Skip to content

Commit 603cd87

Browse files
authored
Prepare auth-next for merging to master (#3740)
* suppress eslint error * fix type error * make auth-compat depend on app-compat * add release build for auth-exp * revert auth-compat to depend on app * test * don't abort on error for release builds * apply release build to web worker build * Revert "test" This reverts commit 8be511c. * fix lint error
1 parent ced51d0 commit 603cd87

File tree

14 files changed

+233
-160
lines changed

14 files changed

+233
-160
lines changed

packages-exp/auth-compat-exp/package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@7 and prior versions",
66
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
77
"main": "dist/index.node.cjs.js",
8-
"browser": "dist/index.cjs.js",
8+
"browser": "dist/index.esm.js",
99
"module": "dist/index.esm.js",
1010
"esm2017": "dist/index.esm2017.js",
1111
"files": [
@@ -15,28 +15,30 @@
1515
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1616
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1717
"build": "rollup -c",
18-
"build:deps": "lerna run --scope @firebase/'{app,auth-exp}' --include-dependencies build",
18+
"build:deps": "lerna run --scope @firebase/auth-compat --include-dependencies build",
1919
"dev": "rollup -c -w",
20-
"test": "yarn type-check && run-p lint test:browser test:node",
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",
2123
"test:browser": "karma start --single-run",
2224
"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",
2425
"prepare": "yarn build"
2526
},
2627
"peerDependencies": {
27-
"@firebase/app": "0.x"
28+
"@firebase/app": "0.x",
29+
"@firebase/app-types": "0.x"
2830
},
2931
"dependencies": {
3032
"@firebase/auth-types": "0.10.1",
3133
"@firebase/auth-exp": "0.0.800",
3234
"@firebase/auth-types-exp": "0.0.800",
33-
"@firebase/component": "0.1.18",
34-
"@firebase/installations": "0.4.16",
35+
"@firebase/component": "0.1.18",
3536
"@firebase/util": "0.3.0",
3637
"tslib": "^1.11.1"
3738
},
3839
"license": "Apache-2.0",
3940
"devDependencies": {
41+
"@firebase/app": "0.6.10",
4042
"rollup": "2.23.0",
4143
"rollup-plugin-json": "4.0.0",
4244
"rollup-plugin-replace": "2.2.0",
@@ -57,4 +59,4 @@
5759
],
5860
"reportDir": "./coverage/node"
5961
}
60-
}
62+
}

packages-exp/auth-compat-exp/rollup.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ import typescriptPlugin from 'rollup-plugin-typescript2';
2222
import typescript from 'typescript';
2323
import pkg from './package.json';
2424

25-
const deps = [
26-
'@firebase/app',
27-
'@firebase/component',
28-
'@firebase/installations'
29-
];
25+
const deps = Object.keys(
26+
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
27+
);
3028

3129
/**
3230
* Common plugins for all builds
@@ -49,10 +47,7 @@ const es5Builds = [
4947
*/
5048
{
5149
input: 'index.ts',
52-
output: [
53-
{ file: pkg.browser, format: 'cjs', sourcemap: true },
54-
{ file: pkg.module, format: 'esm', sourcemap: true }
55-
],
50+
output: [{ file: pkg.module, format: 'esm', sourcemap: true }],
5651
plugins: es5BuildPlugins,
5752
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
5853
},

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import '@firebase/installations';
19-
2018
import { FirebaseApp } from '@firebase/app-types';
2119
import * as impl from '@firebase/auth-exp/internal';
2220
import * as compat from '@firebase/auth-types';

packages-exp/auth-compat-exp/src/recaptcha_verifier.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ export class RecaptchaVerifier
3333
impl.assertFn(app.options?.apiKey, impl.AuthErrorCode.INVALID_API_KEY, {
3434
appName: app.name
3535
});
36-
super(container, parameters, (app.auth!() as unknown) as externs.Auth);
36+
super(
37+
container,
38+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
39+
parameters as any,
40+
(app.auth!() as unknown) as externs.Auth
41+
);
3742
}
3843
}

