@automattic/vip 2.31.1-dev4 → 2.32.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.
package/CHANGELOG.md CHANGED
@@ -1,14 +1,40 @@
1
1
  ## Changelog
2
2
 
3
+ ### 2.32.0
4
+
5
+ - #1411 feature(export): Add ability to generate a new backup when exporting SQL
6
+ - #1427 Remove unnecessary comment
7
+ - #1426 chore: fix CVE-2023-26115 by updating word-wrap to 1.2.6
8
+ - #1424 feat(dev-env): Update wording around dev-env start --vscode
9
+ - #1419 [PIE-3548] Updates CONTRIBUTING.md with the new flow without publish-please
10
+ - #1423 chore(deps): update socket.io-client from 4.6.2 to 4.7.0
11
+ - #1422 chore(dev-deps): update flow-bin from 0.209.0 to 0.210.0
12
+ - #1417 chore(dev-deps): Update eslint from 8.42.0 to 8.43.0
13
+ - #1418 chore(deps): Update semver from 7.5.2 to 7.5.3
14
+ - #1415 [PIE-3548] Removes `publish-please` and replaces it with simple custom script
15
+ - #1416 [dev-env] Reword dev-env VS Code integration messages
16
+ - #1413 [dev-env] Command options text fixes
17
+ - #1412 Update eslint-plugin-wpvip to 0.5.8, Prettier updates
18
+ - #1396 Migrate dev-environment-core to TypeScript
19
+ - #1410 chore(dev-deps): Update flow-bin to 0.209.0
20
+ - #1409 chore(deps): Update semver to 7.5.2
21
+ - #1408 chore(dev-deps): Update rimraf to 5.0.1
22
+ - #1407 chore(dev-deps): Update flow-bin from 0.206.0 to 0.208.0
23
+ - #1406 chore(deps): Replace keytar with @postman/node-keytar
24
+ - #1405 chore(deps): Update socket.io-client from 4.6.1 to 4.6.2
25
+ - #1404 chore(dev-deps): Update TypeScript-related packages
26
+ - #1403 chore(dev-deps): Update ESLint-related packages update/eslint
27
+ - #1402 chore(dev-deps): Update Babel-related packages to 7.22.5
28
+
3
29
  ### 2.31.0
4
30
 
5
- - #1397 feature(dev-env): Add ability to sync multisites
6
- - #1399 chore(dev-deps): Remove stub type definitions
7
- - #1394 FORNO-1609: Combine all error events into one error event
8
- - #1345 feat(dev-env): Add Photon
9
- - #1398 Fix coverage generation
10
- - #1395 Add types for the other ways of using enquirer
11
- - #1388 Typescript: refactor `vip-whoami`
31
+ - #1397 feature(dev-env): Add ability to sync multisites
32
+ - #1399 chore(dev-deps): Remove stub type definitions
33
+ - #1394 FORNO-1609: Combine all error events into one error event
34
+ - #1345 feat(dev-env): Add Photon
35
+ - #1398 Fix coverage generation
36
+ - #1395 Add types for the other ways of using enquirer
37
+ - #1388 Typescript: refactor `vip-whoami`
12
38
  - #1393 refactor: Convert `lib/{app-logs,envvar}` to TypeScript
13
39
  - #1392 refactor: Convert `lib/config` to TypeScript
14
40
  - #1391 refactor: Convert lib to TypeScript
package/CONTRIBUTING.md CHANGED
@@ -147,8 +147,6 @@ In order to do that, please follow this:
147
147
 
148
148
  You can repeat this with every new version until you're happy with your version and ready to a public release. We currently don't support multiple branches for multiple versions. When it's the case, this process needs to be done for every version in every branch.
149
149
 
150
- _PS: The above steps will only change your local `trunk`. The remote `trunk` will remain unaffected, and you can reset your local trunk afterwards with `git reset --hard origin/trunk`._
151
-
152
150
  ### Patching Old Releases
153
151
 
154
152
  There may be times when we need to push out a critical fix to the most recent release (or several past releases) such as for patching security issues or major bugs. This can be complicated by the fact that we may have some larger changes already merged into the `trunk` branch.
@@ -80,7 +80,7 @@ async function getBackupJob(appId, envId) {
80
80
  }
81
81
  } = response;
82
82
  const job = environments[0].jobs[0];
83
- return job;
83
+ return job || null;
84
84
  }
