Files
PozzettiAndrea 7947ff3f23 Vendor viewer JS, drop comfy-3d-viewers
Vendor the viewer JavaScript into javascript/ and drop the
comfy-3d-viewers dependency. The viewers were previously copied into web/ at
every startup by prestartup_script.py, which made the served frontend depend on
a second package resolving at runtime.

Bundles are vendored as .mjs so ComfyUI's **/*.js auto-import glob skips them:
they are iframe-only and must never enter the shared main browser realm. Only
the widget entry points stay .js.

Also replace comfy_env.copy_files with a local helper. Its two extra features
(frame-derived source dir, silent no-op on a missing source) were unused here,
and the asset seeding now resolves the input directory through
folder_paths.get_input_directory() so it follows ComfyUI Desktop and
--input-directory instead of writing into the code tree.

comfy-test.toml moves to the current schema: [test.workflows] cuda (there is no
"gpu" key -- the accelerator is named by backend, and the old spelling parsed to
an empty list, so CUDA runners silently ran the full unfiltered set), an
explicit [test.platforms] platforms allowlist (per-platform booleans are no
longer supported), and the javascript level.

DisplayName becomes "DepthAnythingV3": the namespace enforced on
registerExtension names is derived from it, and the space in "Depth Anything
V3" made that prefix invalid.

Delete the 21 loose js/viewer/*.js modules -- they are already inside
viewer-bundle-vtk.mjs, so shipping them loose leaked the whole viewer into the
shared realm.
2026-08-22 19:44:03 +02:00

20 lines
636 B
JavaScript

/**
* Auto-detect extension folder name from import.meta.url
* Handles both ComfyUI-GeometryPack and comfyui-geometrypack (lowercase)
*/
export const EXTENSION_FOLDER = (() => {
const url = import.meta.url;
const match = url.match(/\/extensions\/([^/]+)\//);
return match ? match[1] : "ComfyUI-GeometryPack";
})();
/**
* Build a viewer URL with cache buster
* @param {string} viewerName - Name of the viewer HTML file (e.g., "viewer_vtk")
* @returns {string} Full URL with cache buster
*/
export function getViewerUrl(viewerName) {
return `/extensions/${EXTENSION_FOLDER}/${viewerName}.html?v=` + Date.now();
}