qfai 0.3.2 → 0.3.3
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/README.md +7 -1
- package/assets/init/.qfai/README.md +2 -0
- package/assets/init/.qfai/prompts/README.md +6 -0
- package/assets/init/.qfai/prompts/require-to-spec.md +39 -0
- package/assets/init/.qfai/rules/pnpm.md +29 -0
- package/assets/init/root/require/README.md +28 -0
- package/dist/cli/index.cjs +20 -3
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +20 -3
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -86,12 +86,29 @@ async function exists(target) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// src/cli/lib/assets.ts
|
|
89
|
+
import { existsSync } from "fs";
|
|
89
90
|
import path2 from "path";
|
|
90
91
|
import { fileURLToPath } from "url";
|
|
91
92
|
function getInitAssetsDir() {
|
|
92
93
|
const base = import.meta.url;
|
|
93
94
|
const basePath = base.startsWith("file:") ? fileURLToPath(base) : base;
|
|
94
|
-
|
|
95
|
+
const baseDir = path2.dirname(basePath);
|
|
96
|
+
const candidates = [
|
|
97
|
+
path2.resolve(baseDir, "../../../assets/init"),
|
|
98
|
+
path2.resolve(baseDir, "../../assets/init")
|
|
99
|
+
];
|
|
100
|
+
for (const candidate of candidates) {
|
|
101
|
+
if (existsSync(candidate)) {
|
|
102
|
+
return candidate;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
throw new Error(
|
|
106
|
+
[
|
|
107
|
+
"init \u7528\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002Template assets not found.",
|
|
108
|
+
"\u78BA\u8A8D\u3057\u305F\u30D1\u30B9 / Checked paths:",
|
|
109
|
+
...candidates.map((candidate) => `- ${candidate}`)
|
|
110
|
+
].join("\n")
|
|
111
|
+
);
|
|
95
112
|
}
|
|
96
113
|
|
|
97
114
|
// src/cli/lib/logger.ts
|
|
@@ -676,8 +693,8 @@ import { readFile as readFile2 } from "fs/promises";
|
|
|
676
693
|
import path7 from "path";
|
|
677
694
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
678
695
|
async function resolveToolVersion() {
|
|
679
|
-
if ("0.3.
|
|
680
|
-
return "0.3.
|
|
696
|
+
if ("0.3.3".length > 0) {
|
|
697
|
+
return "0.3.3";
|
|
681
698
|
}
|
|
682
699
|
try {
|
|
683
700
|
const packagePath = resolvePackageJsonPath();
|