85
85
  async function createBackupJob(appId, envId) {
86
86
  // Disable global error handling so that we can handle errors ourselves
@@ -138,11 +138,11 @@ class BackupDBCommand {
138
138
  this.progressTracker.stopPrinting();
139
139
  }
140
140
  async loadBackupJob() {
141
- var _this$job$metadata$fi, _this$job$metadata$fi2, _this$job$progress;
141
+ var _this$job, _this$job$metadata$fi, _this$job2, _this$job2$progress, _this$job3;
142
142
  this.job = await getBackupJob(this.app.id, this.env.id);
143
- this.backupName = (_this$job$metadata$fi = (_this$job$metadata$fi2 = this.job.metadata.find(meta => meta.name === 'backupName')) === null || _this$job$metadata$fi2 === void 0 ? void 0 : _this$job$metadata$fi2.value) !== null && _this$job$metadata$fi !== void 0 ? _this$job$metadata$fi : 'Unknown';
144
- this.jobStatus = (_this$job$progress = this.job.progress) === null || _this$job$progress === void 0 ? void 0 : _this$job$progress.status;
145
- if (this.job.completedAt) {
143
+ this.backupName = ((_this$job = this.job) === null || _this$job === void 0 ? void 0 : (_this$job$metadata$fi = _this$job.metadata.find(meta => meta.name === 'backupName')) === null || _this$job$metadata$fi === void 0 ? void 0 : _this$job$metadata$fi.value) || 'Unknown';
144
+ this.jobStatus = (_this$job2 = this.job) === null || _this$job2 === void 0 ? void 0 : (_this$job2$progress = _this$job2.progress) === null || _this$job2$progress === void 0 ? void 0 : _this$job2$progress.status;
145
+ if ((_this$job3 = this.job) !== null && _this$job3 !== void 0 && _this$job3.completedAt) {
146
146
  this.jobAge = (new Date().getTime() - new Date(this.job.completedAt).getTime()) / 1000 / 60;
147
147
  } else {
148
148
  this.jobAge = undefined;
@@ -150,14 +150,14 @@ class BackupDBCommand {
150
150
  return this.job;
151
151
  }
152
152
  async run(silent = false) {
153
- var _this$job;
153
+ var _this$job4;
154
154
  this.silent = silent;
155
155
  let noticeMessage = `\n${_chalk.default.yellow('NOTICE: ')}`;
156
156
  noticeMessage += 'If a recent database backup does not exist, a new one will be generated for this environment. ';
157
157
  noticeMessage += 'Learn more about this: https://docs.wpvip.com/technical-references/vip-dashboard/backups/#2-download-a-full-database-backup \n';
158
158
  this.log(noticeMessage);
159
159
  await this.loadBackupJob();
160
- if ((_this$job = this.job) !== null && _this$job !== void 0 && _this$job.inProgressLock) {
160
+ if ((_this$job4 = this.job) !== null && _this$job4 !== void 0 && _this$job4.inProgressLock) {
161
161
  this.log('Database backup already in progress...');
162
162
  } else {
163
163
  try {
@@ -165,15 +165,16 @@ class BackupDBCommand {
165
165
  this.progressTracker.stepRunning(this.steps.PREPARE);
166
166
  this.progressTracker.startPrinting();
167
167
  await createBackupJob(this.app.id, this.env.id);
168
- } catch (stepErr) {
169
- const err = stepErr;
168
+ } catch (e) {
169
+ var _err$message;
170
+ const err = e;
170
171
  this.progressTracker.stepFailed(this.steps.PREPARE);
171
172
  this.stopProgressTracker();
172
- if (err.message.includes('Database backups limit reached')) {
173
+ if ((_err$message = err.message) !== null && _err$message !== void 0 && _err$message.includes('Database backups limit reached')) {
173
174
  await this.track('error', {
174
175
  error_type: 'rate_limit_exceeded',
175
- error_message: `Couldn't create a new database backup job: ${err.message}`,
176
- stack: err.stack
176
+ error_message: `Couldn't create a new database backup job: ${err === null || err === void 0 ? void 0 : err.message}`,
177
+ stack: err === null || err === void 0 ? void 0 : err.stack
177
178
  });
178
179
  let errMessage = err.message.replace('Database backups limit reached', 'A new database backup was not generated because a recently generated backup already exists.');
179
180
  errMessage = errMessage.replace('Retry after', '\nIf you would like to run the same command, you can retry on or after:');
@@ -183,26 +184,26 @@ class BackupDBCommand {
183
184
  }
184
185
  await this.track('error', {
185
186
  error_type: 'db_backup_job_creation_failed',
186
- error_message: `Database Backup job creation failed: ${err.message}`,
187
- stack: err.stack
187
+ error_message: `Database Backup job creation failed: ${err === null || err === void 0 ? void 0 : err.message}`,
188
+ stack: err === null || err === void 0 ? void 0 : err.stack
188
189
  });
189
- exit.withError(`Couldn't create a new database backup job: ${err.message}`);
190
+ exit.withError(`Couldn't create a new database backup job: ${err === null || err === void 0 ? void 0 : err.message}`);
190
191
  }
191
192
  }
192
193
  this.progressTracker.stepSuccess(this.steps.PREPARE);
193
194
  this.progressTracker.stepRunning(this.steps.GENERATE);
194
195
  try {
195
196
  await (0, _utils.pollUntil)(this.loadBackupJob.bind(this), DB_BACKUP_PROGRESS_POLL_INTERVAL, this.isDone.bind(this));
196
- } catch (pollErr) {
197
- const err = pollErr;
197
+ } catch (e) {
198
+ const err = e;
198
199
  this.progressTracker.stepFailed(this.steps.GENERATE);
199
200
  this.stopProgressTracker();
200
201
  await this.track('error', {
201
202
  error_type: 'db_backup_job_failed',
202
- error_message: `Database Backup job failed: ${err.message}`,
203
- stack: err.stack
203
+ error_message: `Database Backup job failed: ${err === null || err === void 0 ? void 0 : err.message}`,
204
+ stack: err === null || err === void 0 ? void 0 : err.stack
204
205
  });
205
- exit.withError(`Failed to create new database backup: ${err.message}`);
206
+ exit.withError(`Failed to create new database backup: ${err === null || err === void 0 ? void 0 : err.message}`);
206
207
  }
207
208
  this.progressTracker.stepSuccess(this.steps.GENERATE);
208
209
  this.stopProgressTracker();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.31.1-dev4",
3
+ "version": "2.32.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@automattic/vip",
9
- "version": "2.31.1-dev4",
9
+ "version": "2.32.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.31.1-dev4",
3
+ "version": "2.32.0",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {