openspecui 0.9.3 → 0.9.4
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.mjs +38 -7
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -4504,7 +4504,7 @@ var yargs_default = Yargs;
|
|
|
4504
4504
|
|
|
4505
4505
|
//#endregion
|
|
4506
4506
|
//#region package.json
|
|
4507
|
-
var version = "0.9.
|
|
4507
|
+
var version = "0.9.4";
|
|
4508
4508
|
|
|
4509
4509
|
//#endregion
|
|
4510
4510
|
//#region src/export.ts
|
|
@@ -4648,6 +4648,37 @@ function detectPackageManager() {
|
|
|
4648
4648
|
return "npm";
|
|
4649
4649
|
}
|
|
4650
4650
|
/**
|
|
4651
|
+
* Get the command to run a local binary (like vite)
|
|
4652
|
+
*/
|
|
4653
|
+
function getRunCommand(pm, bin) {
|
|
4654
|
+
switch (pm) {
|
|
4655
|
+
case "bun": return {
|
|
4656
|
+
cmd: "bunx",
|
|
4657
|
+
args: [bin]
|
|
4658
|
+
};
|
|
4659
|
+
case "pnpm": return {
|
|
4660
|
+
cmd: "pnpm",
|
|
4661
|
+
args: ["exec", bin]
|
|
4662
|
+
};
|
|
4663
|
+
case "yarn": return {
|
|
4664
|
+
cmd: "yarn",
|
|
4665
|
+
args: [bin]
|
|
4666
|
+
};
|
|
4667
|
+
case "deno": return {
|
|
4668
|
+
cmd: "deno",
|
|
4669
|
+
args: [
|
|
4670
|
+
"run",
|
|
4671
|
+
"-A",
|
|
4672
|
+
`npm:${bin}`
|
|
4673
|
+
]
|
|
4674
|
+
};
|
|
4675
|
+
default: return {
|
|
4676
|
+
cmd: "npx",
|
|
4677
|
+
args: [bin]
|
|
4678
|
+
};
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4681
|
+
/**
|
|
4651
4682
|
* Get the exec command for running a package binary
|
|
4652
4683
|
* Uses appropriate flags to ensure the correct version of @openspecui/web is installed
|
|
4653
4684
|
*/
|
|
@@ -4752,16 +4783,16 @@ async function exportHtml(options) {
|
|
|
4752
4783
|
console.log(`\nExport complete: ${outputDir}`);
|
|
4753
4784
|
if (open) {
|
|
4754
4785
|
console.log("\nStarting preview server...");
|
|
4755
|
-
const
|
|
4756
|
-
"vite",
|
|
4786
|
+
const viteArgs = [
|
|
4757
4787
|
"preview",
|
|
4758
4788
|
"--outDir",
|
|
4759
4789
|
resolve$1(outputDir)
|
|
4760
4790
|
];
|
|
4761
|
-
if (previewPort)
|
|
4762
|
-
if (previewHost)
|
|
4763
|
-
|
|
4764
|
-
|
|
4791
|
+
if (previewPort) viteArgs.push("--port", String(previewPort));
|
|
4792
|
+
if (previewHost) viteArgs.push("--host", previewHost);
|
|
4793
|
+
viteArgs.push("--open");
|
|
4794
|
+
const { cmd, args } = getRunCommand(detectPackageManager(), "vite");
|
|
4795
|
+
await runCommand(cmd, [...args, ...viteArgs], outputDir);
|
|
4765
4796
|
}
|
|
4766
4797
|
}
|
|
4767
4798
|
/**
|