Skip to content

Commit 59744b1

Browse files
Merge branch 'master' into mrschmidt/splitrollup
2 parents 8926cd1 + d9b599f commit 59744b1

Some content is hidden

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

76 files changed

+2113
-574
lines changed

lerna.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"npmClient": "yarn",
55
"packages": [
66
"packages/*",
7+
"packages-exp/*",
78
"integration/*"
89
],
910
"useWorkspaces": true

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
"scripts": {
2020
"dev": "lerna run --parallel --scope @firebase/* --scope firebase --scope rxfire dev",
2121
"build": "lerna run --scope @firebase/* --scope firebase --scope rxfire prepare",
22+
"build:exp": "lerna run --scope @firebase/*-exp prepare",
2223
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
2324
"stage:packages": "./scripts/prepublish.sh",
2425
"repl": "node tools/repl.js",
2526
"release": "node scripts/release/cli.js",
2627
"pretest": "node tools/pretest.js",
2728
"test": "lerna run --concurrency 4 --stream test",
29+
"test:exp": "lerna run --concurrency 4 --stream --scope @firebase/*-exp test",
2830
"pretest:coverage": "mkdirp coverage",
2931
"ci:coverage": "lcov-result-merger 'packages/**/lcov.info' 'lcov-all.info'",
3032
"test:coverage": "lcov-result-merger 'packages/**/lcov.info' | coveralls",
@@ -45,6 +47,7 @@
4547
},
4648
"workspaces": [
4749
"packages/*",
50+
"packages-exp/*",
4851
"integration/*"
4952
],
5053
"devDependencies": {
@@ -96,6 +99,7 @@
9699
"lcov-result-merger": "3.1.0",
97100
"lerna": "3.20.2",
98101
"listr": "0.14.3",
102+
"lodash": "4.17.15",
99103
"long": "3.2.0",
100104
"merge2": "1.3.0",
101105
"mkdirp": "0.5.3",
@@ -113,16 +117,15 @@
113117
"sinon": "9.0.1",
114118
"sinon-chai": "3.5.0",
115119
"source-map-loader": "0.2.4",
120+
"terser": "4.6.7",
116121
"ts-loader": "6.2.1",
117122
"ts-node": "8.6.2",
118123
"tslint": "6.1.0",
119124
"typedoc": "0.16.11",
120125
"typescript": "3.8.3",
121126
"watch": "1.0.2",
122127
"webpack": "4.42.0",
123-
"yargs": "15.3.1",
124-
"lodash": "4.17.15",
125-
"terser": "4.6.7"
128+
"yargs": "15.3.1"
126129
},
127130
"husky": {
128131
"hooks": {

packages-exp/app-exp/.eslintrc.js

+26
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+
};

packages-exp/app-exp/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @firebase/app-exp
2+
3+
This package coordinates the communication between the different Firebase components
4+
5+
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "@firebase/app-exp/internal",
3+
"main": "../dist/cjs/internal.js",
4+
"browser": "../dist/esm5/internal.js",
5+
"module": "../dist/esm5/internal.js",
6+
"esm2017": "../dist/esm2017/internal.js",
7+
"typings": "../dist/esm5/packages-exp/app-exp/src/internal.d.ts"
8+
}

packages-exp/app-exp/karma.conf.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 karmaBase = require('../../config/karma.base');
19+
20+
const files = ['src/**/*.test.ts'];
21+
22+
module.exports = function(config) {
23+
const karmaConfig = Object.assign({}, karmaBase, {
24+
// files to load into karma
25+
files: files,
26+
preprocessors: { '**/*.ts': ['webpack', 'sourcemap'] },
27+
// frameworks to use
28+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
29+
frameworks: ['mocha']
30+
});
31+
32+
config.set(karmaConfig);
33+
};
34+
35+
module.exports.files = files;

packages-exp/app-exp/package.json

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "@firebase/app-exp",
3+
"version": "0.800.0",
4+
"private": true,
5+
"description": "FirebaseApp",
6+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
7+
"main": "dist/cjs/index.js",
8+
"browser": "dist/esm5/index.js",
9+
"module": "dist/esm5/index.js",
10+
"esm2017": "dist/esm2017/index.js",
11+
"files": [
12+
"dist"
13+
],
14+
"scripts": {
15+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
16+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
17+
"build": "rollup -c",
18+
"dev": "rollup -c -w",
19+
"test": "yarn type-check && run-p lint test:browser test:node",
20+
"test:browser": "karma start --single-run",
21+
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --opts ../../config/mocha.node.opts",
22+
"type-check": "tsc -p . --noEmit",
23+
"prepare": "yarn build"
24+
},
25+
"dependencies": {
26+
"@firebase/app-types-exp": "0.800.0",
27+
"@firebase/util": "0.2.43",
28+
"@firebase/logger": "0.2.0",
29+
"@firebase/component": "0.1.8",
30+
"tslib": "1.11.1"
31+
},
32+
"license": "Apache-2.0",
33+
"devDependencies": {
34+
"rollup": "1.32.1",
35+
"rollup-plugin-json": "4.0.0",
36+
"rollup-plugin-replace": "2.2.0",
37+
"rollup-plugin-typescript2": "0.26.0",
38+
"typescript": "3.8.3"
39+
},
40+
"repository": {
41+
"directory": "packages-exp/app-exp",
42+
"type": "git",
43+
"url": "https://github.com/firebase/firebase-js-sdk.git"
44+
},
45+
"bugs": {
46+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
47+
},
48+
"typings": "dist/esm5/packages-exp/app-exp/src/index.d.ts",
49+
"nyc": {
50+
"extension": [
51+
".ts"
52+
],
53+
"reportDir": "./coverage/node"
54+
}
55+
}

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

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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 pkg from './package.json';
22+
23+
const deps = Object.keys(
24+
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
25+
);
26+
27+
/**
28+
* ES5 Builds
29+
*/
30+
const es5BuildPlugins = [
31+
typescriptPlugin({
32+
typescript
33+
}),
34+
json()
35+
];
36+
37+
const es5Builds = [
38+
/**
39+
* Browser Builds
40+
*/
41+
{
42+
input: {
43+
index: 'src/index.ts',
44+
internal: 'src/internal.ts'
45+
},
46+
output: [{ dir: 'dist/esm5', format: 'es', sourcemap: true }],
47+
plugins: es5BuildPlugins,
48+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
49+
},
50+
/**
51+
* Node.js Build
52+
*/
53+
{
54+
input: {
55+
index: 'src/index.ts',
56+
internal: 'src/internal.ts'
57+
},
58+
output: [{ dir: 'dist/cjs', format: 'cjs', sourcemap: true }],
59+
plugins: es5BuildPlugins,
60+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
61+
}
62+
];
63+
64+
/**
65+
* ES2017 Builds
66+
*/
67+
const es2017BuildPlugins = [
68+
typescriptPlugin({
69+
typescript,
70+
tsconfigOverride: {
71+
compilerOptions: {
72+
target: 'es2017'
73+
}
74+
}
75+
}),
76+
json({
77+
preferConst: true
78+
})
79+
];
80+
81+
const es2017Builds = [
82+
/**
83+
* Browser Builds
84+
*/
85+
{
86+
input: {
87+
index: 'src/index.ts',
88+
internal: 'src/internal.ts'
89+
},
90+
output: {
91+
dir: 'dist/esm2017',
92+
format: 'es',
93+
sourcemap: true
94+
},
95+
plugins: es2017BuildPlugins,
96+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
97+
}
98+
];
99+
100+
export default [...es5Builds, ...es2017Builds];

0 commit comments

Comments
 (0)