Skip to content

Commit ba77732

Browse files
committed
build remote config compat
1 parent 1a6ee4b commit ba77732

File tree

5 files changed

+123
-35
lines changed

5 files changed

+123
-35
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1414
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1515
"build": "rollup -c",
16-
"build:release": "yarn build",
16+
"build:release": "rollup -c rollup.config.release.js",
1717
"build:deps": "lerna run --scope @firebase/remote-config-compat --include-dependencies build",
1818
"dev": "rollup -c -w",
1919
"test": "run-p lint test:all",

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

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,7 @@
1818
import typescriptPlugin from 'rollup-plugin-typescript2';
1919
import typescript from 'typescript';
2020
import json from '@rollup/plugin-json';
21-
import pkg from './package.json';
22-
23-
const deps = Object.keys(
24-
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
25-
);
26-
27-
export const es5BuildsNoPlugin = [
28-
/**
29-
* Browser Builds
30-
*/
31-
{
32-
input: 'src/index.ts',
33-
output: [
34-
{ file: pkg.main, format: 'cjs', sourcemap: true },
35-
{ file: pkg.browser, format: 'es', sourcemap: true }
36-
],
37-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
38-
}
39-
];
40-
41-
export const es2017BuildsNoPlugin = [
42-
/**
43-
* Browser Builds
44-
*/
45-
{
46-
input: 'src/index.ts',
47-
output: {
48-
file: pkg.esm2017,
49-
format: 'es',
50-
sourcemap: true
51-
},
52-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
53-
}
54-
];
21+
import { es5BuildsNoPlugin, es2017BuildsNoPlugin } from './rollup.shared.js';
5522

5623
/**
5724
* ES5 Builds
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
import typescriptPlugin from 'rollup-plugin-typescript2';
19+
import typescript from 'typescript';
20+
import json from '@rollup/plugin-json';
21+
import { es5BuildsNoPlugin, es2017BuildsNoPlugin } from './rollup.shared.js';
22+
import { importPathTransformer } from '../../scripts/exp/ts-transform-import-path';
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+
}));
41+
42+
/**
43+
* ES2017 Builds
44+
*/
45+
const es2017BuildPlugins = [
46+
typescriptPlugin({
47+
typescript,
48+
tsconfigOverride: {
49+
compilerOptions: {
50+
target: 'es2017'
51+
}
52+
},
53+
clean: true,
54+
abortOnError: false,
55+
transformers: [importPathTransformer]
56+
}),
57+
json({
58+
preferConst: true
59+
})
60+
];
61+
62+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
63+
...build,
64+
plugins: es2017BuildPlugins
65+
}));
66+
67+
export default [...es5Builds, ...es2017Builds];
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 pkg from './package.json';
19+
20+
const deps = Object.keys(
21+
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
22+
);
23+
24+
export const es5BuildsNoPlugin = [
25+
/**
26+
* Browser Builds
27+
*/
28+
{
29+
input: 'src/index.ts',
30+
output: [
31+
{ file: pkg.main, format: 'cjs', sourcemap: true },
32+
{ file: pkg.browser, format: 'es', sourcemap: true }
33+
],
34+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
35+
}
36+
];
37+
38+
export const es2017BuildsNoPlugin = [
39+
/**
40+
* Browser Builds
41+
*/
42+
{
43+
input: 'src/index.ts',
44+
output: {
45+
file: pkg.esm2017,
46+
format: 'es',
47+
sourcemap: true
48+
},
49+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
50+
}
51+
];

scripts/exp/release.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ async function buildPackages() {
146146
// the same reason above
147147
'@firebase/functions',
148148
'--scope',
149+
// the same reason above
150+
'@firebase/remote-config',
151+
'--scope',
149152
'@firebase/util',
150153
'--scope',
151154
'@firebase/component',

0 commit comments

Comments
 (0)