Skip to content

Commit 200cfc4

Browse files
committed
New internal builds for google3
1 parent 247b92f commit 200cfc4

File tree

7 files changed

+126
-8
lines changed

7 files changed

+126
-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: 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';
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@
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",
407407
"build:compat": "rollup -c compat/rollup.config.js",
408408
"dev": "rollup -c -w",
409409
"test": "echo 'No test suite for firebase wrapper'",
@@ -446,6 +446,7 @@
446446
"@rollup/plugin-node-resolve": "16.0.0",
447447
"rollup-plugin-sourcemaps": "0.6.3",
448448
"@rollup/plugin-terser": "0.4.4",
449+
"rollup-plugin-dts": "5.3.1",
449450
"rollup-plugin-typescript2": "0.36.0",
450451
"rollup-plugin-uglify": "6.0.4",
451452
"gulp": "4.0.2",

packages/firebase/rollup-internal.config.js

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,75 @@
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.cdn.ts', outputFile: 'firebase.js' },
59+
{
60+
inputFile: 'custom/analytics-remote-config.cdn.ts',
61+
outputFile: 'firebase-analytics-rc.js'
62+
}
63+
]
64+
.map(build => {
65+
const { dir, name } = parse(build.inputFile);
66+
console.log(`${dir}/${name}.d.ts`);
67+
console.log(`dist/${name}.global.d.ts`);
68+
return [
69+
{
70+
input: build.inputFile,
71+
output: {
72+
file: build.outputFile,
73+
sourcemap: true,
74+
format: 'es'
75+
},
76+
plugins: [...plugins, typescriptPluginCustom, firebaseLicense]
77+
},
78+
{
79+
input: `${dir}/${name}.d.ts`,
80+
output: {
81+
file: `dist/${name}.global.d.ts`,
82+
format: 'es'
83+
},
84+
plugins: [
85+
dts({
86+
respectExternal: true
87+
})
88+
]
89+
}
90+
];
91+
}).flat();
92+
93+
console.log(customBuilds.length);
94+
95+
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)