mirror of
https://github.com/andre482/O-tie.git
synced 2026-07-22 07:44:11 +00:00
- Single-finger touch panning now works even when starting on a node; a tap still selects. - Add keyboard node selection (Tab/Enter/Space/Escape) and validated settings input. - Guard against overwriting malformed .bowtie files; show a notice and keep original data. - Add Vitest tests (model/layout/panZoom) and a GitHub Actions CI workflow. - Split bowtieView into history/panZoom/stackRows/externalSync modules; refresh README, examples, and contributor docs. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
980 B
JavaScript
34 lines
980 B
JavaScript
// Bundles the plugin's pure layout/model TypeScript so Node scripts can use it.
|
|
import { build } from "esbuild";
|
|
import { rmSync, writeFileSync } from "node:fs";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
|
const scriptsDir = dirname(fileURLToPath(import.meta.url));
|
|
const root = join(scriptsDir, "..");
|
|
|
|
export async function loadEngine() {
|
|
const result = await build({
|
|
stdin: {
|
|
contents: `
|
|
export { layoutBowtie, DEFAULT_LAYOUT, barrierHeaderHeightFor } from "./src/layout";
|
|
export * as model from "./src/model";
|
|
`,
|
|
resolveDir: root,
|
|
loader: "ts",
|
|
sourcefile: "engine-entry.ts",
|
|
},
|
|
bundle: true,
|
|
format: "esm",
|
|
platform: "node",
|
|
write: false,
|
|
logLevel: "silent",
|
|
});
|
|
const tmp = join(scriptsDir, `_engine-${process.pid}.mjs`);
|
|
writeFileSync(tmp, result.outputFiles[0].text);
|
|
try {
|
|
return await import(pathToFileURL(tmp).href);
|
|
} finally {
|
|
rmSync(tmp, { force: true });
|
|
}
|
|
}
|