firebase-tools 11.4.0 → 11.5.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 +8 -15
- package/lib/accountImporter.js +1 -1
- package/lib/auth.js +3 -4
- package/lib/bin/firebase.js +4 -4
- package/lib/command.js +3 -3
- package/lib/commands/apps-android-sha-create.js +1 -1
- package/lib/commands/apps-android-sha-delete.js +1 -1
- package/lib/commands/apps-create.js +1 -1
- package/lib/commands/apps-list.js +1 -1
- package/lib/commands/auth-export.js +1 -1
- package/lib/commands/auth-import.js +1 -1
- package/lib/commands/database-instances-list.js +1 -1
- package/lib/commands/database-push.js +1 -1
- package/lib/commands/database-remove.js +1 -1
- package/lib/commands/database-set.js +1 -1
- package/lib/commands/database-update.js +1 -1
- package/lib/commands/emulators-start.js +1 -1
- package/lib/commands/ext-dev-deprecate.js +1 -1
- package/lib/commands/ext-dev-emulators-exec.js +1 -1
- package/lib/commands/ext-dev-emulators-start.js +1 -1
- package/lib/commands/ext-dev-extension-delete.js +1 -1
- package/lib/commands/ext-dev-list.js +1 -1
- package/lib/commands/ext-dev-publish.js +1 -1
- package/lib/commands/ext-dev-register.js +1 -1
- package/lib/commands/ext-dev-undeprecate.js +1 -1
- package/lib/commands/ext-dev-unpublish.js +1 -1
- package/lib/commands/ext-dev-usage.js +1 -1
- package/lib/commands/ext-info.js +1 -1
- package/lib/commands/ext-install.js +2 -2
- package/lib/commands/ext-update.js +1 -1
- package/lib/commands/ext.js +1 -1
- package/lib/commands/firestore-delete.js +2 -2
- package/lib/commands/firestore-indexes-list.js +3 -3
- package/lib/commands/functions-config-clone.js +1 -1
- package/lib/commands/functions-config-export.js +1 -1
- package/lib/commands/functions-config-set.js +1 -1
- package/lib/commands/functions-config-unset.js +1 -1
- package/lib/commands/functions-delete.js +1 -1
- package/lib/commands/functions-secrets-set.js +1 -1
- package/lib/commands/help.js +1 -1
- package/lib/commands/hosting-channel-create.js +5 -5
- package/lib/commands/hosting-channel-delete.js +3 -3
- package/lib/commands/hosting-channel-deploy.js +6 -6
- package/lib/commands/hosting-channel-list.js +2 -2
- package/lib/commands/hosting-channel-open.js +2 -2
- package/lib/commands/hosting-clone.js +13 -8
- package/lib/commands/hosting-disable.js +1 -1
- package/lib/commands/hosting-sites-create.js +4 -4
- package/lib/commands/hosting-sites-delete.js +4 -4
- package/lib/commands/hosting-sites-list.js +2 -2
- package/lib/commands/init.js +5 -5
- package/lib/commands/login-add.js +1 -1
- package/lib/commands/login-ci.js +4 -2
- package/lib/commands/login-list.js +1 -1
- package/lib/commands/login-use.js +1 -1
- package/lib/commands/login.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/open.js +3 -3
- package/lib/commands/projects-list.js +2 -2
- package/lib/commands/serve.js +1 -1
- package/lib/commands/target-apply.js +1 -1
- package/lib/commands/target-clear.js +1 -1
- package/lib/commands/target-remove.js +1 -1
- package/lib/commands/target.js +1 -1
- package/lib/commands/use.js +7 -7
- package/lib/config.js +1 -1
- package/lib/deploy/database/prepare.js +3 -3
- package/lib/deploy/database/release.js +3 -3
- package/lib/deploy/extensions/deploymentSummary.js +1 -1
- package/lib/deploy/extensions/errors.js +1 -1
- package/lib/deploy/extensions/secrets.js +1 -1
- package/lib/deploy/extensions/tasks.js +2 -2
- package/lib/deploy/firestore/deploy.js +2 -2
- package/lib/deploy/firestore/prepare.js +2 -2
- package/lib/deploy/functions/backend.js +7 -5
- package/lib/deploy/functions/build.js +110 -95
- package/lib/deploy/functions/checkIam.js +3 -3
- package/lib/deploy/functions/containerCleaner.js +2 -2
- package/lib/deploy/functions/deploy.js +2 -2
- package/lib/deploy/functions/ensure.js +2 -2
- package/lib/deploy/functions/params.js +5 -2
- package/lib/deploy/functions/prepare.js +4 -4
- package/lib/deploy/functions/prepareFunctionsUpload.js +2 -2
- package/lib/deploy/functions/pricing.js +3 -2
- package/lib/deploy/functions/prompts.js +2 -2
- package/lib/deploy/functions/release/fabricator.js +10 -9
- package/lib/deploy/functions/release/index.js +1 -1
- package/lib/deploy/functions/release/reporter.js +1 -1
- package/lib/deploy/functions/runtimes/discovery/parsing.js +19 -8
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +112 -107
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +1 -1
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +54 -26
- package/lib/deploy/functions/runtimes/node/versioning.js +4 -4
- package/lib/deploy/functions/services/storage.js +6 -0
- package/lib/deploy/functions/validate.js +1 -1
- package/lib/deploy/hosting/convertConfig.js +13 -2
- package/lib/deploy/hosting/deploy.js +11 -10
- package/lib/deploy/hosting/uploader.js +2 -2
- package/lib/deploy/hosting/validate.js +2 -2
- package/lib/deploy/index.js +7 -7
- package/lib/deploy/lifecycleHooks.js +5 -2
- package/lib/deploy/storage/prepare.js +5 -3
- package/lib/deploy/storage/release.js +7 -6
- package/lib/emulator/commandUtils.js +1 -1
- package/lib/emulator/controller.js +1 -1
- package/lib/emulator/databaseEmulator.js +1 -1
- package/lib/emulator/downloadableEmulators.js +1 -1
- package/lib/emulator/emulatorLogger.js +1 -1
- package/lib/emulator/extensionsEmulator.js +2 -2
- package/lib/emulator/firestoreEmulator.js +1 -1
- package/lib/emulator/functionsEmulator.js +22 -10
- package/lib/emulator/functionsEmulatorShared.js +6 -11
- package/lib/emulator/loggingEmulator.js +2 -2
- package/lib/emulator/storage/apis/firebase.js +13 -1
- package/lib/emulator/storage/apis/gcloud.js +15 -8
- package/lib/emulator/storage/files.js +26 -24
- package/lib/emulator/storage/metadata.js +6 -6
- package/lib/emulator/storage/multipart.js +4 -3
- package/lib/emulator/storage/persistence.js +26 -12
- package/lib/emulator/storage/rules/runtime.js +1 -1
- package/lib/emulator/storage/rules/utils.js +4 -2
- package/lib/emulator/types.js +1 -0
- package/lib/ensureApiEnabled.js +7 -7
- package/lib/extensions/askUserForConsent.js +1 -1
- package/lib/extensions/askUserForEventsConfig.js +1 -1
- package/lib/extensions/askUserForParam.js +1 -1
- package/lib/extensions/changelog.js +2 -2
- package/lib/extensions/checkProjectBilling.js +2 -2
- package/lib/extensions/displayExtensionInfo.js +2 -102
- package/lib/extensions/emulator/triggerHelper.js +2 -2
- package/lib/extensions/extensionsApi.js +1 -1
- package/lib/extensions/extensionsHelper.js +1 -1
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/extensions/manifest.js +1 -1
- package/lib/extensions/metricsUtils.js +1 -1
- package/lib/extensions/paramHelper.js +1 -1
- package/lib/extensions/updateHelper.js +3 -9
- package/lib/extensions/warnings.js +2 -2
- package/lib/fetchMOTD.js +1 -1
- package/lib/firestore/delete.js +1 -1
- package/lib/firestore/indexes.js +2 -2
- package/lib/firestore/validator.js +1 -1
- package/lib/functional.js +16 -1
- package/lib/functions/env.js +3 -3
- package/lib/functions/runtimeConfigExport.js +1 -1
- package/lib/functionsConfig.js +1 -1
- package/lib/functionsConfigClone.js +1 -1
- package/lib/functionsShellCommandAction.js +1 -1
- package/lib/gcp/cloudfunctions.js +24 -11
- package/lib/gcp/cloudfunctionsv2.js +48 -24
- package/lib/gcp/cloudscheduler.js +58 -22
- package/lib/gcp/cloudtasks.js +21 -4
- package/lib/gcp/proto.js +18 -6
- package/lib/gcp/resourceManager.js +25 -3
- package/lib/gcp/serviceusage.js +2 -2
- package/lib/handlePreviewToggles.js +4 -4
- package/lib/hosting/implicitInit.js +1 -1
- package/lib/hosting/normalizedHostingConfigs.js +3 -3
- package/lib/index.js +3 -3
- package/lib/init/features/database.js +1 -1
- package/lib/init/features/emulators.js +1 -1
- package/lib/init/features/firestore/index.js +2 -2
- package/lib/init/features/firestore/indexes.js +1 -1
- package/lib/init/features/firestore/rules.js +1 -1
- package/lib/init/features/functions/golang.js +1 -1
- package/lib/init/features/functions/index.js +8 -1
- package/lib/init/features/hosting/github.js +9 -9
- package/lib/init/features/hosting/index.js +1 -1
- package/lib/init/features/project.js +1 -1
- package/lib/init/features/remoteconfig.js +1 -1
- package/lib/init/features/storage.js +1 -1
- package/lib/init/index.js +1 -1
- package/lib/logError.js +3 -3
- package/lib/management/projects.js +1 -1
- package/lib/parseBoltRules.js +1 -1
- package/lib/previews.js +1 -1
- package/lib/profileReport.js +2 -2
- package/lib/projectUtils.js +1 -1
- package/lib/rc.js +1 -1
- package/lib/requireAuth.js +5 -1
- package/lib/requireDatabaseInstance.js +2 -2
- package/lib/requirePermissions.js +2 -2
- package/lib/rulesDeploy.js +49 -13
- package/lib/serve/hosting.js +2 -1
- package/lib/utils.js +10 -10
- package/npm-shrinkwrap.json +26 -295
- package/package.json +8 -5
- package/templates/hosting/init.js +6 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizedHostingConfigs = void 0;
|
|
4
|
-
const
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
5
|
const lodash_1 = require("lodash");
|
|
6
6
|
const error_1 = require("../error");
|
|
7
7
|
function filterOnly(configs, onlyString) {
|
|
@@ -34,7 +34,7 @@ function filterOnly(configs, onlyString) {
|
|
|
34
34
|
filteredConfigs.push(configsByTarget.get(onlyTarget));
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
throw new error_1.FirebaseError(`Hosting site or target ${(0,
|
|
37
|
+
throw new error_1.FirebaseError(`Hosting site or target ${(0, colorette_1.bold)(onlyTarget)} not detected in firebase.json`);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
return filteredConfigs;
|
|
@@ -82,7 +82,7 @@ function normalizedHostingConfigs(cmdOptions, options = {}) {
|
|
|
82
82
|
if (cfg.target) {
|
|
83
83
|
const matchingTargets = cmdOptions.rc.requireTarget(cmdOptions.project, "hosting", cfg.target);
|
|
84
84
|
if (matchingTargets.length > 1) {
|
|
85
|
-
throw new error_1.FirebaseError(`Hosting target ${(0,
|
|
85
|
+
throw new error_1.FirebaseError(`Hosting target ${(0, colorette_1.bold)(cfg.target)} is linked to multiple sites, ` +
|
|
86
86
|
`but only one is permitted. ` +
|
|
87
87
|
`To clear, run:\n\n firebase target:clear hosting ${cfg.target}`);
|
|
88
88
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const program = require("commander");
|
|
3
|
-
const clc = require("
|
|
3
|
+
const clc = require("colorette");
|
|
4
4
|
const leven = require("leven");
|
|
5
5
|
const logger_1 = require("./logger");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
@@ -9,7 +9,7 @@ program.version(pkg.version);
|
|
|
9
9
|
program.option("-P, --project <alias_or_project_id>", "the Firebase project to use for this command");
|
|
10
10
|
program.option("--account <email>", "the Google account to use for authorization");
|
|
11
11
|
program.option("-j, --json", "output JSON instead of text, also triggers non-interactive mode");
|
|
12
|
-
program.option("--token <token>", "supply an auth token for this command");
|
|
12
|
+
program.option("--token <token>", "DEPRECATED - will be removed in a future major version - supply an auth token for this command");
|
|
13
13
|
program.option("--non-interactive", "error out of the command instead of waiting for prompts");
|
|
14
14
|
program.option("-i, --interactive", "force prompts to be displayed");
|
|
15
15
|
program.option("--debug", "print verbose debug output and keep a debug log file");
|
|
@@ -56,7 +56,7 @@ const RENAMED_COMMANDS = {
|
|
|
56
56
|
program.action((_, args) => {
|
|
57
57
|
(0, utils_1.setupLoggers)();
|
|
58
58
|
const cmd = args[0];
|
|
59
|
-
logger_1.logger.error(clc.bold.red("Error:"), clc.bold(cmd), "is not a Firebase command");
|
|
59
|
+
logger_1.logger.error(clc.bold(clc.red("Error:")), clc.bold(cmd), "is not a Firebase command");
|
|
60
60
|
if (RENAMED_COMMANDS[cmd]) {
|
|
61
61
|
logger_1.logger.error();
|
|
62
62
|
logger_1.logger.error(clc.bold(cmd) + " has been renamed, please run", clc.bold("firebase " + RENAMED_COMMANDS[cmd]), "instead");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const prompt_1 = require("../../prompt");
|
|
6
6
|
const logger_1 = require("../../logger");
|
|
7
7
|
const utils = require("../../utils");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
const utils = require("../../utils");
|
|
7
7
|
const prompt_1 = require("../../prompt");
|
|
@@ -9,9 +9,9 @@ const checkDatabaseType_1 = require("../../../firestore/checkDatabaseType");
|
|
|
9
9
|
const rules = require("./rules");
|
|
10
10
|
const indexes = require("./indexes");
|
|
11
11
|
const error_1 = require("../../../error");
|
|
12
|
-
const clc = require("
|
|
12
|
+
const clc = require("colorette");
|
|
13
13
|
async function checkProjectSetup(setup, config, options) {
|
|
14
|
-
const firestoreUnusedError = new error_1.FirebaseError(`It looks like you haven't used Cloud Firestore in this project before. Go to ${clc.bold.underline(`https://console.firebase.google.com/project/${setup.projectId}/firestore`)} to create your Cloud Firestore database.`, { exit: 1 });
|
|
14
|
+
const firestoreUnusedError = new error_1.FirebaseError(`It looks like you haven't used Cloud Firestore in this project before. Go to ${clc.bold(clc.underline(`https://console.firebase.google.com/project/${setup.projectId}/firestore`))} to create your Cloud Firestore database.`, { exit: 1 });
|
|
15
15
|
const isFirestoreEnabled = await apiEnabled.check(setup.projectId, "firestore.googleapis.com", "", true);
|
|
16
16
|
if (!isFirestoreEnabled) {
|
|
17
17
|
throw firestoreUnusedError;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initIndexes = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const error_1 = require("../../../error");
|
|
7
7
|
const iv2 = require("../../../firestore/indexes");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initRules = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const gcp = require("../../../gcp");
|
|
7
7
|
const fsutils = require("../../../fsutils");
|
|
@@ -4,12 +4,12 @@ const util_1 = require("util");
|
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const spawn = require("cross-spawn");
|
|
7
|
+
const clc = require("colorette");
|
|
7
8
|
const error_1 = require("../../../error");
|
|
8
9
|
const prompt_1 = require("../../../prompt");
|
|
9
10
|
const utils = require("../../../utils");
|
|
10
11
|
const go = require("../../../deploy/functions/runtimes/golang");
|
|
11
12
|
const logger_1 = require("../../../logger");
|
|
12
|
-
const clc = require("cli-color");
|
|
13
13
|
const RUNTIME_VERSION = "1.13";
|
|
14
14
|
const TEMPLATE_ROOT = path.resolve(__dirname, "../../../../templates/init/functions/golang");
|
|
15
15
|
const MAIN_TEMPLATE = fs.readFileSync(path.join(TEMPLATE_ROOT, "functions.go"), "utf8");
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const _ = require("lodash");
|
|
5
6
|
const logger_1 = require("../../../logger");
|
|
6
7
|
const prompt_1 = require("../../../prompt");
|
|
7
8
|
const requirePermissions_1 = require("../../../requirePermissions");
|
|
@@ -44,6 +45,12 @@ async function doSetup(setup, config, options) {
|
|
|
44
45
|
default: "javascript",
|
|
45
46
|
choices,
|
|
46
47
|
});
|
|
48
|
+
_.set(setup, "config.functions.ignore", [
|
|
49
|
+
"node_modules",
|
|
50
|
+
".git",
|
|
51
|
+
"firebase-debug.log",
|
|
52
|
+
"firebase-debug.*.log",
|
|
53
|
+
]);
|
|
47
54
|
return require("./" + language).setup(setup, config);
|
|
48
55
|
}
|
|
49
56
|
exports.doSetup = doSetup;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initGitHub = void 0;
|
|
4
|
-
const
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const yaml = require("js-yaml");
|
|
7
7
|
const js_yaml_1 = require("js-yaml");
|
|
@@ -32,7 +32,7 @@ async function initGitHub(setup) {
|
|
|
32
32
|
return (0, utils_1.reject)("Could not determine Project ID, can't set up GitHub workflow.", { exit: 1 });
|
|
33
33
|
}
|
|
34
34
|
if (!setup.config.hosting) {
|
|
35
|
-
return (0, utils_1.reject)(`Didn't find a Hosting config in firebase.json. Run ${(0,
|
|
35
|
+
return (0, utils_1.reject)(`Didn't find a Hosting config in firebase.json. Run ${(0, colorette_1.bold)("firebase init hosting")} instead.`);
|
|
36
36
|
}
|
|
37
37
|
logger_1.logger.info();
|
|
38
38
|
const gitRoot = getGitFolderPath();
|
|
@@ -46,7 +46,7 @@ async function initGitHub(setup) {
|
|
|
46
46
|
const userDetails = await getGitHubUserDetails(ghAccessToken);
|
|
47
47
|
const ghUserName = userDetails.login;
|
|
48
48
|
logger_1.logger.info();
|
|
49
|
-
(0, utils_1.logSuccess)(`Success! Logged into GitHub as ${(0,
|
|
49
|
+
(0, utils_1.logSuccess)(`Success! Logged into GitHub as ${(0, colorette_1.bold)(ghUserName)}`);
|
|
50
50
|
logger_1.logger.info();
|
|
51
51
|
const { repo, key, keyId } = await promptForRepo(setup, ghAccessToken);
|
|
52
52
|
const { default_branch: defaultBranch, id: repoId } = await getRepoDetails(repo, ghAccessToken);
|
|
@@ -56,13 +56,13 @@ async function initGitHub(setup) {
|
|
|
56
56
|
const serviceAccountName = `github-action-${repoId}`;
|
|
57
57
|
const serviceAccountJSON = await createServiceAccountAndKeyWithRetry(setup, repo, serviceAccountName);
|
|
58
58
|
logger_1.logger.info();
|
|
59
|
-
(0, utils_1.logSuccess)(`Created service account ${(0,
|
|
59
|
+
(0, utils_1.logSuccess)(`Created service account ${(0, colorette_1.bold)(serviceAccountName)} with Firebase Hosting admin permissions.`);
|
|
60
60
|
const spinnerSecrets = ora(`Uploading service account secrets to repository: ${repo}`);
|
|
61
61
|
spinnerSecrets.start();
|
|
62
62
|
const encryptedServiceAccountJSON = encryptServiceAccountJSON(serviceAccountJSON, key);
|
|
63
63
|
await uploadSecretToGitHub(repo, ghAccessToken, await encryptedServiceAccountJSON, keyId, githubSecretName);
|
|
64
64
|
spinnerSecrets.stop();
|
|
65
|
-
(0, utils_1.logSuccess)(`Uploaded service account JSON to GitHub as secret ${(0,
|
|
65
|
+
(0, utils_1.logSuccess)(`Uploaded service account JSON to GitHub as secret ${(0, colorette_1.bold)(githubSecretName)}.`);
|
|
66
66
|
(0, utils_1.logBullet)(`You can manage your secrets at https://github.com/${repo}/settings/secrets.`);
|
|
67
67
|
logger_1.logger.info();
|
|
68
68
|
if (setup.config.hosting.predeploy) {
|
|
@@ -81,7 +81,7 @@ async function initGitHub(setup) {
|
|
|
81
81
|
if (shouldWriteYMLHostingFile) {
|
|
82
82
|
writeChannelActionYMLFile(YML_FULL_PATH_PULL_REQUEST, githubSecretName, setup.projectId, script);
|
|
83
83
|
logger_1.logger.info();
|
|
84
|
-
(0, utils_1.logSuccess)(`Created workflow file ${(0,
|
|
84
|
+
(0, utils_1.logSuccess)(`Created workflow file ${(0, colorette_1.bold)(YML_FULL_PATH_PULL_REQUEST)}`);
|
|
85
85
|
}
|
|
86
86
|
const { setupDeploys, branch } = await promptToSetupDeploys(ymlDeployDoc.branch || defaultBranch);
|
|
87
87
|
if (setupDeploys) {
|
|
@@ -102,12 +102,12 @@ async function initGitHub(setup) {
|
|
|
102
102
|
if (shouldWriteYMLDeployFile) {
|
|
103
103
|
writeDeployToProdActionYMLFile(YML_FULL_PATH_MERGE, branch, githubSecretName, setup.projectId, script);
|
|
104
104
|
logger_1.logger.info();
|
|
105
|
-
(0, utils_1.logSuccess)(`Created workflow file ${(0,
|
|
105
|
+
(0, utils_1.logSuccess)(`Created workflow file ${(0, colorette_1.bold)(YML_FULL_PATH_MERGE)}`);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
logger_1.logger.info();
|
|
109
109
|
(0, utils_1.logLabeledBullet)("Action required", `Visit this URL to revoke authorization for the Firebase CLI GitHub OAuth App:`);
|
|
110
|
-
logger_1.logger.info(
|
|
110
|
+
logger_1.logger.info((0, colorette_1.bold)((0, colorette_1.underline)(`https://github.com/settings/connections/applications/${api_1.githubClientId}`)));
|
|
111
111
|
(0, utils_1.logLabeledBullet)("Action required", `Push any new workflow file(s) to your repo`);
|
|
112
112
|
}
|
|
113
113
|
exports.initGitHub = initGitHub;
|
|
@@ -253,7 +253,7 @@ async function promptForRepo(options, ghAccessToken) {
|
|
|
253
253
|
(0, utils_1.logWarning)("The provided authorization cannot be used with this repository. If this repository is in an organization, did you remember to grant access?", "error");
|
|
254
254
|
logger_1.logger.info();
|
|
255
255
|
(0, utils_1.logLabeledBullet)("Action required", `Visit this URL to ensure access has been granted to the appropriate organization(s) for the Firebase CLI GitHub OAuth App:`);
|
|
256
|
-
logger_1.logger.info(
|
|
256
|
+
logger_1.logger.info((0, colorette_1.bold)((0, colorette_1.underline)(`https://github.com/settings/connections/applications/${api_1.githubClientId}`)));
|
|
257
257
|
logger_1.logger.info();
|
|
258
258
|
}
|
|
259
259
|
return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const apiv2_1 = require("../../../apiv2");
|
|
7
7
|
const github_1 = require("./github");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
const error_1 = require("../../error");
|
|
7
7
|
const projects_1 = require("../../management/projects");
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
4
|
const prompt_1 = require("../../prompt");
|
|
5
5
|
const fsutils = require("../../fsutils");
|
|
6
|
-
const clc = require("
|
|
6
|
+
const clc = require("colorette");
|
|
7
7
|
async function doSetup(setup, config) {
|
|
8
8
|
setup.config.remoteconfig = {};
|
|
9
9
|
const jsonFilePath = await (0, prompt_1.promptOnce)({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSetup = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const logger_1 = require("../../logger");
|
|
7
7
|
const prompt_1 = require("../../prompt");
|
package/lib/init/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const error_1 = require("../error");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
8
|
const features = require("./features");
|
package/lib/logError.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logError = void 0;
|
|
4
4
|
const logger_1 = require("./logger");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
function logError(error) {
|
|
7
7
|
if (error.children && error.children.length) {
|
|
8
|
-
logger_1.logger.error(clc.bold.red("Error:"), clc.underline(error.message) + ":");
|
|
8
|
+
logger_1.logger.error(clc.bold(clc.red("Error:")), clc.underline(error.message) + ":");
|
|
9
9
|
error.children.forEach((child) => {
|
|
10
10
|
let out = "- ";
|
|
11
11
|
if (child.name) {
|
|
@@ -20,7 +20,7 @@ function logError(error) {
|
|
|
20
20
|
logger_1.logger.debug(error.original.stack);
|
|
21
21
|
}
|
|
22
22
|
logger_1.logger.error();
|
|
23
|
-
logger_1.logger.error(clc.bold.red("Error:"), error.message);
|
|
23
|
+
logger_1.logger.error(clc.bold(clc.red("Error:")), error.message);
|
|
24
24
|
}
|
|
25
25
|
if (error.context) {
|
|
26
26
|
logger_1.logger.debug("Error Context:", JSON.stringify(error.context, undefined, 2));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFirebaseProject = exports.listFirebaseProjects = exports.getAvailableCloudProjectPage = exports.getFirebaseProjectPage = exports.addFirebaseToCloudProject = exports.createCloudProject = exports.promptAvailableProjectId = exports.getOrPromptProject = exports.addFirebaseToCloudProjectAndLog = exports.createFirebaseProjectAndLog = exports.PROJECTS_CREATE_QUESTIONS = exports.ProjectParentResourceType = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const ora = require("ora");
|
|
6
6
|
const apiv2_1 = require("../apiv2");
|
|
7
7
|
const error_1 = require("../error");
|
package/lib/parseBoltRules.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.parseBoltRules = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const spawn = require("cross-spawn");
|
|
6
|
-
const clc = require("
|
|
6
|
+
const clc = require("colorette");
|
|
7
7
|
const _ = require("lodash");
|
|
8
8
|
const error_1 = require("./error");
|
|
9
9
|
function parseBoltRules(filename) {
|
package/lib/previews.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.previews = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const configstore_1 = require("./configstore");
|
|
6
|
-
exports.previews = Object.assign({ rtdbrules: false, ext: false, extdev: false, rtdbmanagement: false, golang: false, deletegcfartifacts: false, emulatoruisnapshot: false, frameworkawareness: false, functionsparams: false }, configstore_1.configstore.get("previews"));
|
|
6
|
+
exports.previews = Object.assign({ rtdbrules: false, ext: false, extdev: false, rtdbmanagement: false, golang: false, deletegcfartifacts: false, emulatoruisnapshot: false, frameworkawareness: false, functionsparams: false, crossservicerules: false }, configstore_1.configstore.get("previews"));
|
|
7
7
|
if (process.env.FIREBASE_CLI_PREVIEWS) {
|
|
8
8
|
process.env.FIREBASE_CLI_PREVIEWS.split(",").forEach((feature) => {
|
|
9
9
|
if ((0, lodash_1.has)(exports.previews, feature)) {
|
package/lib/profileReport.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProfileReport = exports.extractReadableIndex = exports.formatBytes = exports.formatNumber = exports.pathString = exports.extractJSON = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const Table = require("cli-table");
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const _ = require("lodash");
|
|
@@ -515,7 +515,7 @@ class ProfileReport {
|
|
|
515
515
|
write(title + "\n");
|
|
516
516
|
}
|
|
517
517
|
else {
|
|
518
|
-
write(clc.bold.yellow(title) + "\n");
|
|
518
|
+
write(clc.bold(clc.yellow(title)) + "\n");
|
|
519
519
|
}
|
|
520
520
|
};
|
|
521
521
|
const writeTable = (title, table) => {
|
package/lib/projectUtils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAliases = exports.needProjectNumber = exports.needProjectId = exports.getProjectId = void 0;
|
|
4
4
|
const projects_1 = require("./management/projects");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const { marked } = require("marked");
|
|
7
7
|
const { FirebaseError } = require("./error");
|
|
8
8
|
function getProjectId({ projectId, project, }) {
|
package/lib/rc.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RC = exports.loadRC = void 0;
|
|
4
4
|
const _ = require("lodash");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const cjson = require("cjson");
|
|
7
7
|
const fs = require("fs");
|
|
8
8
|
const path = require("path");
|
package/lib/requireAuth.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.requireAuth = void 0;
|
|
4
4
|
const google_auth_library_1 = require("google-auth-library");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const api = require("./api");
|
|
7
7
|
const apiv2 = require("./apiv2");
|
|
8
8
|
const error_1 = require("./error");
|
|
@@ -32,9 +32,13 @@ async function requireAuth(options) {
|
|
|
32
32
|
let tokenOpt = utils.getInheritedOption(options, "token");
|
|
33
33
|
if (tokenOpt) {
|
|
34
34
|
logger_1.logger.debug("> authorizing via --token option");
|
|
35
|
+
utils.logWarning("Authenticating with `--token` is deprecated and will be removed in a future major version of `firebase-tools`. " +
|
|
36
|
+
"Instead, use a service account key with `GOOGLE_APPLICATION_CREDENTIALS`: https://cloud.google.com/docs/authentication/getting-started");
|
|
35
37
|
}
|
|
36
38
|
else if (process.env.FIREBASE_TOKEN) {
|
|
37
39
|
logger_1.logger.debug("> authorizing via FIREBASE_TOKEN environment variable");
|
|
40
|
+
utils.logWarning("Authenticating with `FIREBASE_TOKEN` is deprecated and will be removed in a future major version of `firebase-tools`. " +
|
|
41
|
+
"Instead, use a service account key with `GOOGLE_APPLICATION_CREDENTIALS`: https://cloud.google.com/docs/authentication/getting-started");
|
|
38
42
|
}
|
|
39
43
|
else if (user) {
|
|
40
44
|
logger_1.logger.debug(`> authorizing via signed-in user (${user.email})`);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.requireDatabaseInstance = exports.MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const error_1 = require("./error");
|
|
6
6
|
const getDefaultDatabaseInstance_1 = require("./getDefaultDatabaseInstance");
|
|
7
|
-
exports.MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE = `It looks like you haven't created a Realtime Database instance in this project before. Please run ${clc.bold.underline("firebase init database")} to create your default Realtime Database instance.`;
|
|
7
|
+
exports.MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE = `It looks like you haven't created a Realtime Database instance in this project before. Please run ${clc.bold(clc.underline("firebase init database"))} to create your default Realtime Database instance.`;
|
|
8
8
|
async function requireDatabaseInstance(options) {
|
|
9
9
|
if (options.instance) {
|
|
10
10
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.requirePermissions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
5
|
const projectUtils_1 = require("./projectUtils");
|
|
6
6
|
const requireAuth_1 = require("./requireAuth");
|
|
7
7
|
const logger_1 = require("./logger");
|
|
@@ -19,7 +19,7 @@ async function requirePermissions(options, permissions = []) {
|
|
|
19
19
|
try {
|
|
20
20
|
const iamResult = await (0, iam_1.testIamPermissions)(projectId, requiredPermissions);
|
|
21
21
|
if (!iamResult.passed) {
|
|
22
|
-
throw new error_1.FirebaseError(`Authorization failed. This account is missing the following required permissions on project ${(0,
|
|
22
|
+
throw new error_1.FirebaseError(`Authorization failed. This account is missing the following required permissions on project ${(0, colorette_1.bold)(projectId)}:\n\n ${iamResult.missing.join("\n ")}`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
catch (err) {
|
package/lib/rulesDeploy.js
CHANGED
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RulesDeploy = exports.RulesetServiceType = void 0;
|
|
4
4
|
const _ = require("lodash");
|
|
5
|
-
const
|
|
5
|
+
const colorette_1 = require("colorette");
|
|
6
6
|
const fs = require("fs-extra");
|
|
7
7
|
const gcp = require("./gcp");
|
|
8
8
|
const logger_1 = require("./logger");
|
|
9
9
|
const error_1 = require("./error");
|
|
10
10
|
const utils = require("./utils");
|
|
11
11
|
const prompt_1 = require("./prompt");
|
|
12
|
+
const getProjectNumber_1 = require("./getProjectNumber");
|
|
13
|
+
const resourceManager_1 = require("./gcp/resourceManager");
|
|
14
|
+
const previews_1 = require("./previews");
|
|
12
15
|
const QUOTA_EXCEEDED_STATUS_CODE = 429;
|
|
13
16
|
const RULESET_COUNT_LIMIT = 1000;
|
|
14
17
|
const RULESETS_TO_GC = 10;
|
|
18
|
+
const CROSS_SERVICE_FUNCTIONS = /firestore\.(get|exists)/;
|
|
19
|
+
const CROSS_SERVICE_RULES_ROLE = "roles/firebaserules.firestoreServiceAgent";
|
|
15
20
|
var RulesetServiceType;
|
|
16
21
|
(function (RulesetServiceType) {
|
|
17
22
|
RulesetServiceType["CLOUD_FIRESTORE"] = "cloud.firestore";
|
|
@@ -37,7 +42,7 @@ class RulesDeploy {
|
|
|
37
42
|
}
|
|
38
43
|
catch (e) {
|
|
39
44
|
logger_1.logger.debug("[rules read error]", e.stack);
|
|
40
|
-
throw new error_1.FirebaseError(
|
|
45
|
+
throw new error_1.FirebaseError(`Error reading rules file ${(0, colorette_1.bold)(path)}`);
|
|
41
46
|
}
|
|
42
47
|
this.rulesFiles[path] = [{ name: path, content: src }];
|
|
43
48
|
}
|
|
@@ -54,18 +59,50 @@ class RulesDeploy {
|
|
|
54
59
|
}
|
|
55
60
|
return { latestName, latestContent };
|
|
56
61
|
}
|
|
62
|
+
async checkStorageRulesIamPermissions(rulesContent) {
|
|
63
|
+
if ((rulesContent === null || rulesContent === void 0 ? void 0 : rulesContent.match(CROSS_SERVICE_FUNCTIONS)) === null) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (this.options.nonInteractive) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const projectNumber = await (0, getProjectNumber_1.getProjectNumber)(this.options);
|
|
70
|
+
const saEmail = `service-${projectNumber}@gcp-sa-firebasestorage.iam.gserviceaccount.com`;
|
|
71
|
+
try {
|
|
72
|
+
if (await (0, resourceManager_1.serviceAccountHasRoles)(projectNumber, saEmail, [CROSS_SERVICE_RULES_ROLE], true)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const addRole = await (0, prompt_1.promptOnce)({
|
|
76
|
+
type: "confirm",
|
|
77
|
+
name: "rulesRole",
|
|
78
|
+
message: `Cloud Storage for Firebase needs an IAM Role to use cross-service rules. Grant the new role?`,
|
|
79
|
+
default: true,
|
|
80
|
+
}, this.options);
|
|
81
|
+
if (addRole) {
|
|
82
|
+
await (0, resourceManager_1.addServiceAccountToRoles)(projectNumber, saEmail, [CROSS_SERVICE_RULES_ROLE], true);
|
|
83
|
+
utils.logLabeledBullet(RulesetType[this.type], "updated service account for cross-service rules...");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
logger_1.logger.warn("[rules] Error checking or updating Cloud Storage for Firebase service account permissions.");
|
|
88
|
+
logger_1.logger.warn("[rules] Cross-service Storage rules may not function properly", e.message);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
57
91
|
async createRulesets(service) {
|
|
92
|
+
var _a;
|
|
58
93
|
const createdRulesetNames = [];
|
|
59
94
|
const { latestName: latestRulesetName, latestContent: latestRulesetContent } = await this.getCurrentRules(service);
|
|
60
95
|
const newRulesetsByFilename = new Map();
|
|
61
|
-
for (const filename of Object.
|
|
62
|
-
const files = this.rulesFiles[filename];
|
|
96
|
+
for (const [filename, files] of Object.entries(this.rulesFiles)) {
|
|
63
97
|
if (latestRulesetName && _.isEqual(files, latestRulesetContent)) {
|
|
64
|
-
utils.
|
|
98
|
+
utils.logLabeledBullet(RulesetType[this.type], `latest version of ${(0, colorette_1.bold)(filename)} already up to date, skipping upload...`);
|
|
65
99
|
this.rulesetNames[filename] = latestRulesetName;
|
|
66
100
|
continue;
|
|
67
101
|
}
|
|
68
|
-
|
|
102
|
+
if (previews_1.previews.crossservicerules && service === RulesetServiceType.FIREBASE_STORAGE) {
|
|
103
|
+
await this.checkStorageRulesIamPermissions((_a = files[0]) === null || _a === void 0 ? void 0 : _a.content);
|
|
104
|
+
}
|
|
105
|
+
utils.logLabeledBullet(RulesetType[this.type], `uploading rules ${(0, colorette_1.bold)(filename)}...`);
|
|
69
106
|
newRulesetsByFilename.set(filename, gcp.rules.createRuleset(this.options.project, files));
|
|
70
107
|
}
|
|
71
108
|
try {
|
|
@@ -79,8 +116,7 @@ class RulesDeploy {
|
|
|
79
116
|
if (err.status !== QUOTA_EXCEEDED_STATUS_CODE) {
|
|
80
117
|
throw err;
|
|
81
118
|
}
|
|
82
|
-
utils.
|
|
83
|
-
" quota exceeded error while uploading rules");
|
|
119
|
+
utils.logLabeledBullet(RulesetType[this.type], "quota exceeded error while uploading rules");
|
|
84
120
|
const history = await gcp.rules.listAllRulesets(this.options.project);
|
|
85
121
|
if (history.length > RULESET_COUNT_LIMIT) {
|
|
86
122
|
const confirm = await (0, prompt_1.promptOnce)({
|
|
@@ -99,7 +135,7 @@ class RulesDeploy {
|
|
|
99
135
|
await gcp.rules.deleteRuleset(this.options.project, gcp.rules.getRulesetId(entry));
|
|
100
136
|
logger_1.logger.debug(`[rules] Deleted ${entry.name}`);
|
|
101
137
|
}
|
|
102
|
-
utils.
|
|
138
|
+
utils.logLabeledWarning(RulesetType[this.type], "retrying rules upload");
|
|
103
139
|
return this.createRulesets(service);
|
|
104
140
|
}
|
|
105
141
|
}
|
|
@@ -113,10 +149,10 @@ class RulesDeploy {
|
|
|
113
149
|
await gcp.rules.updateOrCreateRelease(this.options.project, this.rulesetNames[filename], resourceName === RulesetServiceType.FIREBASE_STORAGE
|
|
114
150
|
? `${resourceName}/${subResourceName}`
|
|
115
151
|
: resourceName);
|
|
116
|
-
utils.
|
|
152
|
+
utils.logLabeledSuccess(RulesetType[this.type], `released rules ${(0, colorette_1.bold)(filename)} to ${(0, colorette_1.bold)(resourceName)}`);
|
|
117
153
|
}
|
|
118
154
|
async compileRuleset(filename, files) {
|
|
119
|
-
utils.
|
|
155
|
+
utils.logLabeledBullet(this.type, `checking ${(0, colorette_1.bold)(filename)} for compilation errors...`);
|
|
120
156
|
const response = await gcp.rules.testRuleset(this.options.project, files);
|
|
121
157
|
if (_.get(response, "body.issues", []).length) {
|
|
122
158
|
const warnings = [];
|
|
@@ -137,11 +173,11 @@ class RulesDeploy {
|
|
|
137
173
|
}
|
|
138
174
|
if (errors.length > 0) {
|
|
139
175
|
const add = errors.length === 1 ? "" : "s";
|
|
140
|
-
const message = `Compilation error${add} in ${
|
|
176
|
+
const message = `Compilation error${add} in ${(0, colorette_1.bold)(filename)}:\n${errors.join("\n")}`;
|
|
141
177
|
throw new error_1.FirebaseError(message, { exit: 1 });
|
|
142
178
|
}
|
|
143
179
|
}
|
|
144
|
-
utils.
|
|
180
|
+
utils.logLabeledSuccess(this.type, `rules file ${(0, colorette_1.bold)(filename)} compiled successfully`);
|
|
145
181
|
}
|
|
146
182
|
}
|
|
147
183
|
exports.RulesDeploy = RulesDeploy;
|
package/lib/serve/hosting.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.connect = exports.start = exports.stop = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const superstatic = require("superstatic").server;
|
|
6
6
|
const morgan = require("morgan");
|
|
7
7
|
const detectProjectRoot_1 = require("../detectProjectRoot");
|
|
@@ -60,6 +60,7 @@ function startServer(options, config, port, init) {
|
|
|
60
60
|
port: port,
|
|
61
61
|
host: options.host,
|
|
62
62
|
config: config,
|
|
63
|
+
compression: true,
|
|
63
64
|
cwd: (0, detectProjectRoot_1.detectProjectRoot)(options),
|
|
64
65
|
stack: "strict",
|
|
65
66
|
before: {
|