latticesql 4.3.1 → 4.3.2
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.js +95 -57
- package/dist/desktop-entry.js +91 -53
- package/dist/index.cjs +49 -19
- package/dist/index.js +95 -57
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -29084,12 +29084,12 @@ var getNodeModulesParentDirs;
|
|
|
29084
29084
|
var init_getNodeModulesParentDirs = __esm({
|
|
29085
29085
|
"node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getNodeModulesParentDirs.js"() {
|
|
29086
29086
|
"use strict";
|
|
29087
|
-
getNodeModulesParentDirs = (
|
|
29087
|
+
getNodeModulesParentDirs = (dirname20) => {
|
|
29088
29088
|
const cwd = process.cwd();
|
|
29089
|
-
if (!
|
|
29089
|
+
if (!dirname20) {
|
|
29090
29090
|
return [cwd];
|
|
29091
29091
|
}
|
|
29092
|
-
const normalizedPath = normalize(
|
|
29092
|
+
const normalizedPath = normalize(dirname20);
|
|
29093
29093
|
const parts = normalizedPath.split(sep6);
|
|
29094
29094
|
const nodeModulesIndex = parts.indexOf("node_modules");
|
|
29095
29095
|
const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep6) : normalizedPath;
|
|
@@ -29167,8 +29167,8 @@ var init_getTypeScriptUserAgentPair = __esm({
|
|
|
29167
29167
|
tscVersion = null;
|
|
29168
29168
|
return void 0;
|
|
29169
29169
|
}
|
|
29170
|
-
const
|
|
29171
|
-
const nodeModulesParentDirs = getNodeModulesParentDirs(
|
|
29170
|
+
const dirname20 = typeof __dirname !== "undefined" ? __dirname : void 0;
|
|
29171
|
+
const nodeModulesParentDirs = getNodeModulesParentDirs(dirname20);
|
|
29172
29172
|
let versionFromApp;
|
|
29173
29173
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
29174
29174
|
try {
|
|
@@ -57954,8 +57954,8 @@ var init_dist_es22 = __esm({
|
|
|
57954
57954
|
});
|
|
57955
57955
|
|
|
57956
57956
|
// src/cli.ts
|
|
57957
|
-
import { resolve as resolve17, dirname as
|
|
57958
|
-
import { readFileSync as readFileSync26, existsSync as
|
|
57957
|
+
import { resolve as resolve17, dirname as dirname19 } from "path";
|
|
57958
|
+
import { readFileSync as readFileSync26, existsSync as existsSync34 } from "fs";
|
|
57959
57959
|
import { execSync } from "child_process";
|
|
57960
57960
|
import { parse as parse3 } from "yaml";
|
|
57961
57961
|
|
|
@@ -58222,9 +58222,9 @@ function installLatest(ctx, version, opts = {}) {
|
|
|
58222
58222
|
init_http();
|
|
58223
58223
|
import { createServer } from "http";
|
|
58224
58224
|
import { spawn as spawn2 } from "child_process";
|
|
58225
|
-
import { existsSync as
|
|
58225
|
+
import { existsSync as existsSync33 } from "fs";
|
|
58226
58226
|
import { WebSocketServer, WebSocket } from "ws";
|
|
58227
|
-
import { dirname as
|
|
58227
|
+
import { dirname as dirname18, resolve as resolve16 } from "path";
|
|
58228
58228
|
|
|
58229
58229
|
// src/gui/active-db.ts
|
|
58230
58230
|
init_adapter();
|
|
@@ -76758,8 +76758,16 @@ async function dispatchIngestRoute(req, res, ctx) {
|
|
|
76758
76758
|
|
|
76759
76759
|
// src/gui/sources-routes.ts
|
|
76760
76760
|
init_user_config();
|
|
76761
|
-
import {
|
|
76762
|
-
|
|
76761
|
+
import {
|
|
76762
|
+
statSync as statSync9,
|
|
76763
|
+
readdirSync as readdirSync8,
|
|
76764
|
+
readFileSync as readFileSync23,
|
|
76765
|
+
writeFileSync as writeFileSync10,
|
|
76766
|
+
existsSync as existsSync27,
|
|
76767
|
+
mkdirSync as mkdirSync12,
|
|
76768
|
+
rmSync
|
|
76769
|
+
} from "fs";
|
|
76770
|
+
import { resolve as resolve12, join as join29, basename as basename12, sep as sep8, dirname as dirname16 } from "path";
|
|
76763
76771
|
import { execFile } from "child_process";
|
|
76764
76772
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
76765
76773
|
init_http();
|
|
@@ -76767,20 +76775,49 @@ var MAX_LIST_ENTRIES = 2e3;
|
|
|
76767
76775
|
var MAX_INGEST_FILES = 500;
|
|
76768
76776
|
var MAX_INGEST_DEPTH = 8;
|
|
76769
76777
|
var SKIP_DIRS = /* @__PURE__ */ new Set([".git", "node_modules", ".DS_Store", "__pycache__", ".venv", "venv"]);
|
|
76770
|
-
function rootsFile() {
|
|
76771
|
-
return join29(
|
|
76778
|
+
function rootsFile(configPath) {
|
|
76779
|
+
return join29(dirname16(configPath), "sources.json");
|
|
76780
|
+
}
|
|
76781
|
+
function migrateGlobalRootsIfNeeded(configPath) {
|
|
76782
|
+
const wsFile = rootsFile(configPath);
|
|
76783
|
+
if (existsSync27(wsFile)) return;
|
|
76784
|
+
const globalFile = join29(configDir(), "sources.json");
|
|
76785
|
+
if (globalFile === wsFile || !existsSync27(globalFile)) return;
|
|
76786
|
+
let roots;
|
|
76787
|
+
try {
|
|
76788
|
+
const parsed = JSON.parse(readFileSync23(globalFile, "utf8"));
|
|
76789
|
+
if (!Array.isArray(parsed.roots) || parsed.roots.length === 0) return;
|
|
76790
|
+
roots = parsed.roots;
|
|
76791
|
+
} catch {
|
|
76792
|
+
return;
|
|
76793
|
+
}
|
|
76794
|
+
try {
|
|
76795
|
+
mkdirSync12(dirname16(wsFile), { recursive: true });
|
|
76796
|
+
writeFileSync10(wsFile, JSON.stringify({ roots }, null, 2), "utf8");
|
|
76797
|
+
} catch {
|
|
76798
|
+
return;
|
|
76799
|
+
}
|
|
76800
|
+
try {
|
|
76801
|
+
rmSync(globalFile, { force: true });
|
|
76802
|
+
} catch {
|
|
76803
|
+
try {
|
|
76804
|
+
writeFileSync10(globalFile, JSON.stringify({ roots: [] }, null, 2), "utf8");
|
|
76805
|
+
} catch {
|
|
76806
|
+
}
|
|
76807
|
+
}
|
|
76772
76808
|
}
|
|
76773
|
-
function readRoots() {
|
|
76809
|
+
function readRoots(configPath) {
|
|
76810
|
+
migrateGlobalRootsIfNeeded(configPath);
|
|
76774
76811
|
try {
|
|
76775
|
-
const raw = readFileSync23(rootsFile(), "utf8");
|
|
76812
|
+
const raw = readFileSync23(rootsFile(configPath), "utf8");
|
|
76776
76813
|
const parsed = JSON.parse(raw);
|
|
76777
76814
|
return Array.isArray(parsed.roots) ? parsed.roots : [];
|
|
76778
76815
|
} catch {
|
|
76779
76816
|
return [];
|
|
76780
76817
|
}
|
|
76781
76818
|
}
|
|
76782
|
-
function writeRoots(roots) {
|
|
76783
|
-
writeFileSync10(rootsFile(), JSON.stringify({ roots }, null, 2), "utf8");
|
|
76819
|
+
function writeRoots(configPath, roots) {
|
|
76820
|
+
writeFileSync10(rootsFile(configPath), JSON.stringify({ roots }, null, 2), "utf8");
|
|
76784
76821
|
}
|
|
76785
76822
|
function safeResolveInside2(target, roots) {
|
|
76786
76823
|
const abs = resolve12(target);
|
|
@@ -76870,14 +76907,14 @@ async function ingestFolder(abs, ingestFile) {
|
|
|
76870
76907
|
return { ingested, skipped };
|
|
76871
76908
|
}
|
|
76872
76909
|
async function dispatchSourcesRoute(req, res, deps) {
|
|
76873
|
-
const { pathname, method, ingestFile } = deps;
|
|
76910
|
+
const { pathname, method, ingestFile, configPath } = deps;
|
|
76874
76911
|
if (!pathname.startsWith("/api/sources/")) return false;
|
|
76875
76912
|
if (!localFileOpenEnabled()) {
|
|
76876
76913
|
sendJson(res, { enabled: false });
|
|
76877
76914
|
return true;
|
|
76878
76915
|
}
|
|
76879
76916
|
if (pathname === "/api/sources/roots" && method === "GET") {
|
|
76880
|
-
sendJson(res, { enabled: true, roots: readRoots() });
|
|
76917
|
+
sendJson(res, { enabled: true, roots: readRoots(configPath) });
|
|
76881
76918
|
return true;
|
|
76882
76919
|
}
|
|
76883
76920
|
if (pathname === "/api/sources/roots" && method === "POST") {
|
|
@@ -76903,12 +76940,12 @@ async function dispatchSourcesRoute(req, res, deps) {
|
|
|
76903
76940
|
sendJson(res, { error: `path not found: ${abs}` }, 400);
|
|
76904
76941
|
return true;
|
|
76905
76942
|
}
|
|
76906
|
-
const roots = readRoots();
|
|
76943
|
+
const roots = readRoots(configPath);
|
|
76907
76944
|
let root6 = roots.find((r6) => resolve12(r6.path) === abs);
|
|
76908
76945
|
if (!root6) {
|
|
76909
76946
|
root6 = { id: randomUUID4(), path: abs, kind, name: basename12(abs) || abs };
|
|
76910
76947
|
roots.push(root6);
|
|
76911
|
-
writeRoots(roots);
|
|
76948
|
+
writeRoots(configPath, roots);
|
|
76912
76949
|
}
|
|
76913
76950
|
let result;
|
|
76914
76951
|
if (kind === "folder") result = await ingestFolder(abs, ingestFile);
|
|
@@ -76919,8 +76956,8 @@ async function dispatchSourcesRoute(req, res, deps) {
|
|
|
76919
76956
|
const delMatch = /^\/api\/sources\/roots\/([^/]+)$/.exec(pathname);
|
|
76920
76957
|
if (delMatch && method === "DELETE") {
|
|
76921
76958
|
const id = decodeURIComponent(delMatch[1] ?? "");
|
|
76922
|
-
const roots = readRoots().filter((r6) => r6.id !== id);
|
|
76923
|
-
writeRoots(roots);
|
|
76959
|
+
const roots = readRoots(configPath).filter((r6) => r6.id !== id);
|
|
76960
|
+
writeRoots(configPath, roots);
|
|
76924
76961
|
sendJson(res, { ok: true });
|
|
76925
76962
|
return true;
|
|
76926
76963
|
}
|
|
@@ -76938,7 +76975,7 @@ async function dispatchSourcesRoute(req, res, deps) {
|
|
|
76938
76975
|
sendJson(res, { error: "path is required" }, 400);
|
|
76939
76976
|
return true;
|
|
76940
76977
|
}
|
|
76941
|
-
const abs = safeResolveInside2(target, readRoots());
|
|
76978
|
+
const abs = safeResolveInside2(target, readRoots(configPath));
|
|
76942
76979
|
if (!abs) {
|
|
76943
76980
|
sendJson(res, { error: "path is outside any registered source root" }, 403);
|
|
76944
76981
|
return true;
|
|
@@ -76953,7 +76990,7 @@ async function dispatchSourcesRoute(req, res, deps) {
|
|
|
76953
76990
|
if (pathname === "/api/sources/ingest-folder" && method === "POST") {
|
|
76954
76991
|
const body = await readJson(req).catch(() => ({}));
|
|
76955
76992
|
const target = typeof body.path === "string" ? body.path : "";
|
|
76956
|
-
const abs = safeResolveInside2(target, readRoots());
|
|
76993
|
+
const abs = safeResolveInside2(target, readRoots(configPath));
|
|
76957
76994
|
if (!abs) {
|
|
76958
76995
|
sendJson(res, { error: "path is outside any registered source root" }, 403);
|
|
76959
76996
|
return true;
|
|
@@ -76967,7 +77004,7 @@ async function dispatchSourcesRoute(req, res, deps) {
|
|
|
76967
77004
|
// src/gui/import-routes.ts
|
|
76968
77005
|
init_adapter();
|
|
76969
77006
|
init_http();
|
|
76970
|
-
import { existsSync as
|
|
77007
|
+
import { existsSync as existsSync28, readFileSync as readFileSync24, statSync as statSync10 } from "fs";
|
|
76971
77008
|
import { isAbsolute as isAbsolute4, join as join30 } from "path";
|
|
76972
77009
|
init_native_entities();
|
|
76973
77010
|
function badRequest(message) {
|
|
@@ -77001,7 +77038,7 @@ async function readImportSourceFromFile(db, fileId, latticeRoot) {
|
|
|
77001
77038
|
);
|
|
77002
77039
|
if (!row) throw badRequest("Unknown import file: " + fileId);
|
|
77003
77040
|
const path3 = localPathOf2(row, latticeRoot);
|
|
77004
|
-
if (!path3 || !
|
|
77041
|
+
if (!path3 || !existsSync28(path3)) {
|
|
77005
77042
|
throw badRequest("The import file\u2019s bytes are not available locally.");
|
|
77006
77043
|
}
|
|
77007
77044
|
const sizeBytes = statSync10(path3).size;
|
|
@@ -79142,7 +79179,7 @@ init_dispatch();
|
|
|
79142
79179
|
init_column_descriptions();
|
|
79143
79180
|
init_mutations();
|
|
79144
79181
|
init_native_entities();
|
|
79145
|
-
import { createReadStream as createReadStream3, existsSync as
|
|
79182
|
+
import { createReadStream as createReadStream3, existsSync as existsSync29, realpathSync as realpathSync2, statSync as statSync11 } from "fs";
|
|
79146
79183
|
import { extname as extname3, join as join31, normalize as normalize2, sep as sep9 } from "path";
|
|
79147
79184
|
|
|
79148
79185
|
// src/gui/count-many.ts
|
|
@@ -79350,7 +79387,7 @@ async function handleReadRoutes(req, res, ctx, deps) {
|
|
|
79350
79387
|
const base = deps.guiAssetsDir.replace(/[/\\]+$/, "");
|
|
79351
79388
|
const target = normalize2(join31(base, rel));
|
|
79352
79389
|
const within = target === base || target.startsWith(base + sep9);
|
|
79353
|
-
if (!within || !
|
|
79390
|
+
if (!within || !existsSync29(target) || !statSync11(target).isFile()) {
|
|
79354
79391
|
sendJson(res, { error: "asset not found" }, 404);
|
|
79355
79392
|
return true;
|
|
79356
79393
|
}
|
|
@@ -80558,16 +80595,16 @@ async function handleHistoryRoutes(req, res, ctx, deps) {
|
|
|
80558
80595
|
// src/gui/workspaces-routes.ts
|
|
80559
80596
|
init_http();
|
|
80560
80597
|
import { resolve as resolve13 } from "path";
|
|
80561
|
-
import { existsSync as
|
|
80598
|
+
import { existsSync as existsSync30, rmSync as rmSync2 } from "fs";
|
|
80562
80599
|
init_workspace();
|
|
80563
80600
|
init_lattice_root();
|
|
80564
80601
|
init_user_config();
|
|
80565
80602
|
function cleanupWorkspaceFiles(root6, ws) {
|
|
80566
80603
|
if (!ws.configPath && ws.kind === "local") {
|
|
80567
|
-
|
|
80604
|
+
rmSync2(workspaceDir(root6, ws.dir), { recursive: true, force: true });
|
|
80568
80605
|
} else if (ws.kind === "cloud") {
|
|
80569
|
-
if (ws.configPath &&
|
|
80570
|
-
|
|
80606
|
+
if (ws.configPath && existsSync30(ws.configPath)) {
|
|
80607
|
+
rmSync2(ws.configPath, { force: true });
|
|
80571
80608
|
}
|
|
80572
80609
|
const labelMatch = /^\$\{LATTICE_DB:([A-Za-z0-9._-]+)\}$/.exec(ws.db.trim());
|
|
80573
80610
|
const label = labelMatch?.[1];
|
|
@@ -80770,15 +80807,15 @@ async function handleWorkspacesRoutes(req, res, ctx, deps) {
|
|
|
80770
80807
|
// src/gui/databases-routes.ts
|
|
80771
80808
|
init_http();
|
|
80772
80809
|
import { basename as basename14, resolve as resolve15 } from "path";
|
|
80773
|
-
import { existsSync as
|
|
80810
|
+
import { existsSync as existsSync32 } from "fs";
|
|
80774
80811
|
init_parser();
|
|
80775
80812
|
|
|
80776
80813
|
// src/gui/config-paths.ts
|
|
80777
80814
|
init_parser();
|
|
80778
|
-
import { basename as basename13, dirname as
|
|
80815
|
+
import { basename as basename13, dirname as dirname17, join as join32, resolve as resolve14 } from "path";
|
|
80779
80816
|
import {
|
|
80780
|
-
existsSync as
|
|
80781
|
-
mkdirSync as
|
|
80817
|
+
existsSync as existsSync31,
|
|
80818
|
+
mkdirSync as mkdirSync13,
|
|
80782
80819
|
readFileSync as readFileSync25,
|
|
80783
80820
|
readdirSync as readdirSync9,
|
|
80784
80821
|
unlinkSync as unlinkSync5,
|
|
@@ -80786,10 +80823,10 @@ import {
|
|
|
80786
80823
|
} from "fs";
|
|
80787
80824
|
import { parseDocument as parseDocument7 } from "yaml";
|
|
80788
80825
|
function resolveOutputDirForConfig(configPath) {
|
|
80789
|
-
const base =
|
|
80826
|
+
const base = dirname17(resolve14(configPath));
|
|
80790
80827
|
for (const dir of ["context", ".", "generated"]) {
|
|
80791
80828
|
const abs = resolve14(base, dir);
|
|
80792
|
-
if (
|
|
80829
|
+
if (existsSync31(join32(abs, ".lattice", "manifest.json"))) return abs;
|
|
80793
80830
|
}
|
|
80794
80831
|
return resolve14(base, "context");
|
|
80795
80832
|
}
|
|
@@ -80798,7 +80835,7 @@ function friendlyConfigName(parsedName, configPath) {
|
|
|
80798
80835
|
return basename13(configPath).replace(/\.(ya?ml)$/, "");
|
|
80799
80836
|
}
|
|
80800
80837
|
function listConfigs(activeConfigPath) {
|
|
80801
|
-
const dir =
|
|
80838
|
+
const dir = dirname17(activeConfigPath);
|
|
80802
80839
|
const entries = [];
|
|
80803
80840
|
for (const fname of readdirSync9(dir)) {
|
|
80804
80841
|
if (!fname.endsWith(".yml") && !fname.endsWith(".yaml")) continue;
|
|
@@ -80827,17 +80864,17 @@ function listConfigs(activeConfigPath) {
|
|
|
80827
80864
|
return entries.sort((a6, b6) => a6.label.localeCompare(b6.label));
|
|
80828
80865
|
}
|
|
80829
80866
|
function createBlankConfig(activeConfigPath, dbName) {
|
|
80830
|
-
const dir =
|
|
80867
|
+
const dir = dirname17(activeConfigPath);
|
|
80831
80868
|
const slug = dbName.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
80832
80869
|
if (!slug) throw new Error("Workspace name must contain at least one alphanumeric character");
|
|
80833
80870
|
const configPath = join32(dir, `${slug}.config.yml`);
|
|
80834
|
-
if (
|
|
80871
|
+
if (existsSync31(configPath)) throw new Error(`Config already exists: ${slug}.config.yml`);
|
|
80835
80872
|
const yaml = `db: ./data/${slug}.db
|
|
80836
80873
|
|
|
80837
80874
|
entities: {}
|
|
80838
80875
|
`;
|
|
80839
80876
|
writeFileSync11(configPath, yaml, "utf8");
|
|
80840
|
-
|
|
80877
|
+
mkdirSync13(join32(dir, "data"), { recursive: true });
|
|
80841
80878
|
return configPath;
|
|
80842
80879
|
}
|
|
80843
80880
|
function sqliteFileForConfig(configPath) {
|
|
@@ -80846,18 +80883,18 @@ function sqliteFileForConfig(configPath) {
|
|
|
80846
80883
|
if (!raw) return null;
|
|
80847
80884
|
if (isPostgresUrl(raw) || raw.startsWith("${LATTICE_DB:")) return null;
|
|
80848
80885
|
if (raw === ":memory:" || raw.startsWith("file:")) return null;
|
|
80849
|
-
return resolve14(
|
|
80886
|
+
return resolve14(dirname17(configPath), raw);
|
|
80850
80887
|
}
|
|
80851
80888
|
function deleteDatabaseFiles(targetConfigPath) {
|
|
80852
80889
|
const sqliteFile = sqliteFileForConfig(targetConfigPath);
|
|
80853
80890
|
unlinkSync5(targetConfigPath);
|
|
80854
80891
|
let deletedDbFile = null;
|
|
80855
|
-
if (sqliteFile &&
|
|
80892
|
+
if (sqliteFile && existsSync31(sqliteFile)) {
|
|
80856
80893
|
unlinkSync5(sqliteFile);
|
|
80857
80894
|
deletedDbFile = sqliteFile;
|
|
80858
80895
|
for (const suffix of ["-wal", "-shm", "-journal"]) {
|
|
80859
80896
|
const sidecar = sqliteFile + suffix;
|
|
80860
|
-
if (
|
|
80897
|
+
if (existsSync31(sidecar)) unlinkSync5(sidecar);
|
|
80861
80898
|
}
|
|
80862
80899
|
}
|
|
80863
80900
|
return { deletedConfig: basename13(targetConfigPath), deletedDbFile };
|
|
@@ -80891,7 +80928,7 @@ async function handleDatabasesRoutes(req, res, ctx, deps) {
|
|
|
80891
80928
|
return true;
|
|
80892
80929
|
}
|
|
80893
80930
|
const newPath = resolve15(body.path);
|
|
80894
|
-
if (!
|
|
80931
|
+
if (!existsSync32(newPath)) {
|
|
80895
80932
|
sendJson(res, { error: `Config not found: ${newPath}` }, 400);
|
|
80896
80933
|
return true;
|
|
80897
80934
|
}
|
|
@@ -80997,8 +81034,8 @@ async function handleDatabasesRoutes(req, res, ctx, deps) {
|
|
|
80997
81034
|
// src/gui/server.ts
|
|
80998
81035
|
init_user_config();
|
|
80999
81036
|
function resolveDefaultGuiAssetsDir() {
|
|
81000
|
-
const bundleSibling = process.argv[1] ? resolve16(
|
|
81001
|
-
if (bundleSibling &&
|
|
81037
|
+
const bundleSibling = process.argv[1] ? resolve16(dirname18(process.argv[1]), "gui-assets") : null;
|
|
81038
|
+
if (bundleSibling && existsSync33(bundleSibling)) return bundleSibling;
|
|
81002
81039
|
return resolve16(process.cwd(), "dist", "gui-assets");
|
|
81003
81040
|
}
|
|
81004
81041
|
function sendText(res, body, status = 200, contentType = "text/plain; charset=utf-8") {
|
|
@@ -81055,7 +81092,7 @@ async function startGuiServer(options) {
|
|
|
81055
81092
|
const sessionId = crypto.randomUUID();
|
|
81056
81093
|
let updateService = null;
|
|
81057
81094
|
let activeRef = bootConfigPath && bootOutputDir ? await openConfig(bootConfigPath, bootOutputDir, autoRender, options.realtimeWatchdogMs) : null;
|
|
81058
|
-
const latticeRoot = (bootConfigPath ? findLatticeRoot(
|
|
81095
|
+
const latticeRoot = (bootConfigPath ? findLatticeRoot(dirname18(bootConfigPath)) : null) ?? (options.latticeRoot ? resolve16(options.latticeRoot) : null);
|
|
81059
81096
|
let currentWorkspaceId = null;
|
|
81060
81097
|
if (latticeRoot && bootConfigPath) {
|
|
81061
81098
|
const launched = listWorkspaces(latticeRoot).find(
|
|
@@ -81409,7 +81446,7 @@ async function startGuiServer(options) {
|
|
|
81409
81446
|
createJunction: (otherTable) => createFileJunction(active, otherTable, sessionId),
|
|
81410
81447
|
createEntity: (entity, columns) => createUserEntity(active, entity, columns, sessionId),
|
|
81411
81448
|
aggressiveness: getAggressiveness(),
|
|
81412
|
-
latticeRoot:
|
|
81449
|
+
latticeRoot: dirname18(active.configPath),
|
|
81413
81450
|
configPath: active.configPath,
|
|
81414
81451
|
outputDir: active.outputDir,
|
|
81415
81452
|
sessionId,
|
|
@@ -81434,7 +81471,7 @@ async function startGuiServer(options) {
|
|
|
81434
81471
|
createJunction: (otherTable) => createFileJunction(active, otherTable, sessionId),
|
|
81435
81472
|
createEntity: (entity, columns) => createUserEntity(active, entity, columns, sessionId),
|
|
81436
81473
|
aggressiveness: getAggressiveness(),
|
|
81437
|
-
latticeRoot:
|
|
81474
|
+
latticeRoot: dirname18(active.configPath),
|
|
81438
81475
|
configPath: active.configPath,
|
|
81439
81476
|
outputDir: active.outputDir,
|
|
81440
81477
|
sessionId,
|
|
@@ -81445,6 +81482,7 @@ async function startGuiServer(options) {
|
|
|
81445
81482
|
return await dispatchSourcesRoute(req2, res2, {
|
|
81446
81483
|
db: active.db,
|
|
81447
81484
|
ingestFile: (p3) => ingestLocalFile(ingestCtx, mctx, p3, false),
|
|
81485
|
+
configPath: active.configPath,
|
|
81448
81486
|
pathname,
|
|
81449
81487
|
method
|
|
81450
81488
|
});
|
|
@@ -81460,7 +81498,7 @@ async function startGuiServer(options) {
|
|
|
81460
81498
|
return await dispatchImportRoute(req2, res2, {
|
|
81461
81499
|
db: active.db,
|
|
81462
81500
|
configPath: active.configPath,
|
|
81463
|
-
latticeRoot:
|
|
81501
|
+
latticeRoot: dirname18(active.configPath),
|
|
81464
81502
|
validTables: active.validTables,
|
|
81465
81503
|
softDeletable: active.softDeletable
|
|
81466
81504
|
});
|
|
@@ -81489,7 +81527,7 @@ async function startGuiServer(options) {
|
|
|
81489
81527
|
if (!pathname.startsWith("/api/files/")) return false;
|
|
81490
81528
|
return await dispatchFilesRoute(req2, res2, {
|
|
81491
81529
|
db: active.db,
|
|
81492
|
-
latticeRoot:
|
|
81530
|
+
latticeRoot: dirname18(active.configPath),
|
|
81493
81531
|
configPath: active.configPath,
|
|
81494
81532
|
pathname,
|
|
81495
81533
|
method
|
|
@@ -81982,7 +82020,7 @@ function printHelp() {
|
|
|
81982
82020
|
);
|
|
81983
82021
|
}
|
|
81984
82022
|
function getVersion() {
|
|
81985
|
-
if (true) return "4.3.
|
|
82023
|
+
if (true) return "4.3.2";
|
|
81986
82024
|
try {
|
|
81987
82025
|
const pkgPath = new URL("../package.json", import.meta.url).pathname;
|
|
81988
82026
|
const pkg = JSON.parse(readFileSync26(pkgPath, "utf-8"));
|
|
@@ -81996,7 +82034,7 @@ function printVersion() {
|
|
|
81996
82034
|
}
|
|
81997
82035
|
function getGuiAssetsDir() {
|
|
81998
82036
|
const fromBundle = new URL("./gui-assets", import.meta.url).pathname;
|
|
81999
|
-
if (
|
|
82037
|
+
if (existsSync34(fromBundle)) return fromBundle;
|
|
82000
82038
|
return new URL("../dist/gui-assets", import.meta.url).pathname;
|
|
82001
82039
|
}
|
|
82002
82040
|
async function runUpdate() {
|
|
@@ -82040,7 +82078,7 @@ function runGenerate(args) {
|
|
|
82040
82078
|
console.error('Error: config must have an "entities" key');
|
|
82041
82079
|
process.exit(1);
|
|
82042
82080
|
}
|
|
82043
|
-
const configDir2 =
|
|
82081
|
+
const configDir2 = dirname19(configPath);
|
|
82044
82082
|
const outDir = resolve17(args.out);
|
|
82045
82083
|
try {
|
|
82046
82084
|
const result = generateAll({ config, configDir: configDir2, outDir, scaffold: args.scaffold });
|