Skip to content

Commit c65c72d

Browse files
authored
Merge 91c709b into ae976d0
2 parents ae976d0 + 91c709b commit c65c72d

File tree

8 files changed

+163
-8
lines changed

8 files changed

+163
-8
lines changed

packages/app-check-interop-types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export interface FirebaseAppCheckInternal {
3434
removeTokenListener(listener: AppCheckTokenListener): void;
3535
}
3636

37-
type AppCheckTokenListener = (token: AppCheckTokenResult) => void;
37+
export type AppCheckTokenListener = (token: AppCheckTokenResult) => void;
3838

3939
// If the error field is defined, the token field will be populated with a dummy token
40-
interface AppCheckTokenResult {
40+
export interface AppCheckTokenResult {
4141
readonly token: string;
4242
readonly error?: Error;
4343
}

packages/firebase/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/firebase*.js
22
/firebase*.map
33
/firebase*.gz
4-
/firebase*.tgz
4+
/firebase*.tgz
5+
/custom/*.d.ts
6+
/packages
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @license
3+
* Copyright 2022 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/**
19+
* Specialized config only for internal deployment to google3 repo, adds required license header to
20+
* generated code.
21+
*/
22+
23+
// When run in google3, original rollup.config.js will have been renamed to rollup-main.config.js.
24+
import baseBuilds from './rollup.config.js';
25+
import license from 'rollup-plugin-license';
26+
27+
const firebaseLicense = license({
28+
banner: `@license
29+
Copyright ${new Date().getFullYear()} Google LLC.
30+
SPDX-License-Identifier: Apache-2.0`
31+
});
32+
33+
const buildsWithLicense = baseBuilds.map(build => {
34+
return Object.assign({}, build, {
35+
plugins: build.plugins.concat(firebaseLicense)
36+
});
37+
});
38+
39+
export default buildsWithLicense;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import { registerVersion } from '@firebase/app';
19+
import { version } from '../package.json';
20+
21+
export * as app from '@firebase/app';
22+
export * as analytics from '@firebase/analytics';
23+
export * as remoteConfig from '@firebase/remote-config';

packages/firebase/custom/index.all.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import { registerVersion } from '@firebase/app';
19+
import { version } from '../package.json';
20+
21+
registerVersion('fire-js-all', version, 'cdn');
22+
export * as app from '@firebase/app';
23+
export * as ai from '@firebase/ai';
24+
export * as analytics from '@firebase/analytics';
25+
export * as appCheck from '@firebase/app-check';
26+
export * as auth from '@firebase/auth';
27+
export * as dataConnect from '@firebase/data-connect';
28+
export * as database from '@firebase/database';
29+
export * as firestore from '@firebase/firestore';
30+
export * as functions from '@firebase/functions';
31+
export * as installations from '@firebase/installations';
32+
export * as messaging from '@firebase/messaging';
33+
export * as performance from '@firebase/performance';
34+
export * as remoteConfig from '@firebase/remote-config';

packages/firebase/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@
403403
},
404404
"scripts": {
405405
"build": "rollup -c && gulp cdn-type-module-path && yarn build:compat",
406-
"build:internal": "rollup -c && gulp cdn-type-module-path-internal && yarn build:compat",
406+
"build:internal": "rollup -c rollup-internal.config.js && gulp cdn-type-module-path-internal && yarn build:compat:internal",
407407
"build:compat": "rollup -c compat/rollup.config.js",
408+
"build:compat:internal": "rollup -c compat/rollup-internal.config.js",
408409
"dev": "rollup -c -w",
409410
"test": "echo 'No test suite for firebase wrapper'",
410411
"test:ci": "echo 'No test suite for firebase wrapper'",
@@ -446,6 +447,7 @@
446447
"@rollup/plugin-node-resolve": "16.0.0",
447448
"rollup-plugin-sourcemaps": "0.6.3",
448449
"@rollup/plugin-terser": "0.4.4",
450+
"rollup-plugin-dts": "5.3.1",
449451
"rollup-plugin-typescript2": "0.36.0",
450452
"rollup-plugin-uglify": "6.0.4",
451453
"gulp": "4.0.2",

packages/firebase/rollup-internal.config.js

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,72 @@
2121
*/
2222

2323
// When run in google3, original rollup.config.js will have been renamed to rollup-main.config.js.
24-
import baseBuilds from './rollup-main.config.js';
24+
import { cdnBuilds, plugins } from './rollup.config.js';
2525
import license from 'rollup-plugin-license';
26+
import typescript from 'typescript';
27+
import rollupTypescriptPlugin from 'rollup-plugin-typescript2';
28+
import dts from 'rollup-plugin-dts';
29+
import { parse } from 'path';
30+
31+
const typescriptPluginCustom = rollupTypescriptPlugin({
32+
typescript,
33+
allowJs: true,
34+
include: ['*.ts', '**/*.ts', '*.js', '**/*.js'],
35+
tsconfigOverride: {
36+
compilerOptions: {
37+
declaration: true
38+
}
39+
}
40+
});
2641

2742
const firebaseLicense = license({
2843
banner: `@license
2944
Copyright ${new Date().getFullYear()} Google LLC.
3045
SPDX-License-Identifier: Apache-2.0`
3146
});
3247

33-
const buildsWithLicense = baseBuilds.map(build => {
48+
const buildsWithLicense = cdnBuilds.map(build => {
3449
return Object.assign({}, build, {
3550
plugins: build.plugins.concat(firebaseLicense)
3651
});
3752
});
3853

39-
export default buildsWithLicense;
54+
/**
55+
* Custom builds that include combinations of multiple products.
56+
*/
57+
const customBuilds = [
58+
{ inputFile: 'custom/index.all.ts', outputFile: 'firebase.js' },
59+
{
60+
inputFile: 'custom/analytics-remote-config.ts',
61+
outputFile: 'firebase-analytics-rc.js'
62+
}
63+
]
64+
.map(build => {
65+
const { dir, name } = parse(build.inputFile);
66+
return [
67+
{
68+
input: build.inputFile,
69+
output: {
70+
file: build.outputFile,
71+
sourcemap: true,
72+
format: 'es'
73+
},
74+
plugins: [...plugins, typescriptPluginCustom, firebaseLicense]
75+
},
76+
{
77+
input: `${dir}/${name}.d.ts`,
78+
output: {
79+
file: `dist/${name}.global.d.ts`,
80+
format: 'es'
81+
},
82+
plugins: [
83+
dts({
84+
respectExternal: true
85+
})
86+
]
87+
}
88+
];
89+
})
90+
.flat();
91+
92+
export default [...buildsWithLicense, ...customBuilds];

packages/firebase/rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const componentBuilds = pkg.components
134134
/**
135135
* CDN script builds
136136
*/
137-
const cdnBuilds = [
137+
export const cdnBuilds = [
138138
{
139139
input: 'app/index.cdn.ts',
140140
output: {
@@ -175,4 +175,6 @@ const cdnBuilds = [
175175
})
176176
];
177177

178+
export { plugins };
179+
178180
export default [...appBuilds, ...componentBuilds, ...cdnBuilds];

0 commit comments

Comments
 (0)