@wordpress/env 10.36.1-next.76cff8c98.0 → 10.36.1-next.8fd3f8831.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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2026 by the contributors
3
+ Copyright 2016-2025 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
@@ -68,10 +68,12 @@ function parseSourceString( sourceString, { cacheDirectoryPath } ) {
68
68
  );
69
69
 
70
70
  if ( zipFields ) {
71
- const rawBasename = path.basename( zipFields[ 1 ] );
72
- const basename = encodeURIComponent(
73
- rawBasename.replace( /\.(\d+\.)*\d+$/, '' )
71
+ const wpOrgFields = sourceString.match(
72
+ /^https?:\/\/downloads\.wordpress\.org\/(?:plugin|theme)\/([^\s\.]*)([^\s]*)?\.zip$/
74
73
  );
74
+ const basename = wpOrgFields
75
+ ? encodeURIComponent( wpOrgFields[ 1 ] )
76
+ : encodeURIComponent( path.basename( zipFields[ 1 ] ) );
75
77
 
76
78
  return {
77
79
  type: 'zip',
@@ -14,24 +14,24 @@ describe( 'addOrReplacePort', () => {
14
14
  // Addition
15
15
  { in: 'test', expect: 'test:101' },
16
16
  { in: 'test/test?test#test', expect: 'test:101/test?test#test' },
17
- { in: 'http://example.org', expect: 'http://example.org:101' },
17
+ { in: 'http://test.com', expect: 'http://test.com:101' },
18
18
  {
19
- in: 'http://example.org/test?test#test',
20
- expect: 'http://example.org:101/test?test#test',
19
+ in: 'http://test.com/test?test#test',
20
+ expect: 'http://test.com:101/test?test#test',
21
21
  },
22
- { in: 'ssh://example.org', expect: 'ssh://example.org:101' },
23
- { in: 'example.org', expect: 'example.org:101' },
22
+ { in: 'ssh://test.com', expect: 'ssh://test.com:101' },
23
+ { in: 'test.com', expect: 'test.com:101' },
24
24
 
25
25
  // Replacement
26
26
  { in: 'test:99', expect: 'test:101' },
27
27
  { in: 'test:99/test?test#test', expect: 'test:101/test?test#test' },
28
- { in: 'http://example.org:99', expect: 'http://example.org:101' },
28
+ { in: 'http://test.com:99', expect: 'http://test.com:101' },
29
29
  {
30
- in: 'http://example.org:99/test?test#test',
31
- expect: 'http://example.org:101/test?test#test',
30
+ in: 'http://test.com:99/test?test#test',
31
+ expect: 'http://test.com:101/test?test#test',
32
32
  },
33
- { in: 'ssh://example.org:99', expect: 'ssh://example.org:101' },
34
- { in: 'example.org:99', expect: 'example.org:101' },
33
+ { in: 'ssh://test.com:99', expect: 'ssh://test.com:101' },
34
+ { in: 'test.com:99', expect: 'test.com:101' },
35
35
  ];
36
36
 
37
37
  for ( const test of testMap ) {
@@ -85,12 +85,12 @@ describe( 'parseSourceString', () => {
85
85
 
86
86
  it( 'should parse other sources', () => {
87
87
  expect(
88
- parseSourceString( 'http://example.com/testing.zip', options )
88
+ parseSourceString( 'http://test.com/testing.zip', options )
89
89
  ).toEqual( {
90
90
  basename: 'testing',
91
91
  path: '/test/cache/testing',
92
92
  type: 'zip',
93
- url: 'http://example.com/testing.zip',
93
+ url: 'http://test.com/testing.zip',
94
94
  } );
95
95
  } );
96
96
  } );
@@ -330,10 +330,10 @@ describe( 'validate-config', () => {
330
330
 
331
331
  it( 'passes for valid URLs', () => {
332
332
  expect( () =>
333
- checkValidURL( 'test.json', 'test', 'http://example.com' )
333
+ checkValidURL( 'test.json', 'test', 'http://test.com' )
334
334
  ).not.toThrow();
335
335
  expect( () =>
336
- checkValidURL( 'test.json', 'test', 'https://example.com' )
336
+ checkValidURL( 'test.json', 'test', 'https://test.com' )
337
337
  ).not.toThrow();
338
338
  expect( () =>
339
339
  checkValidURL( 'test.json', 'test', 'http://test' )
@@ -346,13 +346,16 @@ describe( 'validate-config', () => {
346
346
  )
347
347
  ).not.toThrow();
348
348
  expect( () =>
349
- checkValidURL( 'test.json', 'test', 'https://example.org:8888' )
349
+ checkValidURL( 'test.json', 'test', 'http://test.co.uk' )
350
+ ).not.toThrow();
351
+ expect( () =>
352
+ checkValidURL( 'test.json', 'test', 'https://test.co.uk:8888' )
350
353
  ).not.toThrow();
351
354
  expect( () =>
352
355
  checkValidURL(
353
356
  'test.json',
354
357
  'test',
355
- 'http://example.org:8888/test?test=test#test'
358
+ 'http://test.co.uk:8888/test?test=test#test'
356
359
  )
357
360
  ).not.toThrow();
358
361
  } );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/env",
3
- "version": "10.36.1-next.76cff8c98.0",
3
+ "version": "10.36.1-next.8fd3f8831.0",
4
4
  "description": "A zero-config, self contained local WordPress environment for development and testing.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -61,5 +61,5 @@
61
61
  "scripts": {
62
62
  "test": "echo \"Error: run tests from root\" && exit 1"
63
63
  },
64
- "gitHead": "368727f14b858e75179e140967c2d9ec965c8790"
64
+ "gitHead": "e582b351bc4c4b8734bb087f63a3beec9875c3c7"
65
65
  }