openspecui 1.4.0 → 1.5.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/LICENSE +21 -0
- package/dist/cli.mjs +44 -25
- package/dist/index.mjs +1 -1
- package/dist/{open-BVmQScxd.mjs → open-DDagk2eo.mjs} +2 -2
- package/dist/{src-kxKAXq88.mjs → src-16GA3our.mjs} +826 -141
- package/package.json +3 -3
- package/web/assets/{BufferResource-C85AhGv8.js → BufferResource-Bn1UWy0D.js} +1 -1
- package/web/assets/{CanvasRenderer-CgtmVcg4.js → CanvasRenderer-D8NiU8la.js} +1 -1
- package/web/assets/{Filter-Cb47-EZS.js → Filter-CRwq487x.js} +1 -1
- package/web/assets/{RenderTargetSystem-Cx8qJk_q.js → RenderTargetSystem-CtoB_qTm.js} +1 -1
- package/web/assets/{WebGLRenderer-pIi2Bx_Q.js → WebGLRenderer-BgKO8R0a.js} +1 -1
- package/web/assets/{WebGPURenderer-C3CBA4dG.js → WebGPURenderer-CQeL2efC.js} +1 -1
- package/web/assets/{browserAll-C_q9nnWk.js → browserAll-DP6sOYev.js} +1 -1
- package/web/assets/{ghostty-web-D6mGnCnU.js → ghostty-web-evxujSxm.js} +1 -1
- package/web/assets/{index-C79ew42C.js → index-4MAU81Qk.js} +1 -1
- package/web/assets/{index-BwQ_9hzT.js → index-B0IbsqHi.js} +1 -1
- package/web/assets/{index-ur_rMFp9.js → index-B147AOgf.js} +1 -1
- package/web/assets/{index-TCkbFaCm.js → index-BMashGQn.js} +1 -1
- package/web/assets/{index-D45XwNhE.js → index-BPZ3nG0r.js} +1 -1
- package/web/assets/{index-BBPTFxy1.js → index-BejnsZfY.js} +1 -1
- package/web/assets/{index-CGrYIgSe.js → index-BnT52DZ8.js} +1 -1
- package/web/assets/{index-BSqKqaGj.js → index-CBCPR3Qb.js} +1 -1
- package/web/assets/{index-LWU4Mw81.js → index-D2Tp4F9B.js} +1 -1
- package/web/assets/{index-CGweB5Ib.js → index-D6ardy54.js} +1 -1
- package/web/assets/{index-knJhpHqo.js → index-DJqmTRAR.js} +1 -1
- package/web/assets/{index-B5M3Dg-Q.js → index-DTeOcXKn.js} +1 -1
- package/web/assets/{index-C6pjde1Q.js → index-DcXyAs0z.js} +1 -1
- package/web/assets/{index-3eymcnUu.js → index-T8xoxmUb.js} +218 -215
- package/web/assets/index-Ys2MTD3W.css +1 -0
- package/web/assets/{index-CyqwjCgH.js → index-dSf1u0YV.js} +1 -1
- package/web/assets/{index-D8KhKUsi.js → index-f0QdJSzm.js} +1 -1
- package/web/assets/{webworkerAll-Cq063Dqj.js → webworkerAll-DA2HufNb.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-BImvtc4B.css +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenSpecUI Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as SchemaInfoSchema, c as CliExecutor, d as
|
|
2
|
+
import { a as SchemaInfoSchema, c as CliExecutor, d as OpenSpecAdapter, f as __commonJS, i as SchemaDetailSchema, l as ConfigManager, o as SchemaResolutionSchema, p as __toESM, r as require_dist, s as TemplatesSchema, t as startServer, u as DEFAULT_CONFIG } from "./src-16GA3our.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { basename, dirname, extname, join, normalize, relative, resolve } from "path";
|
|
5
5
|
import { readFile } from "node:fs/promises";
|
|
@@ -8,9 +8,9 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync
|
|
|
8
8
|
import { readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1, writeFile as writeFile$1 } from "fs";
|
|
9
9
|
import { format, inspect } from "util";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
|
+
import { spawn } from "node:child_process";
|
|
11
12
|
import { fileURLToPath as fileURLToPath$1 } from "node:url";
|
|
12
13
|
import { notStrictEqual, strictEqual } from "assert";
|
|
13
|
-
import { spawn } from "node:child_process";
|
|
14
14
|
|
|
15
15
|
//#region ../../node_modules/.pnpm/cliui@9.0.1/node_modules/cliui/build/lib/index.js
|
|
16
16
|
const align = {
|
|
@@ -4505,26 +4505,11 @@ var yargs_default = Yargs;
|
|
|
4505
4505
|
|
|
4506
4506
|
//#endregion
|
|
4507
4507
|
//#region package.json
|
|
4508
|
-
var
|
|
4509
|
-
var
|
|
4510
|
-
"@hono/node-server": "^1.14.1",
|
|
4511
|
-
"@openspecui/server": "workspace:*",
|
|
4512
|
-
"@openspecui/web": "workspace:*",
|
|
4513
|
-
"@types/node": "^22.10.2",
|
|
4514
|
-
"@types/ws": "^8.5.13",
|
|
4515
|
-
"@types/yargs": "^17.0.35",
|
|
4516
|
-
"hono": "^4.7.3",
|
|
4517
|
-
"open": "^10.1.0",
|
|
4518
|
-
"tsdown": "^0.16.6",
|
|
4519
|
-
"tsx": "^4.19.2",
|
|
4520
|
-
"typescript": "^5.7.2",
|
|
4521
|
-
"vitest": "^2.1.8",
|
|
4522
|
-
"yargs": "^18.0.0"
|
|
4523
|
-
};
|
|
4508
|
+
var import_dist = require_dist();
|
|
4509
|
+
var version = "1.5.1";
|
|
4524
4510
|
|
|
4525
4511
|
//#endregion
|
|
4526
4512
|
//#region src/export.ts
|
|
4527
|
-
var import_dist = require_dist();
|
|
4528
4513
|
const __dirname$1 = dirname$1(fileURLToPath$1(import.meta.url));
|
|
4529
4514
|
function parseCliJson(raw, schema, label) {
|
|
4530
4515
|
const trimmed = raw.trim();
|
|
@@ -4580,7 +4565,9 @@ function parseSchemaYaml(content) {
|
|
|
4580
4565
|
*/
|
|
4581
4566
|
async function generateSnapshot(projectDir) {
|
|
4582
4567
|
const adapter = new OpenSpecAdapter(projectDir);
|
|
4583
|
-
const
|
|
4568
|
+
const configManager = new ConfigManager(projectDir);
|
|
4569
|
+
const cliExecutor = new CliExecutor(configManager, projectDir);
|
|
4570
|
+
const uiConfig = await configManager.readConfig().catch(() => DEFAULT_CONFIG);
|
|
4584
4571
|
if (!await adapter.isInitialized()) throw new Error(`OpenSpec not initialized in ${projectDir}`);
|
|
4585
4572
|
const specsMeta = await adapter.listSpecsWithMeta();
|
|
4586
4573
|
const specs = await Promise.all(specsMeta.map(async (meta) => {
|
|
@@ -4704,6 +4691,7 @@ async function generateSnapshot(projectDir) {
|
|
|
4704
4691
|
changesCount: changes.filter((c) => c !== null).length,
|
|
4705
4692
|
archivesCount: archives.length
|
|
4706
4693
|
},
|
|
4694
|
+
config: uiConfig,
|
|
4707
4695
|
specs,
|
|
4708
4696
|
changes: changes.filter((c) => c !== null),
|
|
4709
4697
|
archives,
|
|
@@ -4744,6 +4732,11 @@ function runCommand(cmd, args, cwd) {
|
|
|
4744
4732
|
child.on("error", (err) => reject(err));
|
|
4745
4733
|
});
|
|
4746
4734
|
}
|
|
4735
|
+
const LOCAL_PACKAGE_PROTOCOLS = [
|
|
4736
|
+
"workspace:",
|
|
4737
|
+
"file:",
|
|
4738
|
+
"link:"
|
|
4739
|
+
];
|
|
4747
4740
|
/**
|
|
4748
4741
|
* Detect the package manager used in the current project
|
|
4749
4742
|
*/
|
|
@@ -4794,12 +4787,36 @@ function getRunCommand(pm, bin) {
|
|
|
4794
4787
|
};
|
|
4795
4788
|
}
|
|
4796
4789
|
}
|
|
4790
|
+
function findNearestPackageJson(startDir) {
|
|
4791
|
+
let currentDir = startDir;
|
|
4792
|
+
while (true) {
|
|
4793
|
+
const packageJsonPath = join$1(currentDir, "package.json");
|
|
4794
|
+
if (existsSync(packageJsonPath)) return packageJsonPath;
|
|
4795
|
+
const parentDir = dirname$1(currentDir);
|
|
4796
|
+
if (parentDir === currentDir) return null;
|
|
4797
|
+
currentDir = parentDir;
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
function readWebPackageRangeFromPackageJson(startDir) {
|
|
4801
|
+
const packageJsonPath = findNearestPackageJson(startDir);
|
|
4802
|
+
if (!packageJsonPath) return null;
|
|
4803
|
+
try {
|
|
4804
|
+
const packageJsonRaw = readFileSync(packageJsonPath, "utf-8");
|
|
4805
|
+
const parsed = JSON.parse(packageJsonRaw);
|
|
4806
|
+
return parsed.dependencies?.["@openspecui/web"] ?? parsed.devDependencies?.["@openspecui/web"] ?? parsed.peerDependencies?.["@openspecui/web"] ?? parsed.optionalDependencies?.["@openspecui/web"] ?? null;
|
|
4807
|
+
} catch {
|
|
4808
|
+
return null;
|
|
4809
|
+
}
|
|
4810
|
+
}
|
|
4811
|
+
function isLocalPackageRange(range) {
|
|
4812
|
+
if (!range) return false;
|
|
4813
|
+
return LOCAL_PACKAGE_PROTOCOLS.some((protocol) => range.startsWith(protocol));
|
|
4814
|
+
}
|
|
4797
4815
|
/**
|
|
4798
4816
|
* Get the exec command for running a package binary
|
|
4799
4817
|
* Uses appropriate flags to ensure the correct version of @openspecui/web is installed
|
|
4800
4818
|
*/
|
|
4801
|
-
function getExecCommand(pm) {
|
|
4802
|
-
const webPkgSpec = `@openspecui/web@${devDependencies["@openspecui/web"]}`;
|
|
4819
|
+
function getExecCommand(pm, webPkgSpec) {
|
|
4803
4820
|
switch (pm) {
|
|
4804
4821
|
case "bun": return {
|
|
4805
4822
|
cmd: "bunx",
|
|
@@ -4864,7 +4881,9 @@ async function exportHtml(options) {
|
|
|
4864
4881
|
writeFileSync(dataJsonPath, JSON.stringify(snapshot, null, 2));
|
|
4865
4882
|
console.log(`Data snapshot written to ${dataJsonPath}`);
|
|
4866
4883
|
const localWebPkg = findLocalWebPackage();
|
|
4867
|
-
|
|
4884
|
+
const webPackageRange = readWebPackageRangeFromPackageJson(__dirname$1);
|
|
4885
|
+
if (isLocalPackageRange(webPackageRange)) {
|
|
4886
|
+
if (!localWebPkg) throw new Error(`Detected local/dev @openspecui/web range "${webPackageRange}" but local web package was not found`);
|
|
4868
4887
|
console.log("\n[Local dev mode] Running SSG from local web package...");
|
|
4869
4888
|
await runCommand("pnpm", [
|
|
4870
4889
|
"tsx",
|
|
@@ -4879,7 +4898,7 @@ async function exportHtml(options) {
|
|
|
4879
4898
|
} else {
|
|
4880
4899
|
console.log("\n[Production mode] Running SSG via @openspecui/web...");
|
|
4881
4900
|
const pm = detectPackageManager();
|
|
4882
|
-
const execCmd = getExecCommand(pm);
|
|
4901
|
+
const execCmd = getExecCommand(pm, `@openspecui/web@${webPackageRange || version}`);
|
|
4883
4902
|
try {
|
|
4884
4903
|
await runCommand(execCmd.cmd, [
|
|
4885
4904
|
...execCmd.args,
|
|
@@ -4976,7 +4995,7 @@ async function main() {
|
|
|
4976
4995
|
console.log(`✅ Server running at ${server.url}`);
|
|
4977
4996
|
console.log("");
|
|
4978
4997
|
if (argv.open) {
|
|
4979
|
-
await (await import("./open-
|
|
4998
|
+
await (await import("./open-DDagk2eo.mjs")).default(server.url);
|
|
4980
4999
|
console.log("🌐 Browser opened");
|
|
4981
5000
|
}
|
|
4982
5001
|
console.log("");
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import fs, { constants } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs$1 from "node:fs";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
4
|
import childProcess, { execFile } from "node:child_process";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
6
7
|
import process from "node:process";
|
|
7
8
|
import { Buffer } from "node:buffer";
|
|
8
|
-
import { promisify } from "node:util";
|
|
9
9
|
import os from "node:os";
|
|
10
10
|
|
|
11
11
|
//#region ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|