Skip to content

Commit e87a19a

Browse files
committed
build rc exp
1 parent 0e32757 commit e87a19a

File tree

7 files changed

+201
-38
lines changed

7 files changed

+201
-38
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## API Report File for "@firebase/remote-config-exp"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import { FirebaseApp } from '@firebase/app-types-exp';
8+
import { LogLevel } from '@firebase/remote-config-types-exp';
9+
import { RemoteConfig } from '@firebase/remote-config-types-exp';
10+
import { Value } from '@firebase/remote-config-types-exp';
11+
12+
// @public (undocumented)
13+
export function activate(remoteConfig: RemoteConfig): Promise<boolean>;
14+
15+
// @public (undocumented)
16+
export function ensureInitialized(remoteConfig: RemoteConfig): Promise<void>;
17+
18+
// @public (undocumented)
19+
export function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean>;
20+
21+
// @public (undocumented)
22+
export function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
23+
24+
// @public (undocumented)
25+
export function getAll(remoteConfig: RemoteConfig): Record<string, Value>;
26+
27+
// @public (undocumented)
28+
export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean;
29+
30+
// @public (undocumented)
31+
export function getNumber(remoteConfig: RemoteConfig, key: string): number;
32+
33+
// @public (undocumented)
34+
export function getRemoteConfig(app: FirebaseApp): RemoteConfig;
35+
36+
// @public (undocumented)
37+
export function getString(remoteConfig: RemoteConfig, key: string): string;
38+
39+
// @public (undocumented)
40+
export function getValue(remoteConfig: RemoteConfig, key: string): Value;
41+
42+
// @public (undocumented)
43+
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
44+
45+
46+
// (No @packageDocumentation comment for this package)
47+
48+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
}
8+
}

packages-exp/remote-config-exp/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@
1212
"scripts": {
1313
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1414
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
15-
"build": "rollup -c",
16-
"build:deps": "lerna run --scope @firebase/remote-config --include-dependencies build",
15+
"build": "rollup -c && yarn api-report",
16+
"build:deps": "lerna run --scope @firebase/remote-config-exp --include-dependencies build",
17+
"build:release": "rollup -c rollup.config.release.js && yarn api-report",
1718
"dev": "rollup -c -w",
1819
"test": "run-p lint test:browser",
1920
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
2021
"test:browser": "karma start --single-run",
2122
"test:debug": "karma start --browsers=Chrome --auto-watch",
2223
"prettier": "prettier --write '{src,test}/**/*.{js,ts}'",
23-
"prepare": "yarn build"
24+
"prepare": "yarn build",
25+
"api-report": "api-extractor run --local --verbose",
26+
"predoc": "node ../../scripts/exp/remove-exp.js temp",
27+
"doc": "api-documenter markdown --input temp --output docs",
28+
"build:doc": "yarn build && yarn doc"
2429
},
2530
"peerDependencies": {
2631
"@firebase/app-exp": "0.x",
@@ -49,7 +54,7 @@
4954
"bugs": {
5055
"url": "https://github.com/firebase/firebase-js-sdk/issues"
5156
},
52-
"typings": "dist/index.d.ts",
57+
"typings": "dist/remote-config-exp.d.ts",
5358
"nyc": {
5459
"extension": [
5560
".ts"

packages-exp/remote-config-exp/rollup.config.js

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
import json from '@rollup/plugin-json'; // Enables package.json import in TypeScript.
1919
import typescriptPlugin from 'rollup-plugin-typescript2';
2020
import typescript from 'typescript';
21-
import pkg from './package.json';
22-
23-
const deps = Object.keys(
24-
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
25-
);
21+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
2622

2723
/**
2824
* ES5 Builds
@@ -34,20 +30,10 @@ const es5BuildPlugins = [
3430
json()
3531
];
3632

37-
const es5Builds = [
38-
/**
39-
* Browser Builds
40-
*/
41-
{
42-
input: 'index.ts',
43-
output: [
44-
{ file: pkg.main, format: 'cjs', sourcemap: true },
45-
{ file: pkg.module, format: 'es', sourcemap: true }
46-
],
47-
plugins: es5BuildPlugins,
48-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
49-
}
50-
];
33+
const es5Builds = es5BuildsNoPlugin.map(build => ({
34+
...build,
35+
plugins: es5BuildPlugins
36+
}));
5137

5238
/**
5339
* ES2017 Builds
@@ -64,20 +50,9 @@ const es2017BuildPlugins = [
6450
json({ preferConst: true })
6551
];
6652

67-
const es2017Builds = [
68-
/**
69-
* Browser Builds
70-
*/
71-
{
72-
input: 'index.ts',
73-
output: {
74-
file: pkg.esm2017,
75-
format: 'es',
76-
sourcemap: true
77-
},
78-
plugins: es2017BuildPlugins,
79-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
80-
}
81-
];
53+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
54+
...build,
55+
plugins: es2017BuildPlugins
56+
}));
8257

8358
export default [...es5Builds, ...es2017Builds];
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import typescriptPlugin from 'rollup-plugin-typescript2';
19+
import typescript from 'typescript';
20+
import json from '@rollup/plugin-json';
21+
import { importPathTransformer } from '../../scripts/exp/ts-transform-import-path';
22+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
23+
24+
/**
25+
* ES5 Builds
26+
*/
27+
const es5BuildPlugins = [
28+
typescriptPlugin({
29+
typescript,
30+
clean: true,
31+
abortOnError: false,
32+
transformers: [importPathTransformer]
33+
}),
34+
json()
35+
];
36+
37+
const es5Builds = es5BuildsNoPlugin.map(build => ({
38+
...build,
39+
plugins: es5BuildPlugins,
40+
treeshake: {
41+
moduleSideEffects: false
42+
}
43+
}));
44+
45+
/**
46+
* ES2017 Builds
47+
*/
48+
const es2017BuildPlugins = [
49+
typescriptPlugin({
50+
typescript,
51+
tsconfigOverride: {
52+
compilerOptions: {
53+
target: 'es2017'
54+
}
55+
},
56+
abortOnError: false,
57+
clean: true,
58+
transformers: [importPathTransformer]
59+
}),
60+
json({
61+
preferConst: true
62+
})
63+
];
64+
65+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
66+
...build,
67+
plugins: es2017BuildPlugins,
68+
treeshake: {
69+
moduleSideEffects: false
70+
}
71+
}));
72+
73+
export default [...es5Builds, ...es2017Builds];
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* @license
3+
* Copyright 2018 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
import pkg from './package.json';
18+
19+
const deps = Object.keys(
20+
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
21+
);
22+
23+
export const es5BuildsNoPlugin = [
24+
/**
25+
* Browser Builds
26+
*/
27+
{
28+
input: 'src/index.ts',
29+
output: [
30+
{ file: pkg.main, format: 'cjs', sourcemap: true },
31+
{ file: pkg.module, format: 'es', sourcemap: true }
32+
],
33+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
34+
}
35+
];
36+
37+
/**
38+
* ES2017 Builds
39+
*/
40+
export const es2017BuildsNoPlugin = [
41+
{
42+
/**
43+
* Browser Build
44+
*/
45+
input: 'src/index.ts',
46+
output: {
47+
file: pkg.esm2017,
48+
format: 'es',
49+
sourcemap: true
50+
},
51+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
52+
}
53+
];

packages-exp/remote-config-exp/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18+
import '@firebase/installations-exp';
1819
import { registerRemoteConfig } from './register';
1920

2021
// Facilitates debugging by enabling settings changes without rebuilding asset.

0 commit comments

Comments
 (0)