@automattic/vip 3.8.8 → 3.9.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.
@@ -332,7 +332,7 @@ tooling:
332
332
  nocopy: true
333
333
  - type: volume
334
334
  source: clientcode_vipconfig
335
- target: /wp/wp-content/vip-config
335
+ target: /wp/vip-config
336
336
  volume:
337
337
  nocopy: true
338
338
  <% } else { %>
@@ -342,6 +342,6 @@ tooling:
342
342
  - <%= appCode.dir %>/plugins:/wp/wp-content/plugins
343
343
  - <%= appCode.dir %>/private:/wp/wp-content/private
344
344
  - <%= appCode.dir %>/themes:/wp/wp-content/themes
345
- - <%= appCode.dir %>/vip-config:/wp/wp-content/vip-config
345
+ - <%= appCode.dir %>/vip-config:/wp/vip-config
346
346
  <% } %>
347
347
  <% } %>
@@ -21,7 +21,7 @@ const LIMIT_MIN = 1;
21
21
  const LIMIT_MAX = 5000;
22
22
  const LIMIT_DEFAULT = 500;
23
23
  const ALLOWED_TYPES = ['app', 'batch'];
24
- const ALLOWED_FORMATS = ['csv', 'json', 'table'];
24
+ const ALLOWED_FORMATS = ['csv', 'json', 'table', 'text'];
25
25
  const DEFAULT_POLLING_DELAY_IN_SECONDS = 30;
26
26
  const MIN_POLLING_DELAY_IN_SECONDS = 5;
27
27
  const MAX_POLLING_DELAY_IN_SECONDS = 300;
@@ -143,7 +143,7 @@ function printLogs(logs, format) {
143
143
  };
144
144
  });
145
145
  let output = '';
