Skip to content

Commit e34b4b8

Browse files
Feiyang1sam-gc
authored andcommitted
Auth next build (#3654)
* update package.json * make internal and main share code * remove unused deps and files * point to the right typing file for internal * cast internal Auth to public Auth to make TS happy
1 parent 638219b commit e34b4b8

File tree

15 files changed

+74
-237
lines changed

15 files changed

+74
-237
lines changed

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@firebase/auth-compat-exp",
3-
"version": "0.1.0",
2+
"name": "@firebase/auth-compat",
3+
"version": "0.0.800",
44
"private": true,
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/)",
@@ -24,25 +24,22 @@
2424
"prepare": "yarn build"
2525
},
2626
"peerDependencies": {
27-
"@firebase/app": "0.x",
28-
"@firebase/auth-types": "0.x",
29-
"@firebase/auth-exp": "0.x",
30-
"@firebase/auth-types-exp": "0.x",
31-
"@firebase/component": "0.x",
32-
"@firebase/installations": "0.x",
33-
"@firebase/util": "0.x"
27+
"@firebase/app": "0.x"
3428
},
3529
"dependencies": {
36-
"tslib": "1.11.1"
30+
"@firebase/auth-types": "0.10.1",
31+
"@firebase/auth-exp": "0.0.800",
32+
"@firebase/auth-types-exp": "0.0.800",
33+
"@firebase/component": "0.1.17",
34+
"@firebase/util": "0.3.0",
35+
"tslib": "^1.11.1"
3736
},
3837
"license": "Apache-2.0",
3938
"devDependencies": {
40-
"@firebase/app-exp": "0.x",
41-
"@firebase/auth-exp": "0.x",
42-
"rollup": "1.32.1",
39+
"rollup": "2.23.0",
4340
"rollup-plugin-json": "4.0.0",
4441
"rollup-plugin-replace": "2.2.0",
45-
"rollup-plugin-typescript2": "0.26.0"
42+
"rollup-plugin-typescript2": "0.27.1"
4643
},
4744
"repository": {
4845
"directory": "packages-exp/auth-compat-exp",

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class User extends impl.UserImpl implements compat.User {
4747
credential: compat.AuthCredential
4848
): Promise<compat.UserCredential> {
4949
return convertCredential(
50-
this.auth,
50+
(this.auth as unknown) as externs.Auth,
5151
impl.linkWithCredential(this, credential as externs.AuthCredential)
5252
);
5353
}
@@ -56,15 +56,15 @@ export class User extends impl.UserImpl implements compat.User {
5656
applicationVerifier: compat.ApplicationVerifier
5757
): Promise<compat.ConfirmationResult> {
5858
return convertConfirmationResult(
59-
this.auth,
59+
(this.auth as unknown) as externs.Auth,
6060
impl.linkWithPhoneNumber(this, phoneNumber, applicationVerifier)
6161
);
6262
}
6363
async linkWithPopup(
6464
provider: compat.AuthProvider
6565
): Promise<compat.UserCredential> {
6666
return convertCredential(
67-
this.auth,
67+
(this.auth as unknown) as externs.Auth,
6868
impl.linkWithPopup(
6969
this,
7070
provider as externs.AuthProvider,
@@ -88,7 +88,7 @@ export class User extends impl.UserImpl implements compat.User {
8888
credential: compat.AuthCredential
8989
): Promise<compat.UserCredential> {
9090
return convertCredential(
91-
this.auth,
91+
(this.auth as unknown) as externs.Auth,
9292
impl.reauthenticateWithCredential(
9393
this,
9494
credential as externs.AuthCredential
@@ -100,15 +100,15 @@ export class User extends impl.UserImpl implements compat.User {
100100
applicationVerifier: compat.ApplicationVerifier
101101
): Promise<compat.ConfirmationResult> {
102102
return convertConfirmationResult(
103-
this.auth,
103+
(this.auth as unknown) as externs.Auth,
104104
impl.reauthenticateWithPhoneNumber(this, phoneNumber, applicationVerifier)
105105
);
106106
}
107107
reauthenticateWithPopup(
108108
provider: compat.AuthProvider
109109
): Promise<compat.UserCredential> {
110110
return convertCredential(
111-
this.auth,
111+
(this.auth as unknown) as externs.Auth,
112112
impl.reauthenticateWithPopup(
113113
this,
114114
provider as externs.AuthProvider,

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

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,26 @@
1515
"build:deps": "lerna run --scope @firebase/'{app-exp,auth-exp}' --include-dependencies build",
1616
"dev": "rollup -c -w"
1717
},
18-
"peerDependencies": {
19-
"@firebase/app-exp": "0.x",
20-
"@firebase/app-types-exp": "0.x",
21-
"@firebase/auth-exp": "0.x",
22-
"@firebase/auth-types-exp": "0.x"
23-
},
2418
"dependencies": {
25-
"@firebase/logger": "^0.2.2",
26-
"@firebase/util": "^0.2.44",
27-
"lerna": "^3.22.1",
28-
"tslib": "1.11.1"
19+
"@firebase/app-exp": "0.0.800",
20+
"@firebase/app-types-exp": "0.0.800",
21+
"@firebase/auth-exp": "0.0.800",
22+
"@firebase/auth-types-exp": "0.0.800",
23+
"@firebase/logger": "0.2.6",
24+
"@firebase/util": "0.3.0",
25+
"tslib": "^1.11.1"
2926
},
3027
"license": "Apache-2.0",
3128
"devDependencies": {
32-
"@rollup/plugin-node-resolve": "^8.0.1",
33-
"@rollup/plugin-strip": "^1.3.2",
34-
"rollup": "1.32.1",
29+
"@rollup/plugin-strip": "1.3.2",
30+
"rollup": "2.23.0",
3531
"rollup-plugin-json": "4.0.0",
3632
"rollup-plugin-replace": "2.2.0",
3733
"rollup-plugin-terser": "6.1.0",
38-
"rollup-plugin-typescript2": "0.26.0",
39-
"rollup-plugin-uglify": "6.0.4"
34+
"rollup-plugin-typescript2": "0.27.1",
35+
"rollup-plugin-uglify": "6.0.4",
36+
"rollup-plugin-node-resolve": "5.2.0",
37+
"lerna": "3.22.1"
4038
},
4139
"repository": {
4240
"directory": "packages-exp/auth-exp/demo",
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "@firebase/auth-exp/internal",
33
"description": "An internal version of the Auth SDK for use in the compatibility layer",
4-
"main": "../dist/internal/index.node.cjs.js",
5-
"module": "../dist/internal/index.browser.esm.js",
6-
"browser": "../dist/internal/index.browser.esm.js",
7-
"typings": "../dist/internal/internal/index.d.ts",
4+
"main": "../dist/node/internal.js",
5+
"module": "../dist/esm5/internal.js",
6+
"browser": "../dist/esm5/internal.js",
7+
"esm2017": "../dist/esm2017/internal.js",
8+
"typings": "../dist/esm5/internal/index.d.ts",
89
"private": true
910
}

packages-exp/auth-exp/package.json

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
{
22
"name": "@firebase/auth-exp",
3-
"version": "0.1.0",
3+
"version": "0.0.800",
44
"private": true,
55
"description": "The Firebase Authenticaton component of the Firebase JS SDK.",
66
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
7-
"main": "dist/index.node.cjs.js",
8-
"main-esm2017": "dist/index.node.esm2017.js",
9-
"react-native": "dist/index.rn.cjs.js",
10-
"browser": "dist/index.cjs.js",
11-
"module": "dist/index.esm.js",
12-
"esm2017": "dist/index.esm2017.js",
7+
"main": "dist/node/index.js",
8+
"react-native": "dist/rn/index.js",
9+
"browser": "dist/esm5/index.js",
10+
"module": "dist/esm5/index.js",
11+
"esm2017": "dist/esm2017/index.js",
1312
"webworker": "dist/index.webworker.esm5.js",
1413
"files": [
1514
"dist"
1615
],
1716
"scripts": {
1817
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1918
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
20-
"build": "rollup -c && yarn build:internal",
21-
"build:deps": "lerna run --scope @firebase/'{app-exp,auth-exp,util}' --include-dependencies build",
22-
"build:internal": "rollup -c rollup.config.internal.js",
19+
"build": "rollup -c",
20+
"build:deps": "lerna run --scope @firebase/auth-exp --include-dependencies build",
2321
"build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public",
2422
"dev": "rollup -c -w",
2523
"test": "yarn type-check && run-p lint test:browser test:node",
@@ -36,30 +34,24 @@
3634
},
3735
"peerDependencies": {
3836
"@firebase/app-exp": "0.x",
39-
"@firebase/app-types-exp": "0.x",
40-
"@firebase/auth-exp": "0.x",
41-
"@firebase/auth-types-exp": "0.x",
42-
"@firebase/util": "0.x"
37+
"@firebase/app-types-exp": "0.x"
4338
},
4439
"dependencies": {
40+
"@firebase/logger": "0.2.6",
41+
"@firebase/util": "0.3.0",
4542
"@firebase/component": "0.1.17",
46-
"@firebase/logger": "^0.2.6",
47-
"@firebase/util": "^0.3.0",
43+
"@firebase/auth-types-exp": "0.0.800",
4844
"node-fetch": "2.6.0",
4945
"tslib": "^1.11.1"
5046
},
5147
"license": "Apache-2.0",
5248
"devDependencies": {
53-
"@rollup/plugin-strip": "^1.3.2",
49+
"@firebase/app-exp": "0.0.800",
5450
"rollup": "2.23.0",
55-
"rollup-plugin-copy-assets": "1.1.0",
5651
"rollup-plugin-json": "4.0.0",
57-
"rollup-plugin-node-resolve": "5.2.0",
58-
"rollup-plugin-replace": "2.2.0",
5952
"rollup-plugin-sourcemaps": "0.6.2",
60-
"rollup-plugin-terser": "6.1.0",
6153
"rollup-plugin-typescript2": "0.27.1",
62-
"ts-node": "8.10.2",
54+
"@rollup/plugin-strip": "1.3.2",
6355
"typescript": "3.9.7"
6456
},
6557
"repository": {
@@ -70,7 +62,7 @@
7062
"bugs": {
7163
"url": "https://github.com/firebase/firebase-js-sdk/issues"
7264
},
73-
"typings": "dist/index.d.ts",
65+
"typings": "dist/esm5/index.d.ts",
7466
"nyc": {
7567
"extension": [
7668
".ts"

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

Lines changed: 0 additions & 72 deletions
This file was deleted.

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ const es5Builds = [
5050
* Browser Builds
5151
*/
5252
{
53-
input: 'index.ts',
54-
output: [
55-
{ file: pkg.browser, format: 'cjs', sourcemap: true },
56-
{ file: pkg.module, format: 'esm', sourcemap: true }
57-
],
53+
input: {
54+
index: 'index.ts',
55+
internal: 'internal/index.ts'
56+
},
57+
output: [{ dir: 'dist/esm5', format: 'esm', sourcemap: true }],
5858
plugins: es5BuildPlugins,
5959
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
6060
},
@@ -86,17 +86,23 @@ const es5Builds = [
8686
* Node.js Build
8787
*/
8888
{
89-
input: 'index.node.ts',
90-
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
89+
input: {
90+
index: 'index.node.ts',
91+
internal: 'internal/index.ts'
92+
},
93+
output: [{ dir: 'dist/node', format: 'cjs', sourcemap: true }],
9194
plugins: es5BuildPlugins,
9295
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
9396
},
9497
/**
9598
* React Native Builds
9699
*/
97100
{
98-
input: 'index.rn.ts',
99-
output: [{ file: pkg['react-native'], format: 'cjs', sourcemap: true }],
101+
input: {
102+
index: 'index.rn.ts',
103+
internal: 'internal/index.ts'
104+
},
105+
output: [{ dir: 'dist/rn', format: 'cjs', sourcemap: true }],
100106
plugins: es5BuildPlugins,
101107
external: id =>
102108
[...deps, 'react-native'].some(
@@ -125,9 +131,12 @@ const es2017Builds = [
125131
* Browser Builds
126132
*/
127133
{
128-
input: 'index.ts',
134+
input: {
135+
index: 'index.ts',
136+
internal: 'internal/index.ts'
137+
},
129138
output: {
130-
file: pkg.esm2017,
139+
dir: 'dist/esm2017',
131140
format: 'es',
132141
sourcemap: true
133142
},

0 commit comments

Comments
 (0)