Skip to content
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

Add exports to all packages #5646

Merged
merged 36 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e764198
exports for analytics
Feiyang1 Oct 20, 2021
1df7e70
support exports for app
Feiyang1 Oct 20, 2021
b2bfeed
support exports for app-check
Feiyang1 Oct 20, 2021
cfcc02f
add exports to auth
Feiyang1 Oct 20, 2021
53c0d7e
support exports for auth-compat
Feiyang1 Oct 20, 2021
dd0944b
add exports to component
Feiyang1 Oct 20, 2021
71f51aa
add exports to database packages
Feiyang1 Oct 20, 2021
148359f
exports for firestore
Feiyang1 Oct 20, 2021
dd2c116
add exports to functions
Feiyang1 Oct 20, 2021
e8a11df
add exports to installations
Feiyang1 Oct 20, 2021
27852a5
add exports to logger
Feiyang1 Oct 20, 2021
7f45f73
add exports to messaging
Feiyang1 Oct 20, 2021
feeaf5c
add exports to perf
Feiyang1 Oct 20, 2021
5b2704a
add exports to rc
Feiyang1 Oct 20, 2021
eef2591
add exports to storage
Feiyang1 Oct 21, 2021
ab3c117
update template
Feiyang1 Oct 21, 2021
08088bc
add exports to util
Feiyang1 Oct 21, 2021
4b055c4
add exports to webchannel
Feiyang1 Oct 21, 2021
99b1652
Merge branch 'master' into fei-exports
Feiyang1 Oct 21, 2021
b1c62e0
use default import to import cjs libs
Feiyang1 Oct 27, 2021
ed3ea37
make node code esm compatible
Feiyang1 Oct 27, 2021
0c67d3c
remove esm entrypoint for app in nodejs to mininize dual package hazard
Feiyang1 Oct 28, 2021
94401aa
reorganize builds by env
Feiyang1 Oct 28, 2021
aec1b9c
fix typo
Feiyang1 Oct 28, 2021
47078b0
format
Feiyang1 Oct 28, 2021
df8d284
remove esm entrypoint for nodejs for fcm
Feiyang1 Oct 28, 2021
6d9dd36
Merge branch 'master' into fei-exports
Feiyang1 Oct 28, 2021
bc4ed3a
expose package.json to nodejs
Feiyang1 Oct 29, 2021
68521bd
fix
Feiyang1 Oct 29, 2021
6a1c5e8
fix path in build
Feiyang1 Oct 29, 2021
4c591aa
simplify exports
Feiyang1 Oct 29, 2021
b2e9923
formatting
Feiyang1 Nov 1, 2021
01d4929
enable esModuleInterop
Feiyang1 Nov 1, 2021
c4a556e
use default import
Feiyang1 Nov 1, 2021
1ea90dc
use default import
Feiyang1 Nov 1, 2021
2abc5e8
remove esm support for Nodejs in messaging
Feiyang1 Nov 2, 2021
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
14 changes: 10 additions & 4 deletions packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
"description": "",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"main": "dist/index.cjs.js",
"browser": "dist/index.esm2017.js",
"module": "dist/index.esm2017.js",
"browser": "dist/esm/index.esm2017.js",
"module": "dist/esm/index.esm2017.js",
"esm5": "dist/esm/index.esm.js",
"exports": {
"import": "./dist/esm/index.esm2017.js",
Feiyang1 marked this conversation as resolved.
Show resolved Hide resolved
"browser": "./dist/esm/index.esm2017.js",
"module": "./dist/esm/index.esm2017.js",
"default": "./dist/index.cjs.js"
},
"files": [
"dist"
],
Expand Down Expand Up @@ -54,6 +61,5 @@
".ts"
],
"reportDir": "./coverage/node"
},
"esm5": "dist/index.esm.js"
}
}
50 changes: 23 additions & 27 deletions packages/analytics-compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,20 @@
import json from '@rollup/plugin-json';
import typescriptPlugin from 'rollup-plugin-typescript2';
import typescript from 'typescript';
import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file';
import pkg from './package.json';

