[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide everything into v1, v2, and common (unexported). #1149

Merged
merged 11 commits into from
Jun 27, 2022
Prev Previous commit
Next Next commit
Move apps and utilities into common
  • Loading branch information
inlined committed Jun 26, 2022
commit 97e6526385b45eb54ca465956e72922fda37eca5
2 changes: 1 addition & 1 deletion spec/common/providers/https.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import * as firebase from 'firebase-admin';
import * as sinon from 'sinon';

import { apps as appsNamespace } from '../../../src/apps';
import { apps as appsNamespace } from '../../../src/common/apps';
import * as debug from '../../../src/common/debug';
import * as https from '../../../src/common/providers/https';
import * as mocks from '../../fixtures/credential/key.json';
Expand Down
2 changes: 1 addition & 1 deletion spec/common/providers/tasks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import { expect } from 'chai';
import * as firebase from 'firebase-admin';

import { apps as appsNamespace } from '../../../src/apps';
import { apps as appsNamespace } from '../../../src/common/apps';
import * as https from '../../../src/common/providers/https';
import {
onDispatchHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
import { expect } from 'chai';
import * as pathPattern from '../../src/utilities/path-pattern';
import * as pathPattern from '../../../src/common/utilities/path-pattern';

describe('path-pattern', () => {
describe('trimParam', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import { normalizePath, pathParts } from '../../src/utilities/path';
import { normalizePath, pathParts } from '../../../src/common/utilities/path';

describe('utilities', () => {
describe('path', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/v1/apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// SOFTWARE.

import { expect } from 'chai';
import { apps as appsNamespace } from '../../src/apps';
import { apps as appsNamespace } from '../../src/common/apps';

import * as firebase from 'firebase-admin';
import * as _ from 'lodash';
Expand Down
4 changes: 2 additions & 2 deletions spec/v1/providers/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// SOFTWARE.

import { expect } from 'chai';
import { apps as appsNamespace } from '../../../src/apps';
import { apps as appsNamespace } from '../../../src/common/apps';
import * as config from '../../../src/common/config';
import { applyChange } from '../../../src/utils';
import { applyChange } from '../../../src/common/utilities/utils';
import * as functions from '../../../src/v1';
import * as database from '../../../src/v1/providers/database';

Expand Down
2 changes: 1 addition & 1 deletion spec/v1/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// SOFTWARE.

import { expect } from 'chai';
import { applyChange } from '../../src/utils';
import { applyChange } from '../../src/common/utilities/utils';

describe('utils', () => {
describe('.applyChange(from: any, to: any): any', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/v2/providers/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// SOFTWARE.

import { expect } from 'chai';
import { PathPattern } from '../../../src/utilities/path-pattern';
import { PathPattern } from '../../../src/common/utilities/path-pattern';
import * as database from '../../../src/v2/providers/database';

const RAW_RTDB_EVENT: database.RawRTDBCloudEvent = {
Expand Down
2 changes: 1 addition & 1 deletion src/apps.ts → src/common/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import * as firebase from 'firebase-admin';
import * as _ from 'lodash';
import { firebaseConfig } from './common/config';
import { firebaseConfig } from './config';

export function apps(): apps.Apps {
if (typeof apps.singleton === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion src/common/providers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// SOFTWARE.

import * as firebase from 'firebase-admin';
import { joinPath, pathParts } from '../../utilities/path';
import { joinPath, pathParts } from '../../common/utilities/path';
import { firebaseConfig } from '../config';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/common/providers/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import * as logger from '../../logger';

// TODO(inlined): Decide whether we want to un-version apps or whether we want a
// different strategy
import { apps } from '../../apps';
import { apps } from '../apps';
import { isDebugFeatureEnabled } from '../debug';
import { TaskContext } from './tasks';

Expand Down
2 changes: 1 addition & 1 deletion src/common/providers/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

import * as express from 'express';
import * as firebase from 'firebase-admin';
import { apps } from '../../apps';
import * as logger from '../../logger';
import { EventContext } from '../../v1/cloud-functions';
import { apps } from '../apps';
import { isDebugFeatureEnabled } from '../debug';
import { HttpsError, unsafeDecodeToken } from './https';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/v1/handler-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import * as express from 'express';

import { apps } from '../apps';
import { apps } from '../common/apps';
import { CloudFunction, EventContext, HttpsFunction } from './cloud-functions';
import * as analytics from './providers/analytics';
import * as auth from './providers/auth';
Expand Down
2 changes: 1 addition & 1 deletion src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import * as storage from './providers/storage';
import * as tasks from './providers/tasks';
import * as testLab from './providers/testLab';

import * as apps from '../apps';
import * as apps from '../common/apps';
import * as logger from '../logger';
import { handler } from './handler-builder';

Expand Down
6 changes: 3 additions & 3 deletions src/v1/providers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import { apps } from '../../apps';
import { apps } from '../../common/apps';
import { firebaseConfig } from '../../common/config';
import { DataSnapshot } from '../../common/providers/database';
import { normalizePath } from '../../utilities/path';
import { applyChange } from '../../utils';
import { normalizePath } from '../../common/utilities/path';
import { applyChange } from '../../common/utilities/utils';
import {
Change,
CloudFunction,
Expand Down
4 changes: 2 additions & 2 deletions src/v1/providers/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import * as firebase from 'firebase-admin';
import * as _ from 'lodash';

import { posix } from 'path';
import { apps } from '../../apps';
import { apps } from '../../common/apps';
import { dateToTimestampProto } from '../../common/utilities/encoder';
import * as logger from '../../logger';
import { dateToTimestampProto } from '../../utilities/encoder';
import {
Change,
CloudFunction,
Expand Down
8 changes: 4 additions & 4 deletions src/v2/providers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import { apps } from '../../apps';
import { apps } from '../../common/apps';
import { DataSnapshot } from '../../common/providers/database';
import { normalizePath } from '../../common/utilities/path';
import { PathPattern } from '../../common/utilities/path-pattern';
import { applyChange } from '../../common/utilities/utils';
import { ManifestEndpoint } from '../../runtime/manifest';
import { normalizePath } from '../../utilities/path';
import { PathPattern } from '../../utilities/path-pattern';
import { applyChange } from '../../utils';
import { Change } from '../../v1/cloud-functions';
import { CloudEvent, CloudFunction } from '../core';
import * as options from '../options';
Expand Down