openspecui 0.9.3 → 0.9.5
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 +54 -8
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -4504,7 +4504,22 @@ var yargs_default = Yargs;
|
|
|
4504
4504
|
|
|
4505
4505
|
//#endregion
|
|
4506
4506
|
//#region package.json
|
|
4507
|
-
var version = "0.9.
|
|
4507
|
+
var version = "0.9.5";
|
|
4508
|
+
var devDependencies = {
|
|
4509
|
+
"@hono/node-server": "^1.14.1",
|
|
4510
|
+
"@openspecui/server": "workspace:*",
|
|
4511
|
+
"@openspecui/web": "workspace:*",
|
|
4512
|
+
"@types/node": "^22.10.2",
|
|
4513
|
+
"@types/ws": "^8.5.13",
|
|
4514
|
+
"@types/yargs": "^17.0.35",
|
|
4515
|
+
"hono": "^4.7.3",
|
|
4516
|
+
"open": "^10.1.0",
|
|
4517
|
+
"tsdown": "^0.16.6",
|
|
4518
|
+
"tsx": "^4.19.2",
|
|
4519
|
+
"typescript": "^5.7.2",
|
|
4520
|
+
"vitest": "^2.1.8",
|
|
4521
|
+
"yargs": "^18.0.0"
|
|
4522
|
+
};
|
|
4508
4523
|
|
|
4509
4524
|
//#endregion
|
|
4510
4525
|
//#region src/export.ts
|
|
@@ -4648,11 +4663,42 @@ function detectPackageManager() {
|
|
|
4648
4663
|
return "npm";
|
|
4649
4664
|
}
|
|
4650
4665
|
/**
|
|
4666
|
+
* Get the command to run a local binary (like vite)
|
|
4667
|
+
*/
|
|
4668
|
+
function getRunCommand(pm, bin) {
|
|
4669
|
+
switch (pm) {
|
|
4670
|
+
case "bun": return {
|
|
4671
|
+
cmd: "bunx",
|
|
4672
|
+
args: [bin]
|
|
4673
|
+
};
|
|
4674
|
+
case "pnpm": return {
|
|
4675
|
+
cmd: "pnpm",
|
|
4676
|
+
args: ["exec", bin]
|
|
4677
|
+
};
|
|
4678
|
+
case "yarn": return {
|
|
4679
|
+
cmd: "yarn",
|
|
4680
|
+
args: [bin]
|
|
4681
|
+
};
|
|
4682
|
+
case "deno": return {
|
|
4683
|
+
cmd: "deno",
|
|
4684
|
+
args: [
|
|
4685
|
+
"run",
|
|
4686
|
+
"-A",
|
|
4687
|
+
`npm:${bin}`
|
|
4688
|
+
]
|
|
4689
|
+
};
|
|
4690
|
+
default: return {
|
|
4691
|
+
cmd: "npx",
|
|
4692
|
+
args: [bin]
|
|
4693
|
+
};
|
|
4694
|
+
}
|
|
4695
|
+
}
|
|
4696
|
+
/**
|
|
4651
4697
|
* Get the exec command for running a package binary
|
|
4652
4698
|
* Uses appropriate flags to ensure the correct version of @openspecui/web is installed
|
|
4653
4699
|
*/
|
|
4654
4700
|
function getExecCommand(pm) {
|
|
4655
|
-
const webPkgSpec = `@openspecui/web@${
|
|
4701
|
+
const webPkgSpec = `@openspecui/web@${devDependencies["@openspecui/web"]}`;
|
|
4656
4702
|
switch (pm) {
|
|
4657
4703
|
case "bun": return {
|
|
4658
4704
|
cmd: "bunx",
|
|
@@ -4752,16 +4798,16 @@ async function exportHtml(options) {
|
|
|
4752
4798
|
console.log(`\nExport complete: ${outputDir}`);
|
|
4753
4799
|
if (open) {
|
|
4754
4800
|
console.log("\nStarting preview server...");
|
|
4755
|
-
const
|
|
4756
|
-
"vite",
|
|
4801
|
+
const viteArgs = [
|
|
4757
4802
|
"preview",
|
|
4758
4803
|
"--outDir",
|
|
4759
4804
|
resolve$1(outputDir)
|
|
4760
4805
|
];
|
|
4761
|
-
if (previewPort)
|
|
4762
|
-
if (previewHost)
|
|
4763
|
-
|
|
4764
|
-
|
|
4806
|
+
if (previewPort) viteArgs.push("--port", String(previewPort));
|
|
4807
|
+
if (previewHost) viteArgs.push("--host", previewHost);
|
|
4808
|
+
viteArgs.push("--open");
|
|
4809
|
+
const { cmd, args } = getRunCommand(detectPackageManager(), "vite");
|
|
4810
|
+
await runCommand(cmd, [...args, ...viteArgs], outputDir);
|
|
4765
4811
|
}
|
|
4766
4812
|
}
|
|
4767
4813
|
/**
|