@embeddables/cli 0.6.3 → 0.6.4

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 (2) hide show
  1. package/dist/cli.js +10 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,5 +1,11 @@
1
+ import { createRequire } from 'node:module';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
1
4
  import { Command } from 'commander';
2
5
  import pc from 'picocolors';
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ const require = createRequire(import.meta.url);
8
+ const pkg = require(path.join(__dirname, '..', 'package.json'));
3
9
  import { runBranch } from './commands/branch.js';
4
10
  import { runBuild } from './commands/build.js';
5
11
  import { runDev } from './commands/dev.js';
@@ -20,7 +26,10 @@ console.error = (...args) => {
20
26
  originalError(...args.map((arg) => typeof arg === 'string' ? `${pc.bold(pc.bgRed(' ERROR '))} ${pc.red(arg)}` : arg));
21
27
  };
22
28
  const program = new Command();
23
- program.name('embeddables').description('Embeddables CLI').version('0.1.0');
29
+ program
30
+ .name('embeddables')
31
+ .description('Embeddables CLI')
32
+ .version(pkg.version, '-v, --version', 'Show CLI version');
24
33
  program
25
34
  .command('init')
26
35
  .description('Initialize a new Embeddables project')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddables/cli",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "embeddables": "./bin/embeddables.mjs"