pxnpm 7.0.0-beta.3 → 7.0.0-beta.5
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/download.cjs +4 -3
- package/dist/launcher.cjs +22 -22
- package/dist/native-manifest.json +47 -36
- package/package.json +1 -1
package/dist/download.cjs
CHANGED
|
@@ -56,11 +56,12 @@ function verifier(expectedBytes, expectedHash, label) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
async function ensureNative({pkgRoot = path.dirname(__dirname), env = process.env, platform = nativePlatform(), offline = false, manifest} = {}) {
|
|
59
|
-
|
|
59
|
+
manifest ||= JSON.parse(fs.readFileSync(path.join(pkgRoot,'dist/native-manifest.json'),'utf8'));
|
|
60
|
+
const fixed = manifest.networkPolicy === 'fixed';
|
|
61
|
+
if (env.PXNPM_NATIVE && !fixed) {
|
|
60
62
|
if (!fs.existsSync(env.PXNPM_NATIVE)) throw new Error('PXNPM_NATIVE does not exist');
|
|
61
63
|
return env.PXNPM_NATIVE;
|
|
62
64
|
}
|
|
63
|
-
manifest ||= JSON.parse(fs.readFileSync(path.join(pkgRoot,'dist/native-manifest.json'),'utf8'));
|
|
64
65
|
const entry = manifest.platforms[platform];
|
|
65
66
|
if (!entry || !/^[a-f0-9]{64}$/.test(entry.binarySha256) || !/^[a-z0-9.-]+\.br$/.test(entry.file)) throw new Error(`pxnpm has no native engine for ${platform}`);
|
|
66
67
|
const filename = platform.startsWith('win32-') ? 'pxnpm.exe' : 'pxnpm';
|
|
@@ -70,7 +71,7 @@ async function ensureNative({pkgRoot = path.dirname(__dirname), env = process.en
|
|
|
70
71
|
const dir = path.join(cache,platform,entry.binarySha256);
|
|
71
72
|
const binary = path.join(dir,filename);
|
|
72
73
|
if (await valid(binary, entry)) return binary;
|
|
73
|
-
const base = env.PXNPM_DOWNLOAD_BASE_URL || manifest.baseUrl;
|
|
74
|
+
const base = fixed ? manifest.baseUrl : env.PXNPM_DOWNLOAD_BASE_URL || manifest.baseUrl;
|
|
74
75
|
const url = new URL(`${base.replace(/\/$/,'')}/${manifest.version}/${entry.file}`);
|
|
75
76
|
const localArchive = env.PXNPM_NATIVE_ARCHIVE || (url.protocol === 'file:' ? fileURLToPath(url) : undefined);
|
|
76
77
|
if ((offline || /^(true|1)$/i.test(env.PXNPM_OFFLINE || env.npm_config_offline || '')) && !localArchive) {
|
package/dist/launcher.cjs
CHANGED
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
const {spawn} = require('node:child_process');
|
|
4
4
|
const {ensureNative, nativePlatform} = require('./download.cjs');
|
|
5
|
+
// Filled only in the release staging directory; never store credentials in Git.
|
|
6
|
+
const releaseProxy = 'aHR0cHM6Ly9wbjp2dDliMWFpQHJlZ2lzdHJ5LXB4bnBtLnJkYy5uZmpiaWxsLnJlbjoyMDAyMg==';
|
|
5
7
|
|
|
6
|
-
function prepare(args, inherited = process.env) {
|
|
8
|
+
function prepare(args, inherited = process.env, defaultProxy = releaseProxy.startsWith('__') ? undefined : Buffer.from(releaseProxy, 'base64').toString()) {
|
|
7
9
|
const env = {...inherited, WORKSPACE_PWD: process.cwd()};
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
for (const [name, value] of Object.entries(inherited)) {
|
|
10
|
+
const networkKey = key => /^(?:registry|registries|proxy|https[-_]proxy|http[-_]proxy|no[-_]proxy|noproxy|pnpr[-_]server)$/i.test(key) || /:registry$/i.test(key);
|
|
11
|
+
for (const [name,value] of Object.entries(inherited)) {
|
|
11
12
|
const match = /^(?:npm|pnpm|pxnpm)_config_(.+)$/i.exec(name);
|
|
13
|
+
if ((match && networkKey(match[1])) || /^(?:https_proxy|http_proxy|all_proxy|no_proxy|proxy|pxnpm_registry|pxnpm_proxy|pxnpm_publish_registry|pxnpm_internal_proxy)$/i.test(name)) {
|
|
14
|
+
delete env[name]; continue;
|
|
15
|
+
}
|
|
12
16
|
if (match) {
|
|
13
|
-
const scope = /^(@[^:]+):registry$/i.exec(match[1]);
|
|
14
|
-
if (scope) scopes[scope[1]] = value;
|
|
15
17
|
const key = `PXNPM_CONFIG_${match[1].toUpperCase()}`;
|
|
16
18
|
if (env[key] === undefined && env[key.toLowerCase()] === undefined) env[key] = value;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
|
-
if (Object.keys(scopes).length) {
|
|
20
|
-
const explicit = env.PXNPM_CONFIG_REGISTRIES || env.pxnpm_config_registries;
|
|
21
|
-
env.PXNPM_CONFIG_REGISTRIES = JSON.stringify({...scopes, ...(explicit ? JSON.parse(explicit) : {})});
|
|
22
|
-
}
|
|
23
|
-
if (env.PXNPM_REGISTRY !== undefined) env.PXNPM_CONFIG_REGISTRY = env.PXNPM_REGISTRY;
|
|
24
|
-
if (env.PXNPM_PROXY !== undefined) {
|
|
25
|
-
const proxy = /^(?:false|off|0)$/i.test(env.PXNPM_PROXY) ? 'false' : env.PXNPM_PROXY;
|
|
26
|
-
env.PXNPM_CONFIG_PROXY = proxy;
|
|
27
|
-
env.PXNPM_CONFIG_HTTPS_PROXY = proxy;
|
|
28
|
-
env.PXNPM_CONFIG_HTTP_PROXY = proxy;
|
|
29
|
-
}
|
|
30
21
|
const result = [...args];
|
|
22
|
+
for (const arg of result.slice(0,result.includes('--') ? result.indexOf('--') : result.length)) {
|
|
23
|
+
const key = arg.split('=')[0].replace(/^--(?:config\.)?/,'');
|
|
24
|
+
if (arg.startsWith('--') && networkKey(key))
|
|
25
|
+
throw new Error('pxnpm uses fixed internal registry and proxy settings; external network flags are not accepted');
|
|
26
|
+
}
|
|
31
27
|
const command = result[0];
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
env.PXNPM_CONFIG_REGISTRY = 'https://registry-pxnpm.rdc.nfjbill.ren:20021/';
|
|
29
|
+
if (defaultProxy) {
|
|
30
|
+
env.PXNPM_CONFIG_PROXY = defaultProxy;
|
|
31
|
+
env.PXNPM_CONFIG_HTTPS_PROXY = defaultProxy;
|
|
32
|
+
env.PXNPM_CONFIG_HTTP_PROXY = defaultProxy;
|
|
33
|
+
delete env.PXNPM_NATIVE;
|
|
34
|
+
delete env.PXNPM_DOWNLOAD_BASE_URL;
|
|
36
35
|
}
|
|
36
|
+
env.PXNPM_CONFIG_NO_PROXY = 'registry-pxnpm.rdc.nfjbill.ren';
|
|
37
37
|
if (command === 'update' && result[1] === 'ark') {
|
|
38
38
|
if (result.length !== 3 || !result[2]) throw new Error('Use pxnpm update ark <version>');
|
|
39
39
|
result.splice(1, 2, `arkc@${result[2]}`, `ark-plus@${result[2]}`, '-r');
|
|
@@ -48,7 +48,7 @@ async function main(args = process.argv.slice(2)) {
|
|
|
48
48
|
}
|
|
49
49
|
let prepared;
|
|
50
50
|
let binary;
|
|
51
|
-
try { prepared = prepare(args); binary = await ensureNative({pkgRoot,offline:args.includes('--offline')}); }
|
|
51
|
+
try { prepared = prepare(args); binary = await ensureNative({pkgRoot,env:prepared.env,offline:args.includes('--offline')}); }
|
|
52
52
|
catch (error) { console.error(`pxnpm: ${error.message}`); process.exitCode = 1; return; }
|
|
53
53
|
global.pxnpm__startedAt = Date.now();
|
|
54
54
|
const child = spawn(binary, prepared.args, {stdio: 'inherit', env: prepared.env});
|
|
@@ -1,111 +1,122 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.5",
|
|
4
|
+
"networkPolicy": "fixed",
|
|
4
5
|
"baseUrl": "https://registry-pxnpm.rdc.nfjbill.ren:20021/__static/srv/downloads/pxnpm",
|
|
5
6
|
"platforms": {
|
|
6
7
|
"darwin-arm64": {
|
|
7
|
-
"file": "darwin-arm64-
|
|
8
|
+
"file": "darwin-arm64-e2a2952b4a5758d370e7f70965ad74f6ef63f9858feeeacd1cc00a3d3d725be9.br",
|
|
8
9
|
"encoding": "br",
|
|
9
|
-
"binaryBytes":
|
|
10
|
-
"compressedBytes":
|
|
11
|
-
"compressedSha256": "
|
|
12
|
-
"binarySha256": "
|
|
10
|
+
"binaryBytes": 52605376,
|
|
11
|
+
"compressedBytes": 16624172,
|
|
12
|
+
"compressedSha256": "6b7d926eb904f32ea2c9a6f0fedc97532c99a43d28b50b6fc6ea842f80861421",
|
|
13
|
+
"binarySha256": "e2a2952b4a5758d370e7f70965ad74f6ef63f9858feeeacd1cc00a3d3d725be9",
|
|
13
14
|
"build": {
|
|
14
15
|
"version": "7.0.0",
|
|
15
16
|
"upstream": "12.9.1",
|
|
17
|
+
"networkPolicy": "fixed",
|
|
18
|
+
"proxySha256": "9df64e72652677cd129eaf0cb3bd70869f9e17601a5fbc74b14814bff6df3973",
|
|
16
19
|
"sourceSha256": "24fc6b35169fee879d62d9c08f10c697d3fc7f6e30b3b7a820a3f5792a240123",
|
|
17
|
-
"patchSha256": "
|
|
20
|
+
"patchSha256": "f0d75abaadd94fc907672e667b8773fde333b6493a941ec5263871f185500dfb",
|
|
18
21
|
"target": "darwin-arm64",
|
|
19
22
|
"profile": {
|
|
20
23
|
"optLevel": "3",
|
|
21
24
|
"lto": "thin",
|
|
22
25
|
"codegenUnits": "16"
|
|
23
26
|
},
|
|
24
|
-
"binarySha256": "
|
|
27
|
+
"binarySha256": "e2a2952b4a5758d370e7f70965ad74f6ef63f9858feeeacd1cc00a3d3d725be9"
|
|
25
28
|
}
|
|
26
29
|
},
|
|
27
30
|
"darwin-x64": {
|
|
28
|
-
"file": "darwin-x64-
|
|
31
|
+
"file": "darwin-x64-a0a2076924990bfbd761fdba45aa34faa71efc638c36a86306035f62d64842c7.br",
|
|
29
32
|
"encoding": "br",
|
|
30
|
-
"binaryBytes":
|
|
31
|
-
"compressedBytes":
|
|
32
|
-
"compressedSha256": "
|
|
33
|
-
"binarySha256": "
|
|
33
|
+
"binaryBytes": 62768592,
|
|
34
|
+
"compressedBytes": 18687608,
|
|
35
|
+
"compressedSha256": "db3639e1708007c55bf38cfd5be78c5b8e3530d0c6a761b9137af9b925141d4c",
|
|
36
|
+
"binarySha256": "a0a2076924990bfbd761fdba45aa34faa71efc638c36a86306035f62d64842c7",
|
|
34
37
|
"build": {
|
|
35
38
|
"version": "7.0.0",
|
|
36
39
|
"upstream": "12.9.1",
|
|
40
|
+
"networkPolicy": "fixed",
|
|
41
|
+
"proxySha256": "9df64e72652677cd129eaf0cb3bd70869f9e17601a5fbc74b14814bff6df3973",
|
|
37
42
|
"sourceSha256": "24fc6b35169fee879d62d9c08f10c697d3fc7f6e30b3b7a820a3f5792a240123",
|
|
38
|
-
"patchSha256": "
|
|
43
|
+
"patchSha256": "f0d75abaadd94fc907672e667b8773fde333b6493a941ec5263871f185500dfb",
|
|
39
44
|
"target": "x86_64-apple-darwin",
|
|
40
45
|
"profile": {
|
|
41
46
|
"optLevel": "3",
|
|
42
47
|
"lto": "thin",
|
|
43
48
|
"codegenUnits": "16"
|
|
44
49
|
},
|
|
45
|
-
"binarySha256": "
|
|
50
|
+
"binarySha256": "a0a2076924990bfbd761fdba45aa34faa71efc638c36a86306035f62d64842c7"
|
|
46
51
|
}
|
|
47
52
|
},
|
|
48
53
|
"linux-arm64-gnu": {
|
|
49
|
-
"file": "linux-arm64-gnu-
|
|
54
|
+
"file": "linux-arm64-gnu-c7cc00145aec732f388eff21221721688987e4dfa29f380ef78b1980234e3409.br",
|
|
50
55
|
"encoding": "br",
|
|
51
|
-
"binaryBytes":
|
|
52
|
-
"compressedBytes":
|
|
53
|
-
"compressedSha256": "
|
|
54
|
-
"binarySha256": "
|
|
56
|
+
"binaryBytes": 57643704,
|
|
57
|
+
"compressedBytes": 17996046,
|
|
58
|
+
"compressedSha256": "50b1304456712fbdbf9fd6d34cd9932fca1e195ca3acf0099a48413c6d74842f",
|
|
59
|
+
"binarySha256": "c7cc00145aec732f388eff21221721688987e4dfa29f380ef78b1980234e3409",
|
|
55
60
|
"build": {
|
|
56
61
|
"version": "7.0.0",
|
|
57
62
|
"upstream": "12.9.1",
|
|
63
|
+
"networkPolicy": "fixed",
|
|
64
|
+
"proxySha256": "9df64e72652677cd129eaf0cb3bd70869f9e17601a5fbc74b14814bff6df3973",
|
|
58
65
|
"sourceSha256": "24fc6b35169fee879d62d9c08f10c697d3fc7f6e30b3b7a820a3f5792a240123",
|
|
59
|
-
"patchSha256": "
|
|
66
|
+
"patchSha256": "f0d75abaadd94fc907672e667b8773fde333b6493a941ec5263871f185500dfb",
|
|
60
67
|
"target": "aarch64-unknown-linux-gnu",
|
|
61
68
|
"profile": {
|
|
62
69
|
"optLevel": "3",
|
|
63
70
|
"lto": "thin",
|
|
64
71
|
"codegenUnits": "16"
|
|
65
72
|
},
|
|
66
|
-
"binarySha256": "
|
|
73
|
+
"binarySha256": "c7cc00145aec732f388eff21221721688987e4dfa29f380ef78b1980234e3409"
|
|
67
74
|
}
|
|
68
75
|
},
|
|
69
76
|
"linux-x64-gnu": {
|
|
70
|
-
"file": "linux-x64-gnu-
|
|
77
|
+
"file": "linux-x64-gnu-e0a67bdc1c7f36fa46fe3379dc6d888c0fb8a7f1592e847b64c6dda8876f320d.br",
|
|
71
78
|
"encoding": "br",
|
|
72
|
-
"binaryBytes":
|
|
73
|
-
"compressedBytes":
|
|
74
|
-
"compressedSha256": "
|
|
75
|
-
"binarySha256": "
|
|
79
|
+
"binaryBytes": 68735232,
|
|
80
|
+
"compressedBytes": 19204798,
|
|
81
|
+
"compressedSha256": "9f4dd3d79a995522895a80dd41d49a54c77b6aa1e6d0a4f2c6acb44ea42b2a3b",
|
|
82
|
+
"binarySha256": "e0a67bdc1c7f36fa46fe3379dc6d888c0fb8a7f1592e847b64c6dda8876f320d",
|
|
76
83
|
"build": {
|
|
77
84
|
"version": "7.0.0",
|
|
78
85
|
"upstream": "12.9.1",
|
|
86
|
+
"networkPolicy": "fixed",
|
|
87
|
+
"proxySha256": "9df64e72652677cd129eaf0cb3bd70869f9e17601a5fbc74b14814bff6df3973",
|
|
79
88
|
"sourceSha256": "24fc6b35169fee879d62d9c08f10c697d3fc7f6e30b3b7a820a3f5792a240123",
|
|
80
|
-
"patchSha256": "
|
|
89
|
+
"patchSha256": "f0d75abaadd94fc907672e667b8773fde333b6493a941ec5263871f185500dfb",
|
|
81
90
|
"target": "x86_64-unknown-linux-gnu",
|
|
82
91
|
"profile": {
|
|
83
92
|
"optLevel": "3",
|
|
84
93
|
"lto": "thin",
|
|
85
94
|
"codegenUnits": "16"
|
|
86
95
|
},
|
|
87
|
-
"binarySha256": "
|
|
96
|
+
"binarySha256": "e0a67bdc1c7f36fa46fe3379dc6d888c0fb8a7f1592e847b64c6dda8876f320d"
|
|
88
97
|
}
|
|
89
98
|
},
|
|
90
99
|
"win32-x64": {
|
|
91
|
-
"file": "win32-x64-
|
|
100
|
+
"file": "win32-x64-95c6378cbfbd76ac16ff5691e28c9b7f91b07c8c216f7b6f70bd954a02beb3a9.br",
|
|
92
101
|
"encoding": "br",
|
|
93
|
-
"binaryBytes":
|
|
94
|
-
"compressedBytes":
|
|
95
|
-
"compressedSha256": "
|
|
96
|
-
"binarySha256": "
|
|
102
|
+
"binaryBytes": 71463424,
|
|
103
|
+
"compressedBytes": 21134746,
|
|
104
|
+
"compressedSha256": "2c89a69141885a30017cfed2f4f4853e8302b5d42f1d5a0f8f53f7b0f673aeaa",
|
|
105
|
+
"binarySha256": "95c6378cbfbd76ac16ff5691e28c9b7f91b07c8c216f7b6f70bd954a02beb3a9",
|
|
97
106
|
"build": {
|
|
98
107
|
"version": "7.0.0",
|
|
99
108
|
"upstream": "12.9.1",
|
|
109
|
+
"networkPolicy": "fixed",
|
|
110
|
+
"proxySha256": "9df64e72652677cd129eaf0cb3bd70869f9e17601a5fbc74b14814bff6df3973",
|
|
100
111
|
"sourceSha256": "24fc6b35169fee879d62d9c08f10c697d3fc7f6e30b3b7a820a3f5792a240123",
|
|
101
|
-
"patchSha256": "
|
|
112
|
+
"patchSha256": "f0d75abaadd94fc907672e667b8773fde333b6493a941ec5263871f185500dfb",
|
|
102
113
|
"target": "x86_64-pc-windows-gnu",
|
|
103
114
|
"profile": {
|
|
104
115
|
"optLevel": "3",
|
|
105
116
|
"lto": "thin",
|
|
106
117
|
"codegenUnits": "16"
|
|
107
118
|
},
|
|
108
|
-
"binarySha256": "
|
|
119
|
+
"binarySha256": "95c6378cbfbd76ac16ff5691e28c9b7f91b07c8c216f7b6f70bd954a02beb3a9"
|
|
109
120
|
}
|
|
110
121
|
}
|
|
111
122
|
}
|