packages-exp/auth-compat-exp/src/user.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import * as impl from '@firebase/auth-exp/internal';
1919
import * as compat from '@firebase/auth-types';
2020
import * as externs from '@firebase/auth-types-exp';
21-
import '@firebase/installations';
2221
import {
2322
convertConfirmationResult,
2423
convertCredential

packages-exp/auth-compat-exp/src/user_credential.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import * as impl from '@firebase/auth-exp/internal';
1919
import * as compat from '@firebase/auth-types';
2020
import * as externs from '@firebase/auth-types-exp';
21-
import '@firebase/installations';
2221
import { User } from './user';
2322

2423
function credentialFromResponse(

packages-exp/auth-exp/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,18 @@
1818
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1919
"build": "rollup -c",
2020
"build:deps": "lerna run --scope @firebase/auth-exp --include-dependencies build",
21-
"build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public",
21+
"build:release": "rollup -c rollup.config.release.js",
2222
"dev": "rollup -c -w",
23-
"test": "yarn type-check && run-p lint test:browser test:node",
23+
"test": "run-p lint test:all",
24+
"test:all": "run-p test:browser test:node",
25+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
2426
"test:browser": "karma start --single-run",
2527
"test:browser:unit": "karma start --single-run --unit",
2628
"test:browser:integration": "karma start --single-run --integration",
2729
"test:browser:debug": "karma start --auto-watch",
2830
"test:browser:unit:debug": "karma start --auto-watch --unit",
2931
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/!(platform_browser|platform_react_native)/**/*.test.ts' --file index.node.ts --config ../../config/mocharc.node.js",
30-
"type-check": "tsc -p . --noEmit",
31-
"prepare": "yarn build",
32-
"typings:public": "node ./use_typings.js --public",
33-
"typings:internal": "node ./use_typings.js"
32+
"prepare": "rollup -c rollup.config.release.js"
3433
},
3534
"peerDependencies": {
3635
"@firebase/app-exp": "0.x",

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

Lines changed: 2 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -15,134 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import strip from '@rollup/plugin-strip';
19-
import typescriptPlugin from 'rollup-plugin-typescript2';
20-
import json from 'rollup-plugin-json';
21-
import typescript from 'typescript';
22-
import pkg from './package.json';
18+
import { getConfig } from './rollup.config.shared';
2319

24-
const deps = Object.keys(
25-
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
26-
);
27-
28-
/**
29-
* Common plugins for all builds
30-
*/
31-
const commonPlugins = [
32-
json(),
33-
strip({
34-
functions: ['debugAssert.*']
35-
})
36-
];
37-
38-
/**
39-
* ES5 Builds
40-
*/
41-
const es5BuildPlugins = [
42-
...commonPlugins,
43-
typescriptPlugin({
44-
typescript
45-
})
46-
];
47-
48-
const es5Builds = [
49-
/**
50-
* Browser Builds
51-
*/
52-
{
53-
input: {
54-
index: 'index.ts',
55-
internal: 'internal/index.ts'
56-
},
57-
output: [{ dir: 'dist/esm5', format: 'esm', sourcemap: true }],
58-
plugins: es5BuildPlugins,
59-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
60-
},
61-
/**
62-
* Web Worker Build (compiled without DOM)
63-
*/
64-
{
65-
input: 'index.webworker.ts',
66-
output: [{ file: pkg.webworker, format: 'es', sourcemap: true }],
67-
plugins: [
68-
...commonPlugins,
69-
typescriptPlugin({
70-
typescript,
71-
tsconfigOverride: {
72-
compilerOptions: {
73-
lib: [
74-
// Remove dom after we figure out why navigator stuff doesn't exist
75-
'dom',
76-
'es2015',
77-
'webworker'
78-
]
79-
}
80-
}
81-
})
82-
],
83-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
84-
},
85-
/**
86-
* Node.js Build
87-
*/
88-
{
89-
input: {
90-
index: 'index.node.ts',
91-
internal: 'internal/index.ts'
92-
},
93-
output: [{ dir: 'dist/node', format: 'cjs', sourcemap: true }],
94-
plugins: es5BuildPlugins,
95-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
96-
},
97-
/**
98-
* React Native Builds
99-
*/
100-
{
101-
input: {
102-
index: 'index.rn.ts',
103-
internal: 'internal/index.ts'
104-
},
105-
output: [{ dir: 'dist/rn', format: 'cjs', sourcemap: true }],
106-
plugins: es5BuildPlugins,
107-
external: id =>
108-
[...deps, 'react-native'].some(
109-
dep => id === dep || id.startsWith(`${dep}/`)
110-
)
111-
}
112-
];
113-
114-
/**
115-
* ES2017 Builds
116-
*/
117-
const es2017BuildPlugins = [
118-
...commonPlugins,
119-
typescriptPlugin({
120-
typescript,
121-
tsconfigOverride: {
122-
compilerOptions: {
123-
target: 'es2017'
124-
}
125-
}
126-
})
127-
];
128-
129-
const es2017Builds = [
130-
/**
131-
* Browser Builds
132-
*/
133-
{
134-
input: {
135-
index: 'index.ts',
136-
internal: 'internal/index.ts'
137-
},
138-
output: {
139-
dir: 'dist/esm2017',
140-
format: 'es',
141-
sourcemap: true
142-
},
143-
plugins: es2017BuildPlugins,
144-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
145-
}
146-
];
147-
148-
export default [...es5Builds, ...es2017Builds];
20+
export default getConfig({ isReleaseBuild: false });
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 { getConfig } from './rollup.config.shared';
19+
20+
export default getConfig({ isReleaseBuild: true });

0 commit comments

Comments
 (0)