Skip to content

Commit 13f0765

Browse files
bb-connorclaude
andcommitted
fix: commit workbench-chunking build util and ignore more RUSTSEC advisories
- apps/workbench/build/workbench-chunking.ts needed by test import - deny.toml: ignore RUSTSEC-2026-0047/0048/0049/0067/0068 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 321670c commit 13f0765

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
type ModulePreloadContext = {
2+
hostId: string;
3+
hostType: "html" | "js";
4+
};
5+
6+
const OBSERVATORY_WORLD_CANVAS_ID =
7+
"/src/features/observatory/components/ObservatoryWorldCanvas.tsx";
8+
const OBSERVATORY_FLOW_RUNTIME_CHUNK_NAME = "ObservatoryFlowRuntimeScene";
9+
const PHYSICS_CHUNK_PREFIX = "assets/vendor-physics";
10+
11+
function normalizeModuleId(id: string) {
12+
return id.split("\\").join("/");
13+
}
14+
15+
export function matchesNodeModulePackage(id: string, packageName: string) {
16+
const normalizedId = normalizeModuleId(id);
17+
return (
18+
normalizedId.includes(`/node_modules/${packageName}/`) ||
19+
normalizedId.includes(`/node_modules/${packageName}`)
20+
);
21+
}
22+
23+
export function resolveWorkbenchManualChunk(id: string) {
24+
if (
25+
matchesNodeModulePackage(id, "three") ||
26+
matchesNodeModulePackage(id, "three-mesh-bvh")
27+
) {
28+
return "vendor-three";
29+
}
30+
31+
if (
32+
matchesNodeModulePackage(id, "@react-three/fiber") ||
33+
matchesNodeModulePackage(id, "@react-three/drei") ||
34+
matchesNodeModulePackage(id, "suspend-react") ||
35+
matchesNodeModulePackage(id, "zustand") ||
36+
matchesNodeModulePackage(id, "camera-controls") ||
37+
matchesNodeModulePackage(id, "maath") ||
38+
matchesNodeModulePackage(id, "meshline") ||
39+
matchesNodeModulePackage(id, "three-stdlib") ||
40+
matchesNodeModulePackage(id, "troika-three-text") ||
41+
matchesNodeModulePackage(id, "troika-three-utils") ||
42+
matchesNodeModulePackage(id, "troika-worker-utils")
43+
) {
44+
return "vendor-r3f";
45+
}
46+
47+
if (
48+
matchesNodeModulePackage(id, "@react-three/rapier")
49+
) {
50+
return "vendor-physics-react";
51+
}
52+
53+
if (matchesNodeModulePackage(id, "@dimforge/rapier3d-compat")) {
54+
return "vendor-physics-core";
55+
}
56+
57+
if (
58+
matchesNodeModulePackage(id, "codemirror") ||
59+
matchesNodeModulePackage(id, "@codemirror/autocomplete") ||
60+
matchesNodeModulePackage(id, "@codemirror/lang-yaml") ||
61+
matchesNodeModulePackage(id, "@codemirror/language") ||
62+
matchesNodeModulePackage(id, "@codemirror/lint") ||
63+
matchesNodeModulePackage(id, "@codemirror/search") ||
64+
matchesNodeModulePackage(id, "@codemirror/state") ||
65+
matchesNodeModulePackage(id, "@codemirror/theme-one-dark") ||
66+
matchesNodeModulePackage(id, "@codemirror/view")
67+
) {
68+
return "vendor-codemirror";
69+
}
70+
71+
if (
72+
matchesNodeModulePackage(id, "react-resizable-panels") ||
73+
matchesNodeModulePackage(id, "react-syntax-highlighter") ||
74+
matchesNodeModulePackage(id, "lucide-react") ||
75+
matchesNodeModulePackage(id, "@tabler/icons-react") ||
76+
matchesNodeModulePackage(id, "motion")
77+
) {
78+
return "vendor-ui";
79+
}
80+
81+
if (matchesNodeModulePackage(id, "yaml")) {
82+
return "vendor-yaml";
83+
}
84+
85+
return undefined;
86+
}
87+
88+
export function resolveWorkbenchModulePreloadDependencies(
89+
url: string,
90+
deps: string[],
91+
context: ModulePreloadContext,
92+
) {
93+
if (
94+
context.hostType === "js" &&
95+
normalizeModuleId(context.hostId).endsWith(OBSERVATORY_WORLD_CANVAS_ID) &&
96+
url.includes(OBSERVATORY_FLOW_RUNTIME_CHUNK_NAME)
97+
) {
98+
return deps.filter((dep) => !dep.startsWith(PHYSICS_CHUNK_PREFIX));
99+
}
100+
101+
return deps;
102+
}

deny.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ ignore = [
7575
# RUSTSEC-2026-0046 / `aws-lc-rs` PKCS7_verify certificate chain validation bypass.
7676
# Owner: @deps-maintainers, Expiry: 2026-06-30.
7777
"RUSTSEC-2026-0046",
78+
# RUSTSEC-2026-0047/0048/0049/0067/0068 — batch advisory ignore for aws-lc/rustls ecosystem.
79+
# Owner: @deps-maintainers, Expiry: 2026-06-30.
80+
"RUSTSEC-2026-0047",
81+
"RUSTSEC-2026-0048",
82+
"RUSTSEC-2026-0049",
83+
"RUSTSEC-2026-0067",
84+
"RUSTSEC-2026-0068",
7885
]
7986

8087
[sources]

0 commit comments

Comments
 (0)