Skip to content

Fix auth compat import #5090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions packages-exp/auth-compat-exp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import firebase, { _FirebaseNamespace } from '@firebase/app-compat';
import * as impl from '@firebase/auth-exp/internal';
import * as externs from '@firebase/auth-exp';
import {
Component,
ComponentType,
Expand Down Expand Up @@ -87,14 +86,14 @@ function registerAuthCompat(instance: _FirebaseNamespace): void {
.setServiceProps({
ActionCodeInfo: {
Operation: {
EMAIL_SIGNIN: externs.ActionCodeOperation.EMAIL_SIGNIN,
PASSWORD_RESET: externs.ActionCodeOperation.PASSWORD_RESET,
RECOVER_EMAIL: externs.ActionCodeOperation.RECOVER_EMAIL,
EMAIL_SIGNIN: impl.ActionCodeOperation.EMAIL_SIGNIN,
PASSWORD_RESET: impl.ActionCodeOperation.PASSWORD_RESET,
RECOVER_EMAIL: impl.ActionCodeOperation.RECOVER_EMAIL,
REVERT_SECOND_FACTOR_ADDITION:
externs.ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION,
impl.ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION,
VERIFY_AND_CHANGE_EMAIL:
externs.ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,
VERIFY_EMAIL: externs.ActionCodeOperation.VERIFY_EMAIL
impl.ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL,
VERIFY_EMAIL: impl.ActionCodeOperation.VERIFY_EMAIL
}
},
EmailAuthProvider: impl.EmailAuthProvider,
Expand Down
4 changes: 2 additions & 2 deletions packages/database/rollup.config.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const es5BuildPlugins = [
transformers: [
getImportPathTransformer({
// ../../exp/index
pattern: /^.*exp\/index$/g,
pattern: /^.*exp\/index$/,
template: ['@firebase/database']
})
]
Expand Down Expand Up @@ -111,7 +111,7 @@ const es2017BuildPlugins = [
transformers: [
getImportPathTransformer({
// ../../exp/index
pattern: /^.*exp\/index$/g,
pattern: /^.*exp\/index$/,
template: ['@firebase/database']
})
]
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/rollup.config.browser.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default [
'browser',
getImportPathTransformer({
// ../../exp/index
pattern: /^.*exp\/index$/g,
pattern: /^.*exp\/index$/,
template: ['@firebase/firestore']
}),
/* mangled= */ false
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/rollup.config.node.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default [
'node',
getImportPathTransformer({
// ../../exp/index
pattern: /^.*exp\/index$/g,
pattern: /^.*exp\/index$/,
template: ['@firebase/firestore']
})
),
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/rollup.config.rn.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default [
'rn',
getImportPathTransformer({
// ../../exp/index
pattern: /^.*exp\/index$/g,
pattern: /^.*exp\/index$/,
template: ['@firebase/firestore']
}),
/* mangled= */ false
Expand Down
4 changes: 2 additions & 2 deletions packages/storage/rollup.config.compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const es5BuildPlugins = [
transformers: [
getImportPathTransformer({
// ../exp/index
pattern: /^.*exp\/api$/g,
pattern: /^.*exp\/api$/,
template: ['@firebase/storage']
})
]
Expand Down Expand Up @@ -80,7 +80,7 @@ const es2017BuildPlugins = [
transformers: [
getImportPathTransformer({
// ../exp/index
pattern: /^.*exp\/api$/g,
pattern: /^.*exp\/api$/,
template: ['@firebase/storage']
})
],
Expand Down
5 changes: 2 additions & 3 deletions scripts/exp/ts-transform-import-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export function getImportPathTransformer({ pattern, template }) {
export const importPathTransformer = () => ({
before: [
transformImportPath({
pattern: /^(@firebase.*)-exp(.*)$/g,
pattern: /^(@firebase.*)-exp(.*)$/,
template: [1, 2]
})
],
after: [],
afterDeclarations: [
transformImportPath({
pattern: /^(@firebase.*)-exp(.*)$/g,
pattern: /^(@firebase.*)-exp(.*)$/,
template: [1, 2]
})
]
Expand Down Expand Up @@ -75,7 +75,6 @@ function visitNode(node, { pattern, template }) {
);

const captures = pattern.exec(importPath);

if (captures) {
const newNameFragments = [];
for (const fragment of template) {
Expand Down