diff --git a/.changeset/slimy-cups-promise.md b/.changeset/slimy-cups-promise.md new file mode 100644 index 00000000000..9456c0d5b04 --- /dev/null +++ b/.changeset/slimy-cups-promise.md @@ -0,0 +1,6 @@ +--- +'@firebase/functions-compat': patch +'@firebase/functions': patch +--- + +Remove node bundle from the functions SDK as the node-specific fetch code has been removed in favor of using native fetch throughout the SDK. diff --git a/packages/functions-compat/package.json b/packages/functions-compat/package.json index 584c7126c61..d30a085e30b 100644 --- a/packages/functions-compat/package.json +++ b/packages/functions-compat/package.json @@ -3,7 +3,7 @@ "version": "0.3.14", "description": "", "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", + "main": "dist/index.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", "esm5": "dist/index.esm5.js", @@ -11,8 +11,8 @@ ".": { "types": "./dist/src/index.d.ts", "node": { - "import": "./dist/node-esm/index.node.esm.js", - "require": "./dist/index.node.cjs.js" + "require": "./dist/index.cjs.js", + "import": "./dist/index.esm2017.js" }, "esm5": "./dist/index.esm5.js", "browser": { @@ -57,7 +57,7 @@ "test:all": "run-p --npm-path npm test:browser test:node", "test:browser": "karma start", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", - "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", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --config ../../config/mocharc.node.js", "test:emulator": "env FIREBASE_FUNCTIONS_HOST=http://localhost FIREBASE_FUNCTIONS_PORT=5005 run-p --npm-path npm test:node", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../functions/dist/functions-public.d.ts -o dist/src/index.d.ts -a -r Functions:types.FirebaseFunctions -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/functions" diff --git a/packages/functions-compat/rollup.config.js b/packages/functions-compat/rollup.config.js index 949aeebd513..53aad50475a 100644 --- a/packages/functions-compat/rollup.config.js +++ b/packages/functions-compat/rollup.config.js @@ -73,21 +73,4 @@ const browserBuilds = [ } ]; -const nodeBuilds = [ - { - input: 'src/index.node.ts', - output: [{ file: pkg.main, format: 'cjs', sourcemap: true }], - plugins: es5BuildPlugins, - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - }, - { - input: 'src/index.node.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - plugins: [...es2017BuildPlugins, emitModulePackageFile()], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) - } -]; - -export default [...browserBuilds, ...nodeBuilds]; +export default [...browserBuilds]; diff --git a/packages/functions-compat/src/index.node.ts b/packages/functions-compat/src/index.node.ts deleted file mode 100644 index e7b3c108ac4..00000000000 --- a/packages/functions-compat/src/index.node.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import firebase from '@firebase/app-compat'; -import { name, version } from '../package.json'; -import { registerFunctions } from './register'; - -registerFunctions(); -firebase.registerVersion(name, version, 'node'); diff --git a/packages/functions/package.json b/packages/functions/package.json index 62146df01c6..084bd1b28db 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -3,7 +3,7 @@ "version": "0.11.8", "description": "", "author": "Firebase (https://firebase.google.com/)", - "main": "dist/index.node.cjs.js", + "main": "dist/index.cjs.js", "browser": "dist/index.esm2017.js", "module": "dist/index.esm2017.js", "esm5": "dist/index.esm.js", @@ -11,8 +11,8 @@ ".": { "types": "./dist/functions-public.d.ts", "node": { - "import": "./dist/esm-node/index.node.esm.js", - "require": "./dist/index.node.cjs.js" + "import": "./dist/index.esm2017.js", + "require": "./dist/index.cjs.js" }, "esm5": "./dist/index.esm.js", "browser": { @@ -38,7 +38,7 @@ "test:all": "run-p --npm-path npm test:browser test:node", "test:browser": "karma start", "test:browser:debug": "karma start --browsers=Chrome --auto-watch", - "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", + "test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.ts --config ../../config/mocharc.node.js", "test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://localhost:5005 run-p --npm-path npm test:node", "trusted-type-check": "tsec -p tsconfig.json --noEmit", "api-report": "api-extractor run --local --verbose", diff --git a/packages/functions/rollup.config.js b/packages/functions/rollup.config.js index bb5506ea9b5..4bc7f73d869 100644 --- a/packages/functions/rollup.config.js +++ b/packages/functions/rollup.config.js @@ -84,28 +84,4 @@ const browserBuilds = [ } ]; -const nodeBuilds = [ - { - input: 'src/index.node.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.node.ts', - output: [ - { file: pkg.exports['.'].node.import, format: 'es', sourcemap: true } - ], - external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)), - plugins: [ - ...es2017BuildPlugins, - replace(generateBuildTargetReplaceConfig('esm', 2017)), - emitModulePackageFile() - ] - } -]; - -export default [...browserBuilds, ...nodeBuilds]; +export default [...browserBuilds]; diff --git a/packages/functions/src/index.node.ts b/packages/functions/src/index.node.ts deleted file mode 100644 index 6b1a2ee2939..00000000000 --- a/packages/functions/src/index.node.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2017 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { registerFunctions } from './config'; - -export * from './api'; -export * from './public-types'; - -registerFunctions('node');