firebase-tools 11.22.0 → 11.23.0
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.
- package/lib/commands/ext-configure.js +3 -3
- package/lib/commands/ext-dev-init.js +16 -4
- package/lib/commands/ext-dev-publish.js +3 -3
- package/lib/commands/ext-dev-register.js +2 -2
- package/lib/commands/ext-info.js +3 -3
- package/lib/commands/ext-install.js +2 -2
- package/lib/commands/ext-uninstall.js +2 -2
- package/lib/commands/ext-update.js +2 -2
- package/lib/commands/hosting-channel-create.js +2 -2
- package/lib/commands/hosting-channel-delete.js +2 -2
- package/lib/commands/hosting-channel-deploy.js +2 -2
- package/lib/commands/hosting-clone.js +2 -2
- package/lib/deploy/functions/release/fabricator.js +3 -0
- package/lib/deploy/functions/runtimes/python/index.js +26 -13
- package/lib/deploy/hosting/convertConfig.js +2 -1
- package/lib/emulator/auth/apiSpec.js +17 -1
- package/lib/emulator/downloadableEmulators.js +6 -6
- package/lib/emulator/functionsEmulator.js +12 -15
- package/lib/emulator/functionsEmulatorRuntime.js +26 -42
- package/lib/emulator/functionsRuntimeWorker.js +48 -22
- package/lib/emulator/hub.js +6 -6
- package/lib/emulator/pubsubEmulator.js +12 -9
- package/lib/emulator/storage/apis/shared.js +2 -1
- package/lib/emulator/storage/cloudFunctions.js +1 -1
- package/lib/emulator/storage/files.js +18 -11
- package/lib/emulator/types.js +9 -9
- package/lib/extensions/askUserForConsent.js +4 -4
- package/lib/extensions/askUserForEventsConfig.js +2 -2
- package/lib/extensions/askUserForParam.js +2 -2
- package/lib/extensions/billingMigrationHelper.js +4 -4
- package/lib/extensions/change-log.js +4 -4
- package/lib/extensions/displayExtensionInfo.js +4 -4
- package/lib/extensions/extensionsApi.js +2 -2
- package/lib/extensions/extensionsHelper.js +6 -6
- package/lib/extensions/provisioningHelper.js +2 -2
- package/lib/extensions/updateHelper.js +2 -2
- package/lib/extensions/warnings.js +5 -5
- package/lib/frameworks/angular/index.js +6 -4
- package/lib/frameworks/index.js +38 -3
- package/lib/frameworks/lit/index.js +5 -1
- package/lib/frameworks/next/index.js +42 -16
- package/lib/frameworks/next/utils.js +1 -1
- package/lib/frameworks/preact/index.js +5 -1
- package/lib/frameworks/react/index.js +5 -1
- package/lib/frameworks/svelte/index.js +5 -1
- package/lib/frameworks/vite/index.js +6 -4
- package/lib/functions/python.js +2 -7
- package/lib/gcp/cloudfunctionsv2.js +8 -0
- package/lib/getDefaultHostingSite.js +3 -1
- package/lib/init/features/functions/index.js +10 -0
- package/lib/init/features/functions/python.js +48 -0
- package/lib/init/features/hosting/index.js +3 -2
- package/lib/projectUtils.js +2 -2
- package/lib/rc.js +4 -4
- package/npm-shrinkwrap.json +87 -79
- package/package.json +2 -2
- package/templates/extensions/extension.yaml +1 -1
- package/templates/extensions/integration-test.env +2 -0
- package/templates/extensions/integration-test.json +14 -0
- package/templates/extensions/javascript/WELCOME.md +14 -5
- package/templates/extensions/javascript/index.js +10 -10
- package/templates/extensions/javascript/integration-test.js +13 -0
- package/templates/extensions/javascript/package.lint.json +12 -4
- package/templates/extensions/javascript/package.nolint.json +11 -2
- package/templates/extensions/typescript/WELCOME.md +18 -5
- package/templates/extensions/typescript/_mocharc +10 -0
- package/templates/extensions/typescript/index.ts +16 -15
- package/templates/extensions/typescript/integration-test.ts +13 -0
- package/templates/extensions/typescript/package.lint.json +16 -4
- package/templates/extensions/typescript/package.nolint.json +12 -4
- package/templates/init/functions/javascript/_eslintrc +16 -2
- package/templates/init/functions/javascript/package.lint.json +4 -4
- package/templates/init/functions/javascript/package.nolint.json +3 -3
- package/templates/init/functions/python/_gitignore +0 -0
- package/templates/init/functions/python/main.py +13 -0
- package/templates/init/functions/python/requirements.txt +1 -0
- package/templates/init/functions/typescript/_eslintrc +1 -0
- package/templates/init/functions/typescript/package.lint.json +4 -4
- package/templates/init/functions/typescript/package.nolint.json +4 -3
package/lib/rc.js
CHANGED
|
@@ -23,10 +23,6 @@ function loadRC(options) {
|
|
|
23
23
|
}
|
|
24
24
|
exports.loadRC = loadRC;
|
|
25
25
|
class RC {
|
|
26
|
-
constructor(rcpath, data) {
|
|
27
|
-
this.path = rcpath;
|
|
28
|
-
this.data = Object.assign({ projects: {}, targets: {}, etags: {} }, data);
|
|
29
|
-
}
|
|
30
26
|
static loadFile(rcpath) {
|
|
31
27
|
let data = {};
|
|
32
28
|
if (fsutils.fileExistsSync(rcpath)) {
|
|
@@ -39,6 +35,10 @@ class RC {
|
|
|
39
35
|
}
|
|
40
36
|
return new RC(rcpath, data);
|
|
41
37
|
}
|
|
38
|
+
constructor(rcpath, data) {
|
|
39
|
+
this.path = rcpath;
|
|
40
|
+
this.data = Object.assign({ projects: {}, targets: {}, etags: {} }, data);
|
|
41
|
+
}
|
|
42
42
|
set(key, value) {
|
|
43
43
|
_.set(this.data, key, value);
|
|
44
44
|
return;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.23.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "firebase-tools",
|
|
9
|
-
"version": "11.
|
|
9
|
+
"version": "11.23.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@google-cloud/pubsub": "^3.0.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"stream-chain": "^2.2.4",
|
|
58
58
|
"stream-json": "^1.7.3",
|
|
59
59
|
"strip-ansi": "^6.0.1",
|
|
60
|
-
"superstatic": "^9.0.
|
|
60
|
+
"superstatic": "^9.0.3",
|
|
61
61
|
"tar": "^6.1.11",
|
|
62
62
|
"tcp-port-used": "^1.0.2",
|
|
63
63
|
"tmp": "^0.2.1",
|
|
@@ -512,9 +512,9 @@
|
|
|
512
512
|
"integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA=="
|
|
513
513
|
},
|
|
514
514
|
"node_modules/@types/node": {
|
|
515
|
-
"version": "14.18.
|
|
516
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.
|
|
517
|
-
"integrity": "sha512-
|
|
515
|
+
"version": "14.18.36",
|
|
516
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz",
|
|
517
|
+
"integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ=="
|
|
518
518
|
},
|
|
519
519
|
"node_modules/abbrev": {
|
|
520
520
|
"version": "1.1.1",
|
|
@@ -2140,24 +2140,27 @@
|
|
|
2140
2140
|
}
|
|
2141
2141
|
},
|
|
2142
2142
|
"node_modules/eslint-visitor-keys": {
|
|
2143
|
-
"version": "3.
|
|
2144
|
-
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.
|
|
2145
|
-
"integrity": "sha512-
|
|
2143
|
+
"version": "3.3.0",
|
|
2144
|
+
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
|
|
2145
|
+
"integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==",
|
|
2146
2146
|
"engines": {
|
|
2147
2147
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
2148
2148
|
}
|
|
2149
2149
|
},
|
|
2150
2150
|
"node_modules/espree": {
|
|
2151
|
-
"version": "9.
|
|
2152
|
-
"resolved": "https://registry.npmjs.org/espree/-/espree-9.
|
|
2153
|
-
"integrity": "sha512-
|
|
2151
|
+
"version": "9.4.1",
|
|
2152
|
+
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
|
|
2153
|
+
"integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
|
|
2154
2154
|
"dependencies": {
|
|
2155
|
-
"acorn": "^8.
|
|
2156
|
-
"acorn-jsx": "^5.3.
|
|
2157
|
-
"eslint-visitor-keys": "^3.
|
|
2155
|
+
"acorn": "^8.8.0",
|
|
2156
|
+
"acorn-jsx": "^5.3.2",
|
|
2157
|
+
"eslint-visitor-keys": "^3.3.0"
|
|
2158
2158
|
},
|
|
2159
2159
|
"engines": {
|
|
2160
2160
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
2161
|
+
},
|
|
2162
|
+
"funding": {
|
|
2163
|
+
"url": "https://opencollective.com/eslint"
|
|
2161
2164
|
}
|
|
2162
2165
|
},
|
|
2163
2166
|
"node_modules/esprima": {
|
|
@@ -3387,9 +3390,9 @@
|
|
|
3387
3390
|
}
|
|
3388
3391
|
},
|
|
3389
3392
|
"node_modules/http-cache-semantics": {
|
|
3390
|
-
"version": "4.1.
|
|
3391
|
-
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.
|
|
3392
|
-
"integrity": "sha512-
|
|
3393
|
+
"version": "4.1.1",
|
|
3394
|
+
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
|
|
3395
|
+
"integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==",
|
|
3393
3396
|
"optional": true
|
|
3394
3397
|
},
|
|
3395
3398
|
"node_modules/http-errors": {
|
|
@@ -3587,9 +3590,9 @@
|
|
|
3587
3590
|
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
|
3588
3591
|
},
|
|
3589
3592
|
"node_modules/inquirer": {
|
|
3590
|
-
"version": "8.2.
|
|
3591
|
-
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.
|
|
3592
|
-
"integrity": "sha512-
|
|
3593
|
+
"version": "8.2.5",
|
|
3594
|
+
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz",
|
|
3595
|
+
"integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==",
|
|
3593
3596
|
"dependencies": {
|
|
3594
3597
|
"ansi-escapes": "^4.2.1",
|
|
3595
3598
|
"chalk": "^4.1.1",
|
|
@@ -3601,13 +3604,14 @@
|
|
|
3601
3604
|
"mute-stream": "0.0.8",
|
|
3602
3605
|
"ora": "^5.4.1",
|
|
3603
3606
|
"run-async": "^2.4.0",
|
|
3604
|
-
"rxjs": "^7.
|
|
3607
|
+
"rxjs": "^7.5.5",
|
|
3605
3608
|
"string-width": "^4.1.0",
|
|
3606
3609
|
"strip-ansi": "^6.0.0",
|
|
3607
|
-
"through": "^2.3.6"
|
|
3610
|
+
"through": "^2.3.6",
|
|
3611
|
+
"wrap-ansi": "^7.0.0"
|
|
3608
3612
|
},
|
|
3609
3613
|
"engines": {
|
|
3610
|
-
"node": ">=
|
|
3614
|
+
"node": ">=12.0.0"
|
|
3611
3615
|
}
|
|
3612
3616
|
},
|
|
3613
3617
|
"node_modules/inquirer/node_modules/ansi-escapes": {
|
|
@@ -3836,9 +3840,9 @@
|
|
|
3836
3840
|
}
|
|
3837
3841
|
},
|
|
3838
3842
|
"node_modules/is-path-inside": {
|
|
3839
|
-
"version": "3.0.
|
|
3840
|
-
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.
|
|
3841
|
-
"integrity": "sha512
|
|
3843
|
+
"version": "3.0.3",
|
|
3844
|
+
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
|
3845
|
+
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
|
3842
3846
|
"engines": {
|
|
3843
3847
|
"node": ">=8"
|
|
3844
3848
|
}
|
|
@@ -4562,9 +4566,9 @@
|
|
|
4562
4566
|
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
|
4563
4567
|
},
|
|
4564
4568
|
"node_modules/marked": {
|
|
4565
|
-
"version": "4.
|
|
4566
|
-
"resolved": "https://registry.npmjs.org/marked/-/marked-4.
|
|
4567
|
-
"integrity": "sha512-
|
|
4569
|
+
"version": "4.2.12",
|
|
4570
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz",
|
|
4571
|
+
"integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==",
|
|
4568
4572
|
"bin": {
|
|
4569
4573
|
"marked": "bin/marked.js"
|
|
4570
4574
|
},
|
|
@@ -6192,12 +6196,12 @@
|
|
|
6192
6196
|
}
|
|
6193
6197
|
},
|
|
6194
6198
|
"node_modules/superstatic": {
|
|
6195
|
-
"version": "9.0.
|
|
6196
|
-
"resolved": "https://registry.npmjs.org/superstatic/-/superstatic-9.0.
|
|
6197
|
-
"integrity": "sha512-
|
|
6199
|
+
"version": "9.0.3",
|
|
6200
|
+
"resolved": "https://registry.npmjs.org/superstatic/-/superstatic-9.0.3.tgz",
|
|
6201
|
+
"integrity": "sha512-e/tmW0bsnQ/33ivK6y3CapJT0Ovy4pk/ohNPGhIAGU2oasoNLRQ1cv6enua09NU9w6Y0H/fBu07cjzuiWvLXxw==",
|
|
6198
6202
|
"dependencies": {
|
|
6199
6203
|
"basic-auth-connect": "^1.0.0",
|
|
6200
|
-
"commander": "^
|
|
6204
|
+
"commander": "^10.0.0",
|
|
6201
6205
|
"compression": "^1.7.0",
|
|
6202
6206
|
"connect": "^3.7.0",
|
|
6203
6207
|
"destroy": "^1.0.4",
|
|
@@ -6207,7 +6211,7 @@
|
|
|
6207
6211
|
"join-path": "^1.1.1",
|
|
6208
6212
|
"lodash": "^4.17.19",
|
|
6209
6213
|
"mime-types": "^2.1.35",
|
|
6210
|
-
"minimatch": "^
|
|
6214
|
+
"minimatch": "^6.1.6",
|
|
6211
6215
|
"morgan": "^1.8.2",
|
|
6212
6216
|
"on-finished": "^2.2.0",
|
|
6213
6217
|
"on-headers": "^1.0.0",
|
|
@@ -6234,11 +6238,11 @@
|
|
|
6234
6238
|
}
|
|
6235
6239
|
},
|
|
6236
6240
|
"node_modules/superstatic/node_modules/commander": {
|
|
6237
|
-
"version": "
|
|
6238
|
-
"resolved": "https://registry.npmjs.org/commander/-/commander-
|
|
6239
|
-
"integrity": "sha512-
|
|
6241
|
+
"version": "10.0.0",
|
|
6242
|
+
"resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz",
|
|
6243
|
+
"integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==",
|
|
6240
6244
|
"engines": {
|
|
6241
|
-
"node": "
|
|
6245
|
+
"node": ">=14"
|
|
6242
6246
|
}
|
|
6243
6247
|
},
|
|
6244
6248
|
"node_modules/superstatic/node_modules/isarray": {
|
|
@@ -6247,14 +6251,17 @@
|
|
|
6247
6251
|
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
|
|
6248
6252
|
},
|
|
6249
6253
|
"node_modules/superstatic/node_modules/minimatch": {
|
|
6250
|
-
"version": "
|
|
6251
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-
|
|
6252
|
-
"integrity": "sha512-
|
|
6254
|
+
"version": "6.2.0",
|
|
6255
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz",
|
|
6256
|
+
"integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==",
|
|
6253
6257
|
"dependencies": {
|
|
6254
6258
|
"brace-expansion": "^2.0.1"
|
|
6255
6259
|
},
|
|
6256
6260
|
"engines": {
|
|
6257
6261
|
"node": ">=10"
|
|
6262
|
+
},
|
|
6263
|
+
"funding": {
|
|
6264
|
+
"url": "https://github.com/sponsors/isaacs"
|
|
6258
6265
|
}
|
|
6259
6266
|
},
|
|
6260
6267
|
"node_modules/superstatic/node_modules/path-to-regexp": {
|
|
@@ -7485,9 +7492,9 @@
|
|
|
7485
7492
|
"integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA=="
|
|
7486
7493
|
},
|
|
7487
7494
|
"@types/node": {
|
|
7488
|
-
"version": "14.18.
|
|
7489
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.
|
|
7490
|
-
"integrity": "sha512-
|
|
7495
|
+
"version": "14.18.36",
|
|
7496
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz",
|
|
7497
|
+
"integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ=="
|
|
7491
7498
|
},
|
|
7492
7499
|
"abbrev": {
|
|
7493
7500
|
"version": "1.1.1",
|
|
@@ -8741,18 +8748,18 @@
|
|
|
8741
8748
|
}
|
|
8742
8749
|
},
|
|
8743
8750
|
"eslint-visitor-keys": {
|
|
8744
|
-
"version": "3.
|
|
8745
|
-
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.
|
|
8746
|
-
"integrity": "sha512-
|
|
8751
|
+
"version": "3.3.0",
|
|
8752
|
+
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
|
|
8753
|
+
"integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA=="
|
|
8747
8754
|
},
|
|
8748
8755
|
"espree": {
|
|
8749
|
-
"version": "9.
|
|
8750
|
-
"resolved": "https://registry.npmjs.org/espree/-/espree-9.
|
|
8751
|
-
"integrity": "sha512-
|
|
8756
|
+
"version": "9.4.1",
|
|
8757
|
+
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
|
|
8758
|
+
"integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
|
|
8752
8759
|
"requires": {
|
|
8753
|
-
"acorn": "^8.
|
|
8754
|
-
"acorn-jsx": "^5.3.
|
|
8755
|
-
"eslint-visitor-keys": "^3.
|
|
8760
|
+
"acorn": "^8.8.0",
|
|
8761
|
+
"acorn-jsx": "^5.3.2",
|
|
8762
|
+
"eslint-visitor-keys": "^3.3.0"
|
|
8756
8763
|
}
|
|
8757
8764
|
},
|
|
8758
8765
|
"esprima": {
|
|
@@ -9703,9 +9710,9 @@
|
|
|
9703
9710
|
"integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw=="
|
|
9704
9711
|
},
|
|
9705
9712
|
"http-cache-semantics": {
|
|
9706
|
-
"version": "4.1.
|
|
9707
|
-
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.
|
|
9708
|
-
"integrity": "sha512-
|
|
9713
|
+
"version": "4.1.1",
|
|
9714
|
+
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
|
|
9715
|
+
"integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==",
|
|
9709
9716
|
"optional": true
|
|
9710
9717
|
},
|
|
9711
9718
|
"http-errors": {
|
|
@@ -9855,9 +9862,9 @@
|
|
|
9855
9862
|
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
|
|
9856
9863
|
},
|
|
9857
9864
|
"inquirer": {
|
|
9858
|
-
"version": "8.2.
|
|
9859
|
-
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.
|
|
9860
|
-
"integrity": "sha512-
|
|
9865
|
+
"version": "8.2.5",
|
|
9866
|
+
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz",
|
|
9867
|
+
"integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==",
|
|
9861
9868
|
"requires": {
|
|
9862
9869
|
"ansi-escapes": "^4.2.1",
|
|
9863
9870
|
"chalk": "^4.1.1",
|
|
@@ -9869,10 +9876,11 @@
|
|
|
9869
9876
|
"mute-stream": "0.0.8",
|
|
9870
9877
|
"ora": "^5.4.1",
|
|
9871
9878
|
"run-async": "^2.4.0",
|
|
9872
|
-
"rxjs": "^7.
|
|
9879
|
+
"rxjs": "^7.5.5",
|
|
9873
9880
|
"string-width": "^4.1.0",
|
|
9874
9881
|
"strip-ansi": "^6.0.0",
|
|
9875
|
-
"through": "^2.3.6"
|
|
9882
|
+
"through": "^2.3.6",
|
|
9883
|
+
"wrap-ansi": "^7.0.0"
|
|
9876
9884
|
},
|
|
9877
9885
|
"dependencies": {
|
|
9878
9886
|
"ansi-escapes": {
|
|
@@ -10024,9 +10032,9 @@
|
|
|
10024
10032
|
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
|
|
10025
10033
|
},
|
|
10026
10034
|
"is-path-inside": {
|
|
10027
|
-
"version": "3.0.
|
|
10028
|
-
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.
|
|
10029
|
-
"integrity": "sha512
|
|
10035
|
+
"version": "3.0.3",
|
|
10036
|
+
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
|
10037
|
+
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ=="
|
|
10030
10038
|
},
|
|
10031
10039
|
"is-stream": {
|
|
10032
10040
|
"version": "1.1.0",
|
|
@@ -10630,9 +10638,9 @@
|
|
|
10630
10638
|
"requires": {}
|
|
10631
10639
|
},
|
|
10632
10640
|
"marked": {
|
|
10633
|
-
"version": "4.
|
|
10634
|
-
"resolved": "https://registry.npmjs.org/marked/-/marked-4.
|
|
10635
|
-
"integrity": "sha512-
|
|
10641
|
+
"version": "4.2.12",
|
|
10642
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz",
|
|
10643
|
+
"integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw=="
|
|
10636
10644
|
},
|
|
10637
10645
|
"marked-terminal": {
|
|
10638
10646
|
"version": "5.1.1",
|
|
@@ -11876,12 +11884,12 @@
|
|
|
11876
11884
|
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
|
|
11877
11885
|
},
|
|
11878
11886
|
"superstatic": {
|
|
11879
|
-
"version": "9.0.
|
|
11880
|
-
"resolved": "https://registry.npmjs.org/superstatic/-/superstatic-9.0.
|
|
11881
|
-
"integrity": "sha512-
|
|
11887
|
+
"version": "9.0.3",
|
|
11888
|
+
"resolved": "https://registry.npmjs.org/superstatic/-/superstatic-9.0.3.tgz",
|
|
11889
|
+
"integrity": "sha512-e/tmW0bsnQ/33ivK6y3CapJT0Ovy4pk/ohNPGhIAGU2oasoNLRQ1cv6enua09NU9w6Y0H/fBu07cjzuiWvLXxw==",
|
|
11882
11890
|
"requires": {
|
|
11883
11891
|
"basic-auth-connect": "^1.0.0",
|
|
11884
|
-
"commander": "^
|
|
11892
|
+
"commander": "^10.0.0",
|
|
11885
11893
|
"compression": "^1.7.0",
|
|
11886
11894
|
"connect": "^3.7.0",
|
|
11887
11895
|
"destroy": "^1.0.4",
|
|
@@ -11891,7 +11899,7 @@
|
|
|
11891
11899
|
"join-path": "^1.1.1",
|
|
11892
11900
|
"lodash": "^4.17.19",
|
|
11893
11901
|
"mime-types": "^2.1.35",
|
|
11894
|
-
"minimatch": "^
|
|
11902
|
+
"minimatch": "^6.1.6",
|
|
11895
11903
|
"morgan": "^1.8.2",
|
|
11896
11904
|
"on-finished": "^2.2.0",
|
|
11897
11905
|
"on-headers": "^1.0.0",
|
|
@@ -11910,9 +11918,9 @@
|
|
|
11910
11918
|
}
|
|
11911
11919
|
},
|
|
11912
11920
|
"commander": {
|
|
11913
|
-
"version": "
|
|
11914
|
-
"resolved": "https://registry.npmjs.org/commander/-/commander-
|
|
11915
|
-
"integrity": "sha512-
|
|
11921
|
+
"version": "10.0.0",
|
|
11922
|
+
"resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz",
|
|
11923
|
+
"integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA=="
|
|
11916
11924
|
},
|
|
11917
11925
|
"isarray": {
|
|
11918
11926
|
"version": "0.0.1",
|
|
@@ -11920,9 +11928,9 @@
|
|
|
11920
11928
|
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
|
|
11921
11929
|
},
|
|
11922
11930
|
"minimatch": {
|
|
11923
|
-
"version": "
|
|
11924
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-
|
|
11925
|
-
"integrity": "sha512-
|
|
11931
|
+
"version": "6.2.0",
|
|
11932
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz",
|
|
11933
|
+
"integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==",
|
|
11926
11934
|
"requires": {
|
|
11927
11935
|
"brace-expansion": "^2.0.1"
|
|
11928
11936
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.23.0",
|
|
4
4
|
"description": "Command-Line Interface for Firebase",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"stream-chain": "^2.2.4",
|
|
107
107
|
"stream-json": "^1.7.3",
|
|
108
108
|
"strip-ansi": "^6.0.1",
|
|
109
|
-
"superstatic": "^9.0.
|
|
109
|
+
"superstatic": "^9.0.3",
|
|
110
110
|
"tar": "^6.1.11",
|
|
111
111
|
"tcp-port-used": "^1.0.2",
|
|
112
112
|
"tmp": "^0.2.1",
|
|
@@ -40,7 +40,7 @@ resources:
|
|
|
40
40
|
location: ${LOCATION}
|
|
41
41
|
# httpsTrigger is used for an HTTP triggered function.
|
|
42
42
|
httpsTrigger: {}
|
|
43
|
-
runtime: "
|
|
43
|
+
runtime: "nodejs16"
|
|
44
44
|
|
|
45
45
|
# In the `params` field, set up your extension's user-configured parameters.
|
|
46
46
|
# Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#params-field
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
This directory now contains the source files for a simple extension called **greet-the-world**.
|
|
1
|
+
This directory now contains the source files for a simple extension called **greet-the-world**. You can try it out right away in the Firebase Emulator suite - just naviagte to the integration-test directory and run:
|
|
2
2
|
|
|
3
|
-
`firebase
|
|
3
|
+
`firebase emulators:start --project=<project-id>`
|
|
4
4
|
|
|
5
|
-
If you
|
|
5
|
+
If you don't have a project to use, you can instead use '--project=demo-test' to run against a fake project.
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
The `integration-test` directory also includes an end to end test (in the file integration-test.spec.js) that verifies that the extension responds back with the expected greeting. You can see it in action by running:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
`npm run test`
|
|
10
|
+
|
|
11
|
+
If you want to jump into the code to customize your extension, then modify **index.js** and **extension.yaml** in your favorite editor.
|
|
12
|
+
|
|
13
|
+
If you want to deploy your extension to test on a real project, go to a Firebase project directory (or create a new one with `firebase init`) and run:
|
|
14
|
+
|
|
15
|
+
`firebase ext:install ./path/to/extension/directory --project=<project-id>`
|
|
16
|
+
`firebase deploy --only extensions`
|
|
17
|
+
|
|
18
|
+
You can find more information about building extensions in the publisher docs: https://firebase.google.com/docs/extensions/alpha/overview-build-extensions
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This template contains a HTTP function that
|
|
3
|
-
*
|
|
4
|
-
* Always use the FUNCTIONS HANDLER NAMESPACE
|
|
5
|
-
* when writing Cloud Functions for extensions.
|
|
6
|
-
* Learn more about the handler namespace in the docs
|
|
2
|
+
* This template contains a HTTP function that
|
|
3
|
+
* responds with a greeting when called
|
|
7
4
|
*
|
|
8
5
|
* Reference PARAMETERS in your functions code with:
|
|
9
6
|
* `process.env.<parameter-name>`
|
|
10
|
-
* Learn more about
|
|
7
|
+
* Learn more about building extensions in the docs:
|
|
8
|
+
* https://firebase.google.com/docs/extensions/alpha/overview
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
|
-
const functions = require(
|
|
11
|
+
const functions = require("firebase-functions");
|
|
14
12
|
|
|
15
|
-
exports.greetTheWorld = functions.
|
|
16
|
-
// Here we reference a user-provided parameter
|
|
13
|
+
exports.greetTheWorld = functions.https.onRequest((req, res) => {
|
|
14
|
+
// Here we reference a user-provided parameter
|
|
15
|
+
// (its value is provided by the user during installation)
|
|
17
16
|
const consumerProvidedGreeting = process.env.GREETING;
|
|
18
17
|
|
|
19
|
-
// And here we reference an auto-populated parameter
|
|
18
|
+
// And here we reference an auto-populated parameter
|
|
19
|
+
// (its value is provided by Firebase after installation)
|
|
20
20
|
const instanceId = process.env.EXT_INSTANCE_ID;
|
|
21
21
|
|
|
22
22
|
const greeting = `${consumerProvidedGreeting} World from ${instanceId}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const axios = require("axios");
|
|
2
|
+
const chai = require("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 chai.expect(res.data).to.eql(expected);
|
|
12
|
+
}).timeout(10000);
|
|
13
|
+
});
|
|
@@ -3,15 +3,23 @@
|
|
|
3
3
|
"description": "Greet the world",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"firebase-admin": "^
|
|
7
|
-
"firebase-functions": "^
|
|
6
|
+
"firebase-admin": "^11.5.0",
|
|
7
|
+
"firebase-functions": "^4.2.0"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"eslint": "^8.15.1",
|
|
11
|
-
"eslint-plugin-promise": "^6.0.0"
|
|
11
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
12
|
+
"eslint-config-google": "^0.14.0",
|
|
13
|
+
"eslint-plugin-import": "^2.25.4",
|
|
14
|
+
"axios": "^1.3.2",
|
|
15
|
+
"chai": "^4.3.7",
|
|
16
|
+
"mocha": "^10.2.0"
|
|
12
17
|
},
|
|
13
18
|
"scripts": {
|
|
14
|
-
"lint": "./node_modules/.bin/eslint --max-warnings=0 .."
|
|
19
|
+
"lint": "./node_modules/.bin/eslint --max-warnings=0 ..",
|
|
20
|
+
"lint:fix": "./node_modules/.bin/eslint --max-warnings=0 --fix ..",
|
|
21
|
+
"mocha": "mocha '**/*.spec.js'",
|
|
22
|
+
"test": "(cd integration-tests && firebase emulators:exec 'npm run mocha' -P demo-test)"
|
|
15
23
|
},
|
|
16
24
|
"private": true
|
|
17
25
|
}
|
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
"description": "Greet the world",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"firebase-admin": "^
|
|
7
|
-
"firebase-functions": "^
|
|
6
|
+
"firebase-admin": "^11.5.0",
|
|
7
|
+
"firebase-functions": "^4.2.0"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"axios": "^1.3.2",
|
|
11
|
+
"chai": "^4.3.7",
|
|
12
|
+
"mocha": "^10.2.0"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"mocha": "mocha '**/*.spec.js'",
|
|
16
|
+
"test": "(cd integration-tests && firebase emulators:exec 'npm run mocha' -P demo-test)"
|
|
8
17
|
},
|
|
9
18
|
"private": true
|
|
10
19
|
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
This directory now contains the source files for a simple extension called **greet-the-world**.
|
|
1
|
+
This directory now contains the source files for a simple extension called **greet-the-world**. You can try it out right away in the Firebase Emulator suite: first, compile your code by running:
|
|
2
2
|
|
|
3
|
-
`npm run build --prefix=functions
|
|
3
|
+
`npm run build --prefix=functions`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Then, navigate to the `functions/integration-test` directory and run:
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
`firebase emulators:start --project=<project-id>`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
If you don't have a project to use, you can instead use '--project=demo-test' to run against a fake project.
|
|
10
|
+
|
|
11
|
+
The `integration-test` directory also includes an end to end test (in the file **integration-test.spec.ts**) that verifies that the extension responds back with the expected greeting. You can see it in action by running:
|
|
12
|
+
|
|
13
|
+
`npm run test`
|
|
14
|
+
|
|
15
|
+
If you want to jump into the code to customize your extension, then modify **index.ts** and **extension.yaml** in your favorite editor.
|
|
16
|
+
|
|
17
|
+
If you want to deploy your extension to test on a real project, go to a Firebase project directory (or create a new one with `firebase init`) and run:
|
|
18
|
+
|
|
19
|
+
`firebase ext:install ./path/to/extension/directory --project=<project-id>`
|
|
20
|
+
`firebase deploy --only extensions`
|
|
21
|
+
|
|
22
|
+
You can find more information about building extensions in the publisher docs: https://firebase.google.com/docs/extensions/alpha/overview-build-extensions
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This template contains a HTTP function that responds
|
|
3
|
-
*
|
|
4
|
-
* Always use the FUNCTIONS HANDLER NAMESPACE
|
|
5
|
-
* when writing Cloud Functions for extensions.
|
|
6
|
-
* Learn more about the handler namespace in the docs
|
|
2
|
+
* This template contains a HTTP function that responds
|
|
3
|
+
* with a greeting when called
|
|
7
4
|
*
|
|
8
5
|
* Reference PARAMETERS in your functions code with:
|
|
9
6
|
* `process.env.<parameter-name>`
|
|
10
|
-
* Learn more about
|
|
7
|
+
* Learn more about building extensions in the docs:
|
|
8
|
+
* https://firebase.google.com/docs/extensions/alpha/overview
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
|
-
import * as functions from
|
|
11
|
+
import * as functions from "firebase-functions";
|
|
14
12
|
|
|
15
|
-
exports.greetTheWorld = functions.
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
exports.greetTheWorld = functions.https.onRequest(
|
|
14
|
+
(req: functions.Request, res: functions.Response) => {
|
|
15
|
+
// Here we reference a user-provided parameter
|
|
16
|
+
// (its value is provided by the user during installation)
|
|
17
|
+
const consumerProvidedGreeting = process.env.GREETING;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// And here we reference an auto-populated parameter
|
|
20
|
+
// (its value is provided by Firebase after installation)
|
|
21
|
+
const instanceId = process.env.EXT_INSTANCE_ID;
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
const greeting = `${consumerProvidedGreeting} World from ${instanceId}`;
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
});
|
|
25
|
+
res.send(greeting);
|
|
26
|
+
});
|