@bobfrankston/npmglobalize 1.0.43 → 1.0.45

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.
Files changed (3) hide show
  1. package/cli.js +7 -3
  2. package/lib.js +11 -2
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -6,6 +6,7 @@ import { globalize, readConfig } from './lib.js';
6
6
  import fs from 'fs';
7
7
  import path from 'path';
8
8
  import { fileURLToPath } from 'url';
9
+ import { styleText } from 'util';
9
10
  import JSON5 from 'json5';
10
11
  // Check if JS files are up-to-date with TS files
11
12
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -14,9 +15,12 @@ const libJsPath = path.join(__dirname, 'lib.js');
14
15
  if (fs.existsSync(libTsPath) && fs.existsSync(libJsPath)) {
15
16
  const tsStat = fs.statSync(libTsPath);
16
17
  const jsStat = fs.statSync(libJsPath);
17
- if (jsStat.mtime < tsStat.mtime) {
18
- console.error('\n⚠️ WARNING: lib.js is outdated (older than lib.ts)');
19
- console.error(' Please run: tsc\n');
18
+ if (jsStat.mtime < tsStat.mtime && !process.argv.includes('--force')) {
19
+ console.error('\n' + styleText('red', '❌ Build check failed:'));
20
+ console.error(styleText('red', ' lib.js is outdated (older than lib.ts)'));
21
+ console.error('\n' + styleText('yellow', ' Please run: tsc'));
22
+ console.error(styleText('yellow', ' Or use --force to skip this check') + '\n');
23
+ process.exit(1);
20
24
  }
21
25
  }
22
26
  function printHelp() {
package/lib.js CHANGED
@@ -1440,9 +1440,18 @@ export async function globalize(cwd, options = {}) {
1440
1440
  pkg.private = true;
1441
1441
  }
1442
1442
  }
1443
+ else if (npmVisibility === 'public') {
1444
+ // Explicit public - inform user
1445
+ console.log(`Will publish '${pkg.name}' to PUBLIC npm registry.`);
1446
+ }
1443
1447
  else {
1444
- // Default is public - just inform
1445
- console.log(`Will publish '${pkg.name}' to PUBLIC npm registry (default).`);
1448
+ // No explicit setting - check current state
1449
+ if (pkg.private) {
1450
+ console.log(`Package is marked PRIVATE - will not publish to npm.`);
1451
+ }
1452
+ else {
1453
+ console.log(`Will publish '${pkg.name}' to PUBLIC npm registry.`);
1454
+ }
1446
1455
  }
1447
1456
  // Update existing npm dependencies if requested
1448
1457
  if (updateDeps) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",