@bobfrankston/npmglobalize 1.0.65 → 1.0.67

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.
@@ -8,7 +8,9 @@
8
8
  "Bash(node:*)",
9
9
  "Bash(git add:*)",
10
10
  "Bash(git commit:*)",
11
- "Bash(cmd /c \"del \\\\?\\\\Y:\\\\dev\\\\utils\\\\npmglobalize\\\\nul\")"
11
+ "Bash(cmd /c \"del \\\\?\\\\Y:\\\\dev\\\\utils\\\\npmglobalize\\\\nul\")",
12
+ "Bash(dir /T:W \"y:\\\\dev\\\\utils\\\\npmglobalize\\\\lib.*\")",
13
+ "Bash(ls:*)"
12
14
  ]
13
15
  }
14
16
  }
package/cli.js CHANGED
@@ -26,8 +26,16 @@ for (const tsFile of tsFiles) {
26
26
  }
27
27
  if (outOfSync.length > 0 && !process.argv.includes('--force')) {
28
28
  console.error('\n' + styleText('red', '❌ Build check failed:'));
29
- console.error(styleText('red', ` ${outOfSync.length} file(s) need compilation:`));
30
- outOfSync.forEach(f => console.error(styleText('red', ` - ${f}`)));
29
+ console.error(styleText('red', ` ${outOfSync.length} file(s) need compilation in ${__dirname}:`));
30
+ outOfSync.forEach(f => {
31
+ const tsPath = path.join(__dirname, f);
32
+ const jsPath = path.join(__dirname, f.replace('.ts', '.js'));
33
+ const tsMtime = fs.statSync(tsPath).mtime;
34
+ const jsMtime = fs.statSync(jsPath).mtime;
35
+ const fmt = (d) => d.toLocaleString();
36
+ console.error(styleText('red', ` - ${tsPath}`));
37
+ console.error(styleText('red', ` .ts: ${fmt(tsMtime)} .js: ${fmt(jsMtime)}`));
38
+ });
31
39
  console.error('\n' + styleText('yellow', ' Please run: tsc'));
32
40
  console.error(styleText('yellow', ' Or use --force to skip this check') + '\n');
33
41
  process.exit(1);
package/lib.js CHANGED
@@ -69,7 +69,12 @@ export function readPackageJson(dir) {
69
69
  if (!fs.existsSync(pkgPath)) {
70
70
  throw new Error(`package.json not found: ${pkgPath}`);
71
71
  }
72
- return JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
72
+ try {
73
+ return JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
74
+ }
75
+ catch (error) {
76
+ throw new Error(`Failed to parse ${pkgPath}: ${error.message}`);
77
+ }
73
78
  }
74
79
  /** Read .globalize.json5 config file */
75
80
  export function readConfig(dir) {
@@ -1063,26 +1068,9 @@ function ensureGitignore(cwd) {
1063
1068
  // Update .gitignore if needed
1064
1069
  if (needsUpdate) {
1065
1070
  if (!content || content.trim() === '') {
1066
- // Create new .gitignore with common patterns
1067
- content = `node_modules/
1068
- .env*
1069
- *cert*/
1070
- *certs*/
1071
- *.pem
1072
- *.key
1073
- *.p12
1074
- *.pfx
1075
- configuration.json
1076
- token
1077
- tokens
1078
- *.token
1079
- cruft/
1080
- prev/
1081
- tests/
1082
- *.log
1083
- .DS_Store
1084
- Thumbs.db
1085
- `;
1071
+ // Create new .gitignore from RECOMMENDED_GITIGNORE plus extras
1072
+ const extras = ['*certs*/', 'configuration.json', 'cruft/', 'prev/', 'tests/'];
1073
+ content = [...RECOMMENDED_GITIGNORE, ...extras].join('\n') + '\n';
1086
1074
  }
1087
1075
  else {
1088
1076
  // Add node_modules to existing .gitignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",