Skip to content

Commit

Permalink
Remove private types in app-compat (#5385)
Browse files Browse the repository at this point in the history
* fix app-compat typings

* Create slimy-jobs-wave.md
  • Loading branch information
Feiyang1 authored Aug 30, 2021
1 parent 45db2b7 commit 1b33fda
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-jobs-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/app-compat": patch
---

Remove private types in app-compat
16 changes: 16 additions & 0 deletions packages/app-compat/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../config/api-extractor.json",
// Point it to your entry point d.ts file.
"mainEntryPointFilePath": "<projectFolder>/dist/src/index.d.ts",
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
"publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
},
"apiReport": {
/**
* only dts rollup is needed for app-compat
*/
"enabled": false
}
}
6 changes: 4 additions & 2 deletions packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
"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",
"test:all": "run-p test:browser test:node",
"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": {
Expand Down
3 changes: 3 additions & 0 deletions packages/app-compat/src/firebaseApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions packages/app-compat/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,6 +31,10 @@ export interface FirebaseOptions {
export interface FirebaseAppConfig {
name?: string;
automaticDataCollectionEnabled?: boolean;
}

interface FirebaseAppContructor {
new (): FirebaseApp;
}

/**
Expand Down Expand Up @@ -81,7 +85,7 @@ export interface FirebaseNamespace {
*
* DO NOT call this constuctor directly (use firebase.app() instead).
*/
App: typeof FirebaseAppImpl;
App: FirebaseAppContructor;
};

/**
Expand Down

0 comments on commit 1b33fda

Please sign in to comment.