@nhonh/qabot 0.2.0 → 0.2.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/package.json
CHANGED
package/src/cli/commands/auth.js
CHANGED
|
@@ -232,17 +232,17 @@ async function interactiveSetup(projectDir, config, isEmpty) {
|
|
|
232
232
|
if (isEmpty) {
|
|
233
233
|
logger.blank();
|
|
234
234
|
logger.warn(
|
|
235
|
-
"No qabot.config.
|
|
235
|
+
"No qabot.config.json found. Run `qabot init` first, then `qabot auth`.",
|
|
236
236
|
);
|
|
237
237
|
logger.blank();
|
|
238
|
-
logger.info("Or manually add to qabot.config.
|
|
238
|
+
logger.info("Or manually add to qabot.config.json:");
|
|
239
239
|
logger.dim(` ai: ${JSON.stringify(aiConfig, null, 4)}`);
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
await writeConfig(projectDir, config);
|
|
244
244
|
logger.blank();
|
|
245
|
-
logger.success("AI configuration saved to qabot.config.
|
|
245
|
+
logger.success("AI configuration saved to qabot.config.json");
|
|
246
246
|
logger.blank();
|
|
247
247
|
logger.info("Test your setup:");
|
|
248
248
|
logger.dim(" qabot auth --test");
|
|
@@ -24,7 +24,7 @@ async function runGenerate(feature, options) {
|
|
|
24
24
|
const { config, isEmpty } = await loadConfig(projectDir);
|
|
25
25
|
|
|
26
26
|
if (isEmpty) {
|
|
27
|
-
logger.warn("No qabot.config.
|
|
27
|
+
logger.warn("No qabot.config.json found. Run `qabot init` first.");
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
|
package/src/cli/commands/init.js
CHANGED
|
@@ -59,7 +59,7 @@ async function runInit(options) {
|
|
|
59
59
|
const { proceed } = await enquirer.prompt({
|
|
60
60
|
type: "confirm",
|
|
61
61
|
name: "proceed",
|
|
62
|
-
message: "Generate qabot.config.
|
|
62
|
+
message: "Generate qabot.config.json with these settings?",
|
|
63
63
|
initial: true,
|
|
64
64
|
});
|
|
65
65
|
if (!proceed) {
|
package/src/cli/commands/run.js
CHANGED
|
@@ -31,7 +31,7 @@ async function runTests(feature, options) {
|
|
|
31
31
|
const { config, isEmpty } = await loadConfig(projectDir);
|
|
32
32
|
|
|
33
33
|
if (isEmpty) {
|
|
34
|
-
logger.warn("No qabot.config.
|
|
34
|
+
logger.warn("No qabot.config.json found. Run `qabot init` first.");
|
|
35
35
|
logger.dim("Or run tests with: qabot init -y && qabot run");
|
|
36
36
|
return;
|
|
37
37
|
}
|
package/src/core/config.js
CHANGED
|
@@ -5,11 +5,12 @@ import { DEFAULT_CONFIG, TOOL_NAME } from "./constants.js";
|
|
|
5
5
|
|
|
6
6
|
const explorer = cosmiconfig(TOOL_NAME, {
|
|
7
7
|
searchPlaces: [
|
|
8
|
-
"qabot.config.
|
|
8
|
+
"qabot.config.json",
|
|
9
|
+
".qabotrc.json",
|
|
10
|
+
".qabotrc",
|
|
9
11
|
"qabot.config.mjs",
|
|
12
|
+
"qabot.config.js",
|
|
10
13
|
"qabot.config.cjs",
|
|
11
|
-
".qabotrc.json",
|
|
12
|
-
".qabotrc.js",
|
|
13
14
|
"package.json",
|
|
14
15
|
],
|
|
15
16
|
});
|
|
@@ -33,11 +34,12 @@ export async function loadConfig(projectDir) {
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export async function writeConfig(projectDir, configData) {
|
|
36
|
-
const configPath = path.join(projectDir, "qabot.config.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const configPath = path.join(projectDir, "qabot.config.json");
|
|
38
|
+
await writeFile(
|
|
39
|
+
configPath,
|
|
40
|
+
JSON.stringify(configData, null, 2) + "\n",
|
|
41
|
+
"utf-8",
|
|
42
|
+
);
|
|
41
43
|
return configPath;
|
|
42
44
|
}
|
|
43
45
|
|
package/src/core/constants.js
CHANGED