@automattic/vip 2.34.0 → 2.35.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/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +1 -1
- package/dist/bin/vip-app-list.js +1 -1
- package/dist/bin/vip-app.js +1 -0
- package/dist/bin/vip-backup-db.js +0 -5
- package/dist/bin/vip-cache-purge-url.js +0 -5
- package/dist/bin/vip-cache.js +0 -5
- package/dist/bin/vip-config-envvar-delete.js +6 -5
- package/dist/bin/vip-config-envvar-get-all.js +6 -5
- package/dist/bin/vip-config-envvar-get.js +6 -5
- package/dist/bin/vip-config-envvar-list.js +6 -5
- package/dist/bin/vip-config-envvar-set.js +0 -5
- package/dist/bin/vip-config-envvar.js +0 -5
- package/dist/bin/vip-config-software-get.js +0 -5
- package/dist/bin/vip-config-software-update.js +2 -5
- package/dist/bin/vip-config-software.js +0 -5
- package/dist/bin/vip-config.js +2 -0
- package/dist/bin/vip-dev-env-create.js +2 -5
- package/dist/bin/vip-dev-env-destroy.js +0 -5
- package/dist/bin/vip-dev-env-exec.js +2 -5
- package/dist/bin/vip-dev-env-import-media.js +0 -5
- package/dist/bin/vip-dev-env-import-sql.js +0 -5
- package/dist/bin/vip-dev-env-import.js +0 -5
- package/dist/bin/vip-dev-env-info.js +0 -5
- package/dist/bin/vip-dev-env-list.js +0 -5
- package/dist/bin/vip-dev-env-logs.js +1 -1
- package/dist/bin/vip-dev-env-shell.js +8 -1
- package/dist/bin/vip-dev-env-start.js +0 -5
- package/dist/bin/vip-dev-env-stop.js +0 -5
- package/dist/bin/vip-dev-env-sync-sql.js +0 -5
- package/dist/bin/vip-dev-env-sync.js +0 -5
- package/dist/bin/vip-dev-env-update.js +4 -5
- package/dist/bin/vip-dev-env.js +0 -5
- package/dist/bin/vip-export-sql.js +0 -5
- package/dist/bin/vip-import-media-abort.js +0 -5
- package/dist/bin/vip-import-media-status.js +0 -5
- package/dist/bin/vip-import-media.js +0 -5
- package/dist/bin/vip-import-sql-status.js +1 -5
- package/dist/bin/vip-import-sql.js +11 -5
- package/dist/bin/vip-import-validate-files.js +1 -0
- package/dist/bin/vip-import-validate-sql.js +2 -0
- package/dist/bin/vip-logs.js +11 -0
- package/dist/bin/vip-search-replace.js +0 -5
- package/dist/bin/vip-slowlogs.js +1 -0
- package/dist/bin/vip-sync.js +1 -2
- package/dist/bin/vip-validate-preflight.js +13 -0
- package/dist/bin/vip-wp.js +1 -2
- package/dist/bin/vip.js +7 -0
- package/dist/commands/backup-db.js +9 -5
- package/dist/commands/dev-env-import-sql.js +4 -5
- package/dist/commands/dev-env-sync-sql.js +8 -5
- package/dist/commands/export-sql.js +9 -5
- package/dist/lib/analytics/clients/pendo.js +4 -0
- package/dist/lib/analytics/clients/tracks.js +3 -0
- package/dist/lib/analytics/index.js +1 -0
- package/dist/lib/backup-storage-availability/backup-storage-availability.js +1 -0
- package/dist/lib/cli/command.js +11 -1
- package/dist/lib/cli/config.js +2 -0
- package/dist/lib/cli/format.js +1 -0
- package/dist/lib/cli/progress.js +19 -13
- package/dist/lib/client-file-uploader.js +3 -3
- package/dist/lib/config/software.js +3 -2
- package/dist/lib/constants/vipgo.js +4 -2
- package/dist/lib/dev-environment/dev-environment-lando.js +4 -3
- package/dist/lib/envvar/logging.js +2 -5
- package/dist/lib/keychain/insecure.js +2 -0
- package/dist/lib/keychain.js +1 -0
- package/dist/lib/media-import/progress.js +8 -1
- package/dist/lib/site-import/db-file-import.js +4 -5
- package/dist/lib/site-import/status.js +1 -1
- package/dist/lib/token.js +4 -0
- package/dist/lib/validations/is-multi-site.js +1 -1
- package/dist/lib/validations/is-multisite-domain-mapped.js +1 -1
- package/helpers/prepublishOnly.js +8 -5
- package/npm-shrinkwrap.json +1407 -1512
- package/package.json +15 -22
- package/tsconfig.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 2.35.0
|
|
4
|
+
|
|
5
|
+
- #1506 Allow imports for all sites with databases by @chriszarate in https://github.com/Automattic/vip-cli/pull/1507
|
|
6
|
+
- #1497 fix: remove import bypass for TypeScript by @sjinks in https://github.com/Automattic/vip-cli/pull/1497
|
|
7
|
+
- #1496 fix(dev-env): update certificate Common Name by @sjinks in https://github.com/Automattic/vip-cli/pull/1496
|
|
8
|
+
- #1513 refactor: use `semver` instead of `check-node-version` by @sjinks in https://github.com/Automattic/vip-cli/pull/1513
|
|
9
|
+
- #1514 chore(dev-deps): update TypeScript type definitions by @sjinks in https://github.com/Automattic/vip-cli/pull/1514
|
|
10
|
+
- #1508 chore(dev-deps): update jest-related packages to 29.7.0 by @sjinks in https://github.com/Automattic/vip-cli/pull/1508
|
|
11
|
+
- #1509 chore(dev-deps): update eslint from 8.47.0 to 8.49.0 by @sjinks in https://github.com/Automattic/vip-cli/pull/1509
|
|
12
|
+
- #1510 chore(deps): update uuid from 9.0.0 to 9.0.1 by @sjinks in https://github.com/Automattic/vip-cli/pull/1510
|
|
13
|
+
- #1512 chore(deps): update node-fetch from 2.6.12 to 2.7.0 by @sjinks in https://github.com/Automattic/vip-cli/pull/1512
|
|
14
|
+
- #1511 chore(deps): update graphql-tag from 2.12.5 to 2.12.6 by @sjinks in https://github.com/Automattic/vip-cli/pull/1511
|
|
15
|
+
- #1517 chore(dev-deps): update rimraf from 5.0.1 to 5.0.5 by @sjinks in https://github.com/Automattic/vip-cli/pull/1517
|
|
16
|
+
- #1516 chore(dev-deps): update eslint from 8.49.0 to 8.50.0 by @sjinks in https://github.com/Automattic/vip-cli/pull/1516
|
|
17
|
+
- #1499 chore(dev-deps): update @automattic/eslint-plugin-wpvip to 0.6.0 by @sjinks in https://github.com/Automattic/vip-cli/pull/1499
|
|
18
|
+
|
|
3
19
|
### 2.34.0
|
|
4
20
|
|
|
5
21
|
- #1503 chore(dev-deps): update nock to 13.3.3
|
package/CONTRIBUTING.md
CHANGED
|
@@ -113,7 +113,7 @@ Changelogs allow customers to keep up with all the changes happening across our
|
|
|
113
113
|
|
|
114
114
|
### Pre-publish Checks
|
|
115
115
|
|
|
116
|
-
We use a custom pre-publish [script](https://github.com/Automattic/vip/blob/trunk/
|
|
116
|
+
We use a custom pre-publish [script](https://github.com/Automattic/vip/blob/trunk/helpers/prepublishOnly.js) that performs some confidence checks to avoid common mistakes.
|
|
117
117
|
|
|
118
118
|
Further checks can be added to this flow as needed.
|
|
119
119
|
|
package/dist/bin/vip-app-list.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* External dependencies
|
|
4
5
|
*/
|
|
@@ -20,7 +21,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
21
|
let response;
|
|
21
22
|
try {
|
|
22
23
|
response = await api.query({
|
|
23
|
-
// $FlowFixMe: gql template is not supported by flow
|
|
24
24
|
query: (0, _graphqlTag.default)`
|
|
25
25
|
query Apps($first: Int, $after: String) {
|
|
26
26
|
apps(first: $first, after: $after) {
|
package/dist/bin/vip-app.js
CHANGED
package/dist/bin/vip-cache.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -31,6 +26,12 @@ const examples = [{
|
|
|
31
26
|
usage: `${baseUsage} MY_VARIABLE`,
|
|
32
27
|
description: 'Permanently deletes the environment variable "MY_VARIABLE"'
|
|
33
28
|
}];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {string[]} arg
|
|
32
|
+
* @param {object} opt
|
|
33
|
+
* @return {Promise<void>}
|
|
34
|
+
*/
|
|
34
35
|
async function deleteEnvVarCommand(arg, opt) {
|
|
35
36
|
// Help the user by uppercasing input.
|
|
36
37
|
const name = arg[0].trim().toUpperCase();
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -31,6 +26,12 @@ const examples = [{
|
|
|
31
26
|
usage,
|
|
32
27
|
description: 'Get the values of all environment variables'
|
|
33
28
|
}];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {string[]} arg
|
|
32
|
+
* @param {object} opt
|
|
33
|
+
* @return {Promise<void>}
|
|
34
|
+
*/
|
|
34
35
|
async function getAllEnvVarsCommand(arg, opt) {
|
|
35
36
|
const trackingParams = {
|
|
36
37
|
app_id: opt.app.id,
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -30,6 +25,12 @@ const examples = [{
|
|
|
30
25
|
usage: `${baseUsage} MY_VARIABLE`,
|
|
31
26
|
description: 'Get the value of the environment variable "MY_VARIABLE"'
|
|
32
27
|
}];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {string[]} arg
|
|
31
|
+
* @param {object} opt
|
|
32
|
+
* @return {Promise<void>}
|
|
33
|
+
*/
|
|
33
34
|
async function getEnvVarCommand(arg, opt) {
|
|
34
35
|
// Help the user by uppercasing input.
|
|
35
36
|
const name = arg[0].trim().toUpperCase();
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -31,6 +26,12 @@ const examples = [{
|
|
|
31
26
|
usage,
|
|
32
27
|
description: 'Lists all environment variables (names only)'
|
|
33
28
|
}];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {string[]} arg
|
|
32
|
+
* @param {object} opt
|
|
33
|
+
* @return {Promise<void>}
|
|
34
|
+
*/
|
|
34
35
|
async function listEnvVarsCommand(arg, opt) {
|
|
35
36
|
const trackingParams = {
|
|
36
37
|
app_id: opt.app.id,
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -62,6 +57,8 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
62
57
|
if (softwareSettings === null) {
|
|
63
58
|
throw new _userError.default('Software settings are not supported for this environment.');
|
|
64
59
|
}
|
|
60
|
+
|
|
61
|
+
/** @type {UpdatePromptOptions} */
|
|
65
62
|
const updateOptions = {
|
|
66
63
|
force: !!opt.yes
|
|
67
64
|
};
|
package/dist/bin/vip-config.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -78,6 +73,8 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
78
73
|
const messageToShow = `Environment already exists\n\n\nTo start the environment run:\n\n${startCommand}\n\n` + `To create another environment use ${_chalk.default.bold('--slug')} option with a unique name.\n`;
|
|
79
74
|
exit.withError(messageToShow);
|
|
80
75
|
}
|
|
76
|
+
|
|
77
|
+
/** @type {InstanceOptions} */
|
|
81
78
|
let defaultOptions = {};
|
|
82
79
|
try {
|
|
83
80
|
if (opt.app) {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* Internal dependencies
|
|
10
5
|
*/
|
|
@@ -43,6 +38,8 @@ const examples = [{
|
|
|
43
38
|
if (unmatchedArgs.length > 0 && !argSplitterFound) {
|
|
44
39
|
throw new Error('Please provide "--" argument to separate arguments for "vip" and command to be executed (see "--help" for examples)');
|
|
45
40
|
}
|
|
41
|
+
|
|
42
|
+
/** @type {string[]} */
|
|
46
43
|
let arg = [];
|
|
47
44
|
if (argSplitterFound && argSplitterIx + 1 < process.argv.length) {
|
|
48
45
|
arg = process.argv.slice(argSplitterIx + 1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
/**
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
@@ -41,11 +41,18 @@ const examples = [{
|
|
|
41
41
|
usage: `${_devEnvironment.DEV_ENVIRONMENT_FULL_COMMAND} shell -S database -- ls -lha`,
|
|
42
42
|
description: 'Runs `ls -lha` command in the shell of the database service in the dev environment'
|
|
43
43
|
}];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {string[]} args
|
|
47
|
+
* @return {string[]}
|
|
48
|
+
*/
|
|
44
49
|
function getCommand(args) {
|
|
45
50
|
const splitterIdx = process.argv.findIndex(argument => '--' === argument);
|
|
46
51
|
if (args.length > 0 && splitterIdx === -1) {
|
|
47
52
|
throw new Error('Please provide "--" argument to separate arguments for "vip" and command to be executed (see "--help" for examples)');
|
|
48
53
|
}
|
|
54
|
+
|
|
55
|
+
/** @type {string[]} */
|
|
49
56
|
let cmd = [];
|
|
50
57
|
if (splitterIdx !== -1 && splitterIdx + 1 < process.argv.length) {
|
|
51
58
|
cmd = process.argv.slice(splitterIdx + 1);
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -45,6 +40,8 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
45
40
|
}
|
|
46
41
|
const currentInstanceData = (0, _devEnvironmentCore.readEnvironmentData)(slug);
|
|
47
42
|
debug('Read instance data', currentInstanceData);
|
|
43
|
+
|
|
44
|
+
/** @type {InstanceOptions} */
|
|
48
45
|
const preselectedOptions = {
|
|
49
46
|
title: currentInstanceData.wpTitle,
|
|
50
47
|
multisite: currentInstanceData.multisite,
|
|
@@ -53,6 +50,8 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
53
50
|
const configurationFileOptions = await (0, _devEnvironmentConfigurationFile.getConfigurationFileOptions)();
|
|
54
51
|
const thereAreOptionsFromConfigFile = Object.keys(configurationFileOptions).length > 0;
|
|
55
52
|
const finalPreselectedOptions = (0, _devEnvironmentConfigurationFile.mergeConfigurationFileOptions)(preselectedOptions, configurationFileOptions);
|
|
53
|
+
|
|
54
|
+
/** @type {InstanceOptions} */
|
|
56
55
|
const defaultOptions = {
|
|
57
56
|
appCode: currentInstanceData.appCode.dir || currentInstanceData.appCode.tag || 'latest',
|
|
58
57
|
muPlugins: currentInstanceData.muPlugins.dir || currentInstanceData.muPlugins.tag || 'latest',
|
package/dist/bin/vip-dev-env.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
/**
|
|
9
4
|
* External dependencies
|
|
10
5
|
*/
|
|
@@ -44,6 +39,7 @@ const appQuery = `
|
|
|
44
39
|
id,
|
|
45
40
|
name,
|
|
46
41
|
type,
|
|
42
|
+
typeId
|
|
47
43
|
organization { id, name },
|
|
48
44
|
environments{
|
|
49
45
|
id
|
|
@@ -89,6 +85,12 @@ const SQL_IMPORT_PREFLIGHT_PROGRESS_STEPS = [{
|
|
|
89
85
|
id: 'queue_import',
|
|
90
86
|
name: 'Queueing Import'
|
|
91
87
|
}];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @param {AppForImport} app
|
|
91
|
+
* @param {EnvForImport} env
|
|
92
|
+
* @param {string} fileName
|
|
93
|
+
*/
|
|
92
94
|
async function gates(app, env, fileName) {
|
|
93
95
|
const {
|
|
94
96
|
id: envId,
|
|
@@ -213,6 +215,10 @@ const promptToContinue = async ({
|
|
|
213
215
|
exit.withError('The input did not match the expected environment label. Import aborted.');
|
|
214
216
|
}
|
|
215
217
|
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @returns {Promise<string[]>}
|
|
221
|
+
*/
|
|
216
222
|
async function validateAndGetTableNames({
|
|
217
223
|
skipValidate,
|
|
218
224
|
appId,
|
package/dist/bin/vip-logs.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* External dependencies
|
|
4
5
|
*/
|
|
@@ -31,6 +32,10 @@ const ALLOWED_FORMATS = ['csv', 'json', 'text'];
|
|
|
31
32
|
const DEFAULT_POLLING_DELAY_IN_SECONDS = 30;
|
|
32
33
|
const MIN_POLLING_DELAY_IN_SECONDS = 5;
|
|
33
34
|
const MAX_POLLING_DELAY_IN_SECONDS = 300;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {string[]} arg
|
|
38
|
+
*/
|
|
34
39
|
async function getLogs(arg, opt) {
|
|
35
40
|
validateInputs(opt.type, opt.limit, opt.format);
|
|
36
41
|
const trackingParams = getBaseTrackingParams(opt);
|
|
@@ -158,6 +163,12 @@ function printLogs(logs, format) {
|
|
|
158
163
|
}
|
|
159
164
|
console.log(output);
|
|
160
165
|
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @param {string} type
|
|
169
|
+
* @param {number} limit
|
|
170
|
+
* @param {string} format
|
|
171
|
+
*/
|
|
161
172
|
function validateInputs(type, limit, format) {
|
|
162
173
|
if (!ALLOWED_TYPES.includes(type)) {
|
|
163
174
|
exit.withError(`Invalid type: ${type}. The supported types are: ${ALLOWED_TYPES.join(', ')}.`);
|