@automattic/vip 3.4.0 → 3.4.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.
@@ -39,6 +39,8 @@ services:
39
39
  command: nginx -g "daemon off;"
40
40
  environment:
41
41
  LANDO_NEEDS_EXEC: 1
42
+ LANDO_WEBROOT_USER: nginx
43
+ LANDO_WEBROOT_GROUP: nginx
42
44
  volumes:
43
45
  - ./nginx/extra.conf:/etc/nginx/conf.extra/extra.conf
44
46
  <% wpVolumes() %>
@@ -11,12 +11,14 @@ var _tracker = require("../lib/tracker");
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const usage = 'vip cache purge-url';
15
+ const exampleUsage = 'vip @example-app.develop cache purge-url';
14
16
  const examples = [{
15
- usage: 'vip cache purge-url <URL>',
16
- description: 'Purge a URL from page cache'
17
+ usage: `${exampleUsage} https://example-app-develop.go-vip.co/sample-page/` + '\n - Purged URL: https://example-app.develop.go-vip.co/sample-page/',
18
+ description: 'Purge the page cache for a single URL.'
17
19
  }, {
18
- usage: 'vip cache purge-url --from-file=/dev/vip/urls.txt',
19
- description: 'Purge multiple URLs from page cache'
20
+ usage: `${exampleUsage} --from-file=./urls.txt`,
21
+ description: 'Purge the page cache for multiple URLs, each listed on a single line in a local file.'
20
22
  }];
21
23
  async function cachePurgeCommand(urls = [], opt = {}) {
22
24
  const trackingParams = {
@@ -59,5 +61,5 @@ async function cachePurgeCommand(urls = [], opt = {}) {
59
61
  appQuery: _cachePurge.appQuery,
60
62
  envContext: true,
61
63
  wildcardCommand: true,
62
- usage: 'vip cache purge-url <URL>'
63
- }).option('from-file', 'Read URLs from file (useful to purge multiple URLs)').examples(examples).argv(process.argv, cachePurgeCommand);
64
+ usage
65
+ }).option('from-file', 'Read one or more URLs from a file, each listed on a single line.').examples(examples).argv(process.argv, cachePurgeCommand);
@@ -3,6 +3,16 @@
3
3
 
4
4
  var _command = _interopRequireDefault(require("../lib/cli/command"));
5
5
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
6
+ const usage = 'vip cache';
7
+ const exampleUsage = 'vip @example-app.develop cache';
8
+ const examples = [{
9
+ usage: `${exampleUsage} purge-url https://example-app-develop.go-vip.co/sample-page/` + '\n - Purged URL: https://example-app.develop.go-vip.co/sample-page/',
10
+ description: 'Purge the page cache for a single URL.'
11
+ }, {
12
+ usage: `${exampleUsage} purge-url --from-file=./urls.txt`,
13
+ description: 'Purge the page cache for multiple URLs, each listed on a single line in a local file.'
14
+ }];
6
15
  (0, _command.default)({
7
- requiredArgs: 1
8
- }).command('purge-url', 'Purge page cache').argv(process.argv);
16
+ requiredArgs: 1,
17
+ usage
18
+ }).command('purge-url', 'Purge page cache for one or more URLs.').examples(examples).argv(process.argv);
package/dist/bin/vip.js CHANGED
@@ -22,7 +22,7 @@ const tokenURL = 'https://dashboard.wpvip.com/me/cli/token';
22
22
  const customDeployToken = process.env.WPVIP_DEPLOY_TOKEN;
23
23
  const runCmd = async function () {
24
24
  const cmd = (0, _command.default)();
25
- cmd.command('logout', 'Log out the current authenticated VIP-CLI user.').command('app', 'List and modify your VIP applications').command('backup', 'Generate a backup of an environment.').command('cache', 'Manage page cache for your VIP applications').command('config', 'Manage environment configurations.').command('dev-env', 'Create and manage VIP Local Development Environments.').command('export', 'Export a copy of data associated with an environment.').command('import', 'Import media or SQL files into your VIP applications').command('logs', 'Get logs from your VIP applications').command('search-replace', 'Perform search and replace tasks on files').command('slowlogs', 'Retrieve MySQL slow query logs from an environment.').command('db', "Access an environment's database.").command('sync', 'Sync production to a development environment').command('whoami', 'Retrieve details about the current authenticated VIP-CLI user.').command('validate', 'Validate your VIP application and environment').command('wp', 'Run WP CLI commands against an environment');
25
+ cmd.command('logout', 'Log out the current authenticated VIP-CLI user.').command('app', 'List and modify your VIP applications').command('backup', 'Generate a backup of an environment.').command('cache', 'Manage page cache for an environment.').command('config', 'Manage environment configurations.').command('dev-env', 'Create and manage VIP Local Development Environments.').command('export', 'Export a copy of data associated with an environment.').command('import', 'Import media or SQL files into your VIP applications').command('logs', 'Get logs from your VIP applications').command('search-replace', 'Perform search and replace tasks on files').command('slowlogs', 'Retrieve MySQL slow query logs from an environment.').command('db', "Access an environment's database.").command('sync', 'Sync production to a development environment').command('whoami', 'Retrieve details about the current authenticated VIP-CLI user.').command('validate', 'Validate your VIP application and environment').command('wp', 'Run WP CLI commands against an environment');
26
26
  cmd.argv(process.argv);
27
27
  };
28
28
 
@@ -512,7 +512,10 @@ async function promptForWordPress(defaultObject) {
512
512
 
513
513
  // image with selection
514
514
  const tagChoices = await getTagChoices();
515
- let option = defaultObject?.tag ?? tagChoices[0].value;
515
+ if (typeof defaultObject === 'string' && !tagChoices.find(choice => choice.value === defaultObject)) {
516
+ throw new Error(`Unknown or unsupported WordPress version: ${defaultObject}.`);
517
+ }
518
+ let option = typeof defaultObject === 'string' ? defaultObject : defaultObject?.tag ?? tagChoices[0].value;
516
519
  if (isStdinTTY) {
517
520
  const message = `${messagePrefix}Which version would you like`;
518
521
  const selectTag = new _enquirer.Select({
@@ -577,7 +577,7 @@ async function maybeUpdateWordPressImage(lando, slug) {
577
577
  type: 'select',
578
578
  name: 'upgrade',
579
579
  message: 'Would you like to upgrade WordPress? ',
580
- choices: ['no', 'yes', "no (don't ask anymore)"]
580
+ choices: ['yes', 'no', "no (don't ask anymore)"]
581
581
  });
582
582
 
583
583
  // If the user takes the new WP version path
@@ -585,7 +585,7 @@ async function maybeUpdateWordPressImage(lando, slug) {
585
585
  console.log('Upgrading from: ' + _chalk.default.yellow(currentWordPressTag) + ' to:');
586
586
 
587
587
  // Select a new image
588
- const choice = await (0, _devEnvironmentCli.promptForWordPress)(null);
588
+ const choice = await (0, _devEnvironmentCli.promptForWordPress)(newestWordPressImage?.tag ?? null);
589
589
  const version = versions.find(({
590
590
  tag
591
591
  }) => tag.trim() === choice.tag.trim());
@@ -404,7 +404,8 @@ async function checkEnvHealth(lando, instancePath) {
404
404
  }
405
405
  if (urlsToScan.length) {
406
406
  scanResults = scanResults.concat(await app.scanUrls(urlsToScan, {
407
- max: 1
407
+ max: 1,
408
+ waitCodes: [502, 504]
408
409
  }));
409
410
  }
410
411
  const result = {};
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Changelog
2
2
 
3
+ ### 3.4.1
4
+
5
+ * Updating vip cache commands descriptions and examples to follow the VIP-CLI style guide
6
+ * Dev-env: Upgrade WordPress upgrade prompt to "yes" and pre-select latest version not trunk
7
+ * build(deps-dev): bump @types/node from 18.19.36 to 18.19.37
8
+ * fix(dev-env): retry healthcheck only on 502 and 504 status codes
9
+ * fix(dev-env): set the user/group for `nginx` container to `nginx:nginx`
10
+
11
+ **Full Changelog**: https://github.com/Automattic/vip-cli/compare/3.4.0...3.4.1
12
+
3
13
  ### 3.4.0
4
14
 
5
15
  * Updating command option descriptions to follow the VIP-CLI style guide
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@automattic/vip",
9
- "version": "3.4.0",
9
+ "version": "3.4.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
@@ -3884,9 +3884,9 @@
3884
3884
  "dev": true
3885
3885
  },
3886
3886
  "node_modules/@types/node": {
3887
- "version": "18.19.36",
3888
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.36.tgz",
3889
- "integrity": "sha512-tX1BNmYSWEvViftB26VLNxT6mEr37M7+ldUtq7rlKnv4/2fKYsJIOmqJAjT6h1DNuwQjIKgw3VJ/Dtw3yiTIQw==",
3887
+ "version": "18.19.37",
3888
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.37.tgz",
3889
+ "integrity": "sha512-Pi53fdVMk7Ig5IfAMltQQMgtY7xLzHaEous8IQasYsdQbYK3v90FkxI3XYQCe/Qme58pqp14lXJIsFmGP8VoZQ==",
3890
3890
  "dependencies": {
3891
3891
  "undici-types": "~5.26.4"
3892
3892
  }
@@ -16306,9 +16306,9 @@
16306
16306
  "dev": true
16307
16307
  },
16308
16308
  "@types/node": {
16309
- "version": "18.19.36",
16310
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.36.tgz",
16311
- "integrity": "sha512-tX1BNmYSWEvViftB26VLNxT6mEr37M7+ldUtq7rlKnv4/2fKYsJIOmqJAjT6h1DNuwQjIKgw3VJ/Dtw3yiTIQw==",
16309
+ "version": "18.19.37",
16310
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.37.tgz",
16311
+ "integrity": "sha512-Pi53fdVMk7Ig5IfAMltQQMgtY7xLzHaEous8IQasYsdQbYK3v90FkxI3XYQCe/Qme58pqp14lXJIsFmGP8VoZQ==",
16312
16312
  "requires": {
16313
16313
  "undici-types": "~5.26.4"
16314
16314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {