opencroc 1.3.0 → 1.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/dist/cli/index.js +12 -8
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -3845,25 +3845,29 @@ __export(serve_exports, {
|
|
|
3845
3845
|
});
|
|
3846
3846
|
import chalk11 from "chalk";
|
|
3847
3847
|
async function serve(opts) {
|
|
3848
|
-
let
|
|
3848
|
+
let config;
|
|
3849
|
+
let configPath;
|
|
3849
3850
|
try {
|
|
3850
|
-
loaded = await loadConfig();
|
|
3851
|
+
const loaded = await loadConfig();
|
|
3852
|
+
config = loaded.config;
|
|
3853
|
+
configPath = loaded.filepath;
|
|
3851
3854
|
} catch {
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
+
config = { backendRoot: "." };
|
|
3856
|
+
configPath = "(auto-detected)";
|
|
3857
|
+
console.log(chalk11.yellow("\u26A0 No opencroc config found, using current directory as backend root."));
|
|
3858
|
+
console.log(chalk11.gray(" Tip: run `opencroc init` to create a config file.\n"));
|
|
3855
3859
|
}
|
|
3856
3860
|
const port = parseInt(opts.port || "8765", 10);
|
|
3857
3861
|
const host = opts.host || "localhost";
|
|
3858
3862
|
console.log(chalk11.cyan("\u{1F40A} Starting OpenCroc Studio..."));
|
|
3859
|
-
console.log(chalk11.gray(` Config: ${
|
|
3860
|
-
console.log(chalk11.gray(` Backend: ${
|
|
3863
|
+
console.log(chalk11.gray(` Config: ${configPath}`));
|
|
3864
|
+
console.log(chalk11.gray(` Backend: ${config.backendRoot}`));
|
|
3861
3865
|
const { startServer: startServer2 } = await Promise.resolve().then(() => (init_server(), server_exports));
|
|
3862
3866
|
await startServer2({
|
|
3863
3867
|
port,
|
|
3864
3868
|
host,
|
|
3865
3869
|
open: opts.open ?? true,
|
|
3866
|
-
config
|
|
3870
|
+
config,
|
|
3867
3871
|
cwd: process.cwd()
|
|
3868
3872
|
});
|
|
3869
3873
|
}
|