Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

922 B
Raw Blame
import test from 'node:test';import assert from 'node:assert/strict';import {parse} from 'acorn';import {preserveSourceModuleUrl} from '../scripts/source-module-url.mjs';
test('bundling preserves plain and computed module URLs without replacing comments or literal text',()=>{const source="// import.meta.url\nconst text='import.meta.url';export const a=new URL('./',import.meta.url),b=new URL('./',import.meta['url']);",result=preserveSourceModuleUrl(source,'runtime/landing-v11/controller.mjs',parse),expression='new URL("runtime/landing-v11/controller.mjs", document.baseURI).href';assert.equal(result.split(expression).length-1,2);assert.ok(result.includes("// import.meta.url"));assert.ok(result.includes("'import.meta.url'"));assert.equal(new URL('./',new URL('runtime/landing-v11/controller.mjs','https://fixture.test/release/web/?backend=webgpu')).href,'https://fixture.test/release/web/runtime/landing-v11/');});