sdd-forge 0.1.0-alpha.5 → 0.1.0-alpha.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "sdd-forge",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "Spec-Driven Development tooling for automated documentation generation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@ import {
12
12
  stripBlockComments,
13
13
  extractArrayBody,
14
14
  extractQuotedStrings,
15
- } from "../../lib/php-array-parser.js";
15
+ } from "../../../lib/php-array-parser.js";
16
16
 
17
17
  const LIFECYCLE_METHODS = new Set([
18
18
  "beforeFilter",
@@ -17,7 +17,7 @@
17
17
 
18
18
  import fs from "fs";
19
19
  import path from "path";
20
- import { stripBlockComments } from "../../lib/php-array-parser.js";
20
+ import { stripBlockComments } from "../../../lib/php-array-parser.js";
21
21
 
22
22
  // ---------------------------------------------------------------------------
23
23
  // 定数解析: app/Config/const.php
@@ -15,7 +15,7 @@ import {
15
15
  extractQuotedStrings,
16
16
  camelToSnake,
17
17
  pluralize,
18
- } from "../../lib/php-array-parser.js";
18
+ } from "../../../lib/php-array-parser.js";
19
19
 
20
20
  const RELATION_TYPES = [
21
21
  "belongsTo",
@@ -8,7 +8,7 @@
8
8
 
9
9
  import fs from "fs";
10
10
  import path from "path";
11
- import { stripBlockComments } from "../../lib/php-array-parser.js";
11
+ import { stripBlockComments } from "../../../lib/php-array-parser.js";
12
12
 
13
13
  export function analyzeRoutes(appDir) {
14
14
  const routesPath = path.join(appDir, "Config", "routes.php");
@@ -8,7 +8,7 @@
8
8
 
9
9
  import fs from "fs";
10
10
  import path from "path";
11
- import { stripBlockComments } from "../../lib/php-array-parser.js";
11
+ import { stripBlockComments } from "../../../lib/php-array-parser.js";
12
12
 
13
13
  const LIFECYCLE_METHODS = new Set([
14
14
  "startup",
package/src/sdd-forge.js CHANGED
@@ -33,6 +33,14 @@ if (projIdx !== -1) {
33
33
 
34
34
  const [subCmd, ...rest] = filteredArgs;
35
35
 
36
+ // version (-v / --version / -V)
37
+ if (subCmd === "-v" || subCmd === "--version" || subCmd === "-V") {
38
+ const { readFileSync } = await import("fs");
39
+ const pkg = JSON.parse(readFileSync(path.join(PKG_DIR, "..", "package.json"), "utf8"));
40
+ console.log(pkg.version);
41
+ process.exit(0);
42
+ }
43
+
36
44
  // help (no args / -h / --help)
37
45
  if (!subCmd || subCmd === "-h" || subCmd === "--help") {
38
46
  const helpPath = path.join(PKG_DIR, "help.js");