@absolutejs/absolute 0.19.0-beta.840 → 0.19.0-beta.842
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +57 -54
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +57 -54
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +1618 -429
- package/dist/build.js.map +24 -16
- package/dist/cli/index.js +4 -2
- package/dist/dev/client/errorOverlay.ts +5 -7
- package/dist/index.js +1671 -477
- package/dist/index.js.map +26 -18
- package/dist/react/index.js +57 -53
- package/dist/react/index.js.map +6 -6
- package/dist/react/server.js +57 -53
- package/dist/react/server.js.map +6 -6
- package/dist/src/build/buildEmberVendor.d.ts +24 -0
- package/dist/src/build/compileEmber.d.ts +43 -0
- package/dist/src/build/vendorEntrySource.d.ts +1 -26
- package/dist/src/build/vueAutoRouterTransform.d.ts +1 -0
- package/dist/src/core/devVendorPaths.d.ts +2 -0
- package/dist/src/dev/configResolver.d.ts +1 -0
- package/dist/src/dev/pathUtils.d.ts +1 -1
- package/dist/src/ember/browser.d.ts +24 -0
- package/dist/src/ember/index.d.ts +2 -0
- package/dist/src/ember/pageHandler.d.ts +35 -0
- package/dist/src/ember/server.d.ts +2 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/vue/browser.d.ts +2 -0
- package/dist/src/vue/defineVuePage.d.ts +5 -0
- package/dist/src/vue/index.d.ts +2 -0
- package/dist/svelte/index.js +57 -53
- package/dist/svelte/index.js.map +5 -5
- package/dist/svelte/router/Router.svelte +1 -3
- package/dist/svelte/server.js +57 -53
- package/dist/svelte/server.js.map +5 -5
- package/dist/types/build.d.ts +1 -0
- package/dist/types/conventions.d.ts +1 -0
- package/dist/types/ember.d.ts +41 -0
- package/dist/types/island.d.ts +3 -2
- package/dist/types/vue.d.ts +28 -1
- package/dist/vue/browser.js +4 -1
- package/dist/vue/browser.js.map +5 -4
- package/dist/vue/index.js +62 -53
- package/dist/vue/index.js.map +7 -6
- package/dist/vue/server.js +59 -53
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8246,6 +8246,7 @@ import { readFileSync as readFileSync7 } from "fs";
|
|
|
8246
8246
|
import { dirname as dirname7, resolve as resolve9 } from "path";
|
|
8247
8247
|
var pagePatterns, getPageDirs = (config) => [
|
|
8248
8248
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
8249
|
+
{ dir: config.emberDirectory, framework: "ember" },
|
|
8249
8250
|
{ dir: config.reactDirectory, framework: "react" },
|
|
8250
8251
|
{ dir: config.svelteDirectory, framework: "svelte" },
|
|
8251
8252
|
{ dir: config.vueDirectory, framework: "vue" },
|
|
@@ -8305,6 +8306,7 @@ var init_pageMetadata = __esm(() => {
|
|
|
8305
8306
|
init_sourceMetadata();
|
|
8306
8307
|
pagePatterns = {
|
|
8307
8308
|
angular: "pages/**/*.{ts,js}",
|
|
8309
|
+
ember: "pages/**/*.{gjs,gts,ts,js}",
|
|
8308
8310
|
html: "pages/**/*.html",
|
|
8309
8311
|
htmx: "pages/**/*.html",
|
|
8310
8312
|
react: "pages/**/*.{ts,tsx,js,jsx}",
|
|
@@ -9666,11 +9668,13 @@ var exports_devVendorPaths = {};
|
|
|
9666
9668
|
__export(exports_devVendorPaths, {
|
|
9667
9669
|
setVueVendorPaths: () => setVueVendorPaths,
|
|
9668
9670
|
setSvelteVendorPaths: () => setSvelteVendorPaths,
|
|
9671
|
+
setEmberVendorPaths: () => setEmberVendorPaths,
|
|
9669
9672
|
setDevVendorPaths: () => setDevVendorPaths,
|
|
9670
9673
|
setAngularVendorPaths: () => setAngularVendorPaths,
|
|
9671
9674
|
setAngularServerVendorPaths: () => setAngularServerVendorPaths,
|
|
9672
9675
|
getVueVendorPaths: () => getVueVendorPaths,
|
|
9673
9676
|
getSvelteVendorPaths: () => getSvelteVendorPaths,
|
|
9677
|
+
getEmberVendorPaths: () => getEmberVendorPaths,
|
|
9674
9678
|
getDevVendorPaths: () => getDevVendorPaths,
|
|
9675
9679
|
getAngularVendorPaths: () => getAngularVendorPaths,
|
|
9676
9680
|
getAngularServerVendorPaths: () => getAngularServerVendorPaths
|
|
@@ -9685,6 +9689,8 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
9685
9689
|
svelteVendorPaths = paths;
|
|
9686
9690
|
}, vueVendorPaths = null, getVueVendorPaths = () => vueVendorPaths, setVueVendorPaths = (paths) => {
|
|
9687
9691
|
vueVendorPaths = paths;
|
|
9692
|
+
}, emberVendorPaths = null, getEmberVendorPaths = () => emberVendorPaths, setEmberVendorPaths = (paths) => {
|
|
9693
|
+
emberVendorPaths = paths;
|
|
9688
9694
|
};
|
|
9689
9695
|
|
|
9690
9696
|
// src/build/angularLinkerPlugin.ts
|
|
@@ -10349,6 +10355,57 @@ var init_compileSvelte = __esm(() => {
|
|
|
10349
10355
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
10350
10356
|
});
|
|
10351
10357
|
|
|
10358
|
+
// src/build/vueAutoRouterTransform.ts
|
|
10359
|
+
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL = "__ABSOLUTE_AUTO_ROUTER__", SETUP_APP_DECLARATION_REGEX, SETUP_APP_FUNCTION_REGEX, addAutoRouterSetupApp = (sourceContent) => {
|
|
10360
|
+
if (!ROUTES_EXPORT_REGEX.test(sourceContent))
|
|
10361
|
+
return sourceContent;
|
|
10362
|
+
const match = SCRIPT_REGEX.exec(sourceContent);
|
|
10363
|
+
if (!match)
|
|
10364
|
+
return sourceContent;
|
|
10365
|
+
const [, openTag, scriptBody, closeTag] = match;
|
|
10366
|
+
if (!openTag || scriptBody === undefined || !closeTag)
|
|
10367
|
+
return sourceContent;
|
|
10368
|
+
if (scriptBody.includes(SENTINEL))
|
|
10369
|
+
return sourceContent;
|
|
10370
|
+
let rewrittenScript = scriptBody.replace(SETUP_APP_DECLARATION_REGEX, "const __absoluteUserSetupApp__");
|
|
10371
|
+
rewrittenScript = rewrittenScript.replace(SETUP_APP_FUNCTION_REGEX, "$1 __absoluteUserSetupApp__");
|
|
10372
|
+
const userHadSetupApp = rewrittenScript !== scriptBody;
|
|
10373
|
+
const autoWrapper = `
|
|
10374
|
+
// ${SENTINEL} \u2014 generated by AbsoluteJS because this page exports
|
|
10375
|
+
// \`routes\`. Owns the vue-router lifecycle (history pick, app.use,
|
|
10376
|
+
// push, isReady) so user code stays declarative.
|
|
10377
|
+
import {
|
|
10378
|
+
createRouter as __absoluteCreateRouter__,
|
|
10379
|
+
createMemoryHistory as __absoluteCreateMemoryHistory__,
|
|
10380
|
+
createWebHistory as __absoluteCreateWebHistory__,
|
|
10381
|
+
} from 'vue-router';
|
|
10382
|
+
${userHadSetupApp ? "" : "const __absoluteUserSetupApp__ = null;"}
|
|
10383
|
+
export const setupApp = async (app, ctx) => {
|
|
10384
|
+
const router = __absoluteCreateRouter__({
|
|
10385
|
+
history: ctx.isServer
|
|
10386
|
+
? __absoluteCreateMemoryHistory__()
|
|
10387
|
+
: __absoluteCreateWebHistory__(),
|
|
10388
|
+
routes,
|
|
10389
|
+
});
|
|
10390
|
+
app.use(router);
|
|
10391
|
+
if (ctx.isServer) {
|
|
10392
|
+
await router.push(ctx.url);
|
|
10393
|
+
}
|
|
10394
|
+
await router.isReady();
|
|
10395
|
+
if (__absoluteUserSetupApp__) {
|
|
10396
|
+
await __absoluteUserSetupApp__(app, { ...ctx, router });
|
|
10397
|
+
}
|
|
10398
|
+
};
|
|
10399
|
+
`;
|
|
10400
|
+
return sourceContent.replace(SCRIPT_REGEX, `${openTag}${rewrittenScript}${autoWrapper}${closeTag}`);
|
|
10401
|
+
};
|
|
10402
|
+
var init_vueAutoRouterTransform = __esm(() => {
|
|
10403
|
+
SCRIPT_REGEX = /(<script\b(?![^>]*\bsetup\b)[^>]*>)([\s\S]*?)(<\/script>)/;
|
|
10404
|
+
ROUTES_EXPORT_REGEX = /\bexport\s+(?:const|let|var)\s+routes\b/;
|
|
10405
|
+
SETUP_APP_DECLARATION_REGEX = /\bexport\s+(const|let|var)\s+setupApp\b/;
|
|
10406
|
+
SETUP_APP_FUNCTION_REGEX = /\bexport\s+(async\s+function|function)\s+setupApp\b/;
|
|
10407
|
+
});
|
|
10408
|
+
|
|
10352
10409
|
// src/build/compileVue.ts
|
|
10353
10410
|
var exports_compileVue = {};
|
|
10354
10411
|
__export(exports_compileVue, {
|
|
@@ -10454,7 +10511,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10454
10511
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
10455
10512
|
const fileBaseName = basename6(sourceFilePath, ".vue");
|
|
10456
10513
|
const componentId = toKebab(fileBaseName);
|
|
10457
|
-
const
|
|
10514
|
+
const rawSourceContent = await file3(sourceFilePath).text();
|
|
10515
|
+
const sourceContent = isEntryPoint ? addAutoRouterSetupApp(rawSourceContent) : rawSourceContent;
|
|
10458
10516
|
const islandMetadataExports = buildIslandMetadataExports(sourceContent);
|
|
10459
10517
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
10460
10518
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
@@ -10471,7 +10529,11 @@ var resolveDevClientDir3 = () => {
|
|
|
10471
10529
|
const changeType = detectVueChangeType(sourceFilePath, descriptor);
|
|
10472
10530
|
vueHmrMetadata.set(sourceFilePath, { changeType, hmrId });
|
|
10473
10531
|
const scriptSource = descriptor.scriptSetup?.content ?? descriptor.script?.content ?? "";
|
|
10474
|
-
const
|
|
10532
|
+
const moduleScriptSource = descriptor.script?.content && descriptor.scriptSetup ? descriptor.script.content : "";
|
|
10533
|
+
const importPaths = [
|
|
10534
|
+
...extractImports(scriptSource),
|
|
10535
|
+
...extractImports(moduleScriptSource)
|
|
10536
|
+
];
|
|
10475
10537
|
const resolvedPackageVueImports = new Map;
|
|
10476
10538
|
const bareImports = importPaths.filter((p2) => !p2.startsWith(".") && !p2.startsWith("/"));
|
|
10477
10539
|
for (const importPath of bareImports) {
|
|
@@ -10672,16 +10734,26 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10672
10734
|
'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty);',
|
|
10673
10735
|
"const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
|
|
10674
10736
|
"",
|
|
10675
|
-
"//
|
|
10676
|
-
"//
|
|
10677
|
-
|
|
10678
|
-
"//
|
|
10737
|
+
"// `setupApp` hook. Reflect.get hides the lookup from Bun's",
|
|
10738
|
+
"// static analyzer so non-SPA pages without it don't trigger",
|
|
10739
|
+
'// "always undefined" warnings. Pages that export `routes`',
|
|
10740
|
+
"// have their setupApp auto-synthesized at compile time by",
|
|
10741
|
+
"// compileVue (see addAutoRouterSetupApp below) \u2014 that wrapper",
|
|
10742
|
+
"// uses the page-bundle's own vue-router instance so",
|
|
10743
|
+
"// provide/inject symbols match between the router and the",
|
|
10744
|
+
"// page's `useRoute()` calls.",
|
|
10745
|
+
'const setupAppHook = Reflect.get(PageModule, "setupApp");',
|
|
10679
10746
|
"async function bootstrapApp() {",
|
|
10680
|
-
' if (typeof
|
|
10747
|
+
' if (typeof setupAppHook === "function") {',
|
|
10681
10748
|
' const clientUrl = typeof window !== "undefined"',
|
|
10682
10749
|
" ? window.location.pathname + window.location.search",
|
|
10683
10750
|
' : "/";',
|
|
10684
|
-
" await
|
|
10751
|
+
" await setupAppHook(app, {",
|
|
10752
|
+
" isServer: false,",
|
|
10753
|
+
" router: null,",
|
|
10754
|
+
" setRedirect: () => {},",
|
|
10755
|
+
" url: clientUrl",
|
|
10756
|
+
" });",
|
|
10685
10757
|
" }",
|
|
10686
10758
|
' app.mount("#root");',
|
|
10687
10759
|
"}",
|
|
@@ -10790,6 +10862,7 @@ var init_compileVue = __esm(() => {
|
|
|
10790
10862
|
init_constants();
|
|
10791
10863
|
init_resolvePackageImport();
|
|
10792
10864
|
init_sourceMetadata();
|
|
10865
|
+
init_vueAutoRouterTransform();
|
|
10793
10866
|
init_stylePreprocessor();
|
|
10794
10867
|
devClientDir3 = resolveDevClientDir3();
|
|
10795
10868
|
hmrClientPath4 = join16(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
@@ -12465,31 +12538,723 @@ var init_compileAngular = __esm(() => {
|
|
|
12465
12538
|
wrapperOutputCache = new Map;
|
|
12466
12539
|
});
|
|
12467
12540
|
|
|
12541
|
+
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
12542
|
+
var require_content_tag = __commonJS((exports, module) => {
|
|
12543
|
+
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/content-tag/pkg/node";
|
|
12544
|
+
var imports = {};
|
|
12545
|
+
imports["__wbindgen_placeholder__"] = exports;
|
|
12546
|
+
var wasm;
|
|
12547
|
+
var { TextDecoder: TextDecoder2, TextEncoder: TextEncoder2 } = __require("util");
|
|
12548
|
+
var cachedTextDecoder = new TextDecoder2("utf-8", { ignoreBOM: true, fatal: true });
|
|
12549
|
+
cachedTextDecoder.decode();
|
|
12550
|
+
var cachedUint8ArrayMemory0 = null;
|
|
12551
|
+
function getUint8ArrayMemory0() {
|
|
12552
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
12553
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12554
|
+
}
|
|
12555
|
+
return cachedUint8ArrayMemory0;
|
|
12556
|
+
}
|
|
12557
|
+
function getStringFromWasm0(ptr2, len) {
|
|
12558
|
+
ptr2 = ptr2 >>> 0;
|
|
12559
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr2, ptr2 + len));
|
|
12560
|
+
}
|
|
12561
|
+
function debugString(val) {
|
|
12562
|
+
const type = typeof val;
|
|
12563
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
12564
|
+
return `${val}`;
|
|
12565
|
+
}
|
|
12566
|
+
if (type == "string") {
|
|
12567
|
+
return `"${val}"`;
|
|
12568
|
+
}
|
|
12569
|
+
if (type == "symbol") {
|
|
12570
|
+
const description = val.description;
|
|
12571
|
+
if (description == null) {
|
|
12572
|
+
return "Symbol";
|
|
12573
|
+
} else {
|
|
12574
|
+
return `Symbol(${description})`;
|
|
12575
|
+
}
|
|
12576
|
+
}
|
|
12577
|
+
if (type == "function") {
|
|
12578
|
+
const name = val.name;
|
|
12579
|
+
if (typeof name == "string" && name.length > 0) {
|
|
12580
|
+
return `Function(${name})`;
|
|
12581
|
+
} else {
|
|
12582
|
+
return "Function";
|
|
12583
|
+
}
|
|
12584
|
+
}
|
|
12585
|
+
if (Array.isArray(val)) {
|
|
12586
|
+
const length = val.length;
|
|
12587
|
+
let debug = "[";
|
|
12588
|
+
if (length > 0) {
|
|
12589
|
+
debug += debugString(val[0]);
|
|
12590
|
+
}
|
|
12591
|
+
for (let i = 1;i < length; i++) {
|
|
12592
|
+
debug += ", " + debugString(val[i]);
|
|
12593
|
+
}
|
|
12594
|
+
debug += "]";
|
|
12595
|
+
return debug;
|
|
12596
|
+
}
|
|
12597
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
12598
|
+
let className;
|
|
12599
|
+
if (builtInMatches.length > 1) {
|
|
12600
|
+
className = builtInMatches[1];
|
|
12601
|
+
} else {
|
|
12602
|
+
return toString.call(val);
|
|
12603
|
+
}
|
|
12604
|
+
if (className == "Object") {
|
|
12605
|
+
try {
|
|
12606
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
12607
|
+
} catch (_2) {
|
|
12608
|
+
return "Object";
|
|
12609
|
+
}
|
|
12610
|
+
}
|
|
12611
|
+
if (val instanceof Error) {
|
|
12612
|
+
return `${val.name}: ${val.message}
|
|
12613
|
+
${val.stack}`;
|
|
12614
|
+
}
|
|
12615
|
+
return className;
|
|
12616
|
+
}
|
|
12617
|
+
var WASM_VECTOR_LEN = 0;
|
|
12618
|
+
var cachedTextEncoder = new TextEncoder2("utf-8");
|
|
12619
|
+
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
12620
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
12621
|
+
} : function(arg, view) {
|
|
12622
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
12623
|
+
view.set(buf);
|
|
12624
|
+
return {
|
|
12625
|
+
read: arg.length,
|
|
12626
|
+
written: buf.length
|
|
12627
|
+
};
|
|
12628
|
+
};
|
|
12629
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
12630
|
+
if (realloc === undefined) {
|
|
12631
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
12632
|
+
const ptr3 = malloc(buf.length, 1) >>> 0;
|
|
12633
|
+
getUint8ArrayMemory0().subarray(ptr3, ptr3 + buf.length).set(buf);
|
|
12634
|
+
WASM_VECTOR_LEN = buf.length;
|
|
12635
|
+
return ptr3;
|
|
12636
|
+
}
|
|
12637
|
+
let len = arg.length;
|
|
12638
|
+
let ptr2 = malloc(len, 1) >>> 0;
|
|
12639
|
+
const mem = getUint8ArrayMemory0();
|
|
12640
|
+
let offset = 0;
|
|
12641
|
+
for (;offset < len; offset++) {
|
|
12642
|
+
const code = arg.charCodeAt(offset);
|
|
12643
|
+
if (code > 127)
|
|
12644
|
+
break;
|
|
12645
|
+
mem[ptr2 + offset] = code;
|
|
12646
|
+
}
|
|
12647
|
+
if (offset !== len) {
|
|
12648
|
+
if (offset !== 0) {
|
|
12649
|
+
arg = arg.slice(offset);
|
|
12650
|
+
}
|
|
12651
|
+
ptr2 = realloc(ptr2, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
12652
|
+
const view = getUint8ArrayMemory0().subarray(ptr2 + offset, ptr2 + len);
|
|
12653
|
+
const ret = encodeString(arg, view);
|
|
12654
|
+
offset += ret.written;
|
|
12655
|
+
ptr2 = realloc(ptr2, len, offset, 1) >>> 0;
|
|
12656
|
+
}
|
|
12657
|
+
WASM_VECTOR_LEN = offset;
|
|
12658
|
+
return ptr2;
|
|
12659
|
+
}
|
|
12660
|
+
var cachedDataViewMemory0 = null;
|
|
12661
|
+
function getDataViewMemory0() {
|
|
12662
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
12663
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
12664
|
+
}
|
|
12665
|
+
return cachedDataViewMemory0;
|
|
12666
|
+
}
|
|
12667
|
+
function notDefined(what) {
|
|
12668
|
+
return () => {
|
|
12669
|
+
throw new Error(`${what} is not defined`);
|
|
12670
|
+
};
|
|
12671
|
+
}
|
|
12672
|
+
function takeFromExternrefTable0(idx) {
|
|
12673
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
12674
|
+
wasm.__externref_table_dealloc(idx);
|
|
12675
|
+
return value;
|
|
12676
|
+
}
|
|
12677
|
+
function addToExternrefTable0(obj) {
|
|
12678
|
+
const idx = wasm.__externref_table_alloc();
|
|
12679
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
12680
|
+
return idx;
|
|
12681
|
+
}
|
|
12682
|
+
function handleError(f2, args) {
|
|
12683
|
+
try {
|
|
12684
|
+
return f2.apply(this, args);
|
|
12685
|
+
} catch (e) {
|
|
12686
|
+
const idx = addToExternrefTable0(e);
|
|
12687
|
+
wasm.__wbindgen_exn_store(idx);
|
|
12688
|
+
}
|
|
12689
|
+
}
|
|
12690
|
+
var CodeMapPairFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr2) => wasm.__wbg_codemappair_free(ptr2 >>> 0, 1));
|
|
12691
|
+
|
|
12692
|
+
class CodeMapPair {
|
|
12693
|
+
static __wrap(ptr2) {
|
|
12694
|
+
ptr2 = ptr2 >>> 0;
|
|
12695
|
+
const obj = Object.create(CodeMapPair.prototype);
|
|
12696
|
+
obj.__wbg_ptr = ptr2;
|
|
12697
|
+
CodeMapPairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
12698
|
+
return obj;
|
|
12699
|
+
}
|
|
12700
|
+
__destroy_into_raw() {
|
|
12701
|
+
const ptr2 = this.__wbg_ptr;
|
|
12702
|
+
this.__wbg_ptr = 0;
|
|
12703
|
+
CodeMapPairFinalization.unregister(this);
|
|
12704
|
+
return ptr2;
|
|
12705
|
+
}
|
|
12706
|
+
free() {
|
|
12707
|
+
const ptr2 = this.__destroy_into_raw();
|
|
12708
|
+
wasm.__wbg_codemappair_free(ptr2, 0);
|
|
12709
|
+
}
|
|
12710
|
+
get code() {
|
|
12711
|
+
let deferred1_0;
|
|
12712
|
+
let deferred1_1;
|
|
12713
|
+
try {
|
|
12714
|
+
const ret = wasm.__wbg_get_codemappair_code(this.__wbg_ptr);
|
|
12715
|
+
deferred1_0 = ret[0];
|
|
12716
|
+
deferred1_1 = ret[1];
|
|
12717
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12718
|
+
} finally {
|
|
12719
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12720
|
+
}
|
|
12721
|
+
}
|
|
12722
|
+
set code(arg0) {
|
|
12723
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12724
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12725
|
+
wasm.__wbg_set_codemappair_code(this.__wbg_ptr, ptr0, len0);
|
|
12726
|
+
}
|
|
12727
|
+
get map() {
|
|
12728
|
+
let deferred1_0;
|
|
12729
|
+
let deferred1_1;
|
|
12730
|
+
try {
|
|
12731
|
+
const ret = wasm.__wbg_get_codemappair_map(this.__wbg_ptr);
|
|
12732
|
+
deferred1_0 = ret[0];
|
|
12733
|
+
deferred1_1 = ret[1];
|
|
12734
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12735
|
+
} finally {
|
|
12736
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12737
|
+
}
|
|
12738
|
+
}
|
|
12739
|
+
set map(arg0) {
|
|
12740
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12741
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12742
|
+
wasm.__wbg_set_codemappair_map(this.__wbg_ptr, ptr0, len0);
|
|
12743
|
+
}
|
|
12744
|
+
constructor(code, map) {
|
|
12745
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12746
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12747
|
+
const ptr1 = passStringToWasm0(map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12748
|
+
const len1 = WASM_VECTOR_LEN;
|
|
12749
|
+
const ret = wasm.codemappair_new(ptr0, len0, ptr1, len1);
|
|
12750
|
+
this.__wbg_ptr = ret >>> 0;
|
|
12751
|
+
CodeMapPairFinalization.register(this, this.__wbg_ptr, this);
|
|
12752
|
+
return this;
|
|
12753
|
+
}
|
|
12754
|
+
}
|
|
12755
|
+
exports.CodeMapPair = CodeMapPair;
|
|
12756
|
+
var PreprocessorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr2) => wasm.__wbg_preprocessor_free(ptr2 >>> 0, 1));
|
|
12757
|
+
|
|
12758
|
+
class Preprocessor {
|
|
12759
|
+
__destroy_into_raw() {
|
|
12760
|
+
const ptr2 = this.__wbg_ptr;
|
|
12761
|
+
this.__wbg_ptr = 0;
|
|
12762
|
+
PreprocessorFinalization.unregister(this);
|
|
12763
|
+
return ptr2;
|
|
12764
|
+
}
|
|
12765
|
+
free() {
|
|
12766
|
+
const ptr2 = this.__destroy_into_raw();
|
|
12767
|
+
wasm.__wbg_preprocessor_free(ptr2, 0);
|
|
12768
|
+
}
|
|
12769
|
+
constructor() {
|
|
12770
|
+
const ret = wasm.preprocessor_new();
|
|
12771
|
+
this.__wbg_ptr = ret >>> 0;
|
|
12772
|
+
PreprocessorFinalization.register(this, this.__wbg_ptr, this);
|
|
12773
|
+
return this;
|
|
12774
|
+
}
|
|
12775
|
+
process(src, options) {
|
|
12776
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12777
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12778
|
+
const ret = wasm.preprocessor_process(this.__wbg_ptr, ptr0, len0, options);
|
|
12779
|
+
if (ret[2]) {
|
|
12780
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12781
|
+
}
|
|
12782
|
+
return CodeMapPair.__wrap(ret[0]);
|
|
12783
|
+
}
|
|
12784
|
+
parse(src, options) {
|
|
12785
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12786
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12787
|
+
const ret = wasm.preprocessor_parse(this.__wbg_ptr, ptr0, len0, options);
|
|
12788
|
+
if (ret[2]) {
|
|
12789
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12790
|
+
}
|
|
12791
|
+
return takeFromExternrefTable0(ret[0]);
|
|
12792
|
+
}
|
|
12793
|
+
}
|
|
12794
|
+
exports.Preprocessor = Preprocessor;
|
|
12795
|
+
exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
12796
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
12797
|
+
return ret;
|
|
12798
|
+
};
|
|
12799
|
+
exports.__wbg_String_d7c955520b66a733 = function(arg0, arg1) {
|
|
12800
|
+
const ret = String(arg1);
|
|
12801
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12802
|
+
const len1 = WASM_VECTOR_LEN;
|
|
12803
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
12804
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
12805
|
+
};
|
|
12806
|
+
exports.__wbg_Error_58015c683709e145 = typeof Error == "function" ? Error : notDefined("Error");
|
|
12807
|
+
exports.__wbg_Boolean_ef3e29efb4629824 = typeof Boolean == "function" ? Boolean : notDefined("Boolean");
|
|
12808
|
+
exports.__wbg_parse_181a91d066d1f7fe = typeof JSON.parse == "function" ? JSON.parse : notDefined("JSON.parse");
|
|
12809
|
+
exports.__wbindgen_is_object = function(arg0) {
|
|
12810
|
+
const val = arg0;
|
|
12811
|
+
const ret = typeof val === "object" && val !== null;
|
|
12812
|
+
return ret;
|
|
12813
|
+
};
|
|
12814
|
+
exports.__wbg_crypto_c48a774b022d20ac = function(arg0) {
|
|
12815
|
+
const ret = arg0.crypto;
|
|
12816
|
+
return ret;
|
|
12817
|
+
};
|
|
12818
|
+
exports.__wbg_process_298734cf255a885d = function(arg0) {
|
|
12819
|
+
const ret = arg0.process;
|
|
12820
|
+
return ret;
|
|
12821
|
+
};
|
|
12822
|
+
exports.__wbg_versions_e2e78e134e3e5d01 = function(arg0) {
|
|
12823
|
+
const ret = arg0.versions;
|
|
12824
|
+
return ret;
|
|
12825
|
+
};
|
|
12826
|
+
exports.__wbg_node_1cd7a5d853dbea79 = function(arg0) {
|
|
12827
|
+
const ret = arg0.node;
|
|
12828
|
+
return ret;
|
|
12829
|
+
};
|
|
12830
|
+
exports.__wbindgen_is_string = function(arg0) {
|
|
12831
|
+
const ret = typeof arg0 === "string";
|
|
12832
|
+
return ret;
|
|
12833
|
+
};
|
|
12834
|
+
exports.__wbg_require_8f08ceecec0f4fee = function() {
|
|
12835
|
+
return handleError(function() {
|
|
12836
|
+
const ret = module.require;
|
|
12837
|
+
return ret;
|
|
12838
|
+
}, arguments);
|
|
12839
|
+
};
|
|
12840
|
+
exports.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) {
|
|
12841
|
+
const ret = arg0.msCrypto;
|
|
12842
|
+
return ret;
|
|
12843
|
+
};
|
|
12844
|
+
exports.__wbg_randomFillSync_dc1e9a60c158336d = function() {
|
|
12845
|
+
return handleError(function(arg0, arg1) {
|
|
12846
|
+
arg0.randomFillSync(arg1);
|
|
12847
|
+
}, arguments);
|
|
12848
|
+
};
|
|
12849
|
+
exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() {
|
|
12850
|
+
return handleError(function(arg0, arg1) {
|
|
12851
|
+
arg0.getRandomValues(arg1);
|
|
12852
|
+
}, arguments);
|
|
12853
|
+
};
|
|
12854
|
+
exports.__wbindgen_is_function = function(arg0) {
|
|
12855
|
+
const ret = typeof arg0 === "function";
|
|
12856
|
+
return ret;
|
|
12857
|
+
};
|
|
12858
|
+
exports.__wbg_self_1ff1d729e9aae938 = function() {
|
|
12859
|
+
return handleError(function() {
|
|
12860
|
+
const ret = self.self;
|
|
12861
|
+
return ret;
|
|
12862
|
+
}, arguments);
|
|
12863
|
+
};
|
|
12864
|
+
exports.__wbg_window_5f4faef6c12b79ec = function() {
|
|
12865
|
+
return handleError(function() {
|
|
12866
|
+
const ret = window.window;
|
|
12867
|
+
return ret;
|
|
12868
|
+
}, arguments);
|
|
12869
|
+
};
|
|
12870
|
+
exports.__wbg_globalThis_1d39714405582d3c = function() {
|
|
12871
|
+
return handleError(function() {
|
|
12872
|
+
const ret = globalThis.globalThis;
|
|
12873
|
+
return ret;
|
|
12874
|
+
}, arguments);
|
|
12875
|
+
};
|
|
12876
|
+
exports.__wbg_global_651f05c6a0944d1c = function() {
|
|
12877
|
+
return handleError(function() {
|
|
12878
|
+
const ret = global.global;
|
|
12879
|
+
return ret;
|
|
12880
|
+
}, arguments);
|
|
12881
|
+
};
|
|
12882
|
+
exports.__wbindgen_is_undefined = function(arg0) {
|
|
12883
|
+
const ret = arg0 === undefined;
|
|
12884
|
+
return ret;
|
|
12885
|
+
};
|
|
12886
|
+
exports.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
|
|
12887
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
12888
|
+
return ret;
|
|
12889
|
+
};
|
|
12890
|
+
exports.__wbg_call_cb65541d95d71282 = function() {
|
|
12891
|
+
return handleError(function(arg0, arg1) {
|
|
12892
|
+
const ret = arg0.call(arg1);
|
|
12893
|
+
return ret;
|
|
12894
|
+
}, arguments);
|
|
12895
|
+
};
|
|
12896
|
+
exports.__wbg_call_01734de55d61e11d = function() {
|
|
12897
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
12898
|
+
const ret = arg0.call(arg1, arg2);
|
|
12899
|
+
return ret;
|
|
12900
|
+
}, arguments);
|
|
12901
|
+
};
|
|
12902
|
+
exports.__wbg_get_97b561fb56f034b5 = function() {
|
|
12903
|
+
return handleError(function(arg0, arg1) {
|
|
12904
|
+
const ret = Reflect.get(arg0, arg1);
|
|
12905
|
+
return ret;
|
|
12906
|
+
}, arguments);
|
|
12907
|
+
};
|
|
12908
|
+
exports.__wbg_set_092e06b0f9d71865 = function() {
|
|
12909
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
12910
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
12911
|
+
return ret;
|
|
12912
|
+
}, arguments);
|
|
12913
|
+
};
|
|
12914
|
+
exports.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
|
12915
|
+
const ret = arg0.buffer;
|
|
12916
|
+
return ret;
|
|
12917
|
+
};
|
|
12918
|
+
exports.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
|
|
12919
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
12920
|
+
return ret;
|
|
12921
|
+
};
|
|
12922
|
+
exports.__wbg_new_8125e318e6245eed = function(arg0) {
|
|
12923
|
+
const ret = new Uint8Array(arg0);
|
|
12924
|
+
return ret;
|
|
12925
|
+
};
|
|
12926
|
+
exports.__wbg_newwithlength_e5d69174d6984cd7 = function(arg0) {
|
|
12927
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
12928
|
+
return ret;
|
|
12929
|
+
};
|
|
12930
|
+
exports.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) {
|
|
12931
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
12932
|
+
return ret;
|
|
12933
|
+
};
|
|
12934
|
+
exports.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
|
|
12935
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
12936
|
+
};
|
|
12937
|
+
exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
12938
|
+
const ret = debugString(arg1);
|
|
12939
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12940
|
+
const len1 = WASM_VECTOR_LEN;
|
|
12941
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
12942
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
12943
|
+
};
|
|
12944
|
+
exports.__wbindgen_throw = function(arg0, arg1) {
|
|
12945
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
12946
|
+
};
|
|
12947
|
+
exports.__wbindgen_memory = function() {
|
|
12948
|
+
const ret = wasm.memory;
|
|
12949
|
+
return ret;
|
|
12950
|
+
};
|
|
12951
|
+
exports.__wbindgen_init_externref_table = function() {
|
|
12952
|
+
const table = wasm.__wbindgen_export_2;
|
|
12953
|
+
const offset = table.grow(4);
|
|
12954
|
+
table.set(0, undefined);
|
|
12955
|
+
table.set(offset + 0, undefined);
|
|
12956
|
+
table.set(offset + 1, null);
|
|
12957
|
+
table.set(offset + 2, true);
|
|
12958
|
+
table.set(offset + 3, false);
|
|
12959
|
+
};
|
|
12960
|
+
var path = __require("path").join(__dirname, "content_tag_bg.wasm");
|
|
12961
|
+
var bytes = __require("fs").readFileSync(path);
|
|
12962
|
+
var wasmModule = new WebAssembly.Module(bytes);
|
|
12963
|
+
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
12964
|
+
wasm = wasmInstance.exports;
|
|
12965
|
+
exports.__wasm = wasm;
|
|
12966
|
+
wasm.__wbindgen_start();
|
|
12967
|
+
});
|
|
12968
|
+
|
|
12969
|
+
// node_modules/content-tag/pkg/node.cjs
|
|
12970
|
+
var require_node = __commonJS((exports, module) => {
|
|
12971
|
+
var { Preprocessor } = require_content_tag();
|
|
12972
|
+
exports.Preprocessor = Preprocessor;
|
|
12973
|
+
});
|
|
12974
|
+
|
|
12975
|
+
// src/build/compileEmber.ts
|
|
12976
|
+
var exports_compileEmber = {};
|
|
12977
|
+
__export(exports_compileEmber, {
|
|
12978
|
+
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
12979
|
+
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
12980
|
+
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
12981
|
+
dirname: () => dirname14,
|
|
12982
|
+
compileEmberFileSource: () => compileEmberFileSource,
|
|
12983
|
+
compileEmberFile: () => compileEmberFile,
|
|
12984
|
+
compileEmber: () => compileEmber,
|
|
12985
|
+
clearEmberCompilerCache: () => clearEmberCompilerCache,
|
|
12986
|
+
basename: () => basename8
|
|
12987
|
+
});
|
|
12988
|
+
import { existsSync as existsSync18 } from "fs";
|
|
12989
|
+
import { mkdir as mkdir6, rm as rm5 } from "fs/promises";
|
|
12990
|
+
import { basename as basename8, dirname as dirname14, extname as extname6, join as join18, resolve as resolve20 } from "path";
|
|
12991
|
+
var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file4 } = globalThis.Bun;
|
|
12992
|
+
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
12993
|
+
if (cachedPreprocessor)
|
|
12994
|
+
return cachedPreprocessor;
|
|
12995
|
+
const module = await Promise.resolve().then(() => __toESM(require_node(), 1));
|
|
12996
|
+
cachedPreprocessor = new module.Preprocessor;
|
|
12997
|
+
return cachedPreprocessor;
|
|
12998
|
+
}, transpiler4, isTemplateTagFile = (entry) => {
|
|
12999
|
+
const ext = extname6(entry);
|
|
13000
|
+
return ext === ".gjs" || ext === ".gts";
|
|
13001
|
+
}, rewriteTemplateEvalToScope = (source) => {
|
|
13002
|
+
const importedNames = new Set;
|
|
13003
|
+
const importRegex = /^\s*import\s+(?:type\s+)?(?:(\*\s+as\s+\w+)|(\w+)(?:\s*,\s*\{([^}]+)\})?|\{([^}]+)\})\s+from\s+['"][^'"]+['"]/gm;
|
|
13004
|
+
let match;
|
|
13005
|
+
while ((match = importRegex.exec(source)) !== null) {
|
|
13006
|
+
const [, namespaceImport, defaultImport, namedAfterDefault, named] = match;
|
|
13007
|
+
if (namespaceImport) {
|
|
13008
|
+
const aliasMatch = /\*\s+as\s+(\w+)/.exec(namespaceImport);
|
|
13009
|
+
if (aliasMatch?.[1])
|
|
13010
|
+
importedNames.add(aliasMatch[1]);
|
|
13011
|
+
}
|
|
13012
|
+
if (defaultImport)
|
|
13013
|
+
importedNames.add(defaultImport);
|
|
13014
|
+
const namedList = named ?? namedAfterDefault;
|
|
13015
|
+
if (namedList) {
|
|
13016
|
+
for (const part of namedList.split(",")) {
|
|
13017
|
+
const trimmed = part.trim();
|
|
13018
|
+
if (!trimmed)
|
|
13019
|
+
continue;
|
|
13020
|
+
const asMatch = /\bas\s+(\w+)$/.exec(trimmed);
|
|
13021
|
+
const localName = asMatch ? asMatch[1] : trimmed.replace(/^type\s+/, "");
|
|
13022
|
+
if (localName && /^\w+$/.test(localName)) {
|
|
13023
|
+
importedNames.add(localName);
|
|
13024
|
+
}
|
|
13025
|
+
}
|
|
13026
|
+
}
|
|
13027
|
+
}
|
|
13028
|
+
const scopeObject = importedNames.size === 0 ? "{}" : `{ ${Array.from(importedNames).join(", ")} }`;
|
|
13029
|
+
const evalShim = /eval\s*\(\)\s*\{\s*return\s+eval\(arguments\[0\]\);\s*\}/g;
|
|
13030
|
+
return source.replace(evalShim, `scope() { return ${scopeObject}; }`);
|
|
13031
|
+
}, EMBROIDER_MACROS_SHIM_SOURCE = `const isProd = () => {
|
|
13032
|
+
try {
|
|
13033
|
+
return globalThis.process?.env?.NODE_ENV === 'production';
|
|
13034
|
+
} catch {
|
|
13035
|
+
return false;
|
|
13036
|
+
}
|
|
13037
|
+
};
|
|
13038
|
+
|
|
13039
|
+
export const each = (arr) => {
|
|
13040
|
+
if (!Array.isArray(arr)) {
|
|
13041
|
+
throw new Error('the argument to each() must be an array');
|
|
13042
|
+
}
|
|
13043
|
+
return arr;
|
|
13044
|
+
};
|
|
13045
|
+
export const macroCondition = (predicate) => predicate;
|
|
13046
|
+
export const isDevelopingApp = () => !isProd();
|
|
13047
|
+
export const isTesting = () => false;
|
|
13048
|
+
export const setTesting = () => {};
|
|
13049
|
+
export const dependencySatisfies = () => false;
|
|
13050
|
+
export const appEmberSatisfies = () => false;
|
|
13051
|
+
export const getConfig = () => undefined;
|
|
13052
|
+
export const getOwnConfig = () => undefined;
|
|
13053
|
+
export const getGlobalConfig = () => ({});
|
|
13054
|
+
export const config = () => undefined;
|
|
13055
|
+
export const failBuild = (msg) => { throw new Error('failBuild: ' + msg); };
|
|
13056
|
+
export const moduleExists = () => false;
|
|
13057
|
+
export const importSync = (specifier) => {
|
|
13058
|
+
throw new Error('importSync(' + specifier + '): not supported by the AbsoluteJS Ember adapter \u2014 use dynamic import() instead');
|
|
13059
|
+
};
|
|
13060
|
+
`, createEmberServerResolverPlugin = (cwd, options = {}) => ({
|
|
13061
|
+
name: "absolutejs-ember-server-resolver",
|
|
13062
|
+
setup(build2) {
|
|
13063
|
+
const standalonePackages = new Set([
|
|
13064
|
+
"@glimmer/component",
|
|
13065
|
+
"@glimmer/tracking",
|
|
13066
|
+
"@glimmer/env",
|
|
13067
|
+
"@simple-dom/serializer"
|
|
13068
|
+
]);
|
|
13069
|
+
build2.onResolve({ filter: /^@embroider\/macros$/ }, () => ({
|
|
13070
|
+
namespace: "absolutejs-ember-virtual",
|
|
13071
|
+
path: "embroider-macros-shim"
|
|
13072
|
+
}));
|
|
13073
|
+
build2.onLoad({
|
|
13074
|
+
filter: /^embroider-macros-shim$/,
|
|
13075
|
+
namespace: "absolutejs-ember-virtual"
|
|
13076
|
+
}, () => ({
|
|
13077
|
+
contents: EMBROIDER_MACROS_SHIM_SOURCE,
|
|
13078
|
+
loader: "js"
|
|
13079
|
+
}));
|
|
13080
|
+
const stagedSourceMap = options.stagedSourceMap;
|
|
13081
|
+
if (stagedSourceMap && stagedSourceMap.size > 0) {
|
|
13082
|
+
build2.onResolve({ filter: /^\.{1,2}\// }, (args) => {
|
|
13083
|
+
const originalImporter = stagedSourceMap.get(args.importer);
|
|
13084
|
+
if (!originalImporter)
|
|
13085
|
+
return;
|
|
13086
|
+
const candidateBase = resolve20(dirname14(originalImporter), args.path);
|
|
13087
|
+
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
13088
|
+
for (const ext of extensionsToTry) {
|
|
13089
|
+
const candidate = candidateBase + ext;
|
|
13090
|
+
if (existsSync18(candidate))
|
|
13091
|
+
return { path: candidate };
|
|
13092
|
+
}
|
|
13093
|
+
return;
|
|
13094
|
+
});
|
|
13095
|
+
}
|
|
13096
|
+
build2.onLoad({ filter: /\.(gts|gjs)$/ }, async (args) => {
|
|
13097
|
+
const source = await file4(args.path).text();
|
|
13098
|
+
const preprocessor = await getPreprocessor();
|
|
13099
|
+
const result = preprocessor.process(source, {
|
|
13100
|
+
filename: args.path
|
|
13101
|
+
});
|
|
13102
|
+
const rewritten = rewriteTemplateEvalToScope(result.code);
|
|
13103
|
+
const transpiled = transpiler4.transformSync(rewritten);
|
|
13104
|
+
return { contents: transpiled, loader: "js" };
|
|
13105
|
+
});
|
|
13106
|
+
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
13107
|
+
if (standalonePackages.has(args.path))
|
|
13108
|
+
return;
|
|
13109
|
+
const internal = join18(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
13110
|
+
if (existsSync18(internal))
|
|
13111
|
+
return { path: internal };
|
|
13112
|
+
return;
|
|
13113
|
+
});
|
|
13114
|
+
}
|
|
13115
|
+
}), generateServerHarness = (pageModulePath) => `import PageComponent from ${JSON.stringify(pageModulePath)};
|
|
13116
|
+
import { renderComponent } from '@ember/renderer';
|
|
13117
|
+
import Document from '@simple-dom/document';
|
|
13118
|
+
import Serializer from '@simple-dom/serializer';
|
|
13119
|
+
|
|
13120
|
+
const installSimpleDomGlobals = () => {
|
|
13121
|
+
const g = globalThis;
|
|
13122
|
+
if (typeof g.Element === 'undefined') g.Element = class Element {};
|
|
13123
|
+
if (typeof g.Node === 'undefined') g.Node = class Node {};
|
|
13124
|
+
};
|
|
13125
|
+
|
|
13126
|
+
export const renderToHTML = (props = {}) => {
|
|
13127
|
+
installSimpleDomGlobals();
|
|
13128
|
+
const doc = new Document();
|
|
13129
|
+
const root = doc.createElement('div');
|
|
13130
|
+
const result = renderComponent(PageComponent, {
|
|
13131
|
+
owner: {},
|
|
13132
|
+
env: { document: doc, hasDOM: true, isInteractive: false },
|
|
13133
|
+
into: root,
|
|
13134
|
+
args: props,
|
|
13135
|
+
});
|
|
13136
|
+
const serializer = new Serializer({});
|
|
13137
|
+
const html = serializer.serialize(root);
|
|
13138
|
+
result?.destroy?.();
|
|
13139
|
+
return html;
|
|
13140
|
+
};
|
|
13141
|
+
|
|
13142
|
+
export { PageComponent };
|
|
13143
|
+
export default PageComponent;
|
|
13144
|
+
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
13145
|
+
const resolvedEntry = resolve20(entry);
|
|
13146
|
+
const source = await file4(resolvedEntry).text();
|
|
13147
|
+
let preprocessed = source;
|
|
13148
|
+
if (isTemplateTagFile(resolvedEntry)) {
|
|
13149
|
+
const preprocessor = await getPreprocessor();
|
|
13150
|
+
const result = preprocessor.process(source, {
|
|
13151
|
+
filename: resolvedEntry
|
|
13152
|
+
});
|
|
13153
|
+
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13154
|
+
}
|
|
13155
|
+
const transpiled = transpiler4.transformSync(preprocessed);
|
|
13156
|
+
const baseName = basename8(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
13157
|
+
const tmpDir = join18(compiledRoot, "_tmp");
|
|
13158
|
+
const serverDir = join18(compiledRoot, "server");
|
|
13159
|
+
const clientDir = join18(compiledRoot, "client");
|
|
13160
|
+
await Promise.all([
|
|
13161
|
+
mkdir6(tmpDir, { recursive: true }),
|
|
13162
|
+
mkdir6(serverDir, { recursive: true }),
|
|
13163
|
+
mkdir6(clientDir, { recursive: true })
|
|
13164
|
+
]);
|
|
13165
|
+
const tmpPagePath = resolve20(join18(tmpDir, `${baseName}.module.js`));
|
|
13166
|
+
const tmpHarnessPath = resolve20(join18(tmpDir, `${baseName}.harness.js`));
|
|
13167
|
+
await Promise.all([
|
|
13168
|
+
write3(tmpPagePath, transpiled),
|
|
13169
|
+
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
13170
|
+
]);
|
|
13171
|
+
const stagedSourceMap = new Map([
|
|
13172
|
+
[tmpPagePath, resolvedEntry]
|
|
13173
|
+
]);
|
|
13174
|
+
const serverPath = join18(serverDir, `${baseName}.js`);
|
|
13175
|
+
const buildResult = await bunBuild2({
|
|
13176
|
+
entrypoints: [tmpHarnessPath],
|
|
13177
|
+
format: "esm",
|
|
13178
|
+
minify: false,
|
|
13179
|
+
naming: `${baseName}.js`,
|
|
13180
|
+
outdir: serverDir,
|
|
13181
|
+
plugins: [
|
|
13182
|
+
createEmberServerResolverPlugin(cwd, { stagedSourceMap })
|
|
13183
|
+
],
|
|
13184
|
+
target: "bun",
|
|
13185
|
+
throw: false
|
|
13186
|
+
});
|
|
13187
|
+
if (!buildResult.success) {
|
|
13188
|
+
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
13189
|
+
}
|
|
13190
|
+
await rm5(tmpDir, { force: true, recursive: true });
|
|
13191
|
+
const clientPath = join18(clientDir, `${baseName}.js`);
|
|
13192
|
+
await write3(clientPath, transpiled);
|
|
13193
|
+
return { clientPath, serverPath };
|
|
13194
|
+
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
13195
|
+
if (entries.length === 0) {
|
|
13196
|
+
return {
|
|
13197
|
+
clientPaths: [],
|
|
13198
|
+
serverPaths: []
|
|
13199
|
+
};
|
|
13200
|
+
}
|
|
13201
|
+
const compiledRoot = join18(emberDir, "generated");
|
|
13202
|
+
const outputs = await Promise.all(entries.map((entry) => compileEmberFile(entry, compiledRoot, cwd)));
|
|
13203
|
+
return {
|
|
13204
|
+
clientPaths: outputs.map((o) => o.clientPath),
|
|
13205
|
+
serverPaths: outputs.map((o) => o.serverPath)
|
|
13206
|
+
};
|
|
13207
|
+
}, compileEmberFileSource = async (entry) => {
|
|
13208
|
+
const resolvedEntry = resolve20(entry);
|
|
13209
|
+
const source = await file4(resolvedEntry).text();
|
|
13210
|
+
let preprocessed = source;
|
|
13211
|
+
if (isTemplateTagFile(resolvedEntry)) {
|
|
13212
|
+
const preprocessor = await getPreprocessor();
|
|
13213
|
+
const result = preprocessor.process(source, {
|
|
13214
|
+
filename: resolvedEntry
|
|
13215
|
+
});
|
|
13216
|
+
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
13217
|
+
}
|
|
13218
|
+
return transpiler4.transformSync(preprocessed);
|
|
13219
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (emberDir) => join18(emberDir, "generated"), getEmberServerCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join18(getEmberCompiledRoot(emberDir), "client");
|
|
13220
|
+
var init_compileEmber = __esm(() => {
|
|
13221
|
+
transpiler4 = new Transpiler3({
|
|
13222
|
+
loader: "ts",
|
|
13223
|
+
target: "browser",
|
|
13224
|
+
tsconfig: JSON.stringify({
|
|
13225
|
+
compilerOptions: {
|
|
13226
|
+
experimentalDecorators: true,
|
|
13227
|
+
useDefineForClassFields: false
|
|
13228
|
+
}
|
|
13229
|
+
})
|
|
13230
|
+
});
|
|
13231
|
+
});
|
|
13232
|
+
|
|
12468
13233
|
// src/build/buildReactVendor.ts
|
|
12469
13234
|
var exports_buildReactVendor = {};
|
|
12470
13235
|
__export(exports_buildReactVendor, {
|
|
12471
13236
|
computeVendorPaths: () => computeVendorPaths,
|
|
12472
13237
|
buildReactVendor: () => buildReactVendor
|
|
12473
13238
|
});
|
|
12474
|
-
import { existsSync as
|
|
12475
|
-
import { join as
|
|
12476
|
-
import { rm as
|
|
12477
|
-
var {build:
|
|
13239
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync6 } from "fs";
|
|
13240
|
+
import { join as join19, resolve as resolve21 } from "path";
|
|
13241
|
+
import { rm as rm6 } from "fs/promises";
|
|
13242
|
+
var {build: bunBuild3 } = globalThis.Bun;
|
|
12478
13243
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
12479
13244
|
const candidates = [
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
13245
|
+
resolve21(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
13246
|
+
resolve21(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13247
|
+
resolve21(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
13248
|
+
resolve21(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13249
|
+
resolve21(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
13250
|
+
resolve21(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
12486
13251
|
];
|
|
12487
13252
|
for (const candidate of candidates) {
|
|
12488
|
-
if (
|
|
13253
|
+
if (existsSync19(candidate)) {
|
|
12489
13254
|
return candidate.replace(/\\/g, "/");
|
|
12490
13255
|
}
|
|
12491
13256
|
}
|
|
12492
|
-
return (candidates[0] ??
|
|
13257
|
+
return (candidates[0] ?? resolve21(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
12493
13258
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
12494
13259
|
try {
|
|
12495
13260
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -12526,19 +13291,19 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12526
13291
|
`)}
|
|
12527
13292
|
`;
|
|
12528
13293
|
}, buildReactVendor = async (buildDir) => {
|
|
12529
|
-
const vendorDir =
|
|
13294
|
+
const vendorDir = join19(buildDir, "react", "vendor");
|
|
12530
13295
|
mkdirSync6(vendorDir, { recursive: true });
|
|
12531
|
-
const tmpDir =
|
|
13296
|
+
const tmpDir = join19(buildDir, "_vendor_tmp");
|
|
12532
13297
|
mkdirSync6(tmpDir, { recursive: true });
|
|
12533
13298
|
const specifiers = resolveVendorSpecifiers();
|
|
12534
13299
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12535
13300
|
const safeName = toSafeFileName(specifier);
|
|
12536
|
-
const entryPath =
|
|
13301
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
12537
13302
|
const source = await generateEntrySource(specifier);
|
|
12538
13303
|
await Bun.write(entryPath, source);
|
|
12539
13304
|
return entryPath;
|
|
12540
13305
|
}));
|
|
12541
|
-
const result = await
|
|
13306
|
+
const result = await bunBuild3({
|
|
12542
13307
|
entrypoints,
|
|
12543
13308
|
format: "esm",
|
|
12544
13309
|
minify: false,
|
|
@@ -12548,7 +13313,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12548
13313
|
target: "browser",
|
|
12549
13314
|
throw: false
|
|
12550
13315
|
});
|
|
12551
|
-
await
|
|
13316
|
+
await rm6(tmpDir, { force: true, recursive: true });
|
|
12552
13317
|
if (!result.success) {
|
|
12553
13318
|
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
12554
13319
|
}
|
|
@@ -12565,10 +13330,25 @@ var init_buildReactVendor = __esm(() => {
|
|
|
12565
13330
|
});
|
|
12566
13331
|
|
|
12567
13332
|
// src/build/vendorEntrySource.ts
|
|
12568
|
-
var generateVendorEntrySource = (specifier) =>
|
|
12569
|
-
|
|
12570
|
-
|
|
13333
|
+
var RESERVED_KEYS, VALID_IDENTIFIER, generateVendorEntrySource = async (specifier) => {
|
|
13334
|
+
const mod = await import(specifier);
|
|
13335
|
+
const exportKeys = Object.keys(mod).filter((key) => !RESERVED_KEYS.has(key) && VALID_IDENTIFIER.test(key));
|
|
13336
|
+
const explicitNamedExports = exportKeys.length > 0 ? `export { ${exportKeys.join(", ")} } from '${specifier}';
|
|
13337
|
+
` : "";
|
|
13338
|
+
return `import * as __abs_ns from '${specifier}';
|
|
13339
|
+
export * from '${specifier}';
|
|
13340
|
+
` + explicitNamedExports + `export default __abs_ns.default;
|
|
13341
|
+
export const __ABSOLUTE_VENDOR_NAMESPACE__ = __abs_ns;
|
|
12571
13342
|
`;
|
|
13343
|
+
};
|
|
13344
|
+
var init_vendorEntrySource = __esm(() => {
|
|
13345
|
+
RESERVED_KEYS = new Set([
|
|
13346
|
+
"default",
|
|
13347
|
+
"__esModule",
|
|
13348
|
+
"__ABSOLUTE_VENDOR_NAMESPACE__"
|
|
13349
|
+
]);
|
|
13350
|
+
VALID_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;
|
|
13351
|
+
});
|
|
12572
13352
|
|
|
12573
13353
|
// src/build/buildAngularVendor.ts
|
|
12574
13354
|
var exports_buildAngularVendor = {};
|
|
@@ -12581,9 +13361,9 @@ __export(exports_buildAngularVendor, {
|
|
|
12581
13361
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
12582
13362
|
});
|
|
12583
13363
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
12584
|
-
import { join as
|
|
12585
|
-
import { rm as
|
|
12586
|
-
var {build:
|
|
13364
|
+
import { join as join20 } from "path";
|
|
13365
|
+
import { rm as rm7 } from "fs/promises";
|
|
13366
|
+
var {build: bunBuild4, Glob: Glob6 } = globalThis.Bun;
|
|
12587
13367
|
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) => {
|
|
12588
13368
|
try {
|
|
12589
13369
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -12594,18 +13374,18 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12594
13374
|
}, 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) => {
|
|
12595
13375
|
const angular = new Set;
|
|
12596
13376
|
const transitiveRoots = new Set;
|
|
12597
|
-
const
|
|
13377
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
12598
13378
|
const glob = new Glob6("**/*.{ts,tsx,js,jsx}");
|
|
12599
13379
|
for (const dir of directories) {
|
|
12600
13380
|
try {
|
|
12601
|
-
for await (const
|
|
12602
|
-
const rel =
|
|
13381
|
+
for await (const file5 of glob.scan({ absolute: true, cwd: dir })) {
|
|
13382
|
+
const rel = file5.slice(dir.length + 1);
|
|
12603
13383
|
const [first] = rel.split("/");
|
|
12604
13384
|
if (first && SCAN_SKIP_DIRS.has(first))
|
|
12605
13385
|
continue;
|
|
12606
13386
|
try {
|
|
12607
|
-
const content = await Bun.file(
|
|
12608
|
-
for (const imp of
|
|
13387
|
+
const content = await Bun.file(file5).text();
|
|
13388
|
+
for (const imp of transpiler5.scanImports(content)) {
|
|
12609
13389
|
if (isAngularBrowserSpecifier(imp.path)) {
|
|
12610
13390
|
angular.add(imp.path);
|
|
12611
13391
|
} else if (isBareSpecifier(imp.path)) {
|
|
@@ -12619,7 +13399,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12619
13399
|
return { angular, transitiveRoots };
|
|
12620
13400
|
}, PARTIAL_DECL_MARKERS, containsPartialDeclarations = (source) => PARTIAL_DECL_MARKERS.some((marker) => source.includes(marker)), collectTransitiveAngularSpecs = async (roots, angularFound) => {
|
|
12621
13401
|
const { readFileSync: readFileSync13 } = await import("fs");
|
|
12622
|
-
const
|
|
13402
|
+
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
12623
13403
|
const visited = new Set;
|
|
12624
13404
|
const frontier = [];
|
|
12625
13405
|
for (const r of roots)
|
|
@@ -12648,7 +13428,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12648
13428
|
}
|
|
12649
13429
|
let imports;
|
|
12650
13430
|
try {
|
|
12651
|
-
imports =
|
|
13431
|
+
imports = transpiler5.scanImports(content);
|
|
12652
13432
|
} catch {
|
|
12653
13433
|
continue;
|
|
12654
13434
|
}
|
|
@@ -12678,18 +13458,18 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12678
13458
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
12679
13459
|
return Array.from(angular).filter(isResolvable2);
|
|
12680
13460
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
12681
|
-
const vendorDir =
|
|
13461
|
+
const vendorDir = join20(buildDir, "angular", "vendor");
|
|
12682
13462
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12683
|
-
const tmpDir =
|
|
13463
|
+
const tmpDir = join20(buildDir, "_angular_vendor_tmp");
|
|
12684
13464
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12685
13465
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12686
13466
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12687
13467
|
const safeName = toSafeFileName2(specifier);
|
|
12688
|
-
const entryPath =
|
|
12689
|
-
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
13468
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13469
|
+
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
12690
13470
|
return entryPath;
|
|
12691
13471
|
}));
|
|
12692
|
-
const result = await
|
|
13472
|
+
const result = await bunBuild4({
|
|
12693
13473
|
entrypoints,
|
|
12694
13474
|
external: depVendorSpecifiers,
|
|
12695
13475
|
format: "esm",
|
|
@@ -12701,7 +13481,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12701
13481
|
target: "browser",
|
|
12702
13482
|
throw: false
|
|
12703
13483
|
});
|
|
12704
|
-
await
|
|
13484
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
12705
13485
|
if (!result.success) {
|
|
12706
13486
|
console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
|
|
12707
13487
|
}
|
|
@@ -12716,9 +13496,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12716
13496
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12717
13497
|
return computeAngularVendorPaths(specifiers);
|
|
12718
13498
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
12719
|
-
const vendorDir =
|
|
13499
|
+
const vendorDir = join20(buildDir, "angular", "vendor", "server");
|
|
12720
13500
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12721
|
-
const tmpDir =
|
|
13501
|
+
const tmpDir = join20(buildDir, "_angular_server_vendor_tmp");
|
|
12722
13502
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12723
13503
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12724
13504
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -12729,11 +13509,11 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12729
13509
|
const specifiers = Array.from(allSpecs);
|
|
12730
13510
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12731
13511
|
const safeName = toSafeFileName2(specifier);
|
|
12732
|
-
const entryPath =
|
|
12733
|
-
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
13512
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
13513
|
+
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
12734
13514
|
return entryPath;
|
|
12735
13515
|
}));
|
|
12736
|
-
const result = await
|
|
13516
|
+
const result = await bunBuild4({
|
|
12737
13517
|
entrypoints,
|
|
12738
13518
|
format: "esm",
|
|
12739
13519
|
minify: false,
|
|
@@ -12744,16 +13524,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12744
13524
|
target: "bun",
|
|
12745
13525
|
throw: false
|
|
12746
13526
|
});
|
|
12747
|
-
await
|
|
13527
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
12748
13528
|
if (!result.success) {
|
|
12749
13529
|
console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
|
|
12750
13530
|
}
|
|
12751
13531
|
return specifiers;
|
|
12752
13532
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
12753
13533
|
const paths = {};
|
|
12754
|
-
const vendorDir =
|
|
13534
|
+
const vendorDir = join20(buildDir, "angular", "vendor", "server");
|
|
12755
13535
|
for (const specifier of specifiers) {
|
|
12756
|
-
paths[specifier] =
|
|
13536
|
+
paths[specifier] = join20(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
12757
13537
|
}
|
|
12758
13538
|
return paths;
|
|
12759
13539
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -12767,6 +13547,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12767
13547
|
};
|
|
12768
13548
|
var init_buildAngularVendor = __esm(() => {
|
|
12769
13549
|
init_angularLinkerPlugin();
|
|
13550
|
+
init_vendorEntrySource();
|
|
12770
13551
|
REQUIRED_ANGULAR_SPECIFIERS_BASE = [
|
|
12771
13552
|
"@angular/core",
|
|
12772
13553
|
"@angular/common",
|
|
@@ -12808,22 +13589,22 @@ __export(exports_buildVueVendor, {
|
|
|
12808
13589
|
buildVueVendor: () => buildVueVendor
|
|
12809
13590
|
});
|
|
12810
13591
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
12811
|
-
import { join as
|
|
12812
|
-
import { rm as
|
|
12813
|
-
var {build:
|
|
13592
|
+
import { join as join21 } from "path";
|
|
13593
|
+
import { rm as rm8 } from "fs/promises";
|
|
13594
|
+
var {build: bunBuild5 } = globalThis.Bun;
|
|
12814
13595
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
12815
|
-
const vendorDir =
|
|
13596
|
+
const vendorDir = join21(buildDir, "vue", "vendor");
|
|
12816
13597
|
mkdirSync8(vendorDir, { recursive: true });
|
|
12817
|
-
const tmpDir =
|
|
13598
|
+
const tmpDir = join21(buildDir, "_vue_vendor_tmp");
|
|
12818
13599
|
mkdirSync8(tmpDir, { recursive: true });
|
|
12819
13600
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
12820
13601
|
const safeName = toSafeFileName3(specifier);
|
|
12821
|
-
const entryPath =
|
|
13602
|
+
const entryPath = join21(tmpDir, `${safeName}.ts`);
|
|
12822
13603
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12823
13604
|
`);
|
|
12824
13605
|
return entryPath;
|
|
12825
13606
|
}));
|
|
12826
|
-
const result = await
|
|
13607
|
+
const result = await bunBuild5({
|
|
12827
13608
|
define: {
|
|
12828
13609
|
__VUE_OPTIONS_API__: "true",
|
|
12829
13610
|
__VUE_PROD_DEVTOOLS__: "true",
|
|
@@ -12838,15 +13619,15 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
12838
13619
|
target: "browser",
|
|
12839
13620
|
throw: false
|
|
12840
13621
|
});
|
|
12841
|
-
await
|
|
13622
|
+
await rm8(tmpDir, { force: true, recursive: true });
|
|
12842
13623
|
if (!result.success) {
|
|
12843
13624
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
12844
13625
|
return;
|
|
12845
13626
|
}
|
|
12846
13627
|
const { readFileSync: readFileSync13, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
|
|
12847
13628
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
12848
|
-
for (const
|
|
12849
|
-
const filePath =
|
|
13629
|
+
for (const file5 of files) {
|
|
13630
|
+
const filePath = join21(vendorDir, file5);
|
|
12850
13631
|
const content = readFileSync13(filePath, "utf-8");
|
|
12851
13632
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
12852
13633
|
continue;
|
|
@@ -12873,9 +13654,9 @@ __export(exports_buildSvelteVendor, {
|
|
|
12873
13654
|
buildSvelteVendor: () => buildSvelteVendor
|
|
12874
13655
|
});
|
|
12875
13656
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
12876
|
-
import { join as
|
|
12877
|
-
import { rm as
|
|
12878
|
-
var {build:
|
|
13657
|
+
import { join as join22 } from "path";
|
|
13658
|
+
import { rm as rm9 } from "fs/promises";
|
|
13659
|
+
var {build: bunBuild6 } = globalThis.Bun;
|
|
12879
13660
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
12880
13661
|
try {
|
|
12881
13662
|
__require.resolve(specifier);
|
|
@@ -12887,18 +13668,18 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12887
13668
|
const specifiers = resolveVendorSpecifiers2();
|
|
12888
13669
|
if (specifiers.length === 0)
|
|
12889
13670
|
return;
|
|
12890
|
-
const vendorDir =
|
|
13671
|
+
const vendorDir = join22(buildDir, "svelte", "vendor");
|
|
12891
13672
|
mkdirSync9(vendorDir, { recursive: true });
|
|
12892
|
-
const tmpDir =
|
|
13673
|
+
const tmpDir = join22(buildDir, "_svelte_vendor_tmp");
|
|
12893
13674
|
mkdirSync9(tmpDir, { recursive: true });
|
|
12894
13675
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12895
13676
|
const safeName = toSafeFileName4(specifier);
|
|
12896
|
-
const entryPath =
|
|
13677
|
+
const entryPath = join22(tmpDir, `${safeName}.ts`);
|
|
12897
13678
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12898
13679
|
`);
|
|
12899
13680
|
return entryPath;
|
|
12900
13681
|
}));
|
|
12901
|
-
const result = await
|
|
13682
|
+
const result = await bunBuild6({
|
|
12902
13683
|
entrypoints,
|
|
12903
13684
|
format: "esm",
|
|
12904
13685
|
minify: false,
|
|
@@ -12908,7 +13689,7 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12908
13689
|
target: "browser",
|
|
12909
13690
|
throw: false
|
|
12910
13691
|
});
|
|
12911
|
-
await
|
|
13692
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
12912
13693
|
if (!result.success) {
|
|
12913
13694
|
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
12914
13695
|
}
|
|
@@ -12966,11 +13747,11 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12966
13747
|
if (Object.keys(vendorPaths).length === 0)
|
|
12967
13748
|
return;
|
|
12968
13749
|
const { readdirSync } = await import("fs");
|
|
12969
|
-
const { join:
|
|
13750
|
+
const { join: join23 } = await import("path");
|
|
12970
13751
|
const allFiles = [];
|
|
12971
13752
|
for (const dir of vendorDirs) {
|
|
12972
13753
|
try {
|
|
12973
|
-
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) =>
|
|
13754
|
+
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) => join23(dir, f2));
|
|
12974
13755
|
allFiles.push(...files);
|
|
12975
13756
|
} catch {}
|
|
12976
13757
|
}
|
|
@@ -12996,7 +13777,7 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12996
13777
|
const namedImportRe = new RegExp(`\\bimport\\s*\\{[^}]*\\b${ident}\\b[^}]*\\}\\s*from\\b`);
|
|
12997
13778
|
if (namedImportRe.test(content))
|
|
12998
13779
|
continue;
|
|
12999
|
-
const importPathRe = /from\s
|
|
13780
|
+
const importPathRe = /(?:from\s+|import\s*)["']([^"']+)["']/g;
|
|
13000
13781
|
let pathMatch;
|
|
13001
13782
|
let sourcePath;
|
|
13002
13783
|
while ((pathMatch = importPathRe.exec(content)) !== null) {
|
|
@@ -13006,7 +13787,8 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
13006
13787
|
const base = p2.split("/").pop()?.replace(/\.[mc]?js$/, "");
|
|
13007
13788
|
if (!base)
|
|
13008
13789
|
continue;
|
|
13009
|
-
|
|
13790
|
+
const normalized = base.startsWith("_") ? base.slice(1) : base;
|
|
13791
|
+
if (normalized === ident || normalized.endsWith(`_${ident}`)) {
|
|
13010
13792
|
sourcePath = p2;
|
|
13011
13793
|
break;
|
|
13012
13794
|
}
|
|
@@ -13039,16 +13821,16 @@ var init_rewriteImports = __esm(() => {
|
|
|
13039
13821
|
import {
|
|
13040
13822
|
copyFileSync,
|
|
13041
13823
|
cpSync,
|
|
13042
|
-
existsSync as
|
|
13824
|
+
existsSync as existsSync20,
|
|
13043
13825
|
mkdirSync as mkdirSync10,
|
|
13044
13826
|
readFileSync as readFileSync13,
|
|
13045
13827
|
rmSync as rmSync2,
|
|
13046
13828
|
statSync,
|
|
13047
13829
|
writeFileSync as writeFileSync7
|
|
13048
13830
|
} from "fs";
|
|
13049
|
-
import { basename as
|
|
13831
|
+
import { basename as basename9, dirname as dirname15, extname as extname7, join as join23, relative as relative10, resolve as resolve22 } from "path";
|
|
13050
13832
|
import { cwd, env as env3, exit } from "process";
|
|
13051
|
-
var {build:
|
|
13833
|
+
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
13052
13834
|
var isDev2, isBuildTraceEnabled = () => {
|
|
13053
13835
|
const value = env3.ABSOLUTE_BUILD_TRACE?.toLowerCase();
|
|
13054
13836
|
return value === "1" || value === "true" || value === "yes";
|
|
@@ -13124,8 +13906,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
13124
13906
|
mkdirSync10(htmxDestDir, { recursive: true });
|
|
13125
13907
|
const glob = new Glob7("htmx*.min.js");
|
|
13126
13908
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
13127
|
-
const src =
|
|
13128
|
-
const dest =
|
|
13909
|
+
const src = join23(htmxDir, relPath);
|
|
13910
|
+
const dest = join23(htmxDestDir, "htmx.min.js");
|
|
13129
13911
|
copyFileSync(src, dest);
|
|
13130
13912
|
return;
|
|
13131
13913
|
}
|
|
@@ -13137,8 +13919,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
13137
13919
|
}
|
|
13138
13920
|
}, resolveAbsoluteVersion = async () => {
|
|
13139
13921
|
const candidates = [
|
|
13140
|
-
|
|
13141
|
-
|
|
13922
|
+
resolve22(import.meta.dir, "..", "..", "package.json"),
|
|
13923
|
+
resolve22(import.meta.dir, "..", "package.json")
|
|
13142
13924
|
];
|
|
13143
13925
|
const resolveCandidate = async (remaining) => {
|
|
13144
13926
|
const [candidate, ...rest] = remaining;
|
|
@@ -13153,34 +13935,34 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
13153
13935
|
globalThis.__absoluteVersion = pkg.version;
|
|
13154
13936
|
};
|
|
13155
13937
|
await resolveCandidate(candidates);
|
|
13156
|
-
}, SKIP_DIRS, addWorkerPathIfExists = (
|
|
13157
|
-
const absPath =
|
|
13938
|
+
}, SKIP_DIRS, addWorkerPathIfExists = (file5, relPath, workerPaths) => {
|
|
13939
|
+
const absPath = resolve22(file5, "..", relPath);
|
|
13158
13940
|
try {
|
|
13159
13941
|
statSync(absPath);
|
|
13160
13942
|
workerPaths.add(absPath);
|
|
13161
13943
|
} catch {}
|
|
13162
|
-
}, collectWorkerPathsFromContent = (content, pattern,
|
|
13944
|
+
}, collectWorkerPathsFromContent = (content, pattern, file5, workerPaths) => {
|
|
13163
13945
|
pattern.lastIndex = 0;
|
|
13164
13946
|
let match;
|
|
13165
13947
|
while ((match = pattern.exec(content)) !== null) {
|
|
13166
13948
|
const [, relPath] = match;
|
|
13167
13949
|
if (!relPath)
|
|
13168
13950
|
continue;
|
|
13169
|
-
addWorkerPathIfExists(
|
|
13951
|
+
addWorkerPathIfExists(file5, relPath, workerPaths);
|
|
13170
13952
|
}
|
|
13171
|
-
}, collectWorkerPathsFromFile = (
|
|
13172
|
-
const content = readFileSync13(
|
|
13953
|
+
}, collectWorkerPathsFromFile = (file5, patterns, workerPaths) => {
|
|
13954
|
+
const content = readFileSync13(file5, "utf-8");
|
|
13173
13955
|
for (const pattern of patterns) {
|
|
13174
|
-
collectWorkerPathsFromContent(content, pattern,
|
|
13956
|
+
collectWorkerPathsFromContent(content, pattern, file5, workerPaths);
|
|
13175
13957
|
}
|
|
13176
13958
|
}, scanWorkerReferencesInDir = async (dir, patterns, workerPaths) => {
|
|
13177
13959
|
const glob = new Glob7("**/*.{ts,tsx,js,jsx,svelte,vue}");
|
|
13178
|
-
for await (const
|
|
13179
|
-
const relToDir =
|
|
13960
|
+
for await (const file5 of glob.scan({ absolute: true, cwd: dir })) {
|
|
13961
|
+
const relToDir = file5.slice(dir.length + 1);
|
|
13180
13962
|
const [firstSegment] = relToDir.split("/");
|
|
13181
13963
|
if (firstSegment && SKIP_DIRS.has(firstSegment))
|
|
13182
13964
|
continue;
|
|
13183
|
-
collectWorkerPathsFromFile(
|
|
13965
|
+
collectWorkerPathsFromFile(file5, patterns, workerPaths);
|
|
13184
13966
|
}
|
|
13185
13967
|
}, scanWorkerReferences = async (dirs) => {
|
|
13186
13968
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
@@ -13200,7 +13982,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
13200
13982
|
vuePagesPath
|
|
13201
13983
|
}) => {
|
|
13202
13984
|
const { readdirSync: readDir } = await import("fs");
|
|
13203
|
-
const devIndexDir =
|
|
13985
|
+
const devIndexDir = join23(buildPath, "_src_indexes");
|
|
13204
13986
|
mkdirSync10(devIndexDir, { recursive: true });
|
|
13205
13987
|
if (reactIndexesPath && reactPagesPath) {
|
|
13206
13988
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -13212,41 +13994,41 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
13212
13994
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
13213
13995
|
}
|
|
13214
13996
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
13215
|
-
if (!
|
|
13997
|
+
if (!existsSync20(reactIndexesPath)) {
|
|
13216
13998
|
return;
|
|
13217
13999
|
}
|
|
13218
|
-
const indexFiles = readDir(reactIndexesPath).filter((
|
|
13219
|
-
const pagesRel = relative10(process.cwd(),
|
|
13220
|
-
for (const
|
|
13221
|
-
let content = readFileSync13(
|
|
14000
|
+
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
14001
|
+
const pagesRel = relative10(process.cwd(), resolve22(reactPagesPath)).replace(/\\/g, "/");
|
|
14002
|
+
for (const file5 of indexFiles) {
|
|
14003
|
+
let content = readFileSync13(join23(reactIndexesPath, file5), "utf-8");
|
|
13222
14004
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
13223
|
-
writeFileSync7(
|
|
14005
|
+
writeFileSync7(join23(devIndexDir, file5), content);
|
|
13224
14006
|
}
|
|
13225
14007
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
13226
|
-
const svelteIndexDir =
|
|
13227
|
-
const sveltePageEntries = svelteEntries.filter((
|
|
14008
|
+
const svelteIndexDir = join23(svelteDir, "generated", "indexes");
|
|
14009
|
+
const sveltePageEntries = svelteEntries.filter((file5) => resolve22(file5).startsWith(resolve22(sveltePagesPath)));
|
|
13228
14010
|
for (const entry of sveltePageEntries) {
|
|
13229
|
-
const name =
|
|
13230
|
-
const indexFile =
|
|
13231
|
-
if (!
|
|
14011
|
+
const name = basename9(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14012
|
+
const indexFile = join23(svelteIndexDir, "pages", `${name}.js`);
|
|
14013
|
+
if (!existsSync20(indexFile))
|
|
13232
14014
|
continue;
|
|
13233
14015
|
let content = readFileSync13(indexFile, "utf-8");
|
|
13234
|
-
const srcRel = relative10(process.cwd(),
|
|
14016
|
+
const srcRel = relative10(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
|
|
13235
14017
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
13236
|
-
writeFileSync7(
|
|
14018
|
+
writeFileSync7(join23(devIndexDir, `${name}.svelte.js`), content);
|
|
13237
14019
|
}
|
|
13238
14020
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
13239
|
-
const vueIndexDir =
|
|
13240
|
-
const vuePageEntries = vueEntries.filter((
|
|
14021
|
+
const vueIndexDir = join23(vueDir, "generated", "indexes");
|
|
14022
|
+
const vuePageEntries = vueEntries.filter((file5) => resolve22(file5).startsWith(resolve22(vuePagesPath)));
|
|
13241
14023
|
for (const entry of vuePageEntries) {
|
|
13242
|
-
const name =
|
|
13243
|
-
const indexFile =
|
|
13244
|
-
if (!
|
|
14024
|
+
const name = basename9(entry, ".vue");
|
|
14025
|
+
const indexFile = join23(vueIndexDir, `${name}.js`);
|
|
14026
|
+
if (!existsSync20(indexFile))
|
|
13245
14027
|
continue;
|
|
13246
14028
|
let content = readFileSync13(indexFile, "utf-8");
|
|
13247
|
-
const srcRel = relative10(process.cwd(),
|
|
14029
|
+
const srcRel = relative10(process.cwd(), resolve22(entry)).replace(/\\/g, "/");
|
|
13248
14030
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
13249
|
-
writeFileSync7(
|
|
14031
|
+
writeFileSync7(join23(devIndexDir, `${name}.vue.js`), content);
|
|
13250
14032
|
}
|
|
13251
14033
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
13252
14034
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -13257,7 +14039,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
13257
14039
|
const last = allComments[allComments.length - 1];
|
|
13258
14040
|
if (!last?.[1])
|
|
13259
14041
|
return JSON.stringify(outputPath);
|
|
13260
|
-
const srcPath =
|
|
14042
|
+
const srcPath = resolve22(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
13261
14043
|
return JSON.stringify(srcPath);
|
|
13262
14044
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
13263
14045
|
let depth = 0;
|
|
@@ -13320,7 +14102,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13320
14102
|
const urlFileMap = new Map;
|
|
13321
14103
|
for (const srcPath of urlReferencedFiles) {
|
|
13322
14104
|
const rel = relative10(projectRoot, srcPath).replace(/\\/g, "/");
|
|
13323
|
-
const name =
|
|
14105
|
+
const name = basename9(srcPath);
|
|
13324
14106
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
13325
14107
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
13326
14108
|
urlFileMap.set(name, url);
|
|
@@ -13330,11 +14112,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13330
14112
|
}, buildProdUrlFileMap = (urlReferencedFiles, buildPath, nonReactClientOutputs) => {
|
|
13331
14113
|
const urlFileMap = new Map;
|
|
13332
14114
|
for (const srcPath of urlReferencedFiles) {
|
|
13333
|
-
const srcBase =
|
|
13334
|
-
const output = nonReactClientOutputs.find((artifact) =>
|
|
14115
|
+
const srcBase = basename9(srcPath).replace(/\.[^.]+$/, "");
|
|
14116
|
+
const output = nonReactClientOutputs.find((artifact) => basename9(artifact.path).startsWith(`${srcBase}.`));
|
|
13335
14117
|
if (!output)
|
|
13336
14118
|
continue;
|
|
13337
|
-
urlFileMap.set(
|
|
14119
|
+
urlFileMap.set(basename9(srcPath), `/${relative10(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
13338
14120
|
}
|
|
13339
14121
|
return urlFileMap;
|
|
13340
14122
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -13347,7 +14129,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13347
14129
|
let content = readFileSync13(outputPath, "utf-8");
|
|
13348
14130
|
let changed = false;
|
|
13349
14131
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
13350
|
-
const targetName =
|
|
14132
|
+
const targetName = basename9(relPath);
|
|
13351
14133
|
const resolvedPath = urlFileMap.get(targetName);
|
|
13352
14134
|
if (!resolvedPath)
|
|
13353
14135
|
return _match;
|
|
@@ -13406,6 +14188,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13406
14188
|
htmlDirectory,
|
|
13407
14189
|
htmxDirectory,
|
|
13408
14190
|
angularDirectory,
|
|
14191
|
+
emberDirectory,
|
|
13409
14192
|
svelteDirectory,
|
|
13410
14193
|
vueDirectory,
|
|
13411
14194
|
stylesConfig,
|
|
@@ -13467,10 +14250,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13467
14250
|
restoreTracePhase();
|
|
13468
14251
|
return;
|
|
13469
14252
|
}
|
|
13470
|
-
const traceDir =
|
|
14253
|
+
const traceDir = join23(buildPath2, ".absolute-trace");
|
|
13471
14254
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
13472
14255
|
mkdirSync10(traceDir, { recursive: true });
|
|
13473
|
-
writeFileSync7(
|
|
14256
|
+
writeFileSync7(join23(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
13474
14257
|
events: traceEvents,
|
|
13475
14258
|
frameworks: traceFrameworkNames,
|
|
13476
14259
|
generatedAt: new Date().toISOString(),
|
|
@@ -13495,26 +14278,29 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13495
14278
|
const svelteDir = svelteDirectory && validateSafePath(svelteDirectory, projectRoot);
|
|
13496
14279
|
const vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot);
|
|
13497
14280
|
const angularDir = angularDirectory && validateSafePath(angularDirectory, projectRoot);
|
|
14281
|
+
const emberDir = emberDirectory && validateSafePath(emberDirectory, projectRoot);
|
|
13498
14282
|
const islandBootstrapPath = islands?.bootstrap && validateSafePath(islands.bootstrap, projectRoot);
|
|
13499
14283
|
const islandRegistryPath = islands?.registry && validateSafePath(islands.registry, projectRoot);
|
|
13500
14284
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
13501
14285
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
13502
14286
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
13503
|
-
const reactIndexesPath = reactDir &&
|
|
13504
|
-
const reactPagesPath = reactDir &&
|
|
13505
|
-
const htmlPagesPath = htmlDir &&
|
|
13506
|
-
const htmlScriptsPath = htmlDir &&
|
|
13507
|
-
const sveltePagesPath = svelteDir &&
|
|
13508
|
-
const vuePagesPath = vueDir &&
|
|
13509
|
-
const htmxPagesPath = htmxDir &&
|
|
13510
|
-
const angularPagesPath = angularDir &&
|
|
14287
|
+
const reactIndexesPath = reactDir && join23(reactDir, "generated", "indexes");
|
|
14288
|
+
const reactPagesPath = reactDir && join23(reactDir, "pages");
|
|
14289
|
+
const htmlPagesPath = htmlDir && join23(htmlDir, "pages");
|
|
14290
|
+
const htmlScriptsPath = htmlDir && join23(htmlDir, "scripts");
|
|
14291
|
+
const sveltePagesPath = svelteDir && join23(svelteDir, "pages");
|
|
14292
|
+
const vuePagesPath = vueDir && join23(vueDir, "pages");
|
|
14293
|
+
const htmxPagesPath = htmxDir && join23(htmxDir, "pages");
|
|
14294
|
+
const angularPagesPath = angularDir && join23(angularDir, "pages");
|
|
14295
|
+
const emberPagesPath = emberDir && join23(emberDir, "pages");
|
|
13511
14296
|
const frontends = [
|
|
13512
14297
|
reactDir,
|
|
13513
14298
|
htmlDir,
|
|
13514
14299
|
htmxDir,
|
|
13515
14300
|
svelteDir,
|
|
13516
14301
|
vueDir,
|
|
13517
|
-
angularDir
|
|
14302
|
+
angularDir,
|
|
14303
|
+
emberDir
|
|
13518
14304
|
].filter(Boolean);
|
|
13519
14305
|
const isSingle = frontends.length === 1;
|
|
13520
14306
|
const frameworkNames = [
|
|
@@ -13523,7 +14309,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13523
14309
|
htmxDir && "htmx",
|
|
13524
14310
|
svelteDir && "svelte",
|
|
13525
14311
|
vueDir && "vue",
|
|
13526
|
-
angularDir && "angular"
|
|
14312
|
+
angularDir && "angular",
|
|
14313
|
+
emberDir && "ember"
|
|
13527
14314
|
].filter((name) => Boolean(name));
|
|
13528
14315
|
traceFrameworkNames = frameworkNames;
|
|
13529
14316
|
sendTelemetryEvent("build:start", {
|
|
@@ -13538,19 +14325,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13538
14325
|
htmlDir,
|
|
13539
14326
|
vueDir,
|
|
13540
14327
|
angularDir,
|
|
13541
|
-
islandBootstrapPath &&
|
|
14328
|
+
islandBootstrapPath && dirname15(islandBootstrapPath)
|
|
13542
14329
|
].filter((dir) => Boolean(dir));
|
|
13543
14330
|
const clientRoot = isSingle ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
|
|
13544
14331
|
const serverDirMap = [];
|
|
13545
14332
|
if (svelteDir)
|
|
13546
14333
|
serverDirMap.push({
|
|
13547
14334
|
dir: svelteDir,
|
|
13548
|
-
subdir:
|
|
14335
|
+
subdir: join23("generated", "server")
|
|
13549
14336
|
});
|
|
13550
14337
|
if (vueDir)
|
|
13551
14338
|
serverDirMap.push({
|
|
13552
14339
|
dir: vueDir,
|
|
13553
|
-
subdir:
|
|
14340
|
+
subdir: join23("generated", "server")
|
|
13554
14341
|
});
|
|
13555
14342
|
if (angularDir)
|
|
13556
14343
|
serverDirMap.push({ dir: angularDir, subdir: "generated" });
|
|
@@ -13560,8 +14347,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13560
14347
|
const [firstEntry] = serverDirMap;
|
|
13561
14348
|
if (!firstEntry)
|
|
13562
14349
|
throw new Error("Expected at least one server directory entry");
|
|
13563
|
-
serverRoot =
|
|
13564
|
-
serverOutDir =
|
|
14350
|
+
serverRoot = join23(firstEntry.dir, firstEntry.subdir);
|
|
14351
|
+
serverOutDir = join23(buildPath, basename9(firstEntry.dir));
|
|
13565
14352
|
} else if (serverDirMap.length > 1) {
|
|
13566
14353
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
13567
14354
|
serverOutDir = buildPath;
|
|
@@ -13573,13 +14360,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13573
14360
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
13574
14361
|
if (!isIncremental || !incrementalFiles)
|
|
13575
14362
|
return entryPoints;
|
|
13576
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
14363
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve22(f2)));
|
|
13577
14364
|
const matchingEntries = [];
|
|
13578
14365
|
for (const entry of entryPoints) {
|
|
13579
14366
|
const sourceFile = mapToSource(entry);
|
|
13580
14367
|
if (!sourceFile)
|
|
13581
14368
|
continue;
|
|
13582
|
-
if (!normalizedIncremental.has(
|
|
14369
|
+
if (!normalizedIncremental.has(resolve22(sourceFile)))
|
|
13583
14370
|
continue;
|
|
13584
14371
|
matchingEntries.push(entry);
|
|
13585
14372
|
}
|
|
@@ -13589,7 +14376,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13589
14376
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
13590
14377
|
}
|
|
13591
14378
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
13592
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
14379
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join23(buildPath, "assets"), {
|
|
13593
14380
|
force: true,
|
|
13594
14381
|
recursive: true
|
|
13595
14382
|
}));
|
|
@@ -13607,6 +14394,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13607
14394
|
svelteConventionResult,
|
|
13608
14395
|
vueConventionResult,
|
|
13609
14396
|
angularConventionResult,
|
|
14397
|
+
emberConventionResult,
|
|
13610
14398
|
allGlobalCssEntries
|
|
13611
14399
|
] = await Promise.all([
|
|
13612
14400
|
tailwindPromise,
|
|
@@ -13616,11 +14404,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13616
14404
|
sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
|
|
13617
14405
|
vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
|
|
13618
14406
|
angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
|
|
14407
|
+
emberPagesPath ? tracePhase("scan/ember-conventions", () => scanConventions(emberPagesPath, "*.{gjs,gts,ts}")) : emptyConventionResult,
|
|
13619
14408
|
stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
|
|
13620
14409
|
]);
|
|
13621
14410
|
const allSvelteEntries = svelteConventionResult.pageFiles;
|
|
13622
14411
|
const allVueEntries = vueConventionResult.pageFiles;
|
|
13623
14412
|
const allAngularEntries = angularConventionResult.pageFiles;
|
|
14413
|
+
const allEmberEntries = emberConventionResult.pageFiles;
|
|
13624
14414
|
const conventionsMap = {};
|
|
13625
14415
|
if (reactConventionResult.conventions)
|
|
13626
14416
|
conventionsMap.react = reactConventionResult.conventions;
|
|
@@ -13630,15 +14420,17 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13630
14420
|
conventionsMap.vue = vueConventionResult.conventions;
|
|
13631
14421
|
if (angularConventionResult.conventions)
|
|
13632
14422
|
conventionsMap.angular = angularConventionResult.conventions;
|
|
13633
|
-
|
|
14423
|
+
if (emberConventionResult.conventions)
|
|
14424
|
+
conventionsMap.ember = emberConventionResult.conventions;
|
|
14425
|
+
const notFoundFrameworks = ["react", "svelte", "vue", "angular", "ember"].filter((framework) => conventionsMap[framework]?.defaults?.notFound);
|
|
13634
14426
|
if (notFoundFrameworks.length > 1) {
|
|
13635
14427
|
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.`);
|
|
13636
14428
|
}
|
|
13637
14429
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
13638
14430
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
13639
|
-
if (entry.startsWith(
|
|
13640
|
-
const pageName =
|
|
13641
|
-
return
|
|
14431
|
+
if (entry.startsWith(resolve22(reactIndexesPath))) {
|
|
14432
|
+
const pageName = basename9(entry, ".tsx");
|
|
14433
|
+
return join23(reactPagesPath, `${pageName}.tsx`);
|
|
13642
14434
|
}
|
|
13643
14435
|
return null;
|
|
13644
14436
|
}) : allReactEntries;
|
|
@@ -13646,6 +14438,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13646
14438
|
const svelteEntries = isIncremental ? filterToIncrementalEntries(allSvelteEntries, (entry) => entry) : allSvelteEntries;
|
|
13647
14439
|
const vueEntries = isIncremental ? filterToIncrementalEntries(allVueEntries, (entry) => entry) : allVueEntries;
|
|
13648
14440
|
const angularEntries = isIncremental ? filterToIncrementalEntries(allAngularEntries, (entry) => entry) : allAngularEntries;
|
|
14441
|
+
const emberEntries = isIncremental ? filterToIncrementalEntries(allEmberEntries, (entry) => entry) : allEmberEntries;
|
|
13649
14442
|
const globalCssEntries = isIncremental ? filterToIncrementalEntries(allGlobalCssEntries, (entry) => entry) : allGlobalCssEntries;
|
|
13650
14443
|
const hmrClientBundlePromise = hmr && (htmlDir || htmxDir) ? buildHMRClient() : undefined;
|
|
13651
14444
|
const allFrameworkDirs = [
|
|
@@ -13660,6 +14453,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13660
14453
|
const shouldCompileSvelte = svelteDir && svelteEntries.length > 0;
|
|
13661
14454
|
const shouldCompileVue = vueDir && vueEntries.length > 0;
|
|
13662
14455
|
const shouldCompileAngular = angularDir && angularEntries.length > 0;
|
|
14456
|
+
const shouldCompileEmber = emberDir && emberEntries.length > 0;
|
|
13663
14457
|
const emptyStringArray = [];
|
|
13664
14458
|
const islandBuildInfo = islandRegistryPath ? await tracePhase("islands/registry", () => loadIslandRegistryBuildInfo(islandRegistryPath)) : null;
|
|
13665
14459
|
const islandFrameworkSources = islandBuildInfo ? collectIslandFrameworkSources(islandBuildInfo) : {};
|
|
@@ -13673,6 +14467,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13673
14467
|
{ svelteServerPaths, svelteIndexPaths, svelteClientPaths },
|
|
13674
14468
|
{ vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths },
|
|
13675
14469
|
{ clientPaths: angularClientPaths, serverPaths: angularServerPaths },
|
|
14470
|
+
{ clientPaths: emberClientPaths, serverPaths: emberServerPaths },
|
|
13676
14471
|
{ svelteClientPaths: islandSvelteClientPaths },
|
|
13677
14472
|
{ vueClientPaths: islandVueClientPaths },
|
|
13678
14473
|
{ clientPaths: islandAngularClientPaths }
|
|
@@ -13692,6 +14487,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13692
14487
|
clientPaths: [...emptyStringArray],
|
|
13693
14488
|
serverPaths: [...emptyStringArray]
|
|
13694
14489
|
},
|
|
14490
|
+
shouldCompileEmber ? tracePhase("compile/ember", () => Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber)).then((mod) => mod.compileEmber(emberEntries, emberDir, projectRoot, hmr))) : {
|
|
14491
|
+
clientPaths: [...emptyStringArray],
|
|
14492
|
+
serverPaths: [...emptyStringArray]
|
|
14493
|
+
},
|
|
13695
14494
|
shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
|
|
13696
14495
|
svelteClientPaths: [...emptyStringArray]
|
|
13697
14496
|
},
|
|
@@ -13708,7 +14507,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13708
14507
|
const clientPath = islandSvelteClientPaths[idx];
|
|
13709
14508
|
if (!sourcePath || !clientPath)
|
|
13710
14509
|
continue;
|
|
13711
|
-
islandSvelteClientPathMap.set(
|
|
14510
|
+
islandSvelteClientPathMap.set(resolve22(sourcePath), clientPath);
|
|
13712
14511
|
}
|
|
13713
14512
|
const islandVueClientPathMap = new Map;
|
|
13714
14513
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -13716,7 +14515,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13716
14515
|
const clientPath = islandVueClientPaths[idx];
|
|
13717
14516
|
if (!sourcePath || !clientPath)
|
|
13718
14517
|
continue;
|
|
13719
|
-
islandVueClientPathMap.set(
|
|
14518
|
+
islandVueClientPathMap.set(resolve22(sourcePath), clientPath);
|
|
13720
14519
|
}
|
|
13721
14520
|
const islandAngularClientPathMap = new Map;
|
|
13722
14521
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -13724,7 +14523,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13724
14523
|
const clientPath = islandAngularClientPaths[idx];
|
|
13725
14524
|
if (!sourcePath || !clientPath)
|
|
13726
14525
|
continue;
|
|
13727
|
-
islandAngularClientPathMap.set(
|
|
14526
|
+
islandAngularClientPathMap.set(resolve22(sourcePath), clientPath);
|
|
13728
14527
|
}
|
|
13729
14528
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
13730
14529
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -13735,7 +14534,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13735
14534
|
const compileReactConventions = async () => {
|
|
13736
14535
|
if (reactConventionSources.length === 0)
|
|
13737
14536
|
return emptyStringArray;
|
|
13738
|
-
const destDir =
|
|
14537
|
+
const destDir = join23(buildPath, "conventions", "react");
|
|
13739
14538
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13740
14539
|
mkdirSync10(destDir, { recursive: true });
|
|
13741
14540
|
const destPaths = [];
|
|
@@ -13743,7 +14542,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13743
14542
|
const source = reactConventionSources[idx];
|
|
13744
14543
|
if (!source)
|
|
13745
14544
|
continue;
|
|
13746
|
-
const result = await
|
|
14545
|
+
const result = await bunBuild7({
|
|
13747
14546
|
entrypoints: [source],
|
|
13748
14547
|
format: "esm",
|
|
13749
14548
|
jsx: { development: false },
|
|
@@ -13751,7 +14550,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13751
14550
|
naming: `${idx}-[name].[ext]`,
|
|
13752
14551
|
outdir: destDir,
|
|
13753
14552
|
plugins: [stylePreprocessorPlugin2],
|
|
13754
|
-
root:
|
|
14553
|
+
root: dirname15(source),
|
|
13755
14554
|
target: "bun",
|
|
13756
14555
|
throw: false,
|
|
13757
14556
|
tsconfig: "./tsconfig.json"
|
|
@@ -13779,7 +14578,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13779
14578
|
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 }
|
|
13780
14579
|
]);
|
|
13781
14580
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
13782
|
-
const destDir =
|
|
14581
|
+
const destDir = join23(buildPath, "conventions", framework);
|
|
13783
14582
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13784
14583
|
mkdirSync10(destDir, { recursive: true });
|
|
13785
14584
|
const destPaths = [];
|
|
@@ -13787,8 +14586,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13787
14586
|
const compiledPath = compiledPaths[idx];
|
|
13788
14587
|
if (!compiledPath)
|
|
13789
14588
|
continue;
|
|
13790
|
-
const name =
|
|
13791
|
-
const result = await
|
|
14589
|
+
const name = basename9(compiledPath).replace(/\.[^.]+$/, "");
|
|
14590
|
+
const result = await bunBuild7({
|
|
13792
14591
|
entrypoints: [compiledPath],
|
|
13793
14592
|
format: "esm",
|
|
13794
14593
|
minify: !isDev2,
|
|
@@ -13852,7 +14651,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13852
14651
|
}
|
|
13853
14652
|
})) : {
|
|
13854
14653
|
entries: [],
|
|
13855
|
-
generatedRoot:
|
|
14654
|
+
generatedRoot: join23(buildPath, "_island_entries")
|
|
13856
14655
|
};
|
|
13857
14656
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
13858
14657
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -13888,7 +14687,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13888
14687
|
return {};
|
|
13889
14688
|
}
|
|
13890
14689
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
13891
|
-
const refreshEntry =
|
|
14690
|
+
const refreshEntry = join23(reactIndexesPath, "_refresh.tsx");
|
|
13892
14691
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
13893
14692
|
reactClientEntryPoints.push(refreshEntry);
|
|
13894
14693
|
}
|
|
@@ -13992,19 +14791,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13992
14791
|
throw: false
|
|
13993
14792
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
13994
14793
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
13995
|
-
rmSync2(
|
|
14794
|
+
rmSync2(join23(buildPath, "react", "generated", "indexes"), {
|
|
13996
14795
|
force: true,
|
|
13997
14796
|
recursive: true
|
|
13998
14797
|
});
|
|
13999
14798
|
}
|
|
14000
14799
|
if (angularDir && angularClientPaths.length > 0) {
|
|
14001
|
-
rmSync2(
|
|
14800
|
+
rmSync2(join23(buildPath, "angular", "indexes"), {
|
|
14002
14801
|
force: true,
|
|
14003
14802
|
recursive: true
|
|
14004
14803
|
});
|
|
14005
14804
|
}
|
|
14006
14805
|
if (islandClientEntryPoints.length > 0) {
|
|
14007
|
-
rmSync2(
|
|
14806
|
+
rmSync2(join23(buildPath, "islands"), {
|
|
14008
14807
|
force: true,
|
|
14009
14808
|
recursive: true
|
|
14010
14809
|
});
|
|
@@ -14017,7 +14816,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14017
14816
|
globalCssResult,
|
|
14018
14817
|
vueCssResult
|
|
14019
14818
|
] = await Promise.all([
|
|
14020
|
-
serverEntryPoints.length > 0 ? tracePhase("bun/server", () =>
|
|
14819
|
+
serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7(mergeBunBuildConfig({
|
|
14021
14820
|
conditions: svelteResolveConditions,
|
|
14022
14821
|
entrypoints: serverEntryPoints,
|
|
14023
14822
|
external: serverBuildExternals,
|
|
@@ -14030,8 +14829,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14030
14829
|
throw: false,
|
|
14031
14830
|
tsconfig: "./tsconfig.json"
|
|
14032
14831
|
}, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
|
|
14033
|
-
reactBuildConfig ? tracePhase("bun/react-client", () =>
|
|
14034
|
-
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () =>
|
|
14832
|
+
reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
|
|
14833
|
+
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
|
|
14035
14834
|
conditions: svelteResolveConditions,
|
|
14036
14835
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
14037
14836
|
entrypoints: nonReactClientEntryPoints,
|
|
@@ -14051,7 +14850,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14051
14850
|
throw: false,
|
|
14052
14851
|
tsconfig: "./tsconfig.json"
|
|
14053
14852
|
}, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
|
|
14054
|
-
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () =>
|
|
14853
|
+
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
|
|
14055
14854
|
conditions: svelteResolveConditions,
|
|
14056
14855
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
14057
14856
|
entrypoints: islandClientEntryPoints,
|
|
@@ -14070,19 +14869,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14070
14869
|
throw: false,
|
|
14071
14870
|
tsconfig: "./tsconfig.json"
|
|
14072
14871
|
}, resolveBunBuildOverride(bunBuildConfig, "islandClient")))) : undefined,
|
|
14073
|
-
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () =>
|
|
14872
|
+
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
14074
14873
|
entrypoints: globalCssEntries,
|
|
14075
14874
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
14076
|
-
outdir: stylesDir ?
|
|
14875
|
+
outdir: stylesDir ? join23(buildPath, basename9(stylesDir)) : buildPath,
|
|
14077
14876
|
plugins: [stylePreprocessorPlugin2],
|
|
14078
14877
|
root: stylesDir || clientRoot,
|
|
14079
14878
|
target: "browser",
|
|
14080
14879
|
throw: false
|
|
14081
14880
|
}, resolveBunBuildOverride(bunBuildConfig, "globalCss")))) : undefined,
|
|
14082
|
-
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () =>
|
|
14881
|
+
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
14083
14882
|
entrypoints: vueCssPaths,
|
|
14084
14883
|
naming: `[name].[hash].[ext]`,
|
|
14085
|
-
outdir:
|
|
14884
|
+
outdir: join23(buildPath, assetsPath ? basename9(assetsPath) : "assets", "css"),
|
|
14086
14885
|
target: "browser",
|
|
14087
14886
|
throw: false
|
|
14088
14887
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -14150,7 +14949,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14150
14949
|
const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
|
|
14151
14950
|
const jsArtifacts = serverOutputs.filter((artifact) => artifact.path.endsWith(".js"));
|
|
14152
14951
|
await tracePhase("postprocess/server-angular-vendor-imports", () => Promise.all(jsArtifacts.map(async (artifact) => {
|
|
14153
|
-
const fileDir =
|
|
14952
|
+
const fileDir = dirname15(artifact.path);
|
|
14154
14953
|
const relativePaths = {};
|
|
14155
14954
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
14156
14955
|
const rel = relative10(fileDir, absolute);
|
|
@@ -14204,14 +15003,18 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14204
15003
|
], buildPath)
|
|
14205
15004
|
};
|
|
14206
15005
|
for (const artifact of serverOutputs) {
|
|
14207
|
-
if (
|
|
15006
|
+
if (extname7(artifact.path) !== ".js")
|
|
14208
15007
|
continue;
|
|
14209
|
-
const fileWithHash =
|
|
15008
|
+
const fileWithHash = basename9(artifact.path);
|
|
14210
15009
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
14211
15010
|
if (!baseName)
|
|
14212
15011
|
continue;
|
|
14213
15012
|
manifest[toPascal(baseName)] = artifact.path;
|
|
14214
15013
|
}
|
|
15014
|
+
for (const serverPath of emberServerPaths) {
|
|
15015
|
+
const fileBase = basename9(serverPath, ".js");
|
|
15016
|
+
manifest[toPascal(fileBase)] = serverPath;
|
|
15017
|
+
}
|
|
14215
15018
|
const shouldCopyHtmx = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/htmx/") && f2.endsWith(".html"));
|
|
14216
15019
|
const shouldUpdateHtmlAssetPaths = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
14217
15020
|
const shouldUpdateHtmxAssetPaths = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/htmx/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
@@ -14230,7 +15033,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14230
15033
|
const processHtmlPages = async () => {
|
|
14231
15034
|
if (!(htmlDir && htmlPagesPath))
|
|
14232
15035
|
return;
|
|
14233
|
-
const outputHtmlPages = isSingle ?
|
|
15036
|
+
const outputHtmlPages = isSingle ? join23(buildPath, "pages") : join23(buildPath, basename9(htmlDir), "pages");
|
|
14234
15037
|
mkdirSync10(outputHtmlPages, { recursive: true });
|
|
14235
15038
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
14236
15039
|
force: true,
|
|
@@ -14245,21 +15048,21 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14245
15048
|
for (const htmlFile of htmlPageFiles) {
|
|
14246
15049
|
if (hmr)
|
|
14247
15050
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
14248
|
-
const fileName =
|
|
15051
|
+
const fileName = basename9(htmlFile, ".html");
|
|
14249
15052
|
manifest[fileName] = htmlFile;
|
|
14250
15053
|
}
|
|
14251
15054
|
};
|
|
14252
15055
|
const processHtmxPages = async () => {
|
|
14253
15056
|
if (!(htmxDir && htmxPagesPath))
|
|
14254
15057
|
return;
|
|
14255
|
-
const outputHtmxPages = isSingle ?
|
|
15058
|
+
const outputHtmxPages = isSingle ? join23(buildPath, "pages") : join23(buildPath, basename9(htmxDir), "pages");
|
|
14256
15059
|
mkdirSync10(outputHtmxPages, { recursive: true });
|
|
14257
15060
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
14258
15061
|
force: true,
|
|
14259
15062
|
recursive: true
|
|
14260
15063
|
});
|
|
14261
15064
|
if (shouldCopyHtmx) {
|
|
14262
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
15065
|
+
const htmxDestDir = isSingle ? buildPath : join23(buildPath, basename9(htmxDir));
|
|
14263
15066
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
14264
15067
|
}
|
|
14265
15068
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -14271,7 +15074,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14271
15074
|
for (const htmxFile of htmxPageFiles) {
|
|
14272
15075
|
if (hmr)
|
|
14273
15076
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
14274
|
-
const fileName =
|
|
15077
|
+
const fileName = basename9(htmxFile, ".html");
|
|
14275
15078
|
manifest[fileName] = htmxFile;
|
|
14276
15079
|
}
|
|
14277
15080
|
};
|
|
@@ -14320,9 +15123,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14320
15123
|
writeBuildTrace(buildPath);
|
|
14321
15124
|
return { conventions: conventionsMap, manifest };
|
|
14322
15125
|
}
|
|
14323
|
-
writeFileSync7(
|
|
15126
|
+
writeFileSync7(join23(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
14324
15127
|
if (Object.keys(conventionsMap).length > 0) {
|
|
14325
|
-
writeFileSync7(
|
|
15128
|
+
writeFileSync7(join23(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
14326
15129
|
}
|
|
14327
15130
|
writeBuildTrace(buildPath);
|
|
14328
15131
|
if (tailwind && mode === "production") {
|
|
@@ -14418,10 +15221,156 @@ var init_build = __esm(() => {
|
|
|
14418
15221
|
};
|
|
14419
15222
|
});
|
|
14420
15223
|
|
|
15224
|
+
// src/build/buildEmberVendor.ts
|
|
15225
|
+
import { mkdirSync as mkdirSync11, existsSync as existsSync21 } from "fs";
|
|
15226
|
+
import { join as join24 } from "path";
|
|
15227
|
+
import { rm as rm10 } from "fs/promises";
|
|
15228
|
+
var {build: bunBuild8 } = globalThis.Bun;
|
|
15229
|
+
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
15230
|
+
// implementations for macros that would normally be replaced at
|
|
15231
|
+
// compile time by Embroider's babel plugin. AbsoluteJS doesn't run
|
|
15232
|
+
// babel, so working defaults are shipped instead.
|
|
15233
|
+
const isProd = () => {
|
|
15234
|
+
try {
|
|
15235
|
+
return globalThis.process?.env?.NODE_ENV === 'production';
|
|
15236
|
+
} catch {
|
|
15237
|
+
return false;
|
|
15238
|
+
}
|
|
15239
|
+
};
|
|
15240
|
+
|
|
15241
|
+
export const each = (arr) => {
|
|
15242
|
+
if (!Array.isArray(arr)) {
|
|
15243
|
+
throw new Error('the argument to each() must be an array');
|
|
15244
|
+
}
|
|
15245
|
+
return arr;
|
|
15246
|
+
};
|
|
15247
|
+
export const macroCondition = (predicate) => predicate;
|
|
15248
|
+
export const isDevelopingApp = () => !isProd();
|
|
15249
|
+
export const isTesting = () => false;
|
|
15250
|
+
export const setTesting = () => {};
|
|
15251
|
+
export const dependencySatisfies = () => false;
|
|
15252
|
+
export const appEmberSatisfies = () => false;
|
|
15253
|
+
export const getConfig = () => undefined;
|
|
15254
|
+
export const getOwnConfig = () => undefined;
|
|
15255
|
+
export const getGlobalConfig = () => ({});
|
|
15256
|
+
export const config = () => undefined;
|
|
15257
|
+
export const failBuild = (msg) => { throw new Error('failBuild: ' + msg); };
|
|
15258
|
+
export const moduleExists = () => false;
|
|
15259
|
+
export const importSync = (specifier) => {
|
|
15260
|
+
throw new Error('importSync(' + specifier + '): not supported by the AbsoluteJS Ember adapter \u2014 use dynamic import() instead');
|
|
15261
|
+
};
|
|
15262
|
+
`, resolveEmberSpecifier = (specifier, cwd2) => {
|
|
15263
|
+
if (specifier === "@embroider/macros") {
|
|
15264
|
+
return {
|
|
15265
|
+
inlineSource: generateMacrosShim(),
|
|
15266
|
+
resolveTo: "",
|
|
15267
|
+
specifier
|
|
15268
|
+
};
|
|
15269
|
+
}
|
|
15270
|
+
const standaloneSpecifiers = new Set([
|
|
15271
|
+
"@glimmer/component",
|
|
15272
|
+
"@glimmer/tracking",
|
|
15273
|
+
"@simple-dom/serializer"
|
|
15274
|
+
]);
|
|
15275
|
+
if (standaloneSpecifiers.has(specifier)) {
|
|
15276
|
+
return { resolveTo: specifier, specifier };
|
|
15277
|
+
}
|
|
15278
|
+
const emberInternalPath = join24(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
15279
|
+
if (!existsSync21(emberInternalPath)) {
|
|
15280
|
+
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
15281
|
+
}
|
|
15282
|
+
return { resolveTo: emberInternalPath, specifier };
|
|
15283
|
+
}, REQUIRED_EMBER_SPECIFIERS, SPECIFIERS_WITH_DEFAULT_EXPORT, generateVendorEntrySource2 = (resolution) => {
|
|
15284
|
+
if (resolution.inlineSource !== undefined) {
|
|
15285
|
+
return resolution.inlineSource;
|
|
15286
|
+
}
|
|
15287
|
+
const target = JSON.stringify(resolution.resolveTo);
|
|
15288
|
+
const lines = [`export * from ${target};`];
|
|
15289
|
+
if (SPECIFIERS_WITH_DEFAULT_EXPORT.has(resolution.specifier)) {
|
|
15290
|
+
lines.push(`import __default__ from ${target};`);
|
|
15291
|
+
lines.push(`export default __default__;`);
|
|
15292
|
+
}
|
|
15293
|
+
return lines.join(`
|
|
15294
|
+
`) + `
|
|
15295
|
+
`;
|
|
15296
|
+
}, createEmberResolverPlugin = (cwd2, macrosShimPath) => ({
|
|
15297
|
+
name: "absolutejs-ember-resolver",
|
|
15298
|
+
setup(build3) {
|
|
15299
|
+
const standalonePackages = new Set([
|
|
15300
|
+
"@glimmer/component",
|
|
15301
|
+
"@glimmer/tracking",
|
|
15302
|
+
"@glimmer/env",
|
|
15303
|
+
"@simple-dom/serializer"
|
|
15304
|
+
]);
|
|
15305
|
+
build3.onResolve({ filter: /^@embroider\/macros$/ }, () => ({ path: macrosShimPath }));
|
|
15306
|
+
build3.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
15307
|
+
if (standalonePackages.has(args.path)) {
|
|
15308
|
+
return;
|
|
15309
|
+
}
|
|
15310
|
+
const internal = join24(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
15311
|
+
if (existsSync21(internal)) {
|
|
15312
|
+
return { path: internal };
|
|
15313
|
+
}
|
|
15314
|
+
return;
|
|
15315
|
+
});
|
|
15316
|
+
}
|
|
15317
|
+
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
15318
|
+
const vendorDir = join24(buildDir, "ember", "vendor");
|
|
15319
|
+
mkdirSync11(vendorDir, { recursive: true });
|
|
15320
|
+
const tmpDir = join24(buildDir, "_ember_vendor_tmp");
|
|
15321
|
+
mkdirSync11(tmpDir, { recursive: true });
|
|
15322
|
+
const macrosShimPath = join24(tmpDir, "embroider_macros_shim.js");
|
|
15323
|
+
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
15324
|
+
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
15325
|
+
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
15326
|
+
const safeName = toSafeFileName5(resolution.specifier);
|
|
15327
|
+
const entryPath = join24(tmpDir, `${safeName}.js`);
|
|
15328
|
+
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
15329
|
+
` : generateVendorEntrySource2(resolution);
|
|
15330
|
+
await Bun.write(entryPath, source);
|
|
15331
|
+
return entryPath;
|
|
15332
|
+
}));
|
|
15333
|
+
const result = await bunBuild8({
|
|
15334
|
+
entrypoints,
|
|
15335
|
+
format: "esm",
|
|
15336
|
+
minify: false,
|
|
15337
|
+
naming: "[name].[ext]",
|
|
15338
|
+
outdir: vendorDir,
|
|
15339
|
+
plugins: [createEmberResolverPlugin(cwd2, macrosShimPath)],
|
|
15340
|
+
splitting: true,
|
|
15341
|
+
target: "browser",
|
|
15342
|
+
throw: false
|
|
15343
|
+
});
|
|
15344
|
+
await rm10(tmpDir, { force: true, recursive: true });
|
|
15345
|
+
if (!result.success) {
|
|
15346
|
+
console.warn("\u26A0\uFE0F Ember vendor build had errors:", result.logs);
|
|
15347
|
+
}
|
|
15348
|
+
return REQUIRED_EMBER_SPECIFIERS;
|
|
15349
|
+
}, computeEmberVendorPaths = () => {
|
|
15350
|
+
const paths = {};
|
|
15351
|
+
for (const specifier of REQUIRED_EMBER_SPECIFIERS) {
|
|
15352
|
+
paths[specifier] = `/ember/vendor/${toSafeFileName5(specifier)}.js`;
|
|
15353
|
+
}
|
|
15354
|
+
return paths;
|
|
15355
|
+
};
|
|
15356
|
+
var init_buildEmberVendor = __esm(() => {
|
|
15357
|
+
REQUIRED_EMBER_SPECIFIERS = [
|
|
15358
|
+
"@ember/template-compiler",
|
|
15359
|
+
"@ember/renderer",
|
|
15360
|
+
"@glimmer/component",
|
|
15361
|
+
"@glimmer/tracking",
|
|
15362
|
+
"@embroider/macros"
|
|
15363
|
+
];
|
|
15364
|
+
SPECIFIERS_WITH_DEFAULT_EXPORT = new Set([
|
|
15365
|
+
"@glimmer/component",
|
|
15366
|
+
"@simple-dom/serializer"
|
|
15367
|
+
]);
|
|
15368
|
+
});
|
|
15369
|
+
|
|
14421
15370
|
// src/dev/dependencyGraph.ts
|
|
14422
|
-
import { existsSync as
|
|
15371
|
+
import { existsSync as existsSync22, readFileSync as readFileSync14 } from "fs";
|
|
14423
15372
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
14424
|
-
import { resolve as
|
|
15373
|
+
import { resolve as resolve23 } from "path";
|
|
14425
15374
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
14426
15375
|
const lower = filePath.toLowerCase();
|
|
14427
15376
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -14435,8 +15384,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14435
15384
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
14436
15385
|
return null;
|
|
14437
15386
|
}
|
|
14438
|
-
const fromDir =
|
|
14439
|
-
const normalized =
|
|
15387
|
+
const fromDir = resolve23(fromFile, "..");
|
|
15388
|
+
const normalized = resolve23(fromDir, importPath);
|
|
14440
15389
|
const extensions = [
|
|
14441
15390
|
".ts",
|
|
14442
15391
|
".tsx",
|
|
@@ -14449,10 +15398,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14449
15398
|
];
|
|
14450
15399
|
for (const ext of extensions) {
|
|
14451
15400
|
const withExt = normalized + ext;
|
|
14452
|
-
if (
|
|
15401
|
+
if (existsSync22(withExt))
|
|
14453
15402
|
return withExt;
|
|
14454
15403
|
}
|
|
14455
|
-
if (
|
|
15404
|
+
if (existsSync22(normalized))
|
|
14456
15405
|
return normalized;
|
|
14457
15406
|
return null;
|
|
14458
15407
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -14466,8 +15415,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14466
15415
|
dependents.delete(normalizedPath);
|
|
14467
15416
|
}
|
|
14468
15417
|
}, addFileToGraph = (graph, filePath) => {
|
|
14469
|
-
const normalizedPath =
|
|
14470
|
-
if (!
|
|
15418
|
+
const normalizedPath = resolve23(filePath);
|
|
15419
|
+
if (!existsSync22(normalizedPath))
|
|
14471
15420
|
return;
|
|
14472
15421
|
const dependencies = extractDependencies(normalizedPath);
|
|
14473
15422
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -14483,10 +15432,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14483
15432
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
14484
15433
|
const processedFiles = new Set;
|
|
14485
15434
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
14486
|
-
const resolvedDirs = directories.map((dir) =>
|
|
15435
|
+
const resolvedDirs = directories.map((dir) => resolve23(dir)).filter((dir) => existsSync22(dir));
|
|
14487
15436
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
14488
|
-
for (const
|
|
14489
|
-
const fullPath =
|
|
15437
|
+
for (const file5 of allFiles) {
|
|
15438
|
+
const fullPath = resolve23(file5);
|
|
14490
15439
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
14491
15440
|
continue;
|
|
14492
15441
|
if (processedFiles.has(fullPath))
|
|
@@ -14541,8 +15490,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14541
15490
|
resolveRegexMatches(styleUrlSingularRegex, content, filePath, dependencies);
|
|
14542
15491
|
extractStyleUrlsDependencies(content, filePath, dependencies);
|
|
14543
15492
|
}, extractJsDependencies = (filePath, content, loader) => {
|
|
14544
|
-
const
|
|
14545
|
-
const imports =
|
|
15493
|
+
const transpiler5 = loader === "tsx" ? tsTranspiler : jsTranspiler;
|
|
15494
|
+
const imports = transpiler5.scanImports(content);
|
|
14546
15495
|
const dependencies = [];
|
|
14547
15496
|
for (const imp of imports) {
|
|
14548
15497
|
const resolved = resolveImportPath2(imp.path, filePath);
|
|
@@ -14599,7 +15548,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14599
15548
|
return [];
|
|
14600
15549
|
}
|
|
14601
15550
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
14602
|
-
const normalizedPath =
|
|
15551
|
+
const normalizedPath = resolve23(changedFile);
|
|
14603
15552
|
const affected = new Set;
|
|
14604
15553
|
const toProcess = [normalizedPath];
|
|
14605
15554
|
const processNode = (current) => {
|
|
@@ -14639,7 +15588,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
14639
15588
|
}
|
|
14640
15589
|
graph.dependents.delete(normalizedPath);
|
|
14641
15590
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
14642
|
-
const normalizedPath =
|
|
15591
|
+
const normalizedPath = resolve23(filePath);
|
|
14643
15592
|
removeDepsForFile(graph, normalizedPath);
|
|
14644
15593
|
removeDependentsForFile(graph, normalizedPath);
|
|
14645
15594
|
};
|
|
@@ -14682,16 +15631,17 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
14682
15631
|
};
|
|
14683
15632
|
|
|
14684
15633
|
// src/dev/configResolver.ts
|
|
14685
|
-
import { resolve as
|
|
15634
|
+
import { resolve as resolve24 } from "path";
|
|
14686
15635
|
var resolveBuildPaths = (config) => {
|
|
14687
15636
|
const cwd2 = process.cwd();
|
|
14688
15637
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
14689
|
-
const withDefault = (value, fallback) => normalize(
|
|
14690
|
-
const optional = (value) => value ? normalize(
|
|
15638
|
+
const withDefault = (value, fallback) => normalize(resolve24(cwd2, value ?? fallback));
|
|
15639
|
+
const optional = (value) => value ? normalize(resolve24(cwd2, value)) : undefined;
|
|
14691
15640
|
return {
|
|
14692
15641
|
angularDir: optional(config.angularDirectory),
|
|
14693
15642
|
assetsDir: optional(config.assetsDirectory),
|
|
14694
15643
|
buildDir: withDefault(config.buildDirectory, "build"),
|
|
15644
|
+
emberDir: optional(config.emberDirectory),
|
|
14695
15645
|
htmlDir: optional(config.htmlDirectory),
|
|
14696
15646
|
htmxDir: optional(config.htmxDirectory),
|
|
14697
15647
|
reactDir: optional(config.reactDirectory),
|
|
@@ -14758,6 +15708,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14758
15708
|
return "vue";
|
|
14759
15709
|
if (startsWithDir(resolved.angularDir))
|
|
14760
15710
|
return "angular";
|
|
15711
|
+
if (startsWithDir(resolved.emberDir))
|
|
15712
|
+
return "ember";
|
|
14761
15713
|
if (startsWithDir(resolved.htmlDir))
|
|
14762
15714
|
return "html";
|
|
14763
15715
|
if (startsWithDir(resolved.assetsDir))
|
|
@@ -14773,6 +15725,8 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14773
15725
|
return "vue";
|
|
14774
15726
|
if (normalized.includes("/angular/"))
|
|
14775
15727
|
return "angular";
|
|
15728
|
+
if (normalized.includes("/ember/"))
|
|
15729
|
+
return "ember";
|
|
14776
15730
|
if (normalized.includes("/html/"))
|
|
14777
15731
|
return "html";
|
|
14778
15732
|
}
|
|
@@ -14782,10 +15736,14 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14782
15736
|
return "svelte";
|
|
14783
15737
|
if (normalized.endsWith(".vue"))
|
|
14784
15738
|
return "vue";
|
|
15739
|
+
if (normalized.endsWith(".gjs") || normalized.endsWith(".gts"))
|
|
15740
|
+
return "ember";
|
|
14785
15741
|
if (normalized.endsWith(".html"))
|
|
14786
15742
|
return "html";
|
|
14787
15743
|
if (normalized.endsWith(".ts") && normalized.includes("angular"))
|
|
14788
15744
|
return "angular";
|
|
15745
|
+
if (normalized.endsWith(".ts") && normalized.includes("ember"))
|
|
15746
|
+
return "ember";
|
|
14789
15747
|
if (normalized.includes("/assets/"))
|
|
14790
15748
|
return "assets";
|
|
14791
15749
|
if (STYLE_EXTENSION_PATTERN2.test(normalized)) {
|
|
@@ -14830,6 +15788,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14830
15788
|
const cfg = resolved ?? {
|
|
14831
15789
|
angularDir: config.angularDirectory,
|
|
14832
15790
|
assetsDir: config.assetsDirectory,
|
|
15791
|
+
emberDir: config.emberDirectory,
|
|
14833
15792
|
htmlDir: config.htmlDirectory,
|
|
14834
15793
|
htmxDir: config.htmxDirectory,
|
|
14835
15794
|
reactDir: config.reactDirectory,
|
|
@@ -14840,6 +15799,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14840
15799
|
push(cfg.reactDir);
|
|
14841
15800
|
push(cfg.svelteDir);
|
|
14842
15801
|
push(cfg.vueDir);
|
|
15802
|
+
push(cfg.emberDir);
|
|
14843
15803
|
push(cfg.angularDir);
|
|
14844
15804
|
push(cfg.htmlDir, "pages");
|
|
14845
15805
|
push(cfg.htmlDir, "scripts");
|
|
@@ -14854,6 +15814,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
14854
15814
|
cfg.svelteDir,
|
|
14855
15815
|
cfg.vueDir,
|
|
14856
15816
|
cfg.angularDir,
|
|
15817
|
+
cfg.emberDir,
|
|
14857
15818
|
cfg.htmlDir,
|
|
14858
15819
|
cfg.htmxDir
|
|
14859
15820
|
].filter((dir) => Boolean(dir)).map(normalizePath);
|
|
@@ -14876,8 +15837,8 @@ var init_pathUtils = __esm(() => {
|
|
|
14876
15837
|
|
|
14877
15838
|
// src/dev/fileWatcher.ts
|
|
14878
15839
|
import { watch } from "fs";
|
|
14879
|
-
import { existsSync as
|
|
14880
|
-
import { join as
|
|
15840
|
+
import { existsSync as existsSync23 } from "fs";
|
|
15841
|
+
import { join as join25, resolve as resolve25 } from "path";
|
|
14881
15842
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
14882
15843
|
try {
|
|
14883
15844
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -14904,16 +15865,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14904
15865
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
14905
15866
|
return;
|
|
14906
15867
|
}
|
|
14907
|
-
const fullPath =
|
|
15868
|
+
const fullPath = join25(absolutePath, filename).replace(/\\/g, "/");
|
|
14908
15869
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
14909
15870
|
return;
|
|
14910
15871
|
}
|
|
14911
|
-
if (event === "rename" && !
|
|
15872
|
+
if (event === "rename" && !existsSync23(fullPath)) {
|
|
14912
15873
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
14913
15874
|
onFileChange(fullPath);
|
|
14914
15875
|
return;
|
|
14915
15876
|
}
|
|
14916
|
-
if (
|
|
15877
|
+
if (existsSync23(fullPath)) {
|
|
14917
15878
|
onFileChange(fullPath);
|
|
14918
15879
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
14919
15880
|
}
|
|
@@ -14922,8 +15883,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14922
15883
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
14923
15884
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
14924
15885
|
paths.forEach((path) => {
|
|
14925
|
-
const absolutePath =
|
|
14926
|
-
if (!
|
|
15886
|
+
const absolutePath = resolve25(path).replace(/\\/g, "/");
|
|
15887
|
+
if (!existsSync23(absolutePath)) {
|
|
14927
15888
|
return;
|
|
14928
15889
|
}
|
|
14929
15890
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -14933,8 +15894,8 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14933
15894
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
14934
15895
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
14935
15896
|
watchPaths.forEach((path) => {
|
|
14936
|
-
const absolutePath =
|
|
14937
|
-
if (!
|
|
15897
|
+
const absolutePath = resolve25(path).replace(/\\/g, "/");
|
|
15898
|
+
if (!existsSync23(absolutePath)) {
|
|
14938
15899
|
return;
|
|
14939
15900
|
}
|
|
14940
15901
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -14948,13 +15909,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
14948
15909
|
});
|
|
14949
15910
|
|
|
14950
15911
|
// src/dev/assetStore.ts
|
|
14951
|
-
import { resolve as
|
|
15912
|
+
import { resolve as resolve26 } from "path";
|
|
14952
15913
|
import { readdir as readdir3, unlink } from "fs/promises";
|
|
14953
15914
|
var mimeTypes, getMimeType = (filePath) => {
|
|
14954
15915
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
14955
15916
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
14956
15917
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
14957
|
-
const fullPath =
|
|
15918
|
+
const fullPath = resolve26(dir, entry.name);
|
|
14958
15919
|
if (entry.isDirectory()) {
|
|
14959
15920
|
return walkAndClean(fullPath);
|
|
14960
15921
|
}
|
|
@@ -14970,10 +15931,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
14970
15931
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
14971
15932
|
const liveByIdentity = new Map;
|
|
14972
15933
|
for (const webPath of store.keys()) {
|
|
14973
|
-
const diskPath =
|
|
15934
|
+
const diskPath = resolve26(buildDir, webPath.slice(1));
|
|
14974
15935
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
14975
15936
|
}
|
|
14976
|
-
const absBuildDir =
|
|
15937
|
+
const absBuildDir = resolve26(buildDir);
|
|
14977
15938
|
Object.values(manifest).forEach((val) => {
|
|
14978
15939
|
if (!HASHED_FILE_RE.test(val))
|
|
14979
15940
|
return;
|
|
@@ -14991,7 +15952,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
14991
15952
|
} catch {}
|
|
14992
15953
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
14993
15954
|
if (entry.isDirectory()) {
|
|
14994
|
-
return scanDir(
|
|
15955
|
+
return scanDir(resolve26(dir, entry.name), `${prefix}${entry.name}/`);
|
|
14995
15956
|
}
|
|
14996
15957
|
if (!entry.name.startsWith("chunk-")) {
|
|
14997
15958
|
return null;
|
|
@@ -15000,7 +15961,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
15000
15961
|
if (store.has(webPath)) {
|
|
15001
15962
|
return null;
|
|
15002
15963
|
}
|
|
15003
|
-
return Bun.file(
|
|
15964
|
+
return Bun.file(resolve26(dir, entry.name)).bytes().then((bytes) => {
|
|
15004
15965
|
store.set(webPath, bytes);
|
|
15005
15966
|
return;
|
|
15006
15967
|
}).catch(() => {});
|
|
@@ -15022,7 +15983,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
15022
15983
|
for (const webPath of newIdentities.values()) {
|
|
15023
15984
|
if (store.has(webPath))
|
|
15024
15985
|
continue;
|
|
15025
|
-
loadPromises.push(Bun.file(
|
|
15986
|
+
loadPromises.push(Bun.file(resolve26(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
15026
15987
|
store.set(webPath, bytes);
|
|
15027
15988
|
return;
|
|
15028
15989
|
}).catch(() => {}));
|
|
@@ -15135,9 +16096,9 @@ var init_transformCache = __esm(() => {
|
|
|
15135
16096
|
});
|
|
15136
16097
|
|
|
15137
16098
|
// src/dev/reactComponentClassifier.ts
|
|
15138
|
-
import { resolve as
|
|
16099
|
+
import { resolve as resolve27 } from "path";
|
|
15139
16100
|
var classifyComponent = (filePath) => {
|
|
15140
|
-
const normalizedPath =
|
|
16101
|
+
const normalizedPath = resolve27(filePath);
|
|
15141
16102
|
if (normalizedPath.includes("/react/pages/")) {
|
|
15142
16103
|
return "server";
|
|
15143
16104
|
}
|
|
@@ -15149,7 +16110,7 @@ var classifyComponent = (filePath) => {
|
|
|
15149
16110
|
var init_reactComponentClassifier = () => {};
|
|
15150
16111
|
|
|
15151
16112
|
// src/dev/moduleMapper.ts
|
|
15152
|
-
import { basename as
|
|
16113
|
+
import { basename as basename10, resolve as resolve28 } from "path";
|
|
15153
16114
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
15154
16115
|
const modulePaths = {};
|
|
15155
16116
|
moduleKeys.forEach((key) => {
|
|
@@ -15159,7 +16120,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
15159
16120
|
});
|
|
15160
16121
|
return modulePaths;
|
|
15161
16122
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
15162
|
-
const normalizedFile =
|
|
16123
|
+
const normalizedFile = resolve28(sourceFile);
|
|
15163
16124
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
15164
16125
|
if (processedFiles.has(normalizedFile)) {
|
|
15165
16126
|
return null;
|
|
@@ -15195,8 +16156,8 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
15195
16156
|
});
|
|
15196
16157
|
return grouped;
|
|
15197
16158
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
15198
|
-
const normalizedFile =
|
|
15199
|
-
const fileName =
|
|
16159
|
+
const normalizedFile = resolve28(sourceFile);
|
|
16160
|
+
const fileName = basename10(normalizedFile);
|
|
15200
16161
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
15201
16162
|
const pascalName = toPascal(baseName);
|
|
15202
16163
|
const keys = [];
|
|
@@ -15365,8 +16326,8 @@ __export(exports_moduleServer, {
|
|
|
15365
16326
|
createModuleServer: () => createModuleServer,
|
|
15366
16327
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
15367
16328
|
});
|
|
15368
|
-
import { existsSync as
|
|
15369
|
-
import { basename as
|
|
16329
|
+
import { existsSync as existsSync24, readFileSync as readFileSync16, statSync as statSync2 } from "fs";
|
|
16330
|
+
import { basename as basename11, dirname as dirname16, extname as extname8, join as join26, resolve as resolve29, relative as relative11 } from "path";
|
|
15370
16331
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
15371
16332
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
15372
16333
|
const allExports = [];
|
|
@@ -15386,7 +16347,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
15386
16347
|
${stubs}
|
|
15387
16348
|
`;
|
|
15388
16349
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
15389
|
-
const found = extensions.find((ext) =>
|
|
16350
|
+
const found = extensions.find((ext) => existsSync24(resolve29(projectRoot, srcPath + ext)));
|
|
15390
16351
|
return found ? srcPath + found : srcPath;
|
|
15391
16352
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
15392
16353
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -15401,7 +16362,7 @@ ${stubs}
|
|
|
15401
16362
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
15402
16363
|
}, srcUrl = (relPath, projectRoot) => {
|
|
15403
16364
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
15404
|
-
const absPath =
|
|
16365
|
+
const absPath = resolve29(projectRoot, relPath);
|
|
15405
16366
|
const cached = mtimeCache.get(absPath);
|
|
15406
16367
|
if (cached !== undefined)
|
|
15407
16368
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -15413,12 +16374,12 @@ ${stubs}
|
|
|
15413
16374
|
return base;
|
|
15414
16375
|
}
|
|
15415
16376
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
15416
|
-
const absPath =
|
|
16377
|
+
const absPath = resolve29(fileDir, relPath);
|
|
15417
16378
|
const rel = relative11(projectRoot, absPath);
|
|
15418
|
-
const extension =
|
|
16379
|
+
const extension = extname8(rel);
|
|
15419
16380
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
15420
|
-
if (
|
|
15421
|
-
srcPath = relative11(projectRoot, resolveSvelteModulePath(
|
|
16381
|
+
if (extname8(srcPath) === ".svelte") {
|
|
16382
|
+
srcPath = relative11(projectRoot, resolveSvelteModulePath(resolve29(projectRoot, srcPath)));
|
|
15422
16383
|
}
|
|
15423
16384
|
return srcUrl(srcPath, projectRoot);
|
|
15424
16385
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -15435,14 +16396,14 @@ ${stubs}
|
|
|
15435
16396
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
15436
16397
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
15437
16398
|
if (!subpath) {
|
|
15438
|
-
const pkgDir =
|
|
15439
|
-
const pkgJsonPath =
|
|
15440
|
-
if (
|
|
16399
|
+
const pkgDir = resolve29(projectRoot, "node_modules", packageName ?? "");
|
|
16400
|
+
const pkgJsonPath = join26(pkgDir, "package.json");
|
|
16401
|
+
if (existsSync24(pkgJsonPath)) {
|
|
15441
16402
|
const pkg = JSON.parse(readFileSync16(pkgJsonPath, "utf-8"));
|
|
15442
16403
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
15443
16404
|
if (esmEntry) {
|
|
15444
|
-
const resolved =
|
|
15445
|
-
if (
|
|
16405
|
+
const resolved = resolve29(pkgDir, esmEntry);
|
|
16406
|
+
if (existsSync24(resolved))
|
|
15446
16407
|
return relative11(projectRoot, resolved);
|
|
15447
16408
|
}
|
|
15448
16409
|
}
|
|
@@ -15473,7 +16434,7 @@ ${stubs}
|
|
|
15473
16434
|
};
|
|
15474
16435
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
15475
16436
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
15476
|
-
const fileDir =
|
|
16437
|
+
const fileDir = dirname16(filePath);
|
|
15477
16438
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
15478
16439
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
15479
16440
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
@@ -15486,12 +16447,12 @@ ${stubs}
|
|
|
15486
16447
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
15487
16448
|
});
|
|
15488
16449
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
15489
|
-
const absPath =
|
|
16450
|
+
const absPath = resolve29(fileDir, relPath);
|
|
15490
16451
|
const rel = relative11(projectRoot, absPath);
|
|
15491
16452
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
15492
16453
|
});
|
|
15493
16454
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
15494
|
-
const absPath =
|
|
16455
|
+
const absPath = resolve29(fileDir, relPath);
|
|
15495
16456
|
const rel = relative11(projectRoot, absPath);
|
|
15496
16457
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
15497
16458
|
});
|
|
@@ -15554,16 +16515,16 @@ ${transpiled}`;
|
|
|
15554
16515
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
15555
16516
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
15556
16517
|
const raw = readFileSync16(filePath, "utf-8");
|
|
15557
|
-
const ext =
|
|
16518
|
+
const ext = extname8(filePath);
|
|
15558
16519
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
15559
16520
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
15560
|
-
let
|
|
16521
|
+
let transpiler5 = jsTranspiler2;
|
|
15561
16522
|
if (isTSX)
|
|
15562
|
-
|
|
16523
|
+
transpiler5 = tsxTranspiler;
|
|
15563
16524
|
else if (isTS)
|
|
15564
|
-
|
|
15565
|
-
const valueExports = isTS ?
|
|
15566
|
-
let transpiled =
|
|
16525
|
+
transpiler5 = tsTranspiler2;
|
|
16526
|
+
const valueExports = isTS ? transpiler5.scan(raw).exports : [];
|
|
16527
|
+
let transpiled = transpiler5.transformSync(raw);
|
|
15567
16528
|
if (isTS) {
|
|
15568
16529
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
15569
16530
|
}
|
|
@@ -15779,17 +16740,19 @@ export default __script__;`;
|
|
|
15779
16740
|
return `${cssInjection}
|
|
15780
16741
|
${code}`;
|
|
15781
16742
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
15782
|
-
const
|
|
16743
|
+
const rawSource = readFileSync16(filePath, "utf-8");
|
|
16744
|
+
const raw = addAutoRouterSetupApp(rawSource);
|
|
15783
16745
|
if (!vueCompiler) {
|
|
15784
16746
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
15785
16747
|
}
|
|
15786
|
-
const fileName =
|
|
16748
|
+
const fileName = basename11(filePath, ".vue");
|
|
15787
16749
|
const componentId = fileName.toLowerCase();
|
|
15788
16750
|
const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
|
|
15789
|
-
const
|
|
16751
|
+
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
16752
|
+
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
15790
16753
|
id: componentId,
|
|
15791
16754
|
inlineTemplate: false
|
|
15792
|
-
});
|
|
16755
|
+
}) : { bindings: {}, content: "export default {};" };
|
|
15793
16756
|
const compiledSfcScript = {
|
|
15794
16757
|
bindings: compiledScript.bindings ?? {},
|
|
15795
16758
|
content: compiledScript.content
|
|
@@ -15800,7 +16763,7 @@ ${code}`;
|
|
|
15800
16763
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
15801
16764
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
15802
16765
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
15803
|
-
const hmrBase = vueDir ?
|
|
16766
|
+
const hmrBase = vueDir ? resolve29(vueDir) : projectRoot;
|
|
15804
16767
|
const hmrId = relative11(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
15805
16768
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
15806
16769
|
result += [
|
|
@@ -15815,11 +16778,11 @@ ${code}`;
|
|
|
15815
16778
|
`);
|
|
15816
16779
|
return result;
|
|
15817
16780
|
}, resolveSvelteModulePath = (path) => {
|
|
15818
|
-
if (
|
|
16781
|
+
if (existsSync24(path))
|
|
15819
16782
|
return path;
|
|
15820
|
-
if (
|
|
16783
|
+
if (existsSync24(`${path}.ts`))
|
|
15821
16784
|
return `${path}.ts`;
|
|
15822
|
-
if (
|
|
16785
|
+
if (existsSync24(`${path}.js`))
|
|
15823
16786
|
return `${path}.js`;
|
|
15824
16787
|
return path;
|
|
15825
16788
|
}, jsResponse = (body) => {
|
|
@@ -15959,13 +16922,13 @@ export default {};
|
|
|
15959
16922
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
15960
16923
|
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);`);
|
|
15961
16924
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
15962
|
-
const filePath =
|
|
15963
|
-
const ext =
|
|
16925
|
+
const filePath = resolve29(projectRoot, relPath);
|
|
16926
|
+
const ext = extname8(filePath);
|
|
15964
16927
|
if (ext === ".svelte")
|
|
15965
16928
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
15966
16929
|
if (ext)
|
|
15967
16930
|
return { ext, filePath };
|
|
15968
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
16931
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync24(filePath + candidate));
|
|
15969
16932
|
if (!found)
|
|
15970
16933
|
return { ext, filePath };
|
|
15971
16934
|
const resolved = filePath + found;
|
|
@@ -15986,7 +16949,7 @@ export default {};
|
|
|
15986
16949
|
if (!TRANSPILABLE.has(ext))
|
|
15987
16950
|
return;
|
|
15988
16951
|
const stat4 = statSync2(filePath);
|
|
15989
|
-
const resolvedVueDir = vueDir ?
|
|
16952
|
+
const resolvedVueDir = vueDir ? resolve29(vueDir) : undefined;
|
|
15990
16953
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
15991
16954
|
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
15992
16955
|
return jsResponse(content);
|
|
@@ -16017,7 +16980,7 @@ export default {};
|
|
|
16017
16980
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
16018
16981
|
return;
|
|
16019
16982
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
16020
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
16983
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve29(projectRoot, relPath));
|
|
16021
16984
|
if (virtualCssResponse)
|
|
16022
16985
|
return virtualCssResponse;
|
|
16023
16986
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -16033,11 +16996,11 @@ export default {};
|
|
|
16033
16996
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
16034
16997
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
16035
16998
|
if (match[1])
|
|
16036
|
-
files.push(
|
|
16999
|
+
files.push(resolve29(projectRoot, match[1]));
|
|
16037
17000
|
}
|
|
16038
17001
|
return files;
|
|
16039
17002
|
}, invalidateModule = (filePath) => {
|
|
16040
|
-
const resolved =
|
|
17003
|
+
const resolved = resolve29(filePath);
|
|
16041
17004
|
invalidate(filePath);
|
|
16042
17005
|
if (resolved !== filePath)
|
|
16043
17006
|
invalidate(resolved);
|
|
@@ -16055,6 +17018,7 @@ export default {};
|
|
|
16055
17018
|
var init_moduleServer = __esm(() => {
|
|
16056
17019
|
init_constants();
|
|
16057
17020
|
init_resolvePackageImport();
|
|
17021
|
+
init_vueAutoRouterTransform();
|
|
16058
17022
|
init_sourceMetadata();
|
|
16059
17023
|
init_stylePreprocessor();
|
|
16060
17024
|
init_lowerAwaitSlotSyntax();
|
|
@@ -16111,21 +17075,147 @@ var init_moduleServer = __esm(() => {
|
|
|
16111
17075
|
SRC_URL_PREFIX = SRC_PREFIX;
|
|
16112
17076
|
});
|
|
16113
17077
|
|
|
17078
|
+
// src/utils/ssrErrorPage.ts
|
|
17079
|
+
var ssrErrorPage = (framework, error) => {
|
|
17080
|
+
const frameworkColors2 = {
|
|
17081
|
+
angular: "#dd0031",
|
|
17082
|
+
html: "#e34c26",
|
|
17083
|
+
htmx: "#1a365d",
|
|
17084
|
+
react: "#61dafb",
|
|
17085
|
+
svelte: "#ff3e00",
|
|
17086
|
+
vue: "#42b883"
|
|
17087
|
+
};
|
|
17088
|
+
const accent = frameworkColors2[framework] ?? "#94a3b8";
|
|
17089
|
+
const label = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
17090
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
17091
|
+
return `<!DOCTYPE html>
|
|
17092
|
+
<html>
|
|
17093
|
+
<head>
|
|
17094
|
+
<meta charset="utf-8">
|
|
17095
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
17096
|
+
<title>SSR Error - AbsoluteJS</title>
|
|
17097
|
+
<style>
|
|
17098
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
17099
|
+
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}
|
|
17100
|
+
.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}
|
|
17101
|
+
.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)}
|
|
17102
|
+
.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}
|
|
17103
|
+
.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)}
|
|
17104
|
+
.kind{color:#94a3b8;font-size:13px;font-weight:500}
|
|
17105
|
+
.content{padding:24px}
|
|
17106
|
+
.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}
|
|
17107
|
+
.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}
|
|
17108
|
+
.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}
|
|
17109
|
+
</style>
|
|
17110
|
+
</head>
|
|
17111
|
+
<body>
|
|
17112
|
+
<div class="card">
|
|
17113
|
+
<div class="header">
|
|
17114
|
+
<div style="display:flex;align-items:center;gap:12px">
|
|
17115
|
+
<span class="brand">AbsoluteJS</span>
|
|
17116
|
+
<span class="badge">${label}</span>
|
|
17117
|
+
</div>
|
|
17118
|
+
<span class="kind">Server Render Error</span>
|
|
17119
|
+
</div>
|
|
17120
|
+
<div class="content">
|
|
17121
|
+
<div class="label">What went wrong</div>
|
|
17122
|
+
<pre class="message">${message.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</pre>
|
|
17123
|
+
<div class="hint">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>
|
|
17124
|
+
</div>
|
|
17125
|
+
</div>
|
|
17126
|
+
</body>
|
|
17127
|
+
</html>`;
|
|
17128
|
+
};
|
|
17129
|
+
|
|
17130
|
+
// src/ember/pageHandler.ts
|
|
17131
|
+
import { pathToFileURL } from "url";
|
|
17132
|
+
var resolveRequestPathname = (request) => {
|
|
17133
|
+
if (!request)
|
|
17134
|
+
return;
|
|
17135
|
+
try {
|
|
17136
|
+
const parsed = new URL(request.url);
|
|
17137
|
+
return `${parsed.pathname}${parsed.search}`;
|
|
17138
|
+
} catch {
|
|
17139
|
+
return;
|
|
17140
|
+
}
|
|
17141
|
+
}, installSimpleDomGlobals = () => {
|
|
17142
|
+
const g2 = globalThis;
|
|
17143
|
+
if (typeof g2.Element === "undefined") {
|
|
17144
|
+
g2.Element = class Element {
|
|
17145
|
+
};
|
|
17146
|
+
}
|
|
17147
|
+
if (typeof g2.Node === "undefined") {
|
|
17148
|
+
g2.Node = class Node {
|
|
17149
|
+
};
|
|
17150
|
+
}
|
|
17151
|
+
}, emberCacheBuster = 0, buildRuntimeModuleSpecifier = (modulePath) => {
|
|
17152
|
+
if (emberCacheBuster === 0)
|
|
17153
|
+
return modulePath;
|
|
17154
|
+
const moduleUrl = new URL(pathToFileURL(modulePath).href);
|
|
17155
|
+
moduleUrl.searchParams.set("t", String(emberCacheBuster));
|
|
17156
|
+
return moduleUrl.href;
|
|
17157
|
+
}, invalidateEmberSsrCache = () => {
|
|
17158
|
+
markSsrCacheDirty("ember");
|
|
17159
|
+
emberCacheBuster = Date.now();
|
|
17160
|
+
}, buildHtmlShell = (headTag, bodyContent, indexPath, props) => {
|
|
17161
|
+
const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
|
|
17162
|
+
const indexImport = indexPath ? `<script type="module" src="${indexPath}"></script>` : "";
|
|
17163
|
+
return `<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>` + indexImport + `</body></html>`;
|
|
17164
|
+
}, handleEmberPageRequest = async (input) => {
|
|
17165
|
+
const { indexPath, pagePath, headTag } = input;
|
|
17166
|
+
const userProps = input.props;
|
|
17167
|
+
const requestPathname = resolveRequestPathname(input.request);
|
|
17168
|
+
const props = requestPathname !== undefined && (!userProps || !("url" in userProps)) ? { ...userProps ?? {}, url: requestPathname } : userProps;
|
|
17169
|
+
const resolvedHeadTag = headTag ?? "<head></head>";
|
|
17170
|
+
try {
|
|
17171
|
+
installSimpleDomGlobals();
|
|
17172
|
+
isSsrCacheDirty("ember");
|
|
17173
|
+
const bundle = await import(buildRuntimeModuleSpecifier(pagePath));
|
|
17174
|
+
if (typeof bundle.renderToHTML !== "function") {
|
|
17175
|
+
throw new Error(`Ember page bundle at ${pagePath} does not export renderToHTML(). Was it compiled by compileEmber()?`);
|
|
17176
|
+
}
|
|
17177
|
+
const innerHtml = bundle.renderToHTML(props ?? {});
|
|
17178
|
+
const html = buildHtmlShell(resolvedHeadTag, innerHtml.replace(/^<div>|<\/div>$/g, ""), indexPath, props);
|
|
17179
|
+
return new Response(html, {
|
|
17180
|
+
headers: { "Content-Type": "text/html" }
|
|
17181
|
+
});
|
|
17182
|
+
} catch (error) {
|
|
17183
|
+
console.error("[SSR] Ember render error:", error);
|
|
17184
|
+
return new Response(ssrErrorPage("ember", error), {
|
|
17185
|
+
headers: { "Content-Type": "text/html" },
|
|
17186
|
+
status: 500
|
|
17187
|
+
});
|
|
17188
|
+
}
|
|
17189
|
+
};
|
|
17190
|
+
var init_pageHandler = __esm(() => {
|
|
17191
|
+
init_ssrCache();
|
|
17192
|
+
});
|
|
17193
|
+
|
|
17194
|
+
// src/ember/index.ts
|
|
17195
|
+
var exports_ember = {};
|
|
17196
|
+
__export(exports_ember, {
|
|
17197
|
+
invalidateEmberSsrCache: () => invalidateEmberSsrCache,
|
|
17198
|
+
handleEmberPageRequest: () => handleEmberPageRequest
|
|
17199
|
+
});
|
|
17200
|
+
var init_ember = __esm(() => {
|
|
17201
|
+
init_pageHandler();
|
|
17202
|
+
});
|
|
17203
|
+
|
|
16114
17204
|
// src/dev/simpleHTMLHMR.ts
|
|
16115
17205
|
var exports_simpleHTMLHMR = {};
|
|
16116
17206
|
__export(exports_simpleHTMLHMR, {
|
|
16117
17207
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
16118
17208
|
});
|
|
16119
|
-
import { resolve as
|
|
17209
|
+
import { resolve as resolve30 } from "path";
|
|
16120
17210
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
16121
17211
|
let htmlContent;
|
|
16122
17212
|
try {
|
|
16123
|
-
const resolvedPath =
|
|
16124
|
-
const
|
|
16125
|
-
if (!await
|
|
17213
|
+
const resolvedPath = resolve30(htmlFilePath);
|
|
17214
|
+
const file5 = Bun.file(resolvedPath);
|
|
17215
|
+
if (!await file5.exists()) {
|
|
16126
17216
|
return null;
|
|
16127
17217
|
}
|
|
16128
|
-
htmlContent = await
|
|
17218
|
+
htmlContent = await file5.text();
|
|
16129
17219
|
} catch {
|
|
16130
17220
|
return null;
|
|
16131
17221
|
}
|
|
@@ -16146,16 +17236,16 @@ var exports_simpleHTMXHMR = {};
|
|
|
16146
17236
|
__export(exports_simpleHTMXHMR, {
|
|
16147
17237
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
16148
17238
|
});
|
|
16149
|
-
import { resolve as
|
|
17239
|
+
import { resolve as resolve31 } from "path";
|
|
16150
17240
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
16151
17241
|
let htmlContent;
|
|
16152
17242
|
try {
|
|
16153
|
-
const resolvedPath =
|
|
16154
|
-
const
|
|
16155
|
-
if (!await
|
|
17243
|
+
const resolvedPath = resolve31(htmxFilePath);
|
|
17244
|
+
const file5 = Bun.file(resolvedPath);
|
|
17245
|
+
if (!await file5.exists()) {
|
|
16156
17246
|
return null;
|
|
16157
17247
|
}
|
|
16158
|
-
htmlContent = await
|
|
17248
|
+
htmlContent = await file5.text();
|
|
16159
17249
|
} catch {
|
|
16160
17250
|
return null;
|
|
16161
17251
|
}
|
|
@@ -16172,8 +17262,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
16172
17262
|
var init_simpleHTMXHMR = () => {};
|
|
16173
17263
|
|
|
16174
17264
|
// src/dev/rebuildTrigger.ts
|
|
16175
|
-
import { existsSync as
|
|
16176
|
-
import { basename as
|
|
17265
|
+
import { existsSync as existsSync25 } from "fs";
|
|
17266
|
+
import { basename as basename12, dirname as dirname17, relative as relative12, resolve as resolve32 } from "path";
|
|
16177
17267
|
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) => {
|
|
16178
17268
|
if (!config.tailwind)
|
|
16179
17269
|
return;
|
|
@@ -16197,16 +17287,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16197
17287
|
}, parseErrorLocationFromMessage = (msg) => {
|
|
16198
17288
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
16199
17289
|
if (pathLineCol) {
|
|
16200
|
-
const [,
|
|
17290
|
+
const [, file5, lineStr, colStr] = pathLineCol;
|
|
16201
17291
|
return {
|
|
16202
17292
|
column: colStr ? parseInt(colStr, 10) : undefined,
|
|
16203
|
-
file:
|
|
17293
|
+
file: file5,
|
|
16204
17294
|
line: lineStr ? parseInt(lineStr, 10) : undefined
|
|
16205
17295
|
};
|
|
16206
17296
|
}
|
|
16207
17297
|
const atMatch = msg.match(/(?:at|in)\s+([^(:\s]+)(?:\s*\([^)]*line\s*(\d+)[^)]*col(?:umn)?\s*(\d+)[^)]*\)|:(\d+):(\d+)?)/i);
|
|
16208
17298
|
if (atMatch) {
|
|
16209
|
-
const [,
|
|
17299
|
+
const [, file5, line1, col1, line2, col2] = atMatch;
|
|
16210
17300
|
let parsedCol;
|
|
16211
17301
|
if (col1)
|
|
16212
17302
|
parsedCol = parseInt(col1, 10);
|
|
@@ -16219,16 +17309,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16219
17309
|
parsedLine = parseInt(line2, 10);
|
|
16220
17310
|
return {
|
|
16221
17311
|
column: parsedCol,
|
|
16222
|
-
file:
|
|
17312
|
+
file: file5?.trim(),
|
|
16223
17313
|
line: parsedLine
|
|
16224
17314
|
};
|
|
16225
17315
|
}
|
|
16226
17316
|
const parenMatch = msg.match(/([^\s(]+)\s*\([^)]*line\s*(\d+)[^)]*col(?:umn)?\s*(\d+)/i);
|
|
16227
17317
|
if (parenMatch) {
|
|
16228
|
-
const [,
|
|
17318
|
+
const [, file5, lineStr, colStr] = parenMatch;
|
|
16229
17319
|
return {
|
|
16230
17320
|
column: colStr ? parseInt(colStr, 10) : undefined,
|
|
16231
|
-
file:
|
|
17321
|
+
file: file5 ?? undefined,
|
|
16232
17322
|
line: lineStr ? parseInt(lineStr, 10) : undefined
|
|
16233
17323
|
};
|
|
16234
17324
|
}
|
|
@@ -16240,14 +17330,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16240
17330
|
if (logs && Array.isArray(logs) && logs.length > 0) {
|
|
16241
17331
|
const errLog = logs.find((l4) => l4.level === "error") ?? logs[0];
|
|
16242
17332
|
const pos = errLog?.position;
|
|
16243
|
-
const
|
|
17333
|
+
const file5 = pos?.file;
|
|
16244
17334
|
const line = pos?.line;
|
|
16245
17335
|
const column = pos?.column;
|
|
16246
17336
|
const lineText = pos?.lineText;
|
|
16247
|
-
const framework =
|
|
17337
|
+
const framework = file5 && resolvedPaths ? detectFramework(file5, resolvedPaths) : affectedFrameworks[0] ?? "unknown";
|
|
16248
17338
|
return {
|
|
16249
17339
|
column,
|
|
16250
|
-
file:
|
|
17340
|
+
file: file5,
|
|
16251
17341
|
framework: framework !== "ignored" ? framework : affectedFrameworks[0],
|
|
16252
17342
|
line,
|
|
16253
17343
|
lineText
|
|
@@ -16261,11 +17351,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16261
17351
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
16262
17352
|
}
|
|
16263
17353
|
return { ...parsed, framework: detectedFw };
|
|
16264
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
17354
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync25(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
|
|
16265
17355
|
state.fileHashes.delete(filePathInSet);
|
|
16266
17356
|
try {
|
|
16267
17357
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
16268
|
-
const deletedPathResolved =
|
|
17358
|
+
const deletedPathResolved = resolve32(filePathInSet);
|
|
16269
17359
|
affectedFiles.forEach((affectedFile) => {
|
|
16270
17360
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
16271
17361
|
validFiles.push(affectedFile);
|
|
@@ -16279,7 +17369,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16279
17369
|
if (!dependents || dependents.size === 0) {
|
|
16280
17370
|
return;
|
|
16281
17371
|
}
|
|
16282
|
-
const dependentFiles = Array.from(dependents).filter((
|
|
17372
|
+
const dependentFiles = Array.from(dependents).filter((file5) => existsSync25(file5));
|
|
16283
17373
|
if (dependentFiles.length === 0) {
|
|
16284
17374
|
return;
|
|
16285
17375
|
}
|
|
@@ -16295,7 +17385,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16295
17385
|
try {
|
|
16296
17386
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
16297
17387
|
affectedFiles.forEach((affectedFile) => {
|
|
16298
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
17388
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync25(affectedFile)) {
|
|
16299
17389
|
validFiles.push(affectedFile);
|
|
16300
17390
|
processedFiles.add(affectedFile);
|
|
16301
17391
|
}
|
|
@@ -16309,7 +17399,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16309
17399
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
16310
17400
|
return;
|
|
16311
17401
|
}
|
|
16312
|
-
const normalizedFilePath =
|
|
17402
|
+
const normalizedFilePath = resolve32(filePathInSet);
|
|
16313
17403
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
16314
17404
|
validFiles.push(normalizedFilePath);
|
|
16315
17405
|
processedFiles.add(normalizedFilePath);
|
|
@@ -16320,7 +17410,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16320
17410
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
16321
17411
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
16322
17412
|
filePathSet.forEach((filePathInSet) => {
|
|
16323
|
-
if (!
|
|
17413
|
+
if (!existsSync25(filePathInSet)) {
|
|
16324
17414
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
16325
17415
|
return;
|
|
16326
17416
|
}
|
|
@@ -16351,10 +17441,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16351
17441
|
}
|
|
16352
17442
|
});
|
|
16353
17443
|
return filesToProcess;
|
|
16354
|
-
}, STABILITY_CHECK_ROUNDS = 5, STABILITY_CHECK_DELAY_MS = 10, isFileStable = async (
|
|
16355
|
-
const hash1 = computeFileHash(
|
|
17444
|
+
}, STABILITY_CHECK_ROUNDS = 5, STABILITY_CHECK_DELAY_MS = 10, isFileStable = async (file5) => {
|
|
17445
|
+
const hash1 = computeFileHash(file5);
|
|
16356
17446
|
await Bun.sleep(STABILITY_CHECK_DELAY_MS);
|
|
16357
|
-
const hash2 = computeFileHash(
|
|
17447
|
+
const hash2 = computeFileHash(file5);
|
|
16358
17448
|
return hash1 === hash2;
|
|
16359
17449
|
}, collectAllQueuedFiles = (fileChangeQueue) => {
|
|
16360
17450
|
const allFiles = [];
|
|
@@ -16365,11 +17455,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16365
17455
|
}, areAllQueuedFilesStable = async (fileChangeQueue) => {
|
|
16366
17456
|
const allFiles = collectAllQueuedFiles(fileChangeQueue);
|
|
16367
17457
|
const checkFile = async (files) => {
|
|
16368
|
-
const [
|
|
16369
|
-
if (!
|
|
17458
|
+
const [file5, ...remaining] = files;
|
|
17459
|
+
if (!file5) {
|
|
16370
17460
|
return true;
|
|
16371
17461
|
}
|
|
16372
|
-
const stable = await isFileStable(
|
|
17462
|
+
const stable = await isFileStable(file5);
|
|
16373
17463
|
if (!stable) {
|
|
16374
17464
|
return false;
|
|
16375
17465
|
}
|
|
@@ -16413,7 +17503,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16413
17503
|
return;
|
|
16414
17504
|
}
|
|
16415
17505
|
if (framework === "unknown") {
|
|
16416
|
-
invalidate(
|
|
17506
|
+
invalidate(resolve32(filePath));
|
|
16417
17507
|
const relPath = relative12(process.cwd(), filePath);
|
|
16418
17508
|
logHmrUpdate(relPath);
|
|
16419
17509
|
return;
|
|
@@ -16457,12 +17547,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16457
17547
|
return componentFile;
|
|
16458
17548
|
}
|
|
16459
17549
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
16460
|
-
if (
|
|
17550
|
+
if (existsSync25(tsCounterpart)) {
|
|
16461
17551
|
return tsCounterpart;
|
|
16462
17552
|
}
|
|
16463
17553
|
if (!graph)
|
|
16464
17554
|
return componentFile;
|
|
16465
|
-
const dependents = graph.dependents.get(
|
|
17555
|
+
const dependents = graph.dependents.get(resolve32(componentFile));
|
|
16466
17556
|
if (!dependents)
|
|
16467
17557
|
return componentFile;
|
|
16468
17558
|
for (const dep of dependents) {
|
|
@@ -16471,7 +17561,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16471
17561
|
}
|
|
16472
17562
|
return componentFile;
|
|
16473
17563
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
16474
|
-
const pageEntries = angularFiles.filter((
|
|
17564
|
+
const pageEntries = angularFiles.filter((file5) => file5.endsWith(".ts") && resolve32(file5).startsWith(angularPagesPath));
|
|
16475
17565
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
16476
17566
|
return pageEntries;
|
|
16477
17567
|
}
|
|
@@ -16479,9 +17569,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16479
17569
|
angularFiles.forEach((componentFile) => {
|
|
16480
17570
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
16481
17571
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
16482
|
-
affected.forEach((
|
|
16483
|
-
if (
|
|
16484
|
-
resolvedPages.add(
|
|
17572
|
+
affected.forEach((file5) => {
|
|
17573
|
+
if (file5.endsWith(".ts") && resolve32(file5).startsWith(angularPagesPath)) {
|
|
17574
|
+
resolvedPages.add(file5);
|
|
16485
17575
|
}
|
|
16486
17576
|
});
|
|
16487
17577
|
});
|
|
@@ -16497,14 +17587,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16497
17587
|
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
16498
17588
|
return clientRoots.length === 1 ? clientRoots[0] ?? process.cwd() : commonAncestor2(clientRoots, process.cwd());
|
|
16499
17589
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
16500
|
-
const fileWithHash =
|
|
17590
|
+
const fileWithHash = basename12(artifact.path);
|
|
16501
17591
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
16502
17592
|
if (!baseName) {
|
|
16503
17593
|
return;
|
|
16504
17594
|
}
|
|
16505
17595
|
state.manifest[toPascal(baseName)] = artifact.path;
|
|
16506
17596
|
}, bundleAngularClient = async (state, clientPaths, buildDir) => {
|
|
16507
|
-
const { build:
|
|
17597
|
+
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
16508
17598
|
const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
|
|
16509
17599
|
const { getAngularVendorPaths: getAngularVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
16510
17600
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
@@ -16516,7 +17606,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16516
17606
|
angVendorPaths = computeAngularVendorPaths2(globalThis.__angularVendorSpecifiers);
|
|
16517
17607
|
setAngularVendorPaths2(angVendorPaths);
|
|
16518
17608
|
}
|
|
16519
|
-
const clientResult = await
|
|
17609
|
+
const clientResult = await bunBuild9({
|
|
16520
17610
|
entrypoints: clientPaths,
|
|
16521
17611
|
...Object.keys({
|
|
16522
17612
|
...angVendorPaths ?? {},
|
|
@@ -16552,7 +17642,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16552
17642
|
await populateAssetStore(state.assetStore, clientManifest, buildDir);
|
|
16553
17643
|
}, broadcastAngularPageUpdates = (state, pagesToUpdate, manifest, startTime) => {
|
|
16554
17644
|
pagesToUpdate.forEach((angularPagePath) => {
|
|
16555
|
-
const fileName =
|
|
17645
|
+
const fileName = basename12(angularPagePath);
|
|
16556
17646
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
16557
17647
|
const pascalName = toPascal(baseName);
|
|
16558
17648
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -16589,28 +17679,28 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16589
17679
|
await rewriteImports3(ssrPaths, angServerVendorPaths);
|
|
16590
17680
|
}
|
|
16591
17681
|
serverPaths.forEach((serverPath, idx) => {
|
|
16592
|
-
const fileBase =
|
|
17682
|
+
const fileBase = basename12(serverPath, ".js");
|
|
16593
17683
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
16594
|
-
state.manifest[toPascal(fileBase)] =
|
|
17684
|
+
state.manifest[toPascal(fileBase)] = resolve32(ssrPath);
|
|
16595
17685
|
});
|
|
16596
17686
|
if (clientPaths.length > 0) {
|
|
16597
17687
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
16598
17688
|
}
|
|
16599
17689
|
}, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16600
17690
|
const angularDir = config.angularDirectory ?? "";
|
|
16601
|
-
const angularFiles = filesToRebuild.filter((
|
|
16602
|
-
for (const
|
|
16603
|
-
state.fileHashes.set(
|
|
17691
|
+
const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
|
|
17692
|
+
for (const file5 of angularFiles) {
|
|
17693
|
+
state.fileHashes.set(resolve32(file5), computeFileHash(file5));
|
|
16604
17694
|
}
|
|
16605
|
-
const angularPagesPath =
|
|
17695
|
+
const angularPagesPath = resolve32(angularDir, "pages");
|
|
16606
17696
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
16607
17697
|
if (pageEntries.length > 0) {
|
|
16608
17698
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
16609
17699
|
markSsrCacheDirty("angular");
|
|
16610
17700
|
}
|
|
16611
17701
|
const { manifest } = state;
|
|
16612
|
-
const angularHmrFiles = angularFiles.filter((
|
|
16613
|
-
const angularPageFiles = angularHmrFiles.filter((
|
|
17702
|
+
const angularHmrFiles = angularFiles.filter((file5) => file5.endsWith(".ts") || file5.endsWith(".html"));
|
|
17703
|
+
const angularPageFiles = angularHmrFiles.filter((file5) => file5.replace(/\\/g, "/").includes("/pages/"));
|
|
16614
17704
|
const pagesToUpdate = angularPageFiles.length > 0 ? angularPageFiles : pageEntries;
|
|
16615
17705
|
broadcastAngularPageUpdates(state, pagesToUpdate, manifest, startTime);
|
|
16616
17706
|
onRebuildComplete({ hmrState: state, manifest });
|
|
@@ -16627,14 +17717,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16627
17717
|
if (isComponentFile2)
|
|
16628
17718
|
return primaryFile;
|
|
16629
17719
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
16630
|
-
const nearest = findNearestComponent2(
|
|
17720
|
+
const nearest = findNearestComponent2(resolve32(primaryFile));
|
|
16631
17721
|
return nearest ?? primaryFile;
|
|
16632
17722
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
16633
|
-
for (const
|
|
16634
|
-
state.fileHashes.set(
|
|
17723
|
+
for (const file5 of reactFiles) {
|
|
17724
|
+
state.fileHashes.set(resolve32(file5), computeFileHash(file5));
|
|
16635
17725
|
}
|
|
16636
17726
|
markSsrCacheDirty("react");
|
|
16637
|
-
const primaryFile = reactFiles.find((
|
|
17727
|
+
const primaryFile = reactFiles.find((file5) => !file5.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
16638
17728
|
if (!primaryFile) {
|
|
16639
17729
|
onRebuildComplete({
|
|
16640
17730
|
hmrState: state,
|
|
@@ -16643,8 +17733,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16643
17733
|
return state.manifest;
|
|
16644
17734
|
}
|
|
16645
17735
|
const { invalidateModule: invalidateModule2 } = await getModuleServer();
|
|
16646
|
-
for (const
|
|
16647
|
-
invalidateModule2(
|
|
17736
|
+
for (const file5 of reactFiles) {
|
|
17737
|
+
invalidateModule2(file5);
|
|
16648
17738
|
}
|
|
16649
17739
|
const broadcastTarget = await resolveBroadcastTarget(primaryFile);
|
|
16650
17740
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
@@ -16672,7 +17762,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16672
17762
|
});
|
|
16673
17763
|
return state.manifest;
|
|
16674
17764
|
}, handleReactFastPath = async (state, _config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16675
|
-
const reactFiles = filesToRebuild.filter((
|
|
17765
|
+
const reactFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "react");
|
|
16676
17766
|
if (reactFiles.length === 0) {
|
|
16677
17767
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
16678
17768
|
return state.manifest;
|
|
@@ -16712,8 +17802,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16712
17802
|
type: "svelte-update"
|
|
16713
17803
|
});
|
|
16714
17804
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
16715
|
-
for (const
|
|
16716
|
-
state.fileHashes.set(
|
|
17805
|
+
for (const file5 of svelteFiles) {
|
|
17806
|
+
state.fileHashes.set(resolve32(file5), computeFileHash(file5));
|
|
16717
17807
|
}
|
|
16718
17808
|
markSsrCacheDirty("svelte");
|
|
16719
17809
|
const serverDuration = Date.now() - startTime;
|
|
@@ -16725,22 +17815,22 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16725
17815
|
return state.manifest;
|
|
16726
17816
|
}, handleSvelteFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16727
17817
|
const svelteDir = config.svelteDirectory ?? "";
|
|
16728
|
-
const svelteFiles = filesToRebuild.filter((
|
|
17818
|
+
const svelteFiles = filesToRebuild.filter((file5) => (file5.endsWith(".svelte") || file5.includes(".svelte.")) && detectFramework(file5, state.resolvedPaths) === "svelte");
|
|
16729
17819
|
if (svelteFiles.length > 0) {
|
|
16730
17820
|
return handleSvelteModuleServerPath(state, svelteFiles, startTime, onRebuildComplete);
|
|
16731
17821
|
}
|
|
16732
17822
|
const { buildDir } = state.resolvedPaths;
|
|
16733
17823
|
if (svelteFiles.length > 0) {
|
|
16734
17824
|
const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
|
|
16735
|
-
const { build:
|
|
17825
|
+
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
16736
17826
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
16737
17827
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, getStyleTransformConfig(state.config));
|
|
16738
17828
|
const serverEntries = [...svelteServerPaths];
|
|
16739
17829
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
16740
|
-
const serverRoot =
|
|
16741
|
-
const serverOutDir =
|
|
17830
|
+
const serverRoot = resolve32(svelteDir, "generated", "server");
|
|
17831
|
+
const serverOutDir = resolve32(buildDir, basename12(svelteDir));
|
|
16742
17832
|
const [serverResult, clientResult] = await Promise.all([
|
|
16743
|
-
serverEntries.length > 0 ?
|
|
17833
|
+
serverEntries.length > 0 ? bunBuild9({
|
|
16744
17834
|
entrypoints: serverEntries,
|
|
16745
17835
|
external: [
|
|
16746
17836
|
"react",
|
|
@@ -16760,7 +17850,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16760
17850
|
target: "bun",
|
|
16761
17851
|
throw: false
|
|
16762
17852
|
}) : undefined,
|
|
16763
|
-
clientEntries.length > 0 ?
|
|
17853
|
+
clientEntries.length > 0 ? bunBuild9({
|
|
16764
17854
|
entrypoints: clientEntries,
|
|
16765
17855
|
format: "esm",
|
|
16766
17856
|
naming: "[dir]/[name].[hash].[ext]",
|
|
@@ -16780,7 +17870,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16780
17870
|
const duration = Date.now() - startTime;
|
|
16781
17871
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
16782
17872
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
16783
|
-
const fileName =
|
|
17873
|
+
const fileName = basename12(sveltePagePath);
|
|
16784
17874
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
16785
17875
|
const pascalName = toPascal(baseName);
|
|
16786
17876
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -16811,8 +17901,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16811
17901
|
if (nonVueFiles.length === 0)
|
|
16812
17902
|
return;
|
|
16813
17903
|
const { invalidateModule: invalidateModule2 } = await getModuleServer();
|
|
16814
|
-
for (const
|
|
16815
|
-
invalidateModule2(
|
|
17904
|
+
for (const file5 of nonVueFiles) {
|
|
17905
|
+
invalidateModule2(file5);
|
|
16816
17906
|
}
|
|
16817
17907
|
}, broadcastVueModuleUpdate = async (state, changedFile, vueFiles, nonVueFiles, forceReload, serverDuration) => {
|
|
16818
17908
|
const pageModuleUrl = await getModuleUrl(changedFile);
|
|
@@ -16834,8 +17924,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16834
17924
|
type: "vue-update"
|
|
16835
17925
|
});
|
|
16836
17926
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
16837
|
-
for (const
|
|
16838
|
-
state.fileHashes.set(
|
|
17927
|
+
for (const file5 of [...vueFiles, ...nonVueFiles]) {
|
|
17928
|
+
state.fileHashes.set(resolve32(file5), computeFileHash(file5));
|
|
16839
17929
|
}
|
|
16840
17930
|
markSsrCacheDirty("vue");
|
|
16841
17931
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -16848,16 +17938,68 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16848
17938
|
});
|
|
16849
17939
|
return state.manifest;
|
|
16850
17940
|
}, handleVueFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
16851
|
-
const vueFiles = filesToRebuild.filter((
|
|
16852
|
-
const nonVueFiles = filesToRebuild.filter((
|
|
17941
|
+
const vueFiles = filesToRebuild.filter((file5) => file5.endsWith(".vue") && detectFramework(file5, state.resolvedPaths) === "vue");
|
|
17942
|
+
const nonVueFiles = filesToRebuild.filter((file5) => !file5.endsWith(".vue") && detectFramework(file5, state.resolvedPaths) === "vue");
|
|
16853
17943
|
collectAffectedVueFiles(state, nonVueFiles, vueFiles);
|
|
16854
17944
|
if (vueFiles.length > 0) {
|
|
16855
17945
|
return handleVueModuleServerPath(state, vueFiles, nonVueFiles, startTime, onRebuildComplete);
|
|
16856
17946
|
}
|
|
16857
17947
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
16858
17948
|
return state.manifest;
|
|
17949
|
+
}, EMBER_PAGE_EXTENSIONS, collectAllEmberPages = async (emberPagesPath) => {
|
|
17950
|
+
const { readdir: readdir4 } = await import("fs/promises");
|
|
17951
|
+
try {
|
|
17952
|
+
const entries = await readdir4(emberPagesPath, {
|
|
17953
|
+
recursive: true,
|
|
17954
|
+
withFileTypes: true
|
|
17955
|
+
});
|
|
17956
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve32(emberPagesPath, entry.name));
|
|
17957
|
+
} catch {
|
|
17958
|
+
return [];
|
|
17959
|
+
}
|
|
17960
|
+
}, handleEmberFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
17961
|
+
const emberDir = config.emberDirectory ?? "";
|
|
17962
|
+
const emberFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "ember");
|
|
17963
|
+
if (emberFiles.length === 0 || !emberDir) {
|
|
17964
|
+
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
17965
|
+
return state.manifest;
|
|
17966
|
+
}
|
|
17967
|
+
for (const file5 of emberFiles) {
|
|
17968
|
+
state.fileHashes.set(resolve32(file5), computeFileHash(file5));
|
|
17969
|
+
}
|
|
17970
|
+
const emberPagesPath = resolve32(emberDir, "pages");
|
|
17971
|
+
const directPageEntries = emberFiles.filter((file5) => resolve32(file5).startsWith(emberPagesPath));
|
|
17972
|
+
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
17973
|
+
if (allPageEntries.length === 0) {
|
|
17974
|
+
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
17975
|
+
return state.manifest;
|
|
17976
|
+
}
|
|
17977
|
+
const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
|
|
17978
|
+
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
17979
|
+
for (const serverPath of serverPaths) {
|
|
17980
|
+
const fileBase = basename12(serverPath, ".js");
|
|
17981
|
+
state.manifest[toPascal(fileBase)] = resolve32(serverPath);
|
|
17982
|
+
}
|
|
17983
|
+
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
17984
|
+
invalidateEmberSsrCache2();
|
|
17985
|
+
const duration = Date.now() - startTime;
|
|
17986
|
+
const [primary] = emberFiles;
|
|
17987
|
+
if (primary) {
|
|
17988
|
+
state.lastHmrPath = relative12(process.cwd(), primary).replace(/\\/g, "/");
|
|
17989
|
+
state.lastHmrFramework = "ember";
|
|
17990
|
+
logHmrUpdate(primary, "ember", duration);
|
|
17991
|
+
}
|
|
17992
|
+
broadcastToClients(state, {
|
|
17993
|
+
data: {
|
|
17994
|
+
affectedPages: allPageEntries,
|
|
17995
|
+
manifest: state.manifest
|
|
17996
|
+
},
|
|
17997
|
+
type: "full-reload"
|
|
17998
|
+
});
|
|
17999
|
+
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
18000
|
+
return state.manifest;
|
|
16859
18001
|
}, collectModuleUpdatesForFramework = (framework, filesToRebuild, manifest, state) => {
|
|
16860
|
-
const frameworkFiles = filesToRebuild.filter((
|
|
18002
|
+
const frameworkFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === framework);
|
|
16861
18003
|
if (frameworkFiles.length === 0) {
|
|
16862
18004
|
return [];
|
|
16863
18005
|
}
|
|
@@ -16877,15 +18019,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16877
18019
|
if (!affectedFrameworks.includes("react") || !state.resolvedPaths.reactDir) {
|
|
16878
18020
|
return;
|
|
16879
18021
|
}
|
|
16880
|
-
const reactFiles = filesToRebuild.filter((
|
|
18022
|
+
const reactFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "react");
|
|
16881
18023
|
if (reactFiles.length === 0) {
|
|
16882
18024
|
return;
|
|
16883
18025
|
}
|
|
16884
|
-
const reactPageFiles = reactFiles.filter((
|
|
18026
|
+
const reactPageFiles = reactFiles.filter((file5) => file5.replace(/\\/g, "/").includes("/pages/"));
|
|
16885
18027
|
const sourceFiles = reactPageFiles.length > 0 ? reactPageFiles : reactFiles;
|
|
16886
18028
|
const [primarySource] = sourceFiles;
|
|
16887
18029
|
try {
|
|
16888
|
-
const hasComponentChanges = reactFiles.some((
|
|
18030
|
+
const hasComponentChanges = reactFiles.some((file5) => file5.endsWith(".tsx") || file5.endsWith(".ts") || file5.endsWith(".jsx"));
|
|
16889
18031
|
const hasCSSChanges = reactFiles.some(isStylePath);
|
|
16890
18032
|
logHmrUpdate(primarySource ?? reactFiles[0] ?? "", "react", duration);
|
|
16891
18033
|
broadcastToClients(state, {
|
|
@@ -16906,7 +18048,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16906
18048
|
});
|
|
16907
18049
|
}
|
|
16908
18050
|
}, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
|
|
16909
|
-
const scriptBaseName =
|
|
18051
|
+
const scriptBaseName = basename12(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
16910
18052
|
const pascalName = toPascal(scriptBaseName);
|
|
16911
18053
|
const scriptPath = manifest[pascalName] || null;
|
|
16912
18054
|
if (!scriptPath) {
|
|
@@ -16923,13 +18065,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16923
18065
|
},
|
|
16924
18066
|
type: "script-update"
|
|
16925
18067
|
});
|
|
16926
|
-
}, isScriptFile = (
|
|
18068
|
+
}, isScriptFile = (file5) => (file5.endsWith(".ts") || file5.endsWith(".js") || file5.endsWith(".tsx") || file5.endsWith(".jsx")) && file5.replace(/\\/g, "/").includes("/scripts/"), resolveIslandDefinitionSource = (definition, buildInfo, islandFiles) => {
|
|
16927
18069
|
const { buildReference } = definition;
|
|
16928
18070
|
if (!buildReference?.source) {
|
|
16929
18071
|
return;
|
|
16930
18072
|
}
|
|
16931
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
16932
|
-
islandFiles.add(
|
|
18073
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve32(dirname17(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
18074
|
+
islandFiles.add(resolve32(sourcePath));
|
|
16933
18075
|
}, resolveIslandSourceFiles = async (config) => {
|
|
16934
18076
|
const registryPath = config.islands?.registry;
|
|
16935
18077
|
if (!registryPath) {
|
|
@@ -16937,7 +18079,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16937
18079
|
}
|
|
16938
18080
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
16939
18081
|
const islandFiles = new Set([
|
|
16940
|
-
|
|
18082
|
+
resolve32(buildInfo.resolvedRegistryPath)
|
|
16941
18083
|
]);
|
|
16942
18084
|
for (const definition of buildInfo.definitions) {
|
|
16943
18085
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -16948,14 +18090,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16948
18090
|
if (islandFiles.size === 0) {
|
|
16949
18091
|
return false;
|
|
16950
18092
|
}
|
|
16951
|
-
return filesToRebuild.some((
|
|
18093
|
+
return filesToRebuild.some((file5) => islandFiles.has(resolve32(file5)));
|
|
16952
18094
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
16953
18095
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
16954
18096
|
if (!shouldReload) {
|
|
16955
18097
|
return false;
|
|
16956
18098
|
}
|
|
16957
18099
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
16958
|
-
const affectedPages = filesToRebuild.flatMap((
|
|
18100
|
+
const affectedPages = filesToRebuild.flatMap((file5) => getPagesUsingIslandSource(file5));
|
|
16959
18101
|
broadcastToClients(state, {
|
|
16960
18102
|
data: {
|
|
16961
18103
|
affectedPages,
|
|
@@ -16968,12 +18110,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16968
18110
|
if (!state.resolvedPaths.htmlDir) {
|
|
16969
18111
|
return;
|
|
16970
18112
|
}
|
|
16971
|
-
const htmlFrameworkFiles = filesToRebuild.filter((
|
|
18113
|
+
const htmlFrameworkFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "html");
|
|
16972
18114
|
if (htmlFrameworkFiles.length === 0) {
|
|
16973
18115
|
return;
|
|
16974
18116
|
}
|
|
16975
18117
|
const scriptFiles = htmlFrameworkFiles.filter(isScriptFile);
|
|
16976
|
-
const htmlPageFiles = htmlFrameworkFiles.filter((
|
|
18118
|
+
const htmlPageFiles = htmlFrameworkFiles.filter((file5) => file5.endsWith(".html"));
|
|
16977
18119
|
if (scriptFiles.length === 0 || htmlPageFiles.length > 0) {
|
|
16978
18120
|
return;
|
|
16979
18121
|
}
|
|
@@ -16983,10 +18125,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16983
18125
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
16984
18126
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
16985
18127
|
if (isSingle) {
|
|
16986
|
-
return
|
|
18128
|
+
return resolve32(state.resolvedPaths.buildDir, "pages");
|
|
16987
18129
|
}
|
|
16988
|
-
const dirName = framework === "html" ?
|
|
16989
|
-
return
|
|
18130
|
+
const dirName = framework === "html" ? basename12(config.htmlDirectory ?? "html") : basename12(config.htmxDirectory ?? "htmx");
|
|
18131
|
+
return resolve32(state.resolvedPaths.buildDir, dirName, "pages");
|
|
16990
18132
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
16991
18133
|
try {
|
|
16992
18134
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -17015,17 +18157,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17015
18157
|
return;
|
|
17016
18158
|
}
|
|
17017
18159
|
const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
17018
|
-
const htmlFrameworkFiles = filesToRebuild.filter((
|
|
18160
|
+
const htmlFrameworkFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "html");
|
|
17019
18161
|
if (htmlFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
|
|
17020
18162
|
return;
|
|
17021
18163
|
}
|
|
17022
|
-
const htmlPageFiles = htmlFrameworkFiles.filter((
|
|
18164
|
+
const htmlPageFiles = htmlFrameworkFiles.filter((file5) => file5.endsWith(".html"));
|
|
17023
18165
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
17024
18166
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
17025
18167
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
17026
18168
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
17027
|
-
const htmlPageName =
|
|
17028
|
-
const builtHtmlPagePath =
|
|
18169
|
+
const htmlPageName = basename12(pageFile);
|
|
18170
|
+
const builtHtmlPagePath = resolve32(outputHtmlPages, htmlPageName);
|
|
17029
18171
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
17030
18172
|
});
|
|
17031
18173
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -17033,7 +18175,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17033
18175
|
if (!cssFile) {
|
|
17034
18176
|
return;
|
|
17035
18177
|
}
|
|
17036
|
-
const cssBaseName =
|
|
18178
|
+
const cssBaseName = basename12(getStyleBaseName(cssFile));
|
|
17037
18179
|
const cssPascalName = toPascal(cssBaseName);
|
|
17038
18180
|
const cssKey = `${cssPascalName}CSS`;
|
|
17039
18181
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -17082,7 +18224,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17082
18224
|
type: "vue-update"
|
|
17083
18225
|
});
|
|
17084
18226
|
}, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
|
|
17085
|
-
const fileName =
|
|
18227
|
+
const fileName = basename12(vuePagePath);
|
|
17086
18228
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
17087
18229
|
const pascalName = toPascal(baseName);
|
|
17088
18230
|
const vueRoot = config.vueDirectory;
|
|
@@ -17090,7 +18232,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17090
18232
|
const cssKey = `${pascalName}CSS`;
|
|
17091
18233
|
const cssUrl = manifest[cssKey] || null;
|
|
17092
18234
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
17093
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
18235
|
+
const hmrMeta = vueHmrMetadata2.get(resolve32(vuePagePath));
|
|
17094
18236
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
17095
18237
|
if (changeType === "style-only") {
|
|
17096
18238
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -17110,14 +18252,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17110
18252
|
if (!config.vueDirectory) {
|
|
17111
18253
|
return;
|
|
17112
18254
|
}
|
|
17113
|
-
const vueFiles = filesToRebuild.filter((
|
|
18255
|
+
const vueFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "vue");
|
|
17114
18256
|
if (vueFiles.length === 0) {
|
|
17115
18257
|
return;
|
|
17116
18258
|
}
|
|
17117
|
-
const vueComponentFiles = vueFiles.filter((
|
|
18259
|
+
const vueComponentFiles = vueFiles.filter((file5) => file5.endsWith(".vue"));
|
|
17118
18260
|
const vueCssFiles = vueFiles.filter(isStylePath);
|
|
17119
18261
|
const isCssOnlyChange = vueComponentFiles.length === 0 && vueCssFiles.length > 0;
|
|
17120
|
-
const vuePageFiles = vueFiles.filter((
|
|
18262
|
+
const vuePageFiles = vueFiles.filter((file5) => file5.replace(/\\/g, "/").includes("/pages/"));
|
|
17121
18263
|
const pagesToUpdate = vuePageFiles.length > 0 ? vuePageFiles : vueComponentFiles;
|
|
17122
18264
|
if (isCssOnlyChange && vueCssFiles.length > 0) {
|
|
17123
18265
|
handleVueCssOnlyUpdate(state, vueCssFiles, manifest, duration);
|
|
@@ -17128,7 +18270,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17128
18270
|
if (!cssFile) {
|
|
17129
18271
|
return;
|
|
17130
18272
|
}
|
|
17131
|
-
const cssBaseName =
|
|
18273
|
+
const cssBaseName = basename12(getStyleBaseName(cssFile));
|
|
17132
18274
|
const cssPascalName = toPascal(cssBaseName);
|
|
17133
18275
|
const cssKey = `${cssPascalName}CSS`;
|
|
17134
18276
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -17146,7 +18288,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17146
18288
|
});
|
|
17147
18289
|
}, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
|
|
17148
18290
|
try {
|
|
17149
|
-
const fileName =
|
|
18291
|
+
const fileName = basename12(sveltePagePath);
|
|
17150
18292
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
17151
18293
|
const pascalName = toPascal(baseName);
|
|
17152
18294
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -17174,14 +18316,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17174
18316
|
if (!config.svelteDirectory) {
|
|
17175
18317
|
return;
|
|
17176
18318
|
}
|
|
17177
|
-
const svelteFiles = filesToRebuild.filter((
|
|
18319
|
+
const svelteFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "svelte");
|
|
17178
18320
|
if (svelteFiles.length === 0) {
|
|
17179
18321
|
return;
|
|
17180
18322
|
}
|
|
17181
|
-
const svelteComponentFiles = svelteFiles.filter((
|
|
18323
|
+
const svelteComponentFiles = svelteFiles.filter((file5) => file5.endsWith(".svelte"));
|
|
17182
18324
|
const svelteCssFiles = svelteFiles.filter(isStylePath);
|
|
17183
18325
|
const isCssOnlyChange = svelteComponentFiles.length === 0 && svelteCssFiles.length > 0;
|
|
17184
|
-
const sveltePageFiles = svelteFiles.filter((
|
|
18326
|
+
const sveltePageFiles = svelteFiles.filter((file5) => file5.replace(/\\/g, "/").includes("/pages/"));
|
|
17185
18327
|
const pagesToUpdate = sveltePageFiles.length > 0 ? sveltePageFiles : svelteComponentFiles;
|
|
17186
18328
|
if (isCssOnlyChange && svelteCssFiles.length > 0) {
|
|
17187
18329
|
handleSvelteCssOnlyUpdate(state, svelteCssFiles, manifest, duration);
|
|
@@ -17190,9 +18332,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17190
18332
|
broadcastSveltePageUpdate(state, sveltePagePath, manifest, duration);
|
|
17191
18333
|
});
|
|
17192
18334
|
}, collectAngularAffectedPages = (affected, resolvedPages) => {
|
|
17193
|
-
affected.forEach((
|
|
17194
|
-
if (
|
|
17195
|
-
resolvedPages.add(
|
|
18335
|
+
affected.forEach((file5) => {
|
|
18336
|
+
if (file5.replace(/\\/g, "/").includes("/pages/") && file5.endsWith(".ts")) {
|
|
18337
|
+
resolvedPages.add(file5);
|
|
17196
18338
|
}
|
|
17197
18339
|
});
|
|
17198
18340
|
}, resolveAngularPagesFromDependencyGraph = (state, angularFiles) => {
|
|
@@ -17208,7 +18350,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17208
18350
|
if (!cssFile) {
|
|
17209
18351
|
return;
|
|
17210
18352
|
}
|
|
17211
|
-
const cssBaseName =
|
|
18353
|
+
const cssBaseName = basename12(getStyleBaseName(cssFile));
|
|
17212
18354
|
const cssPascalName = toPascal(cssBaseName);
|
|
17213
18355
|
const cssKey = `${cssPascalName}CSS`;
|
|
17214
18356
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -17226,7 +18368,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17226
18368
|
});
|
|
17227
18369
|
}, broadcastAngularPageHmrUpdate = (state, angularPagePath, manifest, duration) => {
|
|
17228
18370
|
try {
|
|
17229
|
-
const fileName =
|
|
18371
|
+
const fileName = basename12(angularPagePath);
|
|
17230
18372
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
17231
18373
|
const pascalName = toPascal(baseName);
|
|
17232
18374
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -17253,13 +18395,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17253
18395
|
if (!config.angularDirectory) {
|
|
17254
18396
|
return;
|
|
17255
18397
|
}
|
|
17256
|
-
const angularFiles = filesToRebuild.filter((
|
|
18398
|
+
const angularFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "angular");
|
|
17257
18399
|
if (angularFiles.length === 0) {
|
|
17258
18400
|
return;
|
|
17259
18401
|
}
|
|
17260
18402
|
const angularCssFiles = angularFiles.filter(isStylePath);
|
|
17261
18403
|
const isCssOnlyChange = angularFiles.every(isStylePath) && angularCssFiles.length > 0;
|
|
17262
|
-
const angularPageFiles = angularFiles.filter((
|
|
18404
|
+
const angularPageFiles = angularFiles.filter((file5) => file5.replace(/\\/g, "/").includes("/pages/"));
|
|
17263
18405
|
let pagesToUpdate = angularPageFiles;
|
|
17264
18406
|
if (pagesToUpdate.length === 0 && state.dependencyGraph) {
|
|
17265
18407
|
pagesToUpdate = resolveAngularPagesFromDependencyGraph(state, angularFiles);
|
|
@@ -17275,12 +18417,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17275
18417
|
if (!state.resolvedPaths.htmxDir) {
|
|
17276
18418
|
return;
|
|
17277
18419
|
}
|
|
17278
|
-
const htmxFrameworkFiles = filesToRebuild.filter((
|
|
18420
|
+
const htmxFrameworkFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "htmx");
|
|
17279
18421
|
if (htmxFrameworkFiles.length === 0) {
|
|
17280
18422
|
return;
|
|
17281
18423
|
}
|
|
17282
18424
|
const htmxScriptFiles = htmxFrameworkFiles.filter(isScriptFile);
|
|
17283
|
-
const htmxHtmlFiles = htmxFrameworkFiles.filter((
|
|
18425
|
+
const htmxHtmlFiles = htmxFrameworkFiles.filter((file5) => file5.endsWith(".html"));
|
|
17284
18426
|
if (htmxScriptFiles.length === 0 || htmxHtmlFiles.length > 0) {
|
|
17285
18427
|
return;
|
|
17286
18428
|
}
|
|
@@ -17315,17 +18457,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17315
18457
|
return;
|
|
17316
18458
|
}
|
|
17317
18459
|
const shouldRefreshFromIslandChange = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
17318
|
-
const htmxFrameworkFiles = filesToRebuild.filter((
|
|
18460
|
+
const htmxFrameworkFiles = filesToRebuild.filter((file5) => detectFramework(file5, state.resolvedPaths) === "htmx");
|
|
17319
18461
|
if (htmxFrameworkFiles.length === 0 && !shouldRefreshFromIslandChange) {
|
|
17320
18462
|
return;
|
|
17321
18463
|
}
|
|
17322
|
-
const htmxPageFiles = htmxFrameworkFiles.filter((
|
|
18464
|
+
const htmxPageFiles = htmxFrameworkFiles.filter((file5) => file5.endsWith(".html"));
|
|
17323
18465
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
17324
18466
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
17325
18467
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
17326
18468
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
17327
|
-
const htmxPageName =
|
|
17328
|
-
const builtHtmxPagePath =
|
|
18469
|
+
const htmxPageName = basename12(htmxPageFile);
|
|
18470
|
+
const builtHtmxPagePath = resolve32(outputHtmxPages, htmxPageName);
|
|
17329
18471
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
17330
18472
|
});
|
|
17331
18473
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -17394,9 +18536,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17394
18536
|
handleModuleUpdates(state, allModuleUpdates, manifest);
|
|
17395
18537
|
}, logStyleUpdatesForFramework = (state, framework, filesToRebuild, startTime) => {
|
|
17396
18538
|
const dur = Date.now() - startTime;
|
|
17397
|
-
filesToRebuild.forEach((
|
|
17398
|
-
if (detectFramework(
|
|
17399
|
-
logCssUpdate(
|
|
18539
|
+
filesToRebuild.forEach((file5) => {
|
|
18540
|
+
if (detectFramework(file5, state.resolvedPaths) === framework) {
|
|
18541
|
+
logCssUpdate(file5, framework, dur);
|
|
17400
18542
|
}
|
|
17401
18543
|
});
|
|
17402
18544
|
}, broadcastSingleFrameworkUpdate = (state, framework, filesToRebuild, manifest, startTime) => {
|
|
@@ -17434,7 +18576,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17434
18576
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
17435
18577
|
writeFs(destPath, html);
|
|
17436
18578
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
17437
|
-
const destPath =
|
|
18579
|
+
const destPath = resolve32(outputDir, basename12(sourceFile));
|
|
17438
18580
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
17439
18581
|
const source = await Bun.file(sourceFile).text();
|
|
17440
18582
|
await Bun.write(destPath, source);
|
|
@@ -17464,7 +18606,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17464
18606
|
return false;
|
|
17465
18607
|
}
|
|
17466
18608
|
}, runMarkupFastPath = async (state, config, filesToRebuild, startTime, framework) => {
|
|
17467
|
-
const markupFiles = (filesToRebuild ?? []).filter((
|
|
18609
|
+
const markupFiles = (filesToRebuild ?? []).filter((file5) => file5.endsWith(".html"));
|
|
17468
18610
|
if (markupFiles.length === 0)
|
|
17469
18611
|
return;
|
|
17470
18612
|
const outputDir = computeOutputPagesDir(state, config, framework);
|
|
@@ -17493,6 +18635,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17493
18635
|
framework: "angular",
|
|
17494
18636
|
handler: handleAngularFastPath
|
|
17495
18637
|
},
|
|
18638
|
+
{
|
|
18639
|
+
directory: config.emberDirectory,
|
|
18640
|
+
framework: "ember",
|
|
18641
|
+
handler: handleEmberFastPath
|
|
18642
|
+
},
|
|
17496
18643
|
{
|
|
17497
18644
|
directory: config.reactDirectory,
|
|
17498
18645
|
framework: "react",
|
|
@@ -17610,7 +18757,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17610
18757
|
queuedFiles.push(...filePaths);
|
|
17611
18758
|
});
|
|
17612
18759
|
state.fileChangeQueue.clear();
|
|
17613
|
-
pending.forEach((
|
|
18760
|
+
pending.forEach((file5) => state.rebuildQueue.add(file5));
|
|
17614
18761
|
if (state.rebuildTimeout)
|
|
17615
18762
|
clearTimeout(state.rebuildTimeout);
|
|
17616
18763
|
state.rebuildTimeout = setTimeout(() => {
|
|
@@ -17677,6 +18824,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
17677
18824
|
init_ssrCache();
|
|
17678
18825
|
moduleServerPromise = Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
17679
18826
|
getReactModuleUrl = getModuleUrl;
|
|
18827
|
+
EMBER_PAGE_EXTENSIONS = [".gts", ".gjs", ".ts", ".js"];
|
|
17680
18828
|
HMR_SCRIPT_PATTERN = /<script>window\.__HMR_FRAMEWORK__[\s\S]*?<\/script>\s*<script data-hmr-client>[\s\S]*?<\/script>/;
|
|
17681
18829
|
});
|
|
17682
18830
|
|
|
@@ -17686,23 +18834,26 @@ __export(exports_buildDepVendor, {
|
|
|
17686
18834
|
computeDepVendorPaths: () => computeDepVendorPaths,
|
|
17687
18835
|
buildDepVendor: () => buildDepVendor
|
|
17688
18836
|
});
|
|
17689
|
-
import { mkdirSync as
|
|
17690
|
-
import { join as
|
|
17691
|
-
import { rm as
|
|
17692
|
-
var {build:
|
|
17693
|
-
var
|
|
18837
|
+
import { mkdirSync as mkdirSync12 } from "fs";
|
|
18838
|
+
import { join as join27 } from "path";
|
|
18839
|
+
import { rm as rm11 } from "fs/promises";
|
|
18840
|
+
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
18841
|
+
var toSafeFileName6 = (specifier) => {
|
|
18842
|
+
const prefix = specifier.startsWith("@") ? "_" : "";
|
|
18843
|
+
return prefix + specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_");
|
|
18844
|
+
}, isResolvable4 = (specifier) => {
|
|
17694
18845
|
try {
|
|
17695
18846
|
Bun.resolveSync(specifier, process.cwd());
|
|
17696
18847
|
return true;
|
|
17697
18848
|
} catch {
|
|
17698
18849
|
return false;
|
|
17699
18850
|
}
|
|
17700
|
-
}, 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 = (
|
|
18851
|
+
}, 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 = (file5) => file5.includes("node_modules") || file5.includes("/build/") || file5.includes("/dist/") || file5.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier2(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file5, transpiler5) => {
|
|
17701
18852
|
const dep = [];
|
|
17702
18853
|
const framework = [];
|
|
17703
18854
|
try {
|
|
17704
|
-
const content = await Bun.file(
|
|
17705
|
-
for (const imp of
|
|
18855
|
+
const content = await Bun.file(file5).text();
|
|
18856
|
+
for (const imp of transpiler5.scanImports(content)) {
|
|
17706
18857
|
if (isDepSpecifier(imp.path))
|
|
17707
18858
|
dep.push(imp.path);
|
|
17708
18859
|
else if (isFrameworkRootCandidate(imp.path))
|
|
@@ -17715,13 +18866,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17715
18866
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx}");
|
|
17716
18867
|
try {
|
|
17717
18868
|
const all = await Array.fromAsync(glob.scan({ absolute: true, cwd: dir }));
|
|
17718
|
-
return all.filter((
|
|
18869
|
+
return all.filter((file5) => !isSkippedFile(file5));
|
|
17719
18870
|
} catch {
|
|
17720
18871
|
return empty;
|
|
17721
18872
|
}
|
|
17722
|
-
}, collectDirSpecifiers = async (dir,
|
|
18873
|
+
}, collectDirSpecifiers = async (dir, transpiler5, dep, framework) => {
|
|
17723
18874
|
const files = await scanDirFiles(dir);
|
|
17724
|
-
const results = await Promise.all(files.map((
|
|
18875
|
+
const results = await Promise.all(files.map((file5) => readFileSpecifiers(file5, transpiler5)));
|
|
17725
18876
|
for (const result of results) {
|
|
17726
18877
|
for (const spec of result.dep)
|
|
17727
18878
|
dep.add(spec);
|
|
@@ -17731,15 +18882,15 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17731
18882
|
}, scanBareImports = async (directories) => {
|
|
17732
18883
|
const dep = new Set;
|
|
17733
18884
|
const framework = new Set;
|
|
17734
|
-
const
|
|
17735
|
-
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir,
|
|
18885
|
+
const transpiler5 = new Bun.Transpiler({ loader: "tsx" });
|
|
18886
|
+
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler5, dep, framework)));
|
|
17736
18887
|
return {
|
|
17737
18888
|
dep: Array.from(dep).filter(isResolvable4),
|
|
17738
18889
|
framework: Array.from(framework).filter(isResolvable4)
|
|
17739
18890
|
};
|
|
17740
18891
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
17741
18892
|
const { readFileSync: readFileSync17 } = await import("fs");
|
|
17742
|
-
const
|
|
18893
|
+
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
17743
18894
|
const newSpecs = new Set;
|
|
17744
18895
|
for (const spec of specs) {
|
|
17745
18896
|
if (alreadyScanned.has(spec))
|
|
@@ -17759,7 +18910,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17759
18910
|
}
|
|
17760
18911
|
let imports;
|
|
17761
18912
|
try {
|
|
17762
|
-
imports =
|
|
18913
|
+
imports = transpiler5.scanImports(content);
|
|
17763
18914
|
} catch {
|
|
17764
18915
|
continue;
|
|
17765
18916
|
}
|
|
@@ -17779,32 +18930,54 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17779
18930
|
}
|
|
17780
18931
|
}
|
|
17781
18932
|
return newSpecs;
|
|
17782
|
-
},
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
18933
|
+
}, PURE_ANNOTATION, createStripPureAnnotationsPlugin = () => ({
|
|
18934
|
+
name: "absolute-dep-vendor-strip-pure",
|
|
18935
|
+
setup(bld) {
|
|
18936
|
+
bld.onLoad({ filter: /\.(?:m?js|cjs)$/ }, async (args) => {
|
|
18937
|
+
const source = await Bun.file(args.path).text();
|
|
18938
|
+
if (!source.includes("@__PURE__"))
|
|
18939
|
+
return null;
|
|
18940
|
+
return {
|
|
18941
|
+
contents: source.replace(PURE_ANNOTATION, ""),
|
|
18942
|
+
loader: args.path.endsWith(".cjs") ? "js" : "js"
|
|
18943
|
+
};
|
|
18944
|
+
});
|
|
18945
|
+
}
|
|
18946
|
+
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
18947
|
+
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
18948
|
+
const safeName = toSafeFileName6(specifier);
|
|
18949
|
+
const entryPath = join27(tmpDir, `${safeName}.ts`);
|
|
18950
|
+
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
18951
|
+
return { entryPath, specifier };
|
|
17788
18952
|
}));
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
|
|
18953
|
+
const isPrefixOrEqual = (candidate, current) => current === candidate || current.startsWith(`${candidate}/`);
|
|
18954
|
+
const otherSpecsFor = (current) => specifiers.filter((spec) => !isPrefixOrEqual(spec, current));
|
|
18955
|
+
const results = await Promise.all(entries.map(({ entryPath, specifier }) => bunBuild9({
|
|
18956
|
+
entrypoints: [entryPath],
|
|
18957
|
+
external: [...FRAMEWORK_EXTERNALS, ...otherSpecsFor(specifier)],
|
|
17792
18958
|
format: "esm",
|
|
17793
18959
|
minify: false,
|
|
17794
18960
|
naming: "[name].[ext]",
|
|
17795
18961
|
outdir: vendorDir,
|
|
18962
|
+
plugins: [createStripPureAnnotationsPlugin()],
|
|
17796
18963
|
splitting: false,
|
|
17797
18964
|
target: "browser",
|
|
17798
18965
|
throw: false
|
|
17799
|
-
});
|
|
18966
|
+
})));
|
|
18967
|
+
const aggregated = {
|
|
18968
|
+
success: results.every((result) => result.success),
|
|
18969
|
+
logs: results.flatMap((result) => result.logs),
|
|
18970
|
+
outputs: results.flatMap((result) => result.outputs)
|
|
18971
|
+
};
|
|
18972
|
+
return aggregated;
|
|
17800
18973
|
}, MAX_VENDOR_DISCOVERY_PASSES = 5, buildDepVendor = async (buildDir, directories) => {
|
|
17801
18974
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
17802
18975
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
17803
18976
|
return {};
|
|
17804
|
-
const vendorDir =
|
|
17805
|
-
|
|
17806
|
-
const tmpDir =
|
|
17807
|
-
|
|
18977
|
+
const vendorDir = join27(buildDir, "vendor");
|
|
18978
|
+
mkdirSync12(vendorDir, { recursive: true });
|
|
18979
|
+
const tmpDir = join27(buildDir, "_dep_vendor_tmp");
|
|
18980
|
+
mkdirSync12(tmpDir, { recursive: true });
|
|
17808
18981
|
const allSpecs = new Set(initialSpecs);
|
|
17809
18982
|
const alreadyScanned = new Set;
|
|
17810
18983
|
let frontier = [...allSpecs, ...frameworkRoots];
|
|
@@ -17823,10 +18996,10 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17823
18996
|
if (!success) {
|
|
17824
18997
|
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
17825
18998
|
}
|
|
17826
|
-
await
|
|
18999
|
+
await rm11(tmpDir, { force: true, recursive: true });
|
|
17827
19000
|
const paths = {};
|
|
17828
19001
|
for (const specifier of allSpecs) {
|
|
17829
|
-
paths[specifier] = `/vendor/${
|
|
19002
|
+
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
17830
19003
|
}
|
|
17831
19004
|
return paths;
|
|
17832
19005
|
}, computeDepVendorPaths = async (directories) => {
|
|
@@ -17844,11 +19017,12 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17844
19017
|
}
|
|
17845
19018
|
const paths = {};
|
|
17846
19019
|
for (const specifier of allSpecs) {
|
|
17847
|
-
paths[specifier] = `/vendor/${
|
|
19020
|
+
paths[specifier] = `/vendor/${toSafeFileName6(specifier)}.js`;
|
|
17848
19021
|
}
|
|
17849
19022
|
return paths;
|
|
17850
19023
|
};
|
|
17851
19024
|
var init_buildDepVendor = __esm(() => {
|
|
19025
|
+
init_vendorEntrySource();
|
|
17852
19026
|
FRAMEWORK_SPECIFIERS = new Set([
|
|
17853
19027
|
"react",
|
|
17854
19028
|
"react-dom",
|
|
@@ -17875,6 +19049,7 @@ var init_buildDepVendor = __esm(() => {
|
|
|
17875
19049
|
...FRAMEWORK_SPECIFIERS,
|
|
17876
19050
|
...FRAMEWORK_NAMESPACE_PREFIXES.map((prefix) => `${prefix}*`)
|
|
17877
19051
|
];
|
|
19052
|
+
PURE_ANNOTATION = /\/\*\s*@__PURE__\s*\*\//g;
|
|
17878
19053
|
});
|
|
17879
19054
|
|
|
17880
19055
|
// src/core/devBuild.ts
|
|
@@ -17884,7 +19059,7 @@ __export(exports_devBuild, {
|
|
|
17884
19059
|
});
|
|
17885
19060
|
import { readdir as readdir4 } from "fs/promises";
|
|
17886
19061
|
import { statSync as statSync3 } from "fs";
|
|
17887
|
-
import { resolve as
|
|
19062
|
+
import { resolve as resolve33 } from "path";
|
|
17888
19063
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
17889
19064
|
const configuredDirs = [
|
|
17890
19065
|
config.reactDirectory,
|
|
@@ -17907,7 +19082,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17907
19082
|
return Object.keys(config).length > 0 ? config : null;
|
|
17908
19083
|
}, reloadConfig = async () => {
|
|
17909
19084
|
try {
|
|
17910
|
-
const configPath2 =
|
|
19085
|
+
const configPath2 = resolve33(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
17911
19086
|
const source = await Bun.file(configPath2).text();
|
|
17912
19087
|
return parseDirectoryConfig(source);
|
|
17913
19088
|
} catch {
|
|
@@ -17939,6 +19114,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17939
19114
|
if (!oldConfig.vueDirectory && Boolean(newConfig.vueDirectory)) {
|
|
17940
19115
|
setVueVendorPaths(computeVueVendorPaths());
|
|
17941
19116
|
}
|
|
19117
|
+
if (!oldConfig.emberDirectory && Boolean(newConfig.emberDirectory)) {
|
|
19118
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19119
|
+
}
|
|
17942
19120
|
const newWatchPaths = getWatchPaths(state.config, state.resolvedPaths);
|
|
17943
19121
|
const addedPaths = newWatchPaths.filter((path) => !oldWatchPaths.has(path));
|
|
17944
19122
|
if (addedPaths.length > 0) {
|
|
@@ -17989,7 +19167,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
17989
19167
|
state.fileChangeQueue.clear();
|
|
17990
19168
|
}
|
|
17991
19169
|
}, handleCachedReload = async () => {
|
|
17992
|
-
const serverMtime = statSync3(
|
|
19170
|
+
const serverMtime = statSync3(resolve33(Bun.main)).mtimeMs;
|
|
17993
19171
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
17994
19172
|
globalThis.__hmrServerMtime = serverMtime;
|
|
17995
19173
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -18005,6 +19183,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18005
19183
|
if (cached?.hmrState.config.vueDirectory) {
|
|
18006
19184
|
setVueVendorPaths(computeVueVendorPaths());
|
|
18007
19185
|
}
|
|
19186
|
+
if (cached?.hmrState.config.emberDirectory) {
|
|
19187
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19188
|
+
}
|
|
18008
19189
|
if (serverMtime === lastMtime) {
|
|
18009
19190
|
globalThis.__hmrSkipServerRestart = true;
|
|
18010
19191
|
return;
|
|
@@ -18023,8 +19204,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18023
19204
|
return true;
|
|
18024
19205
|
}, resolveAbsoluteVersion2 = async () => {
|
|
18025
19206
|
const candidates = [
|
|
18026
|
-
|
|
18027
|
-
|
|
19207
|
+
resolve33(import.meta.dir, "..", "..", "package.json"),
|
|
19208
|
+
resolve33(import.meta.dir, "..", "package.json")
|
|
18028
19209
|
];
|
|
18029
19210
|
const [candidate, ...remaining] = candidates;
|
|
18030
19211
|
if (!candidate) {
|
|
@@ -18050,7 +19231,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18050
19231
|
const entries = await readdir4(vendorDir).catch(() => emptyStringArray);
|
|
18051
19232
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
18052
19233
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
18053
|
-
const bytes = await Bun.file(
|
|
19234
|
+
const bytes = await Bun.file(resolve33(vendorDir, entry)).bytes();
|
|
18054
19235
|
assetStore.set(webPath, bytes);
|
|
18055
19236
|
}));
|
|
18056
19237
|
}, devBuild = async (config) => {
|
|
@@ -18085,6 +19266,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18085
19266
|
if (config.vueDirectory) {
|
|
18086
19267
|
setVueVendorPaths(computeVueVendorPaths());
|
|
18087
19268
|
}
|
|
19269
|
+
if (config.emberDirectory) {
|
|
19270
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19271
|
+
}
|
|
18088
19272
|
const sourceDirs = collectDepVendorSourceDirs(config);
|
|
18089
19273
|
if (config.angularDirectory) {
|
|
18090
19274
|
setAngularVendorPaths(await computeAngularVendorPathsAsync(sourceDirs));
|
|
@@ -18116,18 +19300,19 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18116
19300
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
18117
19301
|
recordStep("populate asset store", stepStartedAt);
|
|
18118
19302
|
stepStartedAt = performance.now();
|
|
18119
|
-
const reactVendorDir =
|
|
18120
|
-
const angularVendorDir =
|
|
18121
|
-
const svelteVendorDir =
|
|
18122
|
-
const vueVendorDir =
|
|
18123
|
-
const depVendorDir =
|
|
19303
|
+
const reactVendorDir = resolve33(state.resolvedPaths.buildDir, "react", "vendor");
|
|
19304
|
+
const angularVendorDir = resolve33(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
19305
|
+
const svelteVendorDir = resolve33(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
19306
|
+
const vueVendorDir = resolve33(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
19307
|
+
const depVendorDir = resolve33(state.resolvedPaths.buildDir, "vendor");
|
|
18124
19308
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
18125
|
-
const [, angularSpecs, angularServerSpecs, , , depPaths] = await Promise.all([
|
|
19309
|
+
const [, angularSpecs, angularServerSpecs, , , , depPaths] = await Promise.all([
|
|
18126
19310
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
18127
19311
|
config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir, sourceDirs, true, Object.keys(globalThis.__depVendorPaths ?? {})) : Promise.resolve(undefined),
|
|
18128
19312
|
config.angularDirectory ? buildAngularServerVendor(state.resolvedPaths.buildDir, sourceDirs, true) : Promise.resolve(undefined),
|
|
18129
19313
|
config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
18130
19314
|
config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
19315
|
+
config.emberDirectory ? buildEmberVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
18131
19316
|
buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs)
|
|
18132
19317
|
]);
|
|
18133
19318
|
if (angularSpecs)
|
|
@@ -18135,6 +19320,9 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18135
19320
|
if (angularServerSpecs) {
|
|
18136
19321
|
setAngularServerVendorPaths(computeAngularServerVendorPaths(state.resolvedPaths.buildDir, angularServerSpecs));
|
|
18137
19322
|
}
|
|
19323
|
+
if (config.emberDirectory) {
|
|
19324
|
+
setEmberVendorPaths(computeEmberVendorPaths());
|
|
19325
|
+
}
|
|
18138
19326
|
globalThis.__depVendorPaths = depPaths;
|
|
18139
19327
|
recordStep("build vendor bundles", stepStartedAt);
|
|
18140
19328
|
stepStartedAt = performance.now();
|
|
@@ -18197,7 +19385,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
18197
19385
|
manifest
|
|
18198
19386
|
};
|
|
18199
19387
|
globalThis.__hmrDevResult = result;
|
|
18200
|
-
globalThis.__hmrServerMtime = statSync3(
|
|
19388
|
+
globalThis.__hmrServerMtime = statSync3(resolve33(Bun.main)).mtimeMs;
|
|
18201
19389
|
return result;
|
|
18202
19390
|
};
|
|
18203
19391
|
var init_devBuild = __esm(() => {
|
|
@@ -18206,6 +19394,7 @@ var init_devBuild = __esm(() => {
|
|
|
18206
19394
|
init_buildAngularVendor();
|
|
18207
19395
|
init_buildSvelteVendor();
|
|
18208
19396
|
init_buildVueVendor();
|
|
19397
|
+
init_buildEmberVendor();
|
|
18209
19398
|
init_clientManager();
|
|
18210
19399
|
init_configResolver();
|
|
18211
19400
|
init_dependencyGraph();
|
|
@@ -18291,14 +19480,14 @@ var STORE_KEY = "__elysiaStore", getGlobalValue = (key) => Reflect.get(globalThi
|
|
|
18291
19480
|
return new Response(null, { headers: { ETag: etag }, status: 304 });
|
|
18292
19481
|
}
|
|
18293
19482
|
return moduleResponse;
|
|
18294
|
-
},
|
|
19483
|
+
}, resolveRequestPathname2 = (request) => {
|
|
18295
19484
|
const rawUrl = request.url;
|
|
18296
19485
|
const qIdx = rawUrl.indexOf("?");
|
|
18297
19486
|
const pathEnd = qIdx === UNFOUND_INDEX ? rawUrl.length : qIdx;
|
|
18298
19487
|
const pathStart = rawUrl.indexOf("/", rawUrl.indexOf("//") + 2);
|
|
18299
19488
|
return rawUrl.slice(pathStart, pathEnd);
|
|
18300
19489
|
}, resolveDevAssetResponse = async (request, hmrState2, moduleServerHandler) => {
|
|
18301
|
-
const pathname =
|
|
19490
|
+
const pathname = resolveRequestPathname2(request);
|
|
18302
19491
|
if (moduleServerHandler) {
|
|
18303
19492
|
const moduleResponse = await moduleServerHandler(pathname);
|
|
18304
19493
|
if (moduleResponse) {
|
|
@@ -18369,14 +19558,14 @@ __export(exports_devtoolsJson, {
|
|
|
18369
19558
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
18370
19559
|
devtoolsJson: () => devtoolsJson
|
|
18371
19560
|
});
|
|
18372
|
-
import { existsSync as
|
|
18373
|
-
import { dirname as
|
|
19561
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync13, readFileSync as readFileSync17, writeFileSync as writeFileSync8 } from "fs";
|
|
19562
|
+
import { dirname as dirname18, join as join28, resolve as resolve34 } from "path";
|
|
18374
19563
|
import { Elysia as Elysia3 } from "elysia";
|
|
18375
19564
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
18376
19565
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
18377
19566
|
return uuid;
|
|
18378
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) =>
|
|
18379
|
-
if (!
|
|
19567
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve34(uuidCachePath ?? join28(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
19568
|
+
if (!existsSync26(cachePath))
|
|
18380
19569
|
return null;
|
|
18381
19570
|
try {
|
|
18382
19571
|
const value = readFileSync17(cachePath, "utf-8").trim();
|
|
@@ -18397,11 +19586,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
18397
19586
|
if (cachedUuid)
|
|
18398
19587
|
return setGlobalUuid(cachedUuid);
|
|
18399
19588
|
const uuid = crypto.randomUUID();
|
|
18400
|
-
|
|
19589
|
+
mkdirSync13(dirname18(cachePath), { recursive: true });
|
|
18401
19590
|
writeFileSync8(cachePath, uuid, "utf-8");
|
|
18402
19591
|
return setGlobalUuid(uuid);
|
|
18403
19592
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
18404
|
-
const rootPath =
|
|
19593
|
+
const rootPath = resolve34(options.projectRoot ?? process.cwd());
|
|
18405
19594
|
const root = options.normalizeForWindowsContainer === false ? rootPath : normalizeDevtoolsWorkspaceRoot(rootPath);
|
|
18406
19595
|
const uuid = getOrCreateUuid(buildDir, options);
|
|
18407
19596
|
return new Elysia3({ name: "absolute-devtools-json" }).get(ENDPOINT, () => ({
|
|
@@ -18414,11 +19603,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
18414
19603
|
if (process.env.WSL_DISTRO_NAME) {
|
|
18415
19604
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
18416
19605
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
18417
|
-
return
|
|
19606
|
+
return join28("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
18418
19607
|
}
|
|
18419
19608
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
18420
19609
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
18421
|
-
return
|
|
19610
|
+
return join28("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
18422
19611
|
}
|
|
18423
19612
|
return root;
|
|
18424
19613
|
};
|
|
@@ -18429,13 +19618,13 @@ var exports_imageOptimizer = {};
|
|
|
18429
19618
|
__export(exports_imageOptimizer, {
|
|
18430
19619
|
imageOptimizer: () => imageOptimizer
|
|
18431
19620
|
});
|
|
18432
|
-
import { existsSync as
|
|
18433
|
-
import { resolve as
|
|
19621
|
+
import { existsSync as existsSync27 } from "fs";
|
|
19622
|
+
import { resolve as resolve35 } from "path";
|
|
18434
19623
|
import { Elysia as Elysia4 } from "elysia";
|
|
18435
19624
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
18436
19625
|
try {
|
|
18437
19626
|
const resolved = validateSafePath(path, baseDir);
|
|
18438
|
-
if (
|
|
19627
|
+
if (existsSync27(resolved))
|
|
18439
19628
|
return resolved;
|
|
18440
19629
|
return null;
|
|
18441
19630
|
} catch {
|
|
@@ -18443,7 +19632,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
18443
19632
|
}
|
|
18444
19633
|
}, resolveLocalImage = (url, buildDir) => {
|
|
18445
19634
|
const cleanPath = url.startsWith("/") ? url.slice(1) : url;
|
|
18446
|
-
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath,
|
|
19635
|
+
return safeResolve(cleanPath, buildDir) ?? safeResolve(cleanPath, resolve35(process.cwd()));
|
|
18447
19636
|
}, parseQueryParams = (query, allowedSizes, defaultQuality) => {
|
|
18448
19637
|
const url = typeof query["url"] === "string" ? query["url"] : undefined;
|
|
18449
19638
|
const wParam = typeof query["w"] === "string" ? query["w"] : undefined;
|
|
@@ -18507,14 +19696,14 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
|
|
|
18507
19696
|
error: new Response(`Image not found: ${url}`, { status: 404 })
|
|
18508
19697
|
};
|
|
18509
19698
|
}
|
|
18510
|
-
const
|
|
18511
|
-
if (!await
|
|
19699
|
+
const file5 = Bun.file(resolvedPath);
|
|
19700
|
+
if (!await file5.exists()) {
|
|
18512
19701
|
return {
|
|
18513
19702
|
error: new Response(`Image not found: ${url}`, { status: 404 })
|
|
18514
19703
|
};
|
|
18515
19704
|
}
|
|
18516
19705
|
return {
|
|
18517
|
-
buffer: Buffer.from(await
|
|
19706
|
+
buffer: Buffer.from(await file5.arrayBuffer()),
|
|
18518
19707
|
upstreamEtag: undefined
|
|
18519
19708
|
};
|
|
18520
19709
|
}, scheduleAvifPregen = (url, width, quality, sourceBuffer, configuredFormats, format, cacheDir, minimumCacheTTL, upstreamEtag) => {
|
|
@@ -18644,7 +19833,7 @@ var exports_generateSitemap = {};
|
|
|
18644
19833
|
__export(exports_generateSitemap, {
|
|
18645
19834
|
generateSitemap: () => generateSitemap
|
|
18646
19835
|
});
|
|
18647
|
-
var {write:
|
|
19836
|
+
var {write: write4 } = globalThis.Bun;
|
|
18648
19837
|
var DEFAULT_PRIORITY = 0.8, escapeXml = (str) => str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), isExcluded = (path, patterns) => {
|
|
18649
19838
|
for (const pattern of patterns) {
|
|
18650
19839
|
if (typeof pattern === "string" && path === pattern)
|
|
@@ -18711,7 +19900,7 @@ var DEFAULT_PRIORITY = 0.8, escapeXml = (str) => str.replace(/&/g, "&").repl
|
|
|
18711
19900
|
const allRoutes = [...discoveredRoutes, ...filteredDynamic];
|
|
18712
19901
|
const baseUrl = config.baseUrl ?? serverUrl;
|
|
18713
19902
|
const xml = buildSitemapXml(allRoutes, baseUrl, config);
|
|
18714
|
-
await
|
|
19903
|
+
await write4(`${outDir}/sitemap.xml`, xml);
|
|
18715
19904
|
};
|
|
18716
19905
|
var init_generateSitemap = __esm(() => {
|
|
18717
19906
|
PAGE_HANDLER_NAMES = [
|
|
@@ -18734,8 +19923,8 @@ __export(exports_prerender, {
|
|
|
18734
19923
|
prerender: () => prerender,
|
|
18735
19924
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
18736
19925
|
});
|
|
18737
|
-
import { mkdirSync as
|
|
18738
|
-
import { join as
|
|
19926
|
+
import { mkdirSync as mkdirSync14, readFileSync as readFileSync18 } from "fs";
|
|
19927
|
+
import { join as join29 } from "path";
|
|
18739
19928
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
18740
19929
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
18741
19930
|
await Bun.write(metaPath, String(Date.now()));
|
|
@@ -18801,7 +19990,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
18801
19990
|
return false;
|
|
18802
19991
|
const html = await res.text();
|
|
18803
19992
|
const fileName = routeToFilename(route);
|
|
18804
|
-
const filePath =
|
|
19993
|
+
const filePath = join29(prerenderDir, fileName);
|
|
18805
19994
|
await Bun.write(filePath, html);
|
|
18806
19995
|
await writeTimestamp(filePath);
|
|
18807
19996
|
return true;
|
|
@@ -18827,14 +20016,14 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
18827
20016
|
}
|
|
18828
20017
|
const html = await res.text();
|
|
18829
20018
|
const fileName = routeToFilename(route);
|
|
18830
|
-
const filePath =
|
|
20019
|
+
const filePath = join29(prerenderDir, fileName);
|
|
18831
20020
|
await Bun.write(filePath, html);
|
|
18832
20021
|
await writeTimestamp(filePath);
|
|
18833
20022
|
result.routes.set(route, filePath);
|
|
18834
20023
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
18835
20024
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
18836
|
-
const prerenderDir =
|
|
18837
|
-
|
|
20025
|
+
const prerenderDir = join29(outDir, "_prerendered");
|
|
20026
|
+
mkdirSync14(prerenderDir, { recursive: true });
|
|
18838
20027
|
const baseUrl = `http://localhost:${port}`;
|
|
18839
20028
|
let routes;
|
|
18840
20029
|
if (staticConfig.routes === "all") {
|
|
@@ -19429,8 +20618,8 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
19429
20618
|
});
|
|
19430
20619
|
};
|
|
19431
20620
|
// src/core/prepare.ts
|
|
19432
|
-
import { existsSync as
|
|
19433
|
-
import { basename as
|
|
20621
|
+
import { existsSync as existsSync28, readdirSync as readdirSync2, readFileSync as readFileSync19 } from "fs";
|
|
20622
|
+
import { basename as basename13, join as join30, relative as relative13, resolve as resolve36 } from "path";
|
|
19434
20623
|
import { Elysia as Elysia5 } from "elysia";
|
|
19435
20624
|
|
|
19436
20625
|
// src/utils/loadConfig.ts
|
|
@@ -19445,6 +20634,7 @@ var RESERVED_TOP_LEVEL_KEYS = new Set([
|
|
|
19445
20634
|
"cwd",
|
|
19446
20635
|
"dependsOn",
|
|
19447
20636
|
"dev",
|
|
20637
|
+
"emberDirectory",
|
|
19448
20638
|
"entry",
|
|
19449
20639
|
"env",
|
|
19450
20640
|
"htmlDirectory",
|
|
@@ -19692,8 +20882,11 @@ var logConventionRenderError = (framework, label, renderError) => {
|
|
|
19692
20882
|
}
|
|
19693
20883
|
console.error(`[SSR] Failed to render ${framework} convention ${label} page:`, renderError);
|
|
19694
20884
|
};
|
|
20885
|
+
var renderEmberError = async () => null;
|
|
20886
|
+
var renderEmberNotFound = async () => null;
|
|
19695
20887
|
var ERROR_RENDERERS = {
|
|
19696
20888
|
angular: renderAngularError,
|
|
20889
|
+
ember: renderEmberError,
|
|
19697
20890
|
react: renderReactError,
|
|
19698
20891
|
svelte: renderSvelteError,
|
|
19699
20892
|
vue: renderVueError
|
|
@@ -19776,6 +20969,7 @@ var renderAngularNotFound = async (conventionPath) => {
|
|
|
19776
20969
|
};
|
|
19777
20970
|
var NOT_FOUND_RENDERERS = {
|
|
19778
20971
|
angular: renderAngularNotFound,
|
|
20972
|
+
ember: renderEmberNotFound,
|
|
19779
20973
|
react: renderReactNotFound,
|
|
19780
20974
|
svelte: renderSvelteNotFound,
|
|
19781
20975
|
vue: renderVueNotFound
|
|
@@ -19848,7 +21042,7 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
19848
21042
|
for (const { dir, pattern } of prewarmDirs) {
|
|
19849
21043
|
const glob = new Glob10(pattern);
|
|
19850
21044
|
const matches = [
|
|
19851
|
-
...glob.scanSync({ absolute: true, cwd:
|
|
21045
|
+
...glob.scanSync({ absolute: true, cwd: resolve36(dir) })
|
|
19852
21046
|
];
|
|
19853
21047
|
files.push(...matches);
|
|
19854
21048
|
}
|
|
@@ -19856,10 +21050,10 @@ var collectPrewarmFiles = async (prewarmDirs) => {
|
|
|
19856
21050
|
};
|
|
19857
21051
|
var warmPrewarmDirs = async (prewarmDirs, warmCache2, SRC_URL_PREFIX2) => {
|
|
19858
21052
|
const files = await collectPrewarmFiles(prewarmDirs);
|
|
19859
|
-
for (const
|
|
19860
|
-
if (
|
|
21053
|
+
for (const file5 of files) {
|
|
21054
|
+
if (file5.includes("/node_modules/"))
|
|
19861
21055
|
continue;
|
|
19862
|
-
const rel = relative13(process.cwd(),
|
|
21056
|
+
const rel = relative13(process.cwd(), file5).replace(/\\/g, "/");
|
|
19863
21057
|
warmCache2(`${SRC_URL_PREFIX2}${rel}`);
|
|
19864
21058
|
}
|
|
19865
21059
|
};
|
|
@@ -19884,8 +21078,8 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
19884
21078
|
const fileName = resolveDevIndexFileName(manifest[key], baseName);
|
|
19885
21079
|
if (!fileName)
|
|
19886
21080
|
continue;
|
|
19887
|
-
const srcPath =
|
|
19888
|
-
if (!
|
|
21081
|
+
const srcPath = resolve36(devIndexDir, fileName);
|
|
21082
|
+
if (!existsSync28(srcPath))
|
|
19889
21083
|
continue;
|
|
19890
21084
|
const rel = relative13(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
19891
21085
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -19957,7 +21151,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
19957
21151
|
stepStartedAt = performance.now();
|
|
19958
21152
|
const hmrPlugin = hmr2(result.hmrState, result.manifest, moduleHandler);
|
|
19959
21153
|
const { devtoolsJson: devtoolsJson2 } = await Promise.resolve().then(() => (init_devtoolsJson(), exports_devtoolsJson));
|
|
19960
|
-
const devIndexDir =
|
|
21154
|
+
const devIndexDir = resolve36(buildDir, "_src_indexes");
|
|
19961
21155
|
patchManifestIndexes(result.manifest, devIndexDir, SRC_URL_PREFIX2);
|
|
19962
21156
|
recordStep("configure dev plugins", stepStartedAt);
|
|
19963
21157
|
stepStartedAt = performance.now();
|
|
@@ -19993,7 +21187,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
19993
21187
|
};
|
|
19994
21188
|
var loadPrerenderMap = (prerenderDir) => {
|
|
19995
21189
|
const map = new Map;
|
|
19996
|
-
if (!
|
|
21190
|
+
if (!existsSync28(prerenderDir))
|
|
19997
21191
|
return map;
|
|
19998
21192
|
let entries;
|
|
19999
21193
|
try {
|
|
@@ -20004,9 +21198,9 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
20004
21198
|
for (const entry of entries) {
|
|
20005
21199
|
if (!entry.endsWith(".html"))
|
|
20006
21200
|
continue;
|
|
20007
|
-
const name =
|
|
21201
|
+
const name = basename13(entry, ".html");
|
|
20008
21202
|
const route = name === "index" ? "/" : `/${name}`;
|
|
20009
|
-
map.set(route,
|
|
21203
|
+
map.set(route, join30(prerenderDir, entry));
|
|
20010
21204
|
}
|
|
20011
21205
|
return map;
|
|
20012
21206
|
};
|
|
@@ -20038,7 +21232,7 @@ var prepare = async (configOrPath) => {
|
|
|
20038
21232
|
recordStep("load config", stepStartedAt);
|
|
20039
21233
|
const nodeEnv = process.env["NODE_ENV"];
|
|
20040
21234
|
const isDev3 = nodeEnv === "development";
|
|
20041
|
-
const buildDir =
|
|
21235
|
+
const buildDir = resolve36(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
20042
21236
|
if (isDev3) {
|
|
20043
21237
|
stepStartedAt = performance.now();
|
|
20044
21238
|
const result = await prepareDev(config, buildDir);
|
|
@@ -20055,8 +21249,8 @@ var prepare = async (configOrPath) => {
|
|
|
20055
21249
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
20056
21250
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
20057
21251
|
stepStartedAt = performance.now();
|
|
20058
|
-
const conventionsPath =
|
|
20059
|
-
if (
|
|
21252
|
+
const conventionsPath = join30(buildDir, "conventions.json");
|
|
21253
|
+
if (existsSync28(conventionsPath)) {
|
|
20060
21254
|
const conventions2 = JSON.parse(readFileSync19(conventionsPath, "utf-8"));
|
|
20061
21255
|
setConventions(conventions2);
|
|
20062
21256
|
}
|
|
@@ -20071,7 +21265,7 @@ var prepare = async (configOrPath) => {
|
|
|
20071
21265
|
});
|
|
20072
21266
|
recordStep("create static plugin", stepStartedAt);
|
|
20073
21267
|
stepStartedAt = performance.now();
|
|
20074
|
-
const prerenderDir =
|
|
21268
|
+
const prerenderDir = join30(buildDir, "_prerendered");
|
|
20075
21269
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
20076
21270
|
recordStep("load prerender map", stepStartedAt);
|
|
20077
21271
|
if (prerenderMap.size > 0) {
|
|
@@ -20129,15 +21323,15 @@ import { argv } from "process";
|
|
|
20129
21323
|
var {env: env4 } = globalThis.Bun;
|
|
20130
21324
|
|
|
20131
21325
|
// src/dev/devCert.ts
|
|
20132
|
-
import { existsSync as
|
|
20133
|
-
import { join as
|
|
20134
|
-
var CERT_DIR =
|
|
20135
|
-
var CERT_PATH =
|
|
20136
|
-
var KEY_PATH =
|
|
21326
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync15, readFileSync as readFileSync20, rmSync as rmSync3 } from "fs";
|
|
21327
|
+
import { join as join31 } from "path";
|
|
21328
|
+
var CERT_DIR = join31(process.cwd(), ".absolutejs");
|
|
21329
|
+
var CERT_PATH = join31(CERT_DIR, "cert.pem");
|
|
21330
|
+
var KEY_PATH = join31(CERT_DIR, "key.pem");
|
|
20137
21331
|
var CERT_VALIDITY_DAYS = 365;
|
|
20138
21332
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
20139
21333
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
20140
|
-
var certFilesExist = () =>
|
|
21334
|
+
var certFilesExist = () => existsSync29(CERT_PATH) && existsSync29(KEY_PATH);
|
|
20141
21335
|
var isCertExpired = () => {
|
|
20142
21336
|
try {
|
|
20143
21337
|
const certPem = readFileSync20(CERT_PATH, "utf-8");
|
|
@@ -20214,7 +21408,7 @@ var generateCert = () => {
|
|
|
20214
21408
|
}
|
|
20215
21409
|
};
|
|
20216
21410
|
var ensureDevCert = () => {
|
|
20217
|
-
|
|
21411
|
+
mkdirSync15(CERT_DIR, { recursive: true });
|
|
20218
21412
|
if (hasCert()) {
|
|
20219
21413
|
return { cert: CERT_PATH, key: KEY_PATH };
|
|
20220
21414
|
}
|
|
@@ -20465,8 +21659,8 @@ var jsonLd2 = (schema) => {
|
|
|
20465
21659
|
};
|
|
20466
21660
|
// src/utils/defineEnv.ts
|
|
20467
21661
|
var {env: bunEnv } = globalThis.Bun;
|
|
20468
|
-
import { existsSync as
|
|
20469
|
-
import { resolve as
|
|
21662
|
+
import { existsSync as existsSync30, readFileSync as readFileSync21 } from "fs";
|
|
21663
|
+
import { resolve as resolve37 } from "path";
|
|
20470
21664
|
|
|
20471
21665
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
20472
21666
|
var exports_value = {};
|
|
@@ -24595,8 +25789,8 @@ function FromConstructor6(schema, references) {
|
|
|
24595
25789
|
return class {
|
|
24596
25790
|
constructor() {
|
|
24597
25791
|
for (const [key, val] of Object.entries(value)) {
|
|
24598
|
-
const
|
|
24599
|
-
|
|
25792
|
+
const self2 = this;
|
|
25793
|
+
self2[key] = val;
|
|
24600
25794
|
}
|
|
24601
25795
|
}
|
|
24602
25796
|
};
|
|
@@ -26501,8 +27695,8 @@ ${lines.join(`
|
|
|
26501
27695
|
};
|
|
26502
27696
|
var checkEnvFileSecurity = (properties) => {
|
|
26503
27697
|
const cwd2 = process.cwd();
|
|
26504
|
-
const envPath =
|
|
26505
|
-
if (!
|
|
27698
|
+
const envPath = resolve37(cwd2, ".env");
|
|
27699
|
+
if (!existsSync30(envPath))
|
|
26506
27700
|
return;
|
|
26507
27701
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
26508
27702
|
if (sensitiveKeys.length === 0)
|
|
@@ -26511,8 +27705,8 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
26511
27705
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
26512
27706
|
if (presentKeys.length === 0)
|
|
26513
27707
|
return;
|
|
26514
|
-
const gitignorePath =
|
|
26515
|
-
if (
|
|
27708
|
+
const gitignorePath = resolve37(cwd2, ".gitignore");
|
|
27709
|
+
if (existsSync30(gitignorePath)) {
|
|
26516
27710
|
const gitignore = readFileSync21(gitignorePath, "utf-8");
|
|
26517
27711
|
if (gitignore.split(`
|
|
26518
27712
|
`).some((line) => line.trim() === ".env"))
|
|
@@ -26751,5 +27945,5 @@ export {
|
|
|
26751
27945
|
ANGULAR_INIT_TIMEOUT_MS
|
|
26752
27946
|
};
|
|
26753
27947
|
|
|
26754
|
-
//# debugId=
|
|
27948
|
+
//# debugId=3B75AB8D6F99C63464756E2164756E21
|
|
26755
27949
|
//# sourceMappingURL=index.js.map
|