Skip to content

Commit 023b1b5

Browse files
committed
Cleanup build tree a bit
1 parent fcbab14 commit 023b1b5

File tree

7 files changed

+45
-46
lines changed

7 files changed

+45
-46
lines changed

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,27 @@ const es5Builds = [
3838
{
3939
input: 'src/index.js',
4040
output: [{ file: pkg.bundle, format: 'esm', sourcemap: true }],
41-
plugins: commonPlugins,
41+
plugins: commonPlugins
4242
},
4343
{
4444
input: 'src/worker/index.ts',
4545
output: [{ file: pkg.worker, format: 'esm', sourcemap: true }],
46-
plugins: [...commonPlugins,
46+
plugins: [
47+
...commonPlugins,
4748
typescriptPlugin({
48-
typescript,
49-
tsconfigOverride: {
50-
compilerOptions: {
51-
lib: [
52-
// TODO: remove this
53-
"dom",
54-
"es6",
55-
"webworker"
56-
]
49+
typescript,
50+
tsconfigOverride: {
51+
compilerOptions: {
52+
lib: [
53+
// TODO: remove this
54+
'dom',
55+
'es2015',
56+
'webworker'
57+
]
58+
}
5759
}
58-
}
59-
})],
60+
})
61+
]
6062
}
6163
];
6264

packages-exp/auth-exp/demo/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import {
5959
// linkWithPopup,
6060
// reauthenticateWithPopup,
6161
// browserPopupRedirectResolver
62-
} from '@firebase/auth-exp';
62+
} from '@firebase/auth-exp/dist/index.browser';
6363

6464
import { config } from './config';
6565
import {

packages-exp/auth-exp/demo/src/worker/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
inMemoryPersistence,
2323
signInAnonymously,
2424
signInWithEmailAndPassword,
25-
updateProfile,
25+
updateProfile
2626
} from '@firebase/auth-exp/dist/index.webworker';
2727
import { OAuthCredential, User } from '@firebase/auth-types-exp';
2828

@@ -45,14 +45,15 @@ const auth = initializeAuth(app, {
4545
* available. Otherwise, the promise resolves with null.
4646
*/
4747
function getIdToken(): Promise<string | null> {
48-
return new Promise((resolve) => {
48+
return new Promise(resolve => {
4949
auth.onAuthStateChanged((user: User | null) => {
5050
if (user) {
51-
user.getIdToken().then(resolve).catch(
52-
() => {
51+
user
52+
.getIdToken()
53+
.then(resolve)
54+
.catch(() => {
5355
resolve(null);
54-
}
55-
);
56+
});
5657
} else {
5758
resolve(null);
5859
}
@@ -168,7 +169,7 @@ self.onmessage = (e: MessageEvent) => {
168169
ctx.postMessage({
169170
type: e.data.type,
170171
idToken,
171-
uid: auth.currentUser?.uid,
172+
uid: auth.currentUser?.uid
172173
});
173174
})
174175
.catch(error => {
@@ -180,7 +181,7 @@ self.onmessage = (e: MessageEvent) => {
180181
.then(() => {
181182
ctx.postMessage({
182183
type: e.data.type,
183-
status: 'success',
184+
status: 'success'
184185
});
185186
})
186187
.catch(error => {

packages-exp/auth-exp/index.ts renamed to packages-exp/auth-exp/index.browser.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,17 @@
1515
* limitations under the License.
1616
*/
1717

18-
import * as externs from '@firebase/auth-types-exp';
19-
import { CompleteFn, ErrorFn, Unsubscribe } from '@firebase/util';
20-
2118
// Core functionality shared by all browser based clients
2219
export * from './index.webworker';
2320

24-
// Additional DOM dependend functionality
21+
// Additional DOM dependend functionality
2522

2623
// core/persistence
2724
export {
2825
browserLocalPersistence,
2926
browserSessionPersistence
3027
} from './src/core/persistence/browser';
3128
export { indexedDBLocalPersistence } from './src/core/persistence/indexed_db';
32-
export { getReactNativePersistence } from './src/core/persistence/react_native';
3329

3430
// core/strategies
3531
export {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
* This is the file that people using Node.js will actually import. You should
2020
* only include this file if you have something specific about your
2121
* implementation that mandates having a separate entrypoint. Otherwise you can
22-
* just use index.ts
22+
* just use index.browser.ts
2323
*/
24+
25+
// Core functionality shared by all clients
26+
export * from './index.webworker';

packages-exp/auth-exp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"description": "TODO",
66
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
77
"main": "dist/index.node.cjs.js",
8-
"browser": "dist/index.cjs.js",
9-
"module": "dist/index.esm.js",
8+
"browser": "dist/index.browser.esm5.js",
9+
"module": "dist/index.node.esm5.js",
1010
"esm2017": "dist/index.esm2017.js",
11-
"webworker": "dist/index.webworker.js",
11+
"webworker": "dist/index.webworker.esm5.js",
1212
"files": [
1313
"dist"
1414
],

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

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,14 @@ const es5Builds = [
4848
* Browser Builds
4949
*/
5050
{
51-
input: 'index.ts',
52-
output: [{ file: pkg.browser, format: 'cjs', sourcemap: true }],
53-
plugins: es5BuildPlugins,
54-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
55-
},
56-
{
57-
input: 'index.ts',
58-
output: [{ file: pkg.module, format: 'es', sourcemap: true }],
51+
input: 'index.browser.ts',
52+
output: [{ file: pkg.browser, format: 'es', sourcemap: true }],
5953
plugins: es5BuildPlugins,
6054
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
6155
},
6256
/**
63-
* Web Worker Build (compiled without DOM)
64-
*/
57+
* Web Worker Build (compiled without DOM)
58+
*/
6559
{
6660
input: 'index.webworker.ts',
6761
output: [{ file: pkg.webworker, format: 'es', sourcemap: true }],
@@ -73,9 +67,9 @@ const es5Builds = [
7367
compilerOptions: {
7468
lib: [
7569
// Remove dom after we figure out why navigator stuff doesn't exist
76-
"dom",
77-
"es6",
78-
"webworker"
70+
'dom',
71+
'es2015',
72+
'webworker'
7973
]
8074
}
8175
}
@@ -88,7 +82,10 @@ const es5Builds = [
8882
*/
8983
{
9084
input: 'index.node.ts',
91-
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
85+
output: [
86+
{ file: pkg.main, format: 'cjs', sourcemap: true },
87+
{ file: pkg.module, format: 'esm', sourcemap: true }
88+
],
9289
plugins: es5BuildPlugins,
9390
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
9491
}
@@ -114,7 +111,7 @@ const es2017Builds = [
114111
* Browser Builds
115112
*/
116113
{
117-
input: 'index.ts',
114+
input: 'index.browser.ts',
118115
output: {
119116
file: pkg.esm2017,
120117
format: 'es',

0 commit comments

Comments
 (0)