firebase-tools 11.22.0 → 11.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/lib/commands/ext-configure.js +3 -3
  2. package/lib/commands/ext-dev-init.js +16 -4
  3. package/lib/commands/ext-dev-publish.js +3 -3
  4. package/lib/commands/ext-dev-register.js +2 -2
  5. package/lib/commands/ext-info.js +3 -3
  6. package/lib/commands/ext-install.js +2 -2
  7. package/lib/commands/ext-uninstall.js +2 -2
  8. package/lib/commands/ext-update.js +2 -2
  9. package/lib/commands/hosting-channel-create.js +2 -2
  10. package/lib/commands/hosting-channel-delete.js +2 -2
  11. package/lib/commands/hosting-channel-deploy.js +2 -2
  12. package/lib/commands/hosting-clone.js +2 -2
  13. package/lib/deploy/functions/release/fabricator.js +3 -0
  14. package/lib/deploy/functions/runtimes/node/index.js +8 -1
  15. package/lib/deploy/functions/runtimes/python/index.js +26 -13
  16. package/lib/deploy/hosting/convertConfig.js +2 -1
  17. package/lib/emulator/auth/apiSpec.js +17 -1
  18. package/lib/emulator/downloadableEmulators.js +6 -6
  19. package/lib/emulator/functionsEmulator.js +13 -16
  20. package/lib/emulator/functionsEmulatorRuntime.js +26 -42
  21. package/lib/emulator/functionsRuntimeWorker.js +48 -22
  22. package/lib/emulator/hub.js +6 -6
  23. package/lib/emulator/pubsubEmulator.js +12 -9
  24. package/lib/emulator/storage/apis/shared.js +2 -1
  25. package/lib/emulator/storage/cloudFunctions.js +1 -1
  26. package/lib/emulator/storage/files.js +18 -11
  27. package/lib/emulator/types.js +9 -9
  28. package/lib/extensions/askUserForConsent.js +4 -4
  29. package/lib/extensions/askUserForEventsConfig.js +2 -2
  30. package/lib/extensions/askUserForParam.js +2 -2
  31. package/lib/extensions/billingMigrationHelper.js +4 -4
  32. package/lib/extensions/change-log.js +4 -4
  33. package/lib/extensions/displayExtensionInfo.js +4 -4
  34. package/lib/extensions/extensionsApi.js +2 -2
  35. package/lib/extensions/extensionsHelper.js +6 -6
  36. package/lib/extensions/provisioningHelper.js +2 -2
  37. package/lib/extensions/updateHelper.js +2 -2
  38. package/lib/extensions/warnings.js +5 -5
  39. package/lib/frameworks/angular/index.js +6 -4
  40. package/lib/frameworks/index.js +38 -3
  41. package/lib/frameworks/lit/index.js +5 -1
  42. package/lib/frameworks/next/index.js +42 -16
  43. package/lib/frameworks/next/utils.js +1 -1
  44. package/lib/frameworks/preact/index.js +5 -1
  45. package/lib/frameworks/react/index.js +5 -1
  46. package/lib/frameworks/svelte/index.js +5 -1
  47. package/lib/frameworks/vite/index.js +6 -4
  48. package/lib/functions/python.js +2 -7
  49. package/lib/gcp/cloudfunctionsv2.js +8 -0
  50. package/lib/getDefaultHostingSite.js +3 -1
  51. package/lib/init/features/functions/index.js +10 -0
  52. package/lib/init/features/functions/python.js +48 -0
  53. package/lib/init/features/hosting/index.js +3 -2
  54. package/lib/projectUtils.js +2 -2
  55. package/lib/rc.js +4 -4
  56. package/npm-shrinkwrap.json +87 -79
  57. package/package.json +2 -2
  58. package/templates/extensions/extension.yaml +1 -1
  59. package/templates/extensions/integration-test.env +2 -0
  60. package/templates/extensions/integration-test.json +14 -0
  61. package/templates/extensions/javascript/WELCOME.md +14 -5
  62. package/templates/extensions/javascript/index.js +10 -10
  63. package/templates/extensions/javascript/integration-test.js +13 -0
  64. package/templates/extensions/javascript/package.lint.json +12 -4
  65. package/templates/extensions/javascript/package.nolint.json +11 -2
  66. package/templates/extensions/typescript/WELCOME.md +18 -5
  67. package/templates/extensions/typescript/_mocharc +10 -0
  68. package/templates/extensions/typescript/index.ts +16 -15
  69. package/templates/extensions/typescript/integration-test.ts +13 -0
  70. package/templates/extensions/typescript/package.lint.json +16 -4
  71. package/templates/extensions/typescript/package.nolint.json +12 -4
  72. package/templates/init/functions/javascript/_eslintrc +16 -2
  73. package/templates/init/functions/javascript/package.lint.json +4 -4
  74. package/templates/init/functions/javascript/package.nolint.json +3 -3
  75. package/templates/init/functions/python/_gitignore +0 -0
  76. package/templates/init/functions/python/main.py +13 -0
  77. package/templates/init/functions/python/requirements.txt +1 -0
  78. package/templates/init/functions/typescript/_eslintrc +1 -0
  79. package/templates/init/functions/typescript/package.lint.json +4 -4
  80. package/templates/init/functions/typescript/package.nolint.json +4 -3
