@automattic/vip 3.9.2 → 3.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/dist/commands/dev-env-sync-sql.js +6 -2
- package/docs/CHANGELOG.md +8 -0
- package/npm-shrinkwrap.json +11 -10
- package/package.json +3 -3
|
@@ -172,6 +172,8 @@ class DevEnvSyncSQLCommand {
|
|
|
172
172
|
}
|
|
173
173
|
const networkSites = this.env.wpSitesSDS?.nodes;
|
|
174
174
|
if (!networkSites) return;
|
|
175
|
+
const primaryUrl = networkSites.find(site => site?.blogId === 1)?.homeUrl;
|
|
176
|
+
const primaryDomain = primaryUrl ? new URL(primaryUrl).hostname : '';
|
|
175
177
|
for (const site of networkSites) {
|
|
176
178
|
if (!site?.blogId || site.blogId === 1) continue;
|
|
177
179
|
const url = site?.homeUrl;
|
|
@@ -179,7 +181,7 @@ class DevEnvSyncSQLCommand {
|
|
|
179
181
|
const strippedUrl = stripProtocol(url);
|
|
180
182
|
if (!this.searchReplaceMap[strippedUrl]) continue;
|
|
181
183
|
const domain = new URL(url).hostname;
|
|
182
|
-
const newDomain = `${this.slugifyDomain(domain)}.${this.landoDomain}`;
|
|
184
|
+
const newDomain = primaryDomain === domain ? this.landoDomain : `${this.slugifyDomain(domain)}.${this.landoDomain}`;
|
|
183
185
|
this.searchReplaceMap[stripProtocol(url)] = stripProtocol(replaceDomain(url, newDomain));
|
|
184
186
|
}
|
|
185
187
|
}
|
|
@@ -227,13 +229,15 @@ DELIMITER ;
|
|
|
227
229
|
CALL vip_sync_update_blog_domains();
|
|
228
230
|
DROP PROCEDURE vip_sync_update_blog_domains;
|
|
229
231
|
`;
|
|
232
|
+
const primaryUrl = networkSites.find(site => site?.blogId === 1)?.homeUrl;
|
|
233
|
+
const primaryDomain = primaryUrl ? new URL(primaryUrl).hostname : '';
|
|
230
234
|
const queries = [];
|
|
231
235
|
for (const site of networkSites) {
|
|
232
236
|
if (!site?.blogId || !site?.homeUrl) {
|
|
233
237
|
continue;
|
|
234
238
|
}
|
|
235
239
|
const oldDomain = new URL(site.homeUrl).hostname;
|
|
236
|
-
const newDomain =
|
|
240
|
+
const newDomain = primaryDomain !== oldDomain ? `${this.slugifyDomain(oldDomain)}.${this.landoDomain}` : this.landoDomain;
|
|
237
241
|
queries.push(` UPDATE wp_blogs SET domain = '${newDomain}' WHERE blog_id = ${Number(site.blogId)};`);
|
|
238
242
|
}
|
|
239
243
|
if (queries.length) {
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 3.9.3
|
|
4
|
+
|
|
5
|
+
* security: update `cross-spawn` to fix a high-severity CVE-2024-21538
|
|
6
|
+
* chore: fix issues in `package.json`
|
|
7
|
+
* fix(dev-env) sync: don't slugify domain if it matches the primary domain
|
|
8
|
+
|
|
9
|
+
**Full Changelog**: https://github.com/Automattic/vip-cli/compare/3.9.2...3.9.3
|
|
10
|
+
|
|
3
11
|
### 3.9.2
|
|
4
12
|
|
|
5
13
|
* Fix `vip app`
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/vip",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@automattic/vip",
|
|
9
|
-
"version": "3.9.
|
|
9
|
+
"version": "3.9.3",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"ini": "5.0.0",
|
|
32
32
|
"js-yaml": "^4.1.0",
|
|
33
33
|
"jwt-decode": "4.0.0",
|
|
34
|
-
"lando": "github:automattic/lando-cli
|
|
34
|
+
"lando": "github:automattic/lando-cli#6ca2668",
|
|
35
35
|
"node-fetch": "^2.6.1",
|
|
36
36
|
"node-stream-zip": "1.15.0",
|
|
37
37
|
"open": "^10.0.0",
|
|
@@ -5549,9 +5549,10 @@
|
|
|
5549
5549
|
}
|
|
5550
5550
|
},
|
|
5551
5551
|
"node_modules/cross-spawn": {
|
|
5552
|
-
"version": "7.0.
|
|
5553
|
-
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.
|
|
5554
|
-
"integrity": "sha512-
|
|
5552
|
+
"version": "7.0.6",
|
|
5553
|
+
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
|
5554
|
+
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
|
5555
|
+
"license": "MIT",
|
|
5555
5556
|
"dependencies": {
|
|
5556
5557
|
"path-key": "^3.1.0",
|
|
5557
5558
|
"shebang-command": "^2.0.0",
|
|
@@ -17277,9 +17278,9 @@
|
|
|
17277
17278
|
}
|
|
17278
17279
|
},
|
|
17279
17280
|
"cross-spawn": {
|
|
17280
|
-
"version": "7.0.
|
|
17281
|
-
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.
|
|
17282
|
-
"integrity": "sha512-
|
|
17281
|
+
"version": "7.0.6",
|
|
17282
|
+
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
|
17283
|
+
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
|
17283
17284
|
"requires": {
|
|
17284
17285
|
"path-key": "^3.1.0",
|
|
17285
17286
|
"shebang-command": "^2.0.0",
|
|
@@ -20180,7 +20181,7 @@
|
|
|
20180
20181
|
},
|
|
20181
20182
|
"lando": {
|
|
20182
20183
|
"version": "git+ssh://git@github.com/automattic/lando-cli.git#4d8465ece983ee6242528b54de6738f00804ca0d",
|
|
20183
|
-
"from": "lando@github:automattic/lando-cli
|
|
20184
|
+
"from": "lando@github:automattic/lando-cli#6ca2668",
|
|
20184
20185
|
"requires": {
|
|
20185
20186
|
"@lando/compose": "1.0.0",
|
|
20186
20187
|
"axios": "^1.7.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/vip",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.3",
|
|
4
4
|
"description": "The VIP Javascript library & CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"repository": {
|
|
88
88
|
"type": "git",
|
|
89
|
-
"url": "https://github.com/Automattic/vip-cli"
|
|
89
|
+
"url": "git+https://github.com/Automattic/vip-cli.git"
|
|
90
90
|
},
|
|
91
91
|
"keywords": [
|
|
92
92
|
"cli",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"ini": "5.0.0",
|
|
162
162
|
"js-yaml": "^4.1.0",
|
|
163
163
|
"jwt-decode": "4.0.0",
|
|
164
|
-
"lando": "github:automattic/lando-cli
|
|
164
|
+
"lando": "github:automattic/lando-cli#6ca2668",
|
|
165
165
|
"node-fetch": "^2.6.1",
|
|
166
166
|
"node-stream-zip": "1.15.0",
|
|
167
167
|
"open": "^10.0.0",
|