@ogygie/studio 0.5.1 → 0.5.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/server.js +18 -4
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/server/start.ts
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
|
-
import { join as join2 } from "node:path";
|
|
4
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
7
|
// ../ogygie-core/src/error.schema.ts
|
|
@@ -858,7 +858,20 @@ async function createStudioApp(options) {
|
|
|
858
858
|
}
|
|
859
859
|
|
|
860
860
|
// src/server/start.ts
|
|
861
|
-
|
|
861
|
+
function studioPackageRoot() {
|
|
862
|
+
let directory = dirname2(fileURLToPath(import.meta.url));
|
|
863
|
+
for (let depth = 0; depth < 10; depth += 1) {
|
|
864
|
+
if (existsSync(join2(directory, "package.json"))) return directory;
|
|
865
|
+
const parent = dirname2(directory);
|
|
866
|
+
if (parent === directory) break;
|
|
867
|
+
directory = parent;
|
|
868
|
+
}
|
|
869
|
+
throw new Error("@ogygie/studio: package root not found from " + import.meta.url);
|
|
870
|
+
}
|
|
871
|
+
var PACKAGE_DIR = studioPackageRoot();
|
|
872
|
+
function studioUiDir() {
|
|
873
|
+
return join2(PACKAGE_DIR, "dist-ui");
|
|
874
|
+
}
|
|
862
875
|
async function buildUiIfMissing(uiDistDir) {
|
|
863
876
|
if (existsSync(join2(uiDistDir, "index.html"))) return;
|
|
864
877
|
console.log("ogygie studio \u2014 UI absente, construction unique\u2026");
|
|
@@ -887,7 +900,7 @@ function openInBrowser(url) {
|
|
|
887
900
|
}
|
|
888
901
|
async function startStudio(options) {
|
|
889
902
|
const port = options.port ?? 4001;
|
|
890
|
-
const uiDistDir =
|
|
903
|
+
const uiDistDir = studioUiDir();
|
|
891
904
|
await buildUiIfMissing(uiDistDir);
|
|
892
905
|
const app = await createStudioApp({
|
|
893
906
|
storage: createLocalSpecStorage(options.repoRoot),
|
|
@@ -900,5 +913,6 @@ async function startStudio(options) {
|
|
|
900
913
|
return app;
|
|
901
914
|
}
|
|
902
915
|
export {
|
|
903
|
-
startStudio
|
|
916
|
+
startStudio,
|
|
917
|
+
studioUiDir
|
|
904
918
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogygie/studio",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Ogygie framework dev studio: projects a repo's specs and manifest into a local UI. Ships its built UI; launched by `ogygie studio`.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"fastify": "^5.0.0",
|
|
22
22
|
"fastify-type-provider-zod": "^6.0.0",
|
|
23
23
|
"zod": "^4.0.0",
|
|
24
|
-
"@ogygie/core": "0.5.
|
|
24
|
+
"@ogygie/core": "0.5.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@tailwindcss/vite": "^4.3.3",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"dev": "vite",
|
|
48
|
-
"build": "tsx scripts/build-server.ts
|
|
48
|
+
"build": "vite build && tsx scripts/build-server.ts",
|
|
49
49
|
"typecheck": "tsc -p tsconfig.json"
|
|
50
50
|
}
|
|
51
51
|
}
|