firebase-tools 10.9.2 → 11.1.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/README.md +15 -9
- package/lib/accountImporter.js +92 -93
- package/lib/api.js +77 -218
- package/lib/apiv2.js +5 -4
- package/lib/appdistribution/client.js +16 -25
- package/lib/auth.js +69 -47
- package/lib/bin/firebase.js +42 -47
- package/lib/checkValidTargetFilters.js +13 -12
- package/lib/commands/appdistribution-distribute.js +2 -1
- package/lib/commands/appdistribution-testers-add.js +2 -1
- package/lib/commands/appdistribution-testers-remove.js +2 -1
- package/lib/commands/apps-android-sha-create.js +2 -1
- package/lib/commands/apps-android-sha-delete.js +2 -1
- package/lib/commands/apps-android-sha-list.js +2 -1
- package/lib/commands/apps-create.js +2 -1
- package/lib/commands/apps-list.js +2 -1
- package/lib/commands/apps-sdkconfig.js +8 -3
- package/lib/commands/auth-export.js +2 -1
- package/lib/commands/auth-import.js +7 -10
- package/lib/commands/crashlytics-symbols-upload.js +2 -1
- package/lib/commands/database-get.js +4 -3
- package/lib/commands/database-instances-create.js +2 -1
- package/lib/commands/database-instances-list.js +3 -3
- package/lib/commands/database-profile.js +2 -1
- package/lib/commands/database-push.js +2 -1
- package/lib/commands/database-remove.js +2 -1
- package/lib/commands/database-rules-canary.js +2 -1
- package/lib/commands/database-rules-get.js +2 -1
- package/lib/commands/database-rules-list.js +2 -1
- package/lib/commands/database-rules-release.js +2 -1
- package/lib/commands/database-rules-stage.js +2 -1
- package/lib/commands/database-set.js +2 -1
- package/lib/commands/database-settings-get.js +2 -1
- package/lib/commands/database-settings-set.js +2 -1
- package/lib/commands/database-update.js +2 -1
- package/lib/commands/deploy.js +23 -21
- package/lib/commands/emulators-exec.js +2 -1
- package/lib/commands/emulators-export.js +2 -1
- package/lib/commands/emulators-start.js +2 -1
- package/lib/commands/experimental-functions-shell.js +10 -8
- package/lib/commands/ext-configure.js +56 -120
- package/lib/commands/ext-dev-deprecate.js +2 -1
- package/lib/commands/ext-dev-emulators-exec.js +13 -7
- package/lib/commands/ext-dev-emulators-start.js +12 -27
- package/lib/commands/ext-dev-extension-delete.js +2 -1
- package/lib/commands/ext-dev-init.js +2 -1
- package/lib/commands/ext-dev-list.js +2 -1
- package/lib/commands/ext-dev-publish.js +2 -1
- package/lib/commands/ext-dev-register.js +2 -1
- package/lib/commands/ext-dev-undeprecate.js +2 -1
- package/lib/commands/ext-dev-unpublish.js +2 -1
- package/lib/commands/ext-dev-usage.js +2 -1
- package/lib/commands/ext-export.js +2 -1
- package/lib/commands/ext-info.js +2 -1
- package/lib/commands/ext-install.js +14 -198
- package/lib/commands/ext-list.js +2 -1
- package/lib/commands/ext-sources-create.js +2 -1
- package/lib/commands/ext-uninstall.js +9 -92
- package/lib/commands/ext-update.js +67 -225
- package/lib/commands/ext.js +2 -1
- package/lib/commands/firestore-delete.js +2 -1
- package/lib/commands/firestore-indexes-list.js +2 -1
- package/lib/commands/functions-config-clone.js +4 -3
- package/lib/commands/functions-config-export.js +2 -1
- package/lib/commands/functions-config-get.js +2 -1
- package/lib/commands/functions-config-set.js +2 -1
- package/lib/commands/functions-config-unset.js +2 -1
- package/lib/commands/functions-delete.js +2 -1
- package/lib/commands/functions-deletegcfartifacts.js +2 -1
- package/lib/commands/functions-list.js +2 -1
- package/lib/commands/functions-log.js +2 -1
- package/lib/commands/functions-secrets-access.js +2 -1
- package/lib/commands/functions-secrets-destroy.js +2 -1
- package/lib/commands/functions-secrets-get.js +2 -1
- package/lib/commands/functions-secrets-prune.js +2 -1
- package/lib/commands/functions-secrets-set.js +2 -1
- package/lib/commands/functions-shell.js +12 -10
- package/lib/commands/help.js +2 -1
- package/lib/commands/hosting-channel-create.js +2 -1
- package/lib/commands/hosting-channel-delete.js +2 -1
- package/lib/commands/hosting-channel-deploy.js +2 -1
- package/lib/commands/hosting-channel-list.js +2 -1
- package/lib/commands/hosting-channel-open.js +2 -1
- package/lib/commands/hosting-clone.js +2 -1
- package/lib/commands/hosting-disable.js +2 -1
- package/lib/commands/hosting-sites-create.js +2 -1
- package/lib/commands/hosting-sites-delete.js +2 -1
- package/lib/commands/hosting-sites-get.js +2 -1
- package/lib/commands/hosting-sites-list.js +2 -1
- package/lib/commands/index.js +23 -13
- package/lib/commands/init.js +47 -43
- package/lib/commands/login-add.js +2 -1
- package/lib/commands/login-ci.js +2 -1
- package/lib/commands/login-list.js +2 -1
- package/lib/commands/login-use.js +2 -1
- package/lib/commands/login.js +2 -1
- package/lib/commands/logout.js +2 -1
- package/lib/commands/open.js +2 -1
- package/lib/commands/projects-addfirebase.js +2 -1
- package/lib/commands/projects-create.js +2 -1
- package/lib/commands/projects-list.js +2 -1
- package/lib/commands/remoteconfig-get.js +2 -1
- package/lib/commands/remoteconfig-rollback.js +2 -1
- package/lib/commands/remoteconfig-versions-list.js +2 -1
- package/lib/commands/serve.js +29 -27
- package/lib/commands/setup-emulators-database.js +2 -1
- package/lib/commands/setup-emulators-firestore.js +2 -1
- package/lib/commands/setup-emulators-pubsub.js +2 -1
- package/lib/commands/setup-emulators-storage.js +2 -1
- package/lib/commands/setup-emulators-ui.js +2 -1
- package/lib/commands/target-apply.js +2 -1
- package/lib/commands/target-clear.js +2 -1
- package/lib/commands/target-remove.js +2 -1
- package/lib/commands/target.js +2 -1
- package/lib/commands/use.js +54 -52
- package/lib/config.js +3 -3
- package/lib/deploy/database/deploy.js +3 -2
- package/lib/deploy/database/index.js +8 -5
- package/lib/deploy/database/prepare.js +22 -19
- package/lib/deploy/database/release.js +12 -9
- package/lib/deploy/firestore/prepare.js +2 -2
- package/lib/deploy/functions/build.js +32 -20
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +187 -54
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +14 -2
- package/lib/deploy/functions/services/database.js +14 -0
- package/lib/deploy/functions/services/index.js +14 -0
- package/lib/deploy/index.js +3 -3
- package/lib/deploy/lifecycleHooks.js +23 -20
- package/lib/deploy/remoteconfig/functions.js +18 -14
- package/lib/deploy/remoteconfig/prepare.js +2 -2
- package/lib/emulator/auth/apiSpec.js +14 -46
- package/lib/emulator/auth/operations.js +6 -29
- package/lib/emulator/auth/state.js +2 -25
- package/lib/emulator/commandUtils.js +1 -1
- package/lib/emulator/controller.js +3 -3
- package/lib/emulator/databaseEmulator.js +9 -7
- package/lib/emulator/downloadableEmulators.js +6 -6
- package/lib/emulator/extensionsEmulator.js +7 -3
- package/lib/emulator/firestoreEmulator.js +10 -12
- package/lib/emulator/functionsEmulator.js +39 -42
- package/lib/emulator/hubClient.js +11 -22
- package/lib/emulator/hubExport.js +26 -16
- package/lib/emulator/portUtils.js +2 -0
- package/lib/emulator/storage/crc.js +3 -0
- package/lib/emulator/storage/rules/runtime.js +1 -1
- package/lib/errorOut.js +2 -2
- package/lib/extensions/extensionsHelper.js +4 -5
- package/lib/extensions/manifest.js +5 -11
- package/lib/firebaseConfigValidate.js +1 -1
- package/lib/firestore/checkDatabaseType.js +4 -5
- package/lib/firestore/indexes.js +17 -34
- package/lib/functions/events/v2.js +7 -1
- package/lib/functionsConfigClone.js +43 -41
- package/lib/gcp/cloudfunctionsv2.js +17 -2
- package/lib/gcp/iam.js +1 -1
- package/lib/gcp/index.js +10 -10
- package/lib/gcp/runtimeconfig.js +45 -47
- package/lib/gcp/storage.js +2 -4
- package/lib/hosting/cloudRunProxy.js +19 -15
- package/lib/index.js +29 -28
- package/lib/init/features/database.js +11 -5
- package/lib/init/features/functions/index.js +1 -1
- package/lib/init/features/functions/javascript.js +23 -20
- package/lib/init/features/functions/npm-dependencies.js +17 -14
- package/lib/init/features/functions/typescript.js +27 -24
- package/lib/init/features/hosting/github.js +5 -4
- package/lib/loadCJSON.js +9 -6
- package/lib/logError.js +15 -12
- package/lib/management/apps.js +47 -43
- package/lib/management/database.js +33 -31
- package/lib/management/projects.js +13 -7
- package/lib/parseBoltRules.js +15 -14
- package/lib/profileReport.js +503 -511
- package/lib/profiler.js +4 -4
- package/lib/requireAuth.js +0 -1
- package/lib/responseToError.js +8 -5
- package/lib/rtdb.js +31 -29
- package/lib/scopes.js +9 -9
- package/npm-shrinkwrap.json +1485 -670
- package/package.json +21 -22
- package/standalone/package.json +1 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const clc = require("cli-color");
|
|
3
|
+
exports.command = void 0;
|
|
5
4
|
const { marked } = require("marked");
|
|
6
|
-
const ora = require("ora");
|
|
7
5
|
const TerminalRenderer = require("marked-terminal");
|
|
8
6
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
9
7
|
const command_1 = require("../command");
|
|
@@ -23,11 +21,10 @@ const askUserForEventsConfig = require("../extensions/askUserForEventsConfig");
|
|
|
23
21
|
marked.setOptions({
|
|
24
22
|
renderer: new TerminalRenderer(),
|
|
25
23
|
});
|
|
26
|
-
exports.
|
|
24
|
+
exports.command = new command_1.Command("ext:configure <extensionInstanceId>")
|
|
27
25
|
.description("configure an existing extension instance")
|
|
28
26
|
.withForce()
|
|
29
|
-
.option("--
|
|
30
|
-
.option("--local", "save to firebase.json rather than directly install to a Firebase project")
|
|
27
|
+
.option("--local", "deprecated")
|
|
31
28
|
.before(requirePermissions_1.requirePermissions, [
|
|
32
29
|
"firebaseextensions.instances.update",
|
|
33
30
|
"firebaseextensions.instances.get",
|
|
@@ -35,126 +32,65 @@ exports.default = new command_1.Command("ext:configure <extensionInstanceId>")
|
|
|
35
32
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
36
33
|
.before(extensionsHelper_1.diagnoseAndFixProject)
|
|
37
34
|
.action(async (instanceId, options) => {
|
|
38
|
-
var _a;
|
|
39
35
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
36
|
+
if (options.nonInteractive) {
|
|
37
|
+
throw new error_1.FirebaseError(`Command not supported in non-interactive mode, edit ./extensions/${instanceId}.env directly instead. ` +
|
|
38
|
+
`See https://firebase.google.com/docs/extensions/manifest for more details.`);
|
|
39
|
+
}
|
|
40
40
|
if (options.local) {
|
|
41
|
-
|
|
42
|
-
throw new error_1.FirebaseError(`Command not supported in non-interactive mode, edit ./extensions/${instanceId}.env directly instead`);
|
|
43
|
-
}
|
|
44
|
-
const config = manifest.loadConfig(options);
|
|
45
|
-
const refOrPath = manifest.getInstanceTarget(instanceId, config);
|
|
46
|
-
const isLocalSource = (0, extensionsHelper_1.isLocalPath)(refOrPath);
|
|
47
|
-
let spec;
|
|
48
|
-
if (isLocalSource) {
|
|
49
|
-
const source = await (0, extensionsHelper_1.createSourceFromLocation)((0, projectUtils_1.needProjectId)({ projectId }), refOrPath);
|
|
50
|
-
spec = source.spec;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const extensionVersion = await extensionsApi.getExtensionVersion(refOrPath);
|
|
54
|
-
spec = extensionVersion.spec;
|
|
55
|
-
}
|
|
56
|
-
const oldParamValues = manifest.readInstanceParam({
|
|
57
|
-
instanceId,
|
|
58
|
-
projectDir: config.projectDir,
|
|
59
|
-
});
|
|
60
|
-
const [immutableParams, tbdParams] = (0, functional_1.partition)(spec.params, (param) => { var _a; return (_a = param.immutable) !== null && _a !== void 0 ? _a : false; });
|
|
61
|
-
infoImmutableParams(immutableParams, oldParamValues);
|
|
62
|
-
paramHelper.setNewDefaults(tbdParams, oldParamValues);
|
|
63
|
-
const mutableParamsBindingOptions = await paramHelper.getParams({
|
|
64
|
-
projectId,
|
|
65
|
-
paramSpecs: tbdParams,
|
|
66
|
-
nonInteractive: false,
|
|
67
|
-
paramsEnvPath: ((_a = options.params) !== null && _a !== void 0 ? _a : ""),
|
|
68
|
-
instanceId,
|
|
69
|
-
reconfiguring: true,
|
|
70
|
-
});
|
|
71
|
-
const eventsConfig = spec.events
|
|
72
|
-
? await askUserForEventsConfig.askForEventsConfig(spec.events, "${param:PROJECT_ID}", instanceId)
|
|
73
|
-
: undefined;
|
|
74
|
-
if (eventsConfig) {
|
|
75
|
-
mutableParamsBindingOptions.EVENTARC_CHANNEL = { baseValue: eventsConfig.channel };
|
|
76
|
-
mutableParamsBindingOptions.ALLOWED_EVENT_TYPES = {
|
|
77
|
-
baseValue: eventsConfig.allowedEventTypes.join(","),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
const newParamOptions = Object.assign(Object.assign({}, (0, paramHelper_1.buildBindingOptionsWithBaseValue)(oldParamValues)), mutableParamsBindingOptions);
|
|
81
|
-
await manifest.writeToManifest([
|
|
82
|
-
{
|
|
83
|
-
instanceId,
|
|
84
|
-
ref: !isLocalSource ? refs.parse(refOrPath) : undefined,
|
|
85
|
-
localPath: isLocalSource ? refOrPath : undefined,
|
|
86
|
-
params: newParamOptions,
|
|
87
|
-
extensionSpec: spec,
|
|
88
|
-
},
|
|
89
|
-
], config, {
|
|
90
|
-
nonInteractive: false,
|
|
91
|
-
force: true,
|
|
92
|
-
});
|
|
93
|
-
manifest.showPreviewWarning();
|
|
94
|
-
return;
|
|
41
|
+
utils.logLabeledWarning(extensionsHelper_1.logPrefix, "As of firebase-tools@11.0.0, the `--local` flag is no longer required, as it is the default behavior.");
|
|
95
42
|
}
|
|
96
|
-
|
|
97
|
-
|
|
43
|
+
const config = manifest.loadConfig(options);
|
|
44
|
+
const refOrPath = manifest.getInstanceTarget(instanceId, config);
|
|
45
|
+
const isLocalSource = (0, extensionsHelper_1.isLocalPath)(refOrPath);
|
|
46
|
+
let spec;
|
|
47
|
+
if (isLocalSource) {
|
|
48
|
+
const source = await (0, extensionsHelper_1.createSourceFromLocation)((0, projectUtils_1.needProjectId)({ projectId }), refOrPath);
|
|
49
|
+
spec = source.spec;
|
|
98
50
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const paramSpecWithNewDefaults = paramHelper.getParamsWithCurrentValuesAsDefaults(existingInstance);
|
|
103
|
-
const immutableParams = _.remove(paramSpecWithNewDefaults, (param) => param.immutable);
|
|
104
|
-
const paramBindingOptions = await paramHelper.getParams({
|
|
105
|
-
projectId,
|
|
106
|
-
paramSpecs: paramSpecWithNewDefaults,
|
|
107
|
-
nonInteractive: options.nonInteractive,
|
|
108
|
-
paramsEnvPath: options.params,
|
|
109
|
-
instanceId,
|
|
110
|
-
reconfiguring: true,
|
|
111
|
-
});
|
|
112
|
-
const paramBindings = (0, paramHelper_1.getBaseParamBindings)(paramBindingOptions);
|
|
113
|
-
if (immutableParams.length) {
|
|
114
|
-
const plural = immutableParams.length > 1;
|
|
115
|
-
logger_1.logger.info(`The following param${plural ? "s are" : " is"} immutable:`);
|
|
116
|
-
for (const { param } of immutableParams) {
|
|
117
|
-
const value = _.get(existingInstance, `config.params.${param}`);
|
|
118
|
-
logger_1.logger.info(`param: ${param}, value: ${value}`);
|
|
119
|
-
paramBindings[param] = value;
|
|
120
|
-
}
|
|
121
|
-
logger_1.logger.info((plural
|
|
122
|
-
? "To set different values for these params"
|
|
123
|
-
: "To set a different value for this param") +
|
|
124
|
-
", uninstall the extension, then install a new instance of this extension.");
|
|
125
|
-
}
|
|
126
|
-
const pId = (0, projectUtils_1.needProjectId)({ projectId });
|
|
127
|
-
const spec = existingInstance ? existingInstance.config.source.spec : undefined;
|
|
128
|
-
const eventsConfig = spec.events
|
|
129
|
-
? await askUserForEventsConfig.askForEventsConfig(spec.events, pId, instanceId)
|
|
130
|
-
: undefined;
|
|
131
|
-
spinner.start();
|
|
132
|
-
const configureOptions = {
|
|
133
|
-
projectId: pId,
|
|
134
|
-
instanceId,
|
|
135
|
-
params: paramBindings,
|
|
136
|
-
canEmitEvents: eventsConfig ? true : false,
|
|
137
|
-
eventarcChannel: eventsConfig === null || eventsConfig === void 0 ? void 0 : eventsConfig.channel,
|
|
138
|
-
allowedEventTypes: eventsConfig === null || eventsConfig === void 0 ? void 0 : eventsConfig.allowedEventTypes,
|
|
139
|
-
};
|
|
140
|
-
const res = await extensionsApi.configureInstance(configureOptions);
|
|
141
|
-
spinner.stop();
|
|
142
|
-
utils.logLabeledSuccess(extensionsHelper_1.logPrefix, `successfully configured ${clc.bold(instanceId)}.`);
|
|
143
|
-
utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(`You can view your reconfigured instance in the Firebase console: ${utils.consoleUrl((0, projectUtils_1.needProjectId)({ projectId }), `/extensions/instances/${instanceId}?tab=config`)}`));
|
|
144
|
-
manifest.showDeprecationWarning();
|
|
145
|
-
return res;
|
|
51
|
+
else {
|
|
52
|
+
const extensionVersion = await extensionsApi.getExtensionVersion(refOrPath);
|
|
53
|
+
spec = extensionVersion.spec;
|
|
146
54
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
55
|
+
const oldParamValues = manifest.readInstanceParam({
|
|
56
|
+
instanceId,
|
|
57
|
+
projectDir: config.projectDir,
|
|
58
|
+
});
|
|
59
|
+
const [immutableParams, tbdParams] = (0, functional_1.partition)(spec.params, (param) => { var _a; return (_a = param.immutable) !== null && _a !== void 0 ? _a : false; });
|
|
60
|
+
infoImmutableParams(immutableParams, oldParamValues);
|
|
61
|
+
paramHelper.setNewDefaults(tbdParams, oldParamValues);
|
|
62
|
+
const mutableParamsBindingOptions = await paramHelper.getParams({
|
|
63
|
+
projectId,
|
|
64
|
+
paramSpecs: tbdParams,
|
|
65
|
+
nonInteractive: false,
|
|
66
|
+
paramsEnvPath: "",
|
|
67
|
+
instanceId,
|
|
68
|
+
reconfiguring: true,
|
|
69
|
+
});
|
|
70
|
+
const eventsConfig = spec.events
|
|
71
|
+
? await askUserForEventsConfig.askForEventsConfig(spec.events, "${param:PROJECT_ID}", instanceId)
|
|
72
|
+
: undefined;
|
|
73
|
+
if (eventsConfig) {
|
|
74
|
+
mutableParamsBindingOptions.EVENTARC_CHANNEL = { baseValue: eventsConfig.channel };
|
|
75
|
+
mutableParamsBindingOptions.ALLOWED_EVENT_TYPES = {
|
|
76
|
+
baseValue: eventsConfig.allowedEventTypes.join(","),
|
|
77
|
+
};
|
|
157
78
|
}
|
|
79
|
+
const newParamOptions = Object.assign(Object.assign({}, (0, paramHelper_1.buildBindingOptionsWithBaseValue)(oldParamValues)), mutableParamsBindingOptions);
|
|
80
|
+
await manifest.writeToManifest([
|
|
81
|
+
{
|
|
82
|
+
instanceId,
|
|
83
|
+
ref: !isLocalSource ? refs.parse(refOrPath) : undefined,
|
|
84
|
+
localPath: isLocalSource ? refOrPath : undefined,
|
|
85
|
+
params: newParamOptions,
|
|
86
|
+
extensionSpec: spec,
|
|
87
|
+
},
|
|
88
|
+
], config, {
|
|
89
|
+
nonInteractive: false,
|
|
90
|
+
force: true,
|
|
91
|
+
});
|
|
92
|
+
manifest.showPostDeprecationNotice();
|
|
93
|
+
return;
|
|
158
94
|
});
|
|
159
95
|
function infoImmutableParams(immutableParams, paramValues) {
|
|
160
96
|
if (!immutableParams.length) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const semver = require("semver");
|
|
5
6
|
const refs = require("../extensions/refs");
|
|
@@ -11,7 +12,7 @@ const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
|
11
12
|
const versionHelper_1 = require("../extensions/versionHelper");
|
|
12
13
|
const requireAuth_1 = require("../requireAuth");
|
|
13
14
|
const error_1 = require("../error");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:deprecate <extensionRef> <versionPredicate>")
|
|
15
16
|
.description("deprecate extension versions that match the version predicate")
|
|
16
17
|
.option("-m, --message <deprecationMessage>", "deprecation message")
|
|
17
18
|
.option("-f, --force", "override deprecation message for existing deprecated extension versions that match")
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("cli-color");
|
|
3
5
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
4
6
|
const command_1 = require("../command");
|
|
7
|
+
const error_1 = require("../error");
|
|
5
8
|
const commandUtils = require("../emulator/commandUtils");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.description("emulate an extension, run a test script, then shut down the emulators")
|
|
9
|
+
exports.command = new command_1.Command("ext:dev:emulators:exec <script>")
|
|
10
|
+
.description("deprecated: please use `firebase emulators:exec` instead")
|
|
9
11
|
.before(commandUtils.setExportOnExitOptions)
|
|
10
12
|
.option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
|
|
11
13
|
.option(commandUtils.FLAG_TEST_CONFIG, commandUtils.DESC_TEST_CONFIG)
|
|
@@ -14,8 +16,12 @@ module.exports = new command_1.Command("ext:dev:emulators:exec <script>")
|
|
|
14
16
|
.option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
|
|
15
17
|
.option(commandUtils.FLAG_UI, commandUtils.DESC_UI)
|
|
16
18
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
|
|
17
|
-
.action(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
.action((script, options) => {
|
|
20
|
+
const localInstallCommand = `firebase ext:install ${process.cwd()}`;
|
|
21
|
+
const emulatorsExecCommand = `firebase emulators:exec '${script}`;
|
|
22
|
+
throw new error_1.FirebaseError("ext:dev:emulators:exec is no longer supported. " +
|
|
23
|
+
"Instead, navigate to a Firebase project directory and add this extension to the extensions manifest by running:\n" +
|
|
24
|
+
clc.bold(localInstallCommand) +
|
|
25
|
+
"\nThen, you can emulate this extension as part of that project by running:\n" +
|
|
26
|
+
clc.bold(emulatorsExecCommand));
|
|
21
27
|
});
|
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("cli-color");
|
|
4
5
|
const command_1 = require("../command");
|
|
5
|
-
const controller = require("../emulator/controller");
|
|
6
6
|
const commandUtils = require("../emulator/commandUtils");
|
|
7
|
-
const optionsHelper = require("../extensions/emulator/optionsHelper");
|
|
8
|
-
const utils = require("../utils");
|
|
9
7
|
const error_1 = require("../error");
|
|
10
|
-
|
|
11
|
-
.description("
|
|
8
|
+
exports.command = new command_1.Command("ext:dev:emulators:start")
|
|
9
|
+
.description("deprecated: please use `firebase emulators:start`")
|
|
12
10
|
.before(commandUtils.setExportOnExitOptions)
|
|
13
11
|
.option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
|
|
14
12
|
.option(commandUtils.FLAG_TEST_CONFIG, commandUtils.DESC_TEST_CONFIG)
|
|
15
13
|
.option(commandUtils.FLAG_TEST_PARAMS, commandUtils.DESC_TEST_PARAMS)
|
|
16
14
|
.option(commandUtils.FLAG_IMPORT, commandUtils.DESC_IMPORT)
|
|
17
15
|
.option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
await controller.cleanShutdown();
|
|
29
|
-
if (!(e instanceof error_1.FirebaseError)) {
|
|
30
|
-
throw new error_1.FirebaseError("Error in ext:dev:emulator:start", e);
|
|
31
|
-
}
|
|
32
|
-
throw e;
|
|
33
|
-
}
|
|
34
|
-
utils.logSuccess("All emulators ready, it is now safe to connect.");
|
|
35
|
-
for (const notice of deprecationNotices) {
|
|
36
|
-
utils.logLabeledWarning("emulators", notice, "warn");
|
|
37
|
-
}
|
|
38
|
-
await killSignalPromise;
|
|
16
|
+
.action((options) => {
|
|
17
|
+
const localInstallCommand = `firebase ext:install ${process.cwd()}`;
|
|
18
|
+
const emulatorsStartCommand = "firebase emulators:start";
|
|
19
|
+
throw new error_1.FirebaseError("ext:dev:emulators:start is no longer supported. " +
|
|
20
|
+
"Instead, navigate to a Firebase project directory and add this extension to the extensions manifest by running:\n" +
|
|
21
|
+
clc.bold(localInstallCommand) +
|
|
22
|
+
"\nThen, you can emulate this extension as part of that project by running:\n" +
|
|
23
|
+
clc.bold(emulatorsStartCommand));
|
|
39
24
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const utils = require("../utils");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const command_1 = require("../command");
|
|
@@ -10,7 +11,7 @@ const prompt_1 = require("../prompt");
|
|
|
10
11
|
const requireAuth_1 = require("../requireAuth");
|
|
11
12
|
const error_1 = require("../error");
|
|
12
13
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
13
|
-
|
|
14
|
+
exports.command = new command_1.Command("ext:dev:delete <extensionRef>")
|
|
14
15
|
.description("delete an extension")
|
|
15
16
|
.help("use this command to delete an extension, and make it unavailable for developers to install or reconfigure. " +
|
|
16
17
|
"Specify the extension you want to delete using the format '<publisherId>/<extensionId>.")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const fs = require("fs");
|
|
4
5
|
const path = require("path");
|
|
5
6
|
const { marked } = require("marked");
|
|
@@ -24,7 +25,7 @@ function readCommonTemplates() {
|
|
|
24
25
|
changelogTemplate: fs.readFileSync(path.join(TEMPLATE_ROOT, "CHANGELOG.md"), "utf8"),
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
exports.
|
|
28
|
+
exports.command = new command_1.Command("ext:dev:init")
|
|
28
29
|
.description("initialize files for writing an extension in the current directory")
|
|
29
30
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
|
|
30
31
|
.action(async (options) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const Table = require("cli-table");
|
|
5
6
|
const _ = require("lodash");
|
|
@@ -11,7 +12,7 @@ const extensionsUtils = require("../extensions/utils");
|
|
|
11
12
|
const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
12
13
|
const logger_1 = require("../logger");
|
|
13
14
|
const requireAuth_1 = require("../requireAuth");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:list <publisherId>")
|
|
15
16
|
.description("list all published extensions associated with this publisher ID")
|
|
16
17
|
.before(requireAuth_1.requireAuth)
|
|
17
18
|
.action(async (publisherId) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const { marked } = require("marked");
|
|
5
6
|
const TerminalRenderer = require("marked-terminal");
|
|
@@ -14,7 +15,7 @@ const utils = require("../utils");
|
|
|
14
15
|
marked.setOptions({
|
|
15
16
|
renderer: new TerminalRenderer(),
|
|
16
17
|
});
|
|
17
|
-
exports.
|
|
18
|
+
exports.command = new command_1.Command("ext:dev:publish <extensionRef>")
|
|
18
19
|
.description(`publish a new version of an extension`)
|
|
19
20
|
.withForce()
|
|
20
21
|
.help("if you have not previously published a version of this extension, this will " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const { marked } = require("marked");
|
|
5
6
|
const command_1 = require("../command");
|
|
@@ -11,7 +12,7 @@ const askUserForConsent_1 = require("../extensions/askUserForConsent");
|
|
|
11
12
|
const requirePermissions_1 = require("../requirePermissions");
|
|
12
13
|
const error_1 = require("../error");
|
|
13
14
|
const utils = require("../utils");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:register")
|
|
15
16
|
.description("register a publisher ID; run this before publishing your first extension.")
|
|
16
17
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.sources.create"])
|
|
17
18
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const semver = require("semver");
|
|
5
6
|
const refs = require("../extensions/refs");
|
|
@@ -11,7 +12,7 @@ const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
|
11
12
|
const versionHelper_1 = require("../extensions/versionHelper");
|
|
12
13
|
const requireAuth_1 = require("../requireAuth");
|
|
13
14
|
const error_1 = require("../error");
|
|
14
|
-
exports.
|
|
15
|
+
exports.command = new command_1.Command("ext:dev:undeprecate <extensionRef> <versionPredicate>")
|
|
15
16
|
.description("undeprecate extension versions that match the version predicate")
|
|
16
17
|
.before(requireAuth_1.requireAuth)
|
|
17
18
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const command_1 = require("../command");
|
|
4
5
|
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
5
6
|
const extensionsApi_1 = require("../extensions/extensionsApi");
|
|
@@ -10,7 +11,7 @@ const clc = require("cli-color");
|
|
|
10
11
|
const requireAuth_1 = require("../requireAuth");
|
|
11
12
|
const error_1 = require("../error");
|
|
12
13
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
13
|
-
|
|
14
|
+
exports.command = new command_1.Command("ext:dev:unpublish <extensionRef>")
|
|
14
15
|
.description("unpublish an extension")
|
|
15
16
|
.withForce()
|
|
16
17
|
.help("use this command to unpublish an extension, and make it unavailable for developers to install or reconfigure. " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const Table = require("cli-table");
|
|
4
5
|
const clc = require("cli-color");
|
|
5
6
|
const utils = require("../utils");
|
|
@@ -14,7 +15,7 @@ const error_1 = require("../error");
|
|
|
14
15
|
const logger_1 = require("../logger");
|
|
15
16
|
const prompt_1 = require("../prompt");
|
|
16
17
|
const shortenUrl_1 = require("../shortenUrl");
|
|
17
|
-
|
|
18
|
+
exports.command = new command_1.Command("ext:dev:usage <publisherId>")
|
|
18
19
|
.description("get usage for an extension")
|
|
19
20
|
.help("use this command to get the usage of extensions you published. " +
|
|
20
21
|
"Specify the publisher ID you used to publish your extensions, " +
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
4
5
|
const command_1 = require("../command");
|
|
5
6
|
const planner = require("../deploy/extensions/planner");
|
|
@@ -13,7 +14,7 @@ const logger_1 = require("../logger");
|
|
|
13
14
|
const projectUtils_1 = require("../projectUtils");
|
|
14
15
|
const prompt_1 = require("../prompt");
|
|
15
16
|
const requirePermissions_1 = require("../requirePermissions");
|
|
16
|
-
|
|
17
|
+
exports.command = new command_1.Command("ext:export")
|
|
17
18
|
.description("export all Extension instances installed on a project to a local Firebase directory")
|
|
18
19
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.list"])
|
|
19
20
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
package/lib/commands/ext-info.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
3
4
|
const clc = require("cli-color");
|
|
4
5
|
const _ = require("lodash");
|
|
5
6
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
@@ -13,7 +14,7 @@ const utils = require("../utils");
|
|
|
13
14
|
const { marked } = require("marked");
|
|
14
15
|
const TerminalRenderer = require("marked-terminal");
|
|
15
16
|
const FUNCTION_TYPE_REGEX = /\..+\.function/;
|
|
16
|
-
exports.
|
|
17
|
+
exports.command = new command_1.Command("ext:info <extensionName>")
|
|
17
18
|
.description("display information about an extension by name (extensionName@x.y.z for a specific version)")
|
|
18
19
|
.option("--markdown", "output info in Markdown suitable for constructing a README file")
|
|
19
20
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|