From 2fd05d01d4a3a505b7f1e87feec32c42ec517145 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Thu, 26 Aug 2021 12:24:13 -0700 Subject: [PATCH 1/2] fix app-compat typings --- packages/app-compat/api-extractor.json | 16 ++++++++++++++++ packages/app-compat/package.json | 6 ++++-- packages/app-compat/src/firebaseApp.ts | 3 +++ packages/app-compat/src/public-types.ts | 8 ++++++-- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 packages/app-compat/api-extractor.json diff --git a/packages/app-compat/api-extractor.json b/packages/app-compat/api-extractor.json new file mode 100644 index 00000000000..e5656684172 --- /dev/null +++ b/packages/app-compat/api-extractor.json @@ -0,0 +1,16 @@ +{ + "extends": "../../config/api-extractor.json", + // Point it to your entry point d.ts file. + "mainEntryPointFilePath": "/dist/src/index.d.ts", + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "/dist/.d.ts", + "publicTrimmedFilePath": "/dist/-public.d.ts" + }, + "apiReport": { + /** + * only dts rollup is needed for app-compat + */ + "enabled": false + } +} \ No newline at end of file diff --git a/packages/app-compat/package.json b/packages/app-compat/package.json index cdfd500c5e7..818fa43c45e 100644 --- a/packages/app-compat/package.json +++ b/packages/app-compat/package.json @@ -14,7 +14,7 @@ "scripts": { "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "build": "rollup -c", + "build": "rollup -c && yarn api-report", "build:deps": "lerna run --scope @firebase/app-compat --include-dependencies build", "dev": "rollup -c -w", "test": "run-p lint test:all", @@ -22,7 +22,9 @@ "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all", "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers Chrome --auto-watch", - "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* src/**/*.test.ts --config ../../config/mocharc.node.js" + "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* src/**/*.test.ts --config ../../config/mocharc.node.js", + "api-report": "api-extractor run --local --verbose", + "typings:public": "node ../../scripts/exp/use_typings.js ./dist/app-compat-public.d.ts" }, "license": "Apache-2.0", "dependencies": { diff --git a/packages/app-compat/src/firebaseApp.ts b/packages/app-compat/src/firebaseApp.ts index 8697a4a14ff..8a583bfca79 100644 --- a/packages/app-compat/src/firebaseApp.ts +++ b/packages/app-compat/src/firebaseApp.ts @@ -59,6 +59,9 @@ export interface _FirebaseApp { /** * Global context object for a collection of services using * a shared authentication state. + * + * marked as internal because it references internal types exported from @firebase/app + * @internal */ export class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp { private container: ComponentContainer; diff --git a/packages/app-compat/src/public-types.ts b/packages/app-compat/src/public-types.ts index 37387047b38..5759e6daa99 100644 --- a/packages/app-compat/src/public-types.ts +++ b/packages/app-compat/src/public-types.ts @@ -15,7 +15,7 @@ * limitations under the License. */ import { LogCallback, LogLevelString, LogOptions } from '@firebase/logger'; -import { FirebaseAppImpl, _FirebaseApp } from './firebaseApp'; +import { _FirebaseApp } from './firebaseApp'; export interface FirebaseOptions { apiKey?: string; @@ -31,6 +31,10 @@ export interface FirebaseOptions { export interface FirebaseAppConfig { name?: string; automaticDataCollectionEnabled?: boolean; +} + +interface FirebaseAppContructor { + new (): FirebaseApp; } /** @@ -81,7 +85,7 @@ export interface FirebaseNamespace { * * DO NOT call this constuctor directly (use firebase.app() instead). */ - App: typeof FirebaseAppImpl; + App: FirebaseAppContructor; }; /** From 7a2ca8b0c1223f5f74710bf13d71bc91fa49ecce Mon Sep 17 00:00:00 2001 From: Feiyang Date: Fri, 27 Aug 2021 10:29:50 -0700 Subject: [PATCH 2/2] Create slimy-jobs-wave.md --- .changeset/slimy-jobs-wave.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/slimy-jobs-wave.md diff --git a/.changeset/slimy-jobs-wave.md b/.changeset/slimy-jobs-wave.md new file mode 100644 index 00000000000..0cdbc28693e --- /dev/null +++ b/.changeset/slimy-jobs-wave.md @@ -0,0 +1,5 @@ +--- +"@firebase/app-compat": patch +--- + +Remove private types in app-compat