@bobfrankston/importgen 0.1.18 → 0.1.19

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/README.md +4 -1
  2. package/index.js +5 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -25,7 +25,7 @@ npm install -g @bobfrankston/importgen
25
25
  Run from your project directory (containing `package.json` and your HTML file):
26
26
 
27
27
  ```bash
28
- importgen [htmlfile] [--watch|-w]
28
+ importgen [htmlfile] [--watch|-w] [--version|-v]
29
29
  ```
30
30
 
31
31
  ```bash
@@ -39,6 +39,9 @@ importgen app.html
39
39
  # Watch mode: regenerate whenever package.json changes
40
40
  importgen --watch
41
41
  importgen default.htm --watch
42
+
43
+ # Show version
44
+ importgen -v
42
45
  ```
43
46
 
44
47
  `importgen` reads dependencies from `package.json` in the current directory and injects the import map into the HTML file.
package/index.js CHANGED
@@ -177,8 +177,12 @@ function generateImportMap(packageJsonPath, htmlFilePath) {
177
177
  }
178
178
  // Parse CLI arguments
179
179
  const args = process.argv.slice(2);
180
+ if (args.includes('-v') || args.includes('--version')) {
181
+ console.log(`importgen ${packageJson.version}`);
182
+ process.exit(0);
183
+ }
180
184
  const watchMode = args.includes('-w') || args.includes('--watch');
181
- const htmlArg = args.find(a => a !== '-w' && a !== '--watch');
185
+ const htmlArg = args.find(a => !a.startsWith('-'));
182
186
  const packageJsonPath = path.join(process.cwd(), 'package.json');
183
187
  // Resolve HTML file: explicit argument, or search for common names
184
188
  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.18",
3
+ "version": "0.1.19",
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": {