fix(objects): refresh event editor on selection and fix docs-export manifest

This commit is contained in:
miracle authored and GitHub committed 2026-08-24 18:35:17 +08:00
1 parent c1888a2364
commit eaad88cc80
6 files changed
+25 -13

No files matched your search

+8 -6
View File
@@ -7,6 +7,7 @@ import tailwindcss from "@tailwindcss/vite";
import { connectionTypesPlugin } from "./viteConnectionTypesPlugin.ts";
const repoRoot = path.resolve(__dirname, "../..");
const normalizedRepoRoot = repoRoot.replaceAll(path.sep, "/");
const assetsDir = path.join(repoRoot, "crates/dbx-core/assets");
const fontPath = path.join(__dirname, "public/fonts/geist-latin-wght-normal.woff2");
@@ -86,25 +87,26 @@ function exportBundlePlugin() {
// Vite tags CSS the same way. The file on disk is the part before the
// query; without stripping it every SFC would be missing from the
// manifest, which is the failure this whole derivation exists to avoid.
const id = rawId.split("?")[0];
const id = path.resolve(rawId.split("?")[0]);
if (!path.isAbsolute(id)) return;
const normalizedId = id.replaceAll(path.sep, "/");
// `lastIndexOf`: under pnpm a real path is
// `<root>/node_modules/.pnpm/marked@18.0.4/node_modules/marked/…`, and
// the FIRST occurrence yields the package name `.pnpm`.
const nodeModules = id.lastIndexOf("/node_modules/");
const nodeModules = normalizedId.lastIndexOf("/node_modules/");
if (nodeModules !== -1) {
const after = id.slice(nodeModules + "/node_modules/".length);
const after = normalizedId.slice(nodeModules + "/node_modules/".length);
const name = after.startsWith("@") ? after.split("/").slice(0, 2).join("/") : after.split("/")[0];
if (name in deps) return;
const manifest = path.join(id.slice(0, nodeModules), "node_modules", name, "package.json");
const manifest = path.join(normalizedId.slice(0, nodeModules), "node_modules", name, "package.json");
if (!isFile(manifest)) return;
deps[name] = JSON.parse(readFileSync(manifest, "utf8")).version;
return;
}
if (!id.startsWith(repoRoot) || !isFile(id)) return;
sources[path.relative(repoRoot, id)] = sha256(readFileSync(id));
if (!normalizedId.startsWith(normalizedRepoRoot) || !isFile(id)) return;
sources[path.relative(repoRoot, id).replaceAll(path.sep, "/")] = sha256(readFileSync(id));
};
const stylesheets = new Set<string>();