@@ -0,0 +1,13 @@
1
+ import axios from "axios";
2
+ import { expect } from "chai";
3
+
4
+ describe("greet-the-world", () => {
5
+ it("should respond with the configured greeting", async () => {
6
+ const expected = "Hello World from greet-the-world";
7
+
8
+ const httpFunctionUri = "http://localhost:5001/demo-test/us-central1/ext-greet-the-world-greetTheWorld/";
9
+ const res = await axios.get(httpFunctionUri);
10
+
11
+ return expect(res.data).to.eql(expected);
12
+ }).timeout(10000);
13
+ });
@@ -2,18 +2,30 @@
2
2
  "name": "functions",
3
3
  "scripts": {
4
4
  "lint": "eslint \"src/**/*\"",
5
+ "lint:fix": "eslint \"src/**/*\" --fix",
5
6
  "build": "tsc",
6
- "build:watch": "tsc --watch"
7
+ "build:watch": "tsc --watch",
8
+ "mocha": "mocha '**/*.spec.ts'",
9
+ "test": "(cd integration-tests && firebase emulators:exec 'npm run mocha' -P demo-test)"
7
10
  },
8
11
  "main": "lib/index.js",
9
12
  "dependencies": {
10
- "firebase-admin": "^10.2.0",
11
- "firebase-functions": "^3.21.0"
13
+ "firebase-admin": "^11.5.0",
14
+ "firebase-functions": "^4.2.0"
12
15
  },
13
16
  "devDependencies": {
17
+ "@types/chai": "^4.3.4",
18
+ "@types/mocha": "^10.0.1",
19
+ "@typescript-eslint/eslint-plugin": "^5.12.0",
20
+ "@typescript-eslint/parser": "^5.12.0",
14
21
  "eslint": "^8.15.1",
15
22
  "eslint-plugin-import": "^2.26.0",
16
- "typescript": "^4.6.4"
23
+ "eslint-config-google": "^0.14.0",
24
+ "typescript": "^4.9.0",
25
+ "axios": "^1.3.2",
26
+ "chai": "^4.3.7",
27
+ "mocha": "^10.2.0",
28
+ "ts-node": "^10.4.0"
17
29
  },
18
30
  "private": true
19
31
  }
@@ -2,15 +2,23 @@
2
2
  "name": "functions",
3
3
  "scripts": {
4
4
  "build": "tsc",
5
- "build:watch": "tsc --watch"
5
+ "build:watch": "tsc --watch",
6
+ "mocha": "mocha '**/*.spec.ts'",
7
+ "test": "(cd integration-tests && firebase emulators:exec 'npm run mocha' -P demo-test)"
6
8
  },
7
9
  "main": "lib/index.js",
8
10
  "dependencies": {
9
- "firebase-admin": "^9.8.0",
10
- "firebase-functions": "^3.14.1"
11
+ "firebase-admin": "^11.5.0",
12
+ "firebase-functions": "^4.2.0"
11
13
  },
12
14
  "devDependencies": {
13
- "typescript": "^3.8.0"
15
+ "@types/chai": "^4.3.4",
16
+ "@types/mocha": "^10.0.1",
17
+ "typescript": "^4.9.0",
18
+ "axios": "^1.3.2",
19
+ "chai": "^4.3.7",
20
+ "mocha": "^10.2.0",
21
+ "ts-node": "^10.4.0"
14
22
  },
15
23
  "private": true
16
24
  }
