-
Notifications
You must be signed in to change notification settings - Fork 946
@firebase/app modularization #2836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4d2e6fc
init app-exp
Feiyang1 01aab5c
add new packages
Feiyang1 73bbdbd
remove pkg
Feiyang1 0eedaca
fix import paths
Feiyang1 e077761
make tests pass again
Feiyang1 b6e0647
move exp packages to packages-exp folder
Feiyang1 5ba2322
[AUTOMATED]: Prettier Code Styling
Feiyang1 bd2f2fc
[AUTOMATED]: License Headers
Feiyang1 870b2d4
drop node in file name
Feiyang1 495f684
remove compat code
Feiyang1 c244449
add documentation
Feiyang1 19f906f
add internal submodule
Feiyang1 1643aaa
[AUTOMATED]: Prettier Code Styling
Feiyang1 0910768
[AUTOMATED]: License Headers
Feiyang1 2c40993
update run_changed script to account for packages-exp folder
Feiyang1 4a1d771
fix test
Feiyang1 9f5421b
[AUTOMATED]: Prettier Code Styling
Feiyang1 1d95b7e
[AUTOMATED]: License Headers
Feiyang1 504251c
fix lerna version
Feiyang1 a559278
Implement client logging
Feiyang1 4535e99
[AUTOMATED]: Prettier Code Styling
Feiyang1 49e55b7
fix small things
Feiyang1 fc92041
update readme
Feiyang1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @license | ||
* Copyright 2020 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
module.exports = { | ||
extends: '../../config/.eslintrc.js', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
// to make vscode-eslint work with monorepo | ||
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250 | ||
tsconfigRootDir: __dirname | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# @firebase/app-exp | ||
|
||
This package coordinates the communication between the different Firebase components | ||
|
||
**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.** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@firebase/app-exp/internal", | ||
"main": "../dist/cjs/internal.js", | ||
"browser": "../dist/esm5/internal.js", | ||
"module": "../dist/esm5/internal.js", | ||
"esm2017": "../dist/esm2017/internal.js", | ||
"typings": "../dist/esm5/packages-exp/app-exp/src/internal.d.ts" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @license | ||
* Copyright 2019 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
const karmaBase = require('../../config/karma.base'); | ||
|
||
const files = ['src/**/*.test.ts']; | ||
|
||
module.exports = function(config) { | ||
const karmaConfig = Object.assign({}, karmaBase, { | ||
// files to load into karma | ||
files: files, | ||
preprocessors: { '**/*.ts': ['webpack', 'sourcemap'] }, | ||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['mocha'] | ||
}); | ||
|
||
config.set(karmaConfig); | ||
}; | ||
|
||
module.exports.files = files; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "@firebase/app-exp", | ||
"version": "0.800.0", | ||
"private": true, | ||
"description": "FirebaseApp", | ||
"author": "Firebase <[email protected]> (https://firebase.google.com/)", | ||
"main": "dist/cjs/index.js", | ||
"browser": "dist/esm5/index.js", | ||
"module": "dist/esm5/index.js", | ||
"esm2017": "dist/esm2017/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", | ||
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", | ||
"build": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "yarn type-check && run-p lint test:browser test:node", | ||
"test:browser": "karma start --single-run", | ||
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --opts ../../config/mocha.node.opts", | ||
"type-check": "tsc -p . --noEmit", | ||
"prepare": "yarn build" | ||
}, | ||
"dependencies": { | ||
"@firebase/app-types-exp": "0.800.0", | ||
"@firebase/util": "0.2.43", | ||
"@firebase/logger": "0.2.0", | ||
"@firebase/component": "0.1.8", | ||
"tslib": "1.11.1" | ||
}, | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"rollup": "1.32.1", | ||
"rollup-plugin-json": "4.0.0", | ||
"rollup-plugin-replace": "2.2.0", | ||
"rollup-plugin-typescript2": "0.26.0", | ||
"typescript": "3.8.3" | ||
}, | ||
"repository": { | ||
"directory": "packages-exp/app-exp", | ||
"type": "git", | ||
"url": "https://github.com/firebase/firebase-js-sdk.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/firebase/firebase-js-sdk/issues" | ||
}, | ||
"typings": "dist/esm5/packages-exp/app-exp/src/index.d.ts", | ||
"nyc": { | ||
"extension": [ | ||
".ts" | ||
], | ||
"reportDir": "./coverage/node" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/** | ||
* @license | ||
* Copyright 2019 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import typescriptPlugin from 'rollup-plugin-typescript2'; | ||
import typescript from 'typescript'; | ||
import json from 'rollup-plugin-json'; | ||
import pkg from './package.json'; | ||
|
||
const deps = Object.keys( | ||
Object.assign({}, pkg.peerDependencies, pkg.dependencies) | ||
); | ||
|
||
/** | ||
* ES5 Builds | ||
*/ | ||
const es5BuildPlugins = [ | ||
typescriptPlugin({ | ||
typescript | ||
}), | ||
json() | ||
]; | ||
|
||
const es5Builds = [ | ||
/** | ||
* Browser Builds | ||
*/ | ||
{ | ||
input: { | ||
index: 'src/index.ts', | ||
internal: 'src/internal.ts' | ||
}, | ||
output: [{ dir: 'dist/esm5', format: 'es', sourcemap: true }], | ||
plugins: es5BuildPlugins, | ||
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) | ||
}, | ||
/** | ||
* Node.js Build | ||
*/ | ||
{ | ||
input: { | ||
index: 'src/index.ts', | ||
internal: 'src/internal.ts' | ||
}, | ||
output: [{ dir: 'dist/cjs', format: 'cjs', sourcemap: true }], | ||
plugins: es5BuildPlugins, | ||
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) | ||
} | ||
]; | ||
|
||
/** | ||
* ES2017 Builds | ||
*/ | ||
const es2017BuildPlugins = [ | ||
typescriptPlugin({ | ||
typescript, | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
target: 'es2017' | ||
} | ||
} | ||
}), | ||
json({ | ||
preferConst: true | ||
}) | ||
]; | ||
|
||
const es2017Builds = [ | ||
/** | ||
* Browser Builds | ||
*/ | ||
{ | ||
input: { | ||
index: 'src/index.ts', | ||
internal: 'src/internal.ts' | ||
}, | ||
output: { | ||
dir: 'dist/esm2017', | ||
format: 'es', | ||
sourcemap: true | ||
}, | ||
plugins: es2017BuildPlugins, | ||
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) | ||
} | ||
]; | ||
|
||
export default [...es5Builds, ...es2017Builds]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.