Skip to content

Commit bb7c5eb

Browse files
authored
Merge f408d8d into 973cdfa
2 parents 973cdfa + f408d8d commit bb7c5eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4103
-4
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,8 @@ packages/installations-types-exp @andirayo @ChaoqunCHEN @firebase/jssdk-global-a
9999

100100
# Perf-Exp Code
101101
packages/performance-exp @alikn @zijianjoy @firebase/jssdk-global-approvers
102-
packages/performance-types-exp @alikn @zijianjoy @firebase/jssdk-global-approvers
102+
packages/performance-types-exp @alikn @zijianjoy @firebase/jssdk-global-approvers
103+
104+
# RC-Exp Code
105+
packages/remote-config-exp @erikeldridge @firebase/jssdk-global-approvers
106+
packages/remote-config-types-exp @erikeldridge @firebase/jssdk-global-approvers
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+
```

config/webpack.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ module.exports = {
7575
}
7676
}
7777
},
78+
/**
79+
* Transform firebase packages to cjs, so they can be stubbed in tests
80+
*/
7881
{
7982
test: /\.js$/,
8083
include: function (modulePath) {
8184
const match = /node_modules\/@firebase.*/.test(modulePath);
82-
if (match) {
83-
console.log('modulePath', modulePath, match);
84-
}
8585
return match;
8686
},
8787
use: {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright 2020 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+
module.exports = {
19+
'extends': '../../config/.eslintrc.js',
20+
'parserOptions': {
21+
project: 'tsconfig.json',
22+
// to make vscode-eslint work with monorepo
23+
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
24+
tsconfigRootDir: __dirname
25+
}
26+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file is left intentionally blank
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# @firebase/remote-config
2+
3+
This is the [Remote Config](https://firebase.google.com/docs/remote-config/) component of the
4+
[Firebase JS SDK](https://www.npmjs.com/package/firebase).
5+
6+
**This package is not intended for direct usage, and should only be used via the officially
7+
supported [firebase](https://www.npmjs.com/package/firebase) package.**
8+
9+
## Contributing
10+
11+
Setup:
12+
13+
1. Run `yarn` in repo root
14+
15+
Format:
16+
17+
1. Run `yarn prettier` in RC package
18+
19+
Unit test:
20+
21+
1. Run `yarn test` in RC package
22+
23+
End-to-end test:
24+
25+
1. Run `yarn build` in RC package
26+
1. Run `yarn build` in Firebase package
27+
1. Open test_app/index.html in a browser
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+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
const karma = require('karma');
19+
const path = require('path');
20+
const karmaBase = require('../../config/karma.base');
21+
22+
const files = [`test/**/*`];
23+
24+
module.exports = function (config) {
25+
const karmaConfig = Object.assign({}, karmaBase, {
26+
// files to load into karma
27+
files: files,
28+
// frameworks to use
29+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
30+
frameworks: ['mocha']
31+
});
32+
33+
config.set(karmaConfig);
34+
};
35+
36+
module.exports.files = files;
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@firebase/remote-config-exp",
3+
"version": "0.0.800",
4+
"description": "The Remote Config package of the Firebase JS SDK",
5+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
6+
"private": true,
7+
"main": "dist/index.cjs.js",
8+
"browser": "dist/index.esm.js",
9+
"module": "dist/index.esm.js",
10+
"esm2017": "dist/index.esm2017.js",
11+
"files": ["dist"],
12+
"scripts": {
13+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
14+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
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",
18+
"dev": "rollup -c -w",
19+
"test": "run-p lint test:browser",
20+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
21+
"test:browser": "karma start --single-run",
22+
"test:debug": "karma start --browsers=Chrome --auto-watch",
23+
"prettier": "prettier --write '{src,test}/**/*.{js,ts}'",
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"
29+
},
30+
"peerDependencies": {
31+
"@firebase/app-exp": "0.x",
32+
"@firebase/app-types-exp": "0.x"
33+
},
34+
"dependencies": {
35+
"@firebase/installations-exp": "0.0.800",
36+
"@firebase/logger": "0.2.6",
37+
"@firebase/remote-config-types-exp": "0.0.800",
38+
"@firebase/util": "0.3.3",
39+
"@firebase/component": "0.1.20",
40+
"tslib": "^1.11.1"
41+
},
42+
"license": "Apache-2.0",
43+
"devDependencies": {
44+
"@firebase/app-exp": "0.0.800",
45+
"rollup": "2.29.0",
46+
"rollup-plugin-typescript2": "0.27.3",
47+
"typescript": "4.0.2"
48+
},
49+
"repository": {
50+
"directory": "packages/remote-config",
51+
"type": "git",
52+
"url": "https://github.com/firebase/firebase-js-sdk.git"
53+
},
54+
"bugs": {
55+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
56+
},
57+
"typings": "dist/remote-config-exp.d.ts",
58+
"nyc": {
59+
"extension": [
60+
".ts"
61+
],
62+
"reportDir": "./coverage/node"
63+
}
64+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 json from '@rollup/plugin-json'; // Enables package.json import in TypeScript.
19+
import typescriptPlugin from 'rollup-plugin-typescript2';
20+
import typescript from 'typescript';
21+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
22+
23+
/**
24+
* ES5 Builds
25+
*/
26+
const es5BuildPlugins = [
27+
typescriptPlugin({
28+
typescript
29+
}),
30+
json()
31+
];
32+
33+
const es5Builds = es5BuildsNoPlugin.map(build => ({
34+
...build,
35+
plugins: es5BuildPlugins
36+
}));
37+
38+
/**
39+
* ES2017 Builds
40+
*/
41+
const es2017BuildPlugins = [
42+
typescriptPlugin({
43+
typescript,
44+
tsconfigOverride: {
45+
compilerOptions: {
46+
target: 'es2017'
47+
}
48+
}
49+
}),
50+
json({ preferConst: true })
51+
];
52+
53+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
54+
...build,
55+
plugins: es2017BuildPlugins
56+
}));
57+
58+
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];

0 commit comments

Comments
 (0)