@absolutejs/absolute 0.19.0-beta.840 → 0.19.0-beta.841

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.
Files changed (46) hide show
  1. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  2. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  3. package/dist/angular/index.js +57 -54
  4. package/dist/angular/index.js.map +5 -5
  5. package/dist/angular/server.js +57 -54
  6. package/dist/angular/server.js.map +5 -5
  7. package/dist/build.js +1614 -427
  8. package/dist/build.js.map +23 -15
  9. package/dist/cli/index.js +1 -0
  10. package/dist/index.js +1667 -475
  11. package/dist/index.js.map +25 -17
  12. package/dist/react/index.js +57 -53
  13. package/dist/react/index.js.map +5 -5
  14. package/dist/react/server.js +57 -53
  15. package/dist/react/server.js.map +5 -5
  16. package/dist/src/build/buildEmberVendor.d.ts +24 -0
  17. package/dist/src/build/compileEmber.d.ts +43 -0
  18. package/dist/src/build/vendorEntrySource.d.ts +1 -26
  19. package/dist/src/build/vueAutoRouterTransform.d.ts +1 -0
  20. package/dist/src/core/devVendorPaths.d.ts +2 -0
  21. package/dist/src/dev/configResolver.d.ts +1 -0
  22. package/dist/src/dev/pathUtils.d.ts +1 -1
  23. package/dist/src/ember/browser.d.ts +24 -0
  24. package/dist/src/ember/index.d.ts +2 -0
  25. package/dist/src/ember/pageHandler.d.ts +35 -0
  26. package/dist/src/ember/server.d.ts +2 -0
  27. package/dist/src/utils/loadConfig.d.ts +1 -0
  28. package/dist/src/vue/browser.d.ts +2 -0
  29. package/dist/src/vue/defineVuePage.d.ts +5 -0
  30. package/dist/src/vue/index.d.ts +2 -0
  31. package/dist/svelte/index.js +57 -53
  32. package/dist/svelte/index.js.map +5 -5
  33. package/dist/svelte/server.js +57 -53
  34. package/dist/svelte/server.js.map +5 -5
  35. package/dist/types/build.d.ts +1 -0
  36. package/dist/types/conventions.d.ts +1 -0
  37. package/dist/types/ember.d.ts +41 -0
  38. package/dist/types/island.d.ts +3 -2
  39. package/dist/types/vue.d.ts +28 -1
  40. package/dist/vue/browser.js +4 -1
  41. package/dist/vue/browser.js.map +5 -4
  42. package/dist/vue/index.js +62 -53
  43. package/dist/vue/index.js.map +7 -6
  44. package/dist/vue/server.js +59 -53
  45. package/dist/vue/server.js.map +6 -6
  46. 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 sourceContent = await file2(sourceFilePath).text();
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 importPaths = extractImports(scriptSource);
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
- "// Optional setupApp hook \u2014 page modules can export `setupApp(app, { url, isServer })`",
10484
- "// to attach plugins like vue-router that require app.use() before mount.",
10485
- "// On the client we pass the current location.pathname + search as `url` and",
10486
- "// `isServer: false` so the same hook works in both environments.",
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 PageModule.setupApp === "function") {',
10553
+ ' if (typeof setupAppHook === "function") {',
10489
10554
  ' const clientUrl = typeof window !== "undefined"',
10490
10555
  " ? window.location.pathname + window.location.search",
10491
10556
  ' : "/";',
10492
- " await PageModule.setupApp(app, { url: clientUrl, isServer: false });",
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 existsSync17, mkdirSync as mkdirSync6 } from "fs";
12283
- import { join as join17, resolve as resolve17 } from "path";
12284
- import { rm as rm5 } from "fs/promises";
12285
- var {build: bunBuild2 } = globalThis.Bun;
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
- resolve17(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
12289
- resolve17(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
12290
- resolve17(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
12291
- resolve17(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
12292
- resolve17(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
12293
- resolve17(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
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 (existsSync17(candidate)) {
13059
+ if (existsSync18(candidate)) {
12297
13060
  return candidate.replace(/\\/g, "/");
12298
13061
  }
12299
13062
  }
12300
- return (candidates[0] ?? resolve17(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
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 = join17(buildDir, "react", "vendor");
13100
+ const vendorDir = join18(buildDir, "react", "vendor");
12338
13101
  mkdirSync6(vendorDir, { recursive: true });
12339
- const tmpDir = join17(buildDir, "_vendor_tmp");
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 = join17(tmpDir, `${safeName}.ts`);
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 bunBuild2({
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 rm5(tmpDir, { force: true, recursive: true });
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) => `import * as __abs_ns from '${specifier}';
12377
- ` + `export * from '${specifier}';
12378
- ` + `export default __abs_ns.default;
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 join18 } from "path";
12393
- import { rm as rm6 } from "fs/promises";
12394
- var {build: bunBuild3, Glob: Glob6 } = globalThis.Bun;
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 transpiler4 = new Bun.Transpiler({ loader: "tsx" });
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 file3 of glob.scan({ absolute: true, cwd: dir })) {
12410
- const rel = file3.slice(dir.length + 1);
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(file3).text();
12416
- for (const imp of transpiler4.scanImports(content)) {
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 transpiler4 = new Bun.Transpiler({ loader: "js" });
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 = transpiler4.scanImports(content);
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 = join18(buildDir, "angular", "vendor");
13267
+ const vendorDir = join19(buildDir, "angular", "vendor");
12490
13268
  mkdirSync7(vendorDir, { recursive: true });
12491
- const tmpDir = join18(buildDir, "_angular_vendor_tmp");
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 = join18(tmpDir, `${safeName}.ts`);
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 bunBuild3({
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 rm6(tmpDir, { force: true, recursive: true });
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 = join18(buildDir, "angular", "vendor", "server");
13305
+ const vendorDir = join19(buildDir, "angular", "vendor", "server");
12528
13306
  mkdirSync7(vendorDir, { recursive: true });
12529
- const tmpDir = join18(buildDir, "_angular_server_vendor_tmp");
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 = join18(tmpDir, `${safeName}.ts`);
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 bunBuild3({
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 rm6(tmpDir, { force: true, recursive: true });
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 = join18(buildDir, "angular", "vendor", "server");
13340
+ const vendorDir = join19(buildDir, "angular", "vendor", "server");
12563
13341
  for (const specifier of specifiers) {
12564
- paths[specifier] = join18(vendorDir, `${toSafeFileName2(specifier)}.js`);
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 join19 } from "path";
12620
- import { rm as rm7 } from "fs/promises";
12621
- var {build: bunBuild4 } = globalThis.Bun;
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 = join19(buildDir, "vue", "vendor");
13402
+ const vendorDir = join20(buildDir, "vue", "vendor");
12624
13403
  mkdirSync8(vendorDir, { recursive: true });
12625
- const tmpDir = join19(buildDir, "_vue_vendor_tmp");
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 = join19(tmpDir, `${safeName}.ts`);
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 bunBuild4({
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 rm7(tmpDir, { force: true, recursive: true });
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 file3 of files) {
12657
- const filePath = join19(vendorDir, file3);
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 join20 } from "path";
12685
- import { rm as rm8 } from "fs/promises";
12686
- var {build: bunBuild5 } = globalThis.Bun;
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 = join20(buildDir, "svelte", "vendor");
13477
+ const vendorDir = join21(buildDir, "svelte", "vendor");
12699
13478
  mkdirSync9(vendorDir, { recursive: true });
12700
- const tmpDir = join20(buildDir, "_svelte_vendor_tmp");
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 = join20(tmpDir, `${safeName}.ts`);
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 bunBuild5({
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 rm8(tmpDir, { force: true, recursive: true });
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: join21 } = await import("path");
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) => join21(dir, 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
  }
@@ -12847,16 +13626,16 @@ var init_rewriteImports = __esm(() => {
12847
13626
  import {
12848
13627
  copyFileSync,
12849
13628
  cpSync,
12850
- existsSync as existsSync18,
13629
+ existsSync as existsSync19,
12851
13630
  mkdirSync as mkdirSync10,
12852
13631
  readFileSync as readFileSync11,
12853
13632
  rmSync as rmSync2,
12854
13633
  statSync,
12855
13634
  writeFileSync as writeFileSync6
12856
13635
  } from "fs";
12857
- import { basename as basename7, dirname as dirname12, extname as extname6, join as join21, relative as relative10, resolve as resolve18 } from "path";
13636
+ import { basename as basename8, dirname as dirname13, extname as extname7, join as join22, relative as relative10, resolve as resolve19 } from "path";
12858
13637
  import { cwd, env as env2, exit } from "process";
12859
- var {build: bunBuild6, Glob: Glob7 } = globalThis.Bun;
13638
+ var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
12860
13639
  var isDev, isBuildTraceEnabled = () => {
12861
13640
  const value = env2.ABSOLUTE_BUILD_TRACE?.toLowerCase();
12862
13641
  return value === "1" || value === "true" || value === "yes";
@@ -12932,8 +13711,8 @@ var isDev, isBuildTraceEnabled = () => {
12932
13711
  mkdirSync10(htmxDestDir, { recursive: true });
12933
13712
  const glob = new Glob7("htmx*.min.js");
12934
13713
  for (const relPath of glob.scanSync({ cwd: htmxDir })) {
12935
- const src = join21(htmxDir, relPath);
12936
- const dest = join21(htmxDestDir, "htmx.min.js");
13714
+ const src = join22(htmxDir, relPath);
13715
+ const dest = join22(htmxDestDir, "htmx.min.js");
12937
13716
  copyFileSync(src, dest);
12938
13717
  return;
12939
13718
  }
@@ -12945,8 +13724,8 @@ var isDev, isBuildTraceEnabled = () => {
12945
13724
  }
12946
13725
  }, resolveAbsoluteVersion = async () => {
12947
13726
  const candidates = [
12948
- resolve18(import.meta.dir, "..", "..", "package.json"),
12949
- resolve18(import.meta.dir, "..", "package.json")
13727
+ resolve19(import.meta.dir, "..", "..", "package.json"),
13728
+ resolve19(import.meta.dir, "..", "package.json")
12950
13729
  ];
12951
13730
  const resolveCandidate = async (remaining) => {
12952
13731
  const [candidate, ...rest] = remaining;
@@ -12961,34 +13740,34 @@ var isDev, isBuildTraceEnabled = () => {
12961
13740
  globalThis.__absoluteVersion = pkg.version;
12962
13741
  };
12963
13742
  await resolveCandidate(candidates);
12964
- }, SKIP_DIRS, addWorkerPathIfExists = (file3, relPath, workerPaths) => {
12965
- const absPath = resolve18(file3, "..", relPath);
13743
+ }, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
13744
+ const absPath = resolve19(file4, "..", relPath);
12966
13745
  try {
12967
13746
  statSync(absPath);
12968
13747
  workerPaths.add(absPath);
12969
13748
  } catch {}
12970
- }, collectWorkerPathsFromContent = (content, pattern, file3, workerPaths) => {
13749
+ }, collectWorkerPathsFromContent = (content, pattern, file4, workerPaths) => {
12971
13750
  pattern.lastIndex = 0;
12972
13751
  let match;
12973
13752
  while ((match = pattern.exec(content)) !== null) {
12974
13753
  const [, relPath] = match;
12975
13754
  if (!relPath)
12976
13755
  continue;
12977
- addWorkerPathIfExists(file3, relPath, workerPaths);
13756
+ addWorkerPathIfExists(file4, relPath, workerPaths);
12978
13757
  }
12979
- }, collectWorkerPathsFromFile = (file3, patterns, workerPaths) => {
12980
- const content = readFileSync11(file3, "utf-8");
13758
+ }, collectWorkerPathsFromFile = (file4, patterns, workerPaths) => {
13759
+ const content = readFileSync11(file4, "utf-8");
12981
13760
  for (const pattern of patterns) {
12982
- collectWorkerPathsFromContent(content, pattern, file3, workerPaths);
13761
+ collectWorkerPathsFromContent(content, pattern, file4, workerPaths);
12983
13762
  }
12984
13763
  }, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
12985
13764
  const glob = new Glob7("**/*.{ts,tsx,js,jsx,svelte,vue}");
12986
- for await (const file3 of glob.scan({ absolute: true, cwd: dir })) {
12987
- const relToDir = file3.slice(dir.length + 1);
13765
+ for await (const file4 of glob.scan({ absolute: true, cwd: dir })) {
13766
+ const relToDir = file4.slice(dir.length + 1);
12988
13767
  const [firstSegment] = relToDir.split("/");
12989
13768
  if (firstSegment && SKIP_DIRS.has(firstSegment))
12990
13769
  continue;
12991
- collectWorkerPathsFromFile(file3, patterns, workerPaths);
13770
+ collectWorkerPathsFromFile(file4, patterns, workerPaths);
12992
13771
  }
12993
13772
  }, scanWorkerReferences = async (dirs) => {
12994
13773
  const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
@@ -13008,7 +13787,7 @@ var isDev, isBuildTraceEnabled = () => {
13008
13787
  vuePagesPath
13009
13788
  }) => {
13010
13789
  const { readdirSync: readDir } = await import("fs");
13011
- const devIndexDir = join21(buildPath, "_src_indexes");
13790
+ const devIndexDir = join22(buildPath, "_src_indexes");
13012
13791
  mkdirSync10(devIndexDir, { recursive: true });
13013
13792
  if (reactIndexesPath && reactPagesPath) {
13014
13793
  copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
@@ -13020,41 +13799,41 @@ var isDev, isBuildTraceEnabled = () => {
13020
13799
  copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
13021
13800
  }
13022
13801
  }, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
13023
- if (!existsSync18(reactIndexesPath)) {
13802
+ if (!existsSync19(reactIndexesPath)) {
13024
13803
  return;
13025
13804
  }
13026
- const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
13027
- const pagesRel = relative10(process.cwd(), resolve18(reactPagesPath)).replace(/\\/g, "/");
13028
- for (const file3 of indexFiles) {
13029
- let content = readFileSync11(join21(reactIndexesPath, file3), "utf-8");
13805
+ const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
13806
+ const pagesRel = relative10(process.cwd(), resolve19(reactPagesPath)).replace(/\\/g, "/");
13807
+ for (const file4 of indexFiles) {
13808
+ let content = readFileSync11(join22(reactIndexesPath, file4), "utf-8");
13030
13809
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
13031
- writeFileSync6(join21(devIndexDir, file3), content);
13810
+ writeFileSync6(join22(devIndexDir, file4), content);
13032
13811
  }
13033
13812
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
13034
- const svelteIndexDir = join21(svelteDir, "generated", "indexes");
13035
- const sveltePageEntries = svelteEntries.filter((file3) => resolve18(file3).startsWith(resolve18(sveltePagesPath)));
13813
+ const svelteIndexDir = join22(svelteDir, "generated", "indexes");
13814
+ const sveltePageEntries = svelteEntries.filter((file4) => resolve19(file4).startsWith(resolve19(sveltePagesPath)));
13036
13815
  for (const entry of sveltePageEntries) {
13037
- const name = basename7(entry).replace(/\.svelte(\.(ts|js))?$/, "");
13038
- const indexFile = join21(svelteIndexDir, "pages", `${name}.js`);
13039
- if (!existsSync18(indexFile))
13816
+ const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
13817
+ const indexFile = join22(svelteIndexDir, "pages", `${name}.js`);
13818
+ if (!existsSync19(indexFile))
13040
13819
  continue;
13041
13820
  let content = readFileSync11(indexFile, "utf-8");
13042
- const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
13821
+ const srcRel = relative10(process.cwd(), resolve19(entry)).replace(/\\/g, "/");
13043
13822
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
13044
- writeFileSync6(join21(devIndexDir, `${name}.svelte.js`), content);
13823
+ writeFileSync6(join22(devIndexDir, `${name}.svelte.js`), content);
13045
13824
  }
13046
13825
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
13047
- const vueIndexDir = join21(vueDir, "generated", "indexes");
13048
- const vuePageEntries = vueEntries.filter((file3) => resolve18(file3).startsWith(resolve18(vuePagesPath)));
13826
+ const vueIndexDir = join22(vueDir, "generated", "indexes");
13827
+ const vuePageEntries = vueEntries.filter((file4) => resolve19(file4).startsWith(resolve19(vuePagesPath)));
13049
13828
  for (const entry of vuePageEntries) {
13050
- const name = basename7(entry, ".vue");
13051
- const indexFile = join21(vueIndexDir, `${name}.js`);
13052
- if (!existsSync18(indexFile))
13829
+ const name = basename8(entry, ".vue");
13830
+ const indexFile = join22(vueIndexDir, `${name}.js`);
13831
+ if (!existsSync19(indexFile))
13053
13832
  continue;
13054
13833
  let content = readFileSync11(indexFile, "utf-8");
13055
- const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
13834
+ const srcRel = relative10(process.cwd(), resolve19(entry)).replace(/\\/g, "/");
13056
13835
  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(join21(devIndexDir, `${name}.vue.js`), content);
13836
+ writeFileSync6(join22(devIndexDir, `${name}.vue.js`), content);
13058
13837
  }
13059
13838
  }, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
13060
13839
  const varIdx = content.indexOf(`var ${firstUseName} =`);
@@ -13065,7 +13844,7 @@ var isDev, isBuildTraceEnabled = () => {
13065
13844
  const last = allComments[allComments.length - 1];
13066
13845
  if (!last?.[1])
13067
13846
  return JSON.stringify(outputPath);
13068
- const srcPath = resolve18(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
13847
+ const srcPath = resolve19(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
13069
13848
  return JSON.stringify(srcPath);
13070
13849
  }, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
13071
13850
  let depth = 0;
@@ -13128,7 +13907,7 @@ ${content.slice(firstUseIdx)}`;
13128
13907
  const urlFileMap = new Map;
13129
13908
  for (const srcPath of urlReferencedFiles) {
13130
13909
  const rel = relative10(projectRoot, srcPath).replace(/\\/g, "/");
13131
- const name = basename7(srcPath);
13910
+ const name = basename8(srcPath);
13132
13911
  const mtime = Math.round(statSync(srcPath).mtimeMs);
13133
13912
  const url = `/@src/${rel}?v=${mtime}`;
13134
13913
  urlFileMap.set(name, url);
@@ -13138,11 +13917,11 @@ ${content.slice(firstUseIdx)}`;
13138
13917
  }, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
13139
13918
  const urlFileMap = new Map;
13140
13919
  for (const srcPath of urlReferencedFiles) {
13141
- const srcBase = basename7(srcPath).replace(/\.[^.]+$/, "");
13142
- const output = nonReactClientOutputs.find((artifact) => basename7(artifact.path).startsWith(`${srcBase}.`));
13920
+ const srcBase = basename8(srcPath).replace(/\.[^.]+$/, "");
13921
+ const output = nonReactClientOutputs.find((artifact) => basename8(artifact.path).startsWith(`${srcBase}.`));
13143
13922
  if (!output)
13144
13923
  continue;
13145
- urlFileMap.set(basename7(srcPath), `/${relative10(buildPath, output.path).replace(/\\/g, "/")}`);
13924
+ urlFileMap.set(basename8(srcPath), `/${relative10(buildPath, output.path).replace(/\\/g, "/")}`);
13146
13925
  }
13147
13926
  return urlFileMap;
13148
13927
  }, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
@@ -13155,7 +13934,7 @@ ${content.slice(firstUseIdx)}`;
13155
13934
  let content = readFileSync11(outputPath, "utf-8");
13156
13935
  let changed = false;
13157
13936
  content = content.replace(urlPattern, (_match, relPath) => {
13158
- const targetName = basename7(relPath);
13937
+ const targetName = basename8(relPath);
13159
13938
  const resolvedPath = urlFileMap.get(targetName);
13160
13939
  if (!resolvedPath)
13161
13940
  return _match;
@@ -13214,6 +13993,7 @@ ${content.slice(firstUseIdx)}`;
13214
13993
  htmlDirectory,
13215
13994
  htmxDirectory,
13216
13995
  angularDirectory,
13996
+ emberDirectory,
13217
13997
  svelteDirectory,
13218
13998
  vueDirectory,
13219
13999
  stylesConfig,
@@ -13275,10 +14055,10 @@ ${content.slice(firstUseIdx)}`;
13275
14055
  restoreTracePhase();
13276
14056
  return;
13277
14057
  }
13278
- const traceDir = join21(buildPath2, ".absolute-trace");
14058
+ const traceDir = join22(buildPath2, ".absolute-trace");
13279
14059
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
13280
14060
  mkdirSync10(traceDir, { recursive: true });
13281
- writeFileSync6(join21(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
14061
+ writeFileSync6(join22(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
13282
14062
  events: traceEvents,
13283
14063
  frameworks: traceFrameworkNames,
13284
14064
  generatedAt: new Date().toISOString(),
@@ -13303,26 +14083,29 @@ ${content.slice(firstUseIdx)}`;
13303
14083
  const svelteDir = svelteDirectory && validateSafePath(svelteDirectory, projectRoot);
13304
14084
  const vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot);
13305
14085
  const angularDir = angularDirectory && validateSafePath(angularDirectory, projectRoot);
14086
+ const emberDir = emberDirectory && validateSafePath(emberDirectory, projectRoot);
13306
14087
  const islandBootstrapPath = islands?.bootstrap && validateSafePath(islands.bootstrap, projectRoot);
13307
14088
  const islandRegistryPath = islands?.registry && validateSafePath(islands.registry, projectRoot);
13308
14089
  const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
13309
14090
  const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
13310
14091
  const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
13311
- const reactIndexesPath = reactDir && join21(reactDir, "generated", "indexes");
13312
- const reactPagesPath = reactDir && join21(reactDir, "pages");
13313
- const htmlPagesPath = htmlDir && join21(htmlDir, "pages");
13314
- const htmlScriptsPath = htmlDir && join21(htmlDir, "scripts");
13315
- const sveltePagesPath = svelteDir && join21(svelteDir, "pages");
13316
- const vuePagesPath = vueDir && join21(vueDir, "pages");
13317
- const htmxPagesPath = htmxDir && join21(htmxDir, "pages");
13318
- const angularPagesPath = angularDir && join21(angularDir, "pages");
14092
+ const reactIndexesPath = reactDir && join22(reactDir, "generated", "indexes");
14093
+ const reactPagesPath = reactDir && join22(reactDir, "pages");
14094
+ const htmlPagesPath = htmlDir && join22(htmlDir, "pages");
14095
+ const htmlScriptsPath = htmlDir && join22(htmlDir, "scripts");
14096
+ const sveltePagesPath = svelteDir && join22(svelteDir, "pages");
14097
+ const vuePagesPath = vueDir && join22(vueDir, "pages");
14098
+ const htmxPagesPath = htmxDir && join22(htmxDir, "pages");
14099
+ const angularPagesPath = angularDir && join22(angularDir, "pages");
14100
+ const emberPagesPath = emberDir && join22(emberDir, "pages");
13319
14101
  const frontends = [
13320
14102
  reactDir,
13321
14103
  htmlDir,
13322
14104
  htmxDir,
13323
14105
  svelteDir,
13324
14106
  vueDir,
13325
- angularDir
14107
+ angularDir,
14108
+ emberDir
13326
14109
  ].filter(Boolean);
13327
14110
  const isSingle = frontends.length === 1;
13328
14111
  const frameworkNames = [
@@ -13331,7 +14114,8 @@ ${content.slice(firstUseIdx)}`;
13331
14114
  htmxDir && "htmx",
13332
14115
  svelteDir && "svelte",
13333
14116
  vueDir && "vue",
13334
- angularDir && "angular"
14117
+ angularDir && "angular",
14118
+ emberDir && "ember"
13335
14119
  ].filter((name) => Boolean(name));
13336
14120
  traceFrameworkNames = frameworkNames;
13337
14121
  sendTelemetryEvent("build:start", {
@@ -13346,19 +14130,19 @@ ${content.slice(firstUseIdx)}`;
13346
14130
  htmlDir,
13347
14131
  vueDir,
13348
14132
  angularDir,
13349
- islandBootstrapPath && dirname12(islandBootstrapPath)
14133
+ islandBootstrapPath && dirname13(islandBootstrapPath)
13350
14134
  ].filter((dir) => Boolean(dir));
13351
14135
  const clientRoot = isSingle ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
13352
14136
  const serverDirMap = [];
13353
14137
  if (svelteDir)
13354
14138
  serverDirMap.push({
13355
14139
  dir: svelteDir,
13356
- subdir: join21("generated", "server")
14140
+ subdir: join22("generated", "server")
13357
14141
  });
13358
14142
  if (vueDir)
13359
14143
  serverDirMap.push({
13360
14144
  dir: vueDir,
13361
- subdir: join21("generated", "server")
14145
+ subdir: join22("generated", "server")
13362
14146
  });
13363
14147
  if (angularDir)
13364
14148
  serverDirMap.push({ dir: angularDir, subdir: "generated" });
@@ -13368,8 +14152,8 @@ ${content.slice(firstUseIdx)}`;
13368
14152
  const [firstEntry] = serverDirMap;
13369
14153
  if (!firstEntry)
13370
14154
  throw new Error("Expected at least one server directory entry");
13371
- serverRoot = join21(firstEntry.dir, firstEntry.subdir);
13372
- serverOutDir = join21(buildPath, basename7(firstEntry.dir));
14155
+ serverRoot = join22(firstEntry.dir, firstEntry.subdir);
14156
+ serverOutDir = join22(buildPath, basename8(firstEntry.dir));
13373
14157
  } else if (serverDirMap.length > 1) {
13374
14158
  serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
13375
14159
  serverOutDir = buildPath;
@@ -13381,13 +14165,13 @@ ${content.slice(firstUseIdx)}`;
13381
14165
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
13382
14166
  if (!isIncremental || !incrementalFiles)
13383
14167
  return entryPoints;
13384
- const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve18(f2)));
14168
+ const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve19(f2)));
13385
14169
  const matchingEntries = [];
13386
14170
  for (const entry of entryPoints) {
13387
14171
  const sourceFile = mapToSource(entry);
13388
14172
  if (!sourceFile)
13389
14173
  continue;
13390
- if (!normalizedIncremental.has(resolve18(sourceFile)))
14174
+ if (!normalizedIncremental.has(resolve19(sourceFile)))
13391
14175
  continue;
13392
14176
  matchingEntries.push(entry);
13393
14177
  }
@@ -13397,7 +14181,7 @@ ${content.slice(firstUseIdx)}`;
13397
14181
  await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
13398
14182
  }
13399
14183
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
13400
- await tracePhase("assets/copy", () => cpSync(assetsPath, join21(buildPath, "assets"), {
14184
+ await tracePhase("assets/copy", () => cpSync(assetsPath, join22(buildPath, "assets"), {
13401
14185
  force: true,
13402
14186
  recursive: true
13403
14187
  }));
@@ -13415,6 +14199,7 @@ ${content.slice(firstUseIdx)}`;
13415
14199
  svelteConventionResult,
13416
14200
  vueConventionResult,
13417
14201
  angularConventionResult,
14202
+ emberConventionResult,
13418
14203
  allGlobalCssEntries
13419
14204
  ] = await Promise.all([
13420
14205
  tailwindPromise,
@@ -13424,11 +14209,13 @@ ${content.slice(firstUseIdx)}`;
13424
14209
  sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
13425
14210
  vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
13426
14211
  angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
14212
+ emberPagesPath ? tracePhase("scan/ember-conventions", () => scanConventions(emberPagesPath, "*.{gjs,gts,ts}")) : emptyConventionResult,
13427
14213
  stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
13428
14214
  ]);
13429
14215
  const allSvelteEntries = svelteConventionResult.pageFiles;
13430
14216
  const allVueEntries = vueConventionResult.pageFiles;
13431
14217
  const allAngularEntries = angularConventionResult.pageFiles;
14218
+ const allEmberEntries = emberConventionResult.pageFiles;
13432
14219
  const conventionsMap = {};
13433
14220
  if (reactConventionResult.conventions)
13434
14221
  conventionsMap.react = reactConventionResult.conventions;
@@ -13438,15 +14225,17 @@ ${content.slice(firstUseIdx)}`;
13438
14225
  conventionsMap.vue = vueConventionResult.conventions;
13439
14226
  if (angularConventionResult.conventions)
13440
14227
  conventionsMap.angular = angularConventionResult.conventions;
13441
- const notFoundFrameworks = ["react", "svelte", "vue", "angular"].filter((framework) => conventionsMap[framework]?.defaults?.notFound);
14228
+ if (emberConventionResult.conventions)
14229
+ conventionsMap.ember = emberConventionResult.conventions;
14230
+ const notFoundFrameworks = ["react", "svelte", "vue", "angular", "ember"].filter((framework) => conventionsMap[framework]?.defaults?.notFound);
13442
14231
  if (notFoundFrameworks.length > 1) {
13443
14232
  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
14233
  }
13445
14234
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
13446
14235
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
13447
- if (entry.startsWith(resolve18(reactIndexesPath))) {
13448
- const pageName = basename7(entry, ".tsx");
13449
- return join21(reactPagesPath, `${pageName}.tsx`);
14236
+ if (entry.startsWith(resolve19(reactIndexesPath))) {
14237
+ const pageName = basename8(entry, ".tsx");
14238
+ return join22(reactPagesPath, `${pageName}.tsx`);
13450
14239
  }
13451
14240
  return null;
13452
14241
  }) : allReactEntries;
@@ -13454,6 +14243,7 @@ ${content.slice(firstUseIdx)}`;
13454
14243
  const svelteEntries = isIncremental ? filterToIncrementalEntries(allSvelteEntries, (entry) => entry) : allSvelteEntries;
13455
14244
  const vueEntries = isIncremental ? filterToIncrementalEntries(allVueEntries, (entry) => entry) : allVueEntries;
13456
14245
  const angularEntries = isIncremental ? filterToIncrementalEntries(allAngularEntries, (entry) => entry) : allAngularEntries;
14246
+ const emberEntries = isIncremental ? filterToIncrementalEntries(allEmberEntries, (entry) => entry) : allEmberEntries;
13457
14247
  const globalCssEntries = isIncremental ? filterToIncrementalEntries(allGlobalCssEntries, (entry) => entry) : allGlobalCssEntries;
13458
14248
  const hmrClientBundlePromise = hmr && (htmlDir || htmxDir) ? buildHMRClient() : undefined;
13459
14249
  const allFrameworkDirs = [
@@ -13468,6 +14258,7 @@ ${content.slice(firstUseIdx)}`;
13468
14258
  const shouldCompileSvelte = svelteDir && svelteEntries.length > 0;
13469
14259
  const shouldCompileVue = vueDir && vueEntries.length > 0;
13470
14260
  const shouldCompileAngular = angularDir && angularEntries.length > 0;
14261
+ const shouldCompileEmber = emberDir && emberEntries.length > 0;
13471
14262
  const emptyStringArray = [];
13472
14263
  const islandBuildInfo = islandRegistryPath ? await tracePhase("islands/registry", () => loadIslandRegistryBuildInfo(islandRegistryPath)) : null;
13473
14264
  const islandFrameworkSources = islandBuildInfo ? collectIslandFrameworkSources(islandBuildInfo) : {};
@@ -13481,6 +14272,7 @@ ${content.slice(firstUseIdx)}`;
13481
14272
  { svelteServerPaths, svelteIndexPaths, svelteClientPaths },
13482
14273
  { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths },
13483
14274
  { clientPaths: angularClientPaths, serverPaths: angularServerPaths },
14275
+ { clientPaths: emberClientPaths, serverPaths: emberServerPaths },
13484
14276
  { svelteClientPaths: islandSvelteClientPaths },
13485
14277
  { vueClientPaths: islandVueClientPaths },
13486
14278
  { clientPaths: islandAngularClientPaths }
@@ -13500,6 +14292,10 @@ ${content.slice(firstUseIdx)}`;
13500
14292
  clientPaths: [...emptyStringArray],
13501
14293
  serverPaths: [...emptyStringArray]
13502
14294
  },
14295
+ shouldCompileEmber ? tracePhase("compile/ember", () => Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber)).then((mod) => mod.compileEmber(emberEntries, emberDir, projectRoot, hmr))) : {
14296
+ clientPaths: [...emptyStringArray],
14297
+ serverPaths: [...emptyStringArray]
14298
+ },
13503
14299
  shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
13504
14300
  svelteClientPaths: [...emptyStringArray]
13505
14301
  },
@@ -13516,7 +14312,7 @@ ${content.slice(firstUseIdx)}`;
13516
14312
  const clientPath = islandSvelteClientPaths[idx];
13517
14313
  if (!sourcePath || !clientPath)
13518
14314
  continue;
13519
- islandSvelteClientPathMap.set(resolve18(sourcePath), clientPath);
14315
+ islandSvelteClientPathMap.set(resolve19(sourcePath), clientPath);
13520
14316
  }
13521
14317
  const islandVueClientPathMap = new Map;
13522
14318
  for (let idx = 0;idx < islandVueSources.length; idx++) {
@@ -13524,7 +14320,7 @@ ${content.slice(firstUseIdx)}`;
13524
14320
  const clientPath = islandVueClientPaths[idx];
13525
14321
  if (!sourcePath || !clientPath)
13526
14322
  continue;
13527
- islandVueClientPathMap.set(resolve18(sourcePath), clientPath);
14323
+ islandVueClientPathMap.set(resolve19(sourcePath), clientPath);
13528
14324
  }
13529
14325
  const islandAngularClientPathMap = new Map;
13530
14326
  for (let idx = 0;idx < islandAngularSources.length; idx++) {
@@ -13532,7 +14328,7 @@ ${content.slice(firstUseIdx)}`;
13532
14328
  const clientPath = islandAngularClientPaths[idx];
13533
14329
  if (!sourcePath || !clientPath)
13534
14330
  continue;
13535
- islandAngularClientPathMap.set(resolve18(sourcePath), clientPath);
14331
+ islandAngularClientPathMap.set(resolve19(sourcePath), clientPath);
13536
14332
  }
13537
14333
  const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
13538
14334
  const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
@@ -13543,7 +14339,7 @@ ${content.slice(firstUseIdx)}`;
13543
14339
  const compileReactConventions = async () => {
13544
14340
  if (reactConventionSources.length === 0)
13545
14341
  return emptyStringArray;
13546
- const destDir = join21(buildPath, "conventions", "react");
14342
+ const destDir = join22(buildPath, "conventions", "react");
13547
14343
  rmSync2(destDir, { force: true, recursive: true });
13548
14344
  mkdirSync10(destDir, { recursive: true });
13549
14345
  const destPaths = [];
@@ -13551,7 +14347,7 @@ ${content.slice(firstUseIdx)}`;
13551
14347
  const source = reactConventionSources[idx];
13552
14348
  if (!source)
13553
14349
  continue;
13554
- const result = await bunBuild6({
14350
+ const result = await bunBuild7({
13555
14351
  entrypoints: [source],
13556
14352
  format: "esm",
13557
14353
  jsx: { development: false },
@@ -13559,7 +14355,7 @@ ${content.slice(firstUseIdx)}`;
13559
14355
  naming: `${idx}-[name].[ext]`,
13560
14356
  outdir: destDir,
13561
14357
  plugins: [stylePreprocessorPlugin2],
13562
- root: dirname12(source),
14358
+ root: dirname13(source),
13563
14359
  target: "bun",
13564
14360
  throw: false,
13565
14361
  tsconfig: "./tsconfig.json"
@@ -13587,7 +14383,7 @@ ${content.slice(firstUseIdx)}`;
13587
14383
  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
14384
  ]);
13589
14385
  const bundleConventionFiles = async (framework, compiledPaths) => {
13590
- const destDir = join21(buildPath, "conventions", framework);
14386
+ const destDir = join22(buildPath, "conventions", framework);
13591
14387
  rmSync2(destDir, { force: true, recursive: true });
13592
14388
  mkdirSync10(destDir, { recursive: true });
13593
14389
  const destPaths = [];
@@ -13595,8 +14391,8 @@ ${content.slice(firstUseIdx)}`;
13595
14391
  const compiledPath = compiledPaths[idx];
13596
14392
  if (!compiledPath)
13597
14393
  continue;
13598
- const name = basename7(compiledPath).replace(/\.[^.]+$/, "");
13599
- const result = await bunBuild6({
14394
+ const name = basename8(compiledPath).replace(/\.[^.]+$/, "");
14395
+ const result = await bunBuild7({
13600
14396
  entrypoints: [compiledPath],
13601
14397
  format: "esm",
13602
14398
  minify: !isDev,
@@ -13660,7 +14456,7 @@ ${content.slice(firstUseIdx)}`;
13660
14456
  }
13661
14457
  })) : {
13662
14458
  entries: [],
13663
- generatedRoot: join21(buildPath, "_island_entries")
14459
+ generatedRoot: join22(buildPath, "_island_entries")
13664
14460
  };
13665
14461
  const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
13666
14462
  if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
@@ -13696,7 +14492,7 @@ ${content.slice(firstUseIdx)}`;
13696
14492
  return {};
13697
14493
  }
13698
14494
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
13699
- const refreshEntry = join21(reactIndexesPath, "_refresh.tsx");
14495
+ const refreshEntry = join22(reactIndexesPath, "_refresh.tsx");
13700
14496
  if (!reactClientEntryPoints.includes(refreshEntry))
13701
14497
  reactClientEntryPoints.push(refreshEntry);
13702
14498
  }
@@ -13800,19 +14596,19 @@ ${content.slice(firstUseIdx)}`;
13800
14596
  throw: false
13801
14597
  }, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
13802
14598
  if (reactDir && reactClientEntryPoints.length > 0) {
13803
- rmSync2(join21(buildPath, "react", "generated", "indexes"), {
14599
+ rmSync2(join22(buildPath, "react", "generated", "indexes"), {
13804
14600
  force: true,
13805
14601
  recursive: true
13806
14602
  });
13807
14603
  }
13808
14604
  if (angularDir && angularClientPaths.length > 0) {
13809
- rmSync2(join21(buildPath, "angular", "indexes"), {
14605
+ rmSync2(join22(buildPath, "angular", "indexes"), {
13810
14606
  force: true,
13811
14607
  recursive: true
13812
14608
  });
13813
14609
  }
13814
14610
  if (islandClientEntryPoints.length > 0) {
13815
- rmSync2(join21(buildPath, "islands"), {
14611
+ rmSync2(join22(buildPath, "islands"), {
13816
14612
  force: true,
13817
14613
  recursive: true
13818
14614
  });
@@ -13825,7 +14621,7 @@ ${content.slice(firstUseIdx)}`;
13825
14621
  globalCssResult,
13826
14622
  vueCssResult
13827
14623
  ] = await Promise.all([
13828
- serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild6(mergeBunBuildConfig({
14624
+ serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7(mergeBunBuildConfig({
13829
14625
  conditions: svelteResolveConditions,
13830
14626
  entrypoints: serverEntryPoints,
13831
14627
  external: serverBuildExternals,
@@ -13838,8 +14634,8 @@ ${content.slice(firstUseIdx)}`;
13838
14634
  throw: false,
13839
14635
  tsconfig: "./tsconfig.json"
13840
14636
  }, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
13841
- reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild6(reactBuildConfig)) : undefined,
13842
- nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild6(mergeBunBuildConfig({
14637
+ reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
14638
+ nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
13843
14639
  conditions: svelteResolveConditions,
13844
14640
  define: vueDirectory ? vueFeatureFlags : undefined,
13845
14641
  entrypoints: nonReactClientEntryPoints,
@@ -13859,7 +14655,7 @@ ${content.slice(firstUseIdx)}`;
13859
14655
  throw: false,
13860
14656
  tsconfig: "./tsconfig.json"
13861
14657
  }, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
13862
- islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild6(mergeBunBuildConfig({
14658
+ islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
13863
14659
  conditions: svelteResolveConditions,
13864
14660
  define: vueDirectory ? vueFeatureFlags : undefined,
13865
14661
  entrypoints: islandClientEntryPoints,
@@ -13878,19 +14674,19 @@ ${content.slice(firstUseIdx)}`;
13878
14674
  throw: false,
13879
14675
  tsconfig: "./tsconfig.json"
13880
14676
  }, resolveBunBuildOverride(bunBuildConfig, "islandClient")))) : undefined,
13881
- globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild6(mergeBunBuildConfig({
14677
+ globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
13882
14678
  entrypoints: globalCssEntries,
13883
14679
  naming: `[dir]/[name].[hash].[ext]`,
13884
- outdir: stylesDir ? join21(buildPath, basename7(stylesDir)) : buildPath,
14680
+ outdir: stylesDir ? join22(buildPath, basename8(stylesDir)) : buildPath,
13885
14681
  plugins: [stylePreprocessorPlugin2],
13886
14682
  root: stylesDir || clientRoot,
13887
14683
  target: "browser",
13888
14684
  throw: false
13889
14685
  }, resolveBunBuildOverride(bunBuildConfig, "globalCss")))) : undefined,
13890
- vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild6(mergeBunBuildConfig({
14686
+ vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
13891
14687
  entrypoints: vueCssPaths,
13892
14688
  naming: `[name].[hash].[ext]`,
13893
- outdir: join21(buildPath, assetsPath ? basename7(assetsPath) : "assets", "css"),
14689
+ outdir: join22(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
13894
14690
  target: "browser",
13895
14691
  throw: false
13896
14692
  }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
@@ -13958,7 +14754,7 @@ ${content.slice(firstUseIdx)}`;
13958
14754
  const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
13959
14755
  const jsArtifacts = serverOutputs.filter((artifact) => artifact.path.endsWith(".js"));
13960
14756
  await tracePhase("postprocess/server-angular-vendor-imports", () => Promise.all(jsArtifacts.map(async (artifact) => {
13961
- const fileDir = dirname12(artifact.path);
14757
+ const fileDir = dirname13(artifact.path);
13962
14758
  const relativePaths = {};
13963
14759
  for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
13964
14760
  const rel = relative10(fileDir, absolute);
@@ -14012,14 +14808,18 @@ ${content.slice(firstUseIdx)}`;
14012
14808
  ], buildPath)
14013
14809
  };
14014
14810
  for (const artifact of serverOutputs) {
14015
- if (extname6(artifact.path) !== ".js")
14811
+ if (extname7(artifact.path) !== ".js")
14016
14812
  continue;
14017
- const fileWithHash = basename7(artifact.path);
14813
+ const fileWithHash = basename8(artifact.path);
14018
14814
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
14019
14815
  if (!baseName)
14020
14816
  continue;
14021
14817
  manifest[toPascal(baseName)] = artifact.path;
14022
14818
  }
14819
+ for (const serverPath of emberServerPaths) {
14820
+ const fileBase = basename8(serverPath, ".js");
14821
+ manifest[toPascal(fileBase)] = serverPath;
14822
+ }
14023
14823
  const shouldCopyHtmx = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/htmx/") && f2.endsWith(".html"));
14024
14824
  const shouldUpdateHtmlAssetPaths = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
14025
14825
  const shouldUpdateHtmxAssetPaths = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/htmx/") && (f2.endsWith(".html") || isStylePath(f2)));
@@ -14038,7 +14838,7 @@ ${content.slice(firstUseIdx)}`;
14038
14838
  const processHtmlPages = async () => {
14039
14839
  if (!(htmlDir && htmlPagesPath))
14040
14840
  return;
14041
- const outputHtmlPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename7(htmlDir), "pages");
14841
+ const outputHtmlPages = isSingle ? join22(buildPath, "pages") : join22(buildPath, basename8(htmlDir), "pages");
14042
14842
  mkdirSync10(outputHtmlPages, { recursive: true });
14043
14843
  cpSync(htmlPagesPath, outputHtmlPages, {
14044
14844
  force: true,
@@ -14053,21 +14853,21 @@ ${content.slice(firstUseIdx)}`;
14053
14853
  for (const htmlFile of htmlPageFiles) {
14054
14854
  if (hmr)
14055
14855
  injectHMRIntoHTMLFile(htmlFile, "html");
14056
- const fileName = basename7(htmlFile, ".html");
14856
+ const fileName = basename8(htmlFile, ".html");
14057
14857
  manifest[fileName] = htmlFile;
14058
14858
  }
14059
14859
  };
14060
14860
  const processHtmxPages = async () => {
14061
14861
  if (!(htmxDir && htmxPagesPath))
14062
14862
  return;
14063
- const outputHtmxPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename7(htmxDir), "pages");
14863
+ const outputHtmxPages = isSingle ? join22(buildPath, "pages") : join22(buildPath, basename8(htmxDir), "pages");
14064
14864
  mkdirSync10(outputHtmxPages, { recursive: true });
14065
14865
  cpSync(htmxPagesPath, outputHtmxPages, {
14066
14866
  force: true,
14067
14867
  recursive: true
14068
14868
  });
14069
14869
  if (shouldCopyHtmx) {
14070
- const htmxDestDir = isSingle ? buildPath : join21(buildPath, basename7(htmxDir));
14870
+ const htmxDestDir = isSingle ? buildPath : join22(buildPath, basename8(htmxDir));
14071
14871
  copyHtmxVendor(htmxDir, htmxDestDir);
14072
14872
  }
14073
14873
  if (shouldUpdateHtmxAssetPaths) {
@@ -14079,7 +14879,7 @@ ${content.slice(firstUseIdx)}`;
14079
14879
  for (const htmxFile of htmxPageFiles) {
14080
14880
  if (hmr)
14081
14881
  injectHMRIntoHTMLFile(htmxFile, "htmx");
14082
- const fileName = basename7(htmxFile, ".html");
14882
+ const fileName = basename8(htmxFile, ".html");
14083
14883
  manifest[fileName] = htmxFile;
14084
14884
  }
14085
14885
  };
@@ -14128,9 +14928,9 @@ ${content.slice(firstUseIdx)}`;
14128
14928
  writeBuildTrace(buildPath);
14129
14929
  return { conventions: conventionsMap, manifest };
14130
14930
  }
14131
- writeFileSync6(join21(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
14931
+ writeFileSync6(join22(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
14132
14932
  if (Object.keys(conventionsMap).length > 0) {
14133
- writeFileSync6(join21(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
14933
+ writeFileSync6(join22(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
14134
14934
  }
14135
14935
  writeBuildTrace(buildPath);
14136
14936
  if (tailwind && mode === "production") {
@@ -14226,10 +15026,156 @@ var init_build = __esm(() => {
14226
15026
  };
14227
15027
  });
14228
15028
 
15029
+ // src/build/buildEmberVendor.ts
15030
+ import { mkdirSync as mkdirSync11, existsSync as existsSync20 } from "fs";
15031
+ import { join as join23 } from "path";
15032
+ import { rm as rm10 } from "fs/promises";
15033
+ var {build: bunBuild8 } = globalThis.Bun;
15034
+ var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
15035
+ // implementations for macros that would normally be replaced at
15036
+ // compile time by Embroider's babel plugin. AbsoluteJS doesn't run
15037
+ // babel, so working defaults are shipped instead.
15038
+ const isProd = () => {
15039
+ try {
15040
+ return globalThis.process?.env?.NODE_ENV === 'production';
15041
+ } catch {
15042
+ return false;
15043
+ }
15044
+ };
15045
+
15046
+ export const each = (arr) => {
15047
+ if (!Array.isArray(arr)) {
15048
+ throw new Error('the argument to each() must be an array');
15049
+ }
15050
+ return arr;
15051
+ };
15052
+ export const macroCondition = (predicate) => predicate;
15053
+ export const isDevelopingApp = () => !isProd();
15054
+ export const isTesting = () => false;
15055
+ export const setTesting = () => {};
15056
+ export const dependencySatisfies = () => false;
15057
+ export const appEmberSatisfies = () => false;
15058
+ export const getConfig = () => undefined;
15059
+ export const getOwnConfig = () => undefined;
15060
+ export const getGlobalConfig = () => ({});
15061
+ export const config = () => undefined;
15062
+ export const failBuild = (msg) => { throw new Error('failBuild: ' + msg); };
15063
+ export const moduleExists = () => false;
15064
+ export const importSync = (specifier) => {
15065
+ throw new Error('importSync(' + specifier + '): not supported by the AbsoluteJS Ember adapter \u2014 use dynamic import() instead');
15066
+ };
15067
+ `, resolveEmberSpecifier = (specifier, cwd2) => {
15068
+ if (specifier === "@embroider/macros") {
15069
+ return {
15070
+ inlineSource: generateMacrosShim(),
15071
+ resolveTo: "",
15072
+ specifier
15073
+ };
15074
+ }
15075
+ const standaloneSpecifiers = new Set([
15076
+ "@glimmer/component",
15077
+ "@glimmer/tracking",
15078
+ "@simple-dom/serializer"
15079
+ ]);
15080
+ if (standaloneSpecifiers.has(specifier)) {
15081
+ return { resolveTo: specifier, specifier };
15082
+ }
15083
+ const emberInternalPath = join23(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
15084
+ if (!existsSync20(emberInternalPath)) {
15085
+ throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
15086
+ }
15087
+ return { resolveTo: emberInternalPath, specifier };
15088
+ }, REQUIRED_EMBER_SPECIFIERS, SPECIFIERS_WITH_DEFAULT_EXPORT, generateVendorEntrySource2 = (resolution) => {
15089
+ if (resolution.inlineSource !== undefined) {
15090
+ return resolution.inlineSource;
15091
+ }
15092
+ const target = JSON.stringify(resolution.resolveTo);
15093
+ const lines = [`export * from ${target};`];
15094
+ if (SPECIFIERS_WITH_DEFAULT_EXPORT.has(resolution.specifier)) {
15095
+ lines.push(`import __default__ from ${target};`);
15096
+ lines.push(`export default __default__;`);
15097
+ }
15098
+ return lines.join(`
15099
+ `) + `
15100
+ `;
15101
+ }, createEmberResolverPlugin = (cwd2, macrosShimPath) => ({
15102
+ name: "absolutejs-ember-resolver",
15103
+ setup(build2) {
15104
+ const standalonePackages = new Set([
15105
+ "@glimmer/component",
15106
+ "@glimmer/tracking",
15107
+ "@glimmer/env",
15108
+ "@simple-dom/serializer"
15109
+ ]);
15110
+ build2.onResolve({ filter: /^@embroider\/macros$/ }, () => ({ path: macrosShimPath }));
15111
+ build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
15112
+ if (standalonePackages.has(args.path)) {
15113
+ return;
15114
+ }
15115
+ const internal = join23(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
15116
+ if (existsSync20(internal)) {
15117
+ return { path: internal };
15118
+ }
15119
+ return;
15120
+ });
15121
+ }
15122
+ }), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
15123
+ const vendorDir = join23(buildDir, "ember", "vendor");
15124
+ mkdirSync11(vendorDir, { recursive: true });
15125
+ const tmpDir = join23(buildDir, "_ember_vendor_tmp");
15126
+ mkdirSync11(tmpDir, { recursive: true });
15127
+ const macrosShimPath = join23(tmpDir, "embroider_macros_shim.js");
15128
+ await Bun.write(macrosShimPath, generateMacrosShim());
15129
+ const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
15130
+ const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
15131
+ const safeName = toSafeFileName5(resolution.specifier);
15132
+ const entryPath = join23(tmpDir, `${safeName}.js`);
15133
+ const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
15134
+ ` : generateVendorEntrySource2(resolution);
15135
+ await Bun.write(entryPath, source);
15136
+ return entryPath;
15137
+ }));
15138
+ const result = await bunBuild8({
15139
+ entrypoints,
15140
+ format: "esm",
15141
+ minify: false,
15142
+ naming: "[name].[ext]",
15143
+ outdir: vendorDir,
15144
+ plugins: [createEmberResolverPlugin(cwd2, macrosShimPath)],
15145
+ splitting: true,
15146
+ target: "browser",
15147
+ throw: false
15148
+ });
15149
+ await rm10(tmpDir, { force: true, recursive: true });
15150
+ if (!result.success) {
15151
+ console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
15152
+ }
15153
+ return REQUIRED_EMBER_SPECIFIERS;
15154
+ }, computeEmberVendorPaths = () => {
15155
+ const paths = {};
15156
+ for (const specifier of REQUIRED_EMBER_SPECIFIERS) {
15157
+ paths[specifier] = `/ember/vendor/${toSafeFileName5(specifier)}.js`;
15158
+ }
15159
+ return paths;
15160
+ };
15161
+ var init_buildEmberVendor = __esm(() => {
15162
+ REQUIRED_EMBER_SPECIFIERS = [
15163
+ "@ember/template-compiler",
15164
+ "@ember/renderer",
15165
+ "@glimmer/component",
15166
+ "@glimmer/tracking",
15167
+ "@embroider/macros"
15168
+ ];
15169
+ SPECIFIERS_WITH_DEFAULT_EXPORT = new Set([
15170
+ "@glimmer/component",
15171
+ "@simple-dom/serializer"
15172
+ ]);
15173
+ });
15174
+
14229
15175
  // src/dev/dependencyGraph.ts
14230
- import { existsSync as existsSync19, readFileSync as readFileSync12 } from "fs";
15176
+ import { existsSync as existsSync21, readFileSync as readFileSync12 } from "fs";
14231
15177
  var {Glob: Glob8 } = globalThis.Bun;
14232
- import { resolve as resolve19 } from "path";
15178
+ import { resolve as resolve20 } from "path";
14233
15179
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
14234
15180
  const lower = filePath.toLowerCase();
14235
15181
  if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
@@ -14243,8 +15189,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14243
15189
  if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
14244
15190
  return null;
14245
15191
  }
14246
- const fromDir = resolve19(fromFile, "..");
14247
- const normalized = resolve19(fromDir, importPath);
15192
+ const fromDir = resolve20(fromFile, "..");
15193
+ const normalized = resolve20(fromDir, importPath);
14248
15194
  const extensions = [
14249
15195
  ".ts",
14250
15196
  ".tsx",
@@ -14257,10 +15203,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14257
15203
  ];
14258
15204
  for (const ext of extensions) {
14259
15205
  const withExt = normalized + ext;
14260
- if (existsSync19(withExt))
15206
+ if (existsSync21(withExt))
14261
15207
  return withExt;
14262
15208
  }
14263
- if (existsSync19(normalized))
15209
+ if (existsSync21(normalized))
14264
15210
  return normalized;
14265
15211
  return null;
14266
15212
  }, clearExistingDependents = (graph, normalizedPath) => {
@@ -14274,8 +15220,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14274
15220
  dependents.delete(normalizedPath);
14275
15221
  }
14276
15222
  }, addFileToGraph = (graph, filePath) => {
14277
- const normalizedPath = resolve19(filePath);
14278
- if (!existsSync19(normalizedPath))
15223
+ const normalizedPath = resolve20(filePath);
15224
+ if (!existsSync21(normalizedPath))
14279
15225
  return;
14280
15226
  const dependencies = extractDependencies(normalizedPath);
14281
15227
  clearExistingDependents(graph, normalizedPath);
@@ -14291,10 +15237,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14291
15237
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
14292
15238
  const processedFiles = new Set;
14293
15239
  const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
14294
- const resolvedDirs = directories.map((dir) => resolve19(dir)).filter((dir) => existsSync19(dir));
15240
+ const resolvedDirs = directories.map((dir) => resolve20(dir)).filter((dir) => existsSync21(dir));
14295
15241
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
14296
- for (const file3 of allFiles) {
14297
- const fullPath = resolve19(file3);
15242
+ for (const file4 of allFiles) {
15243
+ const fullPath = resolve20(file4);
14298
15244
  if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
14299
15245
  continue;
14300
15246
  if (processedFiles.has(fullPath))
@@ -14349,8 +15295,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14349
15295
  resolveRegexMatches(styleUrlSingularRegex, content, filePath, dependencies);
14350
15296
  extractStyleUrlsDependencies(content, filePath, dependencies);
14351
15297
  }, extractJsDependencies = (filePath, content, loader) => {
14352
- const transpiler4 = loader === "tsx" ? tsTranspiler : jsTranspiler;
14353
- const imports = transpiler4.scanImports(content);
15298
+ const transpiler5 = loader === "tsx" ? tsTranspiler : jsTranspiler;
15299
+ const imports = transpiler5.scanImports(content);
14354
15300
  const dependencies = [];
14355
15301
  for (const imp of imports) {
14356
15302
  const resolved = resolveImportPath2(imp.path, filePath);
@@ -14407,7 +15353,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14407
15353
  return [];
14408
15354
  }
14409
15355
  }, getAffectedFiles = (graph, changedFile) => {
14410
- const normalizedPath = resolve19(changedFile);
15356
+ const normalizedPath = resolve20(changedFile);
14411
15357
  const affected = new Set;
14412
15358
  const toProcess = [normalizedPath];
14413
15359
  const processNode = (current) => {
@@ -14447,7 +15393,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
14447
15393
  }
14448
15394
  graph.dependents.delete(normalizedPath);
14449
15395
  }, removeFileFromGraph = (graph, filePath) => {
14450
- const normalizedPath = resolve19(filePath);
15396
+ const normalizedPath = resolve20(filePath);
14451
15397
  removeDepsForFile(graph, normalizedPath);
14452
15398
  removeDependentsForFile(graph, normalizedPath);
14453
15399
  };
@@ -14490,16 +15436,17 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
14490
15436
  };
14491
15437
 
14492
15438
  // src/dev/configResolver.ts
14493
- import { resolve as resolve20 } from "path";
15439
+ import { resolve as resolve21 } from "path";
14494
15440
  var resolveBuildPaths = (config) => {
14495
15441
  const cwd2 = process.cwd();
14496
15442
  const normalize = (path) => path.replace(/\\/g, "/");
14497
- const withDefault = (value, fallback) => normalize(resolve20(cwd2, value ?? fallback));
14498
- const optional = (value) => value ? normalize(resolve20(cwd2, value)) : undefined;
15443
+ const withDefault = (value, fallback) => normalize(resolve21(cwd2, value ?? fallback));
15444
+ const optional = (value) => value ? normalize(resolve21(cwd2, value)) : undefined;
14499
15445
  return {
14500
15446
  angularDir: optional(config.angularDirectory),
14501
15447
  assetsDir: optional(config.assetsDirectory),
14502
15448
  buildDir: withDefault(config.buildDirectory, "build"),
15449
+ emberDir: optional(config.emberDirectory),
14503
15450
  htmlDir: optional(config.htmlDirectory),
14504
15451
  htmxDir: optional(config.htmxDirectory),
14505
15452
  reactDir: optional(config.reactDirectory),
@@ -14566,6 +15513,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
14566
15513
  return "vue";
14567
15514
  if (startsWithDir(resolved.angularDir))
14568
15515
  return "angular";
15516
+ if (startsWithDir(resolved.emberDir))
15517
+ return "ember";
14569
15518
  if (startsWithDir(resolved.htmlDir))
14570
15519
  return "html";
14571
15520
  if (startsWithDir(resolved.assetsDir))
@@ -14581,6 +15530,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
14581
15530
  return "vue";
14582
15531
  if (normalized.includes("/angular/"))
14583
15532
  return "angular";
15533
+ if (normalized.includes("/ember/"))
15534
+ return "ember";
14584
15535
  if (normalized.includes("/html/"))
14585
15536
  return "html";
14586
15537
  }
@@ -14590,10 +15541,14 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
14590
15541
  return "svelte";
14591
15542
  if (normalized.endsWith(".vue"))
14592
15543
  return "vue";
15544
+ if (normalized.endsWith(".gjs") || normalized.endsWith(".gts"))
15545
+ return "ember";
14593
15546
  if (normalized.endsWith(".html"))
14594
15547
  return "html";
14595
15548
  if (normalized.endsWith(".ts") && normalized.includes("angular"))
14596
15549
  return "angular";
15550
+ if (normalized.endsWith(".ts") && normalized.includes("ember"))
15551
+ return "ember";
14597
15552
  if (normalized.includes("/assets/"))
14598
15553
  return "assets";
14599
15554
  if (STYLE_EXTENSION_PATTERN2.test(normalized)) {
@@ -14638,6 +15593,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
14638
15593
  const cfg = resolved ?? {
14639
15594
  angularDir: config.angularDirectory,
14640
15595
  assetsDir: config.assetsDirectory,
15596
+ emberDir: config.emberDirectory,
14641
15597
  htmlDir: config.htmlDirectory,
14642
15598
  htmxDir: config.htmxDirectory,
14643
15599
  reactDir: config.reactDirectory,
@@ -14648,6 +15604,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
14648
15604
  push(cfg.reactDir);
14649
15605
  push(cfg.svelteDir);
14650
15606
  push(cfg.vueDir);
15607
+ push(cfg.emberDir);
14651
15608
  push(cfg.angularDir);
14652
15609
  push(cfg.htmlDir, "pages");
14653
15610
  push(cfg.htmlDir, "scripts");
@@ -14662,6 +15619,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
14662
15619
  cfg.svelteDir,
14663
15620
  cfg.vueDir,
14664
15621
  cfg.angularDir,
15622
+ cfg.emberDir,
14665
15623
  cfg.htmlDir,
14666
15624
  cfg.htmxDir
14667
15625
  ].filter((dir) => Boolean(dir)).map(normalizePath);
@@ -14684,8 +15642,8 @@ var init_pathUtils = __esm(() => {
14684
15642
 
14685
15643
  // src/dev/fileWatcher.ts
14686
15644
  import { watch } from "fs";
14687
- import { existsSync as existsSync20 } from "fs";
14688
- import { join as join22, resolve as resolve21 } from "path";
15645
+ import { existsSync as existsSync22 } from "fs";
15646
+ import { join as join24, resolve as resolve22 } from "path";
14689
15647
  var safeRemoveFromGraph = (graph, fullPath) => {
14690
15648
  try {
14691
15649
  removeFileFromGraph(graph, fullPath);
@@ -14712,16 +15670,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
14712
15670
  if (shouldSkipFilename(filename, isStylesDir)) {
14713
15671
  return;
14714
15672
  }
14715
- const fullPath = join22(absolutePath, filename).replace(/\\/g, "/");
15673
+ const fullPath = join24(absolutePath, filename).replace(/\\/g, "/");
14716
15674
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
14717
15675
  return;
14718
15676
  }
14719
- if (event === "rename" && !existsSync20(fullPath)) {
15677
+ if (event === "rename" && !existsSync22(fullPath)) {
14720
15678
  safeRemoveFromGraph(state.dependencyGraph, fullPath);
14721
15679
  onFileChange(fullPath);
14722
15680
  return;
14723
15681
  }
14724
- if (existsSync20(fullPath)) {
15682
+ if (existsSync22(fullPath)) {
14725
15683
  onFileChange(fullPath);
14726
15684
  safeAddToGraph(state.dependencyGraph, fullPath);
14727
15685
  }
@@ -14730,8 +15688,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
14730
15688
  }, addFileWatchers = (state, paths, onFileChange) => {
14731
15689
  const stylesDir = state.resolvedPaths?.stylesDir;
14732
15690
  paths.forEach((path) => {
14733
- const absolutePath = resolve21(path).replace(/\\/g, "/");
14734
- if (!existsSync20(absolutePath)) {
15691
+ const absolutePath = resolve22(path).replace(/\\/g, "/");
15692
+ if (!existsSync22(absolutePath)) {
14735
15693
  return;
14736
15694
  }
14737
15695
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -14741,8 +15699,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
14741
15699
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
14742
15700
  const stylesDir = state.resolvedPaths?.stylesDir;
14743
15701
  watchPaths.forEach((path) => {
14744
- const absolutePath = resolve21(path).replace(/\\/g, "/");
14745
- if (!existsSync20(absolutePath)) {
15702
+ const absolutePath = resolve22(path).replace(/\\/g, "/");
15703
+ if (!existsSync22(absolutePath)) {
14746
15704
  return;
14747
15705
  }
14748
15706
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -14756,13 +15714,13 @@ var init_fileWatcher = __esm(() => {
14756
15714
  });
14757
15715
 
14758
15716
  // src/dev/assetStore.ts
14759
- import { resolve as resolve22 } from "path";
15717
+ import { resolve as resolve23 } from "path";
14760
15718
  import { readdir as readdir3, unlink } from "fs/promises";
14761
15719
  var mimeTypes, getMimeType = (filePath) => {
14762
15720
  const ext = filePath.slice(filePath.lastIndexOf("."));
14763
15721
  return mimeTypes[ext] ?? "application/octet-stream";
14764
15722
  }, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
14765
- const fullPath = resolve22(dir, entry.name);
15723
+ const fullPath = resolve23(dir, entry.name);
14766
15724
  if (entry.isDirectory()) {
14767
15725
  return walkAndClean(fullPath);
14768
15726
  }
@@ -14778,10 +15736,10 @@ var mimeTypes, getMimeType = (filePath) => {
14778
15736
  }, cleanStaleAssets = async (store, manifest, buildDir) => {
14779
15737
  const liveByIdentity = new Map;
14780
15738
  for (const webPath of store.keys()) {
14781
- const diskPath = resolve22(buildDir, webPath.slice(1));
15739
+ const diskPath = resolve23(buildDir, webPath.slice(1));
14782
15740
  liveByIdentity.set(stripHash(diskPath), diskPath);
14783
15741
  }
14784
- const absBuildDir = resolve22(buildDir);
15742
+ const absBuildDir = resolve23(buildDir);
14785
15743
  Object.values(manifest).forEach((val) => {
14786
15744
  if (!HASHED_FILE_RE.test(val))
14787
15745
  return;
@@ -14799,7 +15757,7 @@ var mimeTypes, getMimeType = (filePath) => {
14799
15757
  } catch {}
14800
15758
  }, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
14801
15759
  if (entry.isDirectory()) {
14802
- return scanDir(resolve22(dir, entry.name), `${prefix}${entry.name}/`);
15760
+ return scanDir(resolve23(dir, entry.name), `${prefix}${entry.name}/`);
14803
15761
  }
14804
15762
  if (!entry.name.startsWith("chunk-")) {
14805
15763
  return null;
@@ -14808,7 +15766,7 @@ var mimeTypes, getMimeType = (filePath) => {
14808
15766
  if (store.has(webPath)) {
14809
15767
  return null;
14810
15768
  }
14811
- return Bun.file(resolve22(dir, entry.name)).bytes().then((bytes) => {
15769
+ return Bun.file(resolve23(dir, entry.name)).bytes().then((bytes) => {
14812
15770
  store.set(webPath, bytes);
14813
15771
  return;
14814
15772
  }).catch(() => {});
@@ -14830,7 +15788,7 @@ var mimeTypes, getMimeType = (filePath) => {
14830
15788
  for (const webPath of newIdentities.values()) {
14831
15789
  if (store.has(webPath))
14832
15790
  continue;
14833
- loadPromises.push(Bun.file(resolve22(buildDir, webPath.slice(1))).bytes().then((bytes) => {
15791
+ loadPromises.push(Bun.file(resolve23(buildDir, webPath.slice(1))).bytes().then((bytes) => {
14834
15792
  store.set(webPath, bytes);
14835
15793
  return;
14836
15794
  }).catch(() => {}));
@@ -14861,9 +15819,10 @@ var init_assetStore = __esm(() => {
14861
15819
 
14862
15820
  // src/islands/pageMetadata.ts
14863
15821
  import { readFileSync as readFileSync13 } from "fs";
14864
- import { dirname as dirname13, resolve as resolve23 } from "path";
15822
+ import { dirname as dirname14, resolve as resolve24 } from "path";
14865
15823
  var pagePatterns, getPageDirs = (config) => [
14866
15824
  { dir: config.angularDirectory, framework: "angular" },
15825
+ { dir: config.emberDirectory, framework: "ember" },
14867
15826
  { dir: config.reactDirectory, framework: "react" },
14868
15827
  { dir: config.svelteDirectory, framework: "svelte" },
14869
15828
  { dir: config.vueDirectory, framework: "vue" },
@@ -14880,15 +15839,15 @@ var pagePatterns, getPageDirs = (config) => [
14880
15839
  const source = definition.buildReference?.source;
14881
15840
  if (!source)
14882
15841
  continue;
14883
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve23(dirname13(buildInfo.resolvedRegistryPath), source);
14884
- lookup.set(`${definition.framework}:${definition.component}`, resolve23(resolvedSource));
15842
+ const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve24(dirname14(buildInfo.resolvedRegistryPath), source);
15843
+ lookup.set(`${definition.framework}:${definition.component}`, resolve24(resolvedSource));
14885
15844
  }
14886
15845
  return lookup;
14887
15846
  }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
14888
15847
  const candidate = usage.source;
14889
- return candidate ? resolve23(candidate) === target : false;
15848
+ return candidate ? resolve24(candidate) === target : false;
14890
15849
  }), getPagesUsingIslandSource = (sourcePath) => {
14891
- const target = resolve23(sourcePath);
15850
+ const target = resolve24(sourcePath);
14892
15851
  return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
14893
15852
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
14894
15853
  const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
@@ -14900,13 +15859,13 @@ var pagePatterns, getPageDirs = (config) => [
14900
15859
  const pattern = pagePatterns[entry.framework];
14901
15860
  if (!pattern)
14902
15861
  return;
14903
- const files = await scanEntryPoints(resolve23(entry.dir), pattern);
15862
+ const files = await scanEntryPoints(resolve24(entry.dir), pattern);
14904
15863
  for (const filePath of files) {
14905
15864
  const source = readFileSync13(filePath, "utf-8");
14906
15865
  const islands = extractIslandUsagesFromSource(source);
14907
- pageMetadata.set(resolve23(filePath), {
15866
+ pageMetadata.set(resolve24(filePath), {
14908
15867
  islands: resolveIslandUsages(islands, islandSourceLookup),
14909
- pagePath: resolve23(filePath)
15868
+ pagePath: resolve24(filePath)
14910
15869
  });
14911
15870
  }
14912
15871
  }, loadPageIslandMetadata = async (config) => {
@@ -14923,6 +15882,7 @@ var init_pageMetadata = __esm(() => {
14923
15882
  init_sourceMetadata();
14924
15883
  pagePatterns = {
14925
15884
  angular: "pages/**/*.{ts,js}",
15885
+ ember: "pages/**/*.{gjs,gts,ts,js}",
14926
15886
  html: "pages/**/*.html",
14927
15887
  htmx: "pages/**/*.html",
14928
15888
  react: "pages/**/*.{ts,tsx,js,jsx}",
@@ -15015,9 +15975,9 @@ var init_transformCache = __esm(() => {
15015
15975
  });
15016
15976
 
15017
15977
  // src/dev/reactComponentClassifier.ts
15018
- import { resolve as resolve24 } from "path";
15978
+ import { resolve as resolve25 } from "path";
15019
15979
  var classifyComponent = (filePath) => {
15020
- const normalizedPath = resolve24(filePath);
15980
+ const normalizedPath = resolve25(filePath);
15021
15981
  if (normalizedPath.includes("/react/pages/")) {
15022
15982
  return "server";
15023
15983
  }
@@ -15029,7 +15989,7 @@ var classifyComponent = (filePath) => {
15029
15989
  var init_reactComponentClassifier = () => {};
15030
15990
 
15031
15991
  // src/dev/moduleMapper.ts
15032
- import { basename as basename8, resolve as resolve25 } from "path";
15992
+ import { basename as basename9, resolve as resolve26 } from "path";
15033
15993
  var buildModulePaths = (moduleKeys, manifest) => {
15034
15994
  const modulePaths = {};
15035
15995
  moduleKeys.forEach((key) => {
@@ -15039,7 +15999,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
15039
15999
  });
15040
16000
  return modulePaths;
15041
16001
  }, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
15042
- const normalizedFile = resolve25(sourceFile);
16002
+ const normalizedFile = resolve26(sourceFile);
15043
16003
  const normalizedPath = normalizedFile.replace(/\\/g, "/");
15044
16004
  if (processedFiles.has(normalizedFile)) {
15045
16005
  return null;
@@ -15075,8 +16035,8 @@ var buildModulePaths = (moduleKeys, manifest) => {
15075
16035
  });
15076
16036
  return grouped;
15077
16037
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
15078
- const normalizedFile = resolve25(sourceFile);
15079
- const fileName = basename8(normalizedFile);
16038
+ const normalizedFile = resolve26(sourceFile);
16039
+ const fileName = basename9(normalizedFile);
15080
16040
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
15081
16041
  const pascalName = toPascal(baseName);
15082
16042
  const keys = [];
@@ -15268,8 +16228,8 @@ __export(exports_moduleServer, {
15268
16228
  createModuleServer: () => createModuleServer,
15269
16229
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
15270
16230
  });
15271
- import { existsSync as existsSync21, readFileSync as readFileSync15, statSync as statSync2 } from "fs";
15272
- import { basename as basename9, dirname as dirname14, extname as extname7, join as join23, resolve as resolve26, relative as relative11 } from "path";
16231
+ import { existsSync as existsSync23, readFileSync as readFileSync15, statSync as statSync2 } from "fs";
16232
+ import { basename as basename10, dirname as dirname15, extname as extname8, join as join25, resolve as resolve27, relative as relative11 } from "path";
15273
16233
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
15274
16234
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
15275
16235
  const allExports = [];
@@ -15289,7 +16249,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
15289
16249
  ${stubs}
15290
16250
  `;
15291
16251
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
15292
- const found = extensions.find((ext) => existsSync21(resolve26(projectRoot, srcPath + ext)));
16252
+ const found = extensions.find((ext) => existsSync23(resolve27(projectRoot, srcPath + ext)));
15293
16253
  return found ? srcPath + found : srcPath;
15294
16254
  }, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
15295
16255
  const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
@@ -15304,7 +16264,7 @@ ${stubs}
15304
16264
  return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
15305
16265
  }, srcUrl = (relPath, projectRoot) => {
15306
16266
  const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
15307
- const absPath = resolve26(projectRoot, relPath);
16267
+ const absPath = resolve27(projectRoot, relPath);
15308
16268
  const cached = mtimeCache.get(absPath);
15309
16269
  if (cached !== undefined)
15310
16270
  return `${base}?v=${buildVersion(cached, absPath)}`;
@@ -15316,12 +16276,12 @@ ${stubs}
15316
16276
  return base;
15317
16277
  }
15318
16278
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
15319
- const absPath = resolve26(fileDir, relPath);
16279
+ const absPath = resolve27(fileDir, relPath);
15320
16280
  const rel = relative11(projectRoot, absPath);
15321
- const extension = extname7(rel);
16281
+ const extension = extname8(rel);
15322
16282
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
15323
- if (extname7(srcPath) === ".svelte") {
15324
- srcPath = relative11(projectRoot, resolveSvelteModulePath(resolve26(projectRoot, srcPath)));
16283
+ if (extname8(srcPath) === ".svelte") {
16284
+ srcPath = relative11(projectRoot, resolveSvelteModulePath(resolve27(projectRoot, srcPath)));
15325
16285
  }
15326
16286
  return srcUrl(srcPath, projectRoot);
15327
16287
  }, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
@@ -15338,14 +16298,14 @@ ${stubs}
15338
16298
  const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
15339
16299
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
15340
16300
  if (!subpath) {
15341
- const pkgDir = resolve26(projectRoot, "node_modules", packageName ?? "");
15342
- const pkgJsonPath = join23(pkgDir, "package.json");
15343
- if (existsSync21(pkgJsonPath)) {
16301
+ const pkgDir = resolve27(projectRoot, "node_modules", packageName ?? "");
16302
+ const pkgJsonPath = join25(pkgDir, "package.json");
16303
+ if (existsSync23(pkgJsonPath)) {
15344
16304
  const pkg = JSON.parse(readFileSync15(pkgJsonPath, "utf-8"));
15345
16305
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
15346
16306
  if (esmEntry) {
15347
- const resolved = resolve26(pkgDir, esmEntry);
15348
- if (existsSync21(resolved))
16307
+ const resolved = resolve27(pkgDir, esmEntry);
16308
+ if (existsSync23(resolved))
15349
16309
  return relative11(projectRoot, resolved);
15350
16310
  }
15351
16311
  }
@@ -15376,7 +16336,7 @@ ${stubs}
15376
16336
  };
15377
16337
  result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
15378
16338
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
15379
- const fileDir = dirname14(filePath);
16339
+ const fileDir = dirname15(filePath);
15380
16340
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
15381
16341
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
15382
16342
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
@@ -15389,12 +16349,12 @@ ${stubs}
15389
16349
  return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
15390
16350
  });
15391
16351
  result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
15392
- const absPath = resolve26(fileDir, relPath);
16352
+ const absPath = resolve27(fileDir, relPath);
15393
16353
  const rel = relative11(projectRoot, absPath);
15394
16354
  return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
15395
16355
  });
15396
16356
  result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
15397
- const absPath = resolve26(fileDir, relPath);
16357
+ const absPath = resolve27(fileDir, relPath);
15398
16358
  const rel = relative11(projectRoot, absPath);
15399
16359
  return `'${srcUrl(rel, projectRoot)}'`;
15400
16360
  });
@@ -15457,16 +16417,16 @@ ${transpiled}`;
15457
16417
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
15458
16418
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
15459
16419
  const raw = readFileSync15(filePath, "utf-8");
15460
- const ext = extname7(filePath);
16420
+ const ext = extname8(filePath);
15461
16421
  const isTS = ext === ".ts" || ext === ".tsx";
15462
16422
  const isTSX = ext === ".tsx" || ext === ".jsx";
15463
- let transpiler4 = jsTranspiler2;
16423
+ let transpiler5 = jsTranspiler2;
15464
16424
  if (isTSX)
15465
- transpiler4 = tsxTranspiler;
16425
+ transpiler5 = tsxTranspiler;
15466
16426
  else if (isTS)
15467
- transpiler4 = tsTranspiler2;
15468
- const valueExports = isTS ? transpiler4.scan(raw).exports : [];
15469
- let transpiled = transpiler4.transformSync(raw);
16427
+ transpiler5 = tsTranspiler2;
16428
+ const valueExports = isTS ? transpiler5.scan(raw).exports : [];
16429
+ let transpiled = transpiler5.transformSync(raw);
15470
16430
  if (isTS) {
15471
16431
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
15472
16432
  }
@@ -15682,17 +16642,19 @@ export default __script__;`;
15682
16642
  return `${cssInjection}
15683
16643
  ${code}`;
15684
16644
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
15685
- const raw = readFileSync15(filePath, "utf-8");
16645
+ const rawSource = readFileSync15(filePath, "utf-8");
16646
+ const raw = addAutoRouterSetupApp(rawSource);
15686
16647
  if (!vueCompiler) {
15687
16648
  vueCompiler = await import("@vue/compiler-sfc");
15688
16649
  }
15689
- const fileName = basename9(filePath, ".vue");
16650
+ const fileName = basename10(filePath, ".vue");
15690
16651
  const componentId = fileName.toLowerCase();
15691
16652
  const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
15692
- const compiledScript = vueCompiler.compileScript(descriptor, {
16653
+ const hasScript = descriptor.script || descriptor.scriptSetup;
16654
+ const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
15693
16655
  id: componentId,
15694
16656
  inlineTemplate: false
15695
- });
16657
+ }) : { bindings: {}, content: "export default {};" };
15696
16658
  const compiledSfcScript = {
15697
16659
  bindings: compiledScript.bindings ?? {},
15698
16660
  content: compiledScript.content
@@ -15703,7 +16665,7 @@ ${code}`;
15703
16665
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
15704
16666
  return rewriteImports2(code, filePath, projectRoot, rewriter);
15705
16667
  }, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
15706
- const hmrBase = vueDir ? resolve26(vueDir) : projectRoot;
16668
+ const hmrBase = vueDir ? resolve27(vueDir) : projectRoot;
15707
16669
  const hmrId = relative11(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
15708
16670
  let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
15709
16671
  result += [
@@ -15718,11 +16680,11 @@ ${code}`;
15718
16680
  `);
15719
16681
  return result;
15720
16682
  }, resolveSvelteModulePath = (path) => {
15721
- if (existsSync21(path))
16683
+ if (existsSync23(path))
15722
16684
  return path;
15723
- if (existsSync21(`${path}.ts`))
16685
+ if (existsSync23(`${path}.ts`))
15724
16686
  return `${path}.ts`;
15725
- if (existsSync21(`${path}.js`))
16687
+ if (existsSync23(`${path}.js`))
15726
16688
  return `${path}.js`;
15727
16689
  return path;
15728
16690
  }, jsResponse = (body) => {
@@ -15862,13 +16824,13 @@ export default {};
15862
16824
  const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
15863
16825
  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
16826
  }, resolveSourcePath = (relPath, projectRoot) => {
15865
- const filePath = resolve26(projectRoot, relPath);
15866
- const ext = extname7(filePath);
16827
+ const filePath = resolve27(projectRoot, relPath);
16828
+ const ext = extname8(filePath);
15867
16829
  if (ext === ".svelte")
15868
16830
  return { ext, filePath: resolveSvelteModulePath(filePath) };
15869
16831
  if (ext)
15870
16832
  return { ext, filePath };
15871
- const found = MODULE_EXTENSIONS.find((candidate) => existsSync21(filePath + candidate));
16833
+ const found = MODULE_EXTENSIONS.find((candidate) => existsSync23(filePath + candidate));
15872
16834
  if (!found)
15873
16835
  return { ext, filePath };
15874
16836
  const resolved = filePath + found;
@@ -15889,7 +16851,7 @@ export default {};
15889
16851
  if (!TRANSPILABLE.has(ext))
15890
16852
  return;
15891
16853
  const stat4 = statSync2(filePath);
15892
- const resolvedVueDir = vueDir ? resolve26(vueDir) : undefined;
16854
+ const resolvedVueDir = vueDir ? resolve27(vueDir) : undefined;
15893
16855
  const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
15894
16856
  setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
15895
16857
  return jsResponse(content);
@@ -15920,7 +16882,7 @@ export default {};
15920
16882
  if (!pathname.startsWith(SRC_PREFIX))
15921
16883
  return;
15922
16884
  const relPath = pathname.slice(SRC_PREFIX.length);
15923
- const virtualCssResponse = handleVirtualSvelteCss(resolve26(projectRoot, relPath));
16885
+ const virtualCssResponse = handleVirtualSvelteCss(resolve27(projectRoot, relPath));
15924
16886
  if (virtualCssResponse)
15925
16887
  return virtualCssResponse;
15926
16888
  const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
@@ -15936,11 +16898,11 @@ export default {};
15936
16898
  SRC_IMPORT_RE.lastIndex = 0;
15937
16899
  while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
15938
16900
  if (match[1])
15939
- files.push(resolve26(projectRoot, match[1]));
16901
+ files.push(resolve27(projectRoot, match[1]));
15940
16902
  }
15941
16903
  return files;
15942
16904
  }, invalidateModule = (filePath) => {
15943
- const resolved = resolve26(filePath);
16905
+ const resolved = resolve27(filePath);
15944
16906
  invalidate(filePath);
15945
16907
  if (resolved !== filePath)
15946
16908
  invalidate(resolved);
@@ -15958,6 +16920,7 @@ export default {};
15958
16920
  var init_moduleServer = __esm(() => {
15959
16921
  init_constants();
15960
16922
  init_resolvePackageImport();
16923
+ init_vueAutoRouterTransform();
15961
16924
  init_sourceMetadata();
15962
16925
  init_stylePreprocessor();
15963
16926
  init_lowerAwaitSlotSyntax();
@@ -16014,21 +16977,147 @@ var init_moduleServer = __esm(() => {
16014
16977
  SRC_URL_PREFIX = SRC_PREFIX;
16015
16978
  });
16016
16979
 
16980
+ // src/utils/ssrErrorPage.ts
16981
+ var ssrErrorPage = (framework, error) => {
16982
+ const frameworkColors2 = {
16983
+ angular: "#dd0031",
16984
+ html: "#e34c26",
16985
+ htmx: "#1a365d",
16986
+ react: "#61dafb",
16987
+ svelte: "#ff3e00",
16988
+ vue: "#42b883"
16989
+ };
16990
+ const accent = frameworkColors2[framework] ?? "#94a3b8";
16991
+ const label = framework.charAt(0).toUpperCase() + framework.slice(1);
16992
+ const message = error instanceof Error ? error.message : String(error);
16993
+ return `<!DOCTYPE html>
16994
+ <html>
16995
+ <head>
16996
+ <meta charset="utf-8">
16997
+ <meta name="viewport" content="width=device-width, initial-scale=1">
16998
+ <title>SSR Error - AbsoluteJS</title>
16999
+ <style>
17000
+ *{margin:0;padding:0;box-sizing:border-box}
17001
+ 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}
17002
+ .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}
17003
+ .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)}
17004
+ .brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
17005
+ .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)}
17006
+ .kind{color:#94a3b8;font-size:13px;font-weight:500}
17007
+ .content{padding:24px}
17008
+ .label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
17009
+ .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}
17010
+ .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}
17011
+ </style>
17012
+ </head>
17013
+ <body>
17014
+ <div class="card">
17015
+ <div class="header">
17016
+ <div style="display:flex;align-items:center;gap:12px">
17017
+ <span class="brand">AbsoluteJS</span>
17018
+ <span class="badge">${label}</span>
17019
+ </div>
17020
+ <span class="kind">Server Render Error</span>
17021
+ </div>
17022
+ <div class="content">
17023
+ <div class="label">What went wrong</div>
17024
+ <pre class="message">${message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}</pre>
17025
+ <div class="hint">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>
17026
+ </div>
17027
+ </div>
17028
+ </body>
17029
+ </html>`;
17030
+ };
17031
+
17032
+ // src/ember/pageHandler.ts
17033
+ import { pathToFileURL } from "url";
17034
+ var resolveRequestPathname = (request) => {
17035
+ if (!request)
17036
+ return;
17037
+ try {
17038
+ const parsed = new URL(request.url);
17039
+ return `${parsed.pathname}${parsed.search}`;
17040
+ } catch {
17041
+ return;
17042
+ }
17043
+ }, installSimpleDomGlobals = () => {
17044
+ const g2 = globalThis;
17045
+ if (typeof g2.Element === "undefined") {
17046
+ g2.Element = class Element {
17047
+ };
17048
+ }
17049
+ if (typeof g2.Node === "undefined") {
17050
+ g2.Node = class Node {
17051
+ };
17052
+ }
17053
+ }, emberCacheBuster = 0, buildRuntimeModuleSpecifier = (modulePath) => {
17054
+ if (emberCacheBuster === 0)
17055
+ return modulePath;
17056
+ const moduleUrl = new URL(pathToFileURL(modulePath).href);
17057
+ moduleUrl.searchParams.set("t", String(emberCacheBuster));
17058
+ return moduleUrl.href;
17059
+ }, invalidateEmberSsrCache = () => {
17060
+ markSsrCacheDirty("ember");
17061
+ emberCacheBuster = Date.now();
17062
+ }, buildHtmlShell = (headTag, bodyContent, indexPath, props) => {
17063
+ const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
17064
+ const indexImport = indexPath ? `<script type="module" src="${indexPath}"></script>` : "";
17065
+ return `<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>` + indexImport + `</body></html>`;
17066
+ }, handleEmberPageRequest = async (input) => {
17067
+ const { indexPath, pagePath, headTag } = input;
17068
+ const userProps = input.props;
17069
+ const requestPathname = resolveRequestPathname(input.request);
17070
+ const props = requestPathname !== undefined && (!userProps || !("url" in userProps)) ? { ...userProps ?? {}, url: requestPathname } : userProps;
17071
+ const resolvedHeadTag = headTag ?? "<head></head>";
17072
+ try {
17073
+ installSimpleDomGlobals();
17074
+ isSsrCacheDirty("ember");
17075
+ const bundle = await import(buildRuntimeModuleSpecifier(pagePath));
17076
+ if (typeof bundle.renderToHTML !== "function") {
17077
+ throw new Error(`Ember page bundle at ${pagePath} does not export renderToHTML(). Was it compiled by compileEmber()?`);
17078
+ }
17079
+ const innerHtml = bundle.renderToHTML(props ?? {});
17080
+ const html = buildHtmlShell(resolvedHeadTag, innerHtml.replace(/^<div>|<\/div>$/g, ""), indexPath, props);
17081
+ return new Response(html, {
17082
+ headers: { "Content-Type": "text/html" }
17083
+ });
17084
+ } catch (error) {
17085
+ console.error("[SSR] Ember render error:", error);
17086
+ return new Response(ssrErrorPage("ember", error), {
17087
+ headers: { "Content-Type": "text/html" },
17088
+ status: 500
17089
+ });
17090
+ }
17091
+ };
17092
+ var init_pageHandler = __esm(() => {
17093
+ init_ssrCache();
17094
+ });
17095
+
17096
+ // src/ember/index.ts
17097
+ var exports_ember = {};
17098
+ __export(exports_ember, {
17099
+ invalidateEmberSsrCache: () => invalidateEmberSsrCache,
17100
+ handleEmberPageRequest: () => handleEmberPageRequest
17101
+ });
17102
+ var init_ember = __esm(() => {
17103
+ init_pageHandler();
17104
+ });
17105
+
16017
17106
  // src/dev/simpleHTMLHMR.ts
16018
17107
  var exports_simpleHTMLHMR = {};
16019
17108
  __export(exports_simpleHTMLHMR, {
16020
17109
  handleHTMLUpdate: () => handleHTMLUpdate
16021
17110
  });
16022
- import { resolve as resolve27 } from "path";
17111
+ import { resolve as resolve28 } from "path";
16023
17112
  var handleHTMLUpdate = async (htmlFilePath) => {
16024
17113
  let htmlContent;
16025
17114
  try {
16026
- const resolvedPath = resolve27(htmlFilePath);
16027
- const file3 = Bun.file(resolvedPath);
16028
- if (!await file3.exists()) {
17115
+ const resolvedPath = resolve28(htmlFilePath);
17116
+ const file4 = Bun.file(resolvedPath);
17117
+ if (!await file4.exists()) {
16029
17118
  return null;
16030
17119
  }
16031
- htmlContent = await file3.text();
17120
+ htmlContent = await file4.text();
16032
17121
  } catch {
16033
17122
  return null;
16034
17123
  }
@@ -16049,16 +17138,16 @@ var exports_simpleHTMXHMR = {};
16049
17138
  __export(exports_simpleHTMXHMR, {
16050
17139
  handleHTMXUpdate: () => handleHTMXUpdate
16051
17140
  });
16052
- import { resolve as resolve28 } from "path";
17141
+ import { resolve as resolve29 } from "path";
16053
17142
  var handleHTMXUpdate = async (htmxFilePath) => {
16054
17143
  let htmlContent;
16055
17144
  try {
16056
- const resolvedPath = resolve28(htmxFilePath);
16057
- const file3 = Bun.file(resolvedPath);
16058
- if (!await file3.exists()) {
17145
+ const resolvedPath = resolve29(htmxFilePath);
17146
+ const file4 = Bun.file(resolvedPath);
17147
+ if (!await file4.exists()) {
16059
17148
  return null;
16060
17149
  }
16061
- htmlContent = await file3.text();
17150
+ htmlContent = await file4.text();
16062
17151
  } catch {
16063
17152
  return null;
16064
17153
  }
@@ -16075,8 +17164,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
16075
17164
  var init_simpleHTMXHMR = () => {};
16076
17165
 
16077
17166
  // src/dev/rebuildTrigger.ts
16078
- import { existsSync as existsSync22 } from "fs";
16079
- import { basename as basename10, dirname as dirname15, relative as relative12, resolve as resolve29 } from "path";
17167
+ import { existsSync as existsSync24 } from "fs";
17168
+ import { basename as basename11, dirname as dirname16, relative as relative12, resolve as resolve30 } from "path";
16080
17169
  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
17170
  if (!config.tailwind)
16082
17171
  return;
@@ -16100,16 +17189,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16100
17189
  }, parseErrorLocationFromMessage = (msg) => {
16101
17190
  const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
16102
17191
  if (pathLineCol) {
16103
- const [, file3, lineStr, colStr] = pathLineCol;
17192
+ const [, file4, lineStr, colStr] = pathLineCol;
16104
17193
  return {
16105
17194
  column: colStr ? parseInt(colStr, 10) : undefined,
16106
- file: file3,
17195
+ file: file4,
16107
17196
  line: lineStr ? parseInt(lineStr, 10) : undefined
16108
17197
  };
16109
17198
  }
16110
17199
  const atMatch = msg.match(/(?:at|in)\s+([^(:\s]+)(?:\s*\([^)]*line\s*(\d+)[^)]*col(?:umn)?\s*(\d+)[^)]*\)|:(\d+):(\d+)?)/i);
16111
17200
  if (atMatch) {
16112
- const [, file3, line1, col1, line2, col2] = atMatch;
17201
+ const [, file4, line1, col1, line2, col2] = atMatch;
16113
17202
  let parsedCol;
16114
17203
  if (col1)
16115
17204
  parsedCol = parseInt(col1, 10);
@@ -16122,16 +17211,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16122
17211
  parsedLine = parseInt(line2, 10);
16123
17212
  return {
16124
17213
  column: parsedCol,
16125
- file: file3?.trim(),
17214
+ file: file4?.trim(),
16126
17215
  line: parsedLine
16127
17216
  };
16128
17217
  }
16129
17218
  const parenMatch = msg.match(/([^\s(]+)\s*\([^)]*line\s*(\d+)[^)]*col(?:umn)?\s*(\d+)/i);
16130
17219
  if (parenMatch) {
16131
- const [, file3, lineStr, colStr] = parenMatch;
17220
+ const [, file4, lineStr, colStr] = parenMatch;
16132
17221
  return {
16133
17222
  column: colStr ? parseInt(colStr, 10) : undefined,
16134
- file: file3 ?? undefined,
17223
+ file: file4 ?? undefined,
16135
17224
  line: lineStr ? parseInt(lineStr, 10) : undefined
16136
17225
  };
16137
17226
  }
@@ -16143,14 +17232,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16143
17232
  if (logs && Array.isArray(logs) && logs.length > 0) {
16144
17233
  const errLog = logs.find((l4) => l4.level === "error") ?? logs[0];
16145
17234
  const pos = errLog?.position;
16146
- const file3 = pos?.file;
17235
+ const file4 = pos?.file;
16147
17236
  const line = pos?.line;
16148
17237
  const column = pos?.column;
16149
17238
  const lineText = pos?.lineText;
16150
- const framework = file3 && resolvedPaths ? detectFramework(file3, resolvedPaths) : affectedFrameworks[0] ?? "unknown";
17239
+ const framework = file4 && resolvedPaths ? detectFramework(file4, resolvedPaths) : affectedFrameworks[0] ?? "unknown";
16151
17240
  return {
16152
17241
  column,
16153
- file: file3,
17242
+ file: file4,
16154
17243
  framework: framework !== "ignored" ? framework : affectedFrameworks[0],
16155
17244
  line,
16156
17245
  lineText
@@ -16164,11 +17253,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16164
17253
  detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
16165
17254
  }
16166
17255
  return { ...parsed, framework: detectedFw };
16167
- }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync22(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
17256
+ }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync24(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
16168
17257
  state.fileHashes.delete(filePathInSet);
16169
17258
  try {
16170
17259
  const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
16171
- const deletedPathResolved = resolve29(filePathInSet);
17260
+ const deletedPathResolved = resolve30(filePathInSet);
16172
17261
  affectedFiles.forEach((affectedFile) => {
16173
17262
  if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
16174
17263
  validFiles.push(affectedFile);
@@ -16182,7 +17271,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16182
17271
  if (!dependents || dependents.size === 0) {
16183
17272
  return;
16184
17273
  }
16185
- const dependentFiles = Array.from(dependents).filter((file3) => existsSync22(file3));
17274
+ const dependentFiles = Array.from(dependents).filter((file4) => existsSync24(file4));
16186
17275
  if (dependentFiles.length === 0) {
16187
17276
  return;
16188
17277
  }
@@ -16198,7 +17287,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16198
17287
  try {
16199
17288
  const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
16200
17289
  affectedFiles.forEach((affectedFile) => {
16201
- if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync22(affectedFile)) {
17290
+ if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync24(affectedFile)) {
16202
17291
  validFiles.push(affectedFile);
16203
17292
  processedFiles.add(affectedFile);
16204
17293
  }
@@ -16212,7 +17301,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16212
17301
  if (storedHash !== undefined && storedHash === fileHash) {
16213
17302
  return;
16214
17303
  }
16215
- const normalizedFilePath = resolve29(filePathInSet);
17304
+ const normalizedFilePath = resolve30(filePathInSet);
16216
17305
  if (!processedFiles.has(normalizedFilePath)) {
16217
17306
  validFiles.push(normalizedFilePath);
16218
17307
  processedFiles.add(normalizedFilePath);
@@ -16223,7 +17312,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16223
17312
  collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
16224
17313
  }, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
16225
17314
  filePathSet.forEach((filePathInSet) => {
16226
- if (!existsSync22(filePathInSet)) {
17315
+ if (!existsSync24(filePathInSet)) {
16227
17316
  collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
16228
17317
  return;
16229
17318
  }
@@ -16254,10 +17343,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16254
17343
  }
16255
17344
  });
16256
17345
  return filesToProcess;
16257
- }, STABILITY_CHECK_ROUNDS = 5, STABILITY_CHECK_DELAY_MS = 10, isFileStable = async (file3) => {
16258
- const hash1 = computeFileHash(file3);
17346
+ }, STABILITY_CHECK_ROUNDS = 5, STABILITY_CHECK_DELAY_MS = 10, isFileStable = async (file4) => {
17347
+ const hash1 = computeFileHash(file4);
16259
17348
  await Bun.sleep(STABILITY_CHECK_DELAY_MS);
16260
- const hash2 = computeFileHash(file3);
17349
+ const hash2 = computeFileHash(file4);
16261
17350
  return hash1 === hash2;
16262
17351
  }, collectAllQueuedFiles = (fileChangeQueue) => {
16263
17352
  const allFiles = [];
@@ -16268,11 +17357,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16268
17357
  }, areAllQueuedFilesStable = async (fileChangeQueue) => {
16269
17358
  const allFiles = collectAllQueuedFiles(fileChangeQueue);
16270
17359
  const checkFile = async (files) => {
16271
- const [file3, ...remaining] = files;
16272
- if (!file3) {
17360
+ const [file4, ...remaining] = files;
17361
+ if (!file4) {
16273
17362
  return true;
16274
17363
  }
16275
- const stable = await isFileStable(file3);
17364
+ const stable = await isFileStable(file4);
16276
17365
  if (!stable) {
16277
17366
  return false;
16278
17367
  }
@@ -16316,7 +17405,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16316
17405
  return;
16317
17406
  }
16318
17407
  if (framework === "unknown") {
16319
- invalidate(resolve29(filePath));
17408
+ invalidate(resolve30(filePath));
16320
17409
  const relPath = relative12(process.cwd(), filePath);
16321
17410
  logHmrUpdate(relPath);
16322
17411
  return;
@@ -16360,12 +17449,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16360
17449
  return componentFile;
16361
17450
  }
16362
17451
  const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
16363
- if (existsSync22(tsCounterpart)) {
17452
+ if (existsSync24(tsCounterpart)) {
16364
17453
  return tsCounterpart;
16365
17454
  }
16366
17455
  if (!graph)
16367
17456
  return componentFile;
16368
- const dependents = graph.dependents.get(resolve29(componentFile));
17457
+ const dependents = graph.dependents.get(resolve30(componentFile));
16369
17458
  if (!dependents)
16370
17459
  return componentFile;
16371
17460
  for (const dep of dependents) {
@@ -16374,7 +17463,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16374
17463
  }
16375
17464
  return componentFile;
16376
17465
  }, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
16377
- const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") && resolve29(file3).startsWith(angularPagesPath));
17466
+ const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve30(file4).startsWith(angularPagesPath));
16378
17467
  if (pageEntries.length > 0 || !state.dependencyGraph) {
16379
17468
  return pageEntries;
16380
17469
  }
@@ -16382,9 +17471,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16382
17471
  angularFiles.forEach((componentFile) => {
16383
17472
  const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
16384
17473
  const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
16385
- affected.forEach((file3) => {
16386
- if (file3.endsWith(".ts") && resolve29(file3).startsWith(angularPagesPath)) {
16387
- resolvedPages.add(file3);
17474
+ affected.forEach((file4) => {
17475
+ if (file4.endsWith(".ts") && resolve30(file4).startsWith(angularPagesPath)) {
17476
+ resolvedPages.add(file4);
16388
17477
  }
16389
17478
  });
16390
17479
  });
@@ -16400,14 +17489,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16400
17489
  const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
16401
17490
  return clientRoots.length === 1 ? clientRoots[0] ?? process.cwd() : commonAncestor2(clientRoots, process.cwd());
16402
17491
  }, updateServerManifestEntry = (state, artifact) => {
16403
- const fileWithHash = basename10(artifact.path);
17492
+ const fileWithHash = basename11(artifact.path);
16404
17493
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
16405
17494
  if (!baseName) {
16406
17495
  return;
16407
17496
  }
16408
17497
  state.manifest[toPascal(baseName)] = artifact.path;
16409
17498
  }, bundleAngularClient = async (state, clientPaths, buildDir) => {
16410
- const { build: bunBuild7 } = await Promise.resolve(globalThis.Bun);
17499
+ const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
16411
17500
  const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
16412
17501
  const { getAngularVendorPaths: getAngularVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
16413
17502
  const clientRoot = await computeClientRoot(state.resolvedPaths);
@@ -16419,7 +17508,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16419
17508
  angVendorPaths = computeAngularVendorPaths2(globalThis.__angularVendorSpecifiers);
16420
17509
  setAngularVendorPaths2(angVendorPaths);
16421
17510
  }
16422
- const clientResult = await bunBuild7({
17511
+ const clientResult = await bunBuild9({
16423
17512
  entrypoints: clientPaths,
16424
17513
  ...Object.keys({
16425
17514
  ...angVendorPaths ?? {},
@@ -16455,7 +17544,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16455
17544
  await populateAssetStore(state.assetStore, clientManifest, buildDir);
16456
17545
  }, broadcastAngularPageUpdates = (state, pagesToUpdate, manifest, startTime) => {
16457
17546
  pagesToUpdate.forEach((angularPagePath) => {
16458
- const fileName = basename10(angularPagePath);
17547
+ const fileName = basename11(angularPagePath);
16459
17548
  const baseName = fileName.replace(/\.[tj]s$/, "");
16460
17549
  const pascalName = toPascal(baseName);
16461
17550
  const cssKey = `${pascalName}CSS`;
@@ -16492,28 +17581,28 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16492
17581
  await rewriteImports3(ssrPaths, angServerVendorPaths);
16493
17582
  }
16494
17583
  serverPaths.forEach((serverPath, idx) => {
16495
- const fileBase = basename10(serverPath, ".js");
17584
+ const fileBase = basename11(serverPath, ".js");
16496
17585
  const ssrPath = ssrPaths[idx] ?? serverPath;
16497
- state.manifest[toPascal(fileBase)] = resolve29(ssrPath);
17586
+ state.manifest[toPascal(fileBase)] = resolve30(ssrPath);
16498
17587
  });
16499
17588
  if (clientPaths.length > 0) {
16500
17589
  await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
16501
17590
  }
16502
17591
  }, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
16503
17592
  const angularDir = config.angularDirectory ?? "";
16504
- const angularFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "angular");
16505
- for (const file3 of angularFiles) {
16506
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
17593
+ const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
17594
+ for (const file4 of angularFiles) {
17595
+ state.fileHashes.set(resolve30(file4), computeFileHash(file4));
16507
17596
  }
16508
- const angularPagesPath = resolve29(angularDir, "pages");
17597
+ const angularPagesPath = resolve30(angularDir, "pages");
16509
17598
  const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
16510
17599
  if (pageEntries.length > 0) {
16511
17600
  await compileAndBundleAngular(state, pageEntries, angularDir);
16512
17601
  markSsrCacheDirty("angular");
16513
17602
  }
16514
17603
  const { manifest } = state;
16515
- const angularHmrFiles = angularFiles.filter((file3) => file3.endsWith(".ts") || file3.endsWith(".html"));
16516
- const angularPageFiles = angularHmrFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
17604
+ const angularHmrFiles = angularFiles.filter((file4) => file4.endsWith(".ts") || file4.endsWith(".html"));
17605
+ const angularPageFiles = angularHmrFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
16517
17606
  const pagesToUpdate = angularPageFiles.length > 0 ? angularPageFiles : pageEntries;
16518
17607
  broadcastAngularPageUpdates(state, pagesToUpdate, manifest, startTime);
16519
17608
  onRebuildComplete({ hmrState: state, manifest });
@@ -16530,14 +17619,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16530
17619
  if (isComponentFile2)
16531
17620
  return primaryFile;
16532
17621
  const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
16533
- const nearest = findNearestComponent2(resolve29(primaryFile));
17622
+ const nearest = findNearestComponent2(resolve30(primaryFile));
16534
17623
  return nearest ?? primaryFile;
16535
17624
  }, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
16536
- for (const file3 of reactFiles) {
16537
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
17625
+ for (const file4 of reactFiles) {
17626
+ state.fileHashes.set(resolve30(file4), computeFileHash(file4));
16538
17627
  }
16539
17628
  markSsrCacheDirty("react");
16540
- const primaryFile = reactFiles.find((file3) => !file3.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
17629
+ const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
16541
17630
  if (!primaryFile) {
16542
17631
  onRebuildComplete({
16543
17632
  hmrState: state,
@@ -16546,8 +17635,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16546
17635
  return state.manifest;
16547
17636
  }
16548
17637
  const { invalidateModule: invalidateModule2 } = await getModuleServer();
16549
- for (const file3 of reactFiles) {
16550
- invalidateModule2(file3);
17638
+ for (const file4 of reactFiles) {
17639
+ invalidateModule2(file4);
16551
17640
  }
16552
17641
  const broadcastTarget = await resolveBroadcastTarget(primaryFile);
16553
17642
  const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
@@ -16575,7 +17664,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16575
17664
  });
16576
17665
  return state.manifest;
16577
17666
  }, handleReactFastPath = async (state, _config, filesToRebuild, startTime, onRebuildComplete) => {
16578
- const reactFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "react");
17667
+ const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
16579
17668
  if (reactFiles.length === 0) {
16580
17669
  onRebuildComplete({ hmrState: state, manifest: state.manifest });
16581
17670
  return state.manifest;
@@ -16615,8 +17704,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16615
17704
  type: "svelte-update"
16616
17705
  });
16617
17706
  }, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
16618
- for (const file3 of svelteFiles) {
16619
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
17707
+ for (const file4 of svelteFiles) {
17708
+ state.fileHashes.set(resolve30(file4), computeFileHash(file4));
16620
17709
  }
16621
17710
  markSsrCacheDirty("svelte");
16622
17711
  const serverDuration = Date.now() - startTime;
@@ -16628,22 +17717,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16628
17717
  return state.manifest;
16629
17718
  }, handleSvelteFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
16630
17719
  const svelteDir = config.svelteDirectory ?? "";
16631
- const svelteFiles = filesToRebuild.filter((file3) => (file3.endsWith(".svelte") || file3.includes(".svelte.")) && detectFramework(file3, state.resolvedPaths) === "svelte");
17720
+ const svelteFiles = filesToRebuild.filter((file4) => (file4.endsWith(".svelte") || file4.includes(".svelte.")) && detectFramework(file4, state.resolvedPaths) === "svelte");
16632
17721
  if (svelteFiles.length > 0) {
16633
17722
  return handleSvelteModuleServerPath(state, svelteFiles, startTime, onRebuildComplete);
16634
17723
  }
16635
17724
  const { buildDir } = state.resolvedPaths;
16636
17725
  if (svelteFiles.length > 0) {
16637
17726
  const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
16638
- const { build: bunBuild7 } = await Promise.resolve(globalThis.Bun);
17727
+ const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
16639
17728
  const clientRoot = await computeClientRoot(state.resolvedPaths);
16640
17729
  const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
16641
17730
  const serverEntries = [...svelteServerPaths];
16642
17731
  const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
16643
- const serverRoot = resolve29(svelteDir, "generated", "server");
16644
- const serverOutDir = resolve29(buildDir, basename10(svelteDir));
17732
+ const serverRoot = resolve30(svelteDir, "generated", "server");
17733
+ const serverOutDir = resolve30(buildDir, basename11(svelteDir));
16645
17734
  const [serverResult, clientResult] = await Promise.all([
16646
- serverEntries.length > 0 ? bunBuild7({
17735
+ serverEntries.length > 0 ? bunBuild9({
16647
17736
  entrypoints: serverEntries,
16648
17737
  external: [
16649
17738
  "react",
@@ -16663,7 +17752,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16663
17752
  target: "bun",
16664
17753
  throw: false
16665
17754
  }) : undefined,
16666
- clientEntries.length > 0 ? bunBuild7({
17755
+ clientEntries.length > 0 ? bunBuild9({
16667
17756
  entrypoints: clientEntries,
16668
17757
  format: "esm",
16669
17758
  naming: "[dir]/[name].[hash].[ext]",
@@ -16683,7 +17772,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16683
17772
  const duration = Date.now() - startTime;
16684
17773
  const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
16685
17774
  broadcastFiles.forEach((sveltePagePath) => {
16686
- const fileName = basename10(sveltePagePath);
17775
+ const fileName = basename11(sveltePagePath);
16687
17776
  const baseName = fileName.replace(/\.svelte$/, "");
16688
17777
  const pascalName = toPascal(baseName);
16689
17778
  const cssKey = `${pascalName}CSS`;
@@ -16714,8 +17803,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16714
17803
  if (nonVueFiles.length === 0)
16715
17804
  return;
16716
17805
  const { invalidateModule: invalidateModule2 } = await getModuleServer();
16717
- for (const file3 of nonVueFiles) {
16718
- invalidateModule2(file3);
17806
+ for (const file4 of nonVueFiles) {
17807
+ invalidateModule2(file4);
16719
17808
  }
16720
17809
  }, broadcastVueModuleUpdate = async (state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration) => {
16721
17810
  const pageModuleUrl = await getModuleUrl(changedFile);
@@ -16737,8 +17826,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16737
17826
  type: "vue-update"
16738
17827
  });
16739
17828
  }, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
16740
- for (const file3 of [...vueFiles, ...nonVueFiles]) {
16741
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
17829
+ for (const file4 of [...vueFiles, ...nonVueFiles]) {
17830
+ state.fileHashes.set(resolve30(file4), computeFileHash(file4));
16742
17831
  }
16743
17832
  markSsrCacheDirty("vue");
16744
17833
  await invalidateNonVueModules(nonVueFiles);
@@ -16751,16 +17840,68 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16751
17840
  });
16752
17841
  return state.manifest;
16753
17842
  }, handleVueFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
16754
- const vueFiles = filesToRebuild.filter((file3) => file3.endsWith(".vue") && detectFramework(file3, state.resolvedPaths) === "vue");
16755
- const nonVueFiles = filesToRebuild.filter((file3) => !file3.endsWith(".vue") && detectFramework(file3, state.resolvedPaths) === "vue");
17843
+ const vueFiles = filesToRebuild.filter((file4) => file4.endsWith(".vue") && detectFramework(file4, state.resolvedPaths) === "vue");
17844
+ const nonVueFiles = filesToRebuild.filter((file4) => !file4.endsWith(".vue") && detectFramework(file4, state.resolvedPaths) === "vue");
16756
17845
  collectAffectedVueFiles(state, nonVueFiles, vueFiles);
16757
17846
  if (vueFiles.length > 0) {
16758
17847
  return handleVueModuleServerPath(state, vueFiles, nonVueFiles, startTime, onRebuildComplete);
16759
17848
  }
16760
17849
  onRebuildComplete({ hmrState: state, manifest: state.manifest });
16761
17850
  return state.manifest;
17851
+ }, EMBER_PAGE_EXTENSIONS, collectAllEmberPages = async (emberPagesPath) => {
17852
+ const { readdir: readdir4 } = await import("fs/promises");
17853
+ try {
17854
+ const entries = await readdir4(emberPagesPath, {
17855
+ recursive: true,
17856
+ withFileTypes: true
17857
+ });
17858
+ return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve30(emberPagesPath, entry.name));
17859
+ } catch {
17860
+ return [];
17861
+ }
17862
+ }, handleEmberFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
17863
+ const emberDir = config.emberDirectory ?? "";
17864
+ const emberFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "ember");
17865
+ if (emberFiles.length === 0 || !emberDir) {
17866
+ onRebuildComplete({ hmrState: state, manifest: state.manifest });
17867
+ return state.manifest;
17868
+ }
17869
+ for (const file4 of emberFiles) {
17870
+ state.fileHashes.set(resolve30(file4), computeFileHash(file4));
17871
+ }
17872
+ const emberPagesPath = resolve30(emberDir, "pages");
17873
+ const directPageEntries = emberFiles.filter((file4) => resolve30(file4).startsWith(emberPagesPath));
17874
+ const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
17875
+ if (allPageEntries.length === 0) {
17876
+ onRebuildComplete({ hmrState: state, manifest: state.manifest });
17877
+ return state.manifest;
17878
+ }
17879
+ const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
17880
+ const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
17881
+ for (const serverPath of serverPaths) {
17882
+ const fileBase = basename11(serverPath, ".js");
17883
+ state.manifest[toPascal(fileBase)] = resolve30(serverPath);
17884
+ }
17885
+ const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
17886
+ invalidateEmberSsrCache2();
17887
+ const duration = Date.now() - startTime;
17888
+ const [primary] = emberFiles;
17889
+ if (primary) {
17890
+ state.lastHmrPath = relative12(process.cwd(), primary).replace(/\\/g, "/");
17891
+ state.lastHmrFramework = "ember";
17892
+ logHmrUpdate(primary, "ember", duration);
17893
+ }
17894
+ broadcastToClients(state, {
17895
+ data: {
17896
+ affectedPages: allPageEntries,
17897
+ manifest: state.manifest
17898
+ },
17899
+ type: "full-reload"
17900
+ });
17901
+ onRebuildComplete({ hmrState: state, manifest: state.manifest });
17902
+ return state.manifest;
16762
17903
  }, collectModuleUpdatesForFramework = (framework, filesToRebuild, manifest, state) => {
16763
- const frameworkFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === framework);
17904
+ const frameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === framework);
16764
17905
  if (frameworkFiles.length === 0) {
16765
17906
  return [];
16766
17907
  }
@@ -16780,15 +17921,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16780
17921
  if (!affectedFrameworks.includes("react") || !state.resolvedPaths.reactDir) {
16781
17922
  return;
16782
17923
  }
16783
- const reactFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "react");
17924
+ const reactFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "react");
16784
17925
  if (reactFiles.length === 0) {
16785
17926
  return;
16786
17927
  }
16787
- const reactPageFiles = reactFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
17928
+ const reactPageFiles = reactFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
16788
17929
  const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
16789
17930
  const [primarySource] = sourceFiles;
16790
17931
  try {
16791
- const hasComponentChanges = reactFiles.some((file3) => file3.endsWith(".tsx") || file3.endsWith(".ts") || file3.endsWith(".jsx"));
17932
+ const hasComponentChanges = reactFiles.some((file4) => file4.endsWith(".tsx") || file4.endsWith(".ts") || file4.endsWith(".jsx"));
16792
17933
  const hasCSSChanges = reactFiles.some(isStylePath);
16793
17934
  logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
16794
17935
  broadcastToClients(state, {
@@ -16809,7 +17950,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16809
17950
  });
16810
17951
  }
16811
17952
  }, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
16812
- const scriptBaseName = basename10(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
17953
+ const scriptBaseName = basename11(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
16813
17954
  const pascalName = toPascal(scriptBaseName);
16814
17955
  const scriptPath = manifest[pascalName] || null;
16815
17956
  if (!scriptPath) {
@@ -16826,13 +17967,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16826
17967
  },
16827
17968
  type: "script-update"
16828
17969
  });
16829
- }, isScriptFile = (file3) => (file3.endsWith(".ts") || file3.endsWith(".js") || file3.endsWith(".tsx") || file3.endsWith(".jsx")) && file3.replace(/\\/g, "/").includes("/scripts/"), resolveIslandDefinitionSource = (definition, buildInfo, islandFiles) => {
17970
+ }, isScriptFile = (file4) => (file4.endsWith(".ts") || file4.endsWith(".js") || file4.endsWith(".tsx") || file4.endsWith(".jsx")) && file4.replace(/\\/g, "/").includes("/scripts/"), resolveIslandDefinitionSource = (definition, buildInfo, islandFiles) => {
16830
17971
  const { buildReference } = definition;
16831
17972
  if (!buildReference?.source) {
16832
17973
  return;
16833
17974
  }
16834
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve29(dirname15(buildInfo.resolvedRegistryPath), buildReference.source);
16835
- islandFiles.add(resolve29(sourcePath));
17975
+ const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve30(dirname16(buildInfo.resolvedRegistryPath), buildReference.source);
17976
+ islandFiles.add(resolve30(sourcePath));
16836
17977
  }, resolveIslandSourceFiles = async (config) => {
16837
17978
  const registryPath = config.islands?.registry;
16838
17979
  if (!registryPath) {
@@ -16840,7 +17981,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16840
17981
  }
16841
17982
  const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
16842
17983
  const islandFiles = new Set([
16843
- resolve29(buildInfo.resolvedRegistryPath)
17984
+ resolve30(buildInfo.resolvedRegistryPath)
16844
17985
  ]);
16845
17986
  for (const definition of buildInfo.definitions) {
16846
17987
  resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
@@ -16851,14 +17992,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16851
17992
  if (islandFiles.size === 0) {
16852
17993
  return false;
16853
17994
  }
16854
- return filesToRebuild.some((file3) => islandFiles.has(resolve29(file3)));
17995
+ return filesToRebuild.some((file4) => islandFiles.has(resolve30(file4)));
16855
17996
  }, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
16856
17997
  const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
16857
17998
  if (!shouldReload) {
16858
17999
  return false;
16859
18000
  }
16860
18001
  setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
16861
- const affectedPages = filesToRebuild.flatMap((file3) => getPagesUsingIslandSource(file3));
18002
+ const affectedPages = filesToRebuild.flatMap((file4) => getPagesUsingIslandSource(file4));
16862
18003
  broadcastToClients(state, {
16863
18004
  data: {
16864
18005
  affectedPages,
@@ -16871,12 +18012,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16871
18012
  if (!state.resolvedPaths.htmlDir) {
16872
18013
  return;
16873
18014
  }
16874
- const htmlFrameworkFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "html");
18015
+ const htmlFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "html");
16875
18016
  if (htmlFrameworkFiles.length === 0) {
16876
18017
  return;
16877
18018
  }
16878
18019
  const scriptFiles = htmlFrameworkFiles.filter(isScriptFile);
16879
- const htmlPageFiles = htmlFrameworkFiles.filter((file3) => file3.endsWith(".html"));
18020
+ const htmlPageFiles = htmlFrameworkFiles.filter((file4) => file4.endsWith(".html"));
16880
18021
  if (scriptFiles.length === 0 || htmlPageFiles.length > 0) {
16881
18022
  return;
16882
18023
  }
@@ -16886,10 +18027,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16886
18027
  }, computeOutputPagesDir = (state, config, framework) => {
16887
18028
  const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
16888
18029
  if (isSingle) {
16889
- return resolve29(state.resolvedPaths.buildDir, "pages");
18030
+ return resolve30(state.resolvedPaths.buildDir, "pages");
16890
18031
  }
16891
- const dirName = framework === "html" ? basename10(config.htmlDirectory ?? "html") : basename10(config.htmxDirectory ?? "htmx");
16892
- return resolve29(state.resolvedPaths.buildDir, dirName, "pages");
18032
+ const dirName = framework === "html" ? basename11(config.htmlDirectory ?? "html") : basename11(config.htmxDirectory ?? "htmx");
18033
+ return resolve30(state.resolvedPaths.buildDir, dirName, "pages");
16893
18034
  }, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
16894
18035
  try {
16895
18036
  const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
@@ -16918,17 +18059,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16918
18059
  return;
16919
18060
  }
16920
18061
  const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
16921
- const htmlFrameworkFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "html");
18062
+ const htmlFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "html");
16922
18063
  if (htmlFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
16923
18064
  return;
16924
18065
  }
16925
- const htmlPageFiles = htmlFrameworkFiles.filter((file3) => file3.endsWith(".html"));
18066
+ const htmlPageFiles = htmlFrameworkFiles.filter((file4) => file4.endsWith(".html"));
16926
18067
  const outputHtmlPages = computeOutputPagesDir(state, config, "html");
16927
18068
  const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
16928
18069
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
16929
18070
  await runSequentially(pageFilesToUpdate, async (pageFile) => {
16930
- const htmlPageName = basename10(pageFile);
16931
- const builtHtmlPagePath = resolve29(outputHtmlPages, htmlPageName);
18071
+ const htmlPageName = basename11(pageFile);
18072
+ const builtHtmlPagePath = resolve30(outputHtmlPages, htmlPageName);
16932
18073
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
16933
18074
  });
16934
18075
  }, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
@@ -16936,7 +18077,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16936
18077
  if (!cssFile) {
16937
18078
  return;
16938
18079
  }
16939
- const cssBaseName = basename10(getStyleBaseName(cssFile));
18080
+ const cssBaseName = basename11(getStyleBaseName(cssFile));
16940
18081
  const cssPascalName = toPascal(cssBaseName);
16941
18082
  const cssKey = `${cssPascalName}CSS`;
16942
18083
  const cssUrl = manifest[cssKey] || null;
@@ -16985,7 +18126,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16985
18126
  type: "vue-update"
16986
18127
  });
16987
18128
  }, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
16988
- const fileName = basename10(vuePagePath);
18129
+ const fileName = basename11(vuePagePath);
16989
18130
  const baseName = fileName.replace(/\.vue$/, "");
16990
18131
  const pascalName = toPascal(baseName);
16991
18132
  const vueRoot = config.vueDirectory;
@@ -16993,7 +18134,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
16993
18134
  const cssKey = `${pascalName}CSS`;
16994
18135
  const cssUrl = manifest[cssKey] || null;
16995
18136
  const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
16996
- const hmrMeta = vueHmrMetadata2.get(resolve29(vuePagePath));
18137
+ const hmrMeta = vueHmrMetadata2.get(resolve30(vuePagePath));
16997
18138
  const changeType = hmrMeta?.changeType ?? "full";
16998
18139
  if (changeType === "style-only") {
16999
18140
  broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
@@ -17013,14 +18154,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17013
18154
  if (!config.vueDirectory) {
17014
18155
  return;
17015
18156
  }
17016
- const vueFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "vue");
18157
+ const vueFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "vue");
17017
18158
  if (vueFiles.length === 0) {
17018
18159
  return;
17019
18160
  }
17020
- const vueComponentFiles = vueFiles.filter((file3) => file3.endsWith(".vue"));
18161
+ const vueComponentFiles = vueFiles.filter((file4) => file4.endsWith(".vue"));
17021
18162
  const vueCssFiles = vueFiles.filter(isStylePath);
17022
18163
  const isCssOnlyChange = vueComponentFiles.length === 0 && vueCssFiles.length > 0;
17023
- const vuePageFiles = vueFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
18164
+ const vuePageFiles = vueFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
17024
18165
  const pagesToUpdate = vuePageFiles.length > 0 ? vuePageFiles : vueComponentFiles;
17025
18166
  if (isCssOnlyChange && vueCssFiles.length > 0) {
17026
18167
  handleVueCssOnlyUpdate(state, vueCssFiles, manifest, duration);
@@ -17031,7 +18172,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17031
18172
  if (!cssFile) {
17032
18173
  return;
17033
18174
  }
17034
- const cssBaseName = basename10(getStyleBaseName(cssFile));
18175
+ const cssBaseName = basename11(getStyleBaseName(cssFile));
17035
18176
  const cssPascalName = toPascal(cssBaseName);
17036
18177
  const cssKey = `${cssPascalName}CSS`;
17037
18178
  const cssUrl = manifest[cssKey] || null;
@@ -17049,7 +18190,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17049
18190
  });
17050
18191
  }, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
17051
18192
  try {
17052
- const fileName = basename10(sveltePagePath);
18193
+ const fileName = basename11(sveltePagePath);
17053
18194
  const baseName = fileName.replace(/\.svelte$/, "");
17054
18195
  const pascalName = toPascal(baseName);
17055
18196
  const cssKey = `${pascalName}CSS`;
@@ -17077,14 +18218,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17077
18218
  if (!config.svelteDirectory) {
17078
18219
  return;
17079
18220
  }
17080
- const svelteFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "svelte");
18221
+ const svelteFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "svelte");
17081
18222
  if (svelteFiles.length === 0) {
17082
18223
  return;
17083
18224
  }
17084
- const svelteComponentFiles = svelteFiles.filter((file3) => file3.endsWith(".svelte"));
18225
+ const svelteComponentFiles = svelteFiles.filter((file4) => file4.endsWith(".svelte"));
17085
18226
  const svelteCssFiles = svelteFiles.filter(isStylePath);
17086
18227
  const isCssOnlyChange = svelteComponentFiles.length === 0 && svelteCssFiles.length > 0;
17087
- const sveltePageFiles = svelteFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
18228
+ const sveltePageFiles = svelteFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
17088
18229
  const pagesToUpdate = sveltePageFiles.length > 0 ? sveltePageFiles : svelteComponentFiles;
17089
18230
  if (isCssOnlyChange && svelteCssFiles.length > 0) {
17090
18231
  handleSvelteCssOnlyUpdate(state, svelteCssFiles, manifest, duration);
@@ -17093,9 +18234,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17093
18234
  broadcastSveltePageUpdate(state, sveltePagePath, manifest, duration);
17094
18235
  });
17095
18236
  }, collectAngularAffectedPages = (affected, resolvedPages) => {
17096
- affected.forEach((file3) => {
17097
- if (file3.replace(/\\/g, "/").includes("/pages/") && file3.endsWith(".ts")) {
17098
- resolvedPages.add(file3);
18237
+ affected.forEach((file4) => {
18238
+ if (file4.replace(/\\/g, "/").includes("/pages/") && file4.endsWith(".ts")) {
18239
+ resolvedPages.add(file4);
17099
18240
  }
17100
18241
  });
17101
18242
  }, resolveAngularPagesFromDependencyGraph = (state, angularFiles) => {
@@ -17111,7 +18252,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17111
18252
  if (!cssFile) {
17112
18253
  return;
17113
18254
  }
17114
- const cssBaseName = basename10(getStyleBaseName(cssFile));
18255
+ const cssBaseName = basename11(getStyleBaseName(cssFile));
17115
18256
  const cssPascalName = toPascal(cssBaseName);
17116
18257
  const cssKey = `${cssPascalName}CSS`;
17117
18258
  const cssUrl = manifest[cssKey] || null;
@@ -17129,7 +18270,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17129
18270
  });
17130
18271
  }, broadcastAngularPageHmrUpdate = (state, angularPagePath, manifest, duration) => {
17131
18272
  try {
17132
- const fileName = basename10(angularPagePath);
18273
+ const fileName = basename11(angularPagePath);
17133
18274
  const baseName = fileName.replace(/\.[tj]s$/, "");
17134
18275
  const pascalName = toPascal(baseName);
17135
18276
  const cssKey = `${pascalName}CSS`;
@@ -17156,13 +18297,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17156
18297
  if (!config.angularDirectory) {
17157
18298
  return;
17158
18299
  }
17159
- const angularFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "angular");
18300
+ const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
17160
18301
  if (angularFiles.length === 0) {
17161
18302
  return;
17162
18303
  }
17163
18304
  const angularCssFiles = angularFiles.filter(isStylePath);
17164
18305
  const isCssOnlyChange = angularFiles.every(isStylePath) && angularCssFiles.length > 0;
17165
- const angularPageFiles = angularFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
18306
+ const angularPageFiles = angularFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
17166
18307
  let pagesToUpdate = angularPageFiles;
17167
18308
  if (pagesToUpdate.length === 0 && state.dependencyGraph) {
17168
18309
  pagesToUpdate = resolveAngularPagesFromDependencyGraph(state, angularFiles);
@@ -17178,12 +18319,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17178
18319
  if (!state.resolvedPaths.htmxDir) {
17179
18320
  return;
17180
18321
  }
17181
- const htmxFrameworkFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "htmx");
18322
+ const htmxFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "htmx");
17182
18323
  if (htmxFrameworkFiles.length === 0) {
17183
18324
  return;
17184
18325
  }
17185
18326
  const htmxScriptFiles = htmxFrameworkFiles.filter(isScriptFile);
17186
- const htmxHtmlFiles = htmxFrameworkFiles.filter((file3) => file3.endsWith(".html"));
18327
+ const htmxHtmlFiles = htmxFrameworkFiles.filter((file4) => file4.endsWith(".html"));
17187
18328
  if (htmxScriptFiles.length === 0 || htmxHtmlFiles.length > 0) {
17188
18329
  return;
17189
18330
  }
@@ -17218,17 +18359,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17218
18359
  return;
17219
18360
  }
17220
18361
  const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
17221
- const htmxFrameworkFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "htmx");
18362
+ const htmxFrameworkFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "htmx");
17222
18363
  if (htmxFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
17223
18364
  return;
17224
18365
  }
17225
- const htmxPageFiles = htmxFrameworkFiles.filter((file3) => file3.endsWith(".html"));
18366
+ const htmxPageFiles = htmxFrameworkFiles.filter((file4) => file4.endsWith(".html"));
17226
18367
  const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
17227
18368
  const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
17228
18369
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
17229
18370
  await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
17230
- const htmxPageName = basename10(htmxPageFile);
17231
- const builtHtmxPagePath = resolve29(outputHtmxPages, htmxPageName);
18371
+ const htmxPageName = basename11(htmxPageFile);
18372
+ const builtHtmxPagePath = resolve30(outputHtmxPages, htmxPageName);
17232
18373
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
17233
18374
  });
17234
18375
  }, collectUpdatedModulePaths = (allModuleUpdates) => {
@@ -17297,9 +18438,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17297
18438
  handleModuleUpdates(state, allModuleUpdates, manifest);
17298
18439
  }, logStyleUpdatesForFramework = (state, framework, filesToRebuild, startTime) => {
17299
18440
  const dur = Date.now() - startTime;
17300
- filesToRebuild.forEach((file3) => {
17301
- if (detectFramework(file3, state.resolvedPaths) === framework) {
17302
- logCssUpdate(file3, framework, dur);
18441
+ filesToRebuild.forEach((file4) => {
18442
+ if (detectFramework(file4, state.resolvedPaths) === framework) {
18443
+ logCssUpdate(file4, framework, dur);
17303
18444
  }
17304
18445
  });
17305
18446
  }, broadcastSingleFrameworkUpdate = (state, framework, filesToRebuild, manifest, startTime) => {
@@ -17337,7 +18478,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17337
18478
  html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
17338
18479
  writeFs(destPath, html);
17339
18480
  }, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
17340
- const destPath = resolve29(outputDir, basename10(sourceFile));
18481
+ const destPath = resolve30(outputDir, basename11(sourceFile));
17341
18482
  const hmrScript = extractHmrScript(destPath, readFs);
17342
18483
  const source = await Bun.file(sourceFile).text();
17343
18484
  await Bun.write(destPath, source);
@@ -17367,7 +18508,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17367
18508
  return false;
17368
18509
  }
17369
18510
  }, runMarkupFastPath = async (state, config, filesToRebuild, startTime, framework) => {
17370
- const markupFiles = (filesToRebuild ?? []).filter((file3) => file3.endsWith(".html"));
18511
+ const markupFiles = (filesToRebuild ?? []).filter((file4) => file4.endsWith(".html"));
17371
18512
  if (markupFiles.length === 0)
17372
18513
  return;
17373
18514
  const outputDir = computeOutputPagesDir(state, config, framework);
@@ -17396,6 +18537,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17396
18537
  framework: "angular",
17397
18538
  handler: handleAngularFastPath
17398
18539
  },
18540
+ {
18541
+ directory: config.emberDirectory,
18542
+ framework: "ember",
18543
+ handler: handleEmberFastPath
18544
+ },
17399
18545
  {
17400
18546
  directory: config.reactDirectory,
17401
18547
  framework: "react",
@@ -17513,7 +18659,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
17513
18659
  queuedFiles.push(...filePaths);
17514
18660
  });
17515
18661
  state.fileChangeQueue.clear();
17516
- pending.forEach((file3) => state.rebuildQueue.add(file3));
18662
+ pending.forEach((file4) => state.rebuildQueue.add(file4));
17517
18663
  if (state.rebuildTimeout)
17518
18664
  clearTimeout(state.rebuildTimeout);
17519
18665
  state.rebuildTimeout = setTimeout(() => {
@@ -17580,6 +18726,7 @@ var init_rebuildTrigger = __esm(() => {
17580
18726
  init_ssrCache();
17581
18727
  moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
17582
18728
  getReactModuleUrl = getModuleUrl;
18729
+ EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
17583
18730
  HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
17584
18731
  });
17585
18732
 
@@ -17609,23 +18756,26 @@ __export(exports_buildDepVendor, {
17609
18756
  computeDepVendorPaths: () => computeDepVendorPaths,
17610
18757
  buildDepVendor: () => buildDepVendor
17611
18758
  });
17612
- import { mkdirSync as mkdirSync11 } from "fs";
17613
- import { join as join24 } from "path";
17614
- import { rm as rm9 } from "fs/promises";
17615
- var {build: bunBuild7, Glob: Glob9 } = globalThis.Bun;
17616
- var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable4 = (specifier) => {
18759
+ import { mkdirSync as mkdirSync12 } from "fs";
18760
+ import { join as join26 } from "path";
18761
+ import { rm as rm11 } from "fs/promises";
18762
+ var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
18763
+ var toSafeFileName6 = (specifier) => {
18764
+ const prefix = specifier.startsWith("@") ? "_" : "";
18765
+ return prefix + specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_");
18766
+ }, isResolvable4 = (specifier) => {
17617
18767
  try {
17618
18768
  Bun.resolveSync(specifier, process.cwd());
17619
18769
  return true;
17620
18770
  } catch {
17621
18771
  return false;
17622
18772
  }
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 = (file3) => file3.includes("node_modules") || file3.includes("/build/") || file3.includes("/dist/") || file3.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file3, transpiler4) => {
18773
+ }, 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
18774
  const dep = [];
17625
18775
  const framework = [];
17626
18776
  try {
17627
- const content = await Bun.file(file3).text();
17628
- for (const imp of transpiler4.scanImports(content)) {
18777
+ const content = await Bun.file(file4).text();
18778
+ for (const imp of transpiler5.scanImports(content)) {
17629
18779
  if (isDepSpecifier(imp.path))
17630
18780
  dep.push(imp.path);
17631
18781
  else if (isFrameworkRootCandidate(imp.path))
@@ -17638,13 +18788,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17638
18788
  const glob = new Glob9("**/*.{ts,tsx,js,jsx}");
17639
18789
  try {
17640
18790
  const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
17641
- return all.filter((file3) => !isSkippedFile(file3));
18791
+ return all.filter((file4) => !isSkippedFile(file4));
17642
18792
  } catch {
17643
18793
  return empty;
17644
18794
  }
17645
- }, collectDirSpecifiers = async (dir, transpiler4, dep, framework) => {
18795
+ }, collectDirSpecifiers = async (dir, transpiler5, dep, framework) => {
17646
18796
  const files = await scanDirFiles(dir);
17647
- const results = await Promise.all(files.map((file3) => readFileSpecifiers(file3, transpiler4)));
18797
+ const results = await Promise.all(files.map((file4) => readFileSpecifiers(file4, transpiler5)));
17648
18798
  for (const result of results) {
17649
18799
  for (const spec of result.dep)
17650
18800
  dep.add(spec);
@@ -17654,15 +18804,15 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17654
18804
  }, scanBareImports = async (directories) => {
17655
18805
  const dep = new Set;
17656
18806
  const framework = new Set;
17657
- const transpiler4 = new Bun.Transpiler({ loader: "tsx" });
17658
- await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler4, dep, framework)));
18807
+ const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
18808
+ await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler5, dep, framework)));
17659
18809
  return {
17660
18810
  dep: Array.from(dep).filter(isResolvable4),
17661
18811
  framework: Array.from(framework).filter(isResolvable4)
17662
18812
  };
17663
18813
  }, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
17664
18814
  const { readFileSync: readFileSync16 } = await import("fs");
17665
- const transpiler4 = new Bun.Transpiler({ loader: "js" });
18815
+ const transpiler5 = new Bun.Transpiler({ loader: "js" });
17666
18816
  const newSpecs = new Set;
17667
18817
  for (const spec of specs) {
17668
18818
  if (alreadyScanned.has(spec))
@@ -17682,7 +18832,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17682
18832
  }
17683
18833
  let imports;
17684
18834
  try {
17685
- imports = transpiler4.scanImports(content);
18835
+ imports = transpiler5.scanImports(content);
17686
18836
  } catch {
17687
18837
  continue;
17688
18838
  }
@@ -17702,32 +18852,53 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17702
18852
  }
17703
18853
  }
17704
18854
  return newSpecs;
17705
- }, buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
17706
- const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
17707
- const safeName = toSafeFileName5(specifier);
17708
- const entryPath = join24(tmpDir, `${safeName}.ts`);
17709
- await Bun.write(entryPath, generateVendorEntrySource(specifier));
17710
- return entryPath;
18855
+ }, PURE_ANNOTATION, createStripPureAnnotationsPlugin = () => ({
18856
+ name: "absolute-dep-vendor-strip-pure",
18857
+ setup(bld) {
18858
+ bld.onLoad({ filter: /\.(?:m?js|cjs)$/ }, async (args) => {
18859
+ const source = await Bun.file(args.path).text();
18860
+ if (!source.includes("@__PURE__"))
18861
+ return null;
18862
+ return {
18863
+ contents: source.replace(PURE_ANNOTATION, ""),
18864
+ loader: args.path.endsWith(".cjs") ? "js" : "js"
18865
+ };
18866
+ });
18867
+ }
18868
+ }), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
18869
+ const entries = await Promise.all(specifiers.map(async (specifier) => {
18870
+ const safeName = toSafeFileName6(specifier);
18871
+ const entryPath = join26(tmpDir, `${safeName}.ts`);
18872
+ await Bun.write(entryPath, await generateVendorEntrySource(specifier));
18873
+ return { entryPath, specifier };
17711
18874
  }));
17712
- return bunBuild7({
17713
- entrypoints,
17714
- external: FRAMEWORK_EXTERNALS,
18875
+ const otherSpecsFor = (current) => specifiers.filter((spec) => spec !== current);
18876
+ const results = await Promise.all(entries.map(({ entryPath, specifier }) => bunBuild9({
18877
+ entrypoints: [entryPath],
18878
+ external: [...FRAMEWORK_EXTERNALS, ...otherSpecsFor(specifier)],
17715
18879
  format: "esm",
17716
18880
  minify: false,
17717
18881
  naming: "[name].[ext]",
17718
18882
  outdir: vendorDir,
18883
+ plugins: [createStripPureAnnotationsPlugin()],
17719
18884
  splitting: false,
17720
18885
  target: "browser",
17721
18886
  throw: false
17722
- });
18887
+ })));
18888
+ const aggregated = {
18889
+ success: results.every((result) => result.success),
18890
+ logs: results.flatMap((result) => result.logs),
18891
+ outputs: results.flatMap((result) => result.outputs)
18892
+ };
18893
+ return aggregated;
17723
18894
  }, MAX_VENDOR_DISCOVERY_PASSES = 5, buildDepVendor = async (buildDir, directories) => {
17724
18895
  const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
17725
18896
  if (initialSpecs.length === 0 && frameworkRoots.length === 0)
17726
18897
  return {};
17727
- const vendorDir = join24(buildDir, "vendor");
17728
- mkdirSync11(vendorDir, { recursive: true });
17729
- const tmpDir = join24(buildDir, "_dep_vendor_tmp");
17730
- mkdirSync11(tmpDir, { recursive: true });
18898
+ const vendorDir = join26(buildDir, "vendor");
18899
+ mkdirSync12(vendorDir, { recursive: true });
18900
+ const tmpDir = join26(buildDir, "_dep_vendor_tmp");
18901
+ mkdirSync12(tmpDir, { recursive: true });
17731
18902
  const allSpecs = new Set(initialSpecs);
17732
18903
  const alreadyScanned = new Set;
17733
18904
  let frontier = [...allSpecs, ...frameworkRoots];
@@ -17746,10 +18917,10 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17746
18917
  if (!success) {
17747
18918
  console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
17748
18919
  }
17749
- await rm9(tmpDir, { force: true, recursive: true });
18920
+ await rm11(tmpDir, { force: true, recursive: true });
17750
18921
  const paths = {};
17751
18922
  for (const specifier of allSpecs) {
17752
- paths[specifier] = `/vendor/${toSafeFileName5(specifier)}.js`;
18923
+ paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
17753
18924
  }
17754
18925
  return paths;
17755
18926
  }, computeDepVendorPaths = async (directories) => {
@@ -17767,11 +18938,12 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17767
18938
  }
17768
18939
  const paths = {};
17769
18940
  for (const specifier of allSpecs) {
17770
- paths[specifier] = `/vendor/${toSafeFileName5(specifier)}.js`;
18941
+ paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
17771
18942
  }
17772
18943
  return paths;
17773
18944
  };
17774
18945
  var init_buildDepVendor = __esm(() => {
18946
+ init_vendorEntrySource();
17775
18947
  FRAMEWORK_SPECIFIERS = new Set([
17776
18948
  "react",
17777
18949
  "react-dom",
@@ -17798,6 +18970,7 @@ var init_buildDepVendor = __esm(() => {
17798
18970
  ...FRAMEWORK_SPECIFIERS,
17799
18971
  ...FRAMEWORK_NAMESPACE_PREFIXES.map((prefix) => `${prefix}*`)
17800
18972
  ];
18973
+ PURE_ANNOTATION = /\/\*\s*@__PURE__\s*\*\//g;
17801
18974
  });
17802
18975
 
17803
18976
  // src/core/devBuild.ts
@@ -17807,7 +18980,7 @@ __export(exports_devBuild, {
17807
18980
  });
17808
18981
  import { readdir as readdir4 } from "fs/promises";
17809
18982
  import { statSync as statSync3 } from "fs";
17810
- import { resolve as resolve30 } from "path";
18983
+ import { resolve as resolve31 } from "path";
17811
18984
  var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17812
18985
  const configuredDirs = [
17813
18986
  config.reactDirectory,
@@ -17830,7 +19003,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17830
19003
  return Object.keys(config).length > 0 ? config : null;
17831
19004
  }, reloadConfig = async () => {
17832
19005
  try {
17833
- const configPath2 = resolve30(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
19006
+ const configPath2 = resolve31(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
17834
19007
  const source = await Bun.file(configPath2).text();
17835
19008
  return parseDirectoryConfig(source);
17836
19009
  } catch {
@@ -17862,6 +19035,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17862
19035
  if (!oldConfig.vueDirectory && Boolean(newConfig.vueDirectory)) {
17863
19036
  setVueVendorPaths(computeVueVendorPaths());
17864
19037
  }
19038
+ if (!oldConfig.emberDirectory && Boolean(newConfig.emberDirectory)) {
19039
+ setEmberVendorPaths(computeEmberVendorPaths());
19040
+ }
17865
19041
  const newWatchPaths = getWatchPaths(state.config, state.resolvedPaths);
17866
19042
  const addedPaths = newWatchPaths.filter((path) => !oldWatchPaths.has(path));
17867
19043
  if (addedPaths.length > 0) {
@@ -17912,7 +19088,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17912
19088
  state.fileChangeQueue.clear();
17913
19089
  }
17914
19090
  }, handleCachedReload = async () => {
17915
- const serverMtime = statSync3(resolve30(Bun.main)).mtimeMs;
19091
+ const serverMtime = statSync3(resolve31(Bun.main)).mtimeMs;
17916
19092
  const lastMtime = globalThis.__hmrServerMtime;
17917
19093
  globalThis.__hmrServerMtime = serverMtime;
17918
19094
  const cached = globalThis.__hmrDevResult;
@@ -17928,6 +19104,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17928
19104
  if (cached?.hmrState.config.vueDirectory) {
17929
19105
  setVueVendorPaths(computeVueVendorPaths());
17930
19106
  }
19107
+ if (cached?.hmrState.config.emberDirectory) {
19108
+ setEmberVendorPaths(computeEmberVendorPaths());
19109
+ }
17931
19110
  if (serverMtime === lastMtime) {
17932
19111
  globalThis.__hmrSkipServerRestart = true;
17933
19112
  return;
@@ -17946,8 +19125,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17946
19125
  return true;
17947
19126
  }, resolveAbsoluteVersion2 = async () => {
17948
19127
  const candidates = [
17949
- resolve30(import.meta.dir, "..", "..", "package.json"),
17950
- resolve30(import.meta.dir, "..", "package.json")
19128
+ resolve31(import.meta.dir, "..", "..", "package.json"),
19129
+ resolve31(import.meta.dir, "..", "package.json")
17951
19130
  ];
17952
19131
  const [candidate, ...remaining] = candidates;
17953
19132
  if (!candidate) {
@@ -17973,7 +19152,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
17973
19152
  const entries = await readdir4(vendorDir).catch(() => emptyStringArray);
17974
19153
  await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
17975
19154
  const webPath = `/${framework}/vendor/${entry}`;
17976
- const bytes = await Bun.file(resolve30(vendorDir, entry)).bytes();
19155
+ const bytes = await Bun.file(resolve31(vendorDir, entry)).bytes();
17977
19156
  assetStore.set(webPath, bytes);
17978
19157
  }));
17979
19158
  }, devBuild = async (config) => {
@@ -18008,6 +19187,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
18008
19187
  if (config.vueDirectory) {
18009
19188
  setVueVendorPaths(computeVueVendorPaths());
18010
19189
  }
19190
+ if (config.emberDirectory) {
19191
+ setEmberVendorPaths(computeEmberVendorPaths());
19192
+ }
18011
19193
  const sourceDirs = collectDepVendorSourceDirs(config);
18012
19194
  if (config.angularDirectory) {
18013
19195
  setAngularVendorPaths(await computeAngularVendorPathsAsync(sourceDirs));
@@ -18039,18 +19221,19 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
18039
19221
  cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
18040
19222
  recordStep("populate asset store", stepStartedAt);
18041
19223
  stepStartedAt = performance.now();
18042
- const reactVendorDir = resolve30(state.resolvedPaths.buildDir, "react", "vendor");
18043
- const angularVendorDir = resolve30(state.resolvedPaths.buildDir, "angular", "vendor");
18044
- const svelteVendorDir = resolve30(state.resolvedPaths.buildDir, "svelte", "vendor");
18045
- const vueVendorDir = resolve30(state.resolvedPaths.buildDir, "vue", "vendor");
18046
- const depVendorDir = resolve30(state.resolvedPaths.buildDir, "vendor");
19224
+ const reactVendorDir = resolve31(state.resolvedPaths.buildDir, "react", "vendor");
19225
+ const angularVendorDir = resolve31(state.resolvedPaths.buildDir, "angular", "vendor");
19226
+ const svelteVendorDir = resolve31(state.resolvedPaths.buildDir, "svelte", "vendor");
19227
+ const vueVendorDir = resolve31(state.resolvedPaths.buildDir, "vue", "vendor");
19228
+ const depVendorDir = resolve31(state.resolvedPaths.buildDir, "vendor");
18047
19229
  const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
18048
- const [, angularSpecs, angularServerSpecs, , , depPaths] = await Promise.all([
19230
+ const [, angularSpecs, angularServerSpecs, , , , depPaths] = await Promise.all([
18049
19231
  config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
18050
19232
  config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir, sourceDirs, true, Object.keys(globalThis.__depVendorPaths ?? {})) : Promise.resolve(undefined),
18051
19233
  config.angularDirectory ? buildAngularServerVendor(state.resolvedPaths.buildDir, sourceDirs, true) : Promise.resolve(undefined),
18052
19234
  config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
18053
19235
  config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
19236
+ config.emberDirectory ? buildEmberVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
18054
19237
  buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs)
18055
19238
  ]);
18056
19239
  if (angularSpecs)
@@ -18058,6 +19241,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
18058
19241
  if (angularServerSpecs) {
18059
19242
  setAngularServerVendorPaths(computeAngularServerVendorPaths(state.resolvedPaths.buildDir, angularServerSpecs));
18060
19243
  }
19244
+ if (config.emberDirectory) {
19245
+ setEmberVendorPaths(computeEmberVendorPaths());
19246
+ }
18061
19247
  globalThis.__depVendorPaths = depPaths;
18062
19248
  recordStep("build vendor bundles", stepStartedAt);
18063
19249
  stepStartedAt = performance.now();
@@ -18120,7 +19306,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
18120
19306
  manifest
18121
19307
  };
18122
19308
  globalThis.__hmrDevResult = result;
18123
- globalThis.__hmrServerMtime = statSync3(resolve30(Bun.main)).mtimeMs;
19309
+ globalThis.__hmrServerMtime = statSync3(resolve31(Bun.main)).mtimeMs;
18124
19310
  return result;
18125
19311
  };
18126
19312
  var init_devBuild = __esm(() => {
@@ -18129,6 +19315,7 @@ var init_devBuild = __esm(() => {
18129
19315
  init_buildAngularVendor();
18130
19316
  init_buildSvelteVendor();
18131
19317
  init_buildVueVendor();
19318
+ init_buildEmberVendor();
18132
19319
  init_clientManager();
18133
19320
  init_configResolver();
18134
19321
  init_dependencyGraph();
@@ -18156,5 +19343,5 @@ export {
18156
19343
  build
18157
19344
  };
18158
19345
 
18159
- //# debugId=4324F1891A28F01564756E2164756E21
19346
+ //# debugId=992CAE3480E7C45764756E2164756E21
18160
19347
  //# sourceMappingURL=build.js.map