ont-run 0.0.2 → 0.0.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/dist/bin/ont.js +14 -3
- package/dist/index.js +14 -3
- package/package.json +1 -1
- package/src/cli/utils/config-loader.ts +18 -3
package/dist/bin/ont.js
CHANGED
|
@@ -8656,10 +8656,21 @@ async function loadConfig(configPath) {
|
|
|
8656
8656
|
}
|
|
8657
8657
|
return { config, configDir, configPath: resolvedPath };
|
|
8658
8658
|
} catch (error) {
|
|
8659
|
-
|
|
8660
|
-
|
|
8659
|
+
const err = error;
|
|
8660
|
+
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
8661
|
+
const message = err.message || "";
|
|
8662
|
+
if (message.includes("ont-run") || message.includes("zod")) {
|
|
8663
|
+
throw new Error(`Failed to load config: ${resolvedPath}
|
|
8664
|
+
|
|
8665
|
+
Missing dependencies. Run 'bun install' first.`);
|
|
8666
|
+
}
|
|
8667
|
+
throw new Error(`Failed to load config: ${resolvedPath}
|
|
8668
|
+
|
|
8669
|
+
Module not found: ${message}`);
|
|
8661
8670
|
}
|
|
8662
|
-
throw
|
|
8671
|
+
throw new Error(`Failed to load config: ${resolvedPath}
|
|
8672
|
+
|
|
8673
|
+
${err.message || error}`);
|
|
8663
8674
|
}
|
|
8664
8675
|
}
|
|
8665
8676
|
|
package/dist/index.js
CHANGED
|
@@ -14623,10 +14623,21 @@ async function loadConfig(configPath) {
|
|
|
14623
14623
|
}
|
|
14624
14624
|
return { config, configDir, configPath: resolvedPath };
|
|
14625
14625
|
} catch (error) {
|
|
14626
|
-
|
|
14627
|
-
|
|
14626
|
+
const err = error;
|
|
14627
|
+
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
14628
|
+
const message = err.message || "";
|
|
14629
|
+
if (message.includes("ont-run") || message.includes("zod")) {
|
|
14630
|
+
throw new Error(`Failed to load config: ${resolvedPath}
|
|
14631
|
+
|
|
14632
|
+
Missing dependencies. Run 'bun install' first.`);
|
|
14633
|
+
}
|
|
14634
|
+
throw new Error(`Failed to load config: ${resolvedPath}
|
|
14635
|
+
|
|
14636
|
+
Module not found: ${message}`);
|
|
14628
14637
|
}
|
|
14629
|
-
throw
|
|
14638
|
+
throw new Error(`Failed to load config: ${resolvedPath}
|
|
14639
|
+
|
|
14640
|
+
${err.message || error}`);
|
|
14630
14641
|
}
|
|
14631
14642
|
}
|
|
14632
14643
|
|
package/package.json
CHANGED
|
@@ -70,9 +70,24 @@ export async function loadConfig(configPath?: string): Promise<{
|
|
|
70
70
|
|
|
71
71
|
return { config, configDir, configPath: resolvedPath };
|
|
72
72
|
} catch (error) {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
const err = error as NodeJS.ErrnoException & { message?: string };
|
|
74
|
+
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
75
|
+
// Check if it's a missing dependency vs missing config
|
|
76
|
+
const message = err.message || "";
|
|
77
|
+
if (message.includes("ont-run") || message.includes("zod")) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
`Failed to load config: ${resolvedPath}\n\n` +
|
|
80
|
+
`Missing dependencies. Run 'bun install' first.`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
throw new Error(
|
|
84
|
+
`Failed to load config: ${resolvedPath}\n\n` +
|
|
85
|
+
`Module not found: ${message}`
|
|
86
|
+
);
|
|
75
87
|
}
|
|
76
|
-
throw
|
|
88
|
+
throw new Error(
|
|
89
|
+
`Failed to load config: ${resolvedPath}\n\n` +
|
|
90
|
+
`${err.message || error}`
|
|
91
|
+
);
|
|
77
92
|
}
|
|
78
93
|
}
|