@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
|
@@ -68,10 +68,12 @@ function parseSourceString( sourceString, { cacheDirectoryPath } ) {
|
|
|
68
68
|
);
|
|
69
69
|
|
|
70
70
|
if ( zipFields ) {
|
|
71
|
-
const
|
|
72
|
-
|
|
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://
|
|
17
|
+
{ in: 'http://test.com', expect: 'http://test.com:101' },
|
|
18
18
|
{
|
|
19
|
-
in: 'http://
|
|
20
|
-
expect: 'http://
|
|
19
|
+
in: 'http://test.com/test?test#test',
|
|
20
|
+
expect: 'http://test.com:101/test?test#test',
|
|
21
21
|
},
|
|
22
|
-
{ in: 'ssh://
|
|
23
|
-
{ in: '
|
|
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://
|
|
28
|
+
{ in: 'http://test.com:99', expect: 'http://test.com:101' },
|
|
29
29
|
{
|
|
30
|
-
in: 'http://
|
|
31
|
-
expect: 'http://
|
|
30
|
+
in: 'http://test.com:99/test?test#test',
|
|
31
|
+
expect: 'http://test.com:101/test?test#test',
|
|
32
32
|
},
|
|
33
|
-
{ in: 'ssh://
|
|
34
|
-
{ in: '
|
|
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://
|
|
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://
|
|
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://
|
|
333
|
+
checkValidURL( 'test.json', 'test', 'http://test.com' )
|
|
334
334
|
).not.toThrow();
|
|
335
335
|
expect( () =>
|
|
336
|
-
checkValidURL( 'test.json', 'test', 'https://
|
|
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', '
|
|
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://
|
|
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.
|
|
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": "
|
|
64
|
+
"gitHead": "e582b351bc4c4b8734bb087f63a3beec9875c3c7"
|
|
65
65
|
}
|