@@ -1,14 +1,28 @@
1
1
  module.exports = {
2
- root: true,
3
2
  env: {
4
3
  es6: true,
5
4
  node: true,
6
5
  },
6
+ parserOptions: {
7
+ "ecmaVersion": 2018,
8
+ },
7
9
  extends: [
8
10
  "eslint:recommended",
9
11
  "google",
10
12
  ],
11
13
  rules: {
12
- quotes: ["error", "double"],
14
+ "no-restricted-globals": ["error", "name", "length"],
15
+ "prefer-arrow-callback": "error",
16
+ "quotes": ["error", "double", {"allowTemplateLiterals": true}],
13
17
  },
18
+ overrides: [
19
+ {
20
+ files: ["**/*.spec.*"],
21
+ env: {
22
+ mocha: true,
23
+ },
24
+ rules: {},
25
+ },
26
+ ],
27
+ globals: {},
14
28
  };
@@ -14,13 +14,13 @@
14
14
  },
15
15
  "main": "index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^10.0.2",
18
- "firebase-functions": "^3.18.0"
17
+ "firebase-admin": "^111.5.0",
18
+ "firebase-functions": "^4.2.0"
19
19
  },
20
20
  "devDependencies": {
21
- "eslint": "^8.9.0",
21
+ "eslint": "^8.15.0",
22
22
  "eslint-config-google": "^0.14.0",
23
- "firebase-functions-test": "^0.2.0"
23
+ "firebase-functions-test": "^3.0.0"
24
24
  },
25
25
  "private": true
26
26
  }
@@ -13,11 +13,11 @@
13
13
  },
14
14
  "main": "index.js",
15
15
  "dependencies": {
16
- "firebase-admin": "^10.0.2",
17
- "firebase-functions": "^3.18.0"
16
+ "firebase-admin": "^11.5.0",
17
+ "firebase-functions": "^4.2.0"
18
18
  },
19
19
  "devDependencies": {
20
- "firebase-functions-test": "^0.2.0"
20
+ "firebase-functions-test": "^3.0.0"
21
21
  },
22
22
  "private": true
23
23
  }
File without changes
@@ -0,0 +1,13 @@
1
+ # Welcome to Cloud Functions for Firebase for Python!
2
+ # To get started, simply uncomment the below code or create your own.
3
+ # Deploy with `firebase deploy`
4
+
5
+ from firebase_functions import https
6
+ from firebase_admin import initialize_app
7
+
8
+ # initialize_app()
9
+ #
10
+ #
11
+ # @https.on_request()
12
+ # def on_request_example(req: https.Request) -> https.Response:
13
+ # return https.Response("Hello world!")
@@ -0,0 +1 @@
1
+ git+https://github.com/firebase/firebase-functions-python.git@main#egg=firebase-functions
@@ -27,5 +27,6 @@ module.exports = {
27
27
  rules: {
28
28
  "quotes": ["error", "double"],
29
29
  "import/no-unresolved": 0,
30
+ "indent": ["error", 2]
30
31
  },
31
32
  };
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "lib/index.js",
17
17
  "dependencies": {
18
- "firebase-admin": "^10.0.2",
19
- "firebase-functions": "^3.18.0"
18
+ "firebase-admin": "^11.5.0",
19
+ "firebase-functions": "^4.2.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@typescript-eslint/eslint-plugin": "^5.12.0",
@@ -24,8 +24,8 @@
24
24
  "eslint": "^8.9.0",
25
25
  "eslint-config-google": "^0.14.0",
26
26
  "eslint-plugin-import": "^2.25.4",
27
- "firebase-functions-test": "^0.2.0",
28
- "typescript": "^4.5.4"
27
+ "firebase-functions-test": "^3.0.0",
28
+ "typescript": "^4.9.0"
29
29
  },
30
30
  "private": true
31
31
  }
@@ -14,11 +14,12 @@
14
14
  },
15
15
  "main": "lib/index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^10.2.0",
18
- "firebase-functions": "^3.21.0"
17
+ "firebase-admin": "^11.5.0",
18
+ "firebase-functions": "^4.2.0"
19
19
  },
20
20
  "devDependencies": {
21
- "typescript": "^4.6.4"
21
+ "typescript": "^4.9.0",
22
+ "firebase-functions-test": "^3.0.0"
22
23
  },
23
24
  "private": true
24
25
  }