@bobfrankston/importgen 0.1.24 → 0.1.25

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,8 @@
8
8
  "Bash(dir:*)",
9
9
  "Bash(ls:*)",
10
10
  "Bash(where extractids:*)",
11
- "Bash(cd \"y:/dev/utils/importgen\" && npx tsc --noEmit 2>&1222)"
11
+ "Bash(cd \"y:/dev/utils/importgen\" && npx tsc --noEmit 2>&1222)",
12
+ "Bash(cd y:/dev/utils/importgen && npm run release 2>&1exit)"
12
13
  ]
13
14
  }
14
15
  }
package/index.js CHANGED
@@ -283,9 +283,23 @@ if (args.includes('-v') || args.includes('--version')) {
283
283
  console.log(`importgen ${packageJson.version}`);
284
284
  process.exit(0);
285
285
  }
286
+ const knownFlags = new Set(['-w', '--watch', '--freeze', '-freeze', '-v', '--version']);
287
+ // Report unrecognized flags as errors
288
+ const unknownArgs = args.filter(a => a.startsWith('-') && !knownFlags.has(a));
289
+ if (unknownArgs.length > 0) {
290
+ console.error(`[importgen] Error: unrecognized argument(s): ${unknownArgs.join(', ')}`);
291
+ console.error(` Usage: importgen [htmlfile] [-w|--watch] [--freeze] [-v|--version]`);
292
+ process.exit(1);
293
+ }
286
294
  const watchMode = args.includes('-w') || args.includes('--watch');
287
- const freezeMode = args.includes('--freeze');
288
- const htmlArg = args.find(a => !a.startsWith('-'));
295
+ const freezeMode = args.includes('--freeze') || args.includes('-freeze');
296
+ const positionalArgs = args.filter(a => !a.startsWith('-'));
297
+ if (positionalArgs.length > 1) {
298
+ console.error(`[importgen] Error: too many arguments: ${positionalArgs.join(', ')}`);
299
+ console.error(` Usage: importgen [htmlfile] [-w|--watch] [--freeze] [-v|--version]`);
300
+ process.exit(1);
301
+ }
302
+ const htmlArg = positionalArgs[0];
289
303
  const packageJsonPath = path.join(process.cwd(), 'package.json');
290
304
  // Resolve HTML file: explicit argument, or search for common names
291
305
  const possibleHtmlFiles = ['index.html', 'default.html', 'default.htm'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/importgen",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Generate ES Module import maps from package.json dependencies for native browser module loading",
5
5
  "main": "index.js",
6
6
  "bin": {