@automattic/vip 2.9.2 → 2.9.3

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 CHANGED
@@ -131,3 +131,9 @@ For these cases:
131
131
  1. Follow the release steps outlined above (as a `patch` release).
132
132
 
133
133
  Then, repeat for any additional versions that we need to patch.
134
+
135
+ ### go-search-replace binaries
136
+
137
+ Some unit tests require some go-search-replace executable binary files to run. Binaries files for several OS architectures can be downloaded from https://github.com/Automattic/go-search-replace/releases/
138
+
139
+ If, for some reason, you need to compile these binaries yourself, please follow instructions at https://github.com/Automattic/go-search-replace
package/README.md CHANGED
@@ -26,6 +26,17 @@ For help with contributing to this project, including instructions for local dev
26
26
  By default, we record information about the usage of this tool using an in-house analytics sytem. If you would prefer to opt-out of this data collection, you can do so via the `DO_NOT_TRACK` environment variable. You may either export it in your shell configuration or specify it on the command line (e.g. `DO_NOT_TRACK=1 vip app list`).
27
27
 
28
28
  ## Changelog
29
+
30
+ ### 2.9.3 (29 March 2022)
31
+ - #995 Add debug call to dev-envs handleCLIException
32
+ - #992 Add --debug flag to all commands
33
+ - #993 [dev-env] Fix in caching version list.
34
+ - #994 Fix typo in error message
35
+ - #990 [dev-env] Add check for wp folder map add/php_healthcheck
36
+ - #991 Adds optional channing since `progress` can be null as per GraphQL schema
37
+ - #989 Fixes unit test error `bsdthread_register error`
38
+ - #987 Add support for M1 Macs in the search-replace tests
39
+
29
40
  ### 2.9.2 (9 March 2022)
30
41
  - #980 [dev-env] Fix/tag formatting on stapled images
31
42
  - #986 Clean the build folder prior to rebuilding it
@@ -40,6 +40,8 @@ services:
40
40
  image: ghcr.io/automattic/vip-container-images/php-fpm:7.4
41
41
  command: run.sh
42
42
  working_dir: /wp
43
+ healthcheck:
44
+ test: 'cat /wp/wp-includes/pomo/mo.php'
43
45
  environment:
44
46
  XDEBUG: <%= xdebug ? 'enable' : 'disable' %>
45
47
  STATSD: <%= statsd ? 'enable' : 'disable' %>
@@ -37,6 +37,8 @@ var _rollbar = require("../rollbar");
37
37
 
38
38
  var exit = _interopRequireWildcard(require("./exit"));
39
39
 
40
+ var _debug = _interopRequireDefault(require("debug"));
41
+
40
42
  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); }
41
43
 
42
44
  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; }
