Skip to content

Commit b47675c

Browse files
authored
Merge da1ee81 into d9b599f
2 parents d9b599f + da1ee81 commit b47675c

24 files changed

+695
-0
lines changed
+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+
};
+5
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.**
+27
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();

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

+20
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();
+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;
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
"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+
"build:deps": "lerna run --scope @firebase/'{app,auth-compat-exp}' --include-dependencies build",
19+
"dev": "rollup -c -w",
20+
"test": "yarn type-check && run-p lint test:browser test:node",
21+
"test:browser": "karma start --single-run",
22+
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --opts ../../config/mocha.node.opts",
23+
"type-check": "tsc -p . --noEmit",
24+
"prepare": "yarn build"
25+
},
26+
"peerDependencies": {
27+
"@firebase/app-exp": "0.x",
28+
"@firebase/app-types-exp": "0.x"
29+
},
30+
"dependencies": {
31+
"tslib": "1.11.1"
32+
},
33+
"license": "Apache-2.0",
34+
"devDependencies": {
35+
"rollup": "1.32.1",
36+
"rollup-plugin-json": "4.0.0",
37+
"rollup-plugin-replace": "2.2.0",
38+
"rollup-plugin-typescript2": "0.26.0",
39+
"typescript": "3.8.3"
40+
},
41+
"repository": {
42+
"directory": "packages-exp/auth-compat-exp",
43+
"type": "git",
44+
"url": "https://github.com/firebase/firebase-js-sdk.git"
45+
},
46+
"bugs": {
47+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
48+
},
49+
"typings": "dist/index.d.ts",
50+
"nyc": {
51+
"extension": [
52+
".ts"
53+
],
54+
"reportDir": "./coverage/node"
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
59+
/**
60+
* ES2017 Builds
61+
*/
62+
const es2017BuildPlugins = [
63+
typescriptPlugin({
64+
typescript,
65+
tsconfigOverride: {
66+
compilerOptions: {
67+
target: 'es2017'
68+
}
69+
}
70+
})
71+
];
72+
73+
const es2017Builds = [
74+
/**
75+
* Browser Builds
76+
*/
77+
{
78+
input: 'index.ts',
79+
output: {
80+
file: pkg.esm2017,
81+
format: 'es',
82+
sourcemap: true
83+
},
84+
plugins: es2017BuildPlugins,
85+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
86+
}
87+
];
88+
89+
export default [...es5Builds, ...es2017Builds];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 { expect } from 'chai';
19+
import { testFxn } from '../src';
20+
21+
describe('Simple test', () => {
22+
it('Should skip this test');
23+
it('Should test this fxn', () => {
24+
expect(testFxn()).to.equal(42);
25+
});
26+
it('Should test this async thing', async () => {
27+
// Do some async assertions, you can use `await` syntax if it helps
28+
const val = await Promise.resolve(42);
29+
expect(val).to.equal(42);
30+
});
31+
});
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
export function testFxn(): number {
19+
console.log('hi');
20+
return 42;
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../config/tsconfig.base.json",
3+
"compilerOptions": {
4+
"outDir": "dist"
5+
},
6+
"exclude": [
7+
"dist/**/*"
8+
]
9+
}

packages-exp/auth-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/auth-exp/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @firebase/auth-exp
2+
3+
This is the Firebase Authentication component of the Firebase JS 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.**

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

+27
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();

0 commit comments

Comments
 (0)