@bobfrankston/importgen 0.1.13 → 0.1.14

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.
@@ -3,7 +3,8 @@
3
3
  "allow": [
4
4
  "Bash(npm run build:*)",
5
5
  "Bash(npmglobalize)",
6
- "Bash(npx tsc)"
6
+ "Bash(npx tsc)",
7
+ "Bash(node index.js:*)"
7
8
  ]
8
9
  }
9
10
  }
package/index.js CHANGED
@@ -6,6 +6,7 @@
6
6
  import fs from 'node:fs';
7
7
  import path from 'node:path';
8
8
  import chokidar from 'chokidar';
9
+ import pkg from './package.json' with { type: 'json' };
9
10
  /**
10
11
  * Resolve dependency path based on version specifier
11
12
  */
@@ -174,6 +175,10 @@ function generateImportMap(packageJsonPath, htmlFilePath) {
174
175
  }
175
176
  // Parse CLI arguments
176
177
  const args = process.argv.slice(2);
178
+ if (args.includes('-v') || args.includes('--version')) {
179
+ console.log(pkg.version);
180
+ process.exit(0);
181
+ }
177
182
  const watchMode = args.includes('-w') || args.includes('--watch');
178
183
  const packageJsonPath = path.join(process.cwd(), 'package.json');
179
184
  // Find HTML file - check command line arg first, then try common names
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/importgen",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
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": {