@verikit/cli 0.1.0 → 0.1.1

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/index.js +7 -1
  2. package/package.json +13 -13
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
+ import { realpathSync } from "node:fs";
3
4
  import { pathToFileURL } from "node:url";
4
5
  import { InitAbort, runInit } from "./commands/init.js";
5
6
  /**
@@ -39,8 +40,13 @@ export function createProgram(run = runInit) {
39
40
  return program;
40
41
  }
41
42
  /* node:coverage disable */
43
+ // `process.argv[1]` is the path used to invoke this script when run through npm/npx's `bin`
44
+ // symlink (node_modules/.bin/verikit -> .../dist/index.js), that's the symlink path, while
45
+ // `import.meta.url` is Node's ESM loader resolving to the real, symlink-followed path. Without
46
+ // realpathSync here the two never match, `isMain` is always false, and the CLI silently no-ops
47
+ // for every real install only direct `node dist/index.js` invocations happened to line up.
42
48
  const isMain = typeof process.argv[1] === "string" &&
43
- import.meta.url === pathToFileURL(process.argv[1]).href;
49
+ import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href;
44
50
  if (isMain) {
45
51
  void createProgram().parseAsync(process.argv);
46
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verikit/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Scaffolding CLI for VeriKit detects your stack, installs the right packages, and wires up the integration.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -14,6 +14,17 @@
14
14
  "engines": {
15
15
  "node": ">=18.18"
16
16
  },
17
+ "scripts": {
18
+ "build": "tsc -p tsconfig.json",
19
+ "dev": "tsx src/index.ts",
20
+ "typecheck": "tsc --noEmit",
21
+ "lint": "eslint .",
22
+ "format": "prettier --write .",
23
+ "format:check": "prettier --check .",
24
+ "test": "rm -rf .test-dist && tsc -p tsconfig.test.json && node --test $(find ./.test-dist/test -name '*.test.js' -type f | sort)",
25
+ "test:coverage": "rm -rf .test-dist coverage && tsc -p tsconfig.test.json && node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 $(find ./.test-dist/test -name '*.test.js' -type f | sort)",
26
+ "verify": "pnpm typecheck && pnpm lint && pnpm build && pnpm format:check && pnpm test:coverage"
27
+ },
17
28
  "dependencies": {
18
29
  "@clack/prompts": "^1.7.0",
19
30
  "commander": "^15.0.0",
@@ -29,16 +40,5 @@
29
40
  "tsx": "^4.23.12",
30
41
  "typescript": "^6.0.3",
31
42
  "typescript-eslint": "^8.63.0"
32
- },
33
- "scripts": {
34
- "build": "tsc -p tsconfig.json",
35
- "dev": "tsx src/index.ts",
36
- "typecheck": "tsc --noEmit",
37
- "lint": "eslint .",
38
- "format": "prettier --write .",
39
- "format:check": "prettier --check .",
40
- "test": "rm -rf .test-dist && tsc -p tsconfig.test.json && node --test $(find ./.test-dist/test -name '*.test.js' -type f | sort)",
41
- "test:coverage": "rm -rf .test-dist coverage && tsc -p tsconfig.test.json && node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 $(find ./.test-dist/test -name '*.test.js' -type f | sort)",
42
- "verify": "pnpm typecheck && pnpm lint && pnpm build && pnpm format:check && pnpm test:coverage"
43
43
  }
44
- }
44
+ }