@absolutejs/absolute 0.19.0-beta.840 → 0.19.0-beta.842
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +57 -54
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +57 -54
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +1618 -429
- package/dist/build.js.map +24 -16
- package/dist/cli/index.js +4 -2
- package/dist/dev/client/errorOverlay.ts +5 -7
- package/dist/index.js +1671 -477
- package/dist/index.js.map +26 -18
- package/dist/react/index.js +57 -53
- package/dist/react/index.js.map +6 -6
- package/dist/react/server.js +57 -53
- package/dist/react/server.js.map +6 -6
- package/dist/src/build/buildEmberVendor.d.ts +24 -0
- package/dist/src/build/compileEmber.d.ts +43 -0
- package/dist/src/build/vendorEntrySource.d.ts +1 -26
- package/dist/src/build/vueAutoRouterTransform.d.ts +1 -0
- package/dist/src/core/devVendorPaths.d.ts +2 -0
- package/dist/src/dev/configResolver.d.ts +1 -0
- package/dist/src/dev/pathUtils.d.ts +1 -1
- package/dist/src/ember/browser.d.ts +24 -0
- package/dist/src/ember/index.d.ts +2 -0
- package/dist/src/ember/pageHandler.d.ts +35 -0
- package/dist/src/ember/server.d.ts +2 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/vue/browser.d.ts +2 -0
- package/dist/src/vue/defineVuePage.d.ts +5 -0
- package/dist/src/vue/index.d.ts +2 -0
- package/dist/svelte/index.js +57 -53
- package/dist/svelte/index.js.map +5 -5
- package/dist/svelte/router/Router.svelte +1 -3
- package/dist/svelte/server.js +57 -53
- package/dist/svelte/server.js.map +5 -5
- package/dist/types/build.d.ts +1 -0
- package/dist/types/conventions.d.ts +1 -0
- package/dist/types/ember.d.ts +41 -0
- package/dist/types/island.d.ts +3 -2
- package/dist/types/vue.d.ts +28 -1
- package/dist/vue/browser.js +4 -1
- package/dist/vue/browser.js.map +5 -4
- package/dist/vue/index.js +62 -53
- package/dist/vue/index.js.map +7 -6
- package/dist/vue/server.js +59 -53
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -9397,11 +9397,13 @@ var exports_devVendorPaths = {};
|
|
|
9397
9397
|
__export(exports_devVendorPaths, {
|
|
9398
9398
|
setVueVendorPaths: () => setVueVendorPaths,
|
|
9399
9399
|
setSvelteVendorPaths: () => setSvelteVendorPaths,
|
|
9400
|
+
setEmberVendorPaths: () => setEmberVendorPaths,
|
|
9400
9401
|
setDevVendorPaths: () => setDevVendorPaths,
|
|
9401
9402
|
setAngularVendorPaths: () => setAngularVendorPaths,
|
|
9402
9403
|
setAngularServerVendorPaths: () => setAngularServerVendorPaths,
|
|
9403
9404
|
getVueVendorPaths: () => getVueVendorPaths,
|
|
9404
9405
|
getSvelteVendorPaths: () => getSvelteVendorPaths,
|
|
9406
|
+
getEmberVendorPaths: () => getEmberVendorPaths,
|
|
9405
9407
|
getDevVendorPaths: () => getDevVendorPaths,
|
|
9406
9408
|
getAngularVendorPaths: () => getAngularVendorPaths,
|
|
9407
9409
|
getAngularServerVendorPaths: () => getAngularServerVendorPaths
|
|
@@ -9416,6 +9418,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
9416
9418
|
svelteVendorPaths = paths;
|
|
9417
9419
|
}, vueVendorPaths = null, getVueVendorPaths = () => vueVendorPaths, setVueVendorPaths = (paths) => {
|
|
9418
9420
|
vueVendorPaths = paths;
|
|
9421
|
+
}, emberVendorPaths = null, getEmberVendorPaths = () => emberVendorPaths, setEmberVendorPaths = (paths) => {
|
|
9422
|
+
emberVendorPaths = paths;
|
|
9419
9423
|
};
|
|
9420
9424
|
|
|
9421
9425
|
// src/build/angularLinkerPlugin.ts
|
|
@@ -10157,6 +10161,57 @@ var init_compileSvelte = __esm(() => {
|
|
|
10157
10161
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
10158
10162
|
});
|
|
10159
10163
|
|
|
10164
|
+
// src/build/vueAutoRouterTransform.ts
|
|
10165
|
+
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL = "__ABSOLUTE_AUTO_ROUTER__", SETUP_APP_DECLARATION_REGEX, SETUP_APP_FUNCTION_REGEX, addAutoRouterSetupApp = (sourceContent) => {
|
|
10166
|
+
if (!ROUTES_EXPORT_REGEX.test(sourceContent))
|
|
10167
|
+
return sourceContent;
|
|
10168
|
+
const match = SCRIPT_REGEX.exec(sourceContent);
|
|
10169
|
+
if (!match)
|
|
10170
|
+
return sourceContent;
|
|
10171
|
+
const [, openTag, scriptBody, closeTag] = match;
|
|
10172
|
+
if (!openTag || scriptBody === undefined || !closeTag)
|
|
10173
|
+
return sourceContent;
|
|
10174
|
+
if (scriptBody.includes(SENTINEL))
|
|
10175
|
+
return sourceContent;
|
|
10176
|
+
let rewrittenScript = scriptBody.replace(SETUP_APP_DECLARATION_REGEX, "const __absoluteUserSetupApp__");
|
|
10177
|
+
rewrittenScript = rewrittenScript.replace(SETUP_APP_FUNCTION_REGEX, "$1 __absoluteUserSetupApp__");
|
|
10178
|
+
const userHadSetupApp = rewrittenScript !== scriptBody;
|
|
10179
|
+
const autoWrapper = `
|
|
10180
|
+
// ${SENTINEL} \u2014 generated by AbsoluteJS because this page exports
|
|
10181
|
+
// \`routes\`. Owns the vue-router lifecycle (history pick, app.use,
|
|
10182
|
+
// push, isReady) so user code stays declarative.
|
|
10183
|
+
import {
|
|
10184
|
+
createRouter as __absoluteCreateRouter__,
|
|
10185
|
+
createMemoryHistory as __absoluteCreateMemoryHistory__,
|
|
10186
|
+
createWebHistory as __absoluteCreateWebHistory__,
|
|
10187
|
+
} from 'vue-router';
|
|
10188
|
+
${userHadSetupApp ? "" : "const __absoluteUserSetupApp__ = null;"}
|
|
10189
|
+
export const setupApp = async (app, ctx) => {
|
|
10190
|
+
const router = __absoluteCreateRouter__({
|
|
10191
|
+
history: ctx.isServer
|
|
10192
|
+
? __absoluteCreateMemoryHistory__()
|
|
10193
|
+
: __absoluteCreateWebHistory__(),
|
|
10194
|
+
routes,
|
|
10195
|
+
});
|
|
10196
|
+
app.use(router);
|
|
10197
|
+
if (ctx.isServer) {
|
|
10198
|
+
await router.push(ctx.url);
|
|
10199
|
+
}
|
|
10200
|
+
await router.isReady();
|
|
10201
|
+
if (__absoluteUserSetupApp__) {
|
|
10202
|
+
await __absoluteUserSetupApp__(app, { ...ctx, router });
|
|
10203
|
+
}
|
|
10204
|
+
};
|
|
10205
|
+
`;
|
|
10206
|
+
return sourceContent.replace(SCRIPT_REGEX, `${openTag}${rewrittenScript}${autoWrapper}${closeTag}`);
|
|
10207
|
+
};
|
|
10208
|
+
var init_vueAutoRouterTransform = __esm(() => {
|
|
10209
|
+
SCRIPT_REGEX = /(<script\b(?![^>]*\bsetup\b)[^>]*>)([\s\S]*?)(<\/script>)/;
|
|
10210
|
+
ROUTES_EXPORT_REGEX = /\bexport\s+(?:const|let|var)\s+routes\b/;
|
|
10211
|
+
SETUP_APP_DECLARATION_REGEX = /\bexport\s+(const|let|var)\s+setupApp\b/;
|
|
10212
|
+
SETUP_APP_FUNCTION_REGEX = /\bexport\s+(async\s+function|function)\s+setupApp\b/;
|
|
10213
|
+
});
|
|
10214
|
+
|
|
10160
10215
|
// src/build/compileVue.ts
|
|
10161
10216
|
var exports_compileVue = {};
|
|
10162
10217
|
__export(exports_compileVue, {
|
|
@@ -10262,7 +10317,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10262
10317
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
10263
10318
|
const fileBaseName = basename5(sourceFilePath, ".vue");
|
|
10264
10319
|
const componentId = toKebab(fileBaseName);
|
|
10265
|
-
const
|
|
10320
|
+
const rawSourceContent = await file2(sourceFilePath).text();
|
|
10321
|
+
const sourceContent = isEntryPoint ? addAutoRouterSetupApp(rawSourceContent) : rawSourceContent;
|
|
10266
10322
|
const islandMetadataExports = buildIslandMetadataExports(sourceContent);
|
|
10267
10323
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
10268
10324
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
@@ -10279,7 +10335,11 @@ var resolveDevClientDir3 = () => {
|
|
|
10279
10335
|
const changeType = detectVueChangeType(sourceFilePath, descriptor);
|
|
10280
10336
|
vueHmrMetadata.set(sourceFilePath, { changeType, hmrId });
|
|
10281
10337
|
const scriptSource = descriptor.scriptSetup?.content ?? descriptor.script?.content ?? "";
|
|
10282
|
-
const
|
|
10338
|
+
const moduleScriptSource = descriptor.script?.content && descriptor.scriptSetup ? descriptor.script.content : "";
|
|
10339
|
+
const importPaths = [
|
|
10340
|
+
...extractImports(scriptSource),
|
|
10341
|
+
...extractImports(moduleScriptSource)
|
|
10342
|
+
];
|
|
10283
10343
|
const resolvedPackageVueImports = new Map;
|
|
10284
10344
|
const bareImports = importPaths.filter((p2) => !p2.startsWith(".") && !p2.startsWith("/"));
|
|
10285
10345
|
for (const importPath of bareImports) {
|
|
@@ -10480,16 +10540,26 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10480
10540
|
'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty);',
|
|
10481
10541
|
"const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
|
|
10482
10542
|
"",
|
|
10483
|
-
"//
|
|
10484
|
-
"//
|
|
10485
|
-
|
|
10486
|
-
"//
|
|
10543
|
+
"// `setupApp` hook. Reflect.get hides the lookup from Bun's",
|
|
10544
|
+
"// static analyzer so non-SPA pages without it don't trigger",
|
|
10545
|
+
'// "always undefined" warnings. Pages that export `routes`',
|
|
10546
|
+
"// have their setupApp auto-synthesized at compile time by",
|
|
10547
|
+
"// compileVue (see addAutoRouterSetupApp below) \u2014 that wrapper",
|
|
10548
|
+
"// uses the page-bundle's own vue-router instance so",
|
|
10549
|
+
"// provide/inject symbols match between the router and the",
|
|
10550
|
+
"// page's `useRoute()` calls.",
|
|
10551
|
+
'const setupAppHook = Reflect.get(PageModule, "setupApp");',
|
|
10487
10552
|
"async function bootstrapApp() {",
|
|
10488
|
-
' if (typeof
|
|
10553
|
+
' if (typeof setupAppHook === "function") {',
|
|
10489
10554
|
' const clientUrl = typeof window !== "undefined"',
|
|
10490
10555
|
" ? window.location.pathname + window.location.search",
|
|
10491
10556
|
' : "/";',
|
|
10492
|
-
" await
|
|
10557
|
+
" await setupAppHook(app, {",
|
|
10558
|
+
" isServer: false,",
|
|
10559
|
+
" router: null,",
|
|
10560
|
+
" setRedirect: () => {},",
|
|
10561
|
+
" url: clientUrl",
|
|
10562
|
+
" });",
|
|
10493
10563
|
" }",
|
|
10494
10564
|
' app.mount("#root");',
|
|
10495
10565
|
"}",
|
|
@@ -10598,6 +10668,7 @@ var init_compileVue = __esm(() => {
|
|
|
10598
10668
|
init_constants();
|
|
10599
10669
|
init_resolvePackageImport();
|
|
10600
10670
|
init_sourceMetadata();
|
|
10671
|
+
init_vueAutoRouterTransform();
|
|
10601
10672
|
init_stylePreprocessor();
|
|
10602
10673
|
devClientDir3 = resolveDevClientDir3();
|
|
10603
10674
|
hmrClientPath4 = join15(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
@@ -12273,31 +12344,723 @@ var init_compileAngular = __esm(() => {
|
|
|
12273
12344
|
wrapperOutputCache = new Map;
|
|
12274
12345
|
});
|
|
12275
12346
|
|
|
12347
|
+
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
12348
|
+
var require_content_tag = __commonJS((exports, module) => {
|
|
12349
|
+
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/content-tag/pkg/node";
|
|
12350
|
+
var imports = {};
|
|
12351
|
+
imports["__wbindgen_placeholder__"] = exports;
|
|
12352
|
+
var wasm;
|
|
12353
|
+
var { TextDecoder: TextDecoder2, TextEncoder: TextEncoder2 } = __require("util");
|
|
12354
|
+
var cachedTextDecoder = new TextDecoder2("utf-8", { ignoreBOM: true, fatal: true });
|
|
12355
|
+
cachedTextDecoder.decode();
|
|
12356
|
+
var cachedUint8ArrayMemory0 = null;
|
|
12357
|
+
function getUint8ArrayMemory0() {
|
|
12358
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
12359
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12360
|
+
}
|
|
12361
|
+
return cachedUint8ArrayMemory0;
|
|
12362
|
+
}
|
|
12363
|
+
function getStringFromWasm0(ptr2, len) {
|
|
12364
|
+
ptr2 = ptr2 >>> 0;
|
|
12365
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr2, ptr2 + len));
|
|
12366
|
+
}
|
|
12367
|
+
function debugString(val) {
|
|
12368
|
+
const type = typeof val;
|
|
12369
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
12370
|
+
return `${val}`;
|
|
12371
|
+
}
|
|
12372
|
+
if (type == "string") {
|
|
12373
|
+
return `"${val}"`;
|
|
12374
|
+
}
|
|
12375
|
+
if (type == "symbol") {
|
|
12376
|
+
const description = val.description;
|
|
12377
|
+
if (description == null) {
|
|
12378
|
+
return "Symbol";
|
|
12379
|
+
} else {
|
|
12380
|
+
return `Symbol(${description})`;
|
|
12381
|
+
}
|
|
12382
|
+
}
|
|
12383
|
+
if (type == "function") {
|
|
12384
|
+
const name = val.name;
|
|
12385
|
+
if (typeof name == "string" && name.length > 0) {
|
|
12386
|
+
return `Function(${name})`;
|
|
12387
|
+
} else {
|
|
12388
|
+
return "Function";
|
|
12389
|
+
}
|
|
12390
|
+
}
|
|
12391
|
+
if (Array.isArray(val)) {
|
|
12392
|
+
const length = val.length;
|
|
12393
|
+
let debug = "[";
|
|
12394
|
+
if (length > 0) {
|
|
12395
|
+
debug += debugString(val[0]);
|
|
12396
|
+
}
|
|
12397
|
+
for (let i = 1;i < length; i++) {
|
|
12398
|
+
debug += ", " + debugString(val[i]);
|
|
12399
|
+
}
|
|
12400
|
+
debug += "]";
|
|
12401
|
+
return debug;
|
|
12402
|
+
}
|
|
12403
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
12404
|
+
let className;
|
|
12405
|
+
if (builtInMatches.length > 1) {
|
|
12406
|
+
className = builtInMatches[1];
|
|
12407
|
+
} else {
|
|
12408
|
+
return toString.call(val);
|
|
12409
|
+
}
|
|
12410
|
+
if (className == "Object") {
|
|
12411
|
+
try {
|
|
12412
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
12413
|
+
} catch (_2) {
|
|
12414
|
+
return "Object";
|
|
12415
|
+
}
|
|
12416
|
+
}
|
|
12417
|
+
if (val instanceof Error) {
|
|
12418
|
+
return `${val.name}: ${val.message}
|
|
12419
|
+
${val.stack}`;
|
|
12420
|
+
}
|
|
12421
|
+
return className;
|
|
12422
|
+
}
|
|
12423
|
+
var WASM_VECTOR_LEN = 0;
|
|
12424
|
+
var cachedTextEncoder = new TextEncoder2("utf-8");
|
|
12425
|
+
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
12426
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
12427
|
+
} : function(arg, view) {
|
|
12428
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
12429
|
+
view.set(buf);
|
|
12430
|
+
return {
|
|
12431
|
+
read: arg.length,
|
|
12432
|
+
written: buf.length
|
|
12433
|
+
};
|
|
12434
|
+
};
|
|
12435
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
12436
|
+
if (realloc === undefined) {
|
|
12437
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
12438
|
+
const ptr3 = malloc(buf.length, 1) >>> 0;
|
|
12439
|
+
getUint8ArrayMemory0().subarray(ptr3, ptr3 + buf.length).set(buf);
|
|
12440
|
+
WASM_VECTOR_LEN = buf.length;
|
|
12441
|
+
return ptr3;
|
|
12442
|
+
}
|
|
12443
|
+
let len = arg.length;
|
|
12444
|
+
let ptr2 = malloc(len, 1) >>> 0;
|
|
12445
|
+
const mem = getUint8ArrayMemory0();
|
|
12446
|
+
let offset = 0;
|
|
12447
|
+
for (;offset < len; offset++) {
|
|
12448
|
+
const code = arg.charCodeAt(offset);
|
|
12449
|
+
if (code > 127)
|
|
12450
|
+
break;
|
|
12451
|
+
mem[ptr2 + offset] = code;
|
|
12452
|
+
}
|
|
12453
|
+
if (offset !== len) {
|
|
12454
|
+
if (offset !== 0) {
|
|
12455
|
+
arg = arg.slice(offset);
|
|
12456
|
+
}
|
|
12457
|
+
ptr2 = realloc(ptr2, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
12458
|
+
const view = getUint8ArrayMemory0().subarray(ptr2 + offset, ptr2 + len);
|
|
12459
|
+
const ret = encodeString(arg, view);
|
|
12460
|
+
offset += ret.written;
|
|
12461
|
+
ptr2 = realloc(ptr2, len, offset, 1) >>> 0;
|
|
12462
|
+
}
|
|
12463
|
+
WASM_VECTOR_LEN = offset;
|
|
12464
|
+
return ptr2;
|
|
12465
|
+
}
|
|
12466
|
+
var cachedDataViewMemory0 = null;
|
|
12467
|
+
function getDataViewMemory0() {
|
|
12468
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
12469
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
12470
|
+
}
|
|
12471
|
+
return cachedDataViewMemory0;
|
|
12472
|
+
}
|
|
12473
|
+
function notDefined(what) {
|
|
12474
|
+
return () => {
|
|
12475
|
+
throw new Error(`${what} is not defined`);
|
|
12476
|
+
};
|
|
12477
|
+
}
|
|
12478
|
+
function takeFromExternrefTable0(idx) {
|
|
12479
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
12480
|
+
wasm.__externref_table_dealloc(idx);
|
|
12481
|
+
return value;
|
|
12482
|
+
}
|
|
12483
|
+
function addToExternrefTable0(obj) {
|
|
12484
|
+
const idx = wasm.__externref_table_alloc();
|
|
12485
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
12486
|
+
return idx;
|
|
12487
|
+
}
|
|
12488
|
+
function handleError(f2, args) {
|
|
12489
|
+
try {
|
|
12490
|
+
return f2.apply(this, args);
|
|
12491
|
+
} catch (e) {
|
|
12492
|
+
const idx = addToExternrefTable0(e);
|
|
12493
|
+
wasm.__wbindgen_exn_store(idx);
|
|
12494
|
+
}
|
|
12495
|
+
}
|
|
12496
|
+
var CodeMapPairFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr2) => wasm.__wbg_codemappair_free(ptr2 >>> 0, 1));
|
|
12497
|
+
|
|
12498
|
+
class CodeMapPair {
|
|
12499
|
+
static __wrap(ptr2) {
|
|
12500
|
+
ptr2 = ptr2 >>> 0;
|
|
12501
|
+
const obj = Object.create(CodeMapPair.prototype);
|
|
12502
|
+
obj.__wbg_ptr = ptr2;
|
|
12503
|
+
CodeMapPairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
12504
|
+
return obj;
|
|
12505
|
+
}
|
|
12506
|
+
__destroy_into_raw() {
|
|
12507
|
+
const ptr2 = this.__wbg_ptr;
|
|
12508
|
+
this.__wbg_ptr = 0;
|
|
12509
|
+
CodeMapPairFinalization.unregister(this);
|
|
12510
|
+
return ptr2;
|
|
12511
|
+
}
|
|
12512
|
+
free() {
|
|
12513
|
+
const ptr2 = this.__destroy_into_raw();
|
|
12514
|
+
wasm.__wbg_codemappair_free(ptr2, 0);
|
|
12515
|
+
}
|
|
12516
|
+
get code() {
|
|
12517
|
+
let deferred1_0;
|
|
12518
|
+
let deferred1_1;
|
|
12519
|
+
try {
|
|
12520
|
+
const ret = wasm.__wbg_get_codemappair_code(this.__wbg_ptr);
|
|
12521
|
+
deferred1_0 = ret[0];
|
|
12522
|
+
deferred1_1 = ret[1];
|
|
12523
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12524
|
+
} finally {
|
|
12525
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12526
|
+
}
|
|
12527
|
+
}
|
|
12528
|
+
set code(arg0) {
|
|
12529
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12530
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12531
|
+
wasm.__wbg_set_codemappair_code(this.__wbg_ptr, ptr0, len0);
|
|
12532
|
+
}
|
|
12533
|
+
get map() {
|
|
12534
|
+
let deferred1_0;
|
|
12535
|
+
let deferred1_1;
|
|
12536
|
+
try {
|
|
12537
|
+
const ret = wasm.__wbg_get_codemappair_map(this.__wbg_ptr);
|
|
12538
|
+
deferred1_0 = ret[0];
|
|
12539
|
+
deferred1_1 = ret[1];
|
|
12540
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12541
|
+
} finally {
|
|
12542
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12543
|
+
}
|
|
12544
|
+
}
|
|
12545
|
+
set map(arg0) {
|
|
12546
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12547
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12548
|
+
wasm.__wbg_set_codemappair_map(this.__wbg_ptr, ptr0, len0);
|
|
12549
|
+
}
|
|
12550
|
+
constructor(code, map) {
|
|
12551
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12552
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12553
|
+
const ptr1 = passStringToWasm0(map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12554
|
+
const len1 = WASM_VECTOR_LEN;
|
|
12555
|
+
const ret = wasm.codemappair_new(ptr0, len0, ptr1, len1);
|
|
12556
|
+
this.__wbg_ptr = ret >>> 0;
|
|
12557
|
+
CodeMapPairFinalization.register(this, this.__wbg_ptr, this);
|
|
12558
|
+
return this;
|
|
12559
|
+
}
|
|
12560
|
+
}
|
|
12561
|
+
exports.CodeMapPair = CodeMapPair;
|
|
12562
|
+
var PreprocessorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr2) => wasm.__wbg_preprocessor_free(ptr2 >>> 0, 1));
|
|
12563
|
+
|
|
12564
|
+
class Preprocessor {
|
|
12565
|
+
__destroy_into_raw() {
|
|
12566
|
+
const ptr2 = this.__wbg_ptr;
|
|
12567
|
+
this.__wbg_ptr = 0;
|
|
12568
|
+
PreprocessorFinalization.unregister(this);
|
|
12569
|
+
return ptr2;
|
|
12570
|
+
}
|
|
12571
|
+
free() {
|
|
12572
|
+
const ptr2 = this.__destroy_into_raw();
|
|
12573
|
+
wasm.__wbg_preprocessor_free(ptr2, 0);
|
|
12574
|
+
}
|
|
12575
|
+
constructor() {
|
|
12576
|
+
const ret = wasm.preprocessor_new();
|
|
12577
|
+
this.__wbg_ptr = ret >>> 0;
|
|
12578
|
+
PreprocessorFinalization.register(this, this.__wbg_ptr, this);
|
|
12579
|
+
return this;
|
|
12580
|
+
}
|
|
12581
|
+
process(src, options) {
|
|
12582
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12583
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12584
|
+
const ret = wasm.preprocessor_process(this.__wbg_ptr, ptr0, len0, options);
|
|
12585
|
+
if (ret[2]) {
|
|
12586
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12587
|
+
}
|
|
12588
|
+
return CodeMapPair.__wrap(ret[0]);
|
|
12589
|
+
}
|
|
12590
|
+
parse(src, options) {
|
|
12591
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12592
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12593
|
+
const ret = wasm.preprocessor_parse(this.__wbg_ptr, ptr0, len0, options);
|
|
12594
|
+
if (ret[2]) {
|
|
12595
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12596
|
+
}
|
|
12597
|
+
return takeFromExternrefTable0(ret[0]);
|
|
12598
|
+
}
|
|
12599
|
+
}
|
|
12600
|
+
exports.Preprocessor = Preprocessor;
|
|
12601
|
+
exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
12602
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
12603
|
+
return ret;
|
|
12604
|
+
};
|
|
12605
|
+
exports.__wbg_String_d7c955520b66a733 = function(arg0, arg1) {
|
|
12606
|
+
const ret = String(arg1);
|
|
12607
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12608
|
+
const len1 = WASM_VECTOR_LEN;
|
|
12609
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
12610
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
12611
|
+
};
|
|
12612
|
+
exports.__wbg_Error_58015c683709e145 = typeof Error == "function" ? Error : notDefined("Error");
|
|
12613
|
+
exports.__wbg_Boolean_ef3e29efb4629824 = typeof Boolean == "function" ? Boolean : notDefined("Boolean");
|
|
12614
|
+
exports.__wbg_parse_181a91d066d1f7fe = typeof JSON.parse == "function" ? JSON.parse : notDefined("JSON.parse");
|
|
12615
|
+
exports.__wbindgen_is_object = function(arg0) {
|
|
12616
|
+
const val = arg0;
|
|
12617
|
+
const ret = typeof val === "object" && val !== null;
|
|
12618
|
+
return ret;
|
|
12619
|
+
};
|
|
12620
|
+
exports.__wbg_crypto_c48a774b022d20ac = function(arg0) {
|
|
12621
|
+
const ret = arg0.crypto;
|
|
12622
|
+
return ret;
|
|
12623
|
+
};
|
|
12624
|
+
exports.__wbg_process_298734cf255a885d = function(arg0) {
|
|
12625
|
+
const ret = arg0.process;
|
|
12626
|
+
return ret;
|
|
12627
|
+
};
|
|
12628
|
+
exports.__wbg_versions_e2e78e134e3e5d01 = function(arg0) {
|
|
12629
|
+
const ret = arg0.versions;
|
|
12630
|
+
return ret;
|
|
12631
|
+
};
|
|
12632
|
+
exports.__wbg_node_1cd7a5d853dbea79 = function(arg0) {
|
|
12633
|
+
const ret = arg0.node;
|
|
12634
|
+
return ret;
|
|
12635
|
+
};
|
|
12636
|
+
exports.__wbindgen_is_string = function(arg0) {
|
|
12637
|
+
const ret = typeof arg0 === "string";
|
|
12638
|
+
return ret;
|
|
12639
|
+
};
|
|
12640
|
+
exports.__wbg_require_8f08ceecec0f4fee = function() {
|
|
12641
|
+
return handleError(function() {
|
|
12642
|
+
const ret = module.require;
|
|
12643
|
+
return ret;
|
|
12644
|
+
}, arguments);
|
|
12645
|
+
};
|
|
12646
|
+
exports.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) {
|
|
12647
|
+
const ret = arg0.msCrypto;
|
|
12648
|
+
return ret;
|
|
12649
|
+
};
|
|
12650
|
+
exports.__wbg_randomFillSync_dc1e9a60c158336d = function() {
|
|
12651
|
+
return handleError(function(arg0, arg1) {
|
|
12652
|
+
arg0.randomFillSync(arg1);
|
|
12653
|
+
}, arguments);
|
|
12654
|
+
};
|
|
12655
|
+
exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() {
|
|
12656
|
+
return handleError(function(arg0, arg1) {
|
|
12657
|
+
arg0.getRandomValues(arg1);
|
|
12658
|
+
}, arguments);
|
|
12659
|
+
};
|
|
12660
|
+
exports.__wbindgen_is_function = function(arg0) {
|
|
12661
|
+
const ret = typeof arg0 === "function";
|
|
12662
|
+
return ret;
|
|
12663
|
+
};
|
|
12664
|
+
exports.__wbg_self_1ff1d729e9aae938 = function() {
|
|
12665
|
+
return handleError(function() {
|
|
12666
|
+
const ret = self.self;
|
|
12667
|
+
return ret;
|
|
12668
|
+
}, arguments);
|
|
12669
|
+
};
|
|
12670
|
+
exports.__wbg_window_5f4faef6c12b79ec = function() {
|
|
12671
|
+
return handleError(function() {
|
|
12672
|
+
const ret = window.window;
|
|
12673
|
+
return ret;
|
|
12674
|
+
}, arguments);
|
|
12675
|
+
};
|
|
12676
|
+
exports.__wbg_globalThis_1d39714405582d3c = function() {
|
|
12677
|
+
return handleError(function() {
|
|
12678
|
+
const ret = globalThis.globalThis;
|
|
12679
|
+
return ret;
|
|
12680
|
+
}, arguments);
|
|
12681
|
+
};
|
|
12682
|
+
exports.__wbg_global_651f05c6a0944d1c = function() {
|
|
12683
|
+
return handleError(function() {
|
|
12684
|
+
const ret = global.global;
|
|
12685
|
+
return ret;
|
|
12686
|
+
}, arguments);
|
|
12687
|
+
};
|
|
12688
|
+
exports.__wbindgen_is_undefined = function(arg0) {
|
|
12689
|
+
const ret = arg0 === undefined;
|
|
12690
|
+
return ret;
|
|
12691
|
+
};
|
|
12692
|
+
exports.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
|
|
12693
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
12694
|
+
return ret;
|
|
12695
|
+
};
|
|
12696
|
+
exports.__wbg_call_cb65541d95d71282 = function() {
|
|
12697
|
+
return handleError(function(arg0, arg1) {
|
|
12698
|
+
const ret = arg0.call(arg1);
|
|
12699
|
+
return ret;
|
|
12700
|
+
}, arguments);
|
|
12701
|
+
};
|
|
12702
|
+
exports.__wbg_call_01734de55d61e11d = function() {
|
|
12703
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
12704
|
+
const ret = arg0.call(arg1, arg2);
|
|
12705
|
+
return ret;
|
|
12706
|
+
}, arguments);
|
|
12707
|
+
};
|
|
12708
|
+
exports.__wbg_get_97b561fb56f034b5 = function() {
|
|
12709
|
+
return handleError(function(arg0, arg1) {
|
|
12710
|
+
const ret = Reflect.get(arg0, arg1);
|
|
12711
|
+
return ret;
|
|
12712
|
+
}, arguments);
|
|
12713
|
+
};
|
|
12714
|
+
exports.__wbg_set_092e06b0f9d71865 = function() {
|
|
12715
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
12716
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
12717
|
+
return ret;
|
|
12718
|
+
}, arguments);
|
|
12719
|
+
};
|
|
12720
|
+
exports.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
|
12721
|
+
const ret = arg0.buffer;
|
|
12722
|
+
return ret;
|
|
12723
|
+
};
|
|
12724
|
+
exports.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
|
|
12725
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
12726
|
+
return ret;
|
|
12727
|
+
};
|
|
12728
|
+
exports.__wbg_new_8125e318e6245eed = function(arg0) {
|
|
12729
|
+
const ret = new Uint8Array(arg0);
|
|
12730
|
+
return ret;
|
|
12731
|
+
};
|
|
12732
|
+
exports.__wbg_newwithlength_e5d69174d6984cd7 = function(arg0) {
|
|
12733
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
12734
|
+
return ret;
|
|
12735
|
+
};
|
|
12736
|
+
exports.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) {
|
|
12737
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
12738
|
+
return ret;
|
|
12739
|
+
};
|
|
12740
|
+
exports.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
|
|
12741
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
12742
|
+
};
|
|
12743
|
+
exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
12744
|
+
const ret = debugString(arg1);
|
|
12745
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12746
|
+
const len1 = WASM_VECTOR_LEN;
|
|
12747
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
12748
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
12749
|
+
};
|
|
12750
|
+
exports.__wbindgen_throw = function(arg0, arg1) {
|
|
12751
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
12752
|
+
};
|
|
12753
|
+
exports.__wbindgen_memory = function() {
|
|
12754
|
+
const ret = wasm.memory;
|
|
12755
|
+
return ret;
|
|
12756
|
+
};
|
|
12757
|
+
exports.__wbindgen_init_externref_table = function() {
|
|
12758
|
+
const table = wasm.__wbindgen_export_2;
|
|
12759
|
+
const offset = table.grow(4);
|
|
12760
|
+
table.set(0, undefined);
|
|
12761
|
+
table.set(offset + 0, undefined);
|
|
12762
|
+
table.set(offset + 1, null);
|
|
12763
|
+
table.set(offset + 2, true);
|
|
12764
|
+
table.set(offset + 3, false);
|
|
12765
|
+
};
|
|
12766
|
+
var path = __require("path").join(__dirname, "content_tag_bg.wasm");
|
|
12767
|
+
var bytes = __require("fs").readFileSync(path);
|
|
12768
|
+
var wasmModule = new WebAssembly.Module(bytes);
|
|
12769
|
+
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
12770
|
+
wasm = wasmInstance.exports;
|
|
12771
|
+
exports.__wasm = wasm;
|
|
12772
|
+
wasm.__wbindgen_start();
|
|
12773
|
+
});
|
|
12774
|
+
|
|
12775
|
+
// node_modules/content-tag/pkg/node.cjs
|
|
12776
|
+
var require_node = __commonJS((exports, module) => {
|
|
12777
|
+
var { Preprocessor } = require_content_tag();
|
|
12778
|
+
exports.Preprocessor = Preprocessor;
|
|
12779
|
+
});
|
|
12780
|
+
|
|
12781
|
+
// src/build/compileEmber.ts
|
|
12782
|
+
var exports_compileEmber = {};
|
|
12783
|
+
__export(exports_compileEmber, {
|
|
12784
|
+
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
12785
|
+
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
12786
|
+
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
12787
|
+
dirname: () => dirname12,
|
|
12788
|
+
compileEmberFileSource: () => compileEmberFileSource,
|
|
12789
|
+
compileEmberFile: () => compileEmberFile,
|
|
12790
|
+
compileEmber: () => compileEmber,
|
|
12791
|
+
clearEmberCompilerCache: () => clearEmberCompilerCache,
|
|
12792
|
+
basename: () => basename7
|
|
12793
|
+
});
|
|
12794
|
+
import { existsSync as existsSync17 } from "fs";
|
|
12795
|
+
import { mkdir as mkdir6, rm as rm5 } from "fs/promises";
|
|
12796
|
+
import { basename as basename7, dirname as dirname12, extname as extname6, join as join17, resolve as resolve17 } from "path";
|
|
12797
|
+
var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file3 } = globalThis.Bun;
|
|
12798
|
+
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
12799
|
+
if (cachedPreprocessor)
|
|
12800
|
+
return cachedPreprocessor;
|
|
12801
|
+
const module = await Promise.resolve().then(() => __toESM(require_node(), 1));
|
|
12802
|
+
cachedPreprocessor = new module.Preprocessor;
|
|
12803
|
+
return cachedPreprocessor;
|
|
12804
|
+
}, transpiler4, isTemplateTagFile = (entry) => {
|
|
12805
|
+
const ext = extname6(entry);
|
|
12806
|
+
return ext === ".gjs" || ext === ".gts";
|
|
12807
|
+
}, rewriteTemplateEvalToScope = (source) => {
|
|
12808
|
+
const importedNames = new Set;
|
|
12809
|
+
const importRegex = /^\s*import\s+(?:type\s+)?(?:(\*\s+as\s+\w+)|(\w+)(?:\s*,\s*\{([^}]+)\})?|\{([^}]+)\})\s+from\s+['"][^'"]+['"]/gm;
|
|
12810
|
+
let match;
|
|
12811
|
+
while ((match = importRegex.exec(source)) !== null) {
|
|
12812
|
+
const [, namespaceImport, defaultImport, namedAfterDefault, named] = match;
|
|
12813
|
+
if (namespaceImport) {
|
|
12814
|
+
const aliasMatch = /\*\s+as\s+(\w+)/.exec(namespaceImport);
|
|
12815
|
+
if (aliasMatch?.[1])
|
|
12816
|
+
importedNames.add(aliasMatch[1]);
|
|
12817
|
+
}
|
|
12818
|
+
if (defaultImport)
|
|
12819
|
+
importedNames.add(defaultImport);
|
|
12820
|
+
const namedList = named ?? namedAfterDefault;
|
|
12821
|
+
if (namedList) {
|
|
12822
|
+
for (const part of namedList.split(",")) {
|
|
12823
|
+
const trimmed = part.trim();
|
|
12824
|
+
if (!trimmed)
|
|
12825
|
+
continue;
|
|
12826
|
+
const asMatch = /\bas\s+(\w+)$/.exec(trimmed);
|
|
12827
|
+
const localName = asMatch ? asMatch[1] : trimmed.replace(/^type\s+/, "");
|
|
12828
|
+
if (localName && /^\w+$/.test(localName)) {
|
|
12829
|
+
importedNames.add(localName);
|
|
12830
|
+
}
|
|
12831
|
+
}
|
|
12832
|
+
}
|
|
12833
|
+
}
|
|
12834
|
+
const scopeObject = importedNames.size === 0 ? "{}" : `{ ${Array.from(importedNames).join(", ")} }`;
|
|
12835
|
+
const evalShim = /eval\s*\(\)\s*\{\s*return\s+eval\(arguments\[0\]\);\s*\}/g;
|
|
12836
|
+
return source.replace(evalShim, `scope() { return ${scopeObject}; }`);
|
|
12837
|
+
}, EMBROIDER_MACROS_SHIM_SOURCE = `const isProd = () => {
|
|
12838
|
+
try {
|
|
12839
|
+
return globalThis.process?.env?.NODE_ENV === 'production';
|
|
12840
|
+
} catch {
|
|
12841
|
+
return false;
|
|
12842
|
+
}
|
|
12843
|
+
};
|
|
12844
|
+
|
|
12845
|
+
export const each = (arr) => {
|
|
12846
|
+
if (!Array.isArray(arr)) {
|
|
12847
|
+
throw new Error('the argument to each() must be an array');
|
|
12848
|
+
}
|
|
12849
|
+
return arr;
|
|
12850
|
+
};
|
|
12851
|
+
export const macroCondition = (predicate) => predicate;
|
|
12852
|
+
export const isDevelopingApp = () => !isProd();
|
|
12853
|
+
export const isTesting = () => false;
|
|
12854
|
+
export const setTesting = () => {};
|
|
12855
|
+
export const dependencySatisfies = () => false;
|
|
12856
|
+
export const appEmberSatisfies = () => false;
|
|
12857
|
+
export const getConfig = () => undefined;
|
|
12858
|
+
export const getOwnConfig = () => undefined;
|
|
12859
|
+
export const getGlobalConfig = () => ({});
|
|
12860
|
+
export const config = () => undefined;
|
|
12861
|
+
export const failBuild = (msg) => { throw new Error('failBuild: ' + msg); };
|
|
12862
|
+
export const moduleExists = () => false;
|
|
12863
|
+
export const importSync = (specifier) => {
|
|
12864
|
+
throw new Error('importSync(' + specifier + '): not supported by the AbsoluteJS Ember adapter \u2014 use dynamic import() instead');
|
|
12865
|
+
};
|
|
12866
|
+
`, createEmberServerResolverPlugin = (cwd, options = {}) => ({
|
|
12867
|
+
name: "absolutejs-ember-server-resolver",
|
|
12868
|
+
setup(build) {
|
|
12869
|
+
const standalonePackages = new Set([
|
|
12870
|
+
"@glimmer/component",
|
|
12871
|
+
"@glimmer/tracking",
|
|
12872
|
+
"@glimmer/env",
|
|
12873
|
+
"@simple-dom/serializer"
|
|
12874
|
+
]);
|
|
12875
|
+
build.onResolve({ filter: /^@embroider\/macros$/ }, () => ({
|
|
12876
|
+
namespace: "absolutejs-ember-virtual",
|
|
12877
|
+
path: "embroider-macros-shim"
|
|
12878
|
+
}));
|
|
12879
|
+
build.onLoad({
|
|
12880
|
+
filter: /^embroider-macros-shim$/,
|
|
12881
|
+
namespace: "absolutejs-ember-virtual"
|
|
12882
|
+
}, () => ({
|
|
12883
|
+
contents: EMBROIDER_MACROS_SHIM_SOURCE,
|
|
12884
|
+
loader: "js"
|
|
12885
|
+
}));
|
|
12886
|
+
const stagedSourceMap = options.stagedSourceMap;
|
|
12887
|
+
if (stagedSourceMap && stagedSourceMap.size > 0) {
|
|
12888
|
+
build.onResolve({ filter: /^\.{1,2}\// }, (args) => {
|
|
12889
|
+
const originalImporter = stagedSourceMap.get(args.importer);
|
|
12890
|
+
if (!originalImporter)
|
|
12891
|
+
return;
|
|
12892
|
+
const candidateBase = resolve17(dirname12(originalImporter), args.path);
|
|
12893
|
+
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
12894
|
+
for (const ext of extensionsToTry) {
|
|
12895
|
+
const candidate = candidateBase + ext;
|
|
12896
|
+
if (existsSync17(candidate))
|
|
12897
|
+
return { path: candidate };
|
|
12898
|
+
}
|
|
12899
|
+
return;
|
|
12900
|
+
});
|
|
12901
|
+
}
|
|
12902
|
+
build.onLoad({ filter: /\.(gts|gjs)$/ }, async (args) => {
|
|
12903
|
+
const source = await file3(args.path).text();
|
|
12904
|
+
const preprocessor = await getPreprocessor();
|
|
12905
|
+
const result = preprocessor.process(source, {
|
|
12906
|
+
filename: args.path
|
|
12907
|
+
});
|
|
12908
|
+
const rewritten = rewriteTemplateEvalToScope(result.code);
|
|
12909
|
+
const transpiled = transpiler4.transformSync(rewritten);
|
|
12910
|
+
return { contents: transpiled, loader: "js" };
|
|
12911
|
+
});
|
|
12912
|
+
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
12913
|
+
if (standalonePackages.has(args.path))
|
|
12914
|
+
return;
|
|
12915
|
+
const internal = join17(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
12916
|
+
if (existsSync17(internal))
|
|
12917
|
+
return { path: internal };
|
|
12918
|
+
return;
|
|
12919
|
+
});
|
|
12920
|
+
}
|
|
12921
|
+
}), generateServerHarness = (pageModulePath) => `import PageComponent from ${JSON.stringify(pageModulePath)};
|
|
12922
|
+
import { renderComponent } from '@ember/renderer';
|
|
12923
|
+
import Document from '@simple-dom/document';
|
|
12924
|
+
import Serializer from '@simple-dom/serializer';
|
|
12925
|
+
|
|
12926
|
+
const installSimpleDomGlobals = () => {
|
|
12927
|
+
const g = globalThis;
|
|
12928
|
+
if (typeof g.Element === 'undefined') g.Element = class Element {};
|
|
12929
|
+
if (typeof g.Node === 'undefined') g.Node = class Node {};
|
|
12930
|
+
};
|
|
12931
|
+
|
|
12932
|
+
export const renderToHTML = (props = {}) => {
|
|
12933
|
+
installSimpleDomGlobals();
|
|
12934
|
+
const doc = new Document();
|
|
12935
|
+
const root = doc.createElement('div');
|
|
12936
|
+
const result = renderComponent(PageComponent, {
|
|
12937
|
+
owner: {},
|
|
12938
|
+
env: { document: doc, hasDOM: true, isInteractive: false },
|
|
12939
|
+
into: root,
|
|
12940
|
+
args: props,
|
|
12941
|
+
});
|
|
12942
|
+
const serializer = new Serializer({});
|
|
12943
|
+
const html = serializer.serialize(root);
|
|
12944
|
+
result?.destroy?.();
|
|
12945
|
+
return html;
|
|
12946
|
+
};
|
|
12947
|
+
|
|
12948
|
+
export { PageComponent };
|
|
12949
|
+
export default PageComponent;
|
|
12950
|
+
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
12951
|
+
const resolvedEntry = resolve17(entry);
|
|
12952
|
+
const source = await file3(resolvedEntry).text();
|
|
12953
|
+
let preprocessed = source;
|
|
12954
|
+
if (isTemplateTagFile(resolvedEntry)) {
|
|
12955
|
+
const preprocessor = await getPreprocessor();
|
|
12956
|
+
const result = preprocessor.process(source, {
|
|
12957
|
+
filename: resolvedEntry
|
|
12958
|
+
});
|
|
12959
|
+
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
12960
|
+
}
|
|
12961
|
+
const transpiled = transpiler4.transformSync(preprocessed);
|
|
12962
|
+
const baseName = basename7(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
12963
|
+
const tmpDir = join17(compiledRoot, "_tmp");
|
|
12964
|
+
const serverDir = join17(compiledRoot, "server");
|
|
12965
|
+
const clientDir = join17(compiledRoot, "client");
|
|
12966
|
+
await Promise.all([
|
|
12967
|
+
mkdir6(tmpDir, { recursive: true }),
|
|
12968
|
+
mkdir6(serverDir, { recursive: true }),
|
|
12969
|
+
mkdir6(clientDir, { recursive: true })
|
|
12970
|
+
]);
|
|
12971
|
+
const tmpPagePath = resolve17(join17(tmpDir, `${baseName}.module.js`));
|
|
12972
|
+
const tmpHarnessPath = resolve17(join17(tmpDir, `${baseName}.harness.js`));
|
|
12973
|
+
await Promise.all([
|
|
12974
|
+
write3(tmpPagePath, transpiled),
|
|
12975
|
+
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
12976
|
+
]);
|
|
12977
|
+
const stagedSourceMap = new Map([
|
|
12978
|
+
[tmpPagePath, resolvedEntry]
|
|
12979
|
+
]);
|
|
12980
|
+
const serverPath = join17(serverDir, `${baseName}.js`);
|
|
12981
|
+
const buildResult = await bunBuild2({
|
|
12982
|
+
entrypoints: [tmpHarnessPath],
|
|
12983
|
+
format: "esm",
|
|
12984
|
+
minify: false,
|
|
12985
|
+
naming: `${baseName}.js`,
|
|
12986
|
+
outdir: serverDir,
|
|
12987
|
+
plugins: [
|
|
12988
|
+
createEmberServerResolverPlugin(cwd, { stagedSourceMap })
|
|
12989
|
+
],
|
|
12990
|
+
target: "bun",
|
|
12991
|
+
throw: false
|
|
12992
|
+
});
|
|
12993
|
+
if (!buildResult.success) {
|
|
12994
|
+
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
12995
|
+
}
|
|
12996
|
+
await rm5(tmpDir, { force: true, recursive: true });
|
|
12997
|
+
const clientPath = join17(clientDir, `${baseName}.js`);
|
|
12998
|
+
await write3(clientPath, transpiled);
|
|
12999
|
+
return { clientPath, serverPath };
|
|
13000
|
+
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
13001
|
+
if (entries.length === 0) {
|
|
13002
|
+
return {
|
|
13003
|
+
clientPaths: [],
|
|
13004
|
+
serverPaths: []
|
|
13005
|
+
};
|
|
13006
|
+
}
|
|
13007
|
+
const compiledRoot = join17(emberDir, "generated");
|
|
13008
|
+
const outputs = await Promise.all(entries.map((entry) => compileEmberFile(entry, compiledRoot, cwd)));
|
|
13009
|
+
return {
|
|
13010
|
+
clientPaths: outputs.map((o) => o.clientPath),
|
|
13011
|
+
serverPaths: outputs.map((o) => o.serverPath)
|
|
13012
|
+
};
|
|
13013
|
+
}, compileEmberFileSource = async (entry) => {
|
|
13014
|
+
const resolvedEntry = resolve17(entry);
|
|
13015
|
+
const source = await file3(resolvedEntry).text();
|
|
13016
|
+
let preprocessed = source;
|
|
13017
|
+
if (isTemplateTagFile(resolvedEntry)) {
|
|
13018
|
+
const preprocessor = await getPreprocessor();
|
|
13019
|
+
const result = preprocessor.process(source, {
|
|
13020
|
+
filename: resolvedEntry
|
|
13021
|
+
});
|
|
13022
|
+
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13023
|
+
}
|
|
13024
|
+
return transpiler4.transformSync(preprocessed);
|
|
13025
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (emberDir) => join17(emberDir, "generated"), getEmberServerCompiledDir = (emberDir) => join17(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join17(getEmberCompiledRoot(emberDir), "client");
|
|
13026
|
+
var init_compileEmber = __esm(() => {
|
|
13027
|
+
transpiler4 = new Transpiler3({
|
|
13028
|
+
loader: "ts",
|
|
13029
|
+
target: "browser",
|
|
13030
|
+
tsconfig: JSON.stringify({
|
|
13031
|
+
compilerOptions: {
|
|
13032
|
+
experimentalDecorators: true,
|
|
13033
|
+
useDefineForClassFields: false
|
|
13034
|
+
}
|
|
13035
|
+
})
|
|
13036
|
+
});
|
|
13037
|
+
});
|
|
13038
|
+
|
|
12276
13039
|
// src/build/buildReactVendor.ts
|
|
12277
13040
|
var exports_buildReactVendor = {};
|
|
12278
13041
|
__export(exports_buildReactVendor, {
|
|
12279
13042
|
computeVendorPaths: () => computeVendorPaths,
|
|
12280
13043
|
buildReactVendor: () => buildReactVendor
|
|
12281
13044
|
});
|
|
12282
|
-
import { existsSync as
|
|
12283
|
-
import { join as
|
|
12284
|
-
import { rm as
|
|
12285
|
-
var {build:
|
|
13045
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync6 } from "fs";
|
|
13046
|
+
import { join as join18, resolve as resolve18 } from "path";
|
|
13047
|
+
import { rm as rm6 } from "fs/promises";
|
|
13048
|
+
var {build: bunBuild3 } = globalThis.Bun;
|
|
12286
13049
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
12287
13050
|
const candidates = [
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
13051
|
+
resolve18(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
13052
|
+
resolve18(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13053
|
+
resolve18(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
13054
|
+
resolve18(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13055
|
+
resolve18(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
13056
|
+
resolve18(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
12294
13057
|
];
|
|
12295
13058
|
for (const candidate of candidates) {
|
|
12296
|
-
if (
|
|
13059
|
+
if (existsSync18(candidate)) {
|
|
12297
13060
|
return candidate.replace(/\\/g, "/");
|
|
12298
13061
|
}
|
|
12299
13062
|
}
|
|
12300
|
-
return (candidates[0] ??
|
|
13063
|
+
return (candidates[0] ?? resolve18(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
12301
13064
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
12302
13065
|
try {
|
|
12303
13066
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -12334,19 +13097,19 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12334
13097
|
`)}
|
|
12335
13098
|
`;
|
|
12336
13099
|
}, buildReactVendor = async (buildDir) => {
|
|
12337
|
-
const vendorDir =
|
|
13100
|
+
const vendorDir = join18(buildDir, "react", "vendor");
|
|
12338
13101
|
mkdirSync6(vendorDir, { recursive: true });
|
|
12339
|
-
const tmpDir =
|
|
13102
|
+
const tmpDir = join18(buildDir, "_vendor_tmp");
|
|
12340
13103
|
mkdirSync6(tmpDir, { recursive: true });
|
|
12341
13104
|
const specifiers = resolveVendorSpecifiers();
|
|
12342
13105
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12343
13106
|
const safeName = toSafeFileName(specifier);
|
|
12344
|
-
const entryPath =
|
|
13107
|
+
const entryPath = join18(tmpDir, `${safeName}.ts`);
|
|
12345
13108
|
const source = await generateEntrySource(specifier);
|
|
12346
13109
|
await Bun.write(entryPath, source);
|
|
12347
13110
|
return entryPath;
|
|
12348
13111
|
}));
|
|
12349
|
-
const result = await
|
|
13112
|
+
const result = await bunBuild3({
|
|
12350
13113
|
entrypoints,
|
|
12351
13114
|
format: "esm",
|
|
12352
13115
|
minify: false,
|
|
@@ -12356,7 +13119,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12356
13119
|
target: "browser",
|
|
12357
13120
|
throw: false
|
|
12358
13121
|
});
|
|
12359
|
-
await
|
|
13122
|
+
await rm6(tmpDir, { force: true, recursive: true });
|
|
12360
13123
|
if (!result.success) {
|
|
12361
13124
|
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
12362
13125
|
}
|
|
@@ -12373,10 +13136,25 @@ var init_buildReactVendor = __esm(() => {
|
|
|
12373
13136
|
});
|
|
12374
13137
|
|
|
12375
13138
|
// src/build/vendorEntrySource.ts
|
|
12376
|
-
var generateVendorEntrySource = (specifier) =>
|
|
12377
|
-
|
|
12378
|
-
|
|
13139
|
+
var RESERVED_KEYS, VALID_IDENTIFIER, generateVendorEntrySource = async (specifier) => {
|
|
13140
|
+
const mod = await import(specifier);
|
|
13141
|
+
const exportKeys = Object.keys(mod).filter((key) => !RESERVED_KEYS.has(key) && VALID_IDENTIFIER.test(key));
|
|
13142
|
+
const explicitNamedExports = exportKeys.length > 0 ? `export { ${exportKeys.join(", ")} } from '${specifier}';
|
|
13143
|
+
` : "";
|
|
13144
|
+
return `import * as __abs_ns from '${specifier}';
|
|
13145
|
+
export * from '${specifier}';
|
|
13146
|
+
` + explicitNamedExports + `export default __abs_ns.default;
|
|
13147
|
+
export const __ABSOLUTE_VENDOR_NAMESPACE__ = __abs_ns;
|
|
12379
13148
|
`;
|
|
13149
|
+
};
|
|
13150
|
+
var init_vendorEntrySource = __esm(() => {
|
|
13151
|
+
RESERVED_KEYS = new Set([
|
|
13152
|
+
"default",
|
|
13153
|
+
"__esModule",
|
|
13154
|
+
"__ABSOLUTE_VENDOR_NAMESPACE__"
|
|
13155
|
+
]);
|
|
13156
|
+
VALID_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;
|
|
13157
|
+
});
|
|
12380
13158
|
|
|
12381
13159
|
// src/build/buildAngularVendor.ts
|
|
12382
13160
|
var exports_buildAngularVendor = {};
|
|
@@ -12389,9 +13167,9 @@ __export(exports_buildAngularVendor, {
|
|
|
12389
13167
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
12390
13168
|
});
|
|
12391
13169
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
12392
|
-
import { join as
|
|
12393
|
-
import { rm as
|
|
12394
|
-
var {build:
|
|
13170
|
+
import { join as join19 } from "path";
|
|
13171
|
+
import { rm as rm7 } from "fs/promises";
|
|
13172
|
+
var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
|
|
12395
13173
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
|
|
12396
13174
|
try {
|
|
12397
13175
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -12402,18 +13180,18 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12402
13180
|
}, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAngularBrowserSpecifier = (spec) => spec.startsWith("@angular/") && !SERVER_ONLY_ANGULAR_SPECIFIERS.has(spec) && !isBuildOnlyAngularSpecifier(spec), scanSourceImports = async (directories) => {
|
|
12403
13181
|
const angular = new Set;
|
|
12404
13182
|
const transitiveRoots = new Set;
|
|
12405
|
-
const
|
|
13183
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
12406
13184
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
|
|
12407
13185
|
for (const dir of directories) {
|
|
12408
13186
|
try {
|
|
12409
|
-
for await (const
|
|
12410
|
-
const rel =
|
|
13187
|
+
for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
|
|
13188
|
+
const rel = file4.slice(dir.length + 1);
|
|
12411
13189
|
const [first] = rel.split("/");
|
|
12412
13190
|
if (first && SCAN_SKIP_DIRS.has(first))
|
|
12413
13191
|
continue;
|
|
12414
13192
|
try {
|
|
12415
|
-
const content = await Bun.file(
|
|
12416
|
-
for (const imp of
|
|
13193
|
+
const content = await Bun.file(file4).text();
|
|
13194
|
+
for (const imp of transpiler5.scanImports(content)) {
|
|
12417
13195
|
if (isAngularBrowserSpecifier(imp.path)) {
|
|
12418
13196
|
angular.add(imp.path);
|
|
12419
13197
|
} else if (isBareSpecifier(imp.path)) {
|
|
@@ -12427,7 +13205,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12427
13205
|
return { angular, transitiveRoots };
|
|
12428
13206
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
12429
13207
|
const { readFileSync: readFileSync11 } = await import("fs");
|
|
12430
|
-
const
|
|
13208
|
+
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
12431
13209
|
const visited = new Set;
|
|
12432
13210
|
const frontier = [];
|
|
12433
13211
|
for (const r of roots)
|
|
@@ -12456,7 +13234,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12456
13234
|
}
|
|
12457
13235
|
let imports;
|
|
12458
13236
|
try {
|
|
12459
|
-
imports =
|
|
13237
|
+
imports = transpiler5.scanImports(content);
|
|
12460
13238
|
} catch {
|
|
12461
13239
|
continue;
|
|
12462
13240
|
}
|
|
@@ -12486,18 +13264,18 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12486
13264
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
12487
13265
|
return Array.from(angular).filter(isResolvable2);
|
|
12488
13266
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
12489
|
-
const vendorDir =
|
|
13267
|
+
const vendorDir = join19(buildDir, "angular", "vendor");
|
|
12490
13268
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12491
|
-
const tmpDir =
|
|
13269
|
+
const tmpDir = join19(buildDir, "_angular_vendor_tmp");
|
|
12492
13270
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12493
13271
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12494
13272
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12495
13273
|
const safeName = toSafeFileName2(specifier);
|
|
12496
|
-
const entryPath =
|
|
12497
|
-
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
13274
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
13275
|
+
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
12498
13276
|
return entryPath;
|
|
12499
13277
|
}));
|
|
12500
|
-
const result = await
|
|
13278
|
+
const result = await bunBuild4({
|
|
12501
13279
|
entrypoints,
|
|
12502
13280
|
external: depVendorSpecifiers,
|
|
12503
13281
|
format: "esm",
|
|
@@ -12509,7 +13287,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12509
13287
|
target: "browser",
|
|
12510
13288
|
throw: false
|
|
12511
13289
|
});
|
|
12512
|
-
await
|
|
13290
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
12513
13291
|
if (!result.success) {
|
|
12514
13292
|
console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
|
|
12515
13293
|
}
|
|
@@ -12524,9 +13302,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12524
13302
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12525
13303
|
return computeAngularVendorPaths(specifiers);
|
|
12526
13304
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
12527
|
-
const vendorDir =
|
|
13305
|
+
const vendorDir = join19(buildDir, "angular", "vendor", "server");
|
|
12528
13306
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12529
|
-
const tmpDir =
|
|
13307
|
+
const tmpDir = join19(buildDir, "_angular_server_vendor_tmp");
|
|
12530
13308
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12531
13309
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12532
13310
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -12537,11 +13315,11 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12537
13315
|
const specifiers = Array.from(allSpecs);
|
|
12538
13316
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12539
13317
|
const safeName = toSafeFileName2(specifier);
|
|
12540
|
-
const entryPath =
|
|
12541
|
-
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
13318
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
13319
|
+
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
12542
13320
|
return entryPath;
|
|
12543
13321
|
}));
|
|
12544
|
-
const result = await
|
|
13322
|
+
const result = await bunBuild4({
|
|
12545
13323
|
entrypoints,
|
|
12546
13324
|
format: "esm",
|
|
12547
13325
|
minify: false,
|
|
@@ -12552,16 +13330,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12552
13330
|
target: "bun",
|
|
12553
13331
|
throw: false
|
|
12554
13332
|
});
|
|
12555
|
-
await
|
|
13333
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
12556
13334
|
if (!result.success) {
|
|
12557
13335
|
console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
|
|
12558
13336
|
}
|
|
12559
13337
|
return specifiers;
|
|
12560
13338
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
12561
13339
|
const paths = {};
|
|
12562
|
-
const vendorDir =
|
|
13340
|
+
const vendorDir = join19(buildDir, "angular", "vendor", "server");
|
|
12563
13341
|
for (const specifier of specifiers) {
|
|
12564
|
-
paths[specifier] =
|
|
13342
|
+
paths[specifier] = join19(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
12565
13343
|
}
|
|
12566
13344
|
return paths;
|
|
12567
13345
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -12575,6 +13353,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12575
13353
|
};
|
|
12576
13354
|
var init_buildAngularVendor = __esm(() => {
|
|
12577
13355
|
init_angularLinkerPlugin();
|
|
13356
|
+
init_vendorEntrySource();
|
|
12578
13357
|
REQUIRED_ANGULAR_SPECIFIERS_BASE = [
|
|
12579
13358
|
"@angular/core",
|
|
12580
13359
|
"@angular/common",
|
|
@@ -12616,22 +13395,22 @@ __export(exports_buildVueVendor, {
|
|
|
12616
13395
|
buildVueVendor: () => buildVueVendor
|
|
12617
13396
|
});
|
|
12618
13397
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
12619
|
-
import { join as
|
|
12620
|
-
import { rm as
|
|
12621
|
-
var {build:
|
|
13398
|
+
import { join as join20 } from "path";
|
|
13399
|
+
import { rm as rm8 } from "fs/promises";
|
|
13400
|
+
var {build: bunBuild5 } = globalThis.Bun;
|
|
12622
13401
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
12623
|
-
const vendorDir =
|
|
13402
|
+
const vendorDir = join20(buildDir, "vue", "vendor");
|
|
12624
13403
|
mkdirSync8(vendorDir, { recursive: true });
|
|
12625
|
-
const tmpDir =
|
|
13404
|
+
const tmpDir = join20(buildDir, "_vue_vendor_tmp");
|
|
12626
13405
|
mkdirSync8(tmpDir, { recursive: true });
|
|
12627
13406
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
12628
13407
|
const safeName = toSafeFileName3(specifier);
|
|
12629
|
-
const entryPath =
|
|
13408
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
12630
13409
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12631
13410
|
`);
|
|
12632
13411
|
return entryPath;
|
|
12633
13412
|
}));
|
|
12634
|
-
const result = await
|
|
13413
|
+
const result = await bunBuild5({
|
|
12635
13414
|
define: {
|
|
12636
13415
|
__VUE_OPTIONS_API__: "true",
|
|
12637
13416
|
__VUE_PROD_DEVTOOLS__: "true",
|
|
@@ -12646,15 +13425,15 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
12646
13425
|
target: "browser",
|
|
12647
13426
|
throw: false
|
|
12648
13427
|
});
|
|
12649
|
-
await
|
|
13428
|
+
await rm8(tmpDir, { force: true, recursive: true });
|
|
12650
13429
|
if (!result.success) {
|
|
12651
13430
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
12652
13431
|
return;
|
|
12653
13432
|
}
|
|
12654
13433
|
const { readFileSync: readFileSync11, writeFileSync: writeFileSync6, readdirSync } = await import("fs");
|
|
12655
13434
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
12656
|
-
for (const
|
|
12657
|
-
const filePath =
|
|
13435
|
+
for (const file4 of files) {
|
|
13436
|
+
const filePath = join20(vendorDir, file4);
|
|
12658
13437
|
const content = readFileSync11(filePath, "utf-8");
|
|
12659
13438
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
12660
13439
|
continue;
|
|
@@ -12681,9 +13460,9 @@ __export(exports_buildSvelteVendor, {
|
|
|
12681
13460
|
buildSvelteVendor: () => buildSvelteVendor
|
|
12682
13461
|
});
|
|
12683
13462
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
12684
|
-
import { join as
|
|
12685
|
-
import { rm as
|
|
12686
|
-
var {build:
|
|
13463
|
+
import { join as join21 } from "path";
|
|
13464
|
+
import { rm as rm9 } from "fs/promises";
|
|
13465
|
+
var {build: bunBuild6 } = globalThis.Bun;
|
|
12687
13466
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
12688
13467
|
try {
|
|
12689
13468
|
__require.resolve(specifier);
|
|
@@ -12695,18 +13474,18 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12695
13474
|
const specifiers = resolveVendorSpecifiers2();
|
|
12696
13475
|
if (specifiers.length === 0)
|
|
12697
13476
|
return;
|
|
12698
|
-
const vendorDir =
|
|
13477
|
+
const vendorDir = join21(buildDir, "svelte", "vendor");
|
|
12699
13478
|
mkdirSync9(vendorDir, { recursive: true });
|
|
12700
|
-
const tmpDir =
|
|
13479
|
+
const tmpDir = join21(buildDir, "_svelte_vendor_tmp");
|
|
12701
13480
|
mkdirSync9(tmpDir, { recursive: true });
|
|
12702
13481
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12703
13482
|
const safeName = toSafeFileName4(specifier);
|
|
12704
|
-
const entryPath =
|
|
13483
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
12705
13484
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12706
13485
|
`);
|
|
12707
13486
|
return entryPath;
|
|
12708
13487
|
}));
|
|
12709
|
-
const result = await
|
|
13488
|
+
const result = await bunBuild6({
|
|
12710
13489
|
entrypoints,
|
|
12711
13490
|
format: "esm",
|
|
12712
13491
|
minify: false,
|
|
@@ -12716,7 +13495,7 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12716
13495
|
target: "browser",
|
|
12717
13496
|
throw: false
|
|
12718
13497
|
});
|
|
12719
|
-
await
|
|
13498
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
12720
13499
|
if (!result.success) {
|
|
12721
13500
|
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
12722
13501
|
}
|
|
@@ -12774,11 +13553,11 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12774
13553
|
if (Object.keys(vendorPaths).length === 0)
|
|
12775
13554
|
return;
|
|
12776
13555
|
const { readdirSync } = await import("fs");
|
|
12777
|
-
const { join:
|
|
13556
|
+
const { join: join22 } = await import("path");
|
|
12778
13557
|
const allFiles = [];
|
|
12779
13558
|
for (const dir of vendorDirs) {
|
|
12780
13559
|
try {
|
|
12781
|
-
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) =>
|
|
13560
|
+
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) => join22(dir, f2));
|
|
12782
13561
|
allFiles.push(...files);
|
|
12783
13562
|
} catch {}
|
|
12784
13563
|
}
|
|
@@ -12804,7 +13583,7 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12804
13583
|
const namedImportRe = new RegExp(`\\bimport\\s*\\{[^}]*\\b${ident}\\b[^}]*\\}\\s*from\\b`);
|
|
12805
13584
|
if (namedImportRe.test(content))
|
|
12806
13585
|
continue;
|
|
12807
|
-
const importPathRe = /from\s
|
|
13586
|
+
const importPathRe = /(?:from\s+|import\s*)["']([^"']+)["']/g;
|
|
12808
13587
|
let pathMatch;
|
|
12809
13588
|
let sourcePath;
|
|
12810
13589
|
while ((pathMatch = importPathRe.exec(content)) !== null) {
|
|
@@ -12814,7 +13593,8 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12814
13593
|
const base = p2.split("/").pop()?.replace(/\.[mc]?js$/, "");
|
|
12815
13594
|
if (!base)
|
|
12816
13595
|
continue;
|
|
12817
|
-
|
|
13596
|
+
const normalized = base.startsWith("_") ? base.slice(1) : base;
|
|
13597
|
+
if (normalized === ident || normalized.endsWith(`_${ident}`)) {
|
|
12818
13598
|
sourcePath = p2;
|
|
12819
13599
|
break;
|
|
12820
13600
|
}
|
|
@@ -12847,16 +13627,16 @@ var init_rewriteImports = __esm(() => {
|
|
|
12847
13627
|
import {
|
|
12848
13628
|
copyFileSync,
|
|
12849
13629
|
cpSync,
|
|
12850
|
-
existsSync as
|
|
13630
|
+
existsSync as existsSync19,
|
|
12851
13631
|
mkdirSync as mkdirSync10,
|
|
12852
13632
|
readFileSync as readFileSync11,
|
|
12853
13633
|
rmSync as rmSync2,
|
|
12854
13634
|
statSync,
|
|
12855
13635
|
writeFileSync as writeFileSync6
|
|
12856
13636
|
} from "fs";
|
|
12857
|
-
import { basename as
|
|
13637
|
+
import { basename as basename8, dirname as dirname13, extname as extname7, join as join22, relative as relative10, resolve as resolve19 } from "path";
|
|
12858
13638
|
import { cwd, env as env2, exit } from "process";
|
|
12859
|
-
var {build:
|
|
13639
|
+
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
12860
13640
|
var isDev, isBuildTraceEnabled = () => {
|
|
12861
13641
|
const value = env2.ABSOLUTE_BUILD_TRACE?.toLowerCase();
|
|
12862
13642
|
return value === "1" || value === "true" || value === "yes";
|
|
@@ -12932,8 +13712,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12932
13712
|
mkdirSync10(htmxDestDir, { recursive: true });
|
|
12933
13713
|
const glob = new Glob7("htmx*.min.js");
|
|
12934
13714
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
12935
|
-
const src =
|
|
12936
|
-
const dest =
|
|
13715
|
+
const src = join22(htmxDir, relPath);
|
|
13716
|
+
const dest = join22(htmxDestDir, "htmx.min.js");
|
|
12937
13717
|
copyFileSync(src, dest);
|
|
12938
13718
|
return;
|
|
12939
13719
|
}
|
|
@@ -12945,8 +13725,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12945
13725
|
}
|
|
12946
13726
|
}, resolveAbsoluteVersion = async () => {
|
|
12947
13727
|
const candidates = [
|
|
12948
|
-
|
|
12949
|
-
|
|
13728
|
+
resolve19(import.meta.dir, "..", "..", "package.json"),
|
|
13729
|
+
resolve19(import.meta.dir, "..", "package.json")
|
|
12950
13730
|
];
|
|
12951
13731
|
const resolveCandidate = async (remaining) => {
|
|
12952
13732
|
const [candidate, ...rest] = remaining;
|
|
@@ -12961,34 +13741,34 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12961
13741
|
globalThis.__absoluteVersion = pkg.version;
|
|
12962
13742
|
};
|
|
12963
13743
|
await resolveCandidate(candidates);
|
|
12964
|
-
}, SKIP_DIRS, addWorkerPathIfExists = (
|
|
12965
|
-
const absPath =
|
|
13744
|
+
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
13745
|
+
const absPath = resolve19(file4, "..", relPath);
|
|
12966
13746
|
try {
|
|
12967
13747
|
statSync(absPath);
|
|
12968
13748
|
workerPaths.add(absPath);
|
|
12969
13749
|
} catch {}
|
|
12970
|
-
}, collectWorkerPathsFromContent = (content, pattern,
|
|
13750
|
+
}, collectWorkerPathsFromContent = (content, pattern, file4, workerPaths) => {
|
|
12971
13751
|
pattern.lastIndex = 0;
|
|
12972
13752
|
let match;
|
|
12973
13753
|
while ((match = pattern.exec(content)) !== null) {
|
|
12974
13754
|
const [, relPath] = match;
|
|
12975
13755
|
if (!relPath)
|
|
12976
13756
|
continue;
|
|
12977
|
-
addWorkerPathIfExists(
|
|
13757
|
+
addWorkerPathIfExists(file4, relPath, workerPaths);
|
|
12978
13758
|
}
|
|
12979
|
-
}, collectWorkerPathsFromFile = (
|
|
12980
|
-
const content = readFileSync11(
|
|
13759
|
+
}, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
|
|
13760
|
+
const content = readFileSync11(file4, "utf-8");
|
|
12981
13761
|
for (const pattern of patterns) {
|
|
12982
|
-
collectWorkerPathsFromContent(content, pattern,
|
|
13762
|
+
collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
|
|
12983
13763
|
}
|
|
12984
13764
|
}, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
|
|
12985
13765
|
const glob = new Glob7("**/*.{ts,tsx,js,jsx,svelte,vue}");
|
|
12986
|
-
for await (const
|
|
12987
|
-
const relToDir =
|
|
13766
|
+
for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
|
|
13767
|
+
const relToDir = file4.slice(dir.length + 1);
|
|
12988
13768
|
const [firstSegment] = relToDir.split("/");
|
|
12989
13769
|
if (firstSegment && SKIP_DIRS.has(firstSegment))
|
|
12990
13770
|
continue;
|
|
12991
|
-
collectWorkerPathsFromFile(
|
|
13771
|
+
collectWorkerPathsFromFile(file4, patterns, workerPaths);
|
|
12992
13772
|
}
|
|
12993
13773
|
}, scanWorkerReferences = async (dirs) => {
|
|
12994
13774
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
@@ -13008,7 +13788,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13008
13788
|
vuePagesPath
|
|
13009
13789
|
}) => {
|
|
13010
13790
|
const { readdirSync: readDir } = await import("fs");
|
|
13011
|
-
const devIndexDir =
|
|
13791
|
+
const devIndexDir = join22(buildPath, "_src_indexes");
|
|
13012
13792
|
mkdirSync10(devIndexDir, { recursive: true });
|
|
13013
13793
|
if (reactIndexesPath && reactPagesPath) {
|
|
13014
13794
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -13020,41 +13800,41 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13020
13800
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
13021
13801
|
}
|
|
13022
13802
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
13023
|
-
if (!
|
|
13803
|
+
if (!existsSync19(reactIndexesPath)) {
|
|
13024
13804
|
return;
|
|
13025
13805
|
}
|
|
13026
|
-
const indexFiles = readDir(reactIndexesPath).filter((
|
|
13027
|
-
const pagesRel = relative10(process.cwd(),
|
|
13028
|
-
for (const
|
|
13029
|
-
let content = readFileSync11(
|
|
13806
|
+
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
13807
|
+
const pagesRel = relative10(process.cwd(), resolve19(reactPagesPath)).replace(/\\/g, "/");
|
|
13808
|
+
for (const file4 of indexFiles) {
|
|
13809
|
+
let content = readFileSync11(join22(reactIndexesPath, file4), "utf-8");
|
|
13030
13810
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
13031
|
-
writeFileSync6(
|
|
13811
|
+
writeFileSync6(join22(devIndexDir, file4), content);
|
|
13032
13812
|
}
|
|
13033
13813
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
13034
|
-
const svelteIndexDir =
|
|
13035
|
-
const sveltePageEntries = svelteEntries.filter((
|
|
13814
|
+
const svelteIndexDir = join22(svelteDir, "generated", "indexes");
|
|
13815
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve19(file4).startsWith(resolve19(sveltePagesPath)));
|
|
13036
13816
|
for (const entry of sveltePageEntries) {
|
|
13037
|
-
const name =
|
|
13038
|
-
const indexFile =
|
|
13039
|
-
if (!
|
|
13817
|
+
const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
13818
|
+
const indexFile = join22(svelteIndexDir, "pages", `${name}.js`);
|
|
13819
|
+
if (!existsSync19(indexFile))
|
|
13040
13820
|
continue;
|
|
13041
13821
|
let content = readFileSync11(indexFile, "utf-8");
|
|
13042
|
-
const srcRel = relative10(process.cwd(),
|
|
13822
|
+
const srcRel = relative10(process.cwd(), resolve19(entry)).replace(/\\/g, "/");
|
|
13043
13823
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
13044
|
-
writeFileSync6(
|
|
13824
|
+
writeFileSync6(join22(devIndexDir, `${name}.svelte.js`), content);
|
|
13045
13825
|
}
|
|
13046
13826
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
13047
|
-
const vueIndexDir =
|
|
13048
|
-
const vuePageEntries = vueEntries.filter((
|
|
13827
|
+
const vueIndexDir = join22(vueDir, "generated", "indexes");
|
|
13828
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve19(file4).startsWith(resolve19(vuePagesPath)));
|
|
13049
13829
|
for (const entry of vuePageEntries) {
|
|
13050
|
-
const name =
|
|
13051
|
-
const indexFile =
|
|
13052
|
-
if (!
|
|
13830
|
+
const name = basename8(entry, ".vue");
|
|
13831
|
+
const indexFile = join22(vueIndexDir, `${name}.js`);
|
|
13832
|
+
if (!existsSync19(indexFile))
|
|
13053
13833
|
continue;
|
|
13054
13834
|
let content = readFileSync11(indexFile, "utf-8");
|
|
13055
|
-
const srcRel = relative10(process.cwd(),
|
|
13835
|
+
const srcRel = relative10(process.cwd(), resolve19(entry)).replace(/\\/g, "/");
|
|
13056
13836
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
13057
|
-
writeFileSync6(
|
|
13837
|
+
writeFileSync6(join22(devIndexDir, `${name}.vue.js`), content);
|
|
13058
13838
|
}
|
|
13059
13839
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
13060
13840
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -13065,7 +13845,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13065
13845
|
const last = allComments[allComments.length - 1];
|
|
13066
13846
|
if (!last?.[1])
|
|
13067
13847
|
return JSON.stringify(outputPath);
|
|
13068
|
-
const srcPath =
|
|
13848
|
+
const srcPath = resolve19(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
13069
13849
|
return JSON.stringify(srcPath);
|
|
13070
13850
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
13071
13851
|
let depth = 0;
|
|
@@ -13128,7 +13908,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13128
13908
|
const urlFileMap = new Map;
|
|
13129
13909
|
for (const srcPath of urlReferencedFiles) {
|
|
13130
13910
|
const rel = relative10(projectRoot, srcPath).replace(/\\/g, "/");
|
|
13131
|
-
const name =
|
|
13911
|
+
const name = basename8(srcPath);
|
|
13132
13912
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
13133
13913
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
13134
13914
|
urlFileMap.set(name, url);
|
|
@@ -13138,11 +13918,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13138
13918
|
}, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
|
|
13139
13919
|
const urlFileMap = new Map;
|
|
13140
13920
|
for (const srcPath of urlReferencedFiles) {
|
|
13141
|
-
const srcBase =
|
|
13142
|
-
const output = nonReactClientOutputs.find((artifact) =>
|
|
13921
|
+
const srcBase = basename8(srcPath).replace(/\.[^.]+$/, "");
|
|
13922
|
+
const output = nonReactClientOutputs.find((artifact) => basename8(artifact.path).startsWith(`${srcBase}.`));
|
|
13143
13923
|
if (!output)
|
|
13144
13924
|
continue;
|
|
13145
|
-
urlFileMap.set(
|
|
13925
|
+
urlFileMap.set(basename8(srcPath), `/${relative10(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
13146
13926
|
}
|
|
13147
13927
|
return urlFileMap;
|
|
13148
13928
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -13155,7 +13935,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13155
13935
|
let content = readFileSync11(outputPath, "utf-8");
|
|
13156
13936
|
let changed = false;
|
|
13157
13937
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
13158
|
-
const targetName =
|
|
13938
|
+
const targetName = basename8(relPath);
|
|
13159
13939
|
const resolvedPath = urlFileMap.get(targetName);
|
|
13160
13940
|
if (!resolvedPath)
|
|
13161
13941
|
return _match;
|
|
@@ -13214,6 +13994,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13214
13994
|
htmlDirectory,
|
|
13215
13995
|
htmxDirectory,
|
|
13216
13996
|
angularDirectory,
|
|
13997
|
+
emberDirectory,
|
|
13217
13998
|
svelteDirectory,
|
|
13218
13999
|
vueDirectory,
|
|
13219
14000
|
stylesConfig,
|
|
@@ -13275,10 +14056,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13275
14056
|
restoreTracePhase();
|
|
13276
14057
|
return;
|
|
13277
14058
|
}
|
|
13278
|
-
const traceDir =
|
|
14059
|
+
const traceDir = join22(buildPath2, ".absolute-trace");
|
|
13279
14060
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
13280
14061
|
mkdirSync10(traceDir, { recursive: true });
|
|
13281
|
-
writeFileSync6(
|
|
14062
|
+
writeFileSync6(join22(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
13282
14063
|
events: traceEvents,
|
|
13283
14064
|
frameworks: traceFrameworkNames,
|
|
13284
14065
|
generatedAt: new Date().toISOString(),
|
|
@@ -13303,26 +14084,29 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13303
14084
|
const svelteDir = svelteDirectory && validateSafePath(svelteDirectory, projectRoot);
|
|
13304
14085
|
const vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot);
|
|
13305
14086
|
const angularDir = angularDirectory && validateSafePath(angularDirectory, projectRoot);
|
|
14087
|
+
const emberDir = emberDirectory && validateSafePath(emberDirectory, projectRoot);
|
|
13306
14088
|
const islandBootstrapPath = islands?.bootstrap && validateSafePath(islands.bootstrap, projectRoot);
|
|
13307
14089
|
const islandRegistryPath = islands?.registry && validateSafePath(islands.registry, projectRoot);
|
|
13308
14090
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
13309
14091
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
13310
14092
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
13311
|
-
const reactIndexesPath = reactDir &&
|
|
13312
|
-
const reactPagesPath = reactDir &&
|
|
13313
|
-
const htmlPagesPath = htmlDir &&
|
|
13314
|
-
const htmlScriptsPath = htmlDir &&
|
|
13315
|
-
const sveltePagesPath = svelteDir &&
|
|
13316
|
-
const vuePagesPath = vueDir &&
|
|
13317
|
-
const htmxPagesPath = htmxDir &&
|
|
13318
|
-
const angularPagesPath = angularDir &&
|
|
14093
|
+
const reactIndexesPath = reactDir && join22(reactDir, "generated", "indexes");
|
|
14094
|
+
const reactPagesPath = reactDir && join22(reactDir, "pages");
|
|
14095
|
+
const htmlPagesPath = htmlDir && join22(htmlDir, "pages");
|
|
14096
|
+
const htmlScriptsPath = htmlDir && join22(htmlDir, "scripts");
|
|
14097
|
+
const sveltePagesPath = svelteDir && join22(svelteDir, "pages");
|
|
14098
|
+
const vuePagesPath = vueDir && join22(vueDir, "pages");
|
|
14099
|
+
const htmxPagesPath = htmxDir && join22(htmxDir, "pages");
|
|
14100
|
+
const angularPagesPath = angularDir && join22(angularDir, "pages");
|
|
14101
|
+
const emberPagesPath = emberDir && join22(emberDir, "pages");
|
|
13319
14102
|
const frontends = [
|
|
13320
14103
|
reactDir,
|
|
13321
14104
|
htmlDir,
|
|
13322
14105
|
htmxDir,
|
|
13323
14106
|
svelteDir,
|
|
13324
14107
|
vueDir,
|
|
13325
|
-
angularDir
|
|
14108
|
+
angularDir,
|
|
14109
|
+
emberDir
|
|
13326
14110
|
].filter(Boolean);
|
|
13327
14111
|
const isSingle = frontends.length === 1;
|
|
13328
14112
|
const frameworkNames = [
|
|
@@ -13331,7 +14115,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13331
14115
|
htmxDir && "htmx",
|
|
13332
14116
|
svelteDir && "svelte",
|
|
13333
14117
|
vueDir && "vue",
|
|
13334
|
-
angularDir && "angular"
|
|
14118
|
+
angularDir && "angular",
|
|
14119
|
+
emberDir && "ember"
|
|
13335
14120
|
].filter((name) => Boolean(name));
|
|
13336
14121
|
traceFrameworkNames = frameworkNames;
|
|
13337
14122
|
sendTelemetryEvent("build:start", {
|
|
@@ -13346,19 +14131,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13346
14131
|
htmlDir,
|
|
13347
14132
|
vueDir,
|
|
13348
14133
|
angularDir,
|
|
13349
|
-
islandBootstrapPath &&
|
|
14134
|
+
islandBootstrapPath && dirname13(islandBootstrapPath)
|
|
13350
14135
|
].filter((dir) => Boolean(dir));
|
|
13351
14136
|
const clientRoot = isSingle ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
|
|
13352
14137
|
const serverDirMap = [];
|
|
13353
14138
|
if (svelteDir)
|
|
13354
14139
|
serverDirMap.push({
|
|
13355
14140
|
dir: svelteDir,
|
|
13356
|
-
subdir:
|
|
14141
|
+
subdir: join22("generated", "server")
|
|
13357
14142
|
});
|
|
13358
14143
|
if (vueDir)
|
|
13359
14144
|
serverDirMap.push({
|
|
13360
14145
|
dir: vueDir,
|
|
13361
|
-
subdir:
|
|
14146
|
+
subdir: join22("generated", "server")
|
|
13362
14147
|
});
|
|
13363
14148
|
if (angularDir)
|
|
13364
14149
|
serverDirMap.push({ dir: angularDir, subdir: "generated" });
|
|
@@ -13368,8 +14153,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13368
14153
|
const [firstEntry] = serverDirMap;
|
|
13369
14154
|
if (!firstEntry)
|
|
13370
14155
|
throw new Error("Expected at least one server directory entry");
|
|
13371
|
-
serverRoot =
|
|
13372
|
-
serverOutDir =
|
|
14156
|
+
serverRoot = join22(firstEntry.dir, firstEntry.subdir);
|
|
14157
|
+
serverOutDir = join22(buildPath, basename8(firstEntry.dir));
|
|
13373
14158
|
} else if (serverDirMap.length > 1) {
|
|
13374
14159
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
13375
14160
|
serverOutDir = buildPath;
|
|
@@ -13381,13 +14166,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13381
14166
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
13382
14167
|
if (!isIncremental || !incrementalFiles)
|
|
13383
14168
|
return entryPoints;
|
|
13384
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
14169
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve19(f2)));
|
|
13385
14170
|
const matchingEntries = [];
|
|
13386
14171
|
for (const entry of entryPoints) {
|
|
13387
14172
|
const sourceFile = mapToSource(entry);
|
|
13388
14173
|
if (!sourceFile)
|
|
13389
14174
|
continue;
|
|
13390
|
-
if (!normalizedIncremental.has(
|
|
14175
|
+
if (!normalizedIncremental.has(resolve19(sourceFile)))
|
|
13391
14176
|
continue;
|
|
13392
14177
|
matchingEntries.push(entry);
|
|
13393
14178
|
}
|
|
@@ -13397,7 +14182,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13397
14182
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
13398
14183
|
}
|
|
13399
14184
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
13400
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
14185
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join22(buildPath, "assets"), {
|
|
13401
14186
|
force: true,
|
|
13402
14187
|
recursive: true
|
|
13403
14188
|
}));
|
|
@@ -13415,6 +14200,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13415
14200
|
svelteConventionResult,
|
|
13416
14201
|
vueConventionResult,
|
|
13417
14202
|
angularConventionResult,
|
|
14203
|
+
emberConventionResult,
|
|
13418
14204
|
allGlobalCssEntries
|
|
13419
14205
|
] = await Promise.all([
|
|
13420
14206
|
tailwindPromise,
|
|
@@ -13424,11 +14210,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13424
14210
|
sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
|
|
13425
14211
|
vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
|
|
13426
14212
|
angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
|
|
14213
|
+
emberPagesPath ? tracePhase("scan/ember-conventions", () => scanConventions(emberPagesPath, "*.{gjs,gts,ts}")) : emptyConventionResult,
|
|
13427
14214
|
stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
|
|
13428
14215
|
]);
|
|
13429
14216
|
const allSvelteEntries = svelteConventionResult.pageFiles;
|
|
13430
14217
|
const allVueEntries = vueConventionResult.pageFiles;
|
|
13431
14218
|
const allAngularEntries = angularConventionResult.pageFiles;
|
|
14219
|
+
const allEmberEntries = emberConventionResult.pageFiles;
|
|
13432
14220
|
const conventionsMap = {};
|
|
13433
14221
|
if (reactConventionResult.conventions)
|
|
13434
14222
|
conventionsMap.react = reactConventionResult.conventions;
|
|
@@ -13438,15 +14226,17 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13438
14226
|
conventionsMap.vue = vueConventionResult.conventions;
|
|
13439
14227
|
if (angularConventionResult.conventions)
|
|
13440
14228
|
conventionsMap.angular = angularConventionResult.conventions;
|
|
13441
|
-
|
|
14229
|
+
if (emberConventionResult.conventions)
|
|
14230
|
+
conventionsMap.ember = emberConventionResult.conventions;
|
|
14231
|
+
const notFoundFrameworks = ["react", "svelte", "vue", "angular", "ember"].filter((framework) => conventionsMap[framework]?.defaults?.notFound);
|
|
13442
14232
|
if (notFoundFrameworks.length > 1) {
|
|
13443
14233
|
logWarn(`Multiple frameworks define not-found convention files: ${notFoundFrameworks.join(", ")}. Only one will be used (priority: ${notFoundFrameworks[0]}). Remove not-found files from other frameworks to avoid ambiguity.`);
|
|
13444
14234
|
}
|
|
13445
14235
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
13446
14236
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
13447
|
-
if (entry.startsWith(
|
|
13448
|
-
const pageName =
|
|
13449
|
-
return
|
|
14237
|
+
if (entry.startsWith(resolve19(reactIndexesPath))) {
|
|
14238
|
+
const pageName = basename8(entry, ".tsx");
|
|
14239
|
+
return join22(reactPagesPath, `${pageName}.tsx`);
|
|
13450
14240
|
}
|
|
13451
14241
|
return null;
|
|
13452
14242
|
}) : allReactEntries;
|
|
@@ -13454,6 +14244,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13454
14244
|
const svelteEntries = isIncremental ? filterToIncrementalEntries(allSvelteEntries, (entry) => entry) : allSvelteEntries;
|
|
13455
14245
|
const vueEntries = isIncremental ? filterToIncrementalEntries(allVueEntries, (entry) => entry) : allVueEntries;
|
|
13456
14246
|
const angularEntries = isIncremental ? filterToIncrementalEntries(allAngularEntries, (entry) => entry) : allAngularEntries;
|
|
14247
|
+
const emberEntries = isIncremental ? filterToIncrementalEntries(allEmberEntries, (entry) => entry) : allEmberEntries;
|
|
13457
14248
|
const globalCssEntries = isIncremental ? filterToIncrementalEntries(allGlobalCssEntries, (entry) => entry) : allGlobalCssEntries;
|
|
13458
14249
|
const hmrClientBundlePromise = hmr && (htmlDir || htmxDir) ? buildHMRClient() : undefined;
|
|
13459
14250
|
const allFrameworkDirs = [
|
|
@@ -13468,6 +14259,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13468
14259
|
const shouldCompileSvelte = svelteDir && svelteEntries.length > 0;
|
|
13469
14260
|
const shouldCompileVue = vueDir && vueEntries.length > 0;
|
|
13470
14261
|
const shouldCompileAngular = angularDir && angularEntries.length > 0;
|
|
14262
|
+
const shouldCompileEmber = emberDir && emberEntries.length > 0;
|
|
13471
14263
|
const emptyStringArray = [];
|
|
13472
14264
|
const islandBuildInfo = islandRegistryPath ? await tracePhase("islands/registry", () => loadIslandRegistryBuildInfo(islandRegistryPath)) : null;
|
|
13473
14265
|
const islandFrameworkSources = islandBuildInfo ? collectIslandFrameworkSources(islandBuildInfo) : {};
|
|
@@ -13481,6 +14273,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13481
14273
|
{ svelteServerPaths, svelteIndexPaths, svelteClientPaths },
|
|
13482
14274
|
{ vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths },
|
|
13483
14275
|
{ clientPaths: angularClientPaths, serverPaths: angularServerPaths },
|
|
14276
|
+
{ clientPaths: emberClientPaths, serverPaths: emberServerPaths },
|
|
13484
14277
|
{ svelteClientPaths: islandSvelteClientPaths },
|
|
13485
14278
|
{ vueClientPaths: islandVueClientPaths },
|
|
13486
14279
|
{ clientPaths: islandAngularClientPaths }
|
|
@@ -13500,6 +14293,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13500
14293
|
clientPaths: [...emptyStringArray],
|
|
13501
14294
|
serverPaths: [...emptyStringArray]
|
|
13502
14295
|
},
|
|
14296
|
+
shouldCompileEmber ? tracePhase("compile/ember", () => Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber)).then((mod) => mod.compileEmber(emberEntries, emberDir, projectRoot, hmr))) : {
|
|
14297
|
+
clientPaths: [...emptyStringArray],
|
|
14298
|
+
serverPaths: [...emptyStringArray]
|
|
14299
|
+
},
|
|
13503
14300
|
shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
|
|
13504
14301
|
svelteClientPaths: [...emptyStringArray]
|
|
13505
14302
|
},
|
|
@@ -13516,7 +14313,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13516
14313
|
const clientPath = islandSvelteClientPaths[idx];
|
|
13517
14314
|
if (!sourcePath || !clientPath)
|
|
13518
14315
|
continue;
|
|
13519
|
-
islandSvelteClientPathMap.set(
|
|
14316
|
+
islandSvelteClientPathMap.set(resolve19(sourcePath), clientPath);
|
|
13520
14317
|
}
|
|
13521
14318
|
const islandVueClientPathMap = new Map;
|
|
13522
14319
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -13524,7 +14321,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13524
14321
|
const clientPath = islandVueClientPaths[idx];
|
|
13525
14322
|
if (!sourcePath || !clientPath)
|
|
13526
14323
|
continue;
|
|
13527
|
-
islandVueClientPathMap.set(
|
|
14324
|
+
islandVueClientPathMap.set(resolve19(sourcePath), clientPath);
|
|
13528
14325
|
}
|
|
13529
14326
|
const islandAngularClientPathMap = new Map;
|
|
13530
14327
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -13532,7 +14329,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13532
14329
|
const clientPath = islandAngularClientPaths[idx];
|
|
13533
14330
|
if (!sourcePath || !clientPath)
|
|
13534
14331
|
continue;
|
|
13535
|
-
islandAngularClientPathMap.set(
|
|
14332
|
+
islandAngularClientPathMap.set(resolve19(sourcePath), clientPath);
|
|
13536
14333
|
}
|
|
13537
14334
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
13538
14335
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -13543,7 +14340,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13543
14340
|
const compileReactConventions = async () => {
|
|
13544
14341
|
if (reactConventionSources.length === 0)
|
|
13545
14342
|
return emptyStringArray;
|
|
13546
|
-
const destDir =
|
|
14343
|
+
const destDir = join22(buildPath, "conventions", "react");
|
|
13547
14344
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13548
14345
|
mkdirSync10(destDir, { recursive: true });
|
|
13549
14346
|
const destPaths = [];
|
|
@@ -13551,7 +14348,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13551
14348
|
const source = reactConventionSources[idx];
|
|
13552
14349
|
if (!source)
|
|
13553
14350
|
continue;
|
|
13554
|
-
const result = await
|
|
14351
|
+
const result = await bunBuild7({
|
|
13555
14352
|
entrypoints: [source],
|
|
13556
14353
|
format: "esm",
|
|
13557
14354
|
jsx: { development: false },
|
|
@@ -13559,7 +14356,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13559
14356
|
naming: `${idx}-[name].[ext]`,
|
|
13560
14357
|
outdir: destDir,
|
|
13561
14358
|
plugins: [stylePreprocessorPlugin2],
|
|
13562
|
-
root:
|
|
14359
|
+
root: dirname13(source),
|
|
13563
14360
|
target: "bun",
|
|
13564
14361
|
throw: false,
|
|
13565
14362
|
tsconfig: "./tsconfig.json"
|
|
@@ -13587,7 +14384,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13587
14384
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
13588
14385
|
]);
|
|
13589
14386
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
13590
|
-
const destDir =
|
|
14387
|
+
const destDir = join22(buildPath, "conventions", framework);
|
|
13591
14388
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13592
14389
|
mkdirSync10(destDir, { recursive: true });
|
|
13593
14390
|
const destPaths = [];
|
|
@@ -13595,8 +14392,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13595
14392
|
const compiledPath = compiledPaths[idx];
|
|
13596
14393
|
if (!compiledPath)
|
|
13597
14394
|
continue;
|
|
13598
|
-
const name =
|
|
13599
|
-
const result = await
|
|
14395
|
+
const name = basename8(compiledPath).replace(/\.[^.]+$/, "");
|
|
14396
|
+
const result = await bunBuild7({
|
|
13600
14397
|
entrypoints: [compiledPath],
|
|
13601
14398
|
format: "esm",
|
|
13602
14399
|
minify: !isDev,
|
|
@@ -13660,7 +14457,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13660
14457
|
}
|
|
13661
14458
|
})) : {
|
|
13662
14459
|
entries: [],
|
|
13663
|
-
generatedRoot:
|
|
14460
|
+
generatedRoot: join22(buildPath, "_island_entries")
|
|
13664
14461
|
};
|
|
13665
14462
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
13666
14463
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -13696,7 +14493,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13696
14493
|
return {};
|
|
13697
14494
|
}
|
|
13698
14495
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
13699
|
-
const refreshEntry =
|
|
14496
|
+
const refreshEntry = join22(reactIndexesPath, "_refresh.tsx");
|
|
13700
14497
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
13701
14498
|
reactClientEntryPoints.push(refreshEntry);
|
|
13702
14499
|
}
|
|
@@ -13800,19 +14597,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13800
14597
|
throw: false
|
|
13801
14598
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
13802
14599
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
13803
|
-
rmSync2(
|
|
14600
|
+
rmSync2(join22(buildPath, "react", "generated", "indexes"), {
|
|
13804
14601
|
force: true,
|
|
13805
14602
|
recursive: true
|
|
13806
14603
|
});
|
|
13807
14604
|
}
|
|
13808
14605
|
if (angularDir && angularClientPaths.length > 0) {
|
|
13809
|
-
rmSync2(
|
|
14606
|
+
rmSync2(join22(buildPath, "angular", "indexes"), {
|
|
13810
14607
|
force: true,
|
|
13811
14608
|
recursive: true
|
|
13812
14609
|
});
|
|
13813
14610
|
}
|
|
13814
14611
|
if (islandClientEntryPoints.length > 0) {
|
|
13815
|
-
rmSync2(
|
|
14612
|
+
rmSync2(join22(buildPath, "islands"), {
|
|
13816
14613
|
force: true,
|
|
13817
14614
|
recursive: true
|
|
13818
14615
|
});
|
|
@@ -13825,7 +14622,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13825
14622
|
globalCssResult,
|
|
13826
14623
|
vueCssResult
|
|
13827
14624
|
] = await Promise.all([
|
|
13828
|
-
serverEntryPoints.length > 0 ? tracePhase("bun/server", () =>
|
|
14625
|
+
serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7(mergeBunBuildConfig({
|
|
13829
14626
|
conditions: svelteResolveConditions,
|
|
13830
14627
|
entrypoints: serverEntryPoints,
|
|
13831
14628
|
external: serverBuildExternals,
|
|
@@ -13838,8 +14635,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13838
14635
|
throw: false,
|
|
13839
14636
|
tsconfig: "./tsconfig.json"
|
|
13840
14637
|
}, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
|
|
13841
|
-
reactBuildConfig ? tracePhase("bun/react-client", () =>
|
|
13842
|
-
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () =>
|
|
14638
|
+
reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
|
|
14639
|
+
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
|
|
13843
14640
|
conditions: svelteResolveConditions,
|
|
13844
14641
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
13845
14642
|
entrypoints: nonReactClientEntryPoints,
|
|
@@ -13859,7 +14656,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13859
14656
|
throw: false,
|
|
13860
14657
|
tsconfig: "./tsconfig.json"
|
|
13861
14658
|
}, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
|
|
13862
|
-
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () =>
|
|
14659
|
+
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
|
|
13863
14660
|
conditions: svelteResolveConditions,
|
|
13864
14661
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
13865
14662
|
entrypoints: islandClientEntryPoints,
|
|
@@ -13878,19 +14675,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13878
14675
|
throw: false,
|
|
13879
14676
|
tsconfig: "./tsconfig.json"
|
|
13880
14677
|
}, resolveBunBuildOverride(bunBuildConfig, "islandClient")))) : undefined,
|
|
13881
|
-
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () =>
|
|
14678
|
+
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
13882
14679
|
entrypoints: globalCssEntries,
|
|
13883
14680
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
13884
|
-
outdir: stylesDir ?
|
|
14681
|
+
outdir: stylesDir ? join22(buildPath, basename8(stylesDir)) : buildPath,
|
|
13885
14682
|
plugins: [stylePreprocessorPlugin2],
|
|
13886
14683
|
root: stylesDir || clientRoot,
|
|
13887
14684
|
target: "browser",
|
|
13888
14685
|
throw: false
|
|
13889
14686
|
}, resolveBunBuildOverride(bunBuildConfig, "globalCss")))) : undefined,
|
|
13890
|
-
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () =>
|
|
14687
|
+
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
13891
14688
|
entrypoints: vueCssPaths,
|
|
13892
14689
|
naming: `[name].[hash].[ext]`,
|
|
13893
|
-
outdir:
|
|
14690
|
+
outdir: join22(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
|
|
13894
14691
|
target: "browser",
|
|
13895
14692
|
throw: false
|
|
13896
14693
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -13958,7 +14755,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13958
14755
|
const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
|
|
13959
14756
|
const jsArtifacts = serverOutputs.filter((artifact) => artifact.path.endsWith(".js"));
|
|
13960
14757
|
await tracePhase("postprocess/server-angular-vendor-imports", () => Promise.all(jsArtifacts.map(async (artifact) => {
|
|
13961
|
-
const fileDir =
|
|
14758
|
+
const fileDir = dirname13(artifact.path);
|
|
13962
14759
|
const relativePaths = {};
|
|
13963
14760
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
13964
14761
|
const rel = relative10(fileDir, absolute);
|
|
@@ -14012,14 +14809,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14012
14809
|
], buildPath)
|
|
14013
14810
|
};
|
|
14014
14811
|
for (const artifact of serverOutputs) {
|
|
14015
|
-
if (
|
|
14812
|
+
if (extname7(artifact.path) !== ".js")
|
|
14016
14813
|
continue;
|
|
14017
|
-
const fileWithHash =
|
|
14814
|
+
const fileWithHash = basename8(artifact.path);
|
|
14018
14815
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
14019
14816
|
if (!baseName)
|
|
14020
14817
|
continue;
|
|
14021
14818
|
manifest[toPascal(baseName)] = artifact.path;
|
|
14022
14819
|
}
|
|
14820
|
+
for (const serverPath of emberServerPaths) {
|
|
14821
|
+
const fileBase = basename8(serverPath, ".js");
|
|
14822
|
+
manifest[toPascal(fileBase)] = serverPath;
|
|
14823
|
+
}
|
|
14023
14824
|
const shouldCopyHtmx = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/htmx/") && f2.endsWith(".html"));
|
|
14024
14825
|
const shouldUpdateHtmlAssetPaths = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
14025
14826
|
const shouldUpdateHtmxAssetPaths = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/htmx/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
@@ -14038,7 +14839,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14038
14839
|
const processHtmlPages = async () => {
|
|
14039
14840
|
if (!(htmlDir && htmlPagesPath))
|
|
14040
14841
|
return;
|
|
14041
|
-
const outputHtmlPages = isSingle ?
|
|
14842
|
+
const outputHtmlPages = isSingle ? join22(buildPath, "pages") : join22(buildPath, basename8(htmlDir), "pages");
|
|
14042
14843
|
mkdirSync10(outputHtmlPages, { recursive: true });
|
|
14043
14844
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
14044
14845
|
force: true,
|
|
@@ -14053,21 +14854,21 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14053
14854
|
for (const htmlFile of htmlPageFiles) {
|
|
14054
14855
|
if (hmr)
|
|
14055
14856
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
14056
|
-
const fileName =
|
|
14857
|
+
const fileName = basename8(htmlFile, ".html");
|
|
14057
14858
|
manifest[fileName] = htmlFile;
|
|
14058
14859
|
}
|
|
14059
14860
|
};
|
|
14060
14861
|
const processHtmxPages = async () => {
|
|
14061
14862
|
if (!(htmxDir && htmxPagesPath))
|
|
14062
14863
|
return;
|
|
14063
|
-
const outputHtmxPages = isSingle ?
|
|
14864
|
+
const outputHtmxPages = isSingle ? join22(buildPath, "pages") : join22(buildPath, basename8(htmxDir), "pages");
|
|
14064
14865
|
mkdirSync10(outputHtmxPages, { recursive: true });
|
|
14065
14866
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
14066
14867
|
force: true,
|
|
14067
14868
|
recursive: true
|
|
14068
14869
|
});
|
|
14069
14870
|
if (shouldCopyHtmx) {
|
|
14070
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
14871
|
+
const htmxDestDir = isSingle ? buildPath : join22(buildPath, basename8(htmxDir));
|
|
14071
14872
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
14072
14873
|
}
|
|
14073
14874
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -14079,7 +14880,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14079
14880
|
for (const htmxFile of htmxPageFiles) {
|
|
14080
14881
|
if (hmr)
|
|
14081
14882
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
14082
|
-
const fileName =
|
|
14883
|
+
const fileName = basename8(htmxFile, ".html");
|
|
14083
14884
|
manifest[fileName] = htmxFile;
|
|
14084
14885
|
}
|
|
14085
14886
|
};
|
|
@@ -14128,9 +14929,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14128
14929
|
writeBuildTrace(buildPath);
|
|
14129
14930
|
return { conventions: conventionsMap, manifest };
|
|
14130
14931
|
}
|
|
14131
|
-
writeFileSync6(
|
|
14932
|
+
writeFileSync6(join22(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
14132
14933
|
if (Object.keys(conventionsMap).length > 0) {
|
|
14133
|
-
writeFileSync6(
|
|
14934
|
+
writeFileSync6(join22(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
14134
14935
|
}
|
|
14135
14936
|
writeBuildTrace(buildPath);
|
|
14136
14937
|
if (tailwind && mode === "production") {
|
|
@@ -14226,10 +15027,156 @@ var init_build = __esm(() => {
|
|
|
14226
15027
|
};
|
|
14227
15028
|
});
|
|
14228
15029
|
|
|
15030
|
+
// src/build/buildEmberVendor.ts
|
|
15031
|
+
import { mkdirSync as mkdirSync11, existsSync as existsSync20 } from "fs";
|
|
15032
|
+
import { join as join23 } from "path";
|
|
15033
|
+
import { rm as rm10 } from "fs/promises";
|
|
15034
|
+
var {build: bunBuild8 } = globalThis.Bun;
|
|
15035
|
+
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
15036
|
+
// implementations for macros that would normally be replaced at
|
|
15037
|
+
// compile time by Embroider's babel plugin. AbsoluteJS doesn't run
|
|
15038
|
+
// babel, so working defaults are shipped instead.
|
|
15039
|
+
const isProd = () => {
|
|
15040
|
+
try {
|
|
15041
|
+
return globalThis.process?.env?.NODE_ENV === 'production';
|
|
15042
|
+
} catch {
|
|
15043
|
+
return false;
|
|
15044
|
+
}
|
|
15045
|
+
};
|
|
15046
|
+
|
|
15047
|
+
export const each = (arr) => {
|
|
15048
|
+
if (!Array.isArray(arr)) {
|
|
15049
|
+
throw new Error('the argument to each() must be an array');
|
|
15050
|
+
}
|
|
15051
|
+
return arr;
|
|
15052
|
+
};
|
|
15053
|
+
export const macroCondition = (predicate) => predicate;
|
|
15054
|
+
export const isDevelopingApp = () => !isProd();
|
|
15055
|
+
export const isTesting = () => false;
|
|
15056
|
+
export const setTesting = () => {};
|
|
15057
|
+
export const dependencySatisfies = () => false;
|
|
15058
|
+
export const appEmberSatisfies = () => false;
|
|
15059
|
+
export const getConfig = () => undefined;
|
|
15060
|
+
export const getOwnConfig = () => undefined;
|
|
15061
|
+
export const getGlobalConfig = () => ({});
|
|
15062
|
+
export const config = () => undefined;
|
|
15063
|
+
export const failBuild = (msg) => { throw new Error('failBuild: ' + msg); };
|
|
15064
|
+
export const moduleExists = () => false;
|
|
15065
|
+
export const importSync = (specifier) => {
|
|
15066
|
+
throw new Error('importSync(' + specifier + '): not supported by the AbsoluteJS Ember adapter \u2014 use dynamic import() instead');
|
|
15067
|
+
};
|
|
15068
|
+
`, resolveEmberSpecifier = (specifier, cwd2) => {
|
|
15069
|
+
if (specifier === "@embroider/macros") {
|
|
15070
|
+
return {
|
|
15071
|
+
inlineSource: generateMacrosShim(),
|
|
15072
|
+
resolveTo: "",
|
|
15073
|
+
specifier
|
|
15074
|
+
};
|
|
15075
|
+
}
|
|
15076
|
+
const standaloneSpecifiers = new Set([
|
|
15077
|
+
"@glimmer/component",
|
|
15078
|
+
"@glimmer/tracking",
|
|
15079
|
+
"@simple-dom/serializer"
|
|
15080
|
+
]);
|
|
15081
|
+
if (standaloneSpecifiers.has(specifier)) {
|
|
15082
|
+
return { resolveTo: specifier, specifier };
|
|
15083
|
+
}
|
|
15084
|
+
const emberInternalPath = join23(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
15085
|
+
if (!existsSync20(emberInternalPath)) {
|
|
15086
|
+
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
15087
|
+
}
|
|
15088
|
+
return { resolveTo: emberInternalPath, specifier };
|
|
15089
|
+
}, REQUIRED_EMBER_SPECIFIERS, SPECIFIERS_WITH_DEFAULT_EXPORT, generateVendorEntrySource2 = (resolution) => {
|
|
15090
|
+
if (resolution.inlineSource !== undefined) {
|
|
15091
|
+
return resolution.inlineSource;
|
|
15092
|
+
}
|
|
15093
|
+
const target = JSON.stringify(resolution.resolveTo);
|
|
15094
|
+
const lines = [`export * from ${target};`];
|
|
15095
|
+
if (SPECIFIERS_WITH_DEFAULT_EXPORT.has(resolution.specifier)) {
|
|
15096
|
+
lines.push(`import __default__ from ${target};`);
|
|
15097
|
+
lines.push(`export default __default__;`);
|
|
15098
|
+
}
|
|
15099
|
+
return lines.join(`
|
|
15100
|
+
`) + `
|
|
15101
|
+
`;
|
|
15102
|
+
}, createEmberResolverPlugin = (cwd2, macrosShimPath) => ({
|
|
15103
|
+
name: "absolutejs-ember-resolver",
|
|
15104
|
+
setup(build2) {
|
|
15105
|
+
const standalonePackages = new Set([
|
|
15106
|
+
"@glimmer/component",
|
|
15107
|
+
"@glimmer/tracking",
|
|
15108
|
+
"@glimmer/env",
|
|
15109
|
+
"@simple-dom/serializer"
|
|
15110
|
+
]);
|
|
15111
|
+
build2.onResolve({ filter: /^@embroider\/macros$/ }, () => ({ path: macrosShimPath }));
|
|
15112
|
+
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
15113
|
+
if (standalonePackages.has(args.path)) {
|
|
15114
|
+
return;
|
|
15115
|
+
}
|
|
15116
|
+
const internal = join23(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
15117
|
+
if (existsSync20(internal)) {
|
|
15118
|
+
return { path: internal };
|
|
15119
|
+
}
|
|
15120
|
+
return;
|
|
15121
|
+
});
|
|
15122
|
+
}
|
|
15123
|
+
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
15124
|
+
const vendorDir = join23(buildDir, "ember", "vendor");
|
|
15125
|
+
mkdirSync11(vendorDir, { recursive: true });
|
|
15126
|
+
const tmpDir = join23(buildDir, "_ember_vendor_tmp");
|
|
15127
|
+
mkdirSync11(tmpDir, { recursive: true });
|
|
15128
|
+
const macrosShimPath = join23(tmpDir, "embroider_macros_shim.js");
|
|
15129
|
+
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
15130
|
+
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
15131
|
+
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
15132
|
+
const safeName = toSafeFileName5(resolution.specifier);
|
|
15133
|
+
const entryPath = join23(tmpDir, `${safeName}.js`);
|
|
15134
|
+
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
15135
|
+
` : generateVendorEntrySource2(resolution);
|
|
15136
|
+
await Bun.write(entryPath, source);
|
|
15137
|
+
return entryPath;
|
|
15138
|
+
}));
|
|
15139
|
+
const result = await bunBuild8({
|
|
15140
|
+
entrypoints,
|
|
15141
|
+
format: "esm",
|
|
15142
|
+
minify: false,
|
|
15143
|
+
naming: "[name].[ext]",
|
|
15144
|
+
outdir: vendorDir,
|
|
15145
|
+
plugins: [createEmberResolverPlugin(cwd2, macrosShimPath)],
|
|
15146
|
+
splitting: true,
|
|
15147
|
+
target: "browser",
|
|
15148
|
+
throw: false
|
|
15149
|
+
});
|
|
15150
|
+
await rm10(tmpDir, { force: true, recursive: true });
|
|
15151
|
+
if (!result.success) {
|
|
15152
|
+
console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
|
|
15153
|
+
}
|
|
15154
|
+
return REQUIRED_EMBER_SPECIFIERS;
|
|
15155
|
+
}, computeEmberVendorPaths = () => {
|
|
15156
|
+
const paths = {};
|
|
15157
|
+
for (const specifier of REQUIRED_EMBER_SPECIFIERS) {
|
|
15158
|
+
paths[specifier] = `/ember/vendor/${toSafeFileName5(specifier)}.js`;
|
|
15159
|
+
}
|
|
15160
|
+
return paths;
|
|
15161
|
+
};
|
|
15162
|
+
var init_buildEmberVendor = __esm(() => {
|
|
15163
|
+
REQUIRED_EMBER_SPECIFIERS = [
|
|
15164
|
+
"@ember/template-compiler",
|
|
15165
|
+
"@ember/renderer",
|
|
15166
|
+
"@glimmer/component",
|
|
15167
|
+
"@glimmer/tracking",
|
|
15168
|
+
"@embroider/macros"
|
|
15169
|
+
];
|
|
15170
|
+
SPECIFIERS_WITH_DEFAULT_EXPORT = new Set([
|
|
15171
|
+
"@glimmer/component",
|
|
15172
|
+
"@simple-dom/serializer"
|
|
15173
|
+
]);
|
|
15174
|
+
});
|
|
15175
|
+
|
|
14229
15176
|
// src/dev/dependencyGraph.ts
|
|
14230
|
-
import { existsSync as
|
|
15177
|
+
import { existsSync as existsSync21, readFileSync as readFileSync12 } from "fs";
|
|
14231
15178
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
14232
|
-
import { resolve as
|
|
15179
|
+
import { resolve as resolve20 } from "path";
|
|
14233
15180
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
14234
15181
|
const lower = filePath.toLowerCase();
|
|
14235
15182
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -14243,8 +15190,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14243
15190
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
14244
15191
|
return null;
|
|
14245
15192
|
}
|
|
14246
|
-
const fromDir =
|
|
14247
|
-
const normalized =
|
|
15193
|
+
const fromDir = resolve20(fromFile, "..");
|
|
15194
|
+
const normalized = resolve20(fromDir, importPath);
|
|
14248
15195
|
const extensions = [
|
|
14249
15196
|
".ts",
|
|
14250
15197
|
".tsx",
|
|
@@ -14257,10 +15204,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14257
15204
|
];
|
|
14258
15205
|
for (const ext of extensions) {
|
|
14259
15206
|
const withExt = normalized + ext;
|
|
14260
|
-
if (
|
|
15207
|
+
if (existsSync21(withExt))
|
|
14261
15208
|
return withExt;
|
|
14262
15209
|
}
|
|
14263
|
-
if (
|
|
15210
|
+
if (existsSync21(normalized))
|
|
14264
15211
|
return normalized;
|
|
14265
15212
|
return null;
|
|
14266
15213
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -14274,8 +15221,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14274
15221
|
dependents.delete(normalizedPath);
|
|
14275
15222
|
}
|
|
14276
15223
|
}, addFileToGraph = (graph, filePath) => {
|
|
14277
|
-
const normalizedPath =
|
|
14278
|
-
if (!
|
|
15224
|
+
const normalizedPath = resolve20(filePath);
|
|
15225
|
+
if (!existsSync21(normalizedPath))
|
|
14279
15226
|
return;
|
|
14280
15227
|
const dependencies = extractDependencies(normalizedPath);
|
|
14281
15228
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -14291,10 +15238,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14291
15238
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
14292
15239
|
const processedFiles = new Set;
|
|
14293
15240
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
14294
|
-
const resolvedDirs = directories.map((dir) =>
|
|
15241
|
+
const resolvedDirs = directories.map((dir) => resolve20(dir)).filter((dir) => existsSync21(dir));
|
|
14295
15242
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
14296
|
-
for (const
|
|
14297
|
-
const fullPath =
|
|
15243
|
+
for (const file4 of allFiles) {
|
|
15244
|
+
const fullPath = resolve20(file4);
|
|
14298
15245
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
14299
15246
|
continue;
|
|
14300
15247
|
if (processedFiles.has(fullPath))
|
|
@@ -14349,8 +15296,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14349
15296
|
resolveRegexMatches(styleUrlSingularRegex, content, filePath, dependencies);
|
|
14350
15297
|
extractStyleUrlsDependencies(content, filePath, dependencies);
|
|
14351
15298
|
}, extractJsDependencies = (filePath, content, loader) => {
|
|
14352
|
-
const
|
|
14353
|
-
const imports =
|
|
15299
|
+
const transpiler5 = loader === "tsx" ? tsTranspiler : jsTranspiler;
|
|
15300
|
+
const imports = transpiler5.scanImports(content);
|
|
14354
15301
|
const dependencies = [];
|
|
14355
15302
|
for (const imp of imports) {
|
|
14356
15303
|
const resolved = resolveImportPath2(imp.path, filePath);
|
|
@@ -14407,7 +15354,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14407
15354
|
return [];
|
|
14408
15355
|
}
|
|
14409
15356
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
14410
|
-
const normalizedPath =
|
|
15357
|
+
const normalizedPath = resolve20(changedFile);
|
|
14411
15358
|
const affected = new Set;
|
|
14412
15359
|
const toProcess = [normalizedPath];
|
|
14413
15360
|
const processNode = (current) => {
|
|
@@ -14447,7 +15394,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14447
15394
|
}
|
|
14448
15395
|
graph.dependents.delete(normalizedPath);
|
|
14449
15396
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
14450
|
-
const normalizedPath =
|
|
15397
|
+
const normalizedPath = resolve20(filePath);
|
|
14451
15398
|
removeDepsForFile(graph, normalizedPath);
|
|
14452
15399
|
removeDependentsForFile(graph, normalizedPath);
|
|
14453
15400
|
};
|
|
@@ -14490,16 +15437,17 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
14490
15437
|
};
|
|
14491
15438
|
|
|
14492
15439
|
// src/dev/configResolver.ts
|
|
14493
|
-
import { resolve as
|
|
15440
|
+
import { resolve as resolve21 } from "path";
|
|
14494
15441
|
var resolveBuildPaths = (config) => {
|
|
14495
15442
|
const cwd2 = process.cwd();
|
|
14496
15443
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
14497
|
-
const withDefault = (value, fallback) => normalize(
|
|
14498
|
-
const optional = (value) => value ? normalize(
|
|
15444
|
+
const withDefault = (value, fallback) => normalize(resolve21(cwd2, value ?? fallback));
|
|
15445
|
+
const optional = (value) => value ? normalize(resolve21(cwd2, value)) : undefined;
|
|
14499
15446
|
return {
|
|
14500
15447
|
angularDir: optional(config.angularDirectory),
|
|
14501
15448
|
assetsDir: optional(config.assetsDirectory),
|
|
14502
15449
|
buildDir: withDefault(config.buildDirectory, "build"),
|
|
15450
|
+
emberDir: optional(config.emberDirectory),
|
|
14503
15451
|
htmlDir: optional(config.htmlDirectory),
|
|
14504
15452
|
htmxDir: optional(config.htmxDirectory),
|
|
14505
15453
|
reactDir: optional(config.reactDirectory),
|
|
@@ -14566,6 +15514,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14566
15514
|
return "vue";
|
|
14567
15515
|
if (startsWithDir(resolved.angularDir))
|
|
14568
15516
|
return "angular";
|
|
15517
|
+
if (startsWithDir(resolved.emberDir))
|
|
15518
|
+
return "ember";
|
|
14569
15519
|
if (startsWithDir(resolved.htmlDir))
|
|
14570
15520
|
return "html";
|
|
14571
15521
|
if (startsWithDir(resolved.assetsDir))
|
|
@@ -14581,6 +15531,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14581
15531
|
return "vue";
|
|
14582
15532
|
if (normalized.includes("/angular/"))
|
|
14583
15533
|
return "angular";
|
|
15534
|
+
if (normalized.includes("/ember/"))
|
|
15535
|
+
return "ember";
|
|
14584
15536
|
if (normalized.includes("/html/"))
|
|
14585
15537
|
return "html";
|
|
14586
15538
|
}
|
|
@@ -14590,10 +15542,14 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14590
15542
|
return "svelte";
|
|
14591
15543
|
if (normalized.endsWith(".vue"))
|
|
14592
15544
|
return "vue";
|
|
15545
|
+
if (normalized.endsWith(".gjs") || normalized.endsWith(".gts"))
|
|
15546
|
+
return "ember";
|
|
14593
15547
|
if (normalized.endsWith(".html"))
|
|
14594
15548
|
return "html";
|
|
14595
15549
|
if (normalized.endsWith(".ts") && normalized.includes("angular"))
|
|
14596
15550
|
return "angular";
|
|
15551
|
+
if (normalized.endsWith(".ts") && normalized.includes("ember"))
|
|
15552
|
+
return "ember";
|
|
14597
15553
|
if (normalized.includes("/assets/"))
|
|
14598
15554
|
return "assets";
|
|
14599
15555
|
if (STYLE_EXTENSION_PATTERN2.test(normalized)) {
|
|
@@ -14638,6 +15594,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14638
15594
|
const cfg = resolved ?? {
|
|
14639
15595
|
angularDir: config.angularDirectory,
|
|
14640
15596
|
assetsDir: config.assetsDirectory,
|
|
15597
|
+
emberDir: config.emberDirectory,
|
|
14641
15598
|
htmlDir: config.htmlDirectory,
|
|
14642
15599
|
htmxDir: config.htmxDirectory,
|
|
14643
15600
|
reactDir: config.reactDirectory,
|
|
@@ -14648,6 +15605,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14648
15605
|
push(cfg.reactDir);
|
|
14649
15606
|
push(cfg.svelteDir);
|
|
14650
15607
|
push(cfg.vueDir);
|
|
15608
|
+
push(cfg.emberDir);
|
|
14651
15609
|
push(cfg.angularDir);
|
|
14652
15610
|
push(cfg.htmlDir, "pages");
|
|
14653
15611
|
push(cfg.htmlDir, "scripts");
|
|
@@ -14662,6 +15620,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14662
15620
|
cfg.svelteDir,
|
|
14663
15621
|
cfg.vueDir,
|
|
14664
15622
|
cfg.angularDir,
|
|
15623
|
+
cfg.emberDir,
|
|
14665
15624
|
cfg.htmlDir,
|
|
14666
15625
|
cfg.htmxDir
|
|
14667
15626
|
].filter((dir) => Boolean(dir)).map(normalizePath);
|
|
@@ -14684,8 +15643,8 @@ var init_pathUtils = __esm(() => {
|
|
|
14684
15643
|
|
|
14685
15644
|
// src/dev/fileWatcher.ts
|
|
14686
15645
|
import { watch } from "fs";
|
|
14687
|
-
import { existsSync as
|
|
14688
|
-
import { join as
|
|
15646
|
+
import { existsSync as existsSync22 } from "fs";
|
|
15647
|
+
import { join as join24, resolve as resolve22 } from "path";
|
|
14689
15648
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
14690
15649
|
try {
|
|
14691
15650
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -14712,16 +15671,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14712
15671
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
14713
15672
|
return;
|
|
14714
15673
|
}
|
|
14715
|
-
const fullPath =
|
|
15674
|
+
const fullPath = join24(absolutePath, filename).replace(/\\/g, "/");
|
|
14716
15675
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
14717
15676
|
return;
|
|
14718
15677
|
}
|
|
14719
|
-
if (event === "rename" && !
|
|
15678
|
+
if (event === "rename" && !existsSync22(fullPath)) {
|
|
14720
15679
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
14721
15680
|
onFileChange(fullPath);
|
|
14722
15681
|
return;
|
|
14723
15682
|
}
|
|
14724
|
-
if (
|
|
15683
|
+
if (existsSync22(fullPath)) {
|
|
14725
15684
|
onFileChange(fullPath);
|
|
14726
15685
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
14727
15686
|
}
|
|
@@ -14730,8 +15689,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14730
15689
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
14731
15690
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
14732
15691
|
paths.forEach((path) => {
|
|
14733
|
-
const absolutePath =
|
|
14734
|
-
if (!
|
|
15692
|
+
const absolutePath = resolve22(path).replace(/\\/g, "/");
|
|
15693
|
+
if (!existsSync22(absolutePath)) {
|
|
14735
15694
|
return;
|
|
14736
15695
|
}
|
|
14737
15696
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -14741,8 +15700,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14741
15700
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
14742
15701
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
14743
15702
|
watchPaths.forEach((path) => {
|
|
14744
|
-
const absolutePath =
|
|
14745
|
-
if (!
|
|
15703
|
+
const absolutePath = resolve22(path).replace(/\\/g, "/");
|
|
15704
|
+
if (!existsSync22(absolutePath)) {
|
|
14746
15705
|
return;
|
|
14747
15706
|
}
|
|
14748
15707
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -14756,13 +15715,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
14756
15715
|
});
|
|
14757
15716
|
|
|
14758
15717
|
// src/dev/assetStore.ts
|
|
14759
|
-
import { resolve as
|
|
15718
|
+
import { resolve as resolve23 } from "path";
|
|
14760
15719
|
import { readdir as readdir3, unlink } from "fs/promises";
|
|
14761
15720
|
var mimeTypes, getMimeType = (filePath) => {
|
|
14762
15721
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
14763
15722
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
14764
15723
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
14765
|
-
const fullPath =
|
|
15724
|
+
const fullPath = resolve23(dir, entry.name);
|
|
14766
15725
|
if (entry.isDirectory()) {
|
|
14767
15726
|
return walkAndClean(fullPath);
|
|
14768
15727
|
}
|
|
@@ -14778,10 +15737,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
14778
15737
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
14779
15738
|
const liveByIdentity = new Map;
|
|
14780
15739
|
for (const webPath of store.keys()) {
|
|
14781
|
-
const diskPath =
|
|
15740
|
+
const diskPath = resolve23(buildDir, webPath.slice(1));
|
|
14782
15741
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
14783
15742
|
}
|
|
14784
|
-
const absBuildDir =
|
|
15743
|
+
const absBuildDir = resolve23(buildDir);
|
|
14785
15744
|
Object.values(manifest).forEach((val) => {
|
|
14786
15745
|
if (!HASHED_FILE_RE.test(val))
|
|
14787
15746
|
return;
|
|
@@ -14799,7 +15758,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
14799
15758
|
} catch {}
|
|
14800
15759
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
14801
15760
|
if (entry.isDirectory()) {
|
|
14802
|
-
return scanDir(
|
|
15761
|
+
return scanDir(resolve23(dir, entry.name), `${prefix}${entry.name}/`);
|
|
14803
15762
|
}
|
|
14804
15763
|
if (!entry.name.startsWith("chunk-")) {
|
|
14805
15764
|
return null;
|
|
@@ -14808,7 +15767,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
14808
15767
|
if (store.has(webPath)) {
|
|
14809
15768
|
return null;
|
|
14810
15769
|
}
|
|
14811
|
-
return Bun.file(
|
|
15770
|
+
return Bun.file(resolve23(dir, entry.name)).bytes().then((bytes) => {
|
|
14812
15771
|
store.set(webPath, bytes);
|
|
14813
15772
|
return;
|
|
14814
15773
|
}).catch(() => {});
|
|
@@ -14830,7 +15789,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
14830
15789
|
for (const webPath of newIdentities.values()) {
|
|
14831
15790
|
if (store.has(webPath))
|
|
14832
15791
|
continue;
|
|
14833
|
-
loadPromises.push(Bun.file(
|
|
15792
|
+
loadPromises.push(Bun.file(resolve23(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
14834
15793
|
store.set(webPath, bytes);
|
|
14835
15794
|
return;
|
|
14836
15795
|
}).catch(() => {}));
|
|
@@ -14861,9 +15820,10 @@ var init_assetStore = __esm(() => {
|
|
|
14861
15820
|
|
|
14862
15821
|
// src/islands/pageMetadata.ts
|
|
14863
15822
|
import { readFileSync as readFileSync13 } from "fs";
|
|
14864
|
-
import { dirname as
|
|
15823
|
+
import { dirname as dirname14, resolve as resolve24 } from "path";
|
|
14865
15824
|
var pagePatterns, getPageDirs = (config) => [
|
|
14866
15825
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
15826
|
+
{ dir: config.emberDirectory, framework: "ember" },
|
|
14867
15827
|
{ dir: config.reactDirectory, framework: "react" },
|
|
14868
15828
|
{ dir: config.svelteDirectory, framework: "svelte" },
|
|
14869
15829
|
{ dir: config.vueDirectory, framework: "vue" },
|
|
@@ -14880,15 +15840,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
14880
15840
|
const source = definition.buildReference?.source;
|
|
14881
15841
|
if (!source)
|
|
14882
15842
|
continue;
|
|
14883
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
14884
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
15843
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve24(dirname14(buildInfo.resolvedRegistryPath), source);
|
|
15844
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve24(resolvedSource));
|
|
14885
15845
|
}
|
|
14886
15846
|
return lookup;
|
|
14887
15847
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
14888
15848
|
const candidate = usage.source;
|
|
14889
|
-
return candidate ?
|
|
15849
|
+
return candidate ? resolve24(candidate) === target : false;
|
|
14890
15850
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
14891
|
-
const target =
|
|
15851
|
+
const target = resolve24(sourcePath);
|
|
14892
15852
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
14893
15853
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
14894
15854
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -14900,13 +15860,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
14900
15860
|
const pattern = pagePatterns[entry.framework];
|
|
14901
15861
|
if (!pattern)
|
|
14902
15862
|
return;
|
|
14903
|
-
const files = await scanEntryPoints(
|
|
15863
|
+
const files = await scanEntryPoints(resolve24(entry.dir), pattern);
|
|
14904
15864
|
for (const filePath of files) {
|
|
14905
15865
|
const source = readFileSync13(filePath, "utf-8");
|
|
14906
15866
|
const islands = extractIslandUsagesFromSource(source);
|
|
14907
|
-
pageMetadata.set(
|
|
15867
|
+
pageMetadata.set(resolve24(filePath), {
|
|
14908
15868
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
14909
|
-
pagePath:
|
|
15869
|
+
pagePath: resolve24(filePath)
|
|
14910
15870
|
});
|
|
14911
15871
|
}
|
|
14912
15872
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -14923,6 +15883,7 @@ var init_pageMetadata = __esm(() => {
|
|
|
14923
15883
|
init_sourceMetadata();
|
|
14924
15884
|
pagePatterns = {
|
|
14925
15885
|
angular: "pages/**/*.{ts,js}",
|
|
15886
|
+
ember: "pages/**/*.{gjs,gts,ts,js}",
|
|
14926
15887
|
html: "pages/**/*.html",
|
|
14927
15888
|
htmx: "pages/**/*.html",
|
|
14928
15889
|
react: "pages/**/*.{ts,tsx,js,jsx}",
|
|
@@ -15015,9 +15976,9 @@ var init_transformCache = __esm(() => {
|
|
|
15015
15976
|
});
|
|
15016
15977
|
|
|
15017
15978
|
// src/dev/reactComponentClassifier.ts
|
|
15018
|
-
import { resolve as
|
|
15979
|
+
import { resolve as resolve25 } from "path";
|
|
15019
15980
|
var classifyComponent = (filePath) => {
|
|
15020
|
-
const normalizedPath =
|
|
15981
|
+
const normalizedPath = resolve25(filePath);
|
|
15021
15982
|
if (normalizedPath.includes("/react/pages/")) {
|
|
15022
15983
|
return "server";
|
|
15023
15984
|
}
|
|
@@ -15029,7 +15990,7 @@ var classifyComponent = (filePath) => {
|
|
|
15029
15990
|
var init_reactComponentClassifier = () => {};
|
|
15030
15991
|
|
|
15031
15992
|
// src/dev/moduleMapper.ts
|
|
15032
|
-
import { basename as
|
|
15993
|
+
import { basename as basename9, resolve as resolve26 } from "path";
|
|
15033
15994
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
15034
15995
|
const modulePaths = {};
|
|
15035
15996
|
moduleKeys.forEach((key) => {
|
|
@@ -15039,7 +16000,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
15039
16000
|
});
|
|
15040
16001
|
return modulePaths;
|
|
15041
16002
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
15042
|
-
const normalizedFile =
|
|
16003
|
+
const normalizedFile = resolve26(sourceFile);
|
|
15043
16004
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
15044
16005
|
if (processedFiles.has(normalizedFile)) {
|
|
15045
16006
|
return null;
|
|
@@ -15075,8 +16036,8 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
15075
16036
|
});
|
|
15076
16037
|
return grouped;
|
|
15077
16038
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
15078
|
-
const normalizedFile =
|
|
15079
|
-
const fileName =
|
|
16039
|
+
const normalizedFile = resolve26(sourceFile);
|
|
16040
|
+
const fileName = basename9(normalizedFile);
|
|
15080
16041
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
15081
16042
|
const pascalName = toPascal(baseName);
|
|
15082
16043
|
const keys = [];
|
|
@@ -15268,8 +16229,8 @@ __export(exports_moduleServer, {
|
|
|
15268
16229
|
createModuleServer: () => createModuleServer,
|
|
15269
16230
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
15270
16231
|
});
|
|
15271
|
-
import { existsSync as
|
|
15272
|
-
import { basename as
|
|
16232
|
+
import { existsSync as existsSync23, readFileSync as readFileSync15, statSync as statSync2 } from "fs";
|
|
16233
|
+
import { basename as basename10, dirname as dirname15, extname as extname8, join as join25, resolve as resolve27, relative as relative11 } from "path";
|
|
15273
16234
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
15274
16235
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
15275
16236
|
const allExports = [];
|
|
@@ -15289,7 +16250,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
15289
16250
|
${stubs}
|
|
15290
16251
|
`;
|
|
15291
16252
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
15292
|
-
const found = extensions.find((ext) =>
|
|
16253
|
+
const found = extensions.find((ext) => existsSync23(resolve27(projectRoot, srcPath + ext)));
|
|
15293
16254
|
return found ? srcPath + found : srcPath;
|
|
15294
16255
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
15295
16256
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -15304,7 +16265,7 @@ ${stubs}
|
|
|
15304
16265
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
15305
16266
|
}, srcUrl = (relPath, projectRoot) => {
|
|
15306
16267
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
15307
|
-
const absPath =
|
|
16268
|
+
const absPath = resolve27(projectRoot, relPath);
|
|
15308
16269
|
const cached = mtimeCache.get(absPath);
|
|
15309
16270
|
if (cached !== undefined)
|
|
15310
16271
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -15316,12 +16277,12 @@ ${stubs}
|
|
|
15316
16277
|
return base;
|
|
15317
16278
|
}
|
|
15318
16279
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
15319
|
-
const absPath =
|
|
16280
|
+
const absPath = resolve27(fileDir, relPath);
|
|
15320
16281
|
const rel = relative11(projectRoot, absPath);
|
|
15321
|
-
const extension =
|
|
16282
|
+
const extension = extname8(rel);
|
|
15322
16283
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
15323
|
-
if (
|
|
15324
|
-
srcPath = relative11(projectRoot, resolveSvelteModulePath(
|
|
16284
|
+
if (extname8(srcPath) === ".svelte") {
|
|
16285
|
+
srcPath = relative11(projectRoot, resolveSvelteModulePath(resolve27(projectRoot, srcPath)));
|
|
15325
16286
|
}
|
|
15326
16287
|
return srcUrl(srcPath, projectRoot);
|
|
15327
16288
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -15338,14 +16299,14 @@ ${stubs}
|
|
|
15338
16299
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
15339
16300
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
15340
16301
|
if (!subpath) {
|
|
15341
|
-
const pkgDir =
|
|
15342
|
-
const pkgJsonPath =
|
|
15343
|
-
if (
|
|
16302
|
+
const pkgDir = resolve27(projectRoot, "node_modules", packageName ?? "");
|
|
16303
|
+
const pkgJsonPath = join25(pkgDir, "package.json");
|
|
16304
|
+
if (existsSync23(pkgJsonPath)) {
|
|
15344
16305
|
const pkg = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
|
|
15345
16306
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
15346
16307
|
if (esmEntry) {
|
|
15347
|
-
const resolved =
|
|
15348
|
-
if (
|
|
16308
|
+
const resolved = resolve27(pkgDir, esmEntry);
|
|
16309
|
+
if (existsSync23(resolved))
|
|
15349
16310
|
return relative11(projectRoot, resolved);
|
|
15350
16311
|
}
|
|
15351
16312
|
}
|
|
@@ -15376,7 +16337,7 @@ ${stubs}
|
|
|
15376
16337
|
};
|
|
15377
16338
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
15378
16339
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
15379
|
-
const fileDir =
|
|
16340
|
+
const fileDir = dirname15(filePath);
|
|
15380
16341
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
15381
16342
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
15382
16343
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
@@ -15389,12 +16350,12 @@ ${stubs}
|
|
|
15389
16350
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
15390
16351
|
});
|
|
15391
16352
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
15392
|
-
const absPath =
|
|
16353
|
+
const absPath = resolve27(fileDir, relPath);
|
|
15393
16354
|
const rel = relative11(projectRoot, absPath);
|
|
15394
16355
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
15395
16356
|
});
|
|
15396
16357
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
15397
|
-
const absPath =
|
|
16358
|
+
const absPath = resolve27(fileDir, relPath);
|
|
15398
16359
|
const rel = relative11(projectRoot, absPath);
|
|
15399
16360
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
15400
16361
|
});
|
|
@@ -15457,16 +16418,16 @@ ${transpiled}`;
|
|
|
15457
16418
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
15458
16419
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
15459
16420
|
const raw = readFileSync15(filePath, "utf-8");
|
|
15460
|
-
const ext =
|
|
16421
|
+
const ext = extname8(filePath);
|
|
15461
16422
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
15462
16423
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
15463
|
-
let
|
|
16424
|
+
let transpiler5 = jsTranspiler2;
|
|
15464
16425
|
if (isTSX)
|
|
15465
|
-
|
|
16426
|
+
transpiler5 = tsxTranspiler;
|
|
15466
16427
|
else if (isTS)
|
|
15467
|
-
|
|
15468
|
-
const valueExports = isTS ?
|
|
15469
|
-
let transpiled =
|
|
16428
|
+
transpiler5 = tsTranspiler2;
|
|
16429
|
+
const valueExports = isTS ? transpiler5.scan(raw).exports : [];
|
|
16430
|
+
let transpiled = transpiler5.transformSync(raw);
|
|
15470
16431
|
if (isTS) {
|
|
15471
16432
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
15472
16433
|
}
|
|
@@ -15682,17 +16643,19 @@ export default __script__;`;
|
|
|
15682
16643
|
return `${cssInjection}
|
|
15683
16644
|
${code}`;
|
|
15684
16645
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
15685
|
-
const
|
|
16646
|
+
const rawSource = readFileSync15(filePath, "utf-8");
|
|
16647
|
+
const raw = addAutoRouterSetupApp(rawSource);
|
|
15686
16648
|
if (!vueCompiler) {
|
|
15687
16649
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
15688
16650
|
}
|
|
15689
|
-
const fileName =
|
|
16651
|
+
const fileName = basename10(filePath, ".vue");
|
|
15690
16652
|
const componentId = fileName.toLowerCase();
|
|
15691
16653
|
const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
|
|
15692
|
-
const
|
|
16654
|
+
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
16655
|
+
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
15693
16656
|
id: componentId,
|
|
15694
16657
|
inlineTemplate: false
|
|
15695
|
-
});
|
|
16658
|
+
}) : { bindings: {}, content: "export default {};" };
|
|
15696
16659
|
const compiledSfcScript = {
|
|
15697
16660
|
bindings: compiledScript.bindings ?? {},
|
|
15698
16661
|
content: compiledScript.content
|
|
@@ -15703,7 +16666,7 @@ ${code}`;
|
|
|
15703
16666
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
15704
16667
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
15705
16668
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
15706
|
-
const hmrBase = vueDir ?
|
|
16669
|
+
const hmrBase = vueDir ? resolve27(vueDir) : projectRoot;
|
|
15707
16670
|
const hmrId = relative11(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
15708
16671
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
15709
16672
|
result += [
|
|
@@ -15718,11 +16681,11 @@ ${code}`;
|
|
|
15718
16681
|
`);
|
|
15719
16682
|
return result;
|
|
15720
16683
|
}, resolveSvelteModulePath = (path) => {
|
|
15721
|
-
if (
|
|
16684
|
+
if (existsSync23(path))
|
|
15722
16685
|
return path;
|
|
15723
|
-
if (
|
|
16686
|
+
if (existsSync23(`${path}.ts`))
|
|
15724
16687
|
return `${path}.ts`;
|
|
15725
|
-
if (
|
|
16688
|
+
if (existsSync23(`${path}.js`))
|
|
15726
16689
|
return `${path}.js`;
|
|
15727
16690
|
return path;
|
|
15728
16691
|
}, jsResponse = (body) => {
|
|
@@ -15862,13 +16825,13 @@ export default {};
|
|
|
15862
16825
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
15863
16826
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
15864
16827
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
15865
|
-
const filePath =
|
|
15866
|
-
const ext =
|
|
16828
|
+
const filePath = resolve27(projectRoot, relPath);
|
|
16829
|
+
const ext = extname8(filePath);
|
|
15867
16830
|
if (ext === ".svelte")
|
|
15868
16831
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
15869
16832
|
if (ext)
|
|
15870
16833
|
return { ext, filePath };
|
|
15871
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
16834
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync23(filePath + candidate));
|
|
15872
16835
|
if (!found)
|
|
15873
16836
|
return { ext, filePath };
|
|
15874
16837
|
const resolved = filePath + found;
|
|
@@ -15889,7 +16852,7 @@ export default {};
|
|
|
15889
16852
|
if (!TRANSPILABLE.has(ext))
|
|
15890
16853
|
return;
|
|
15891
16854
|
const stat4 = statSync2(filePath);
|
|
15892
|
-
const resolvedVueDir = vueDir ?
|
|
16855
|
+
const resolvedVueDir = vueDir ? resolve27(vueDir) : undefined;
|
|
15893
16856
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
15894
16857
|
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
15895
16858
|
return jsResponse(content);
|
|
@@ -15920,7 +16883,7 @@ export default {};
|
|
|
15920
16883
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
15921
16884
|
return;
|
|
15922
16885
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
15923
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
16886
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve27(projectRoot, relPath));
|
|
15924
16887
|
if (virtualCssResponse)
|
|
15925
16888
|
return virtualCssResponse;
|
|
15926
16889
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -15936,11 +16899,11 @@ export default {};
|
|
|
15936
16899
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
15937
16900
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
15938
16901
|
if (match[1])
|
|
15939
|
-
files.push(
|
|
16902
|
+
files.push(resolve27(projectRoot, match[1]));
|
|
15940
16903
|
}
|
|
15941
16904
|
return files;
|
|
15942
16905
|
}, invalidateModule = (filePath) => {
|
|
15943
|
-
const resolved =
|
|
16906
|
+
const resolved = resolve27(filePath);
|
|
15944
16907
|
invalidate(filePath);
|
|
15945
16908
|
if (resolved !== filePath)
|
|
15946
16909
|
invalidate(resolved);
|
|
@@ -15958,6 +16921,7 @@ export default {};
|
|
|
15958
16921
|
var init_moduleServer = __esm(() => {
|
|
15959
16922
|
init_constants();
|
|
15960
16923
|
init_resolvePackageImport();
|
|
16924
|
+
init_vueAutoRouterTransform();
|
|
15961
16925
|
init_sourceMetadata();
|
|
15962
16926
|
init_stylePreprocessor();
|
|
15963
16927
|
init_lowerAwaitSlotSyntax();
|
|
@@ -16014,21 +16978,147 @@ var init_moduleServer = __esm(() => {
|
|
|
16014
16978
|
SRC_URL_PREFIX = SRC_PREFIX;
|
|
16015
16979
|
});
|
|
16016
16980
|
|
|
16981
|
+
// src/utils/ssrErrorPage.ts
|
|
16982
|
+
var ssrErrorPage = (framework, error) => {
|
|
16983
|
+
const frameworkColors2 = {
|
|
16984
|
+
angular: "#dd0031",
|
|
16985
|
+
html: "#e34c26",
|
|
16986
|
+
htmx: "#1a365d",
|
|
16987
|
+
react: "#61dafb",
|
|
16988
|
+
svelte: "#ff3e00",
|
|
16989
|
+
vue: "#42b883"
|
|
16990
|
+
};
|
|
16991
|
+
const accent = frameworkColors2[framework] ?? "#94a3b8";
|
|
16992
|
+
const label = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
16993
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16994
|
+
return `<!DOCTYPE html>
|
|
16995
|
+
<html>
|
|
16996
|
+
<head>
|
|
16997
|
+
<meta charset="utf-8">
|
|
16998
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
16999
|
+
<title>SSR Error - AbsoluteJS</title>
|
|
17000
|
+
<style>
|
|
17001
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
17002
|
+
body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}
|
|
17003
|
+
.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}
|
|
17004
|
+
.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}
|
|
17005
|
+
.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
|
|
17006
|
+
.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}
|
|
17007
|
+
.kind{color:#94a3b8;font-size:13px;font-weight:500}
|
|
17008
|
+
.content{padding:24px}
|
|
17009
|
+
.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
|
|
17010
|
+
.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}
|
|
17011
|
+
.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}
|
|
17012
|
+
</style>
|
|
17013
|
+
</head>
|
|
17014
|
+
<body>
|
|
17015
|
+
<div class="card">
|
|
17016
|
+
<div class="header">
|
|
17017
|
+
<div style="display:flex;align-items:center;gap:12px">
|
|
17018
|
+
<span class="brand">AbsoluteJS</span>
|
|
17019
|
+
<span class="badge">${label}</span>
|
|
17020
|
+
</div>
|
|
17021
|
+
<span class="kind">Server Render Error</span>
|
|
17022
|
+
</div>
|
|
17023
|
+
<div class="content">
|
|
17024
|
+
<div class="label">What went wrong</div>
|
|
17025
|
+
<pre class="message">${message.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
17026
|
+
<div class="hint">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>
|
|
17027
|
+
</div>
|
|
17028
|
+
</div>
|
|
17029
|
+
</body>
|
|
17030
|
+
</html>`;
|
|
17031
|
+
};
|
|
17032
|
+
|
|
17033
|
+
// src/ember/pageHandler.ts
|
|
17034
|
+
import { pathToFileURL } from "url";
|
|
17035
|
+
var resolveRequestPathname = (request) => {
|
|
17036
|
+
if (!request)
|
|
17037
|
+
return;
|
|
17038
|
+
try {
|
|
17039
|
+
const parsed = new URL(request.url);
|
|
17040
|
+
return `${parsed.pathname}${parsed.search}`;
|
|
17041
|
+
} catch {
|
|
17042
|
+
return;
|
|
17043
|
+
}
|
|
17044
|
+
}, installSimpleDomGlobals = () => {
|
|
17045
|
+
const g2 = globalThis;
|
|
17046
|
+
if (typeof g2.Element === "undefined") {
|
|
17047
|
+
g2.Element = class Element {
|
|
17048
|
+
};
|
|
17049
|
+
}
|
|
17050
|
+
if (typeof g2.Node === "undefined") {
|
|
17051
|
+
g2.Node = class Node {
|
|
17052
|
+
};
|
|
17053
|
+
}
|
|
17054
|
+
}, emberCacheBuster = 0, buildRuntimeModuleSpecifier = (modulePath) => {
|
|
17055
|
+
if (emberCacheBuster === 0)
|
|
17056
|
+
return modulePath;
|
|
17057
|
+
const moduleUrl = new URL(pathToFileURL(modulePath).href);
|
|
17058
|
+
moduleUrl.searchParams.set("t", String(emberCacheBuster));
|
|
17059
|
+
return moduleUrl.href;
|
|
17060
|
+
}, invalidateEmberSsrCache = () => {
|
|
17061
|
+
markSsrCacheDirty("ember");
|
|
17062
|
+
emberCacheBuster = Date.now();
|
|
17063
|
+
}, buildHtmlShell = (headTag, bodyContent, indexPath, props) => {
|
|
17064
|
+
const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
|
|
17065
|
+
const indexImport = indexPath ? `<script type="module" src="${indexPath}"></script>` : "";
|
|
17066
|
+
return `<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>` + indexImport + `</body></html>`;
|
|
17067
|
+
}, handleEmberPageRequest = async (input) => {
|
|
17068
|
+
const { indexPath, pagePath, headTag } = input;
|
|
17069
|
+
const userProps = input.props;
|
|
17070
|
+
const requestPathname = resolveRequestPathname(input.request);
|
|
17071
|
+
const props = requestPathname !== undefined && (!userProps || !("url" in userProps)) ? { ...userProps ?? {}, url: requestPathname } : userProps;
|
|
17072
|
+
const resolvedHeadTag = headTag ?? "<head></head>";
|
|
17073
|
+
try {
|
|
17074
|
+
installSimpleDomGlobals();
|
|
17075
|
+
isSsrCacheDirty("ember");
|
|
17076
|
+
const bundle = await import(buildRuntimeModuleSpecifier(pagePath));
|
|
17077
|
+
if (typeof bundle.renderToHTML !== "function") {
|
|
17078
|
+
throw new Error(`Ember page bundle at ${pagePath} does not export renderToHTML(). Was it compiled by compileEmber()?`);
|
|
17079
|
+
}
|
|
17080
|
+
const innerHtml = bundle.renderToHTML(props ?? {});
|
|
17081
|
+
const html = buildHtmlShell(resolvedHeadTag, innerHtml.replace(/^<div>|<\/div>$/g, ""), indexPath, props);
|
|
17082
|
+
return new Response(html, {
|
|
17083
|
+
headers: { "Content-Type": "text/html" }
|
|
17084
|
+
});
|
|
17085
|
+
} catch (error) {
|
|
17086
|
+
console.error("[SSR] Ember render error:", error);
|
|
17087
|
+
return new Response(ssrErrorPage("ember", error), {
|
|
17088
|
+
headers: { "Content-Type": "text/html" },
|
|
17089
|
+
status: 500
|
|
17090
|
+
});
|
|
17091
|
+
}
|
|
17092
|
+
};
|
|
17093
|
+
var init_pageHandler = __esm(() => {
|
|
17094
|
+
init_ssrCache();
|
|
17095
|
+
});
|
|
17096
|
+
|
|
17097
|
+
// src/ember/index.ts
|
|
17098
|
+
var exports_ember = {};
|
|
17099
|
+
__export(exports_ember, {
|
|
17100
|
+
invalidateEmberSsrCache: () => invalidateEmberSsrCache,
|
|
17101
|
+
handleEmberPageRequest: () => handleEmberPageRequest
|
|
17102
|
+
});
|
|
17103
|
+
var init_ember = __esm(() => {
|
|
17104
|
+
init_pageHandler();
|
|
17105
|
+
});
|
|
17106
|
+
|
|
16017
17107
|
// src/dev/simpleHTMLHMR.ts
|
|
16018
17108
|
var exports_simpleHTMLHMR = {};
|
|
16019
17109
|
__export(exports_simpleHTMLHMR, {
|
|
16020
17110
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
16021
17111
|
});
|
|
16022
|
-
import { resolve as
|
|
17112
|
+
import { resolve as resolve28 } from "path";
|
|
16023
17113
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
16024
17114
|
let htmlContent;
|
|
16025
17115
|
try {
|
|
16026
|
-
const resolvedPath =
|
|
16027
|
-
const
|
|
16028
|
-
if (!await
|
|
17116
|
+
const resolvedPath = resolve28(htmlFilePath);
|
|
17117
|
+
const file4 = Bun.file(resolvedPath);
|
|
17118
|
+
if (!await file4.exists()) {
|
|
16029
17119
|
return null;
|
|
16030
17120
|
}
|
|
16031
|
-
htmlContent = await
|
|
17121
|
+
htmlContent = await file4.text();
|
|
16032
17122
|
} catch {
|
|
16033
17123
|
return null;
|
|
16034
17124
|
}
|
|
@@ -16049,16 +17139,16 @@ var exports_simpleHTMXHMR = {};
|
|
|
16049
17139
|
__export(exports_simpleHTMXHMR, {
|
|
16050
17140
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
16051
17141
|
});
|
|
16052
|
-
import { resolve as
|
|
17142
|
+
import { resolve as resolve29 } from "path";
|
|
16053
17143
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
16054
17144
|
let htmlContent;
|
|
16055
17145
|
try {
|
|
16056
|
-
const resolvedPath =
|
|
16057
|
-
const
|
|
16058
|
-
if (!await
|
|
17146
|
+
const resolvedPath = resolve29(htmxFilePath);
|
|
17147
|
+
const file4 = Bun.file(resolvedPath);
|
|
17148
|
+
if (!await file4.exists()) {
|
|
16059
17149
|
return null;
|
|
16060
17150
|
}
|
|
16061
|
-
htmlContent = await
|
|
17151
|
+
htmlContent = await file4.text();
|
|
16062
17152
|
} catch {
|
|
16063
17153
|
return null;
|
|
16064
17154
|
}
|
|
@@ -16075,8 +17165,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
16075
17165
|
var init_simpleHTMXHMR = () => {};
|
|
16076
17166
|
|
|
16077
17167
|
// src/dev/rebuildTrigger.ts
|
|
16078
|
-
import { existsSync as
|
|
16079
|
-
import { basename as
|
|
17168
|
+
import { existsSync as existsSync24 } from "fs";
|
|
17169
|
+
import { basename as basename11, dirname as dirname16, relative as relative12, resolve as resolve30 } from "path";
|
|
16080
17170
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
16081
17171
|
if (!config.tailwind)
|
|
16082
17172
|
return;
|
|
@@ -16100,16 +17190,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16100
17190
|
}, parseErrorLocationFromMessage = (msg) => {
|
|
16101
17191
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
16102
17192
|
if (pathLineCol) {
|
|
16103
|
-
const [,
|
|
17193
|
+
const [, file4, lineStr, colStr] = pathLineCol;
|
|
16104
17194
|
return {
|
|
16105
17195
|
column: colStr ? parseInt(colStr, 10) : undefined,
|
|
16106
|
-
file:
|
|
17196
|
+
file: file4,
|
|
16107
17197
|
line: lineStr ? parseInt(lineStr, 10) : undefined
|
|
16108
17198
|
};
|
|
16109
17199
|
}
|
|
16110
17200
|
const atMatch = msg.match(/(?:at|in)\s+([^(:\s]+)(?:\s*\([^)]*line\s*(\d+)[^)]*col(?:umn)?\s*(\d+)[^)]*\)|:(\d+):(\d+)?)/i);
|
|
16111
17201
|
if (atMatch) {
|
|
16112
|
-
const [,
|
|
17202
|
+
const [, file4, line1, col1, line2, col2] = atMatch;
|
|
16113
17203
|
let parsedCol;
|
|
16114
17204
|
if (col1)
|
|
16115
17205
|
parsedCol = parseInt(col1, 10);
|
|
@@ -16122,16 +17212,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16122
17212
|
parsedLine = parseInt(line2, 10);
|
|
16123
17213
|
return {
|
|
16124
17214
|
column: parsedCol,
|
|
16125
|
-
file:
|
|
17215
|
+
file: file4?.trim(),
|
|
16126
17216
|
line: parsedLine
|
|
16127
17217
|
};
|
|
16128
17218
|
}
|
|
16129
17219
|
const parenMatch = msg.match(/([^\s(]+)\s*\([^)]*line\s*(\d+)[^)]*col(?:umn)?\s*(\d+)/i);
|
|
16130
17220
|
if (parenMatch) {
|
|
16131
|
-
const [,
|
|
17221
|
+
const [, file4, lineStr, colStr] = parenMatch;
|
|
16132
17222
|
return {
|
|
16133
17223
|
column: colStr ? parseInt(colStr, 10) : undefined,
|
|
16134
|
-
file:
|
|
17224
|
+
file: file4 ?? undefined,
|
|
16135
17225
|
line: lineStr ? parseInt(lineStr, 10) : undefined
|
|
16136
17226
|
};
|
|
16137
17227
|
}
|
|
@@ -16143,14 +17233,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16143
17233
|
if (logs && Array.isArray(logs) && logs.length > 0) {
|
|
16144
17234
|
const errLog = logs.find((l4) => l4.level === "error") ?? logs[0];
|
|
16145
17235
|
const pos = errLog?.position;
|
|
16146
|
-
const
|
|
17236
|
+
const file4 = pos?.file;
|
|
16147
17237
|
const line = pos?.line;
|
|
16148
17238
|
const column = pos?.column;
|
|
16149
17239
|
const lineText = pos?.lineText;
|
|
16150
|
-
const framework =
|
|
17240
|
+
const framework = file4 && resolvedPaths ? detectFramework(file4, resolvedPaths) : affectedFrameworks[0] ?? "unknown";
|
|
16151
17241
|
return {
|
|
16152
17242
|
column,
|
|
16153
|
-
file:
|
|
17243
|
+
file: file4,
|
|
16154
17244
|
framework: framework !== "ignored" ? framework : affectedFrameworks[0],
|
|
16155
17245
|
line,
|
|
16156
17246
|
lineText
|
|
@@ -16164,11 +17254,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16164
17254
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
16165
17255
|
}
|
|
16166
17256
|
return { ...parsed, framework: detectedFw };
|
|
16167
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
17257
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync24(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
|
|
16168
17258
|
state.fileHashes.delete(filePathInSet);
|
|
16169
17259
|
try {
|
|
16170
17260
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
16171
|
-
const deletedPathResolved =
|
|
17261
|
+
const deletedPathResolved = resolve30(filePathInSet);
|
|
16172
17262
|
affectedFiles.forEach((affectedFile) => {
|
|
16173
17263
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
16174
17264
|
validFiles.push(affectedFile);
|
|
@@ -16182,7 +17272,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16182
17272
|
if (!dependents || dependents.size === 0) {
|
|
16183
17273
|
return;
|
|
16184
17274
|
}
|
|
16185
|
-
const dependentFiles = Array.from(dependents).filter((
|
|
17275
|
+
const dependentFiles = Array.from(dependents).filter((file4) => existsSync24(file4));
|
|
16186
17276
|
if (dependentFiles.length === 0) {
|
|
16187
17277
|
return;
|
|
16188
17278
|
}
|
|
@@ -16198,7 +17288,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16198
17288
|
try {
|
|
16199
17289
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
16200
17290
|
affectedFiles.forEach((affectedFile) => {
|
|
16201
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
17291
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync24(affectedFile)) {
|
|
16202
17292
|
validFiles.push(affectedFile);
|
|
16203
17293
|
processedFiles.add(affectedFile);
|
|
16204
17294
|
}
|
|
@@ -16212,7 +17302,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16212
17302
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
16213
17303
|
return;
|
|
16214
17304
|
}
|
|
16215
|
-
const normalizedFilePath =
|
|
17305
|
+
const normalizedFilePath = resolve30(filePathInSet);
|
|
16216
17306
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
16217
17307
|
validFiles.push(normalizedFilePath);
|
|
16218
17308
|
processedFiles.add(normalizedFilePath);
|
|
@@ -16223,7 +17313,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16223
17313
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
16224
17314
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
16225
17315
|
filePathSet.forEach((filePathInSet) => {
|
|
16226
|
-
if (!
|
|
17316
|
+
if (!existsSync24(filePathInSet)) {
|
|
16227
17317
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
16228
17318
|
return;
|
|
16229
17319
|
}
|
|
@@ -16254,10 +17344,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16254
17344
|
}
|
|
16255
17345
|
});
|
|
16256
17346
|
return filesToProcess;
|
|
16257
|
-
}, STABILITY_CHECK_ROUNDS = 5, STABILITY_CHECK_DELAY_MS = 10, isFileStable = async (
|
|
16258
|
-
const hash1 = computeFileHash(
|
|
17347
|
+
}, STABILITY_CHECK_ROUNDS = 5, STABILITY_CHECK_DELAY_MS = 10, isFileStable = async (file4) => {
|
|
17348
|
+
const hash1 = computeFileHash(file4);
|
|
16259
17349
|
await Bun.sleep(STABILITY_CHECK_DELAY_MS);
|
|
16260
|
-
const hash2 = computeFileHash(
|
|
17350
|
+
const hash2 = computeFileHash(file4);
|
|
16261
17351
|
return hash1 === hash2;
|
|
16262
17352
|
}, collectAllQueuedFiles = (fileChangeQueue) => {
|
|
16263
17353
|
const allFiles = [];
|
|
@@ -16268,11 +17358,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16268
17358
|
}, areAllQueuedFilesStable = async (fileChangeQueue) => {
|
|
16269
17359
|
const allFiles = collectAllQueuedFiles(fileChangeQueue);
|
|
16270
17360
|
const checkFile = async (files) => {
|
|
16271
|
-
const [
|
|
16272
|
-
if (!
|
|
17361
|
+
const [file4, ...remaining] = files;
|
|
17362
|
+
if (!file4) {
|
|
16273
17363
|
return true;
|
|
16274
17364
|
}
|
|
16275
|
-
const stable = await isFileStable(
|
|
17365
|
+
const stable = await isFileStable(file4);
|
|
16276
17366
|
if (!stable) {
|
|
16277
17367
|
return false;
|
|
16278
17368
|
}
|
|
@@ -16316,7 +17406,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16316
17406
|
return;
|
|
16317
17407
|
}
|
|
16318
17408
|
if (framework === "unknown") {
|
|
16319
|
-
invalidate(
|
|
17409
|
+
invalidate(resolve30(filePath));
|
|
16320
17410
|
const relPath = relative12(process.cwd(), filePath);
|
|
16321
17411
|
logHmrUpdate(relPath);
|
|
16322
17412
|
return;
|
|
@@ -16360,12 +17450,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16360
17450
|
return componentFile;
|
|
16361
17451
|
}
|
|
16362
17452
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
16363
|
-
if (
|
|
17453
|
+
if (existsSync24(tsCounterpart)) {
|
|
16364
17454
|
return tsCounterpart;
|
|
16365
17455
|
}
|
|
16366
17456
|
if (!graph)
|
|
16367
17457
|
return componentFile;
|
|
16368
|
-
const dependents = graph.dependents.get(
|
|
17458
|
+
const dependents = graph.dependents.get(resolve30(componentFile));
|
|
16369
17459
|
if (!dependents)
|
|
16370
17460
|
return componentFile;
|
|
16371
17461
|
for (const dep of dependents) {
|
|
@@ -16374,7 +17464,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16374
17464
|
}
|
|
16375
17465
|
return componentFile;
|
|
16376
17466
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
16377
|
-
const pageEntries = angularFiles.filter((
|
|
17467
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve30(file4).startsWith(angularPagesPath));
|
|
16378
17468
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
16379
17469
|
return pageEntries;
|
|
16380
17470
|
}
|
|
@@ -16382,9 +17472,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16382
17472
|
angularFiles.forEach((componentFile) => {
|
|
16383
17473
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
16384
17474
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
16385
|
-
affected.forEach((
|
|
16386
|
-
if (
|
|
16387
|
-
resolvedPages.add(
|
|
17475
|
+
affected.forEach((file4) => {
|
|
17476
|
+
if (file4.endsWith(".ts") && resolve30(file4).startsWith(angularPagesPath)) {
|
|
17477
|
+
resolvedPages.add(file4);
|
|
16388
17478
|
}
|
|
16389
17479
|
});
|
|
16390
17480
|
});
|
|
@@ -16400,14 +17490,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16400
17490
|
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
16401
17491
|
return clientRoots.length === 1 ? clientRoots[0] ?? process.cwd() : commonAncestor2(clientRoots, process.cwd());
|
|
16402
17492
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
16403
|
-
const fileWithHash =
|
|
17493
|
+
const fileWithHash = basename11(artifact.path);
|
|
16404
17494
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
16405
17495
|
if (!baseName) {
|
|
16406
17496
|
return;
|
|
16407
17497
|
}
|
|
16408
17498
|
state.manifest[toPascal(baseName)] = artifact.path;
|
|
16409
17499
|
}, bundleAngularClient = async (state, clientPaths, buildDir) => {
|
|
16410
|
-
const { build:
|
|
17500
|
+
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
16411
17501
|
const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
|
|
16412
17502
|
const { getAngularVendorPaths: getAngularVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
16413
17503
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
@@ -16419,7 +17509,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16419
17509
|
angVendorPaths = computeAngularVendorPaths2(globalThis.__angularVendorSpecifiers);
|
|
16420
17510
|
setAngularVendorPaths2(angVendorPaths);
|
|
16421
17511
|
}
|
|
16422
|
-
const clientResult = await
|
|
17512
|
+
const clientResult = await bunBuild9({
|
|
16423
17513
|
entrypoints: clientPaths,
|
|
16424
17514
|
...Object.keys({
|
|
16425
17515
|
...angVendorPaths ?? {},
|
|
@@ -16455,7 +17545,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16455
17545
|
await populateAssetStore(state.assetStore, clientManifest, buildDir);
|
|
16456
17546
|
}, broadcastAngularPageUpdates = (state, pagesToUpdate, manifest, startTime) => {
|
|
16457
17547
|
pagesToUpdate.forEach((angularPagePath) => {
|
|
16458
|
-
const fileName =
|
|
17548
|
+
const fileName = basename11(angularPagePath);
|
|
16459
17549
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
16460
17550
|
const pascalName = toPascal(baseName);
|
|
16461
17551
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -16492,28 +17582,28 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16492
17582
|
await rewriteImports3(ssrPaths, angServerVendorPaths);
|
|
16493
17583
|
}
|
|
16494
17584
|
serverPaths.forEach((serverPath, idx) => {
|
|
16495
|
-
const fileBase =
|
|
17585
|
+
const fileBase = basename11(serverPath, ".js");
|
|
16496
17586
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
16497
|
-
state.manifest[toPascal(fileBase)] =
|
|
17587
|
+
state.manifest[toPascal(fileBase)] = resolve30(ssrPath);
|
|
16498
17588
|
});
|
|
16499
17589
|
if (clientPaths.length > 0) {
|
|
16500
17590
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
16501
17591
|
}
|
|
16502
17592
|
}, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16503
17593
|
const angularDir = config.angularDirectory ?? "";
|
|
16504
|
-
const angularFiles = filesToRebuild.filter((
|
|
16505
|
-
for (const
|
|
16506
|
-
state.fileHashes.set(
|
|
17594
|
+
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
17595
|
+
for (const file4 of angularFiles) {
|
|
17596
|
+
state.fileHashes.set(resolve30(file4), computeFileHash(file4));
|
|
16507
17597
|
}
|
|
16508
|
-
const angularPagesPath =
|
|
17598
|
+
const angularPagesPath = resolve30(angularDir, "pages");
|
|
16509
17599
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
16510
17600
|
if (pageEntries.length > 0) {
|
|
16511
17601
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
16512
17602
|
markSsrCacheDirty("angular");
|
|
16513
17603
|
}
|
|
16514
17604
|
const { manifest } = state;
|
|
16515
|
-
const angularHmrFiles = angularFiles.filter((
|
|
16516
|
-
const angularPageFiles = angularHmrFiles.filter((
|
|
17605
|
+
const angularHmrFiles = angularFiles.filter((file4) => file4.endsWith(".ts") || file4.endsWith(".html"));
|
|
17606
|
+
const angularPageFiles = angularHmrFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
16517
17607
|
const pagesToUpdate = angularPageFiles.length > 0 ? angularPageFiles : pageEntries;
|
|
16518
17608
|
broadcastAngularPageUpdates(state, pagesToUpdate, manifest, startTime);
|
|
16519
17609
|
onRebuildComplete({ hmrState: state, manifest });
|
|
@@ -16530,14 +17620,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16530
17620
|
if (isComponentFile2)
|
|
16531
17621
|
return primaryFile;
|
|
16532
17622
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
16533
|
-
const nearest = findNearestComponent2(
|
|
17623
|
+
const nearest = findNearestComponent2(resolve30(primaryFile));
|
|
16534
17624
|
return nearest ?? primaryFile;
|
|
16535
17625
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
16536
|
-
for (const
|
|
16537
|
-
state.fileHashes.set(
|
|
17626
|
+
for (const file4 of reactFiles) {
|
|
17627
|
+
state.fileHashes.set(resolve30(file4), computeFileHash(file4));
|
|
16538
17628
|
}
|
|
16539
17629
|
markSsrCacheDirty("react");
|
|
16540
|
-
const primaryFile = reactFiles.find((
|
|
17630
|
+
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
16541
17631
|
if (!primaryFile) {
|
|
16542
17632
|
onRebuildComplete({
|
|
16543
17633
|
hmrState: state,
|
|
@@ -16546,8 +17636,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16546
17636
|
return state.manifest;
|
|
16547
17637
|
}
|
|
16548
17638
|
const { invalidateModule: invalidateModule2 } = await getModuleServer();
|
|
16549
|
-
for (const
|
|
16550
|
-
invalidateModule2(
|
|
17639
|
+
for (const file4 of reactFiles) {
|
|
17640
|
+
invalidateModule2(file4);
|
|
16551
17641
|
}
|
|
16552
17642
|
const broadcastTarget = await resolveBroadcastTarget(primaryFile);
|
|
16553
17643
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
@@ -16575,7 +17665,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16575
17665
|
});
|
|
16576
17666
|
return state.manifest;
|
|
16577
17667
|
}, handleReactFastPath = async (state, _config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16578
|
-
const reactFiles = filesToRebuild.filter((
|
|
17668
|
+
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
|
|
16579
17669
|
if (reactFiles.length === 0) {
|
|
16580
17670
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
16581
17671
|
return state.manifest;
|
|
@@ -16615,8 +17705,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16615
17705
|
type: "svelte-update"
|
|
16616
17706
|
});
|
|
16617
17707
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
16618
|
-
for (const
|
|
16619
|
-
state.fileHashes.set(
|
|
17708
|
+
for (const file4 of svelteFiles) {
|
|
17709
|
+
state.fileHashes.set(resolve30(file4), computeFileHash(file4));
|
|
16620
17710
|
}
|
|
16621
17711
|
markSsrCacheDirty("svelte");
|
|
16622
17712
|
const serverDuration = Date.now() - startTime;
|
|
@@ -16628,22 +17718,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16628
17718
|
return state.manifest;
|
|
16629
17719
|
}, handleSvelteFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16630
17720
|
const svelteDir = config.svelteDirectory ?? "";
|
|
16631
|
-
const svelteFiles = filesToRebuild.filter((
|
|
17721
|
+
const svelteFiles = filesToRebuild.filter((file4) => (file4.endsWith(".svelte") || file4.includes(".svelte.")) && detectFramework(file4, state.resolvedPaths) === "svelte");
|
|
16632
17722
|
if (svelteFiles.length > 0) {
|
|
16633
17723
|
return handleSvelteModuleServerPath(state, svelteFiles, startTime, onRebuildComplete);
|
|
16634
17724
|
}
|
|
16635
17725
|
const { buildDir } = state.resolvedPaths;
|
|
16636
17726
|
if (svelteFiles.length > 0) {
|
|
16637
17727
|
const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
|
|
16638
|
-
const { build:
|
|
17728
|
+
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
16639
17729
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
16640
17730
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
|
|
16641
17731
|
const serverEntries = [...svelteServerPaths];
|
|
16642
17732
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
16643
|
-
const serverRoot =
|
|
16644
|
-
const serverOutDir =
|
|
17733
|
+
const serverRoot = resolve30(svelteDir, "generated", "server");
|
|
17734
|
+
const serverOutDir = resolve30(buildDir, basename11(svelteDir));
|
|
16645
17735
|
const [serverResult, clientResult] = await Promise.all([
|
|
16646
|
-
serverEntries.length > 0 ?
|
|
17736
|
+
serverEntries.length > 0 ? bunBuild9({
|
|
16647
17737
|
entrypoints: serverEntries,
|
|
16648
17738
|
external: [
|
|
16649
17739
|
"react",
|
|
@@ -16663,7 +17753,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16663
17753
|
target: "bun",
|
|
16664
17754
|
throw: false
|
|
16665
17755
|
}) : undefined,
|
|
16666
|
-
clientEntries.length > 0 ?
|
|
17756
|
+
clientEntries.length > 0 ? bunBuild9({
|
|
16667
17757
|
entrypoints: clientEntries,
|
|
16668
17758
|
format: "esm",
|
|
16669
17759
|
naming: "[dir]/[name].[hash].[ext]",
|
|
@@ -16683,7 +17773,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16683
17773
|
const duration = Date.now() - startTime;
|
|
16684
17774
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
16685
17775
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
16686
|
-
const fileName =
|
|
17776
|
+
const fileName = basename11(sveltePagePath);
|
|
16687
17777
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
16688
17778
|
const pascalName = toPascal(baseName);
|
|
16689
17779
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -16714,8 +17804,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16714
17804
|
if (nonVueFiles.length === 0)
|
|
16715
17805
|
return;
|
|
16716
17806
|
const { invalidateModule: invalidateModule2 } = await getModuleServer();
|
|
16717
|
-
for (const
|
|
16718
|
-
invalidateModule2(
|
|
17807
|
+
for (const file4 of nonVueFiles) {
|
|
17808
|
+
invalidateModule2(file4);
|
|
16719
17809
|
}
|
|
16720
17810
|
}, broadcastVueModuleUpdate = async (state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration) => {
|
|
16721
17811
|
const pageModuleUrl = await getModuleUrl(changedFile);
|
|
@@ -16737,8 +17827,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16737
17827
|
type: "vue-update"
|
|
16738
17828
|
});
|
|
16739
17829
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
16740
|
-
for (const
|
|
16741
|
-
state.fileHashes.set(
|
|
17830
|
+
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
17831
|
+
state.fileHashes.set(resolve30(file4), computeFileHash(file4));
|
|
16742
17832
|
}
|
|
16743
17833
|
markSsrCacheDirty("vue");
|
|
16744
17834
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -16751,16 +17841,68 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16751
17841
|
});
|
|
16752
17842
|
return state.manifest;
|
|
16753
17843
|
}, handleVueFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16754
|
-
const vueFiles = filesToRebuild.filter((
|
|
16755
|
-
const nonVueFiles = filesToRebuild.filter((
|
|
17844
|
+
const vueFiles = filesToRebuild.filter((file4) => file4.endsWith(".vue") && detectFramework(file4, state.resolvedPaths) === "vue");
|
|
17845
|
+
const nonVueFiles = filesToRebuild.filter((file4) => !file4.endsWith(".vue") && detectFramework(file4, state.resolvedPaths) === "vue");
|
|
16756
17846
|
collectAffectedVueFiles(state, nonVueFiles, vueFiles);
|
|
16757
17847
|
if (vueFiles.length > 0) {
|
|
16758
17848
|
return handleVueModuleServerPath(state, vueFiles, nonVueFiles, startTime, onRebuildComplete);
|
|
16759
17849
|
}
|
|
16760
17850
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
16761
17851
|
return state.manifest;
|
|
17852
|
+
}, EMBER_PAGE_EXTENSIONS, collectAllEmberPages = async (emberPagesPath) => {
|
|
17853
|
+
const { readdir: readdir4 } = await import("fs/promises");
|
|
17854
|
+
try {
|
|
17855
|
+
const entries = await readdir4(emberPagesPath, {
|
|
17856
|
+
recursive: true,
|
|
17857
|
+
withFileTypes: true
|
|
17858
|
+
});
|
|
17859
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve30(emberPagesPath, entry.name));
|
|
17860
|
+
} catch {
|
|
17861
|
+
return [];
|
|
17862
|
+
}
|
|
17863
|
+
}, handleEmberFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
17864
|
+
const emberDir = config.emberDirectory ?? "";
|
|
17865
|
+
const emberFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "ember");
|
|
17866
|
+
if (emberFiles.length === 0 || !emberDir) {
|
|
17867
|
+
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
17868
|
+
return state.manifest;
|
|
17869
|
+
}
|
|
17870
|
+
for (const file4 of emberFiles) {
|
|
17871
|
+
state.fileHashes.set(resolve30(file4), computeFileHash(file4));
|
|
17872
|
+
}
|
|
17873
|
+
const emberPagesPath = resolve30(emberDir, "pages");
|
|
17874
|
+
const directPageEntries = emberFiles.filter((file4) => resolve30(file4).startsWith(emberPagesPath));
|
|
17875
|
+
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
17876
|
+
if (allPageEntries.length === 0) {
|
|
17877
|
+
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
17878
|
+
return state.manifest;
|
|
17879
|
+
}
|
|
17880
|
+
const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
|
|
17881
|
+
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
17882
|
+
for (const serverPath of serverPaths) {
|
|
17883
|
+
const fileBase = basename11(serverPath, ".js");
|
|
17884
|
+
state.manifest[toPascal(fileBase)] = resolve30(serverPath);
|
|
17885
|
+
}
|
|
17886
|
+
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
17887
|
+
invalidateEmberSsrCache2();
|
|
17888
|
+
const duration = Date.now() - startTime;
|
|
17889
|
+
const [primary] = emberFiles;
|
|
17890
|
+
if (primary) {
|
|
17891
|
+
state.lastHmrPath = relative12(process.cwd(), primary).replace(/\\/g, "/");
|
|
17892
|
+
state.lastHmrFramework = "ember";
|
|
17893
|
+
logHmrUpdate(primary, "ember", duration);
|
|
17894
|
+
}
|
|
17895
|
+
broadcastToClients(state, {
|
|
17896
|
+
data: {
|
|
17897
|
+
affectedPages: allPageEntries,
|
|
17898
|
+
manifest: state.manifest
|
|
17899
|
+
},
|
|
17900
|
+
type: "full-reload"
|
|
17901
|
+
});
|
|
17902
|
+
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
17903
|
+
return state.manifest;
|
|
16762
17904
|
}, collectModuleUpdatesForFramework = (framework, filesToRebuild, manifest, state) => {
|
|
16763
|
-
const frameworkFiles = filesToRebuild.filter((
|
|
17905
|
+
const frameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === framework);
|
|
16764
17906
|
if (frameworkFiles.length === 0) {
|
|
16765
17907
|
return [];
|
|
16766
17908
|
}
|
|
@@ -16780,15 +17922,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16780
17922
|
if (!affectedFrameworks.includes("react") || !state.resolvedPaths.reactDir) {
|
|
16781
17923
|
return;
|
|
16782
17924
|
}
|
|
16783
|
-
const reactFiles = filesToRebuild.filter((
|
|
17925
|
+
const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
|
|
16784
17926
|
if (reactFiles.length === 0) {
|
|
16785
17927
|
return;
|
|
16786
17928
|
}
|
|
16787
|
-
const reactPageFiles = reactFiles.filter((
|
|
17929
|
+
const reactPageFiles = reactFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
16788
17930
|
const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
|
|
16789
17931
|
const [primarySource] = sourceFiles;
|
|
16790
17932
|
try {
|
|
16791
|
-
const hasComponentChanges = reactFiles.some((
|
|
17933
|
+
const hasComponentChanges = reactFiles.some((file4) => file4.endsWith(".tsx") || file4.endsWith(".ts") || file4.endsWith(".jsx"));
|
|
16792
17934
|
const hasCSSChanges = reactFiles.some(isStylePath);
|
|
16793
17935
|
logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
|
|
16794
17936
|
broadcastToClients(state, {
|
|
@@ -16809,7 +17951,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16809
17951
|
});
|
|
16810
17952
|
}
|
|
16811
17953
|
}, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
|
|
16812
|
-
const scriptBaseName =
|
|
17954
|
+
const scriptBaseName = basename11(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
16813
17955
|
const pascalName = toPascal(scriptBaseName);
|
|
16814
17956
|
const scriptPath = manifest[pascalName] || null;
|
|
16815
17957
|
if (!scriptPath) {
|
|
@@ -16826,13 +17968,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16826
17968
|
},
|
|
16827
17969
|
type: "script-update"
|
|
16828
17970
|
});
|
|
16829
|
-
}, isScriptFile = (
|
|
17971
|
+
}, isScriptFile = (file4) => (file4.endsWith(".ts") || file4.endsWith(".js") || file4.endsWith(".tsx") || file4.endsWith(".jsx")) && file4.replace(/\\/g, "/").includes("/scripts/"), resolveIslandDefinitionSource = (definition, buildInfo, islandFiles) => {
|
|
16830
17972
|
const { buildReference } = definition;
|
|
16831
17973
|
if (!buildReference?.source) {
|
|
16832
17974
|
return;
|
|
16833
17975
|
}
|
|
16834
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
16835
|
-
islandFiles.add(
|
|
17976
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve30(dirname16(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
17977
|
+
islandFiles.add(resolve30(sourcePath));
|
|
16836
17978
|
}, resolveIslandSourceFiles = async (config) => {
|
|
16837
17979
|
const registryPath = config.islands?.registry;
|
|
16838
17980
|
if (!registryPath) {
|
|
@@ -16840,7 +17982,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16840
17982
|
}
|
|
16841
17983
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
16842
17984
|
const islandFiles = new Set([
|
|
16843
|
-
|
|
17985
|
+
resolve30(buildInfo.resolvedRegistryPath)
|
|
16844
17986
|
]);
|
|
16845
17987
|
for (const definition of buildInfo.definitions) {
|
|
16846
17988
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -16851,14 +17993,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16851
17993
|
if (islandFiles.size === 0) {
|
|
16852
17994
|
return false;
|
|
16853
17995
|
}
|
|
16854
|
-
return filesToRebuild.some((
|
|
17996
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve30(file4)));
|
|
16855
17997
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
16856
17998
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
16857
17999
|
if (!shouldReload) {
|
|
16858
18000
|
return false;
|
|
16859
18001
|
}
|
|
16860
18002
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
16861
|
-
const affectedPages = filesToRebuild.flatMap((
|
|
18003
|
+
const affectedPages = filesToRebuild.flatMap((file4) => getPagesUsingIslandSource(file4));
|
|
16862
18004
|
broadcastToClients(state, {
|
|
16863
18005
|
data: {
|
|
16864
18006
|
affectedPages,
|
|
@@ -16871,12 +18013,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16871
18013
|
if (!state.resolvedPaths.htmlDir) {
|
|
16872
18014
|
return;
|
|
16873
18015
|
}
|
|
16874
|
-
const htmlFrameworkFiles = filesToRebuild.filter((
|
|
18016
|
+
const htmlFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "html");
|
|
16875
18017
|
if (htmlFrameworkFiles.length === 0) {
|
|
16876
18018
|
return;
|
|
16877
18019
|
}
|
|
16878
18020
|
const scriptFiles = htmlFrameworkFiles.filter(isScriptFile);
|
|
16879
|
-
const htmlPageFiles = htmlFrameworkFiles.filter((
|
|
18021
|
+
const htmlPageFiles = htmlFrameworkFiles.filter((file4) => file4.endsWith(".html"));
|
|
16880
18022
|
if (scriptFiles.length === 0 || htmlPageFiles.length > 0) {
|
|
16881
18023
|
return;
|
|
16882
18024
|
}
|
|
@@ -16886,10 +18028,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16886
18028
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
16887
18029
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
16888
18030
|
if (isSingle) {
|
|
16889
|
-
return
|
|
18031
|
+
return resolve30(state.resolvedPaths.buildDir, "pages");
|
|
16890
18032
|
}
|
|
16891
|
-
const dirName = framework === "html" ?
|
|
16892
|
-
return
|
|
18033
|
+
const dirName = framework === "html" ? basename11(config.htmlDirectory ?? "html") : basename11(config.htmxDirectory ?? "htmx");
|
|
18034
|
+
return resolve30(state.resolvedPaths.buildDir, dirName, "pages");
|
|
16893
18035
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
16894
18036
|
try {
|
|
16895
18037
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -16918,17 +18060,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16918
18060
|
return;
|
|
16919
18061
|
}
|
|
16920
18062
|
const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
16921
|
-
const htmlFrameworkFiles = filesToRebuild.filter((
|
|
18063
|
+
const htmlFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "html");
|
|
16922
18064
|
if (htmlFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
|
|
16923
18065
|
return;
|
|
16924
18066
|
}
|
|
16925
|
-
const htmlPageFiles = htmlFrameworkFiles.filter((
|
|
18067
|
+
const htmlPageFiles = htmlFrameworkFiles.filter((file4) => file4.endsWith(".html"));
|
|
16926
18068
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
16927
18069
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
16928
18070
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
16929
18071
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
16930
|
-
const htmlPageName =
|
|
16931
|
-
const builtHtmlPagePath =
|
|
18072
|
+
const htmlPageName = basename11(pageFile);
|
|
18073
|
+
const builtHtmlPagePath = resolve30(outputHtmlPages, htmlPageName);
|
|
16932
18074
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
16933
18075
|
});
|
|
16934
18076
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -16936,7 +18078,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16936
18078
|
if (!cssFile) {
|
|
16937
18079
|
return;
|
|
16938
18080
|
}
|
|
16939
|
-
const cssBaseName =
|
|
18081
|
+
const cssBaseName = basename11(getStyleBaseName(cssFile));
|
|
16940
18082
|
const cssPascalName = toPascal(cssBaseName);
|
|
16941
18083
|
const cssKey = `${cssPascalName}CSS`;
|
|
16942
18084
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -16985,7 +18127,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16985
18127
|
type: "vue-update"
|
|
16986
18128
|
});
|
|
16987
18129
|
}, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
|
|
16988
|
-
const fileName =
|
|
18130
|
+
const fileName = basename11(vuePagePath);
|
|
16989
18131
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
16990
18132
|
const pascalName = toPascal(baseName);
|
|
16991
18133
|
const vueRoot = config.vueDirectory;
|
|
@@ -16993,7 +18135,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16993
18135
|
const cssKey = `${pascalName}CSS`;
|
|
16994
18136
|
const cssUrl = manifest[cssKey] || null;
|
|
16995
18137
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
16996
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
18138
|
+
const hmrMeta = vueHmrMetadata2.get(resolve30(vuePagePath));
|
|
16997
18139
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
16998
18140
|
if (changeType === "style-only") {
|
|
16999
18141
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -17013,14 +18155,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17013
18155
|
if (!config.vueDirectory) {
|
|
17014
18156
|
return;
|
|
17015
18157
|
}
|
|
17016
|
-
const vueFiles = filesToRebuild.filter((
|
|
18158
|
+
const vueFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "vue");
|
|
17017
18159
|
if (vueFiles.length === 0) {
|
|
17018
18160
|
return;
|
|
17019
18161
|
}
|
|
17020
|
-
const vueComponentFiles = vueFiles.filter((
|
|
18162
|
+
const vueComponentFiles = vueFiles.filter((file4) => file4.endsWith(".vue"));
|
|
17021
18163
|
const vueCssFiles = vueFiles.filter(isStylePath);
|
|
17022
18164
|
const isCssOnlyChange = vueComponentFiles.length === 0 && vueCssFiles.length > 0;
|
|
17023
|
-
const vuePageFiles = vueFiles.filter((
|
|
18165
|
+
const vuePageFiles = vueFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
17024
18166
|
const pagesToUpdate = vuePageFiles.length > 0 ? vuePageFiles : vueComponentFiles;
|
|
17025
18167
|
if (isCssOnlyChange && vueCssFiles.length > 0) {
|
|
17026
18168
|
handleVueCssOnlyUpdate(state, vueCssFiles, manifest, duration);
|
|
@@ -17031,7 +18173,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17031
18173
|
if (!cssFile) {
|
|
17032
18174
|
return;
|
|
17033
18175
|
}
|
|
17034
|
-
const cssBaseName =
|
|
18176
|
+
const cssBaseName = basename11(getStyleBaseName(cssFile));
|
|
17035
18177
|
const cssPascalName = toPascal(cssBaseName);
|
|
17036
18178
|
const cssKey = `${cssPascalName}CSS`;
|
|
17037
18179
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -17049,7 +18191,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17049
18191
|
});
|
|
17050
18192
|
}, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
|
|
17051
18193
|
try {
|
|
17052
|
-
const fileName =
|
|
18194
|
+
const fileName = basename11(sveltePagePath);
|
|
17053
18195
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
17054
18196
|
const pascalName = toPascal(baseName);
|
|
17055
18197
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -17077,14 +18219,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17077
18219
|
if (!config.svelteDirectory) {
|
|
17078
18220
|
return;
|
|
17079
18221
|
}
|
|
17080
|
-
const svelteFiles = filesToRebuild.filter((
|
|
18222
|
+
const svelteFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "svelte");
|
|
17081
18223
|
if (svelteFiles.length === 0) {
|
|
17082
18224
|
return;
|
|
17083
18225
|
}
|
|
17084
|
-
const svelteComponentFiles = svelteFiles.filter((
|
|
18226
|
+
const svelteComponentFiles = svelteFiles.filter((file4) => file4.endsWith(".svelte"));
|
|
17085
18227
|
const svelteCssFiles = svelteFiles.filter(isStylePath);
|
|
17086
18228
|
const isCssOnlyChange = svelteComponentFiles.length === 0 && svelteCssFiles.length > 0;
|
|
17087
|
-
const sveltePageFiles = svelteFiles.filter((
|
|
18229
|
+
const sveltePageFiles = svelteFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
17088
18230
|
const pagesToUpdate = sveltePageFiles.length > 0 ? sveltePageFiles : svelteComponentFiles;
|
|
17089
18231
|
if (isCssOnlyChange && svelteCssFiles.length > 0) {
|
|
17090
18232
|
handleSvelteCssOnlyUpdate(state, svelteCssFiles, manifest, duration);
|
|
@@ -17093,9 +18235,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17093
18235
|
broadcastSveltePageUpdate(state, sveltePagePath, manifest, duration);
|
|
17094
18236
|
});
|
|
17095
18237
|
}, collectAngularAffectedPages = (affected, resolvedPages) => {
|
|
17096
|
-
affected.forEach((
|
|
17097
|
-
if (
|
|
17098
|
-
resolvedPages.add(
|
|
18238
|
+
affected.forEach((file4) => {
|
|
18239
|
+
if (file4.replace(/\\/g, "/").includes("/pages/") && file4.endsWith(".ts")) {
|
|
18240
|
+
resolvedPages.add(file4);
|
|
17099
18241
|
}
|
|
17100
18242
|
});
|
|
17101
18243
|
}, resolveAngularPagesFromDependencyGraph = (state, angularFiles) => {
|
|
@@ -17111,7 +18253,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17111
18253
|
if (!cssFile) {
|
|
17112
18254
|
return;
|
|
17113
18255
|
}
|
|
17114
|
-
const cssBaseName =
|
|
18256
|
+
const cssBaseName = basename11(getStyleBaseName(cssFile));
|
|
17115
18257
|
const cssPascalName = toPascal(cssBaseName);
|
|
17116
18258
|
const cssKey = `${cssPascalName}CSS`;
|
|
17117
18259
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -17129,7 +18271,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17129
18271
|
});
|
|
17130
18272
|
}, broadcastAngularPageHmrUpdate = (state, angularPagePath, manifest, duration) => {
|
|
17131
18273
|
try {
|
|
17132
|
-
const fileName =
|
|
18274
|
+
const fileName = basename11(angularPagePath);
|
|
17133
18275
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
17134
18276
|
const pascalName = toPascal(baseName);
|
|
17135
18277
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -17156,13 +18298,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17156
18298
|
if (!config.angularDirectory) {
|
|
17157
18299
|
return;
|
|
17158
18300
|
}
|
|
17159
|
-
const angularFiles = filesToRebuild.filter((
|
|
18301
|
+
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
17160
18302
|
if (angularFiles.length === 0) {
|
|
17161
18303
|
return;
|
|
17162
18304
|
}
|
|
17163
18305
|
const angularCssFiles = angularFiles.filter(isStylePath);
|
|
17164
18306
|
const isCssOnlyChange = angularFiles.every(isStylePath) && angularCssFiles.length > 0;
|
|
17165
|
-
const angularPageFiles = angularFiles.filter((
|
|
18307
|
+
const angularPageFiles = angularFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
17166
18308
|
let pagesToUpdate = angularPageFiles;
|
|
17167
18309
|
if (pagesToUpdate.length === 0 && state.dependencyGraph) {
|
|
17168
18310
|
pagesToUpdate = resolveAngularPagesFromDependencyGraph(state, angularFiles);
|
|
@@ -17178,12 +18320,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17178
18320
|
if (!state.resolvedPaths.htmxDir) {
|
|
17179
18321
|
return;
|
|
17180
18322
|
}
|
|
17181
|
-
const htmxFrameworkFiles = filesToRebuild.filter((
|
|
18323
|
+
const htmxFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "htmx");
|
|
17182
18324
|
if (htmxFrameworkFiles.length === 0) {
|
|
17183
18325
|
return;
|
|
17184
18326
|
}
|
|
17185
18327
|
const htmxScriptFiles = htmxFrameworkFiles.filter(isScriptFile);
|
|
17186
|
-
const htmxHtmlFiles = htmxFrameworkFiles.filter((
|
|
18328
|
+
const htmxHtmlFiles = htmxFrameworkFiles.filter((file4) => file4.endsWith(".html"));
|
|
17187
18329
|
if (htmxScriptFiles.length === 0 || htmxHtmlFiles.length > 0) {
|
|
17188
18330
|
return;
|
|
17189
18331
|
}
|
|
@@ -17218,17 +18360,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17218
18360
|
return;
|
|
17219
18361
|
}
|
|
17220
18362
|
const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
17221
|
-
const htmxFrameworkFiles = filesToRebuild.filter((
|
|
18363
|
+
const htmxFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "htmx");
|
|
17222
18364
|
if (htmxFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
|
|
17223
18365
|
return;
|
|
17224
18366
|
}
|
|
17225
|
-
const htmxPageFiles = htmxFrameworkFiles.filter((
|
|
18367
|
+
const htmxPageFiles = htmxFrameworkFiles.filter((file4) => file4.endsWith(".html"));
|
|
17226
18368
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
17227
18369
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
17228
18370
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
17229
18371
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
17230
|
-
const htmxPageName =
|
|
17231
|
-
const builtHtmxPagePath =
|
|
18372
|
+
const htmxPageName = basename11(htmxPageFile);
|
|
18373
|
+
const builtHtmxPagePath = resolve30(outputHtmxPages, htmxPageName);
|
|
17232
18374
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
17233
18375
|
});
|
|
17234
18376
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -17297,9 +18439,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17297
18439
|
handleModuleUpdates(state, allModuleUpdates, manifest);
|
|
17298
18440
|
}, logStyleUpdatesForFramework = (state, framework, filesToRebuild, startTime) => {
|
|
17299
18441
|
const dur = Date.now() - startTime;
|
|
17300
|
-
filesToRebuild.forEach((
|
|
17301
|
-
if (detectFramework(
|
|
17302
|
-
logCssUpdate(
|
|
18442
|
+
filesToRebuild.forEach((file4) => {
|
|
18443
|
+
if (detectFramework(file4, state.resolvedPaths) === framework) {
|
|
18444
|
+
logCssUpdate(file4, framework, dur);
|
|
17303
18445
|
}
|
|
17304
18446
|
});
|
|
17305
18447
|
}, broadcastSingleFrameworkUpdate = (state, framework, filesToRebuild, manifest, startTime) => {
|
|
@@ -17337,7 +18479,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17337
18479
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
17338
18480
|
writeFs(destPath, html);
|
|
17339
18481
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
17340
|
-
const destPath =
|
|
18482
|
+
const destPath = resolve30(outputDir, basename11(sourceFile));
|
|
17341
18483
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
17342
18484
|
const source = await Bun.file(sourceFile).text();
|
|
17343
18485
|
await Bun.write(destPath, source);
|
|
@@ -17367,7 +18509,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17367
18509
|
return false;
|
|
17368
18510
|
}
|
|
17369
18511
|
}, runMarkupFastPath = async (state, config, filesToRebuild, startTime, framework) => {
|
|
17370
|
-
const markupFiles = (filesToRebuild ?? []).filter((
|
|
18512
|
+
const markupFiles = (filesToRebuild ?? []).filter((file4) => file4.endsWith(".html"));
|
|
17371
18513
|
if (markupFiles.length === 0)
|
|
17372
18514
|
return;
|
|
17373
18515
|
const outputDir = computeOutputPagesDir(state, config, framework);
|
|
@@ -17396,6 +18538,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17396
18538
|
framework: "angular",
|
|
17397
18539
|
handler: handleAngularFastPath
|
|
17398
18540
|
},
|
|
18541
|
+
{
|
|
18542
|
+
directory: config.emberDirectory,
|
|
18543
|
+
framework: "ember",
|
|
18544
|
+
handler: handleEmberFastPath
|
|
18545
|
+
},
|
|
17399
18546
|
{
|
|
17400
18547
|
directory: config.reactDirectory,
|
|
17401
18548
|
framework: "react",
|
|
@@ -17513,7 +18660,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17513
18660
|
queuedFiles.push(...filePaths);
|
|
17514
18661
|
});
|
|
17515
18662
|
state.fileChangeQueue.clear();
|
|
17516
|
-
pending.forEach((
|
|
18663
|
+
pending.forEach((file4) => state.rebuildQueue.add(file4));
|
|
17517
18664
|
if (state.rebuildTimeout)
|
|
17518
18665
|
clearTimeout(state.rebuildTimeout);
|
|
17519
18666
|
state.rebuildTimeout = setTimeout(() => {
|
|
@@ -17580,6 +18727,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
17580
18727
|
init_ssrCache();
|
|
17581
18728
|
moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
17582
18729
|
getReactModuleUrl = getModuleUrl;
|
|
18730
|
+
EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
|
|
17583
18731
|
HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
|
|
17584
18732
|
});
|
|
17585
18733
|
|
|
@@ -17609,23 +18757,26 @@ __export(exports_buildDepVendor, {
|
|
|
17609
18757
|
computeDepVendorPaths: () => computeDepVendorPaths,
|
|
17610
18758
|
buildDepVendor: () => buildDepVendor
|
|
17611
18759
|
});
|
|
17612
|
-
import { mkdirSync as
|
|
17613
|
-
import { join as
|
|
17614
|
-
import { rm as
|
|
17615
|
-
var {build:
|
|
17616
|
-
var
|
|
18760
|
+
import { mkdirSync as mkdirSync12 } from "fs";
|
|
18761
|
+
import { join as join26 } from "path";
|
|
18762
|
+
import { rm as rm11 } from "fs/promises";
|
|
18763
|
+
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
18764
|
+
var toSafeFileName6 = (specifier) => {
|
|
18765
|
+
const prefix = specifier.startsWith("@") ? "_" : "";
|
|
18766
|
+
return prefix + specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_");
|
|
18767
|
+
}, isResolvable4 = (specifier) => {
|
|
17617
18768
|
try {
|
|
17618
18769
|
Bun.resolveSync(specifier, process.cwd());
|
|
17619
18770
|
return true;
|
|
17620
18771
|
} catch {
|
|
17621
18772
|
return false;
|
|
17622
18773
|
}
|
|
17623
|
-
}, isBareSpecifier2 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (
|
|
18774
|
+
}, isBareSpecifier2 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file4) => file4.includes("node_modules") || file4.includes("/build/") || file4.includes("/dist/") || file4.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file4, transpiler5) => {
|
|
17624
18775
|
const dep = [];
|
|
17625
18776
|
const framework = [];
|
|
17626
18777
|
try {
|
|
17627
|
-
const content = await Bun.file(
|
|
17628
|
-
for (const imp of
|
|
18778
|
+
const content = await Bun.file(file4).text();
|
|
18779
|
+
for (const imp of transpiler5.scanImports(content)) {
|
|
17629
18780
|
if (isDepSpecifier(imp.path))
|
|
17630
18781
|
dep.push(imp.path);
|
|
17631
18782
|
else if (isFrameworkRootCandidate(imp.path))
|
|
@@ -17638,13 +18789,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17638
18789
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx}");
|
|
17639
18790
|
try {
|
|
17640
18791
|
const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
|
|
17641
|
-
return all.filter((
|
|
18792
|
+
return all.filter((file4) => !isSkippedFile(file4));
|
|
17642
18793
|
} catch {
|
|
17643
18794
|
return empty;
|
|
17644
18795
|
}
|
|
17645
|
-
}, collectDirSpecifiers = async (dir,
|
|
18796
|
+
}, collectDirSpecifiers = async (dir, transpiler5, dep, framework) => {
|
|
17646
18797
|
const files = await scanDirFiles(dir);
|
|
17647
|
-
const results = await Promise.all(files.map((
|
|
18798
|
+
const results = await Promise.all(files.map((file4) => readFileSpecifiers(file4, transpiler5)));
|
|
17648
18799
|
for (const result of results) {
|
|
17649
18800
|
for (const spec of result.dep)
|
|
17650
18801
|
dep.add(spec);
|
|
@@ -17654,15 +18805,15 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17654
18805
|
}, scanBareImports = async (directories) => {
|
|
17655
18806
|
const dep = new Set;
|
|
17656
18807
|
const framework = new Set;
|
|
17657
|
-
const
|
|
17658
|
-
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir,
|
|
18808
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
18809
|
+
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler5, dep, framework)));
|
|
17659
18810
|
return {
|
|
17660
18811
|
dep: Array.from(dep).filter(isResolvable4),
|
|
17661
18812
|
framework: Array.from(framework).filter(isResolvable4)
|
|
17662
18813
|
};
|
|
17663
18814
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
17664
18815
|
const { readFileSync: readFileSync16 } = await import("fs");
|
|
17665
|
-
const
|
|
18816
|
+
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
17666
18817
|
const newSpecs = new Set;
|
|
17667
18818
|
for (const spec of specs) {
|
|
17668
18819
|
if (alreadyScanned.has(spec))
|
|
@@ -17682,7 +18833,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17682
18833
|
}
|
|
17683
18834
|
let imports;
|
|
17684
18835
|
try {
|
|
17685
|
-
imports =
|
|
18836
|
+
imports = transpiler5.scanImports(content);
|
|
17686
18837
|
} catch {
|
|
17687
18838
|
continue;
|
|
17688
18839
|
}
|
|
@@ -17702,32 +18853,54 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17702
18853
|
}
|
|
17703
18854
|
}
|
|
17704
18855
|
return newSpecs;
|
|
17705
|
-
},
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
18856
|
+
}, PURE_ANNOTATION, createStripPureAnnotationsPlugin = () => ({
|
|
18857
|
+
name: "absolute-dep-vendor-strip-pure",
|
|
18858
|
+
setup(bld) {
|
|
18859
|
+
bld.onLoad({ filter: /\.(?:m?js|cjs)$/ }, async (args) => {
|
|
18860
|
+
const source = await Bun.file(args.path).text();
|
|
18861
|
+
if (!source.includes("@__PURE__"))
|
|
18862
|
+
return null;
|
|
18863
|
+
return {
|
|
18864
|
+
contents: source.replace(PURE_ANNOTATION, ""),
|
|
18865
|
+
loader: args.path.endsWith(".cjs") ? "js" : "js"
|
|
18866
|
+
};
|
|
18867
|
+
});
|
|
18868
|
+
}
|
|
18869
|
+
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
18870
|
+
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
18871
|
+
const safeName = toSafeFileName6(specifier);
|
|
18872
|
+
const entryPath = join26(tmpDir, `${safeName}.ts`);
|
|
18873
|
+
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18874
|
+
return { entryPath, specifier };
|
|
17711
18875
|
}));
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
18876
|
+
const isPrefixOrEqual = (candidate, current) => current === candidate || current.startsWith(`${candidate}/`);
|
|
18877
|
+
const otherSpecsFor = (current) => specifiers.filter((spec) => !isPrefixOrEqual(spec, current));
|
|
18878
|
+
const results = await Promise.all(entries.map(({ entryPath, specifier }) => bunBuild9({
|
|
18879
|
+
entrypoints: [entryPath],
|
|
18880
|
+
external: [...FRAMEWORK_EXTERNALS, ...otherSpecsFor(specifier)],
|
|
17715
18881
|
format: "esm",
|
|
17716
18882
|
minify: false,
|
|
17717
18883
|
naming: "[name].[ext]",
|
|
17718
18884
|
outdir: vendorDir,
|
|
18885
|
+
plugins: [createStripPureAnnotationsPlugin()],
|
|
17719
18886
|
splitting: false,
|
|
17720
18887
|
target: "browser",
|
|
17721
18888
|
throw: false
|
|
17722
|
-
});
|
|
18889
|
+
})));
|
|
18890
|
+
const aggregated = {
|
|
18891
|
+
success: results.every((result) => result.success),
|
|
18892
|
+
logs: results.flatMap((result) => result.logs),
|
|
18893
|
+
outputs: results.flatMap((result) => result.outputs)
|
|
18894
|
+
};
|
|
18895
|
+
return aggregated;
|
|
17723
18896
|
}, MAX_VENDOR_DISCOVERY_PASSES = 5, buildDepVendor = async (buildDir, directories) => {
|
|
17724
18897
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
17725
18898
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
17726
18899
|
return {};
|
|
17727
|
-
const vendorDir =
|
|
17728
|
-
|
|
17729
|
-
const tmpDir =
|
|
17730
|
-
|
|
18900
|
+
const vendorDir = join26(buildDir, "vendor");
|
|
18901
|
+
mkdirSync12(vendorDir, { recursive: true });
|
|
18902
|
+
const tmpDir = join26(buildDir, "_dep_vendor_tmp");
|
|
18903
|
+
mkdirSync12(tmpDir, { recursive: true });
|
|
17731
18904
|
const allSpecs = new Set(initialSpecs);
|
|
17732
18905
|
const alreadyScanned = new Set;
|
|
17733
18906
|
let frontier = [...allSpecs, ...frameworkRoots];
|
|
@@ -17746,10 +18919,10 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17746
18919
|
if (!success) {
|
|
17747
18920
|
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
17748
18921
|
}
|
|
17749
|
-
await
|
|
18922
|
+
await rm11(tmpDir, { force: true, recursive: true });
|
|
17750
18923
|
const paths = {};
|
|
17751
18924
|
for (const specifier of allSpecs) {
|
|
17752
|
-
paths[specifier] = `/vendor/${
|
|
18925
|
+
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
17753
18926
|
}
|
|
17754
18927
|
return paths;
|
|
17755
18928
|
}, computeDepVendorPaths = async (directories) => {
|
|
@@ -17767,11 +18940,12 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17767
18940
|
}
|
|
17768
18941
|
const paths = {};
|
|
17769
18942
|
for (const specifier of allSpecs) {
|
|
17770
|
-
paths[specifier] = `/vendor/${
|
|
18943
|
+
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
17771
18944
|
}
|
|
17772
18945
|
return paths;
|
|
17773
18946
|
};
|
|
17774
18947
|
var init_buildDepVendor = __esm(() => {
|
|
18948
|
+
init_vendorEntrySource();
|
|
17775
18949
|
FRAMEWORK_SPECIFIERS = new Set([
|
|
17776
18950
|
"react",
|
|
17777
18951
|
"react-dom",
|
|
@@ -17798,6 +18972,7 @@ var init_buildDepVendor = __esm(() => {
|
|
|
17798
18972
|
...FRAMEWORK_SPECIFIERS,
|
|
17799
18973
|
...FRAMEWORK_NAMESPACE_PREFIXES.map((prefix) => `${prefix}*`)
|
|
17800
18974
|
];
|
|
18975
|
+
PURE_ANNOTATION = /\/\*\s*@__PURE__\s*\*\//g;
|
|
17801
18976
|
});
|
|
17802
18977
|
|
|
17803
18978
|
// src/core/devBuild.ts
|
|
@@ -17807,7 +18982,7 @@ __export(exports_devBuild, {
|
|
|
17807
18982
|
});
|
|
17808
18983
|
import { readdir as readdir4 } from "fs/promises";
|
|
17809
18984
|
import { statSync as statSync3 } from "fs";
|
|
17810
|
-
import { resolve as
|
|
18985
|
+
import { resolve as resolve31 } from "path";
|
|
17811
18986
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
17812
18987
|
const configuredDirs = [
|
|
17813
18988
|
config.reactDirectory,
|
|
@@ -17830,7 +19005,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17830
19005
|
return Object.keys(config).length > 0 ? config : null;
|
|
17831
19006
|
}, reloadConfig = async () => {
|
|
17832
19007
|
try {
|
|
17833
|
-
const configPath2 =
|
|
19008
|
+
const configPath2 = resolve31(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
17834
19009
|
const source = await Bun.file(configPath2).text();
|
|
17835
19010
|
return parseDirectoryConfig(source);
|
|
17836
19011
|
} catch {
|
|
@@ -17862,6 +19037,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17862
19037
|
if (!oldConfig.vueDirectory && Boolean(newConfig.vueDirectory)) {
|
|
17863
19038
|
setVueVendorPaths(computeVueVendorPaths());
|
|
17864
19039
|
}
|
|
19040
|
+
if (!oldConfig.emberDirectory && Boolean(newConfig.emberDirectory)) {
|
|
19041
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19042
|
+
}
|
|
17865
19043
|
const newWatchPaths = getWatchPaths(state.config, state.resolvedPaths);
|
|
17866
19044
|
const addedPaths = newWatchPaths.filter((path) => !oldWatchPaths.has(path));
|
|
17867
19045
|
if (addedPaths.length > 0) {
|
|
@@ -17912,7 +19090,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17912
19090
|
state.fileChangeQueue.clear();
|
|
17913
19091
|
}
|
|
17914
19092
|
}, handleCachedReload = async () => {
|
|
17915
|
-
const serverMtime = statSync3(
|
|
19093
|
+
const serverMtime = statSync3(resolve31(Bun.main)).mtimeMs;
|
|
17916
19094
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
17917
19095
|
globalThis.__hmrServerMtime = serverMtime;
|
|
17918
19096
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -17928,6 +19106,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17928
19106
|
if (cached?.hmrState.config.vueDirectory) {
|
|
17929
19107
|
setVueVendorPaths(computeVueVendorPaths());
|
|
17930
19108
|
}
|
|
19109
|
+
if (cached?.hmrState.config.emberDirectory) {
|
|
19110
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19111
|
+
}
|
|
17931
19112
|
if (serverMtime === lastMtime) {
|
|
17932
19113
|
globalThis.__hmrSkipServerRestart = true;
|
|
17933
19114
|
return;
|
|
@@ -17946,8 +19127,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17946
19127
|
return true;
|
|
17947
19128
|
}, resolveAbsoluteVersion2 = async () => {
|
|
17948
19129
|
const candidates = [
|
|
17949
|
-
|
|
17950
|
-
|
|
19130
|
+
resolve31(import.meta.dir, "..", "..", "package.json"),
|
|
19131
|
+
resolve31(import.meta.dir, "..", "package.json")
|
|
17951
19132
|
];
|
|
17952
19133
|
const [candidate, ...remaining] = candidates;
|
|
17953
19134
|
if (!candidate) {
|
|
@@ -17973,7 +19154,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17973
19154
|
const entries = await readdir4(vendorDir).catch(() => emptyStringArray);
|
|
17974
19155
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
17975
19156
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
17976
|
-
const bytes = await Bun.file(
|
|
19157
|
+
const bytes = await Bun.file(resolve31(vendorDir, entry)).bytes();
|
|
17977
19158
|
assetStore.set(webPath, bytes);
|
|
17978
19159
|
}));
|
|
17979
19160
|
}, devBuild = async (config) => {
|
|
@@ -18008,6 +19189,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18008
19189
|
if (config.vueDirectory) {
|
|
18009
19190
|
setVueVendorPaths(computeVueVendorPaths());
|
|
18010
19191
|
}
|
|
19192
|
+
if (config.emberDirectory) {
|
|
19193
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19194
|
+
}
|
|
18011
19195
|
const sourceDirs = collectDepVendorSourceDirs(config);
|
|
18012
19196
|
if (config.angularDirectory) {
|
|
18013
19197
|
setAngularVendorPaths(await computeAngularVendorPathsAsync(sourceDirs));
|
|
@@ -18039,18 +19223,19 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18039
19223
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
18040
19224
|
recordStep("populate asset store", stepStartedAt);
|
|
18041
19225
|
stepStartedAt = performance.now();
|
|
18042
|
-
const reactVendorDir =
|
|
18043
|
-
const angularVendorDir =
|
|
18044
|
-
const svelteVendorDir =
|
|
18045
|
-
const vueVendorDir =
|
|
18046
|
-
const depVendorDir =
|
|
19226
|
+
const reactVendorDir = resolve31(state.resolvedPaths.buildDir, "react", "vendor");
|
|
19227
|
+
const angularVendorDir = resolve31(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
19228
|
+
const svelteVendorDir = resolve31(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
19229
|
+
const vueVendorDir = resolve31(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
19230
|
+
const depVendorDir = resolve31(state.resolvedPaths.buildDir, "vendor");
|
|
18047
19231
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
18048
|
-
const [, angularSpecs, angularServerSpecs, , , depPaths] = await Promise.all([
|
|
19232
|
+
const [, angularSpecs, angularServerSpecs, , , , depPaths] = await Promise.all([
|
|
18049
19233
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
18050
19234
|
config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir, sourceDirs, true, Object.keys(globalThis.__depVendorPaths ?? {})) : Promise.resolve(undefined),
|
|
18051
19235
|
config.angularDirectory ? buildAngularServerVendor(state.resolvedPaths.buildDir, sourceDirs, true) : Promise.resolve(undefined),
|
|
18052
19236
|
config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
18053
19237
|
config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
19238
|
+
config.emberDirectory ? buildEmberVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
18054
19239
|
buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs)
|
|
18055
19240
|
]);
|
|
18056
19241
|
if (angularSpecs)
|
|
@@ -18058,6 +19243,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18058
19243
|
if (angularServerSpecs) {
|
|
18059
19244
|
setAngularServerVendorPaths(computeAngularServerVendorPaths(state.resolvedPaths.buildDir, angularServerSpecs));
|
|
18060
19245
|
}
|
|
19246
|
+
if (config.emberDirectory) {
|
|
19247
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19248
|
+
}
|
|
18061
19249
|
globalThis.__depVendorPaths = depPaths;
|
|
18062
19250
|
recordStep("build vendor bundles", stepStartedAt);
|
|
18063
19251
|
stepStartedAt = performance.now();
|
|
@@ -18120,7 +19308,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18120
19308
|
manifest
|
|
18121
19309
|
};
|
|
18122
19310
|
globalThis.__hmrDevResult = result;
|
|
18123
|
-
globalThis.__hmrServerMtime = statSync3(
|
|
19311
|
+
globalThis.__hmrServerMtime = statSync3(resolve31(Bun.main)).mtimeMs;
|
|
18124
19312
|
return result;
|
|
18125
19313
|
};
|
|
18126
19314
|
var init_devBuild = __esm(() => {
|
|
@@ -18129,6 +19317,7 @@ var init_devBuild = __esm(() => {
|
|
|
18129
19317
|
init_buildAngularVendor();
|
|
18130
19318
|
init_buildSvelteVendor();
|
|
18131
19319
|
init_buildVueVendor();
|
|
19320
|
+
init_buildEmberVendor();
|
|
18132
19321
|
init_clientManager();
|
|
18133
19322
|
init_configResolver();
|
|
18134
19323
|
init_dependencyGraph();
|
|
@@ -18156,5 +19345,5 @@ export {
|
|
|
18156
19345
|
build
|
|
18157
19346
|
};
|
|
18158
19347
|
|
|
18159
|
-
//# debugId=
|
|
19348
|
+
//# debugId=4D4396D799FC767D64756E2164756E21
|
|
18160
19349
|
//# sourceMappingURL=build.js.map
|