const deps = Object.keys(
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
);
/**
* ES5 Builds
*/

const es5BuildPlugins = [
typescriptPlugin({
typescript
}),
json()
];

const es5Builds = [
/**
* Browser Builds
*/
{
input: 'src/index.ts',
output: [
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.esm5, format: 'es', sourcemap: true }
],
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: es5BuildPlugins
}
];

/**
* ES2017 Builds
*/
const es2017BuildPlugins = [
typescriptPlugin({
typescript,
Expand All @@ -63,20 +44,35 @@ const es2017BuildPlugins = [
json({ preferConst: true })
];

const es2017Builds = [
const esmBuilds = [
{
/**
* Browser Build
*/
input: 'src/index.ts',
output: {
file: pkg.browser,
format: 'es',
sourcemap: true
},
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: es2017BuildPlugins
plugins: [...es2017BuildPlugins, emitModulePackageFile()]
Feiyang1 marked this conversation as resolved.
Show resolved Hide resolved
},
{
input: 'src/index.ts',
output: { file: pkg.esm5, format: 'es', sourcemap: true },
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [...es5BuildPlugins, emitModulePackageFile()]
}
];

/**
* ES2017 Builds
Feiyang1 marked this conversation as resolved.
Show resolved Hide resolved
*/
const cjsBuilds = [
{
input: 'src/index.ts',
output: { file: pkg.main, format: 'cjs', sourcemap: true },
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: es5BuildPlugins
}
];

export default [...es5Builds, ...es2017Builds];
export default [...esmBuilds, ...cjsBuilds];
14 changes: 10 additions & 4 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
"description": "A analytics package for new firebase packages",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"main": "dist/index.cjs.js",
"browser": "dist/index.esm2017.js",
"module": "dist/index.esm2017.js",
"browser": "dist/esm/index.esm2017.js",
"module": "dist/esm/index.esm2017.js",
"esm5": "dist/esm/index.esm.js",
"exports": {
"import": "./dist/esm/index.esm2017.js",
"browser": "./dist/esm/index.esm2017.js",
"module": "./dist/esm/index.esm2017.js",
"default": "./dist/index.cjs.js"
},
"files": [
"dist"
],
Expand Down Expand Up @@ -60,6 +67,5 @@
".ts"
],
"reportDir": "./coverage/node"
},
"esm5": "dist/index.esm.js"
}
}
71 changes: 35 additions & 36 deletions packages/analytics/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,20 @@ import typescriptPlugin from 'rollup-plugin-typescript2';
import replace from 'rollup-plugin-replace';
import typescript from 'typescript';
import { generateBuildTargetReplaceConfig } from '../../scripts/build/rollup_replace_build_target';
import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file';
import pkg from './package.json';

const deps = [
...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies))
];

/**
* ES5 Builds
*/
const es5BuildPlugins = [
typescriptPlugin({
typescript
}),
json()
];

const es5Builds = [
/**
* Browser Builds
*/
{
input: 'src/index.ts',
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [
...es5BuildPlugins,
replace(generateBuildTargetReplaceConfig('cjs', 5))
]
},
{
input: 'src/index.ts',
output: [{ file: pkg.esm5, format: 'es', sourcemap: true }],
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [
...es5BuildPlugins,
replace(generateBuildTargetReplaceConfig('esm', 5))
]
}
];

