artifact-graph 0.3.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.1
6
+
7
+ ### Fixed
8
+
9
+ - **CLI help contract**: `artifact-graph --help`、`-h` 和 `help` now return exit code 0 and print usage to stdout, making `--help` a reliable install verification gate for public INSTALL instructions.
10
+ - **init creates missing directories**: `artifact-graph init --root <path>` now creates intermediate directories if they don't exist, matching the documented usage pattern.
11
+
5
12
  ## 0.3.0
6
13
 
7
14
  ### Added
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // src/cli.ts
4
4
  import yaml2 from "js-yaml";
5
5
  import { realpathSync } from "fs";
6
- import { access as access2, readFile as readFile3, writeFile as writeFile5 } from "fs/promises";
6
+ import { access as access2, mkdir as mkdir6, readFile as readFile3, writeFile as writeFile5 } from "fs/promises";
7
7
  import { join as join7 } from "path";
8
8
  import { fileURLToPath } from "url";
9
9
 
@@ -6134,6 +6134,10 @@ async function runCli(argv, io = {}) {
6134
6134
  const err = io.stderr ?? ((chunk) => process.stderr.write(chunk));
6135
6135
  const root = String(parsed.flags.root ?? cwd);
6136
6136
  try {
6137
+ if (parsed.command === "--help" || parsed.command === "-h" || parsed.command === "help") {
6138
+ out(helpText());
6139
+ return 0;
6140
+ }
6137
6141
  switch (parsed.command) {
6138
6142
  case "init": {
6139
6143
  await initConfig(root);
@@ -6983,6 +6987,7 @@ async function initConfig(root) {
6983
6987
  throw error;
6984
6988
  }
6985
6989
  }
6990
+ await mkdir6(root, { recursive: true });
6986
6991
  await writeFile5(configPath, yaml2.dump(DEFAULT_SCHEMA, { lineWidth: 120 }));
6987
6992
  }
6988
6993
  function parseArgs(argv) {
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "artifact-graph",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Git-native Markdown artifact graph scanner and validator",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
- "packageManager": "pnpm@10.17.1",
8
7
  "keywords": [
9
8
  "artifact-graph",
10
9
  "traceability",
@@ -33,16 +32,6 @@
33
32
  "engines": {
34
33
  "node": ">=22.0.0"
35
34
  },
36
- "scripts": {
37
- "build": "tsup src/index.ts --format esm,cjs --dts --splitting false && tsup src/cli.ts --format esm --dts --splitting false",
38
- "test": "vitest run --config vitest.config.ts",
39
- "test:ci": "ARTIFACT_GRAPH_PUBLIC_REPO=1 vitest run --config vitest.config.ts",
40
- "test:watch": "vitest",
41
- "typecheck": "tsc --noEmit",
42
- "clean": "rm -rf dist coverage",
43
- "packet:audit": "node scripts/run-packet-audit.mjs",
44
- "packet:prompt-audit": "node scripts/run-packet-prompt-audit.mjs"
45
- },
46
35
  "dependencies": {
47
36
  "better-sqlite3": "^11.9.0",
48
37
  "commander": "^13.1.0",
@@ -76,10 +65,15 @@
76
65
  "url": "https://github.com/mzdbxqh/artifact-graph/issues"
77
66
  },
78
67
  "homepage": "https://github.com/mzdbxqh/artifact-graph#readme",
79
- "pnpm": {
80
- "onlyBuiltDependencies": [
81
- "better-sqlite3",
82
- "esbuild"
83
- ]
68
+ "scripts": {
69
+ "build": "tsup src/index.ts --format esm,cjs --dts --splitting false && tsup src/cli.ts --format esm --dts --splitting false",
70
+ "test": "vitest run --config vitest.config.ts",
71
+ "test:ci": "ARTIFACT_GRAPH_PUBLIC_REPO=1 vitest run --config vitest.config.ts && pnpm test:npm-consumer",
72
+ "test:npm-consumer": "node test/npm-bin-install.test.mjs",
73
+ "test:watch": "vitest",
74
+ "typecheck": "tsc --noEmit",
75
+ "clean": "rm -rf dist coverage",
76
+ "packet:audit": "node scripts/run-packet-audit.mjs",
77
+ "packet:prompt-audit": "node scripts/run-packet-prompt-audit.mjs"
84
78
  }
85
- }
79
+ }
File without changes
File without changes
File without changes