146
- if (format && 'table' === format) {
146
+ if ('table' === format) {
147
147
  const options = {
148
148
  wordWrap: true,
149
149
  wrapOnWordBoundary: true,
@@ -168,6 +168,15 @@ function printLogs(logs, format) {
168
168
  table.push([timestamp, msg]);
169
169
  }
170
170
  output = table.toString();
171
+ } else if ('text' === format) {
172
+ const rows = [];
173
+ for (const {
174
+ timestamp,
175
+ message
176
+ } of logs) {
177
+ rows.push(`${timestamp} ${message}`);
178
+ output = rows.join('\n');
179
+ }
171
180
  } else {
172
181
  output = (0, _format.formatData)(logs, format);
173
182
  }
@@ -211,7 +220,7 @@ const appQuery = exports.appQuery = `
211
220
  module: 'logs'
212
221
  }).option('type', 'Specify the type of Runtime Logs to retrieve. Accepts "batch" (only valid for WordPress environments).', 'app')
213
222
  // The default limit is set manually in the validateInputs function to address validation issues, avoiding incorrect replacement of the default value.
214
- .option('limit', `The maximum number of entries to return. Accepts an integer value between 1 and 5000 (defaults to ${LIMIT_DEFAULT}).`).option('follow', 'Output new entries as they are generated.').option('format', 'Render output in a particular format. Accepts “csv”, and “json”.', 'table').examples([{
223
+ .option('limit', `The maximum number of entries to return. Accepts an integer value between 1 and 5000 (defaults to ${LIMIT_DEFAULT}).`).option('follow', 'Output new entries as they are generated.').option('format', 'Render output in a particular format. Accepts “csv”, “json”, and “text”.', 'table').examples([{
215
224
  usage: 'vip @example-app.production logs',
216
225
  description: 'Retrieve up to 500 of the most recent entries of application Runtime Logs from web containers.'
217
226
  }, {
package/dist/lib/api.js CHANGED
@@ -27,6 +27,12 @@ function disableGlobalGraphQLErrorHandling() {
27
27
  function enableGlobalGraphQLErrorHandling() {
28
28
  globalGraphQLErrorHandlingEnabled = true;
29
29
  }
30
+ function isServerError(networkError) {
31
+ if (!networkError) {
32
+ return false;
33
+ }
34
+ return 'result' in networkError;
35
+ }
30
36
  function API({
31
37
  exitOnError = true
32
38
  } = {}) {
@@ -35,7 +41,11 @@ function API({
35
41
  graphQLErrors
36
42
  }) => {
37
43
  if (networkError && 'statusCode' in networkError && networkError.statusCode === 401) {
38
- console.error(_chalk.default.red('Unauthorized:'), 'You are unauthorized to perform this request, please logout with `vip logout` then try again.');
44
+ let message = 'You are not authorized to perform this request; please logout with `vip logout`, then try again.';
45
+ if (isServerError(networkError) && networkError.result?.code === 'token-disabled-inactivity') {
46
+ message = 'Your token has been disabled due to inactivity; please log out with `vip logout`, then try again.';
47
+ }
48
+ console.error(_chalk.default.red('Unauthorized:'), message);
39
49
  process.exit(1);
40
50
  }
41
51
  if (graphQLErrors?.length && globalGraphQLErrorHandlingEnabled) {
@@ -25,6 +25,10 @@ const DEV_ENVIRONMENT_PHP_VERSIONS = exports.DEV_ENVIRONMENT_PHP_VERSIONS = {
25
25
  8.3: {
26
26
  image: 'ghcr.io/automattic/vip-container-images/php-fpm:8.3',
27
27
  label: '8.3'
28
+ },
29
+ 8.4: {
30
+ image: 'ghcr.io/automattic/vip-container-images/php-fpm:8.4',
31
+ label: '8.4 (experimental)'
28
32
  }
29
33
  };
30
34
  const DEV_ENVIRONMENT_DEFAULTS = exports.DEV_ENVIRONMENT_DEFAULTS = {
@@ -32,4 +36,4 @@ const DEV_ENVIRONMENT_DEFAULTS = exports.DEV_ENVIRONMENT_DEFAULTS = {
32
36
  multisite: false,
33
37
  phpVersion: Object.keys(DEV_ENVIRONMENT_PHP_VERSIONS)[0]
34
38
  };
35
- const DEV_ENVIRONMENT_VERSION = exports.DEV_ENVIRONMENT_VERSION = '2.1.1';
39
+ const DEV_ENVIRONMENT_VERSION = exports.DEV_ENVIRONMENT_VERSION = '2.1.2';
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## Changelog
2
2
 
3
+ ### 3.9.0
4
+
5
+ * feat(dev-env): add support for PHP 8.4
6
+ * Provide dedicated error message for when a token is marked as disabled due to inactivity
7
+ * Set the mount path for vip-config to ABSPATH/vip-config to match production
8
+ * Add --format="text" option to vip logs
9
+ * build(deps-dev): bump typescript from 5.6.3 to 5.7.2
10
+ * build(deps-dev): bump @types/node from 22.9.1 to 22.10.0
11
+
12
+ **Full Changelog**: https://github.com/Automattic/vip-cli/compare/3.8.8...3.9.0
13
+
3
14
  ### 3.8.8
4
15
 
5
16
  * build(deps-dev): bump @types/dockerode from 3.3.31 to 3.3.32
@@ -54,7 +65,7 @@
54
65
  * build(deps): bump uuid from 11.0.2 to 11.0.3
55
66
  * Update socket error handler
56
67
  * Fix --limit arg handling in vip logs command
57
- * New package release: v3.9.0 by
68
+ * New package release: v3.9.0 by
58
69
  * Revert "New package release: v3.9.0"
59
70
  * chore(deps): update Lando to 6ca2668
60
71
  * fix: `table` format output
@@ -151,7 +162,7 @@
151
162
  * build(deps-dev): bump @babel/core from 7.24.8 to 7.24.9 in the babel group
152
163
  * build(deps-dev): bump @types/dockerode from 3.3.29 to 3.3.30
153
164
  * update: media import validate-files
154
-
165
+
155
166
  **Full Changelog**: https://github.com/Automattic/vip-cli/compare/3.6.0...3.7.0
156
167
 
157
168
  ### 3.6.0
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "3.8.8",
3
+ "version": "3.9.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@automattic/vip",
9
- "version": "3.8.8",
9
+ "version": "3.9.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
@@ -3618,11 +3618,11 @@
3618
3618
  "dev": true
3619
3619
  },
3620
3620
  "node_modules/@types/node": {
3621
- "version": "22.9.1",
3622
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz",
3623
- "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==",
3621
+ "version": "22.10.0",
3622
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz",
3623
+ "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==",
3624
3624
  "dependencies": {
3625
- "undici-types": "~6.19.8"
3625
+ "undici-types": "~6.20.0"
3626
3626
  }
3627
3627
  },
3628
3628
  "node_modules/@types/node-fetch": {
@@ -12278,9 +12278,9 @@
12278
12278
  }
12279
12279
  },
12280
12280
  "node_modules/typescript": {
12281
- "version": "5.6.3",
12282
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
12283
- "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
12281
+ "version": "5.7.2",
12282
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
12283
+ "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
12284
12284
  "dev": true,
12285
12285
  "bin": {
12286
12286
  "tsc": "bin/tsc",
@@ -12314,9 +12314,9 @@
12314
12314
  }
12315
12315
  },
12316
12316
  "node_modules/undici-types": {
12317
- "version": "6.19.8",
12318
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
12319
- "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
12317
+ "version": "6.20.0",
12318
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
12319
+ "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="
12320
12320
  },
12321
12321
  "node_modules/unicode-canonical-property-names-ecmascript": {
12322
12322
  "version": "2.0.1",
@@ -15878,11 +15878,11 @@
15878
15878
  "dev": true
15879
15879
  },
15880
15880
  "@types/node": {
15881
- "version": "22.9.1",
15882
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz",
15883
- "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==",
15881
+ "version": "22.10.0",
15882
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz",
15883
+ "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==",
15884
15884
  "requires": {
15885
- "undici-types": "~6.19.8"
15885
+ "undici-types": "~6.20.0"
15886
15886
  }
15887
15887
  },
15888
15888
  "@types/node-fetch": {
@@ -22169,9 +22169,9 @@
22169
22169
  }
22170
22170
  },
22171
22171
  "typescript": {
22172
- "version": "5.6.3",
22173
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
22174
- "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
22172
+ "version": "5.7.2",
22173
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
22174
+ "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
22175
22175
  "dev": true
22176
22176
  },
22177
22177
  "typical": {
@@ -22192,9 +22192,9 @@
22192
22192
  }
22193
22193
  },
22194
22194
  "undici-types": {
22195
- "version": "6.19.8",
22196
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
22197
- "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
22195
+ "version": "6.20.0",
22196
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
22197
+ "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="
22198
22198
  },
22199
22199
  "unicode-canonical-property-names-ecmascript": {
22200
22200
  "version": "2.0.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "3.8.8",
3
+ "version": "3.9.0",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {