three-blocks-login 0.1.5 → 0.1.7
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/README.md +1 -1
- package/bin/login.js +40 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Minimal, dependency-free CLI for authenticating to Three Blocks private npm regi
|
|
|
9
9
|
npx -y three-blocks-login@latest
|
|
10
10
|
|
|
11
11
|
# Using pnpm (recommended - no warnings)
|
|
12
|
-
pnpm dlx three-blocks-login@latest
|
|
12
|
+
pnpm dlx three-blocks-login@latest@latest
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Authentication Modes
|
package/bin/login.js
CHANGED
|
@@ -362,6 +362,14 @@ let CHANNEL = String( args.channel || process.env.THREE_BLOCKS_CHANNEL || "stabl
|
|
|
362
362
|
if ( ! [ 'stable', 'alpha', 'beta' ].includes( CHANNEL ) ) CHANNEL = 'stable';
|
|
363
363
|
const PRINT_SHELL = !! ( args[ 'print-shell' ] || args.printShell || process.env.THREE_BLOCKS_LOGIN_PRINT_SHELL === '1' );
|
|
364
364
|
const NON_INTERACTIVE = !! ( args[ 'non-interactive' ] || args.nonInteractive || process.env.CI === '1' );
|
|
365
|
+
const SKIP_LOGIN = /^1|true|yes$/i.test( String( process.env.THREE_BLOCKS_LOGIN_SKIP || '' ) );
|
|
366
|
+
|
|
367
|
+
if ( SKIP_LOGIN ) {
|
|
368
|
+
|
|
369
|
+
if ( ! QUIET ) console.error( `${banner} skipping login (THREE_BLOCKS_LOGIN_SKIP=1)` );
|
|
370
|
+
process.exit( 0 );
|
|
371
|
+
|
|
372
|
+
}
|
|
365
373
|
|
|
366
374
|
// Load .env from current working directory (no deps)
|
|
367
375
|
loadEnvFromDotfile( process.cwd() );
|
|
@@ -640,7 +648,38 @@ const log = {
|
|
|
640
648
|
const merged = base ? `${base}${os.EOL}${os.EOL}${npmrcContent}` : npmrcContent;
|
|
641
649
|
|
|
642
650
|
fs.writeFileSync( out, merged, { mode: 0o600 } );
|
|
643
|
-
|
|
651
|
+
|
|
652
|
+
// Show authentication status (unless in quiet mode)
|
|
653
|
+
|
|
654
|
+
if ( ! QUIET ) {
|
|
655
|
+
|
|
656
|
+
const maskedLicense = maskLicense( LICENSE_CLEAN );
|
|
657
|
+
|
|
658
|
+
renderEnvHeader( {
|
|
659
|
+
|
|
660
|
+
scope: SCOPE,
|
|
661
|
+
registry: u.href,
|
|
662
|
+
expiresAt,
|
|
663
|
+
tmpFile: out,
|
|
664
|
+
licenseMasked: maskedLicense,
|
|
665
|
+
licenseId,
|
|
666
|
+
channel: CHANNEL,
|
|
667
|
+
status: authStatus,
|
|
668
|
+
plan,
|
|
669
|
+
teamName,
|
|
670
|
+
teamId,
|
|
671
|
+
repository,
|
|
672
|
+
domain,
|
|
673
|
+
region,
|
|
674
|
+
userDisplayName: USER_DISPLAY_NAME,
|
|
675
|
+
} );
|
|
676
|
+
|
|
677
|
+
} else {
|
|
678
|
+
|
|
679
|
+
log.ok( `${banner} wrote ${bold( out )} ${dim( `(${SCOPE} → ${u.href}, expires ${expiresAt ?? "unknown"})` )}` );
|
|
680
|
+
|
|
681
|
+
}
|
|
682
|
+
|
|
644
683
|
return;
|
|
645
684
|
|
|
646
685
|
}
|