@@ -80,7 +82,8 @@ _args.default.argv = async function (argv, cb) {
80
82
  const options = this.parse(parsedAlias.argv, {
81
83
  help: false,
82
84
  name,
83
- version: false
85
+ version: false,
86
+ debug: false
84
87
  });
85
88
 
86
89
  if (options.h || options.help) {
@@ -89,6 +92,10 @@ _args.default.argv = async function (argv, cb) {
89
92
 
90
93
  if (options.v || options.version) {
91
94
  this.showVersion();
95
+ }
96
+
97
+ if (options.debug || options.d) {
98
+ _debug.default.enable(options.debug === true ? '*' : options.debug);
92
99
  } // If we have both an --app/--env and an alias, we need to give a warning
93
100
 
94
101
 
@@ -128,6 +135,7 @@ _args.default.argv = async function (argv, cb) {
128
135
  switch (command.usage) {
129
136
  case 'help':
130
137
  case 'version':
138
+ case 'debug':
131
139
  return false;
132
140
 
133
141
  default:
@@ -576,6 +584,8 @@ function _default(opts) {
576
584
 
577
585
  _args.default.option('version', 'Output the version number');
578
586
 
587
+ _args.default.option('debug', 'Activate debug output');
588
+
579
589
  return _args.default;
580
590
  }
581
591
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = exports.DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI = exports.DEV_ENVIRONMENT_RAW_GITHUB_HOST = exports.DEV_ENVIRONMENT_COMPONENTS = exports.DEV_ENVIRONMENT_NOT_FOUND = exports.DEV_ENVIRONMENT_PROMPT_INTRO = exports.DEV_ENVIRONMENT_DEFAULTS = exports.DEV_ENVIRONMENT_FULL_COMMAND = exports.DEV_ENVIRONMENT_SUBCOMMAND = void 0;
6
+ exports.DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = exports.DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI = exports.DEV_ENVIRONMENT_RAW_GITHUB_HOST = exports.DEV_ENVIRONMENT_COMPONENTS = exports.DEV_ENVIRONMENT_NOT_FOUND = exports.DEV_ENVIRONMENT_PROMPT_INTRO = exports.DEV_ENVIRONMENT_DEFAULTS = exports.DEV_ENVIRONMENT_FULL_COMMAND = exports.DEV_ENVIRONMENT_SUBCOMMAND = void 0;
7
7
  const DEV_ENVIRONMENT_SUBCOMMAND = 'dev-env';
8
8
  exports.DEV_ENVIRONMENT_SUBCOMMAND = DEV_ENVIRONMENT_SUBCOMMAND;
9
9
  const DEV_ENVIRONMENT_FULL_COMMAND = `vip ${DEV_ENVIRONMENT_SUBCOMMAND}`;
@@ -25,5 +25,8 @@ const DEV_ENVIRONMENT_RAW_GITHUB_HOST = 'raw.githubusercontent.com';
25
25
  exports.DEV_ENVIRONMENT_RAW_GITHUB_HOST = DEV_ENVIRONMENT_RAW_GITHUB_HOST;
26
26
  const DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI = '/Automattic/vip-container-images/master/wordpress/versions.json';
27
27
  exports.DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI = DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI;
28
- const DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = 'worpress-versions.json';
29
- exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY;
28
+ const DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = 'wordpress-versions.json';
29
+ exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY;
30
+ const DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = 86400; // once per day
31
+
32
+ exports.DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL;
@@ -65,6 +65,14 @@ function handleCLIException(exception) {
65
65
 
66
66
  message = message.replace('ERROR: ', '');
67
67
  console.log(errorPrefix, message);
68
+
69
+ if (!process.env.DEBUG) {
70
+ console.log(`Please re-run the command with "${_chalk.default.bold('DEBUG=@automattic/vip:bin:dev-environment')}" prepended to it and provide the stack trace on the support ticket.`);
71
+ console.log(_chalk.default.bold('\nExample:\n'));
72
+ console.log('DEBUG=@automattic/vip:bin:dev-environment vip dev-env create\n');
73
+ }
74
+
75
+ debug(exception);
68
76
  }
69
77
  }
70
78
 
@@ -146,7 +146,7 @@ function buildErrorMessage(importFailed) {
146
146
  }
147
147
 
148
148
  message += _chalk.default.red(importFailed.error ? importFailed.error : importFailed);
149
- message += '\n\nPlease check the status of your Import using `vip import status @appId.production`';
149
+ message += '\n\nPlease check the status of your Import using `vip import media status @mysite.production`';
150
150
  message += '\n\nIf this error persists and you are not sure on how to fix, please contact support\n';
151
151
  return message;
152
152
  }
@@ -254,6 +254,8 @@ ${maybeExitPrompt}
254
254
 
255
255
  const getResults = () => new Promise((resolve, reject) => {
256
256
  const checkStatus = async () => {
257
+ var _importJob$progress$s, _importJob$progress, _importJob$progress$s2, _importJob$progress2;
258
+
257
259
  let status;
258
260
 
259
261
  try {
@@ -322,8 +324,8 @@ ${maybeExitPrompt}
322
324
  return resolve('No import job found');
323
325
  }
324
326
 
325
- jobStatus = importJob.progress.status;
326
- jobSteps = importJob.progress.steps;
327
+ jobStatus = (_importJob$progress$s = (_importJob$progress = importJob.progress) === null || _importJob$progress === void 0 ? void 0 : _importJob$progress.status) !== null && _importJob$progress$s !== void 0 ? _importJob$progress$s : 'unknown';
328
+ jobSteps = (_importJob$progress$s2 = (_importJob$progress2 = importJob.progress) === null || _importJob$progress2 === void 0 ? void 0 : _importJob$progress2.steps) !== null && _importJob$progress$s2 !== void 0 ? _importJob$progress$s2 : [];
327
329
  createdAt = importJob.createdAt;
328
330
  completedAt = importJob.completedAt;
329
331
  const {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {