Skip to content

Commit 336fb17

Browse files
committed
Merge branch 'master' of https://github.com/firebase/firebase-js-sdk into ida-size-analysis-phase-2
2 parents 78e15a4 + 8d3aca7 commit 336fb17

Some content is hidden

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

58 files changed

+709
-483
lines changed

.github/workflows/lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint All Packages
2+
3+
on: push
4+
5+
jobs:
6+
test:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Node (10)
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 10.x
16+
- name: yarn install
17+
run: yarn
18+
- name: yarn lint
19+
run: yarn lint

.github/workflows/test-all.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ jobs:
2323
yarn
2424
- name: yarn build
2525
run: yarn build
26+
- name: Set start timestamp env var
27+
run: echo "::set-env name=FIREBASE_CI_TEST_START_TIME::$(date +%s)"
2628
- name: Run unit tests
27-
run: xvfb-run yarn test:ci
29+
run: |
30+
xvfb-run yarn test:ci
31+
node scripts/print_test_logs.js
2832
- name: Generate coverage file
2933
run: yarn ci:coverage
3034
- name: Run coverage

integration/browserify/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"pretest": "mkdirp dist && browserify src/namespace.test.js -o dist/namespace.test.js",
77
"test": "karma start --single-run",
8-
"test:ci": "node ../../scripts/run_tests_in_ci.js"
8+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
99
},
1010
"devDependencies": {
1111
"firebase": "7.18.0",

integration/firebase-typings/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.2.1",
55
"scripts": {
66
"test": "tsc",
7-
"test:ci": "node ../../scripts/run_tests_in_ci.js"
7+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
1010
"firebase": "7.18.0",

integration/firestore/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build:persistence": "INCLUDE_FIRESTORE_PERSISTENCE=true gulp compile-tests",
88
"build:memory": "INCLUDE_FIRESTORE_PERSISTENCE=false gulp compile-tests",
99
"test": "yarn build:memory; karma start --single-run; yarn build:persistence; karma start --single-run;",
10-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
10+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test",
1111
"test:persistence": " yarn build:persistence; karma start --single-run",
1212
"test:persistence:debug:": "yarn build:persistence; karma start --auto-watch --browsers Chrome",
1313
"test:memory": "yarn build:memory; karma start --single-run",

integration/typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.2.1",
55
"scripts": {
66
"test": "karma start --single-run",
7-
"test:ci": "node ../../scripts/run_tests_in_ci.js"
7+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
1010
"firebase": "7.18.0",

integration/webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"pretest": "webpack",
77
"test": "karma start --single-run",
8-
"test:ci": "node ../../scripts/run_tests_in_ci.js"
8+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
99
},
1010
"devDependencies": {
1111
"firebase": "7.18.0",

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
"release": "ts-node-script scripts/release/cli.ts",
3333
"pretest": "node tools/pretest.js",
3434
"test": "lerna run --concurrency 4 --stream test",
35-
"test:ci": "lerna run --concurrency 4 --stream test:ci",
36-
"test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp --stream test:ci",
37-
"test:exp": "lerna run --concurrency 4 --stream --scope @firebase/*-exp --scope firebase-exp test",
35+
"test:ci": "lerna run --concurrency 4 test:ci",
36+
"test:release": "lerna run --concurrency 4 --ignore @firebase/*-exp --ignore firebase-exp test:ci",
37+
"test:exp": "lerna run --concurrency 4 --scope @firebase/*-exp --scope firebase-exp --stream test",
3838
"pretest:coverage": "mkdirp coverage",
3939
"ci:coverage": "lcov-result-merger 'packages/**/lcov.info' 'lcov-all.info'",
4040
"test:coverage": "lcov-result-merger 'packages/**/lcov.info' | coveralls",

packages-exp/app-exp/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public",
1717
"build:deps": "lerna run --scope @firebase/app-exp --include-dependencies build",
1818
"dev": "rollup -c -w",
19-
"test": "yarn type-check && run-p lint test:browser test:node",
20-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
19+
"test": "run-p lint test:all",
20+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
21+
"test:all": "run-p test:browser test:node",
2122
"test:browser": "karma start --single-run",
2223
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js",
23-
"type-check": "tsc -p . --noEmit",
2424
"prepare": "rollup -c rollup.config.release.js && yarn api-report",
2525
"api-report": "api-extractor run --local --verbose",
2626
"predoc": "node ../../scripts/exp/remove-exp.js temp",

packages-exp/functions-exp/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"build:deps": "lerna run --scope @firebase/functions-exp --include-dependencies build",
1717
"build:release": "rollup -c rollup.config.release.js && yarn api-report",
1818
"dev": "rollup -c -w",
19-
"test": "yarn type-check && run-p lint test:browser test:node",
20-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
21-
"type-check": "tsc -p . --noEmit",
19+
"test": "run-p lint test:all",
20+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
21+
"test:all": "run-p test:browser test:node",
2222
"test:browser": "karma start --single-run",
2323
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
2424
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",

packages/analytics/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1212
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1313
"build": "rollup -c",
14-
"build:deps": "lerna run --scope @firebase/'{app,analytics}' --include-dependencies build",
14+
"build:deps": "lerna run --scope @firebase/analytics --include-dependencies build",
1515
"dev": "rollup -c -w",
16-
"test": "yarn type-check && yarn run-p lint test:browser",
17-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
16+
"test": "run-p lint test:browser",
17+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
1818
"test:browser": "karma start --single-run --nocache",
19-
"type-check": "tsc -p . --noEmit",
2019
"prepare": "yarn build"
2120
},
2221
"peerDependencies": {
@@ -33,6 +32,7 @@
3332
},
3433
"license": "Apache-2.0",
3534
"devDependencies": {
35+
"@firebase/app": "0.6.10",
3636
"rollup": "2.23.0",
3737
"rollup-plugin-commonjs": "10.1.0",
3838
"rollup-plugin-json": "4.0.0",

packages/app/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"build": "rollup -c",
1818
"build:deps": "lerna run --scope @firebase/app --include-dependencies build",
1919
"dev": "rollup -c -w",
20-
"test": "yarn type-check && run-p lint test:browser test:node",
21-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
22-
"type-check": "tsc -p . --noEmit",
20+
"test": "run-p lint test:all",
21+
"test:all": "run-p test:browser test:node",
22+
"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",
2525
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js",

packages/component/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"build": "rollup -c",
1515
"build:deps": "lerna run --scope @firebase/component --include-dependencies build",
1616
"dev": "rollup -c -w",
17-
"test": "yarn type-check && run-p lint test:browser test:node",
18-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
19-
"type-check": "tsc -p . --noEmit",
17+
"test": "run-p lint test:all",
18+
"test:all": "run-p test:browser test:node",
19+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
2020
"test:browser": "karma start --single-run",
2121
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js",
2222
"prepare": "yarn build"

packages/database/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build:deps": "lerna run --scope @firebase/'{app,database}' --include-dependencies build",
1616
"dev": "rollup -c -w",
1717
"test": "run-p lint test:emulator",
18-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
18+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator",
1919
"test:all": "run-p lint test:browser test:node",
2020
"test:browser": "karma start --single-run",
2121
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file index.node.ts --config ../../config/mocharc.node.js",

packages/firestore/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "run-p 'bundle rollup.config.browser.js' 'bundle rollup.config.browser.memory.js' 'bundle rollup.config.node.js' 'bundle rollup.config.node.memory.js' 'bundle rollup.config.rn.js' 'bundle rollup.config.rn.memory.js' build:lite build:exp",
1212
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
1313
"build:release": "run-p 'bundle rollup.config.browser.js' 'bundle rollup.config.browser.memory.js' 'bundle rollup.config.node.js' 'bundle rollup.config.node.memory.js' 'bundle rollup.config.rn.js' 'bundle rollup.config.rn.memory.js'",
14-
"build:deps": "lerna run --scope @firebase/'{app,firestore}' --include-dependencies build",
14+
"build:deps": "lerna run --scope @firebase/firestore --include-dependencies build",
1515
"build:console": "node tools/console.build.js",
1616
"build:exp": "rollup -c rollup.config.exp.js",
1717
"build:lite": "rollup -c rollup.config.lite.js",
@@ -36,7 +36,7 @@
3636
"test:exp:browser": "karma start --single-run --exp",
3737
"test:exp:browser:debug": "karma start --single-run --exp --auto-watch",
3838
"test": "run-s lint test:all",
39-
"test:ci": "node ../../scripts/run_tests_in_ci.js",
39+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
4040
"test:all": "run-p test:browser test:lite:browser test:exp:browser test:travis test:minified",
4141
"test:browser": "karma start --single-run",
4242
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
@@ -75,6 +75,7 @@
7575
"@firebase/app-types": "0.x"
7676
},
7777
"devDependencies": {
78+
"@firebase/app": "0.6.10",
7879
"@rollup/plugin-alias": "3.1.1",
7980
"@types/json-stable-stringify": "1.0.32",
8081
"json-stable-stringify": "1.0.1",

packages/firestore/rollup.config.browser.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,27 @@ export default [
2828
sourcemap: true
2929
},
3030
plugins: util.es2017Plugins('browser', /* mangled= */ true),
31-
external: util.resolveBrowserExterns
31+
external: util.resolveBrowserExterns,
32+
treeshake: {
33+
moduleSideEffects: false
34+
}
3235
},
3336
{
3437
input: pkg.esm2017,
3538
output: { file: pkg.module, format: 'es', sourcemap: true },
3639
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
37-
external: util.resolveBrowserExterns
40+
external: util.resolveBrowserExterns,
41+
treeshake: {
42+
moduleSideEffects: false
43+
}
3844
},
3945
{
4046
input: pkg.esm2017,
4147
output: { file: pkg.browser, format: 'cjs', sourcemap: true },
4248
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
43-
external: util.resolveBrowserExterns
49+
external: util.resolveBrowserExterns,
50+
treeshake: {
51+
moduleSideEffects: false
52+
}
4453
}
4554
];

packages/firestore/rollup.config.browser.memory.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default [
2929
sourcemap: true
3030
},
3131
plugins: util.es2017Plugins('browser', /* mangled= */ true),
32-
external: util.resolveBrowserExterns
32+
external: util.resolveBrowserExterns,
33+
treeshake: {
34+
moduleSideEffects: false
35+
}
3336
},
3437
{
3538
input: path.resolve('./memory', memoryPkg['esm2017']),
@@ -39,7 +42,10 @@ export default [
3942
sourcemap: true
4043
},
4144
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
42-
external: util.resolveBrowserExterns
45+
external: util.resolveBrowserExterns,
46+
treeshake: {
47+
moduleSideEffects: false
48+
}
4349
},
4450
{
4551
input: path.resolve('./memory', memoryPkg['esm2017']),
@@ -49,6 +55,9 @@ export default [
4955
sourcemap: true
5056
},
5157
plugins: util.es2017ToEs5Plugins(/* mangled= */ true),
52-
external: util.resolveBrowserExterns
58+
external: util.resolveBrowserExterns,
59+
treeshake: {
60+
moduleSideEffects: false
61+
}
5362
}
5463
];

packages/firestore/rollup.config.node.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ export default [
3939
'process.env.FIRESTORE_PROTO_ROOT': JSON.stringify('src/protos')
4040
})
4141
],
42-
external: util.resolveNodeExterns
42+
external: util.resolveNodeExterns,
43+
treeshake: {
44+
moduleSideEffects: false
45+
}
4346
},
4447
{
4548
input: pkg['main-esm2017'],
4649
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
4750
plugins: util.es2017ToEs5Plugins(),
48-
external: util.resolveNodeExterns
51+
external: util.resolveNodeExterns,
52+
treeshake: {
53+
moduleSideEffects: false
54+
}
4955
}
5056
];

packages/firestore/rollup.config.node.memory.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import * as path from 'path';
1919
import replace from 'rollup-plugin-replace';
20-
import copy from 'rollup-plugin-copy-assets';
2120
import memoryPkg from './memory/package.json';
2221

2322
const util = require('./rollup.shared');
@@ -32,15 +31,14 @@ export default [
3231
},
3332
plugins: [
3433
...util.es2017Plugins('node'),
35-
// Needed as we also use the *.proto files
36-
copy({
37-
assets: ['./src/protos']
38-
}),
3934
replace({
4035
'process.env.FIRESTORE_PROTO_ROOT': JSON.stringify('src/protos')
4136
})
4237
],
43-
external: util.resolveNodeExterns
38+
external: util.resolveNodeExterns,
39+
treeshake: {
40+
moduleSideEffects: false
41+
}
4442
},
4543
{
4644
input: path.resolve('./memory', memoryPkg['main-esm2017']),
@@ -50,6 +48,9 @@ export default [
5048
sourcemap: true
5149
},
5250
plugins: util.es2017ToEs5Plugins(),
53-
external: util.resolveNodeExterns
51+
external: util.resolveNodeExterns,
52+
treeshake: {
53+
moduleSideEffects: false
54+
}
5455
}
5556
];

packages/firestore/rollup.config.rn.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ export default {
2727
sourcemap: true
2828
},
2929
plugins: util.es2017Plugins('rn', /* mangled= */ true),
30-
external: util.resolveBrowserExterns
30+
external: util.resolveBrowserExterns,
31+
treeshake: {
32+
moduleSideEffects: false
33+
}
3134
};

packages/firestore/rollup.config.rn.memory.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ export default {
2828
sourcemap: true
2929
},
3030
plugins: util.es2017Plugins('rn', /* mangled= */ true),
31-
external: util.resolveBrowserExterns
31+
external: util.resolveBrowserExterns,
32+
treeshake: {
33+
moduleSideEffects: false
34+
}
3235
};

0 commit comments

Comments
 (0)