create-three-blocks-starter 0.0.5 → 0.0.6
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/bin/index.js +4 -8
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -17,19 +17,15 @@ const reset = ESC(0);
|
|
|
17
17
|
|
|
18
18
|
const STARTER_PKG = '@three-blocks/starter'; // private starter (lives in CodeArtifact)
|
|
19
19
|
const LOGIN_CLI = 'three-blocks-login'; // public login CLI
|
|
20
|
+
const LOGIN_SPEC = `${LOGIN_CLI}@latest`; // force-fresh npx install
|
|
20
21
|
const SCOPE = '@three-blocks';
|
|
21
22
|
|
|
22
23
|
const BLOCKED_NPM_ENV_KEYS = new Set([
|
|
23
24
|
'npm_config__three_blocks_registry',
|
|
24
|
-
'npm_config__three-blocks-registry',
|
|
25
25
|
'npm_config_verify_deps_before_run',
|
|
26
|
-
'npm_config_verify-deps-before-run',
|
|
27
26
|
'npm_config_global_bin_dir',
|
|
28
|
-
'npm_config_global-bin-dir',
|
|
29
27
|
'npm_config__jsr_registry',
|
|
30
|
-
'npm_config__jsr-registry',
|
|
31
28
|
'npm_config_node_linker',
|
|
32
|
-
'npm_config_node-linker',
|
|
33
29
|
].map((key) => key.replace(/-/g, '_').toLowerCase()));
|
|
34
30
|
|
|
35
31
|
const cleanNpmEnv = (extra = {}) => {
|
|
@@ -122,7 +118,7 @@ function mask(s) {
|
|
|
122
118
|
return v.slice(0, 3) + '••••' + v.slice(-4);
|
|
123
119
|
}
|
|
124
120
|
|
|
125
|
-
const BROKER_DEFAULT_ENDPOINT = process.env.THREE_BLOCKS_BROKER_URL || '
|
|
121
|
+
const BROKER_DEFAULT_ENDPOINT = process.env.THREE_BLOCKS_BROKER_URL || 'https://www.threejs-blocks.com/api/npm/token';
|
|
126
122
|
|
|
127
123
|
const resolveBrokerEndpoint = (channel) => {
|
|
128
124
|
let endpoint = BROKER_DEFAULT_ENDPOINT;
|
|
@@ -400,7 +396,7 @@ async function main() {
|
|
|
400
396
|
const tmp = mkTmpDir();
|
|
401
397
|
const tmpNpmrc = path.join(tmp, '.npmrc');
|
|
402
398
|
logProgress(`Fetching short-lived token (temp .npmrc) [channel: ${channel}] ...`);
|
|
403
|
-
run('npx', ['-y',
|
|
399
|
+
run('npx', ['-y', LOGIN_SPEC, '--mode', 'project', '--scope', SCOPE, '--channel', channel], {
|
|
404
400
|
cwd: tmp,
|
|
405
401
|
env: { ...process.env, THREE_BLOCKS_SECRET_KEY: license, THREE_BLOCKS_CHANNEL: channel },
|
|
406
402
|
});
|
|
@@ -484,7 +480,7 @@ async function main() {
|
|
|
484
480
|
const pkg = JSON.parse(pkgRaw);
|
|
485
481
|
pkg.scripts = pkg.scripts || {};
|
|
486
482
|
if (!pkg.scripts.preinstall) {
|
|
487
|
-
pkg.scripts.preinstall = `npx -y ${LOGIN_CLI} --mode project --scope ${SCOPE} --channel ${channel}`;
|
|
483
|
+
pkg.scripts.preinstall = `npx -y ${LOGIN_CLI}@latest --mode project --scope ${SCOPE} --channel ${channel}`;
|
|
488
484
|
}
|
|
489
485
|
await fsp.writeFile(pkgPath, JSON.stringify(pkg, null, 2));
|
|
490
486
|
logSuccess('Added preinstall to generated package.json to refresh token on installs.');
|