@clerk/dev-cli 0.0.5 → 0.0.6-canary.v041ba46

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clerk/dev-cli",
3
3
  "description": "CLI tool designed to simplify the process of iterating on packages within the clerk/javascript repository",
4
- "version": "0.0.5",
4
+ "version": "0.0.6-canary.v041ba46",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "author": "Clerk",
package/src/cli.js CHANGED
@@ -6,11 +6,12 @@ import { setInstance } from './commands/set-instance.js';
6
6
  import { setRoot } from './commands/set-root.js';
7
7
  import { setup } from './commands/setup.js';
8
8
  import { watch } from './commands/watch.js';
9
+ import { getPackageVersion } from './utils/getPackageVersion.js';
9
10
 
10
11
  export default function cli() {
11
12
  const program = new Command();
12
13
 
13
- program.name('clerk-dev').description('CLI to make developing Clerk packages easier').version('0.0.0');
14
+ program.name('clerk-dev').description('CLI to make developing Clerk packages easier').version(getPackageVersion());
14
15
 
15
16
  program
16
17
  .command('init')
@@ -0,0 +1,12 @@
1
+ import { createRequire } from 'node:module';
2
+
3
+ /**
4
+ * Get the version of the dev-cli as specified in the `package.json` file.
5
+ * @returns {string}
6
+ */
7
+ export function getPackageVersion() {
8
+ // Currently we use createRequire which allows us to import JSON files without logging a warning to the console about
9
+ // the experimental nature of JSON file imports.
10
+ const pkgJson = createRequire(import.meta.url)('../../package.json');
11
+ return pkgJson.version;
12
+ }