firebase-tools 10.9.1 → 11.0.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.
- package/README.md +15 -9
- package/lib/appdistribution/client.js +16 -25
- package/lib/commands/apps-sdkconfig.js +6 -2
- package/lib/commands/ext-configure.js +54 -119
- package/lib/commands/ext-dev-emulators-exec.js +11 -6
- package/lib/commands/ext-dev-emulators-start.js +10 -26
- package/lib/commands/ext-install.js +12 -197
- package/lib/commands/ext-uninstall.js +7 -91
- package/lib/commands/ext-update.js +65 -224
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +8 -9
- package/lib/deploy/remoteconfig/functions.js +18 -14
- package/lib/emulator/commandUtils.js +1 -1
- package/lib/emulator/controller.js +2 -2
- package/lib/emulator/databaseEmulator.js +7 -5
- 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/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/gcp/storage.js +2 -4
- package/lib/hosting/cloudRunProxy.js +19 -15
- package/lib/init/features/database.js +3 -5
- package/lib/management/apps.js +47 -43
- package/lib/management/database.js +33 -31
- package/lib/management/projects.js +13 -7
- package/lib/rtdb.js +31 -29
- package/npm-shrinkwrap.json +982 -511
- package/package.json +16 -19
- package/standalone/package.json +1 -1
package/README.md
CHANGED
|
@@ -136,15 +136,21 @@ Detailed doc is [here](https://firebase.google.com/docs/cli/auth).
|
|
|
136
136
|
|
|
137
137
|
### Cloud Functions Commands
|
|
138
138
|
|
|
139
|
-
| Command
|
|
140
|
-
|
|
|
141
|
-
| **functions:log**
|
|
142
|
-
| **functions:
|
|
143
|
-
| **functions:config:
|
|
144
|
-
| **functions:config:
|
|
145
|
-
| **functions:config:
|
|
146
|
-
| **functions:
|
|
147
|
-
| **functions:
|
|
139
|
+
| Command | Description |
|
|
140
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
141
|
+
| **functions:log** | Read logs from deployed Cloud Functions. |
|
|
142
|
+
| **functions:list** | List all deployed functions in your Firebase project. |
|
|
143
|
+
| **functions:config:set** | Store runtime configuration values for the current project's Cloud Functions. |
|
|
144
|
+
| **functions:config:get** | Retrieve existing configuration values for the current project's Cloud Functions. |
|
|
145
|
+
| **functions:config:unset** | Remove values from the current project's runtime configuration. |
|
|
146
|
+
| **functions:config:clone** | Copy runtime configuration from one project environment to another. |
|
|
147
|
+
| **functions:secrets:set** | Create or update a secret for use in Cloud Functions for Firebase. |
|
|
148
|
+
| **functions:secrets:get** | Get metadata for secret and its versions. |
|
|
149
|
+
| **functions:secrets:access** | Access secret value given secret and its version. Defaults to accessing the latest version. |
|
|
150
|
+
| **functions:secrets:prune** | Destroys unused secrets. |
|
|
151
|
+
| **functions:secrets:destroy** | Destroy a secret. Defaults to destroying the latest version. |
|
|
152
|
+
| **functions:delete** | Delete one or more Cloud Functions by name or group name. |
|
|
153
|
+
| **functions:shell** | Locally emulate functions and start Node.js shell where these local functions can be invoked with test data. |
|
|
148
154
|
|
|
149
155
|
### Hosting Commands
|
|
150
156
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppDistributionClient = exports.UploadReleaseResult = exports.IntegrationState = void 0;
|
|
4
4
|
const _ = require("lodash");
|
|
5
|
-
const api = require("../api");
|
|
6
5
|
const utils = require("../utils");
|
|
7
6
|
const operationPoller = require("../operation-poller");
|
|
8
7
|
const error_1 = require("../error");
|
|
9
8
|
const apiv2_1 = require("../apiv2");
|
|
9
|
+
const api_1 = require("../api");
|
|
10
10
|
var IntegrationState;
|
|
11
11
|
(function (IntegrationState) {
|
|
12
12
|
IntegrationState["AAB_INTEGRATION_STATE_UNSPECIFIED"] = "AAB_INTEGRATION_STATE_UNSPECIFIED";
|
|
@@ -27,35 +27,33 @@ var UploadReleaseResult;
|
|
|
27
27
|
class AppDistributionClient {
|
|
28
28
|
constructor() {
|
|
29
29
|
this.appDistroV2Client = new apiv2_1.Client({
|
|
30
|
-
urlPrefix:
|
|
30
|
+
urlPrefix: api_1.appDistributionOrigin,
|
|
31
31
|
apiVersion: "v1",
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
async getAabInfo(appName) {
|
|
35
|
-
const apiResponse = await
|
|
36
|
-
|
|
37
|
-
auth: true,
|
|
38
|
-
});
|
|
39
|
-
return _.get(apiResponse, "body");
|
|
35
|
+
const apiResponse = await this.appDistroV2Client.get(`/${appName}/aabInfo`);
|
|
36
|
+
return apiResponse.body;
|
|
40
37
|
}
|
|
41
38
|
async uploadRelease(appName, distribution) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const client = new apiv2_1.Client({ urlPrefix: api_1.appDistributionOrigin });
|
|
40
|
+
const apiResponse = await client.request({
|
|
41
|
+
method: "POST",
|
|
42
|
+
path: `/upload/v1/${appName}/releases:upload`,
|
|
45
43
|
headers: {
|
|
46
44
|
"X-Goog-Upload-File-Name": distribution.getFileName(),
|
|
47
45
|
"X-Goog-Upload-Protocol": "raw",
|
|
48
46
|
"Content-Type": "application/octet-stream",
|
|
49
47
|
},
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
responseType: "json",
|
|
49
|
+
body: distribution.readStream(),
|
|
52
50
|
});
|
|
53
|
-
return
|
|
51
|
+
return apiResponse.body.name;
|
|
54
52
|
}
|
|
55
53
|
async pollUploadStatus(operationName) {
|
|
56
54
|
return operationPoller.pollOperation({
|
|
57
55
|
pollerName: "App Distribution Upload Poller",
|
|
58
|
-
apiOrigin:
|
|
56
|
+
apiOrigin: api_1.appDistributionOrigin,
|
|
59
57
|
apiVersion: "v1",
|
|
60
58
|
operationResourceName: operationName,
|
|
61
59
|
masterTimeout: 5 * 60 * 1000,
|
|
@@ -75,15 +73,12 @@ class AppDistributionClient {
|
|
|
75
73
|
text: releaseNotes,
|
|
76
74
|
},
|
|
77
75
|
};
|
|
76
|
+
const queryParams = { updateMask: "release_notes.text" };
|
|
78
77
|
try {
|
|
79
|
-
await
|
|
80
|
-
origin: api.appDistributionOrigin,
|
|
81
|
-
auth: true,
|
|
82
|
-
data,
|
|
83
|
-
});
|
|
78
|
+
await this.appDistroV2Client.patch(`/${releaseName}`, data, { queryParams });
|
|
84
79
|
}
|
|
85
80
|
catch (err) {
|
|
86
|
-
throw new error_1.FirebaseError(`failed to update release notes with ${err === null || err === void 0 ? void 0 : err.message}
|
|
81
|
+
throw new error_1.FirebaseError(`failed to update release notes with ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
87
82
|
}
|
|
88
83
|
utils.logSuccess("added release notes successfully");
|
|
89
84
|
}
|
|
@@ -98,11 +93,7 @@ class AppDistributionClient {
|
|
|
98
93
|
groupAliases,
|
|
99
94
|
};
|
|
100
95
|
try {
|
|
101
|
-
await
|
|
102
|
-
origin: api.appDistributionOrigin,
|
|
103
|
-
auth: true,
|
|
104
|
-
data,
|
|
105
|
-
});
|
|
96
|
+
await this.appDistroV2Client.post(`/${releaseName}:distribute`, data);
|
|
106
97
|
}
|
|
107
98
|
catch (err) {
|
|
108
99
|
let errorMessage = err.message;
|
|
@@ -10,11 +10,14 @@ const error_1 = require("../error");
|
|
|
10
10
|
const requireAuth_1 = require("../requireAuth");
|
|
11
11
|
const logger_1 = require("../logger");
|
|
12
12
|
const prompt_1 = require("../prompt");
|
|
13
|
-
|
|
14
|
-
if (apps.length
|
|
13
|
+
function checkForApps(apps, appPlatform) {
|
|
14
|
+
if (!apps.length) {
|
|
15
15
|
throw new error_1.FirebaseError(`There are no ${appPlatform === apps_1.AppPlatform.ANY ? "" : appPlatform + " "}apps ` +
|
|
16
16
|
"associated with this Firebase project");
|
|
17
17
|
}
|
|
18
|
+
}
|
|
19
|
+
async function selectAppInteractively(apps, appPlatform) {
|
|
20
|
+
checkForApps(apps, appPlatform);
|
|
18
21
|
const choices = apps.map((app) => {
|
|
19
22
|
return {
|
|
20
23
|
name: `${app.displayName || app.bundleId || app.packageName}` +
|
|
@@ -46,6 +49,7 @@ module.exports = new command_1.Command("apps:sdkconfig [platform] [appId]")
|
|
|
46
49
|
projectId = result.projectId;
|
|
47
50
|
}
|
|
48
51
|
const apps = await (0, apps_1.listFirebaseApps)(projectId, appPlatform);
|
|
52
|
+
checkForApps(apps, appPlatform);
|
|
49
53
|
if (apps.length === 1) {
|
|
50
54
|
appId = apps[0].appId;
|
|
51
55
|
appPlatform = apps[0].platform;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const _ = require("lodash");
|
|
4
|
-
const clc = require("cli-color");
|
|
5
3
|
const { marked } = require("marked");
|
|
6
|
-
const ora = require("ora");
|
|
7
4
|
const TerminalRenderer = require("marked-terminal");
|
|
8
5
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
9
6
|
const command_1 = require("../command");
|
|
@@ -26,8 +23,7 @@ marked.setOptions({
|
|
|
26
23
|
exports.default = new command_1.Command("ext:configure <extensionInstanceId>")
|
|
27
24
|
.description("configure an existing extension instance")
|
|
28
25
|
.withForce()
|
|
29
|
-
.option("--
|
|
30
|
-
.option("--local", "save to firebase.json rather than directly install to a Firebase project")
|
|
26
|
+
.option("--local", "deprecated")
|
|
31
27
|
.before(requirePermissions_1.requirePermissions, [
|
|
32
28
|
"firebaseextensions.instances.update",
|
|
33
29
|
"firebaseextensions.instances.get",
|
|
@@ -35,126 +31,65 @@ exports.default = new command_1.Command("ext:configure <extensionInstanceId>")
|
|
|
35
31
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
36
32
|
.before(extensionsHelper_1.diagnoseAndFixProject)
|
|
37
33
|
.action(async (instanceId, options) => {
|
|
38
|
-
var _a;
|
|
39
34
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
35
|
+
if (options.nonInteractive) {
|
|
36
|
+
throw new error_1.FirebaseError(`Command not supported in non-interactive mode, edit ./extensions/${instanceId}.env directly instead. ` +
|
|
37
|
+
`See https://firebase.google.com/docs/extensions/manifest for more details.`);
|
|
38
|
+
}
|
|
40
39
|
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;
|
|
40
|
+
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
41
|
}
|
|
96
|
-
|
|
97
|
-
|
|
42
|
+
const config = manifest.loadConfig(options);
|
|
43
|
+
const refOrPath = manifest.getInstanceTarget(instanceId, config);
|
|
44
|
+
const isLocalSource = (0, extensionsHelper_1.isLocalPath)(refOrPath);
|
|
45
|
+
let spec;
|
|
46
|
+
if (isLocalSource) {
|
|
47
|
+
const source = await (0, extensionsHelper_1.createSourceFromLocation)((0, projectUtils_1.needProjectId)({ projectId }), refOrPath);
|
|
48
|
+
spec = source.spec;
|
|
98
49
|
}
|
|
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;
|
|
50
|
+
else {
|
|
51
|
+
const extensionVersion = await extensionsApi.getExtensionVersion(refOrPath);
|
|
52
|
+
spec = extensionVersion.spec;
|
|
146
53
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
54
|
+
const oldParamValues = manifest.readInstanceParam({
|
|
55
|
+
instanceId,
|
|
56
|
+
projectDir: config.projectDir,
|
|
57
|
+
});
|
|
58
|
+
const [immutableParams, tbdParams] = (0, functional_1.partition)(spec.params, (param) => { var _a; return (_a = param.immutable) !== null && _a !== void 0 ? _a : false; });
|
|
59
|
+
infoImmutableParams(immutableParams, oldParamValues);
|
|
60
|
+
paramHelper.setNewDefaults(tbdParams, oldParamValues);
|
|
61
|
+
const mutableParamsBindingOptions = await paramHelper.getParams({
|
|
62
|
+
projectId,
|
|
63
|
+
paramSpecs: tbdParams,
|
|
64
|
+
nonInteractive: false,
|
|
65
|
+
paramsEnvPath: "",
|
|
66
|
+
instanceId,
|
|
67
|
+
reconfiguring: true,
|
|
68
|
+
});
|
|
69
|
+
const eventsConfig = spec.events
|
|
70
|
+
? await askUserForEventsConfig.askForEventsConfig(spec.events, "${param:PROJECT_ID}", instanceId)
|
|
71
|
+
: undefined;
|
|
72
|
+
if (eventsConfig) {
|
|
73
|
+
mutableParamsBindingOptions.EVENTARC_CHANNEL = { baseValue: eventsConfig.channel };
|
|
74
|
+
mutableParamsBindingOptions.ALLOWED_EVENT_TYPES = {
|
|
75
|
+
baseValue: eventsConfig.allowedEventTypes.join(","),
|
|
76
|
+
};
|
|
157
77
|
}
|
|
78
|
+
const newParamOptions = Object.assign(Object.assign({}, (0, paramHelper_1.buildBindingOptionsWithBaseValue)(oldParamValues)), mutableParamsBindingOptions);
|
|
79
|
+
await manifest.writeToManifest([
|
|
80
|
+
{
|
|
81
|
+
instanceId,
|
|
82
|
+
ref: !isLocalSource ? refs.parse(refOrPath) : undefined,
|
|
83
|
+
localPath: isLocalSource ? refOrPath : undefined,
|
|
84
|
+
params: newParamOptions,
|
|
85
|
+
extensionSpec: spec,
|
|
86
|
+
},
|
|
87
|
+
], config, {
|
|
88
|
+
nonInteractive: false,
|
|
89
|
+
force: true,
|
|
90
|
+
});
|
|
91
|
+
manifest.showPostDeprecationNotice();
|
|
92
|
+
return;
|
|
158
93
|
});
|
|
159
94
|
function infoImmutableParams(immutableParams, paramValues) {
|
|
160
95
|
if (!immutableParams.length) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const clc = require("cli-color");
|
|
3
4
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
4
5
|
const command_1 = require("../command");
|
|
6
|
+
const error_1 = require("../error");
|
|
5
7
|
const commandUtils = require("../emulator/commandUtils");
|
|
6
|
-
const optionsHelper = require("../extensions/emulator/optionsHelper");
|
|
7
8
|
module.exports = new command_1.Command("ext:dev:emulators:exec <script>")
|
|
8
|
-
.description("
|
|
9
|
+
.description("deprecated: please use `firebase emulators:exec` instead")
|
|
9
10
|
.before(commandUtils.setExportOnExitOptions)
|
|
10
11
|
.option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
|
|
11
12
|
.option(commandUtils.FLAG_TEST_CONFIG, commandUtils.DESC_TEST_CONFIG)
|
|
@@ -14,8 +15,12 @@ module.exports = new command_1.Command("ext:dev:emulators:exec <script>")
|
|
|
14
15
|
.option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
|
|
15
16
|
.option(commandUtils.FLAG_UI, commandUtils.DESC_UI)
|
|
16
17
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
|
|
17
|
-
.action(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
.action((script, options) => {
|
|
19
|
+
const localInstallCommand = `firebase ext:install ${process.cwd()}`;
|
|
20
|
+
const emulatorsExecCommand = `firebase emulators:exec '${script}`;
|
|
21
|
+
throw new error_1.FirebaseError("ext:dev:emulators:exec is no longer supported. " +
|
|
22
|
+
"Instead, navigate to a Firebase project directory and add this extension to the extensions manifest by running:\n" +
|
|
23
|
+
clc.bold(localInstallCommand) +
|
|
24
|
+
"\nThen, you can emulate this extension as part of that project by running:\n" +
|
|
25
|
+
clc.bold(emulatorsExecCommand));
|
|
21
26
|
});
|
|
@@ -1,39 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const clc = require("cli-color");
|
|
4
4
|
const command_1 = require("../command");
|
|
5
|
-
const controller = require("../emulator/controller");
|
|
6
5
|
const commandUtils = require("../emulator/commandUtils");
|
|
7
|
-
const optionsHelper = require("../extensions/emulator/optionsHelper");
|
|
8
|
-
const utils = require("../utils");
|
|
9
6
|
const error_1 = require("../error");
|
|
10
7
|
module.exports = new command_1.Command("ext:dev:emulators:start")
|
|
11
|
-
.description("
|
|
8
|
+
.description("deprecated: please use `firebase emulators:start`")
|
|
12
9
|
.before(commandUtils.setExportOnExitOptions)
|
|
13
10
|
.option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
|
|
14
11
|
.option(commandUtils.FLAG_TEST_CONFIG, commandUtils.DESC_TEST_CONFIG)
|
|
15
12
|
.option(commandUtils.FLAG_TEST_PARAMS, commandUtils.DESC_TEST_PARAMS)
|
|
16
13
|
.option(commandUtils.FLAG_IMPORT, commandUtils.DESC_IMPORT)
|
|
17
14
|
.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;
|
|
15
|
+
.action((options) => {
|
|
16
|
+
const localInstallCommand = `firebase ext:install ${process.cwd()}`;
|
|
17
|
+
const emulatorsStartCommand = "firebase emulators:start";
|
|
18
|
+
throw new error_1.FirebaseError("ext:dev:emulators:start is no longer supported. " +
|
|
19
|
+
"Instead, navigate to a Firebase project directory and add this extension to the extensions manifest by running:\n" +
|
|
20
|
+
clc.bold(localInstallCommand) +
|
|
21
|
+
"\nThen, you can emulate this extension as part of that project by running:\n" +
|
|
22
|
+
clc.bold(emulatorsStartCommand));
|
|
39
23
|
});
|