Skip to content

Commit 75ab880

Browse files
authored
Fix auth compat import (#5090)
* fix auth compat import * do not use g flag in regex * revert changes for testing * update
1 parent ca85752 commit 75ab880

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import firebase, { _FirebaseNamespace } from '@firebase/app-compat';
2121
import * as impl from '@firebase/auth-exp/internal';
22-
import * as externs from '@firebase/auth-exp';
2322
import {
2423
Component,
2524
ComponentType,
@@ -87,14 +86,14 @@ function registerAuthCompat(instance: _FirebaseNamespace): void {
8786
.setServiceProps({
8887
ActionCodeInfo: {
8988
Operation: {
90-
EMAIL_SIGNIN: externs.ActionCodeOperation.EMAIL_SIGNIN,
91-
PASSWORD_RESET: externs.ActionCodeOperation.PASSWORD_RESET,
92-
RECOVER_EMAIL: externs.ActionCodeOperation.RECOVER_EMAIL,
89+
EMAIL_SIGNIN: impl.ActionCodeOperation.EMAIL_SIGNIN,
90+
PASSWORD_RESET: impl.ActionCodeOperation.PASSWORD_RESET,
91+
RECOVER_EMAIL: impl.ActionCodeOperation.RECOVER_EMAIL,
9392
REVERT_SECOND_FACTOR_ADDITION:
94-
externs.ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION,
93+
impl.ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION,
9594
VERIFY_AND_CHANGE_EMAIL:
96-
externs.ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,
97-
VERIFY_EMAIL: externs.ActionCodeOperation.VERIFY_EMAIL
95+
impl.ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,
96+
VERIFY_EMAIL: impl.ActionCodeOperation.VERIFY_EMAIL
9897
}
9998
},
10099
EmailAuthProvider: impl.EmailAuthProvider,

packages/database/rollup.config.compat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const es5BuildPlugins = [
4747
transformers: [
4848
getImportPathTransformer({
4949
// ../../exp/index
50-
pattern: /^.*exp\/index$/g,
50+
pattern: /^.*exp\/index$/,
5151
template: ['@firebase/database']
5252
})
5353
]
@@ -111,7 +111,7 @@ const es2017BuildPlugins = [
111111
transformers: [
112112
getImportPathTransformer({
113113
// ../../exp/index
114-
pattern: /^.*exp\/index$/g,
114+
pattern: /^.*exp\/index$/,
115115
template: ['@firebase/database']
116116
})
117117
]

packages/firestore/rollup.config.browser.compat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default [
3737
'browser',
3838
getImportPathTransformer({
3939
// ../../exp/index
40-
pattern: /^.*exp\/index$/g,
40+
pattern: /^.*exp\/index$/,
4141
template: ['@firebase/firestore']
4242
}),
4343
/* mangled= */ false

packages/firestore/rollup.config.node.compat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default [
3838
'node',
3939
getImportPathTransformer({
4040
// ../../exp/index
41-
pattern: /^.*exp\/index$/g,
41+
pattern: /^.*exp\/index$/,
4242
template: ['@firebase/firestore']
4343
})
4444
),

packages/firestore/rollup.config.rn.compat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default [
3434
'rn',
3535
getImportPathTransformer({
3636
// ../../exp/index
37-
pattern: /^.*exp\/index$/g,
37+
pattern: /^.*exp\/index$/,
3838
template: ['@firebase/firestore']
3939
}),
4040
/* mangled= */ false

packages/storage/rollup.config.compat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const es5BuildPlugins = [
3939
transformers: [
4040
getImportPathTransformer({
4141
// ../exp/index
42-
pattern: /^.*exp\/api$/g,
42+
pattern: /^.*exp\/api$/,
4343
template: ['@firebase/storage']
4444
})
4545
]
@@ -80,7 +80,7 @@ const es2017BuildPlugins = [
8080
transformers: [
8181
getImportPathTransformer({
8282
// ../exp/index
83-
pattern: /^.*exp\/api$/g,
83+
pattern: /^.*exp\/api$/,
8484
template: ['@firebase/storage']
8585
})
8686
],

scripts/exp/ts-transform-import-path.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export function getImportPathTransformer({ pattern, template }) {
3434
export const importPathTransformer = () => ({
3535
before: [
3636
transformImportPath({
37-
pattern: /^(@firebase.*)-exp(.*)$/g,
37+
pattern: /^(@firebase.*)-exp(.*)$/,
3838
template: [1, 2]
3939
})
4040
],
4141
after: [],
4242
afterDeclarations: [
4343
transformImportPath({
44-
pattern: /^(@firebase.*)-exp(.*)$/g,
44+
pattern: /^(@firebase.*)-exp(.*)$/,
4545
template: [1, 2]
4646
})
4747
]
@@ -75,7 +75,6 @@ function visitNode(node, { pattern, template }) {
7575
);
7676

7777
const captures = pattern.exec(importPath);
78-
7978
if (captures) {
8079
const newNameFragments = [];
8180
for (const fragment of template) {

0 commit comments

Comments
 (0)