Skip to content

Commit f9972be

Browse files
Merge
2 parents df8e3cc + 58e1b6f commit f9972be

File tree

136 files changed

+4949
-2321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4949
-2321
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## API Report File for "@firebase/functions-exp"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import { FirebaseApp } from '@firebase/app-types-exp';
8+
import { Functions } from '@firebase/functions-types-exp';
9+
import { HttpsCallable } from '@firebase/functions-types-exp';
10+
import { HttpsCallableOptions } from '@firebase/functions-types-exp';
11+
12+
// @public
13+
export function getFunctions(app: FirebaseApp, region?: string): Functions;
14+
15+
// @public
16+
export function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable;
17+
18+
// @public
19+
export function useFunctionsEmulator(functionsInstance: Functions, origin: string): void;
20+
21+
22+
// (No @packageDocumentation comment for this package)
23+
24+
```

config/webpack.test.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -18,6 +18,12 @@
1818
const path = require('path');
1919
const webpack = require('webpack');
2020

21+
/**
22+
* A regular expression used to replace Firestore's platform specific modules,
23+
* which are located under 'packages/firestore/src/platform/'.
24+
*/
25+
const FIRESTORE_PLATFORM_RE = /^(.*)\/platform\/([^.\/]*)(\.ts)?$/;
26+
2127
module.exports = {
2228
mode: 'development',
2329
devtool: 'source-map',
@@ -77,6 +83,15 @@ module.exports = {
7783
extensions: ['.js', '.ts']
7884
},
7985
plugins: [
86+
new webpack.NormalModuleReplacementPlugin(
87+
FIRESTORE_PLATFORM_RE,
88+
resource => {
89+
resource.request = resource.request.replace(
90+
FIRESTORE_PLATFORM_RE,
91+
'$1/platform/browser/$2.ts'
92+
);
93+
}
94+
),
8095
new webpack.EnvironmentPlugin([
8196
'RTDB_EMULATOR_PORT',
8297
'RTDB_EMULATOR_NAMESPACE'

integration/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:ci": "node ../../scripts/run_tests_in_ci.js"
99
},
1010
"dependencies": {
11-
"firebase": "7.15.2"
11+
"firebase": "7.15.4"
1212
},
1313
"devDependencies": {
1414
"@babel/core": "7.9.6",

integration/firebase-typings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js"
88
},
99
"dependencies": {
10-
"firebase": "7.15.2"
10+
"firebase": "7.15.4"
1111
},
1212
"devDependencies": {
1313
"typescript": "3.8.3"

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:manual": "mocha --exit"
99
},
1010
"dependencies": {
11-
"firebase": "7.15.2"
11+
"firebase": "7.15.4"
1212
},
1313
"devDependencies": {
1414
"chai": "4.2.0",

integration/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js"
88
},
99
"dependencies": {
10-
"firebase": "7.15.2"
10+
"firebase": "7.15.4"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.9.6",

integration/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:ci": "node ../../scripts/run_tests_in_ci.js"
99
},
1010
"dependencies": {
11-
"firebase": "7.15.2"
11+
"firebase": "7.15.4"
1212
},
1313
"devDependencies": {
1414
"@babel/core": "7.9.6",

packages-exp/app-exp/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ import { name as appName } from '../package.json';
1919
import { name as analyticsName } from '../../../packages/analytics/package.json';
2020
import { name as authName } from '../../../packages/auth/package.json';
2121
import { name as databaseName } from '../../../packages/database/package.json';
22-
import { name as functionsName } from '../../../packages/functions/package.json';
22+
import { name as functionsName } from '../../../packages-exp/functions-exp/package.json';
2323
import { name as installationsName } from '../../../packages/installations/package.json';
2424
import { name as messagingName } from '../../../packages/messaging/package.json';
2525
import { name as performanceName } from '../../../packages/performance/package.json';
2626
import { name as remoteConfigName } from '../../../packages/remote-config/package.json';
2727
import { name as storageName } from '../../../packages/storage/package.json';
2828
import { name as firestoreName } from '../../../packages/firestore/package.json';
29-
import { name as packageName } from '../../../packages/firebase/package.json';
29+
import { name as packageName } from '../../../packages-exp/firebase-exp/package.json';
3030

3131
export const DEFAULT_ENTRY_NAME = '[DEFAULT]';
3232

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* eslint-disable @typescript-eslint/no-require-imports */
2+
/**
3+
* @license
4+
* Copyright 2020 Google LLC
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
const path = require('path');
19+
20+
module.exports = {
21+
extends: '../../config/.eslintrc.js',
22+
parserOptions: {
23+
project: 'tsconfig.json',
24+
// to make vscode-eslint work with monorepo
25+
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
26+
tsconfigRootDir: __dirname
27+
},
28+
rules: {
29+
'import/no-extraneous-dependencies': [
30+
'error',
31+
{
32+
'packageDir': [path.resolve(__dirname, '../../'), __dirname],
33+
devDependencies: true
34+
}
35+
]
36+
}
37+
};

packages-exp/functions-exp/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# `@firebase/functions`
2+
3+
This is the Firebase Functions component of the Firebase JS SDK.
4+
5+
**This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../config/api-extractor.json",
3+
// Point it to your entry point d.ts file.
4+
"mainEntryPointFilePath": "<projectFolder>/dist/src/index.d.ts",
5+
"dtsRollup": {
6+
"enabled": true,
7+
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
8+
"publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
9+
}
10+
}

packages/firestore/src/platform_node/node_init.ts renamed to packages-exp/functions-exp/karma.conf.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { PlatformSupport } from '../platform/platform';
19-
import { NodePlatform } from './node_platform';
18+
const karmaBase = require('../../config/karma.base');
2019

21-
/**
22-
* This code needs to run before Firestore is used. This can be achieved in
23-
* several ways:
24-
* 1) Through the JSCompiler compiling this code and then (automatically)
25-
* executing it before exporting the Firestore symbols.
26-
* 2) Through importing this module first in a Firestore main module
27-
*/
28-
PlatformSupport.setPlatform(new NodePlatform());
20+
const files = [`src/**/*.test.ts`];
21+
22+
module.exports = function(config) {
23+
const karmaConfig = Object.assign({}, karmaBase, {
24+
// files to load into karma
25+
files,
26+
// frameworks to use
27+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
28+
frameworks: ['mocha']
29+
});
30+
31+
config.set(karmaConfig);
32+
};
33+
34+
module.exports.files = files;
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "@firebase/functions-exp",
3+
"version": "0.0.800",
4+
"description": "",
5+
"private": true,
6+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
7+
"main": "dist/index.node.cjs.js",
8+
"browser": "dist/index.esm.js",
9+
"module": "dist/index.esm.js",
10+
"esm2017": "dist/index.esm2017.js",
11+
"files": [
12+
"dist"
13+
],
14+
"scripts": {
15+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
16+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
17+
"build": "rollup -c && yarn api-report",
18+
"build:deps": "lerna run --scope @firebase/functions-exp --include-dependencies build",
19+
"dev": "rollup -c -w",
20+
"test": "yarn type-check && run-p lint test:browser test:node",
21+
"test:ci": "node ../../scripts/run_tests_in_ci.js",
22+
"type-check": "tsc -p . --noEmit",
23+
"test:browser": "karma start --single-run",
24+
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
25+
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
26+
"test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://localhost:5005 run-p test:node",
27+
"prepare": "yarn build",
28+
"api-report": "api-extractor run --local --verbose",
29+
"predoc": "node ../../scripts/exp/remove-exp.js temp",
30+
"doc": "api-documenter markdown --input temp --output docs",
31+
"build:doc": "yarn build && yarn doc"
32+
},
33+
"license": "Apache-2.0",
34+
"peerDependencies": {
35+
"@firebase/app-exp": "0.x",
36+
"@firebase/app-types-exp": "0.x"
37+
},
38+
"devDependencies": {
39+
"@firebase/app-exp": "0.0.800",
40+
"rollup": "2.7.6",
41+
"rollup-plugin-typescript2": "0.27.0",
42+
"typescript": "3.8.3"
43+
},
44+
"repository": {
45+
"directory": "packages/functions",
46+
"type": "git",
47+
"url": "https://github.com/firebase/firebase-js-sdk.git"
48+
},
49+
"bugs": {
50+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
51+
},
52+
"typings": "dist/index.d.ts",
53+
"dependencies": {
54+
"@firebase/component": "0.1.14",
55+
"@firebase/functions-types-exp": "0.0.800",
56+
"@firebase/messaging": "0.6.18",
57+
"@firebase/messaging-types": "0.4.5",
58+
"@firebase/util": "0.2.49",
59+
"isomorphic-fetch": "2.2.1",
60+
"tslib": "1.11.1"
61+
},
62+
"nyc": {
63+
"extension": [
64+
".ts"
65+
],
66+
"reportDir": "./coverage/node"
67+
}
68+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**
2+
* @license
3+
* Copyright 2018 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 json from 'rollup-plugin-json';
19+
import typescriptPlugin from 'rollup-plugin-typescript2';
20+
import typescript from 'typescript';
21+
import pkg from './package.json';
22+
23+
const deps = Object.keys(
24+
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
25+
);
26+
27+
/**
28+
* ES5 Builds
29+
*/
30+
const es5BuildPlugins = [
31+
typescriptPlugin({
32+
typescript
33+
}),
34+
json()
35+
];
36+
37+
const es5Builds = [
38+
/**
39+
* Browser Builds
40+
*/
41+
{
42+
input: 'src/index.ts',
43+
output: [
44+
{ file: pkg.browser, format: 'cjs', sourcemap: true },
45+
{ file: pkg.module, format: 'es', sourcemap: true }
46+
],
47+
plugins: es5BuildPlugins,
48+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
49+
},
50+
/**
51+
* Node.js Build
52+
*/
53+
{
54+
input: 'src/index.node.ts',
55+
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
56+
plugins: es5BuildPlugins,
57+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
58+
}
59+
];
60+
61+
const es2017BuildPlugins = [
62+
typescriptPlugin({
63+
typescript,
64+
tsconfigOverride: {
65+
compilerOptions: {
66+
target: 'es2017'
67+
}
68+
}
69+
}),
70+
json({ preferConst: true })
71+
];
72+
73+
/**
74+
* ES2017 Builds
75+
*/
76+
const es2017Builds = [
77+
{
78+
/**
79+
* Browser Build
80+
*/
81+
input: 'src/index.ts',
82+
output: {
83+
file: pkg.esm2017,
84+
format: 'es',
85+
sourcemap: true
86+
},
87+
plugins: es2017BuildPlugins,
88+
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
89+
}
90+
];
91+
92+
export default [...es5Builds, ...es2017Builds];

0 commit comments

Comments
 (0)