/**
* ES2017 Builds
*/
const es2017BuildPlugins = [
typescriptPlugin({
typescript,
Expand All @@ -75,11 +46,21 @@ const es2017BuildPlugins = [
json({ preferConst: true })
];

const es2017Builds = [
/**
* ESM builds
*/
const esmBuilds = [
{
input: 'src/index.ts',
output: [{ file: pkg.esm5, format: 'es', sourcemap: true }],
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [
...es5BuildPlugins,
replace(generateBuildTargetReplaceConfig('esm', 5)),
emitModulePackageFile()
]
},
{
/**
* Browser Build
*/
input: 'src/index.ts',
output: {
file: pkg.browser,
Expand All @@ -89,9 +70,27 @@ const es2017Builds = [
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [
...es2017BuildPlugins,
replace(generateBuildTargetReplaceConfig('esm', 2017))
replace(generateBuildTargetReplaceConfig('esm', 2017)),
emitModulePackageFile()
]
}
]

/**
* CJS builds
*/
const cjsBuilds = [
{
input: 'src/index.ts',
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [
...es5BuildPlugins,
replace(generateBuildTargetReplaceConfig('cjs', 5))
]
},

];

export default [...es5Builds, ...es2017Builds];

export default [...esmBuilds, ...cjsBuilds];
16 changes: 11 additions & 5 deletions packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
"description": "A compat App Check package for new firebase packages",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"main": "dist/index.cjs.js",
"browser": "dist/index.esm2017.js",
"module": "dist/index.esm2017.js",
"browser": "dist/esm/index.esm2017.js",
"module": "dist/esm/index.esm2017.js",
"esm5": "dist/esm/index.esm.js",
"exports": {
"import": "./dist/esm/index.esm2017.js",
"browser": "./dist/esm/index.esm2017.js",
"module": "./dist/esm/index.esm2017.js",
"default": "./dist/index.cjs.js"
},
"files": [
"dist"
],
Expand Down Expand Up @@ -55,6 +62,5 @@
".ts"
],
"reportDir": "./coverage/node"
},
"esm5": "dist/index.esm.js"
}
}
}
47 changes: 20 additions & 27 deletions packages/app-check-compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,20 @@
import json from '@rollup/plugin-json';
import typescriptPlugin from 'rollup-plugin-typescript2';
import typescript from 'typescript';
import { emitModulePackageFile } from '../../scripts/build/rollup_emit_module_package_file';
import pkg from './package.json';

const deps = Object.keys(
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
);
/**
* ES5 Builds
*/

const es5BuildPlugins = [
typescriptPlugin({
typescript
}),
json()
];

const es5Builds = [
/**
* Browser Builds
*/
{
input: 'src/index.ts',
output: [
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.esm5, format: 'es', sourcemap: true }
],
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: es5BuildPlugins
}
];

/**
* ES2017 Builds
*/
const es2017BuildPlugins = [
typescriptPlugin({
typescript,
Expand All @@ -63,20 +44,32 @@ const es2017BuildPlugins = [
json({ preferConst: true })
];

const es2017Builds = [
const esmBuilds = [
{
input: 'src/index.ts',
output: { file: pkg.esm5, format: 'es', sourcemap: true },
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: [...es5BuildPlugins, emitModulePackageFile()]
},
{
/**
* Browser Build
*/
input: 'src/index.ts',
output: {
file: pkg.browser,
format: 'es',
sourcemap: true
},
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: es2017BuildPlugins
plugins: [...es2017BuildPlugins, emitModulePackageFile()]
}
];

const cjsBuilds = [
{
input: 'src/index.ts',
output: { file: pkg.main, format: 'cjs', sourcemap: true },
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
plugins: es5BuildPlugins
}
];

export default [...es5Builds, ...es2017Builds];
export default [...esmBuilds, ...cjsBuilds];
16 changes: 0 additions & 16 deletions packages/app-check-compat/rollup.shared.js

This file was deleted.

14 changes: 10 additions & 4 deletions packages/app-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
"description": "The App Check component of the Firebase JS SDK",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"main": "dist/index.cjs.js",
"browser": "dist/index.esm2017.js",
"module": "dist/index.esm2017.js",
"browser": "dist/esm/index.esm2017.js",
"module": "dist/esm/index.esm2017.js",
"esm5": "dist/esm/index.esm.js",
"exports": {
"import": "./dist/esm/index.esm2017.js",
"browser": "./dist/esm/index.esm2017.js",
"module": "./dist/esm/index.esm2017.js",
"default": "./dist/index.cjs.js"
},
"files": [
"dist"
],
Expand Down Expand Up @@ -57,6 +64,5 @@
".ts"
],
"reportDir": "./coverage/node"
},
"esm5": "dist/index.esm.js"
}
}
Loading