diff --git a/common/api-review/app-exp.api.md b/common/api-review/app-exp.api.md index bf230efd778..ede3689fc22 100644 --- a/common/api-review/app-exp.api.md +++ b/common/api-review/app-exp.api.md @@ -5,9 +5,9 @@ ```ts import { Component } from '@firebase/component'; -import { FirebaseApp } from '@firebase/app-types-exp'; -import { FirebaseAppConfig } from '@firebase/app-types-exp'; -import { FirebaseOptions } from '@firebase/app-types-exp'; +import { FirebaseApp } from '@firebase/app-types'; +import { FirebaseAppConfig } from '@firebase/app-types'; +import { FirebaseOptions } from '@firebase/app-types'; import { LogCallback } from '@firebase/logger'; import { LogLevelString } from '@firebase/logger'; import { LogOptions } from '@firebase/logger'; @@ -35,6 +35,12 @@ export const _DEFAULT_ENTRY_NAME = "[DEFAULT]"; // @public export function deleteApp(app: FirebaseApp): Promise; +export { FirebaseApp } + +export { FirebaseAppConfig } + +export { FirebaseOptions } + // @public export function getApp(name?: string): FirebaseApp; diff --git a/common/api-review/app-types-exp.api.md b/common/api-review/app-types-exp.api.md index d915bc160e0..54b363e93f1 100644 --- a/common/api-review/app-types-exp.api.md +++ b/common/api-review/app-types-exp.api.md @@ -60,14 +60,14 @@ export interface _FirebaseService { _delete(): Promise; } -// @public (undocumented) -export interface PlatformLoggerService { +// @internal (undocumented) +export interface _PlatformLoggerService { // (undocumented) getPlatformInfoString(): string; } -// @public (undocumented) -export interface VersionService { +// @internal (undocumented) +export interface _VersionService { // (undocumented) library: string; // (undocumented) diff --git a/packages-exp/app-exp/package.json b/packages-exp/app-exp/package.json index 1a130a20f1a..80762a221df 100644 --- a/packages-exp/app-exp/package.json +++ b/packages-exp/app-exp/package.json @@ -25,8 +25,8 @@ "predoc": "node ../../scripts/exp/remove-exp.js temp", "doc": "api-documenter markdown --input temp --output docs", "build:doc": "yarn build && yarn doc", - "typings:public": "node ./use_typings.js --public", - "typings:internal": "node ./use_typings.js" + "typings:public": "node ../../scripts/exp/use_typings.js ./dist/app-exp-public.d.ts", + "typings:internal": "node ../../scripts/exp/use_typings.js ./dist/app-exp.d.ts" }, "dependencies": { "@firebase/app-types-exp": "0.0.900", diff --git a/packages-exp/app-exp/rollup.config.release.js b/packages-exp/app-exp/rollup.config.release.js index 1b5cca8c1fc..ce92982b33d 100644 --- a/packages-exp/app-exp/rollup.config.release.js +++ b/packages-exp/app-exp/rollup.config.release.js @@ -28,6 +28,7 @@ const es5BuildPlugins = [ typescriptPlugin({ typescript, clean: true, + abortOnError: false, transformers: [importPathTransformer] }), json() @@ -53,6 +54,7 @@ const es2017BuildPlugins = [ } }, clean: true, + abortOnError: false, transformers: [importPathTransformer] }), json({ diff --git a/packages-exp/app-exp/src/api.ts b/packages-exp/app-exp/src/api.ts index 064babe8c4e..cc6eea69507 100644 --- a/packages-exp/app-exp/src/api.ts +++ b/packages-exp/app-exp/src/api.ts @@ -303,3 +303,5 @@ export function onLog( export function setLogLevel(logLevel: LogLevelString): void { setLogLevelImpl(logLevel); } + +export { FirebaseApp, FirebaseAppConfig, FirebaseOptions }; diff --git a/packages-exp/app-types-exp/api-extractor.json b/packages-exp/app-types-exp/api-extractor.json index 42f37a88c4b..0ffb2569a4d 100644 --- a/packages-exp/app-types-exp/api-extractor.json +++ b/packages-exp/app-types-exp/api-extractor.json @@ -1,5 +1,10 @@ { "extends": "../../config/api-extractor.json", // Point it to your entry point d.ts file. - "mainEntryPointFilePath": "/index.d.ts" + "mainEntryPointFilePath": "/index.d.ts", + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "/dist/.d.ts", + "publicTrimmedFilePath": "/dist/-public.d.ts" + } } \ No newline at end of file diff --git a/packages-exp/app-types-exp/index.d.ts b/packages-exp/app-types-exp/index.d.ts index d74be71601c..d172f05e94c 100644 --- a/packages-exp/app-types-exp/index.d.ts +++ b/packages-exp/app-types-exp/index.d.ts @@ -98,9 +98,9 @@ export interface FirebaseAppConfig { } /** - * @public + * @internal */ -export interface PlatformLoggerService { +export interface _PlatformLoggerService { getPlatformInfoString(): string; } @@ -116,7 +116,10 @@ export interface _FirebaseService { _delete(): Promise; } -export interface VersionService { +/** + * @internal + */ +export interface _VersionService { library: string; version: string; } @@ -124,7 +127,7 @@ export interface VersionService { declare module '@firebase/component' { interface NameServiceMapping { 'app-exp': FirebaseApp; - 'app-version': VersionService; - 'platform-logger': PlatformLoggerService; + 'app-version': _VersionService; + 'platform-logger': _PlatformLoggerService; } } diff --git a/packages-exp/app-types-exp/package.json b/packages-exp/app-types-exp/package.json index 03c1d353d3f..2799737a0c0 100644 --- a/packages-exp/app-types-exp/package.json +++ b/packages-exp/app-types-exp/package.json @@ -11,7 +11,10 @@ "api-report": "api-extractor run --local --verbose", "predoc": "node ../../scripts/exp/remove-exp.js temp", "doc": "api-documenter markdown --input temp --output docs", - "build:doc": "yarn api-report && yarn doc" + "build:doc": "yarn api-report && yarn doc", + "build:release": "yarn api-report && yarn typings:public", + "typings:public": "node ../../scripts/exp/use_typings.js ./dist/app-types-exp-public.d.ts", + "typings:internal": "node ../../scripts/exp/use_typings.js ./index.d.ts" }, "files": [ "index.d.ts", diff --git a/packages-exp/installations-exp/src/api/delete-installations.ts b/packages-exp/installations-exp/src/api/delete-installations.ts index 5e3d6b21123..c4072a2b1d6 100644 --- a/packages-exp/installations-exp/src/api/delete-installations.ts +++ b/packages-exp/installations-exp/src/api/delete-installations.ts @@ -54,3 +54,5 @@ export async function deleteInstallations( } } } + +export { FirebaseInstallations }; diff --git a/packages-exp/messaging-exp/src/api.ts b/packages-exp/messaging-exp/src/api.ts index 5f23959802d..a1b4f1738fd 100644 --- a/packages-exp/messaging-exp/src/api.ts +++ b/packages-exp/messaging-exp/src/api.ts @@ -126,3 +126,5 @@ export function onBackgroundMessage( ): Unsubscribe { return _onBackgroundMessage(messaging as MessagingService, nextOrObserver); } + +export { FirebaseMessaging, MessagePayload }; diff --git a/packages-exp/messaging-types-exp/index.d.ts b/packages-exp/messaging-types-exp/index.d.ts index 7bd08407fd4..8960b73cf3a 100644 --- a/packages-exp/messaging-types-exp/index.d.ts +++ b/packages-exp/messaging-types-exp/index.d.ts @@ -15,21 +15,29 @@ * limitations under the License. */ -// Currently supported fcm notification display parameters. Note that -// {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications/NotificationOptions} -// defines a full list of display notification parameters. This interface we only include what the -// SEND API support for clarity. +/** + * Currently supported fcm notification display parameters. Note that + * {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/notifications/NotificationOptions} + * defines a full list of display notification parameters. This interface we only include what the + * SEND API support for clarity. + */ export interface NotificationPayload { title?: string; body?: string; image?: string; } +/** + * @public + */ export interface FcmOptions { link?: string; analyticsLabel?: string; } +/** + * @public + */ export interface MessagePayload { notification?: NotificationPayload; data?: { [key: string]: string }; @@ -38,9 +46,15 @@ export interface MessagePayload { collapseKey: string; } +/** + * @public + */ export interface FirebaseMessaging {} -export type FirebaseMessagingName = 'messaging'; +/** + * @internal + */ +export type _FirebaseMessagingName = 'messaging'; declare module '@firebase/component' { interface NameServiceMapping { diff --git a/packages-exp/performance-exp/src/index.ts b/packages-exp/performance-exp/src/index.ts index b976ac9d398..80f8c8f35c8 100644 --- a/packages-exp/performance-exp/src/index.ts +++ b/packages-exp/performance-exp/src/index.ts @@ -97,3 +97,5 @@ function registerPerformance(): void { registerPerformance(); registerVersion(name, version); + +export { FirebasePerformance, PerformanceSettings, PerformanceTrace }; diff --git a/packages-exp/performance-types-exp/index.d.ts b/packages-exp/performance-types-exp/index.d.ts index cf65771a0f1..1e0548276ad 100644 --- a/packages-exp/performance-types-exp/index.d.ts +++ b/packages-exp/performance-types-exp/index.d.ts @@ -26,6 +26,9 @@ export interface PerformanceSettings { instrumentationEnabled?: boolean; } +/** + * @public + */ export interface FirebasePerformance { /** * Controls the logging of automatic traces and HTTP/S network monitoring. @@ -38,6 +41,9 @@ export interface FirebasePerformance { dataCollectionEnabled: boolean; } +/** + * @public + */ export interface PerformanceTrace { /** * Starts the timing for the trace instance. diff --git a/packages-exp/remote-config-exp/src/api.ts b/packages-exp/remote-config-exp/src/api.ts index 466cd9e2d9b..49ce6aa2eda 100644 --- a/packages-exp/remote-config-exp/src/api.ts +++ b/packages-exp/remote-config-exp/src/api.ts @@ -257,3 +257,5 @@ export function setLogLevel( function getAllKeys(obj1: {} = {}, obj2: {} = {}): string[] { return Object.keys({ ...obj1, ...obj2 }); } + +export { RemoteConfig, ValueType, RemoteConfigLogLevel }; diff --git a/packages-exp/app-exp/use_typings.js b/scripts/exp/use_typings.js similarity index 71% rename from packages-exp/app-exp/use_typings.js rename to scripts/exp/use_typings.js index 1a299535a16..8842ef649bd 100644 --- a/packages-exp/app-exp/use_typings.js +++ b/scripts/exp/use_typings.js @@ -16,24 +16,27 @@ * limitations under the License. */ +// NOTE: the script assumes it runs at the root of the package you want to update + const { writeFileSync } = require('fs'); const { argv } = require('yargs'); const path = require('path'); -const packageJsonPath = path.resolve(__dirname, './package.json'); +const packageJsonPath = path.resolve(process.cwd(), './package.json'); -// point typings field to the public d.ts file in package.json -const TYPINGS_PATH = argv.public - ? './dist/app-exp-public.d.ts' - : './dist/app-exp.d.ts'; -console.log( - `Updating the packages-exp/app-exp typings field to the ${ - argv.public ? 'public' : 'internal' - } d.ts file ${TYPINGS_PATH}` -); +// point typings field to supplied path in package.json +const TYPINGS_PATH = argv._[0]; + +if (!TYPINGS_PATH) { + throw Error('Please supply a file path'); +} const packageJson = require(packageJsonPath); packageJson.typings = TYPINGS_PATH; +console.log( + `Pointing the typings field in ${packageJson.name} to ${TYPINGS_PATH}` +); + writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, { encoding: 'utf-8' });