@automattic/vip 2.9.5 → 2.11.2
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/CONTRIBUTING.md +2 -11
- package/README.md +26 -0
- package/dist/bin/vip-dev-env-create.js +9 -1
- package/dist/bin/vip-dev-env-destroy.js +7 -7
- package/dist/bin/vip-dev-env-exec.js +7 -1
- package/dist/bin/vip-dev-env-import-media.js +7 -1
- package/dist/bin/vip-dev-env-import-sql.js +7 -1
- package/dist/bin/vip-dev-env-info.js +10 -1
- package/dist/bin/vip-dev-env-list.js +10 -1
- package/dist/bin/vip-dev-env-start.js +14 -3
- package/dist/bin/vip-dev-env-stop.js +7 -1
- package/dist/bin/vip-dev-env-update.js +8 -2
- package/dist/bin/vip-import-sql.js +7 -1
- package/dist/lib/analytics/clients/pendo.js +92 -0
- package/dist/lib/analytics/index.js +8 -3
- package/dist/lib/dev-environment/dev-environment-cli.js +56 -1
- package/dist/lib/dev-environment/dev-environment-core.js +4 -2
- package/dist/lib/dev-environment/dev-environment-lando.js +35 -3
- package/dist/lib/tracker.js +15 -7
- package/npm-shrinkwrap.json +1 -1
- package/package/dist/bin/vip-app-list.js +73 -0
- package/package/dist/bin/vip-app.js +76 -0
- package/package/dist/bin/vip-config-envvar-delete.js +97 -0
- package/package/dist/bin/vip-config-envvar-get-all.js +94 -0
- package/package/dist/bin/vip-config-envvar-get.js +79 -0
- package/package/dist/bin/vip-config-envvar-list.js +91 -0
- package/package/dist/bin/vip-config-envvar-set.js +123 -0
- package/package/dist/bin/vip-config-envvar.js +23 -0
- package/package/dist/bin/vip-config.js +20 -0
- package/package/dist/bin/vip-dev-env-create.js +105 -0
- package/package/dist/bin/vip-dev-env-destroy.js +56 -0
- package/package/dist/bin/vip-dev-env-exec.js +67 -0
- package/package/dist/bin/vip-dev-env-import-media.js +51 -0
- package/package/dist/bin/vip-dev-env-import-sql.js +83 -0
- package/package/dist/bin/vip-dev-env-import.js +32 -0
- package/package/dist/bin/vip-dev-env-info.js +61 -0
- package/package/dist/bin/vip-dev-env-list.js +46 -0
- package/package/dist/bin/vip-dev-env-start.js +77 -0
- package/package/dist/bin/vip-dev-env-stop.js +52 -0
- package/package/dist/bin/vip-dev-env-update.js +89 -0
- package/package/dist/bin/vip-dev-env.js +23 -0
- package/package/dist/bin/vip-import-media-abort.js +132 -0
- package/package/dist/bin/vip-import-media-status.js +84 -0
- package/package/dist/bin/vip-import-media.js +168 -0
- package/package/dist/bin/vip-import-sql-status.js +83 -0
- package/package/dist/bin/vip-import-sql.js +580 -0
- package/package/dist/bin/vip-import-validate-files.js +191 -0
- package/package/dist/bin/vip-import-validate-sql.js +34 -0
- package/package/dist/bin/vip-import.js +20 -0
- package/package/dist/bin/vip-logs.js +232 -0
- package/package/dist/bin/vip-search-replace.js +71 -0
- package/package/dist/bin/vip-sync.js +191 -0
- package/package/dist/bin/vip-whoami.js +67 -0
- package/package/dist/bin/vip-wp.js +555 -0
- package/package/dist/bin/vip.js +149 -0
- package/package/dist/lib/analytics/clients/client.js +1 -0
- package/package/dist/lib/analytics/clients/pendo.js +92 -0
- package/package/dist/lib/analytics/clients/stub.js +19 -0
- package/package/dist/lib/analytics/clients/tracks.js +128 -0
- package/package/dist/lib/analytics/index.js +45 -0
- package/package/dist/lib/api/app.js +70 -0
- package/package/dist/lib/api/feature-flags.js +39 -0
- package/package/dist/lib/api/user.js +58 -0
- package/package/dist/lib/api.js +136 -0
- package/package/dist/lib/app-logs/app-logs.js +70 -0
- package/package/dist/lib/cli/apiConfig.js +90 -0
- package/package/dist/lib/cli/command.js +606 -0
- package/package/dist/lib/cli/envAlias.js +60 -0
- package/package/dist/lib/cli/exit.js +33 -0
- package/package/dist/lib/cli/format.js +213 -0
- package/package/dist/lib/cli/pager.js +52 -0
- package/package/dist/lib/cli/progress.js +208 -0
- package/package/dist/lib/cli/prompt.js +37 -0
- package/package/dist/lib/cli/repo.js +77 -0
- package/package/dist/lib/client-file-uploader.js +602 -0
- package/package/dist/lib/constants/dev-environment.js +42 -0
- package/package/dist/lib/constants/file-size.js +14 -0
- package/package/dist/lib/dev-environment/dev-environment-cli.js +508 -0
- package/package/dist/lib/dev-environment/dev-environment-core.js +620 -0
- package/package/dist/lib/dev-environment/dev-environment-lando.js +330 -0
- package/package/dist/lib/dev-environment/types.js +1 -0
- package/package/dist/lib/env.js +36 -0
- package/package/dist/lib/envvar/api-delete.js +56 -0
- package/package/dist/lib/envvar/api-get-all.js +59 -0
- package/package/dist/lib/envvar/api-get.js +24 -0
- package/package/dist/lib/envvar/api-list.js +60 -0
- package/package/dist/lib/envvar/api-set.js +58 -0
- package/package/dist/lib/envvar/api.js +104 -0
- package/package/dist/lib/envvar/input.js +55 -0
- package/package/dist/lib/envvar/logging.js +33 -0
- package/package/dist/lib/envvar/read-file.js +43 -0
- package/package/dist/lib/http/socks-proxy-agent.js +25 -0
- package/package/dist/lib/keychain/browser.js +35 -0
- package/package/dist/lib/keychain/insecure.js +63 -0
- package/package/dist/lib/keychain/keychain.js +1 -0
- package/package/dist/lib/keychain/secure.js +36 -0
- package/package/dist/lib/keychain.js +36 -0
- package/package/dist/lib/media-import/media-file-import.js +34 -0
- package/package/dist/lib/media-import/progress.js +86 -0
- package/package/dist/lib/media-import/status.js +335 -0
- package/package/dist/lib/rollbar.js +35 -0
- package/package/dist/lib/search-and-replace.js +203 -0
- package/package/dist/lib/site-import/db-file-import.js +46 -0
- package/package/dist/lib/site-import/status.js +444 -0
- package/package/dist/lib/token.js +132 -0
- package/package/dist/lib/tracker.js +96 -0
- package/package/dist/lib/validations/is-multi-site-sql-dump.js +59 -0
- package/package/dist/lib/validations/is-multi-site.js +99 -0
- package/package/dist/lib/validations/line-by-line.js +92 -0
- package/package/dist/lib/validations/site-type.js +66 -0
- package/package/dist/lib/validations/sql.js +371 -0
- package/package/dist/lib/vip-import-validate-files.js +548 -0
- package/package/vip.iml +11 -0
- package/package.json +1 -1
- package/vip.iml +11 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -44,21 +44,12 @@ Our release flow for VIP CLI follows this pattern:
|
|
|
44
44
|
- Include a Changelog for all npm version releases, including any minor or major versions
|
|
45
45
|
- This is a public repository. Please do not include any internal links in PRs, changelogs, testing instructions, etc.
|
|
46
46
|
- Merge changes from your feature branch to the `develop` branch
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- Any team member that is part of our NPM organization can release new minor or major versions, but please have a Customer Experience (Pâtisserie) team member look over the changes first.
|
|
47
|
+
- If you are ready to release your changes publicly, merge your changes from the `develop` branch to the `master` branch. All changes that are not ready to be public should be feature flagged or stay in the `develop` branch to avoid conflicts when releasing urgent fixes (not recommended).
|
|
48
|
+
- Finally, release your changes as a new minor or major NPM version. Ping in the #vip-platform-patisserie channel to notify folks of a new release, but please feel free to release your changes without any blockers from the team. Any team member that is part of the Automattic NPM organization can release a new version; if you aren't a member, generic credentials are available in the Secret Store.
|
|
50
49
|
|
|
51
50
|
### Changelogs
|
|
52
51
|
Changelogs allow customers to keep up with all the changes happening across our VIP Platform. Changelogs for VIP CLI are posted to the [VIP Cloud Changelog P2](https://wpvipchangelog.wordpress.com/), along with the repository’s `README.md`.
|
|
53
52
|
|
|
54
|
-
### Release Schedule
|
|
55
|
-
|
|
56
|
-
The VIP Customer Experience squad conducts releases on Tuesdays from 4AM to 5PM Pacific Time (US). Releases are regular but do not happen every Tuesday. Please coordinate with the VIP Customer Experience squad if you'd like to lead your own release.
|
|
57
|
-
|
|
58
|
-
As part of the release process, our squad merges changes from the `develop` branch to the `master` branch. Therefore, do not merge changes into `develop` unless it is ready for release (or use a feature flag to disable it).
|
|
59
|
-
|
|
60
|
-
Fixes for urgent or breaking bugs may be merged straight to the `master` branch and released publicly via `npm` at any time outside of our release window. All other changes should participate in our release window.
|
|
61
|
-
|
|
62
53
|
## Releasing / Publishing
|
|
63
54
|
|
|
64
55
|
### Pre-publish Checks
|
package/README.md
CHANGED
|
@@ -26,6 +26,32 @@ By default, we record information about the usage of this tool using an in-house
|
|
|
26
26
|
|
|
27
27
|
## Changelog
|
|
28
28
|
|
|
29
|
+
### 2.11.2 (12 May 2022)
|
|
30
|
+
|
|
31
|
+
- Hotfix to use correct production config.json in the NPM published package caused by a different NPM version in the build process.
|
|
32
|
+
|
|
33
|
+
### 2.11.1 (12 May 2022)
|
|
34
|
+
|
|
35
|
+
- Hotfix to use correct production config.json in the NPM published package
|
|
36
|
+
|
|
37
|
+
### 2.11.0 (11 May 2022)
|
|
38
|
+
|
|
39
|
+
- #1022 [dev-env] Validate docker installed
|
|
40
|
+
- #1026 [dev-env] adds tracking to stop subcommand
|
|
41
|
+
- #1028 Re-calculate the fileMeta if file gets changed by the searchAndReplace
|
|
42
|
+
- #1029 Adds Pendo analytics client
|
|
43
|
+
- #1030 [dev-env] Fix failure tracking
|
|
44
|
+
|
|
45
|
+
### 2.10.0 (4 May 2022)
|
|
46
|
+
|
|
47
|
+
- #1021 [dev-env] Add login info and documentation link to `dev-env info`
|
|
48
|
+
- #1023 [dev-env] Skip the trunk from the prompt about the latest available WordPress versions
|
|
49
|
+
- #1019 [dev-env] Unifies lando and other dev-env debug logs
|
|
50
|
+
- #1018 [dev-env] enable lando debug on `--debug`
|
|
51
|
+
- #1017 [dev-env] Adding tracking for create and destroy sub commands
|
|
52
|
+
- #1016 [dev-env] Adding tracking for start sub command
|
|
53
|
+
- #1020 [dev-env] More tracking
|
|
54
|
+
|
|
29
55
|
### 2.9.5 (26 April 2022)
|
|
30
56
|
|
|
31
57
|
- #1005 [dev-env] updateWordPress image improvements
|
|
@@ -14,6 +14,8 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
14
14
|
|
|
15
15
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
16
16
|
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
|
+
|
|
17
19
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
18
20
|
|
|
19
21
|
var exit = _interopRequireWildcard(require("../lib/cli/exit"));
|
|
@@ -58,8 +60,13 @@ const cmd = (0, _command.default)().option('slug', 'Custom name of the dev envir
|
|
|
58
60
|
(0, _devEnvironmentCli.addDevEnvConfigurationOptions)(cmd);
|
|
59
61
|
cmd.examples(examples);
|
|
60
62
|
cmd.argv(process.argv, async (arg, opt) => {
|
|
63
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
61
64
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
62
65
|
debug('Args: ', arg, 'Options: ', opt);
|
|
66
|
+
const trackingInfo = {
|
|
67
|
+
slug
|
|
68
|
+
};
|
|
69
|
+
await (0, _tracker.trackEvent)('dev_env_create_command_execute', trackingInfo);
|
|
63
70
|
|
|
64
71
|
const startCommand = _chalk.default.bold((0, _devEnvironmentCli.getEnvironmentStartCommand)(opt));
|
|
65
72
|
|
|
@@ -91,7 +98,8 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
91
98
|
await (0, _devEnvironmentCore.printEnvironmentInfo)(slug);
|
|
92
99
|
const message = '\n' + _chalk.default.green('✓') + ` environment created.\n\nTo start it please run:\n\n${startCommand}\n`;
|
|
93
100
|
console.log(message);
|
|
101
|
+
await (0, _tracker.trackEvent)('dev_env_create_command_success', trackingInfo);
|
|
94
102
|
} catch (error) {
|
|
95
|
-
|
|
103
|
+
await (0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_create_command_error', trackingInfo);
|
|
96
104
|
}
|
|
97
105
|
});
|
|
@@ -14,9 +14,9 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
14
14
|
|
|
15
15
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
20
20
|
|
|
21
21
|
var _devEnvironmentCore = require("../lib/dev-environment/dev-environment-core");
|
|
22
22
|
|
|
@@ -24,10 +24,6 @@ var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
|
24
24
|
|
|
25
25
|
var _devEnvironment = require("../lib/constants/dev-environment");
|
|
26
26
|
|
|
27
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
|
-
|
|
29
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
-
|
|
31
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
28
|
|
|
33
29
|
/**
|
|
@@ -42,7 +38,10 @@ const examples = [{
|
|
|
42
38
|
description: 'Destroys a local dev environment named foo'
|
|
43
39
|
}];
|
|
44
40
|
(0, _command.default)().option('slug', 'Custom name of the dev environment').option('soft', 'Keep config files needed to start an environment intact').examples(examples).argv(process.argv, async (arg, opt) => {
|
|
41
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
45
42
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
43
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
44
|
+
await (0, _tracker.trackEvent)('dev_env_destroy_command_execute', trackingInfo);
|
|
46
45
|
debug('Args: ', arg, 'Options: ', opt);
|
|
47
46
|
|
|
48
47
|
try {
|
|
@@ -50,7 +49,8 @@ const examples = [{
|
|
|
50
49
|
await (0, _devEnvironmentCore.destroyEnvironment)(slug, removeFiles);
|
|
51
50
|
const message = _chalk.default.green('✓') + ' Environment destroyed.\n';
|
|
52
51
|
console.log(message);
|
|
52
|
+
await (0, _tracker.trackEvent)('dev_env_destroy_command_success', trackingInfo);
|
|
53
53
|
} catch (error) {
|
|
54
|
-
|
|
54
|
+
await (0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_destroy_command_error', trackingInfo);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
|
+
|
|
17
19
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
18
20
|
|
|
19
21
|
var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
@@ -37,7 +39,10 @@ const examples = [{
|
|
|
37
39
|
(0, _command.default)({
|
|
38
40
|
wildcardCommand: true
|
|
39
41
|
}).option('slug', 'Custom name of the dev environment').examples(examples).argv(process.argv, async (unmatchedArgs, opt) => {
|
|
42
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
40
43
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
44
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
45
|
+
await (0, _tracker.trackEvent)('dev_env_exec_command_execute', trackingInfo);
|
|
41
46
|
|
|
42
47
|
try {
|
|
43
48
|
// to avoid confusion let's enforce -- as a splitter for arguments for this command and wp itself
|
|
@@ -55,7 +60,8 @@ const examples = [{
|
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
await (0, _devEnvironmentCore.exec)(slug, arg);
|
|
63
|
+
await (0, _tracker.trackEvent)('dev_env_exec_command_success', trackingInfo);
|
|
58
64
|
} catch (error) {
|
|
59
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
65
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_exec_command_error', trackingInfo);
|
|
60
66
|
}
|
|
61
67
|
});
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
|
+
|
|
17
19
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
18
20
|
|
|
19
21
|
var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
@@ -34,12 +36,16 @@ const examples = [{
|
|
|
34
36
|
(0, _command.default)({
|
|
35
37
|
requiredArgs: 1
|
|
36
38
|
}).examples(examples).option('slug', 'Custom name of the dev environment').argv(process.argv, async (unmatchedArgs, opt) => {
|
|
39
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
37
40
|
const [filePath] = unmatchedArgs;
|
|
38
41
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
42
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
43
|
+
await (0, _tracker.trackEvent)('dev_env_import_media_command_execute', trackingInfo);
|
|
39
44
|
|
|
40
45
|
try {
|
|
41
46
|
await (0, _devEnvironmentCore.importMediaPath)(slug, filePath);
|
|
47
|
+
await (0, _tracker.trackEvent)('dev_env_import_media_command_success', trackingInfo);
|
|
42
48
|
} catch (error) {
|
|
43
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
49
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_import_media_command_error', trackingInfo);
|
|
44
50
|
}
|
|
45
51
|
});
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
var _fs = _interopRequireDefault(require("fs"));
|
|
14
14
|
|
|
15
|
+
var _tracker = require("../lib/tracker");
|
|
16
|
+
|
|
15
17
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
16
18
|
|
|
17
19
|
var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
@@ -43,12 +45,15 @@ const examples = [{
|
|
|
43
45
|
(0, _command.default)({
|
|
44
46
|
requiredArgs: 1
|
|
45
47
|
}).option('slug', 'Custom name of the dev environment').option('search-replace', 'Perform Search and Replace on the specified SQL file').option('in-place', 'Search and Replace explicitly on the given input file').option('skip-validate', 'Do not perform file validation.').examples(examples).argv(process.argv, async (unmatchedArgs, opt) => {
|
|
48
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
46
49
|
const [fileName] = unmatchedArgs;
|
|
47
50
|
const {
|
|
48
51
|
searchReplace,
|
|
49
52
|
inPlace
|
|
50
53
|
} = opt;
|
|
51
54
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
55
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
56
|
+
await (0, _tracker.trackEvent)('dev_env_import_sql_command_execute', trackingInfo);
|
|
52
57
|
|
|
53
58
|
try {
|
|
54
59
|
const {
|
|
@@ -71,7 +76,8 @@ const examples = [{
|
|
|
71
76
|
await (0, _devEnvironmentCore.exec)(slug, cacheArg);
|
|
72
77
|
const addUserArg = ['wp', 'dev-env-add-admin', '--username=vipgo', '--password=password'];
|
|
73
78
|
await (0, _devEnvironmentCore.exec)(slug, addUserArg);
|
|
79
|
+
await (0, _tracker.trackEvent)('dev_env_import_sql_command_success', trackingInfo);
|
|
74
80
|
} catch (error) {
|
|
75
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
81
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_import_sql_command_error', trackingInfo);
|
|
76
82
|
}
|
|
77
83
|
});
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
var _debug = _interopRequireDefault(require("debug"));
|
|
14
14
|
|
|
15
|
+
var _tracker = require("../lib/tracker");
|
|
16
|
+
|
|
15
17
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
16
18
|
|
|
17
19
|
var _devEnvironmentCore = require("../lib/dev-environment/dev-environment-core");
|
|
@@ -37,7 +39,12 @@ const examples = [{
|
|
|
37
39
|
description: 'Return information about a local dev environment named "my_site"'
|
|
38
40
|
}];
|
|
39
41
|
(0, _command.default)().option('slug', 'Custom name of the dev environment').option('all', 'Show Info for all local dev environments').examples(examples).argv(process.argv, async (arg, opt) => {
|
|
42
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
40
43
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
44
|
+
const trackingInfo = opt.all ? {
|
|
45
|
+
all: true
|
|
46
|
+
} : (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
47
|
+
await (0, _tracker.trackEvent)('dev_env_info_command_execute', trackingInfo);
|
|
41
48
|
debug('Args: ', arg, 'Options: ', opt);
|
|
42
49
|
|
|
43
50
|
try {
|
|
@@ -46,7 +53,9 @@ const examples = [{
|
|
|
46
53
|
} else {
|
|
47
54
|
await (0, _devEnvironmentCore.printEnvironmentInfo)(slug);
|
|
48
55
|
}
|
|
56
|
+
|
|
57
|
+
await (0, _tracker.trackEvent)('dev_env_info_command_success', trackingInfo);
|
|
49
58
|
} catch (error) {
|
|
50
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
59
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_info_command_error', trackingInfo);
|
|
51
60
|
}
|
|
52
61
|
});
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
|
+
|
|
17
19
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
18
20
|
|
|
19
21
|
var _devEnvironmentCore = require("../lib/dev-environment/dev-environment-core");
|
|
@@ -29,9 +31,16 @@ const examples = [{
|
|
|
29
31
|
description: 'Return information about all local dev environments'
|
|
30
32
|
}];
|
|
31
33
|
(0, _command.default)().examples(examples).argv(process.argv, async () => {
|
|
34
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
35
|
+
const trackingInfo = {
|
|
36
|
+
all: true
|
|
37
|
+
};
|
|
38
|
+
await (0, _tracker.trackEvent)('dev_env_list_command_execute', trackingInfo);
|
|
39
|
+
|
|
32
40
|
try {
|
|
33
41
|
await (0, _devEnvironmentCore.printAllEnvironmentsInfo)();
|
|
42
|
+
await (0, _tracker.trackEvent)('dev_env_list_command_success', trackingInfo);
|
|
34
43
|
} catch (error) {
|
|
35
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
44
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_list_command_error', trackingInfo);
|
|
36
45
|
}
|
|
37
46
|
});
|
|
@@ -16,14 +16,16 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
16
16
|
|
|
17
17
|
var _child_process = require("child_process");
|
|
18
18
|
|
|
19
|
+
var _tracker = require("../lib/tracker");
|
|
20
|
+
|
|
19
21
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
20
22
|
|
|
21
23
|
var _devEnvironmentCore = require("../lib/dev-environment/dev-environment-core");
|
|
22
24
|
|
|
23
|
-
var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
24
|
-
|
|
25
25
|
var _devEnvironment = require("../lib/constants/dev-environment");
|
|
26
26
|
|
|
27
|
+
var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
28
|
+
|
|
27
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
30
|
|
|
29
31
|
/**
|
|
@@ -37,7 +39,11 @@ const examples = [{
|
|
|
37
39
|
description: 'Starts a local dev environment'
|
|
38
40
|
}];
|
|
39
41
|
(0, _command.default)().option('slug', 'Custom name of the dev environment').option('skip-rebuild', 'Only start stopped services').examples(examples).argv(process.argv, async (arg, opt) => {
|
|
42
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
43
|
+
const startProcessing = new Date();
|
|
40
44
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
45
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
46
|
+
await (0, _tracker.trackEvent)('dev_env_start_command_execute', trackingInfo);
|
|
41
47
|
debug('Args: ', arg, 'Options: ', opt);
|
|
42
48
|
const options = {
|
|
43
49
|
skipRebuild: !!opt.skipRebuild
|
|
@@ -60,7 +66,12 @@ const examples = [{
|
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
await (0, _devEnvironmentCore.startEnvironment)(slug, options);
|
|
69
|
+
const processingTime = new Date() - startProcessing;
|
|
70
|
+
const successTrackingInfo = { ...trackingInfo,
|
|
71
|
+
processing_time: processingTime
|
|
72
|
+
};
|
|
73
|
+
await (0, _tracker.trackEvent)('dev_env_start_command_success', successTrackingInfo);
|
|
63
74
|
} catch (error) {
|
|
64
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
75
|
+
await (0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_start_command_error', trackingInfo);
|
|
65
76
|
}
|
|
66
77
|
});
|
|
@@ -14,6 +14,8 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
14
14
|
|
|
15
15
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
16
16
|
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
|
+
|
|
17
19
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
18
20
|
|
|
19
21
|
var _devEnvironmentCore = require("../lib/dev-environment/dev-environment-core");
|
|
@@ -33,14 +35,18 @@ const examples = [{
|
|
|
33
35
|
description: 'Stops a local dev environment'
|
|
34
36
|
}];
|
|
35
37
|
(0, _command.default)().option('slug', 'Custom name of the dev environment').examples(examples).argv(process.argv, async (arg, opt) => {
|
|
38
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
36
39
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
37
40
|
debug('Args: ', arg, 'Options: ', opt);
|
|
41
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
42
|
+
await (0, _tracker.trackEvent)('dev_env_stop_command_execute', trackingInfo);
|
|
38
43
|
|
|
39
44
|
try {
|
|
40
45
|
await (0, _devEnvironmentCore.stopEnvironment)(slug);
|
|
41
46
|
const message = _chalk.default.green('✓') + ' environment stopped.\n';
|
|
42
47
|
console.log(message);
|
|
48
|
+
await (0, _tracker.trackEvent)('dev_env_stop_command_success', trackingInfo);
|
|
43
49
|
} catch (error) {
|
|
44
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
50
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_stop_command_error', trackingInfo);
|
|
45
51
|
}
|
|
46
52
|
});
|
|
@@ -14,6 +14,8 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
14
14
|
|
|
15
15
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
16
16
|
|
|
17
|
+
var _tracker = require("../lib/tracker");
|
|
18
|
+
|
|
17
19
|
var _command = _interopRequireDefault(require("../lib/cli/command"));
|
|
18
20
|
|
|
19
21
|
var _devEnvironmentCli = require("../lib/dev-environment/dev-environment-cli");
|
|
@@ -36,7 +38,10 @@ const cmd = (0, _command.default)().option('slug', 'Custom name of the dev envir
|
|
|
36
38
|
(0, _devEnvironmentCli.addDevEnvConfigurationOptions)(cmd);
|
|
37
39
|
cmd.examples(examples);
|
|
38
40
|
cmd.argv(process.argv, async (arg, opt) => {
|
|
41
|
+
await (0, _devEnvironmentCli.validateDependencies)();
|
|
39
42
|
const slug = (0, _devEnvironmentCli.getEnvironmentName)(opt);
|
|
43
|
+
const trackingInfo = (0, _devEnvironmentCli.getEnvTrackingInfo)(slug);
|
|
44
|
+
await (0, _tracker.trackEvent)('dev_env_update_command_execute', trackingInfo);
|
|
40
45
|
|
|
41
46
|
try {
|
|
42
47
|
const environmentAlreadyExists = (0, _devEnvironmentCore.doesEnvironmentExist)(slug);
|
|
@@ -72,12 +77,13 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
72
77
|
await (0, _devEnvironmentCore.updateEnvironment)(instanceData);
|
|
73
78
|
const message = '\n' + _chalk.default.green('✓') + ' environment updated. Restart environment for changes to take an affect.';
|
|
74
79
|
console.log(message);
|
|
80
|
+
await (0, _tracker.trackEvent)('dev_env_update_command_success', trackingInfo);
|
|
75
81
|
} catch (error) {
|
|
76
82
|
if ('ENOENT' === error.code) {
|
|
77
83
|
const message = 'Environment was created before update was supported.\n\nTo update environment please destroy it and create a new one.';
|
|
78
|
-
(0, _devEnvironmentCli.handleCLIException)(new Error(message));
|
|
84
|
+
(0, _devEnvironmentCli.handleCLIException)(new Error(message), 'dev_env_update_command_error', trackingInfo);
|
|
79
85
|
} else {
|
|
80
|
-
(0, _devEnvironmentCli.handleCLIException)(error);
|
|
86
|
+
(0, _devEnvironmentCli.handleCLIException)(error, 'dev_env_update_command_error', trackingInfo);
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
});
|
|
@@ -54,6 +54,8 @@ var _progress = require("../lib/cli/progress");
|
|
|
54
54
|
|
|
55
55
|
var _isMultiSite = require("../lib/validations/is-multi-site");
|
|
56
56
|
|
|
57
|
+
var _rollbar = require("../lib/rollbar");
|
|
58
|
+
|
|
57
59
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
58
60
|
|
|
59
61
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -379,7 +381,7 @@ const displayPlaybook = ({
|
|
|
379
381
|
} = env;
|
|
380
382
|
const [fileName] = arg;
|
|
381
383
|
const isMultiSite = await (0, _isMultiSite.isMultiSiteInSiteMeta)(appId, envId);
|
|
382
|
-
|
|
384
|
+
let fileMeta = await (0, _clientFileUploader.getFileMeta)(fileName);
|
|
383
385
|
|
|
384
386
|
if (fileMeta.isCompressed) {
|
|
385
387
|
console.log(_chalk.default.yellowBright('You are importing a compressed file. Validation and search-replace operation will be skipped.'));
|
|
@@ -453,6 +455,9 @@ Processing the SQL import for your environment...
|
|
|
453
455
|
progressTracker.print({
|
|
454
456
|
clearAfter: true
|
|
455
457
|
});
|
|
458
|
+
|
|
459
|
+
_rollbar.rollbar.error(failureError);
|
|
460
|
+
|
|
456
461
|
exit.withError(failureError);
|
|
457
462
|
};
|
|
458
463
|
|
|
@@ -474,6 +479,7 @@ Processing the SQL import for your environment...
|
|
|
474
479
|
}
|
|
475
480
|
|
|
476
481
|
fileNameToUpload = outputFileName;
|
|
482
|
+
fileMeta = await (0, _clientFileUploader.getFileMeta)(fileNameToUpload);
|
|
477
483
|
progressTracker.stepSuccess('replace');
|
|
478
484
|
} else {
|
|
479
485
|
progressTracker.stepSkipped('replace');
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _api = _interopRequireDefault(require("../../api"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* External dependencies
|
|
16
|
+
*/
|
|
17
|
+
const debug = require('debug')('@automattic/vip:analytics:clients:pendo');
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Pendo analytics client.
|
|
25
|
+
*/
|
|
26
|
+
class Pendo {
|
|
27
|
+
static get ENDPOINT() {
|
|
28
|
+
return '/pendo';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
constructor({
|
|
32
|
+
userId,
|
|
33
|
+
eventPrefix,
|
|
34
|
+
env
|
|
35
|
+
}) {
|
|
36
|
+
_defineProperty(this, "context", {});
|
|
37
|
+
|
|
38
|
+
this.eventPrefix = eventPrefix;
|
|
39
|
+
this.userAgent = env.userAgent;
|
|
40
|
+
this.userId = userId;
|
|
41
|
+
this.context = { ...env
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async trackEvent(eventName, eventProps = {}) {
|
|
46
|
+
if (!eventName.startsWith(this.eventPrefix)) {
|
|
47
|
+
eventName = this.eventPrefix + eventName;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
debug('trackEvent()', eventProps);
|
|
51
|
+
this.context = { ...this.context,
|
|
52
|
+
org_id: eventProps.org_slug,
|
|
53
|
+
org_slug: eventProps.org_slug,
|
|
54
|
+
userAgent: this.userAgent,
|
|
55
|
+
userId: this.userId
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
return await this.send(eventName, eventProps);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
debug(error);
|
|
62
|
+
} // Resolve to false instead of rejecting
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
return Promise.resolve(false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async send(eventName, eventProps) {
|
|
69
|
+
const body = {
|
|
70
|
+
context: this.context,
|
|
71
|
+
event: eventName,
|
|
72
|
+
properties: eventProps,
|
|
73
|
+
timestamp: Date.now(),
|
|
74
|
+
type: 'track',
|
|
75
|
+
visitorId: `${this.context.userId}`
|
|
76
|
+
};
|
|
77
|
+
debug('send()', body);
|
|
78
|
+
const {
|
|
79
|
+
apiFetch
|
|
80
|
+
} = await (0, _api.default)();
|
|
81
|
+
const response = await apiFetch(Pendo.ENDPOINT, {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
body
|
|
84
|
+
});
|
|
85
|
+
const responseText = await response.text();
|
|
86
|
+
debug('response', responseText);
|
|
87
|
+
return responseText;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
exports.default = Pendo;
|
|
@@ -26,13 +26,18 @@ const client_info = {
|
|
|
26
26
|
|
|
27
27
|
class Analytics {
|
|
28
28
|
constructor({
|
|
29
|
-
|
|
29
|
+
clients = new _stub.default()
|
|
30
30
|
}) {
|
|
31
|
-
this.
|
|
31
|
+
this.clients = clients;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
async trackEvent(name, props = {}) {
|
|
35
|
-
return Promise.all(
|
|
35
|
+
return Promise.all(this.clients.map(client => {
|
|
36
|
+
return client.trackEvent(name, { // eslint-disable-next-line camelcase
|
|
37
|
+
...client_info,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}));
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
}
|
|
@@ -17,6 +17,8 @@ exports.promptForPhpVersion = promptForPhpVersion;
|
|
|
17
17
|
exports.promptForComponent = promptForComponent;
|
|
18
18
|
exports.addDevEnvConfigurationOptions = addDevEnvConfigurationOptions;
|
|
19
19
|
exports.getTagChoices = getTagChoices;
|
|
20
|
+
exports.getEnvTrackingInfo = getEnvTrackingInfo;
|
|
21
|
+
exports.validateDependencies = void 0;
|
|
20
22
|
|
|
21
23
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
22
24
|
|
|
@@ -32,10 +34,20 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
32
34
|
|
|
33
35
|
var _os = _interopRequireDefault(require("os"));
|
|
34
36
|
|
|
37
|
+
var exit = _interopRequireWildcard(require("../cli/exit"));
|
|
38
|
+
|
|
39
|
+
var _tracker = require("../tracker");
|
|
40
|
+
|
|
35
41
|
var _devEnvironment = require("../constants/dev-environment");
|
|
36
42
|
|
|
37
43
|
var _devEnvironmentCore = require("./dev-environment-core");
|
|
38
44
|
|
|
45
|
+
var _devEnvironmentLando = require("./dev-environment-lando");
|
|
46
|
+
|
|
47
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
48
|
+
|
|
49
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
50
|
+
|
|
39
51
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
52
|
|
|
41
53
|
/**
|
|
@@ -53,7 +65,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
53
65
|
const debug = (0, _debug.default)('@automattic/vip:bin:dev-environment');
|
|
54
66
|
const DEFAULT_SLUG = 'vip-local';
|
|
55
67
|
|
|
56
|
-
function handleCLIException(exception) {
|
|
68
|
+
async function handleCLIException(exception, trackKey, trackBaseInfo = {}) {
|
|
57
69
|
const errorPrefix = _chalk.default.red('Error:');
|
|
58
70
|
|
|
59
71
|
if (_devEnvironment.DEV_ENVIRONMENT_NOT_FOUND === exception.message) {
|
|
@@ -67,6 +79,17 @@ function handleCLIException(exception) {
|
|
|
67
79
|
message = message.replace('ERROR: ', '');
|
|
68
80
|
console.log(errorPrefix, message);
|
|
69
81
|
|
|
82
|
+
if (trackKey) {
|
|
83
|
+
try {
|
|
84
|
+
const errorTrackingInfo = { ...trackBaseInfo,
|
|
85
|
+
failure: message
|
|
86
|
+
};
|
|
87
|
+
await (0, _tracker.trackEvent)(trackKey, errorTrackingInfo);
|
|
88
|
+
} catch (trackException) {
|
|
89
|
+
console.log(errorPrefix, `Failed to record track event ${trackKey}`, trackException.message);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
70
93
|
if (!process.env.DEBUG) {
|
|
71
94
|
console.log(`Please re-run the command with "--debug ${_chalk.default.bold('@automattic/vip:bin:dev-environment')}" appended to it and provide the stack trace on the support ticket.`);
|
|
72
95
|
console.log(_chalk.default.bold('\nExample:\n'));
|
|
@@ -77,6 +100,16 @@ function handleCLIException(exception) {
|
|
|
77
100
|
}
|
|
78
101
|
}
|
|
79
102
|
|
|
103
|
+
const validateDependencies = async () => {
|
|
104
|
+
try {
|
|
105
|
+
await (0, _devEnvironmentLando.validateDockerInstalled)();
|
|
106
|
+
} catch (exception) {
|
|
107
|
+
exit.withError(exception.message);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
exports.validateDependencies = validateDependencies;
|
|
112
|
+
|
|
80
113
|
function getEnvironmentName(options) {
|
|
81
114
|
if (options.slug) {
|
|
82
115
|
return options.slug;
|
|
@@ -450,4 +483,26 @@ async function getTagChoices() {
|
|
|
450
483
|
value: version.tag
|
|
451
484
|
};
|
|
452
485
|
});
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function getEnvTrackingInfo(slug) {
|
|
489
|
+
try {
|
|
490
|
+
const envData = (0, _devEnvironmentCore.readEnvironmentData)(slug);
|
|
491
|
+
const result = {
|
|
492
|
+
slug
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
for (const key of Object.keys(envData)) {
|
|
496
|
+
// track doesnt like camelCase
|
|
497
|
+
const snakeCasedKey = key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
|
|
498
|
+
const value = _devEnvironment.DEV_ENVIRONMENT_COMPONENTS.includes(key) ? JSON.stringify(envData[key]) : envData[key];
|
|
499
|
+
result[snakeCasedKey] = value;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return result;
|
|
503
|
+
} catch (err) {
|
|
504
|
+
return {
|
|
505
|
+
slug
|
|
506
|
+
};
|
|
507
|
+
}
|
|
453
508
|
}
|