Skip to content

Commit 1b33fda

Browse files
authored
Remove private types in app-compat (#5385)
* fix app-compat typings * Create slimy-jobs-wave.md
1 parent 45db2b7 commit 1b33fda

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

.changeset/slimy-jobs-wave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/app-compat": patch
3+
---
4+
5+
Remove private types in app-compat
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "../../config/api-extractor.json",
3+
// Point it to your entry point d.ts file.
4+
"mainEntryPointFilePath": "<projectFolder>/dist/src/index.d.ts",
5+
"dtsRollup": {
6+
"enabled": true,
7+
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
8+
"publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
9+
},
10+
"apiReport": {
11+
/**
12+
* only dts rollup is needed for app-compat
13+
*/
14+
"enabled": false
15+
}
16+
}

packages/app-compat/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@
1414
"scripts": {
1515
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1616
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
17-
"build": "rollup -c",
17+
"build": "rollup -c && yarn api-report",
1818
"build:deps": "lerna run --scope @firebase/app-compat --include-dependencies build",
1919
"dev": "rollup -c -w",
2020
"test": "run-p lint test:all",
2121
"test:all": "run-p test:browser test:node",
2222
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
2323
"test:browser": "karma start --single-run",
2424
"test:browser:debug": "karma start --browsers Chrome --auto-watch",
25-
"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"
25+
"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",
26+
"api-report": "api-extractor run --local --verbose",
27+
"typings:public": "node ../../scripts/exp/use_typings.js ./dist/app-compat-public.d.ts"
2628
},
2729
"license": "Apache-2.0",
2830
"dependencies": {

packages/app-compat/src/firebaseApp.ts

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export interface _FirebaseApp {
5959
/**
6060
* Global context object for a collection of services using
6161
* a shared authentication state.
62+
*
63+
* marked as internal because it references internal types exported from @firebase/app
64+
* @internal
6265
*/
6366
export class FirebaseAppImpl implements Compat<_FirebaseAppExp>, _FirebaseApp {
6467
private container: ComponentContainer;

packages/app-compat/src/public-types.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717
import { LogCallback, LogLevelString, LogOptions } from '@firebase/logger';
18-
import { FirebaseAppImpl, _FirebaseApp } from './firebaseApp';
18+
import { _FirebaseApp } from './firebaseApp';
1919

2020
export interface FirebaseOptions {
2121
apiKey?: string;
@@ -31,6 +31,10 @@ export interface FirebaseOptions {
3131
export interface FirebaseAppConfig {
3232
name?: string;
3333
automaticDataCollectionEnabled?: boolean;
34+
}
35+
36+
interface FirebaseAppContructor {
37+
new (): FirebaseApp;
3438
}
3539

3640
/**
@@ -81,7 +85,7 @@ export interface FirebaseNamespace {
8185
*
8286
* DO NOT call this constuctor directly (use firebase.app() instead).
8387
*/
84-
App: typeof FirebaseAppImpl;
88+
App: FirebaseAppContructor;
8589
};
8690

8791
/**

0 commit comments

Comments
 (0)