Skip to content

Commit dff5cce

Browse files
authored
Merge 6c889cb into faf6583
2 parents faf6583 + 6c889cb commit dff5cce

File tree

188 files changed

+18004
-34
lines changed

Some content is hidden

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

188 files changed

+18004
-34
lines changed

common/api-review/dummy-exp.api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## API Report File for "@firebase/dummy-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+
// @public (undocumented)
8+
export function bar(): string;
9+
10+
// @public (undocumented)
11+
export function bar1(): string;
12+
13+
// @public (undocumented)
14+
export function bar2(): string;
15+
16+
// @public (undocumented)
17+
export function foo1(): string;
18+
19+
20+
// (No @packageDocumentation comment for this package)
21+
22+
```

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,13 @@
138138
"typescript": "3.8.3",
139139
"watch": "1.0.2",
140140
"webpack": "4.43.0",
141-
"yargs": "15.3.1"
141+
"yargs": "15.3.1",
142+
"@rollup/plugin-commonjs": "13.0.0",
143+
"@rollup/plugin-node-resolve": "8.1.0"
142144
},
143145
"husky": {
144146
"hooks": {
145147
"pre-commit": "node tools/gitHooks/precommit.js"
146148
}
147149
}
148-
}
150+
}
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @firebase/auth-compat-exp
2+
3+
This is a compatability layer to for the Firebase Authentication SDK
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.**
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @license
3+
* Copyright 2017 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+
/**
19+
* This is the file that people using Node.js will actually import. You should
20+
* only include this file if you have something specific about your
21+
* implementation that mandates having a separate entrypoint. Otherwise you can
22+
* just use index.ts
23+
*/
24+
25+
import { testFxn } from './src';
26+
27+
testFxn();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @license
3+
* Copyright 2017 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+
/**
19+
* This is the file that people using React Native will actually import. You
20+
* should only include this file if you have something specific about your
21+
* implementation that mandates having a separate entrypoint. Otherwise you can
22+
* just use index.ts
23+
*/
24+
25+
import { AsyncStorage } from 'react-native';
26+
import { ReactNativePersistence } from '@firebase/auth-exp/src/core/persistence/react_native';
27+
28+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
29+
const reactNativeLocalPersistence = new ReactNativePersistence(AsyncStorage);

packages-exp/auth-compat-exp/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2017 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 { testFxn } from './src';
19+
20+
testFxn();
Lines changed: 35 additions & 0 deletions
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;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "@firebase/auth-compat-exp",
3+
"version": "0.1.0",
4+
"private": true,
5+
"description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@7 and prior versions",
6+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
7+
"main": "dist/index.node.cjs.js",
8+
"browser": "dist/index.cjs.js",
9+
"module": "dist/index.esm.js",
10+
"esm2017": "dist/index.esm2017.js",
11+
"react-native": "dist/index.rn.cjs.js",
12+
"files": [
13+
"dist"
14+
],
15+
"scripts": {
16+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
17+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
18+
"build": "rollup -c",
19+
"build:deps": "lerna run --scope @firebase/'{app,auth-compat-exp}' --include-dependencies build",
20+
"dev": "rollup -c -w",
21+
"test": "yarn type-check && run-p lint test:browser test:node",
22+
"test:browser": "karma start --single-run",
23+
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --opts ../../config/mocha.node.opts",
24+
"type-check": "tsc -p . --noEmit",
25+
"prepare": "yarn build"
26+
},
27+
"peerDependencies": {
28+
"@firebase/app-exp": "0.x",
29+
"@firebase/app-types-exp": "0.x",
30+
"@firebase/auth-exp": "0.x",
31+
"@firebase/auth-types-exp": "0.x"
32+
},
33+
"dependencies": {
34+
"tslib": "1.11.1"
35+
},
36+
"license": "Apache-2.0",
37+
"devDependencies": {
38+
"rollup": "1.32.1",
39+
"rollup-plugin-json": "4.0.0",
40+
"rollup-plugin-replace": "2.2.0",
41+
"rollup-plugin-typescript2": "0.26.0",
42+
"typescript": "3.8.3"
43+
},
44+
"repository": {
45+
"directory": "packages-exp/auth-compat-exp",
46+
"type": "git",
47+
"url": "https://github.com/firebase/firebase-js-sdk.git"
48+
},
49+
"bugs": {
50+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
51+
},
52+
"typings": "dist/index.d.ts",
53+
"nyc": {
54+
"extension": [
55+
".ts"
56+
],
57+
"reportDir": "./coverage/node"
58+
}
59+
}
Lines changed: 35 additions & 0 deletions
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+
/**
19+
* Basic stub for what is expected from the package 'react-native'.
20+
*
21+
* This should be a subset `@types/react-native` which cannot be installed
22+
* because it has conflicting definitions with typescript/dom. If included in
23+
* deps, yarn will attempt to install this in the root directory of the
24+
* monolithic repository which will then be included in the base `tsconfig.json`
25+
* via `typeroots` and then break every other package in this repo.
26+
*/
27+
28+
declare module 'react-native' {
29+
interface ReactNativeAsyncStorage {
30+
setItem(key: string, value: string): Promise<void>;
31+
getItem(key: string): Promise<string | null>;
32+
removeItem(key: string): Promise<void>;
33+
}
34+
export const AsyncStorage: ReactNativeAsyncStorage;
35+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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 pkg from './package.json';
21+
22+
const deps = Object.keys(
23+
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
24+
);
25+
26+
/**
27+
* ES5 Builds
28+
*/
29+
const es5BuildPlugins = [
30+
typescriptPlugin({
31+
typescript
32+
})
33+
];
34+
35+
const es5Builds = [
36+
/**
37+
* Browser Builds
38+
*/
39+
{
40+
input: 'index.ts',
41+
output: [
42+
{ file: pkg.browser, format: 'cjs', sourcemap: true },
43+
{ file: pkg.module, format: 'es', sourcemap: true }
44+
],
45+
plugins: es5BuildPlugins,
46+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
47+
},
48+
/**
49+
* Node.js Build
50+
*/
51+
{
52+
input: 'index.node.ts',
53+
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
54+
plugins: es5BuildPlugins,
55+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
56+
},
57+
/**
58+
* React Native Builds
59+
*/
60+
{
61+
input: 'index.rn.ts',
62+
output: [{ file: pkg['react-native'], format: 'cjs', sourcemap: true }],
63+
plugins: es5BuildPlugins,
64+
external: id =>
65+
[...deps, 'react-native'].some(
66+
dep => id === dep || id.startsWith(`${dep}/`)
67+
)
68+
}
69+
];
70+
71+
/**
72+
* ES2017 Builds
73+
*/
74+
const es2017BuildPlugins = [
75+
typescriptPlugin({
76+
typescript,
77+
tsconfigOverride: {
78+
compilerOptions: {
79+
target: 'es2017'
80+
}
81+
}
82+
})
83+
];
84+
85+
const es2017Builds = [
86+
/**
87+
* Browser Builds
88+
*/
89+
{
90+
input: 'index.ts',
91+
output: {
92+
file: pkg.esm2017,
93+
format: 'es',
94+
sourcemap: true
95+
},
96+
plugins: es2017BuildPlugins,
97+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
98+
}
99+
];
100+
101+
export default [...es5Builds, ...es2017Builds];

0 commit comments

Comments
 (0)