@absolutejs/absolute 0.19.0-beta.1023 → 0.19.0-beta.1025
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/browser.js +13 -17
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +595 -267
- package/dist/angular/index.js.map +11 -8
- package/dist/angular/server.js +577 -249
- package/dist/angular/server.js.map +11 -8
- package/dist/build.js +827 -735
- package/dist/build.js.map +11 -10
- package/dist/cli/config/server.js +49 -42
- package/dist/cli/index.js +366 -9
- package/dist/client/index.js +34 -20
- package/dist/client/index.js.map +6 -6
- package/dist/index.js +899 -800
- package/dist/index.js.map +12 -11
- package/dist/islands/index.js +416 -95
- package/dist/islands/index.js.map +10 -7
- package/dist/react/browser.js +13 -17
- package/dist/react/browser.js.map +3 -3
- package/dist/react/index.js +484 -156
- package/dist/react/index.js.map +12 -9
- package/dist/react/server.js +69 -62
- package/dist/react/server.js.map +5 -5
- package/dist/src/cli/scripts/tunnelRelay.d.ts +9 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +4 -1
- package/dist/src/core/angularServerModule.d.ts +1 -0
- package/dist/src/dev/tunnel/client.d.ts +20 -0
- package/dist/src/dev/tunnel/protocol.d.ts +85 -0
- package/dist/src/dev/tunnel/relay.d.ts +28 -0
- package/dist/src/utils/loadConfig.d.ts +4 -0
- package/dist/svelte/index.js +389 -61
- package/dist/svelte/index.js.map +11 -8
- package/dist/svelte/server.js +50 -43
- package/dist/svelte/server.js.map +3 -3
- package/dist/types/angular.d.ts +3 -0
- package/dist/types/build.d.ts +11 -0
- package/dist/types/globals.d.ts +0 -1
- package/dist/vue/browser.js +13 -17
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +477 -153
- package/dist/vue/index.js.map +12 -9
- package/dist/vue/server.js +50 -43
- package/dist/vue/server.js.map +3 -3
- package/package.json +2 -6
package/dist/index.js
CHANGED
|
@@ -6839,9 +6839,12 @@ var initDominoAdapter = (platformServer) => {
|
|
|
6839
6839
|
return {
|
|
6840
6840
|
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
6841
6841
|
bootstrapApplication: platformBrowser.bootstrapApplication,
|
|
6842
|
+
Component: core.Component,
|
|
6842
6843
|
DomSanitizer: platformBrowser.DomSanitizer,
|
|
6843
6844
|
ENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,
|
|
6844
6845
|
inject: core.inject,
|
|
6846
|
+
InjectionToken: core.InjectionToken,
|
|
6847
|
+
NgComponentOutlet: common.NgComponentOutlet,
|
|
6845
6848
|
provideClientHydration: platformBrowser.provideClientHydration,
|
|
6846
6849
|
provideServerRendering: platformServer.provideServerRendering,
|
|
6847
6850
|
provideZonelessChangeDetection: core.provideZonelessChangeDetection,
|
|
@@ -7097,9 +7100,8 @@ var angularIslandSelector = "abs-angular-island", isAngularComponent = (value) =
|
|
|
7097
7100
|
const componentName = typeof component.name === "string" && component.name.length > 0 ? component.name : "AngularIsland";
|
|
7098
7101
|
return `${componentName}:${JSON.stringify(props)}`;
|
|
7099
7102
|
}, buildAngularIslandWrapperMetadata = async (component, islandId, wrapperKey) => {
|
|
7100
|
-
const { Component, InjectionToken, inject } = await import("@angular/core");
|
|
7101
|
-
const { NgComponentOutlet } = await import("@angular/common");
|
|
7102
7103
|
const deps = await getAngularDeps();
|
|
7104
|
+
const { Component, InjectionToken, NgComponentOutlet, inject } = deps;
|
|
7103
7105
|
const selector = getAngularIslandSelector(islandId);
|
|
7104
7106
|
const propsToken = new InjectionToken(`${wrapperKey}:props`);
|
|
7105
7107
|
|
|
@@ -7205,7 +7207,15 @@ var init_islands2 = __esm(() => {
|
|
|
7205
7207
|
var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
|
|
7206
7208
|
const { renderAngularIslandToHtml: renderAngularIslandToHtml2 } = await Promise.resolve().then(() => (init_islands2(), exports_islands));
|
|
7207
7209
|
return renderAngularIslandToHtml2(component, props, islandId);
|
|
7208
|
-
}, renderAngularIslandToHtml2,
|
|
7210
|
+
}, renderAngularIslandToHtml2, LEADING_HOISTED_RESOURCE_RE, stripLeadingHoistedResources = (html) => {
|
|
7211
|
+
let result = html;
|
|
7212
|
+
let match = LEADING_HOISTED_RESOURCE_RE.exec(result);
|
|
7213
|
+
while (match) {
|
|
7214
|
+
result = result.slice(match[0].length);
|
|
7215
|
+
match = LEADING_HOISTED_RESOURCE_RE.exec(result);
|
|
7216
|
+
}
|
|
7217
|
+
return result.trimStart();
|
|
7218
|
+
}, renderReactIslandToHtml = (component, props) => import("react").then(({ createElement }) => import("react-dom/server").then(({ renderToString }) => stripLeadingHoistedResources(renderToString(createElement(component, props))))), renderSvelteIslandToHtml = (component, props) => import("svelte/server").then(({ render }) => {
|
|
7209
7219
|
const { body } = render(component, { props });
|
|
7210
7220
|
return body;
|
|
7211
7221
|
}), renderVueIslandToHtml = (component, props) => import("vue").then(({ createSSRApp, h: createVueVNode }) => {
|
|
@@ -7216,10 +7226,311 @@ var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
|
|
|
7216
7226
|
});
|
|
7217
7227
|
var init_islandSsr = __esm(() => {
|
|
7218
7228
|
renderAngularIslandToHtml2 = renderAngularIslandToHtmlInternal;
|
|
7229
|
+
LEADING_HOISTED_RESOURCE_RE = /^\s*(?:<link\b[^>]*\/?>|<meta\b[^>]*\/?>|<title\b[^>]*>[\s\S]*?<\/title>|<style\b[^>]*>[\s\S]*?<\/style>|<script\b[^>]*>[\s\S]*?<\/script>)/i;
|
|
7230
|
+
});
|
|
7231
|
+
|
|
7232
|
+
// src/build/nativeRewrite.ts
|
|
7233
|
+
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
7234
|
+
import { platform, arch } from "os";
|
|
7235
|
+
import { resolve as resolve5 } from "path";
|
|
7236
|
+
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
7237
|
+
if (nativeLib !== null)
|
|
7238
|
+
return nativeLib;
|
|
7239
|
+
const osPlatform = platform();
|
|
7240
|
+
const cpu = arch();
|
|
7241
|
+
const platformMap = {
|
|
7242
|
+
"darwin-arm64": "darwin-arm64/fast_ops.dylib",
|
|
7243
|
+
"darwin-x64": "darwin-x64/fast_ops.dylib",
|
|
7244
|
+
"linux-arm64": "linux-arm64/fast_ops.so",
|
|
7245
|
+
"linux-x64": "linux-x64/fast_ops.so",
|
|
7246
|
+
"win32-arm64": "windows-arm64/fast_ops.dll",
|
|
7247
|
+
"win32-x64": "windows-x64/fast_ops.dll"
|
|
7248
|
+
};
|
|
7249
|
+
const libPath = platformMap[`${osPlatform}-${cpu}`];
|
|
7250
|
+
if (!libPath)
|
|
7251
|
+
return null;
|
|
7252
|
+
try {
|
|
7253
|
+
const fullPath = resolve5(import.meta.dir, "../../native/packages", libPath);
|
|
7254
|
+
const lib = dlopen(fullPath, ffiDefinition);
|
|
7255
|
+
nativeLib = lib.symbols;
|
|
7256
|
+
return nativeLib;
|
|
7257
|
+
} catch {
|
|
7258
|
+
return null;
|
|
7259
|
+
}
|
|
7260
|
+
}, nativeRewriteImports = (content, replacements) => {
|
|
7261
|
+
const lib = loadNative();
|
|
7262
|
+
if (!lib)
|
|
7263
|
+
return null;
|
|
7264
|
+
const jsonStr = JSON.stringify(replacements);
|
|
7265
|
+
const contentBuf = Buffer.from(content);
|
|
7266
|
+
const jsonBuf = Buffer.from(jsonStr);
|
|
7267
|
+
const outBuf = Buffer.alloc(content.length * 2);
|
|
7268
|
+
const outLenBuf = new BigUint64Array([BigInt(outBuf.length)]);
|
|
7269
|
+
const result = lib.rewrite_imports(ptr(contentBuf), contentBuf.length, ptr(jsonBuf), jsonBuf.length, ptr(outBuf), ptr(new Uint8Array(outLenBuf.buffer)));
|
|
7270
|
+
if (result < 0)
|
|
7271
|
+
return null;
|
|
7272
|
+
if (result === 0)
|
|
7273
|
+
return content;
|
|
7274
|
+
const outLen = Number(outLenBuf[0]);
|
|
7275
|
+
return outBuf.subarray(0, outLen).toString("utf-8");
|
|
7276
|
+
};
|
|
7277
|
+
var init_nativeRewrite = __esm(() => {
|
|
7278
|
+
ffiDefinition = {
|
|
7279
|
+
rewrite_imports: {
|
|
7280
|
+
args: [
|
|
7281
|
+
FFIType.ptr,
|
|
7282
|
+
FFIType.u64,
|
|
7283
|
+
FFIType.ptr,
|
|
7284
|
+
FFIType.u64,
|
|
7285
|
+
FFIType.ptr,
|
|
7286
|
+
FFIType.ptr
|
|
7287
|
+
],
|
|
7288
|
+
returns: FFIType.i32
|
|
7289
|
+
}
|
|
7290
|
+
};
|
|
7291
|
+
});
|
|
7292
|
+
|
|
7293
|
+
// src/build/rewriteImportsPlugin.ts
|
|
7294
|
+
var exports_rewriteImportsPlugin = {};
|
|
7295
|
+
__export(exports_rewriteImportsPlugin, {
|
|
7296
|
+
rewriteVendorDirectories: () => rewriteVendorDirectories,
|
|
7297
|
+
rewriteImportsInContent: () => rewriteImportsInContent,
|
|
7298
|
+
rewriteBuildOutputsWith: () => rewriteBuildOutputsWith,
|
|
7299
|
+
rewriteBuildOutputs: () => rewriteBuildOutputs,
|
|
7300
|
+
jsRewriteImports: () => jsRewriteImports,
|
|
7301
|
+
fixMissingReExportNamespacesInContent: () => fixMissingReExportNamespacesInContent,
|
|
7302
|
+
buildWithImportRewrite: () => buildWithImportRewrite
|
|
7303
|
+
});
|
|
7304
|
+
import { readdir } from "fs/promises";
|
|
7305
|
+
import { join as join5 } from "path";
|
|
7306
|
+
var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
7307
|
+
let result = content;
|
|
7308
|
+
for (const [specifier, webPath] of replacements) {
|
|
7309
|
+
const escaped = escapeRegex(specifier);
|
|
7310
|
+
const fromRegex = new RegExp(`(from\\s*["'])${escaped}(["'])`, "g");
|
|
7311
|
+
const sideEffectRegex = new RegExp(`(import\\s*["'])${escaped}(["'])`, "g");
|
|
7312
|
+
const dynamicRegex = new RegExp(`(import\\s*\\(\\s*["'])${escaped}(["']\\s*\\))`, "g");
|
|
7313
|
+
result = result.replace(fromRegex, `$1${webPath}$2`);
|
|
7314
|
+
result = result.replace(sideEffectRegex, `$1${webPath}$2`);
|
|
7315
|
+
result = result.replace(dynamicRegex, `$1${webPath}$2`);
|
|
7316
|
+
}
|
|
7317
|
+
return result;
|
|
7318
|
+
}, rewriteImportsInContent = (content, vendorPaths) => {
|
|
7319
|
+
if (Object.keys(vendorPaths).length === 0)
|
|
7320
|
+
return content;
|
|
7321
|
+
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
7322
|
+
const native = nativeRewriteImports(content, replacements);
|
|
7323
|
+
return native ?? jsRewriteImports(content, replacements);
|
|
7324
|
+
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
7325
|
+
const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
|
|
7326
|
+
REEXPORT_PATTERN.lastIndex = 0;
|
|
7327
|
+
const missing = [];
|
|
7328
|
+
let match;
|
|
7329
|
+
while ((match = REEXPORT_PATTERN.exec(content)) !== null) {
|
|
7330
|
+
const ident = match[1];
|
|
7331
|
+
if (!ident)
|
|
7332
|
+
continue;
|
|
7333
|
+
const nsImportRe = new RegExp(`\\bimport\\s*\\*\\s*as\\s+${ident}\\s+from\\b`);
|
|
7334
|
+
if (nsImportRe.test(content))
|
|
7335
|
+
continue;
|
|
7336
|
+
const declRe = new RegExp(`\\b(?:const|let|var|function|class)\\s+${ident}\\b`);
|
|
7337
|
+
if (declRe.test(content))
|
|
7338
|
+
continue;
|
|
7339
|
+
const namedImportRe = new RegExp(`\\bimport\\s*\\{[^}]*\\b${ident}\\b[^}]*\\}\\s*from\\b`);
|
|
7340
|
+
if (namedImportRe.test(content))
|
|
7341
|
+
continue;
|
|
7342
|
+
const importPathRe = /(?:from\s+|import\s*)["']([^"']+)["']/g;
|
|
7343
|
+
let pathMatch;
|
|
7344
|
+
let sourcePath;
|
|
7345
|
+
while ((pathMatch = importPathRe.exec(content)) !== null) {
|
|
7346
|
+
const p2 = pathMatch[1];
|
|
7347
|
+
if (!p2)
|
|
7348
|
+
continue;
|
|
7349
|
+
const base = p2.split("/").pop()?.replace(/\.[mc]?js$/, "");
|
|
7350
|
+
if (!base)
|
|
7351
|
+
continue;
|
|
7352
|
+
const normalized = base.startsWith("_") ? base.slice(1) : base;
|
|
7353
|
+
if (normalized === ident || normalized.endsWith(`_${ident}`)) {
|
|
7354
|
+
sourcePath = p2;
|
|
7355
|
+
break;
|
|
7356
|
+
}
|
|
7357
|
+
}
|
|
7358
|
+
if (sourcePath)
|
|
7359
|
+
missing.push({ ident, path: sourcePath });
|
|
7360
|
+
}
|
|
7361
|
+
if (missing.length === 0)
|
|
7362
|
+
return content;
|
|
7363
|
+
const seen = new Set;
|
|
7364
|
+
const unique = missing.filter((entry) => {
|
|
7365
|
+
if (seen.has(entry.ident))
|
|
7366
|
+
return false;
|
|
7367
|
+
seen.add(entry.ident);
|
|
7368
|
+
return true;
|
|
7369
|
+
});
|
|
7370
|
+
const inserts = unique.map((entry) => `import * as ${entry.ident} from "${entry.path}";`).join(`
|
|
7371
|
+
`);
|
|
7372
|
+
return `${inserts}
|
|
7373
|
+
${content}`;
|
|
7374
|
+
}, isReadableArtifact = (artifact) => artifact.path.endsWith(".js"), rewriteBuildOutputs = async (outputs, vendorPaths) => {
|
|
7375
|
+
if (Object.keys(vendorPaths).length === 0)
|
|
7376
|
+
return;
|
|
7377
|
+
await Promise.all(outputs.filter(isReadableArtifact).map(async (artifact) => {
|
|
7378
|
+
let original;
|
|
7379
|
+
try {
|
|
7380
|
+
original = await artifact.text();
|
|
7381
|
+
} catch (err) {
|
|
7382
|
+
const code = err.code;
|
|
7383
|
+
if (code === "ENOENT")
|
|
7384
|
+
return;
|
|
7385
|
+
throw err;
|
|
7386
|
+
}
|
|
7387
|
+
const rewritten = rewriteImportsInContent(original, vendorPaths);
|
|
7388
|
+
if (rewritten === original)
|
|
7389
|
+
return;
|
|
7390
|
+
try {
|
|
7391
|
+
await Bun.write(artifact.path, rewritten);
|
|
7392
|
+
} catch (err) {
|
|
7393
|
+
const code = err.code;
|
|
7394
|
+
if (code === "ENOENT")
|
|
7395
|
+
return;
|
|
7396
|
+
throw err;
|
|
7397
|
+
}
|
|
7398
|
+
}));
|
|
7399
|
+
}, rewriteBuildOutputsWith = async (outputs, resolveVendorPaths) => {
|
|
7400
|
+
await Promise.all(outputs.filter(isReadableArtifact).map(async (artifact) => {
|
|
7401
|
+
const vendorPaths = resolveVendorPaths(artifact);
|
|
7402
|
+
if (Object.keys(vendorPaths).length === 0)
|
|
7403
|
+
return;
|
|
7404
|
+
let original;
|
|
7405
|
+
try {
|
|
7406
|
+
original = await artifact.text();
|
|
7407
|
+
} catch (err) {
|
|
7408
|
+
const code = err.code;
|
|
7409
|
+
if (code === "ENOENT")
|
|
7410
|
+
return;
|
|
7411
|
+
throw err;
|
|
7412
|
+
}
|
|
7413
|
+
const rewritten = rewriteImportsInContent(original, vendorPaths);
|
|
7414
|
+
if (rewritten === original)
|
|
7415
|
+
return;
|
|
7416
|
+
try {
|
|
7417
|
+
await Bun.write(artifact.path, rewritten);
|
|
7418
|
+
} catch (err) {
|
|
7419
|
+
const code = err.code;
|
|
7420
|
+
if (code === "ENOENT")
|
|
7421
|
+
return;
|
|
7422
|
+
throw err;
|
|
7423
|
+
}
|
|
7424
|
+
}));
|
|
7425
|
+
}, rewriteVendorDirectories = async (vendorDirs, vendorPaths) => {
|
|
7426
|
+
if (Object.keys(vendorPaths).length === 0)
|
|
7427
|
+
return;
|
|
7428
|
+
const allFiles = [];
|
|
7429
|
+
for (const dir of vendorDirs) {
|
|
7430
|
+
try {
|
|
7431
|
+
const entries = await readdir(dir);
|
|
7432
|
+
for (const entry of entries) {
|
|
7433
|
+
if (entry.endsWith(".js"))
|
|
7434
|
+
allFiles.push(join5(dir, entry));
|
|
7435
|
+
}
|
|
7436
|
+
} catch {}
|
|
7437
|
+
}
|
|
7438
|
+
await Promise.all(allFiles.map(async (filePath) => {
|
|
7439
|
+
let original;
|
|
7440
|
+
try {
|
|
7441
|
+
original = await Bun.file(filePath).text();
|
|
7442
|
+
} catch (err) {
|
|
7443
|
+
const code = err.code;
|
|
7444
|
+
if (code === "ENOENT")
|
|
7445
|
+
return;
|
|
7446
|
+
throw err;
|
|
7447
|
+
}
|
|
7448
|
+
let next = rewriteImportsInContent(original, vendorPaths);
|
|
7449
|
+
next = fixMissingReExportNamespacesInContent(next);
|
|
7450
|
+
if (next === original)
|
|
7451
|
+
return;
|
|
7452
|
+
try {
|
|
7453
|
+
await Bun.write(filePath, next);
|
|
7454
|
+
} catch (err) {
|
|
7455
|
+
const code = err.code;
|
|
7456
|
+
if (code === "ENOENT")
|
|
7457
|
+
return;
|
|
7458
|
+
throw err;
|
|
7459
|
+
}
|
|
7460
|
+
}));
|
|
7461
|
+
}, buildWithImportRewrite = async (pendingBuild, vendorPaths) => {
|
|
7462
|
+
const result = await pendingBuild;
|
|
7463
|
+
if (result.outputs.length > 0) {
|
|
7464
|
+
await rewriteBuildOutputs(result.outputs, vendorPaths);
|
|
7465
|
+
}
|
|
7466
|
+
return result;
|
|
7467
|
+
};
|
|
7468
|
+
var init_rewriteImportsPlugin = __esm(() => {
|
|
7469
|
+
init_nativeRewrite();
|
|
7470
|
+
});
|
|
7471
|
+
|
|
7472
|
+
// src/core/angularServerModule.ts
|
|
7473
|
+
import { mkdir as mkdir2 } from "fs/promises";
|
|
7474
|
+
import { dirname as dirname5, join as join6, relative as relative2 } from "path";
|
|
7475
|
+
var serverCacheRoot, compiledModuleCache, ANGULAR_SPECIFIER_RE, getCachedModulePath = (sourcePath) => {
|
|
7476
|
+
const relativeSourcePath = relative2(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
7477
|
+
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
7478
|
+
return join6(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
7479
|
+
}, collectVendorPaths = (code) => {
|
|
7480
|
+
const vendorPaths = {};
|
|
7481
|
+
if (!isProductionRuntime()) {
|
|
7482
|
+
return vendorPaths;
|
|
7483
|
+
}
|
|
7484
|
+
const specifiers = new Set([...code.matchAll(ANGULAR_SPECIFIER_RE)].map((match) => match[1]));
|
|
7485
|
+
specifiers.forEach((specifier) => {
|
|
7486
|
+
if (!specifier)
|
|
7487
|
+
return;
|
|
7488
|
+
const resolved = resolveAngularRuntimePath(specifier);
|
|
7489
|
+
if (resolved === specifier)
|
|
7490
|
+
return;
|
|
7491
|
+
vendorPaths[specifier] = resolved;
|
|
7492
|
+
});
|
|
7493
|
+
return vendorPaths;
|
|
7494
|
+
}, buildAngularServerModule = async (sourcePath) => {
|
|
7495
|
+
const result = await Bun.build({
|
|
7496
|
+
entrypoints: [sourcePath],
|
|
7497
|
+
format: "esm",
|
|
7498
|
+
packages: "external",
|
|
7499
|
+
target: "bun",
|
|
7500
|
+
throw: false
|
|
7501
|
+
});
|
|
7502
|
+
const entry = result.outputs.find((output) => output.kind === "entry-point");
|
|
7503
|
+
if (!result.success || !entry) {
|
|
7504
|
+
const message = result.logs.map((log) => String(log)).join(`
|
|
7505
|
+
`);
|
|
7506
|
+
throw new Error(`Failed to compile Angular island server module for "${sourcePath}":
|
|
7507
|
+
${message}`);
|
|
7508
|
+
}
|
|
7509
|
+
const code = await entry.text();
|
|
7510
|
+
const rewritten = rewriteImportsInContent(code, collectVendorPaths(code));
|
|
7511
|
+
const modulePath = getCachedModulePath(sourcePath);
|
|
7512
|
+
await mkdir2(dirname5(modulePath), { recursive: true });
|
|
7513
|
+
await Bun.write(modulePath, rewritten);
|
|
7514
|
+
return modulePath;
|
|
7515
|
+
}, compileAngularServerModule = (sourcePath) => {
|
|
7516
|
+
const cached = compiledModuleCache.get(sourcePath);
|
|
7517
|
+
if (cached) {
|
|
7518
|
+
return cached;
|
|
7519
|
+
}
|
|
7520
|
+
const compiledModulePromise = buildAngularServerModule(sourcePath);
|
|
7521
|
+
compiledModuleCache.set(sourcePath, compiledModulePromise);
|
|
7522
|
+
return compiledModulePromise;
|
|
7523
|
+
};
|
|
7524
|
+
var init_angularServerModule = __esm(() => {
|
|
7525
|
+
init_resolveAngularPackage();
|
|
7526
|
+
init_rewriteImportsPlugin();
|
|
7527
|
+
serverCacheRoot = join6(process.cwd(), ".absolutejs", "islands", "angular");
|
|
7528
|
+
compiledModuleCache = new Map;
|
|
7529
|
+
ANGULAR_SPECIFIER_RE = /["'](@angular\/[^"']+)["']/g;
|
|
7219
7530
|
});
|
|
7220
7531
|
|
|
7221
7532
|
// src/build/resolvePackageImport.ts
|
|
7222
|
-
import { resolve as
|
|
7533
|
+
import { resolve as resolve6, join as join7 } from "path";
|
|
7223
7534
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "fs";
|
|
7224
7535
|
var resolveExportPath = (entry, conditions) => {
|
|
7225
7536
|
if (typeof entry === "string")
|
|
@@ -7241,11 +7552,11 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
7241
7552
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
7242
7553
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
7243
7554
|
const exportKey = subpath ? `./${subpath}` : ".";
|
|
7244
|
-
const currentPackageJsonPath =
|
|
7555
|
+
const currentPackageJsonPath = resolve6(process.cwd(), "package.json");
|
|
7245
7556
|
const currentPackageJson = existsSync5(currentPackageJsonPath) ? JSON.parse(readFileSync5(currentPackageJsonPath, "utf-8")) : null;
|
|
7246
7557
|
const currentPackageDir = currentPackageJson?.name === packageName ? process.cwd() : null;
|
|
7247
|
-
const packageDir = currentPackageDir ??
|
|
7248
|
-
const packageJsonPath =
|
|
7558
|
+
const packageDir = currentPackageDir ?? resolve6(process.cwd(), "node_modules", packageName ?? "");
|
|
7559
|
+
const packageJsonPath = join7(packageDir, "package.json");
|
|
7249
7560
|
if (!existsSync5(packageJsonPath))
|
|
7250
7561
|
return null;
|
|
7251
7562
|
try {
|
|
@@ -7260,12 +7571,12 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
7260
7571
|
if (!importPath)
|
|
7261
7572
|
return null;
|
|
7262
7573
|
if (currentPackageDir && importPath.startsWith("./dist/")) {
|
|
7263
|
-
const sourceCandidate =
|
|
7574
|
+
const sourceCandidate = resolve6(packageDir, importPath.replace(/^\.\/dist\//, "./src/"));
|
|
7264
7575
|
if (existsSync5(sourceCandidate)) {
|
|
7265
7576
|
return sourceCandidate;
|
|
7266
7577
|
}
|
|
7267
7578
|
}
|
|
7268
|
-
const resolved =
|
|
7579
|
+
const resolved = resolve6(packageDir, importPath);
|
|
7269
7580
|
return existsSync5(resolved) ? resolved : null;
|
|
7270
7581
|
} catch {
|
|
7271
7582
|
return null;
|
|
@@ -7398,14 +7709,14 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
7398
7709
|
});
|
|
7399
7710
|
|
|
7400
7711
|
// src/core/svelteServerModule.ts
|
|
7401
|
-
import { mkdir as
|
|
7402
|
-
import { basename, dirname as
|
|
7403
|
-
var
|
|
7404
|
-
const importPath =
|
|
7712
|
+
import { mkdir as mkdir3, readdir as readdir2 } from "fs/promises";
|
|
7713
|
+
import { basename, dirname as dirname6, extname as extname2, join as join8, relative as relative3, resolve as resolve7 } from "path";
|
|
7714
|
+
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
7715
|
+
const importPath = relative3(dirname6(from), target).replace(/\\/g, "/");
|
|
7405
7716
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
7406
7717
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
7407
7718
|
for (const entry of entries) {
|
|
7408
|
-
const entryPath =
|
|
7719
|
+
const entryPath = join8(dir, entry.name);
|
|
7409
7720
|
if (entry.isDirectory())
|
|
7410
7721
|
stack.push(entryPath);
|
|
7411
7722
|
if (entry.isFile() && entry.name === targetFileName) {
|
|
@@ -7419,7 +7730,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7419
7730
|
const nextStack = [];
|
|
7420
7731
|
const dirEntries = await Promise.all(dirs.map(async (dir) => ({
|
|
7421
7732
|
dir,
|
|
7422
|
-
entries: await
|
|
7733
|
+
entries: await readdir2(dir, {
|
|
7423
7734
|
encoding: "utf-8",
|
|
7424
7735
|
withFileTypes: true
|
|
7425
7736
|
})
|
|
@@ -7435,11 +7746,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7435
7746
|
if (cachedPath !== undefined) {
|
|
7436
7747
|
return cachedPath;
|
|
7437
7748
|
}
|
|
7438
|
-
if (!sourcePath.includes(`${
|
|
7749
|
+
if (!sourcePath.includes(`${join8(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
|
|
7439
7750
|
originalSourcePathCache.set(sourcePath, sourcePath);
|
|
7440
7751
|
return sourcePath;
|
|
7441
7752
|
}
|
|
7442
|
-
const resolvedSourcePath = await findSourceFileByBasename(
|
|
7753
|
+
const resolvedSourcePath = await findSourceFileByBasename(join8(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
|
|
7443
7754
|
const nextPath = resolvedSourcePath ?? sourcePath;
|
|
7444
7755
|
originalSourcePathCache.set(sourcePath, nextPath);
|
|
7445
7756
|
return nextPath;
|
|
@@ -7447,7 +7758,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7447
7758
|
if (!spec.startsWith(".")) {
|
|
7448
7759
|
return null;
|
|
7449
7760
|
}
|
|
7450
|
-
const basePath =
|
|
7761
|
+
const basePath = resolve7(dirname6(from), spec);
|
|
7451
7762
|
const candidates = [
|
|
7452
7763
|
basePath,
|
|
7453
7764
|
`${basePath}.ts`,
|
|
@@ -7455,19 +7766,19 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7455
7766
|
`${basePath}.mjs`,
|
|
7456
7767
|
`${basePath}.cjs`,
|
|
7457
7768
|
`${basePath}.json`,
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7769
|
+
join8(basePath, "index.ts"),
|
|
7770
|
+
join8(basePath, "index.js"),
|
|
7771
|
+
join8(basePath, "index.mjs"),
|
|
7772
|
+
join8(basePath, "index.cjs"),
|
|
7773
|
+
join8(basePath, "index.json")
|
|
7463
7774
|
];
|
|
7464
7775
|
const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
|
|
7465
7776
|
const foundIndex = existResults.indexOf(true);
|
|
7466
7777
|
return foundIndex >= 0 ? candidates[foundIndex] ?? null : null;
|
|
7467
|
-
},
|
|
7468
|
-
const relativeSourcePath =
|
|
7778
|
+
}, getCachedModulePath2 = (sourcePath) => {
|
|
7779
|
+
const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
7469
7780
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
7470
|
-
return
|
|
7781
|
+
return join8(serverCacheRoot2, `${normalizedSourcePath}.server.js`);
|
|
7471
7782
|
}, resolveSvelteImport = async (spec, from) => {
|
|
7472
7783
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
7473
7784
|
const resolved = resolvePackageImport(spec);
|
|
@@ -7479,7 +7790,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7479
7790
|
if (!spec.startsWith(".")) {
|
|
7480
7791
|
return null;
|
|
7481
7792
|
}
|
|
7482
|
-
const explicitPath =
|
|
7793
|
+
const explicitPath = resolve7(dirname6(from), spec);
|
|
7483
7794
|
if (extname2(explicitPath) === ".svelte") {
|
|
7484
7795
|
return explicitPath;
|
|
7485
7796
|
}
|
|
@@ -7499,7 +7810,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7499
7810
|
}
|
|
7500
7811
|
await Bun.write(path, content);
|
|
7501
7812
|
}, compileSvelteServerModule = async (sourcePath) => {
|
|
7502
|
-
const cachedModulePath =
|
|
7813
|
+
const cachedModulePath = compiledModuleCache2.get(sourcePath);
|
|
7503
7814
|
if (cachedModulePath) {
|
|
7504
7815
|
return cachedModulePath;
|
|
7505
7816
|
}
|
|
@@ -7538,7 +7849,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7538
7849
|
continue;
|
|
7539
7850
|
if (resolvedChildModules[index])
|
|
7540
7851
|
continue;
|
|
7541
|
-
rewrittenModulePaths.set(spec, ensureRelativeImportPath(
|
|
7852
|
+
rewrittenModulePaths.set(spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), resolvedModuleImport));
|
|
7542
7853
|
}
|
|
7543
7854
|
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
7544
7855
|
transpiled = transpiled.replaceAll(spec, resolvedModuleImport);
|
|
@@ -7552,15 +7863,15 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
7552
7863
|
generate: "server"
|
|
7553
7864
|
}).js.code;
|
|
7554
7865
|
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
7555
|
-
compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(
|
|
7866
|
+
compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath2(sourcePath), compiledChildPath));
|
|
7556
7867
|
}
|
|
7557
7868
|
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
7558
7869
|
compiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);
|
|
7559
7870
|
}
|
|
7560
|
-
const compiledModulePath =
|
|
7561
|
-
await
|
|
7871
|
+
const compiledModulePath = getCachedModulePath2(sourcePath);
|
|
7872
|
+
await mkdir3(dirname6(compiledModulePath), { recursive: true });
|
|
7562
7873
|
await writeIfChanged(compiledModulePath, compiledCode);
|
|
7563
|
-
|
|
7874
|
+
compiledModuleCache2.set(sourcePath, compiledModulePath);
|
|
7564
7875
|
return compiledModulePath;
|
|
7565
7876
|
};
|
|
7566
7877
|
var init_svelteServerModule = __esm(() => {
|
|
@@ -7568,8 +7879,8 @@ var init_svelteServerModule = __esm(() => {
|
|
|
7568
7879
|
init_lowerIslandSyntax();
|
|
7569
7880
|
init_lowerAwaitSlotSyntax();
|
|
7570
7881
|
init_stylePreprocessor();
|
|
7571
|
-
|
|
7572
|
-
|
|
7882
|
+
serverCacheRoot2 = join8(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
7883
|
+
compiledModuleCache2 = new Map;
|
|
7573
7884
|
originalSourcePathCache = new Map;
|
|
7574
7885
|
transpiler = new Bun.Transpiler({
|
|
7575
7886
|
loader: "ts",
|
|
@@ -7579,16 +7890,16 @@ var init_svelteServerModule = __esm(() => {
|
|
|
7579
7890
|
|
|
7580
7891
|
// src/core/vueServerModule.ts
|
|
7581
7892
|
import { existsSync as existsSync6, readFileSync as readFileSync6, realpathSync } from "fs";
|
|
7582
|
-
import { mkdir as
|
|
7583
|
-
import { dirname as
|
|
7893
|
+
import { mkdir as mkdir4 } from "fs/promises";
|
|
7894
|
+
import { dirname as dirname7, join as join9, relative as relative4, resolve as resolve8 } from "path";
|
|
7584
7895
|
var {Transpiler } = globalThis.Bun;
|
|
7585
|
-
var ISLAND_COMPONENT_ID_LENGTH = 8,
|
|
7586
|
-
const importPath =
|
|
7896
|
+
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
7897
|
+
const importPath = relative4(dirname7(from), target).replace(/\\/g, "/");
|
|
7587
7898
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
7588
|
-
},
|
|
7589
|
-
const relativeSourcePath =
|
|
7899
|
+
}, getCachedModulePath3 = (sourcePath) => {
|
|
7900
|
+
const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
7590
7901
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
7591
|
-
return
|
|
7902
|
+
return join9(serverCacheRoot3, `${normalizedSourcePath}.server.js`);
|
|
7592
7903
|
}, writeIfChanged2 = async (path, content) => {
|
|
7593
7904
|
const targetFile = Bun.file(path);
|
|
7594
7905
|
if (await targetFile.exists()) {
|
|
@@ -7615,7 +7926,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, tran
|
|
|
7615
7926
|
`) : nonVueLines.join(`
|
|
7616
7927
|
`);
|
|
7617
7928
|
}, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
|
|
7618
|
-
const cachedModulePath =
|
|
7929
|
+
const cachedModulePath = compiledModuleCache3.get(sourcePath);
|
|
7619
7930
|
if (cachedModulePath)
|
|
7620
7931
|
return cachedModulePath;
|
|
7621
7932
|
const compiler = await import("@vue/compiler-sfc");
|
|
@@ -7648,7 +7959,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, tran
|
|
|
7648
7959
|
}).code : "const ssrRender = () => {};";
|
|
7649
7960
|
const childImportPaths = extractRelativeVueImports(compiledScript.content);
|
|
7650
7961
|
const compiledChildren = await Promise.all(childImportPaths.map(async (relativeImport) => ({
|
|
7651
|
-
compiledPath: await compileVueServerModule(
|
|
7962
|
+
compiledPath: await compileVueServerModule(resolve8(dirname7(sourcePath), relativeImport)),
|
|
7652
7963
|
spec: relativeImport
|
|
7653
7964
|
})));
|
|
7654
7965
|
const strippedScript = stripExports(compiledScript.content);
|
|
@@ -7660,20 +7971,20 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, tran
|
|
|
7660
7971
|
"export default script;"
|
|
7661
7972
|
].join(`
|
|
7662
7973
|
`));
|
|
7663
|
-
const compiledModulePath =
|
|
7974
|
+
const compiledModulePath = getCachedModulePath3(sourcePath);
|
|
7664
7975
|
let rewritten = assembled;
|
|
7665
7976
|
for (const child of compiledChildren) {
|
|
7666
7977
|
rewritten = rewritten.replaceAll(child.spec, ensureRelativeImportPath2(compiledModulePath, child.compiledPath));
|
|
7667
7978
|
}
|
|
7668
|
-
await
|
|
7979
|
+
await mkdir4(dirname7(compiledModulePath), { recursive: true });
|
|
7669
7980
|
await writeIfChanged2(compiledModulePath, rewritten);
|
|
7670
|
-
|
|
7981
|
+
compiledModuleCache3.set(sourcePath, compiledModulePath);
|
|
7671
7982
|
return compiledModulePath;
|
|
7672
7983
|
};
|
|
7673
7984
|
var init_vueServerModule = __esm(() => {
|
|
7674
7985
|
init_constants();
|
|
7675
|
-
|
|
7676
|
-
|
|
7986
|
+
serverCacheRoot3 = join9(process.cwd(), ".absolutejs", "islands", "vue");
|
|
7987
|
+
compiledModuleCache3 = new Map;
|
|
7677
7988
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
7678
7989
|
});
|
|
7679
7990
|
|
|
@@ -7768,8 +8079,17 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
7768
8079
|
throw new Error("Resolved Vue island is not a valid Vue component.");
|
|
7769
8080
|
}
|
|
7770
8081
|
return resolvedComponent;
|
|
8082
|
+
}, loadAngularServerBuildComponent = async (buildReferencePath, exportName) => {
|
|
8083
|
+
const serverModulePath = await compileAngularServerModule(buildReferencePath);
|
|
8084
|
+
const loadedModule = await import(serverModulePath);
|
|
8085
|
+
if (exportName && exportName !== "default" && exportName in loadedModule) {
|
|
8086
|
+
return loadedModule[exportName];
|
|
8087
|
+
}
|
|
8088
|
+
return "default" in loadedModule ? loadedModule.default : loadedModule;
|
|
7771
8089
|
}, resolveAngularServerIslandComponent = async (component) => {
|
|
7772
|
-
const
|
|
8090
|
+
const buildReference = getIslandBuildReference(component);
|
|
8091
|
+
const buildReferencePath = buildReference?.source ? resolveBuildReferencePath(buildReference.source, import.meta.url) : null;
|
|
8092
|
+
const resolvedComponent = buildReferencePath ? await loadAngularServerBuildComponent(buildReferencePath, buildReference?.export) : await resolveServerIslandComponent(component);
|
|
7773
8093
|
if (!isAngularServerIslandComponent(resolvedComponent)) {
|
|
7774
8094
|
throw new Error("Resolved Angular island is not a valid Angular component.");
|
|
7775
8095
|
}
|
|
@@ -7825,6 +8145,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
7825
8145
|
};
|
|
7826
8146
|
var init_renderIslandMarkup = __esm(() => {
|
|
7827
8147
|
init_islandSsr();
|
|
8148
|
+
init_angularServerModule();
|
|
7828
8149
|
init_svelteServerModule();
|
|
7829
8150
|
init_vueServerModule();
|
|
7830
8151
|
init_islandMarkupAttributes();
|
|
@@ -7835,7 +8156,7 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
7835
8156
|
|
|
7836
8157
|
// src/build/islandEntries.ts
|
|
7837
8158
|
import { mkdirSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
7838
|
-
import { dirname as
|
|
8159
|
+
import { dirname as dirname8, extname as extname3, join as join10, relative as relative5, resolve as resolve9 } from "path";
|
|
7839
8160
|
import ts from "typescript";
|
|
7840
8161
|
var frameworks, isRecord4 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
|
|
7841
8162
|
if (isRecord4(mod.islandRegistry))
|
|
@@ -7844,13 +8165,13 @@ var frameworks, isRecord4 = (value) => typeof value === "object" && value !== nu
|
|
|
7844
8165
|
return mod.default;
|
|
7845
8166
|
throw new Error("Island registry module must export `islandRegistry` or a default registry object.");
|
|
7846
8167
|
}, hasSvelteImport = (source) => /from\s+['"][^'"]+\.svelte['"]/.test(source), normalizeImportPath = (wrapperPath, targetPath) => {
|
|
7847
|
-
const importPath =
|
|
8168
|
+
const importPath = relative5(dirname8(wrapperPath), targetPath).replace(/\\/g, "/");
|
|
7848
8169
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
7849
8170
|
}, isIdentifier = (value) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value), resolveIslandSourcePath = (registryPath, sourcePath) => {
|
|
7850
8171
|
if (sourcePath.startsWith("file://")) {
|
|
7851
8172
|
return new URL(sourcePath).pathname;
|
|
7852
8173
|
}
|
|
7853
|
-
return
|
|
8174
|
+
return resolve9(dirname8(registryPath), sourcePath);
|
|
7854
8175
|
}, getObjectPropertyName = (name) => {
|
|
7855
8176
|
if (ts.isIdentifier(name) || ts.isStringLiteral(name)) {
|
|
7856
8177
|
return name.text;
|
|
@@ -8068,16 +8389,16 @@ export default component;
|
|
|
8068
8389
|
buildPath,
|
|
8069
8390
|
clientPathMaps = {}
|
|
8070
8391
|
}) => {
|
|
8071
|
-
const generatedRoot =
|
|
8392
|
+
const generatedRoot = join10(buildPath, "_island_entries");
|
|
8072
8393
|
rmSync(generatedRoot, { force: true, recursive: true });
|
|
8073
8394
|
const entries = [];
|
|
8074
8395
|
for (const definition of buildInfo.definitions) {
|
|
8075
|
-
const entryPath =
|
|
8396
|
+
const entryPath = join10(generatedRoot, "islands", definition.framework, `${definition.component}.ts`);
|
|
8076
8397
|
const { buildReference } = definition;
|
|
8077
8398
|
const source = buildReference ? resolveIslandSourcePath(buildInfo.resolvedRegistryPath, buildReference.source) : null;
|
|
8078
8399
|
const compiledSourcePath = source && shouldUseCompiledClientPath(definition.framework, source) ? clientPathMaps[definition.framework]?.get(source) : undefined;
|
|
8079
8400
|
const entrySource = source && (compiledSourcePath || !shouldUseCompiledClientPath(definition.framework, source)) ? createDirectEntrySource(entryPath, compiledSourcePath ?? source, compiledSourcePath ? undefined : buildReference?.export) : createRegistryEntrySource(entryPath, buildInfo.resolvedRegistryPath, buildInfo.hasNamedExport, definition.framework, definition.component);
|
|
8080
|
-
mkdirSync(
|
|
8401
|
+
mkdirSync(dirname8(entryPath), { recursive: true });
|
|
8081
8402
|
writeFileSync2(entryPath, entrySource);
|
|
8082
8403
|
entries.push({
|
|
8083
8404
|
component: definition.component,
|
|
@@ -8090,7 +8411,7 @@ export default component;
|
|
|
8090
8411
|
generatedRoot
|
|
8091
8412
|
};
|
|
8092
8413
|
}, loadIslandRegistryBuildInfo = async (registryPath) => {
|
|
8093
|
-
const resolvedRegistryPath =
|
|
8414
|
+
const resolvedRegistryPath = resolve9(registryPath);
|
|
8094
8415
|
const registrySource = Bun.file(resolvedRegistryPath);
|
|
8095
8416
|
const registrySourceText = await registrySource.text();
|
|
8096
8417
|
const parsedInfo = parseIslandRegistryBuildInfo(registrySourceText, resolvedRegistryPath);
|
|
@@ -8357,7 +8678,7 @@ __export(exports_loadConfig, {
|
|
|
8357
8678
|
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
8358
8679
|
getWorkspaceServices: () => getWorkspaceServices
|
|
8359
8680
|
});
|
|
8360
|
-
import { resolve as
|
|
8681
|
+
import { resolve as resolve10 } from "path";
|
|
8361
8682
|
var RESERVED_TOP_LEVEL_KEYS, isObject = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
|
|
8362
8683
|
if (!isObject(config)) {
|
|
8363
8684
|
return false;
|
|
@@ -8408,7 +8729,7 @@ var RESERVED_TOP_LEVEL_KEYS, isObject = (value) => typeof value === "object" &&
|
|
|
8408
8729
|
}
|
|
8409
8730
|
return config;
|
|
8410
8731
|
}, loadRawConfig = async (configPath) => {
|
|
8411
|
-
const resolved =
|
|
8732
|
+
const resolved = resolve10(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
8412
8733
|
const mod = await import(resolved);
|
|
8413
8734
|
const config = mod.default ?? mod.config;
|
|
8414
8735
|
if (!config) {
|
|
@@ -8551,7 +8872,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
8551
8872
|
|
|
8552
8873
|
// src/islands/pageMetadata.ts
|
|
8553
8874
|
import { readFileSync as readFileSync8 } from "fs";
|
|
8554
|
-
import { dirname as
|
|
8875
|
+
import { dirname as dirname9, resolve as resolve12 } from "path";
|
|
8555
8876
|
var pagePatterns, getPageDirs = (config) => [
|
|
8556
8877
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
8557
8878
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -8571,15 +8892,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
8571
8892
|
const source = definition.buildReference?.source;
|
|
8572
8893
|
if (!source)
|
|
8573
8894
|
continue;
|
|
8574
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
8575
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
8895
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve12(dirname9(buildInfo.resolvedRegistryPath), source);
|
|
8896
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve12(resolvedSource));
|
|
8576
8897
|
}
|
|
8577
8898
|
return lookup;
|
|
8578
8899
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata2, target) => metadata2.islands.some((usage) => {
|
|
8579
8900
|
const candidate = usage.source;
|
|
8580
|
-
return candidate ?
|
|
8901
|
+
return candidate ? resolve12(candidate) === target : false;
|
|
8581
8902
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
8582
|
-
const target =
|
|
8903
|
+
const target = resolve12(sourcePath);
|
|
8583
8904
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata2) => metadataUsesSource(metadata2, target)).map((metadata2) => metadata2.pagePath);
|
|
8584
8905
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
8585
8906
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -8591,13 +8912,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
8591
8912
|
const pattern = pagePatterns[entry.framework];
|
|
8592
8913
|
if (!pattern)
|
|
8593
8914
|
return;
|
|
8594
|
-
const files = await scanEntryPoints(
|
|
8915
|
+
const files = await scanEntryPoints(resolve12(entry.dir), pattern);
|
|
8595
8916
|
for (const filePath of files) {
|
|
8596
8917
|
const source = readFileSync8(filePath, "utf-8");
|
|
8597
8918
|
const islands = extractIslandUsagesFromSource(source);
|
|
8598
|
-
pageMetadata.set(
|
|
8919
|
+
pageMetadata.set(resolve12(filePath), {
|
|
8599
8920
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
8600
|
-
pagePath:
|
|
8921
|
+
pagePath: resolve12(filePath)
|
|
8601
8922
|
});
|
|
8602
8923
|
}
|
|
8603
8924
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -8839,12 +9160,12 @@ var init_startupBanner = __esm(() => {
|
|
|
8839
9160
|
// src/utils/logger.ts
|
|
8840
9161
|
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
8841
9162
|
const cwd = process.cwd();
|
|
8842
|
-
let
|
|
8843
|
-
|
|
8844
|
-
if (!
|
|
8845
|
-
|
|
9163
|
+
let relative6 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
9164
|
+
relative6 = relative6.replace(/\\/g, "/");
|
|
9165
|
+
if (!relative6.startsWith("/")) {
|
|
9166
|
+
relative6 = `/${relative6}`;
|
|
8846
9167
|
}
|
|
8847
|
-
return
|
|
9168
|
+
return relative6;
|
|
8848
9169
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
8849
9170
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
8850
9171
|
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
@@ -8947,9 +9268,9 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
8947
9268
|
}, generateManifest = (outputs, buildPath) => outputs.reduce((manifest, artifact) => {
|
|
8948
9269
|
const normalizedArtifactPath = normalizePath(artifact.path);
|
|
8949
9270
|
const normalizedBuildPath = normalizePath(buildPath);
|
|
8950
|
-
let
|
|
8951
|
-
|
|
8952
|
-
const segments =
|
|
9271
|
+
let relative6 = normalizedArtifactPath.startsWith(normalizedBuildPath) ? normalizedArtifactPath.slice(normalizedBuildPath.length) : normalizedArtifactPath;
|
|
9272
|
+
relative6 = relative6.replace(/^\/+/, "");
|
|
9273
|
+
const segments = relative6.split("/");
|
|
8953
9274
|
const fileWithHash = segments.pop();
|
|
8954
9275
|
if (!fileWithHash)
|
|
8955
9276
|
return manifest;
|
|
@@ -8963,15 +9284,15 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
8963
9284
|
if (segments.includes("server"))
|
|
8964
9285
|
return manifest;
|
|
8965
9286
|
const cssKey = getCssKey(pascalName, segments);
|
|
8966
|
-
if (manifest[cssKey] && manifest[cssKey] !== `/${
|
|
8967
|
-
logWarn(`Duplicate manifest key "${cssKey}" \u2014 "${manifest[cssKey]}" will be overwritten by "/${
|
|
8968
|
-
manifest[cssKey] = `/${
|
|
9287
|
+
if (manifest[cssKey] && manifest[cssKey] !== `/${relative6}`)
|
|
9288
|
+
logWarn(`Duplicate manifest key "${cssKey}" \u2014 "${manifest[cssKey]}" will be overwritten by "/${relative6}". Use unique page names across frameworks.`);
|
|
9289
|
+
manifest[cssKey] = `/${relative6}`;
|
|
8969
9290
|
return manifest;
|
|
8970
9291
|
}
|
|
8971
9292
|
const frameworkSegment = islandIndex > UNFOUND_INDEX ? segments[islandIndex + 1] : undefined;
|
|
8972
9293
|
if (frameworkSegment === "react" || frameworkSegment === "svelte" || frameworkSegment === "vue" || frameworkSegment === "angular") {
|
|
8973
9294
|
const manifestKey2 = getIslandManifestKey(frameworkSegment, pascalName);
|
|
8974
|
-
manifest[manifestKey2] = `/${
|
|
9295
|
+
manifest[manifestKey2] = `/${relative6}`;
|
|
8975
9296
|
return manifest;
|
|
8976
9297
|
}
|
|
8977
9298
|
const idx = segments.findIndex((seg) => seg === "indexes" || seg === "pages" || seg === "client");
|
|
@@ -8982,10 +9303,10 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
8982
9303
|
const isAngular = segments.some((seg) => seg === "angular");
|
|
8983
9304
|
const isClientComponent = segments.includes("client");
|
|
8984
9305
|
const manifestKey = getManifestKey(folder, pascalName, isClientComponent, isReact, isVue, isSvelte, isAngular);
|
|
8985
|
-
if (manifest[manifestKey] && manifest[manifestKey] !== `/${
|
|
8986
|
-
logWarn(`Duplicate manifest key "${manifestKey}" \u2014 "${manifest[manifestKey]}" will be overwritten by "/${
|
|
9306
|
+
if (manifest[manifestKey] && manifest[manifestKey] !== `/${relative6}`) {
|
|
9307
|
+
logWarn(`Duplicate manifest key "${manifestKey}" \u2014 "${manifest[manifestKey]}" will be overwritten by "/${relative6}". Use unique page names across frameworks.`);
|
|
8987
9308
|
}
|
|
8988
|
-
manifest[manifestKey] = `/${
|
|
9309
|
+
manifest[manifestKey] = `/${relative6}`;
|
|
8989
9310
|
return manifest;
|
|
8990
9311
|
}, {});
|
|
8991
9312
|
var init_generateManifest = __esm(() => {
|
|
@@ -8994,7 +9315,7 @@ var init_generateManifest = __esm(() => {
|
|
|
8994
9315
|
});
|
|
8995
9316
|
|
|
8996
9317
|
// src/build/verifyAngularCoreUniqueness.ts
|
|
8997
|
-
import { resolve as
|
|
9318
|
+
import { resolve as resolve13 } from "path";
|
|
8998
9319
|
var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specifier, artifactPath, serverOutDir) => {
|
|
8999
9320
|
if (!ANGULAR_CORE_PACKAGE_RE.test(specifier))
|
|
9000
9321
|
return null;
|
|
@@ -9004,9 +9325,9 @@ var ANGULAR_CORE_IMPORT_RE, ANGULAR_CORE_PACKAGE_RE, classifySpecifier = (specif
|
|
|
9004
9325
|
if (specifier.startsWith("/")) {
|
|
9005
9326
|
absolute = specifier;
|
|
9006
9327
|
} else if (specifier.startsWith(".")) {
|
|
9007
|
-
absolute =
|
|
9328
|
+
absolute = resolve13(artifactPath, "..", specifier);
|
|
9008
9329
|
} else {
|
|
9009
|
-
absolute = serverOutDir ?
|
|
9330
|
+
absolute = serverOutDir ? resolve13(serverOutDir, specifier) : resolve13(artifactPath, "..", specifier);
|
|
9010
9331
|
}
|
|
9011
9332
|
return {
|
|
9012
9333
|
kind: "resolved",
|
|
@@ -9070,19 +9391,19 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
9070
9391
|
|
|
9071
9392
|
// src/build/generateReactIndexes.ts
|
|
9072
9393
|
import { existsSync as existsSync8, mkdirSync as mkdirSync2 } from "fs";
|
|
9073
|
-
import { readdir as
|
|
9074
|
-
import { basename as basename3, join as
|
|
9394
|
+
import { readdir as readdir3, rm, writeFile } from "fs/promises";
|
|
9395
|
+
import { basename as basename3, join as join11, relative as relative6, resolve as resolve14, sep } from "path";
|
|
9075
9396
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
9076
9397
|
var indexContentCache, resolveDevClientDir = () => {
|
|
9077
9398
|
const projectRoot = process.cwd();
|
|
9078
|
-
const fromSource =
|
|
9399
|
+
const fromSource = resolve14(import.meta.dir, "../dev/client");
|
|
9079
9400
|
if (existsSync8(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9080
9401
|
return fromSource;
|
|
9081
9402
|
}
|
|
9082
|
-
const fromNodeModules =
|
|
9403
|
+
const fromNodeModules = resolve14(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
9083
9404
|
if (existsSync8(fromNodeModules))
|
|
9084
9405
|
return fromNodeModules;
|
|
9085
|
-
return
|
|
9406
|
+
return resolve14(import.meta.dir, "./dev/client");
|
|
9086
9407
|
}, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, reactRefreshRuntimePath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev2 = false) => {
|
|
9087
9408
|
if (!existsSync8(reactIndexesDirectory)) {
|
|
9088
9409
|
mkdirSync2(reactIndexesDirectory, { recursive: true });
|
|
@@ -9097,20 +9418,20 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
9097
9418
|
}
|
|
9098
9419
|
const currentPageNames = new Set(files.map((file2) => basename3(file2).split(".")[0]));
|
|
9099
9420
|
const emptyStringArray = [];
|
|
9100
|
-
const existingIndexes = await
|
|
9421
|
+
const existingIndexes = await readdir3(reactIndexesDirectory).catch(() => emptyStringArray);
|
|
9101
9422
|
const staleIndexes = existingIndexes.filter((indexFile) => {
|
|
9102
9423
|
const indexName = indexFile.replace(/\.tsx$/, "");
|
|
9103
9424
|
return indexName !== "_refresh" && !currentPageNames.has(indexName);
|
|
9104
9425
|
});
|
|
9105
9426
|
if (staleIndexes.length > 0) {
|
|
9106
9427
|
await Promise.all(staleIndexes.map((indexFile) => {
|
|
9107
|
-
indexContentCache.delete(
|
|
9108
|
-
return rm(
|
|
9428
|
+
indexContentCache.delete(join11(reactIndexesDirectory, indexFile));
|
|
9429
|
+
return rm(join11(reactIndexesDirectory, indexFile), {
|
|
9109
9430
|
force: true
|
|
9110
9431
|
});
|
|
9111
9432
|
}));
|
|
9112
9433
|
}
|
|
9113
|
-
const pagesRelPath =
|
|
9434
|
+
const pagesRelPath = relative6(resolve14(reactIndexesDirectory), resolve14(reactPagesDirectory)).split(sep).join("/");
|
|
9114
9435
|
const promises = files.map(async (file2) => {
|
|
9115
9436
|
const fileName = basename3(file2);
|
|
9116
9437
|
const componentName = fileName.split(".")[0];
|
|
@@ -9384,11 +9705,11 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
9384
9705
|
`
|
|
9385
9706
|
// Pre-warm: import the page module from the module server`,
|
|
9386
9707
|
`// immediately so the browser caches all /@src/ URLs.`,
|
|
9387
|
-
`import('/@src/${
|
|
9708
|
+
`import('/@src/${relative6(process.cwd(), resolve14(reactPagesDirectory, `${componentName}.tsx`)).replace(/\\/g, "/")}').catch(() => {});`
|
|
9388
9709
|
] : []
|
|
9389
9710
|
].join(`
|
|
9390
9711
|
`);
|
|
9391
|
-
const indexPath =
|
|
9712
|
+
const indexPath = join11(reactIndexesDirectory, `${componentName}.tsx`);
|
|
9392
9713
|
const hasher = new Bun.CryptoHasher("md5");
|
|
9393
9714
|
hasher.update(content);
|
|
9394
9715
|
const contentHash = hasher.digest("hex");
|
|
@@ -9402,7 +9723,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
9402
9723
|
if (!isDev2) {
|
|
9403
9724
|
return;
|
|
9404
9725
|
}
|
|
9405
|
-
const refreshPath =
|
|
9726
|
+
const refreshPath = join11(reactIndexesDirectory, "_refresh.tsx");
|
|
9406
9727
|
if (!existsSync8(refreshPath)) {
|
|
9407
9728
|
await writeFile(refreshPath, `import '${refreshSetupPath}';
|
|
9408
9729
|
import 'react';
|
|
@@ -9413,10 +9734,10 @@ import 'react-dom/client';
|
|
|
9413
9734
|
var init_generateReactIndexes = __esm(() => {
|
|
9414
9735
|
indexContentCache = new Map;
|
|
9415
9736
|
devClientDir = resolveDevClientDir();
|
|
9416
|
-
errorOverlayPath =
|
|
9417
|
-
hmrClientPath =
|
|
9418
|
-
refreshSetupPath =
|
|
9419
|
-
reactRefreshRuntimePath =
|
|
9737
|
+
errorOverlayPath = join11(devClientDir, "errorOverlay.ts").replace(/\\/g, "/");
|
|
9738
|
+
hmrClientPath = join11(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
9739
|
+
refreshSetupPath = join11(devClientDir, "reactRefreshSetup.ts").replace(/\\/g, "/");
|
|
9740
|
+
reactRefreshRuntimePath = join11(devClientDir, "vendor", "reactRefreshRuntime.js").replace(/\\/g, "/");
|
|
9420
9741
|
});
|
|
9421
9742
|
|
|
9422
9743
|
// src/build/wrapHTMLScript.ts
|
|
@@ -9533,7 +9854,7 @@ var init_scanConventions = __esm(() => {
|
|
|
9533
9854
|
|
|
9534
9855
|
// src/build/scanRouteRegistrations.ts
|
|
9535
9856
|
import { readdirSync, readFileSync as readFileSync9 } from "fs";
|
|
9536
|
-
import { join as
|
|
9857
|
+
import { join as join12 } from "path";
|
|
9537
9858
|
import ts2 from "typescript";
|
|
9538
9859
|
var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePath) => {
|
|
9539
9860
|
if (filePath.endsWith(".tsx"))
|
|
@@ -9570,9 +9891,9 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
9570
9891
|
continue;
|
|
9571
9892
|
if (entry.name.startsWith("."))
|
|
9572
9893
|
continue;
|
|
9573
|
-
stack.push(
|
|
9894
|
+
stack.push(join12(dir, entry.name));
|
|
9574
9895
|
} else if (entry.isFile() && hasSourceExtension(entry.name)) {
|
|
9575
|
-
out.push(
|
|
9896
|
+
out.push(join12(dir, entry.name));
|
|
9576
9897
|
}
|
|
9577
9898
|
}
|
|
9578
9899
|
}
|
|
@@ -9656,7 +9977,7 @@ var init_scanRouteRegistrations = __esm(() => {
|
|
|
9656
9977
|
|
|
9657
9978
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
9658
9979
|
import { existsSync as existsSync10, promises as fs } from "fs";
|
|
9659
|
-
import { join as
|
|
9980
|
+
import { join as join13 } from "path";
|
|
9660
9981
|
import ts3 from "typescript";
|
|
9661
9982
|
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sf, localName, moduleSpecifier) => {
|
|
9662
9983
|
for (const statement of sf.statements) {
|
|
@@ -9854,7 +10175,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
9854
10175
|
continue;
|
|
9855
10176
|
if (item.name.startsWith("."))
|
|
9856
10177
|
continue;
|
|
9857
|
-
const full =
|
|
10178
|
+
const full = join13(dir, item.name);
|
|
9858
10179
|
if (item.isDirectory()) {
|
|
9859
10180
|
await walkTsFiles(full, out);
|
|
9860
10181
|
} else if (item.isFile() && item.name.endsWith(".ts") && !item.name.endsWith(".d.ts")) {
|
|
@@ -9884,7 +10205,7 @@ var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
|
9884
10205
|
|
|
9885
10206
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
9886
10207
|
import { existsSync as existsSync11, promises as fs2 } from "fs";
|
|
9887
|
-
import { join as
|
|
10208
|
+
import { join as join14 } from "path";
|
|
9888
10209
|
import ts4 from "typescript";
|
|
9889
10210
|
var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN2.test(seg) || seg === "**"), readStringLiteral2 = (expression) => {
|
|
9890
10211
|
if (ts4.isStringLiteral(expression) || ts4.isNoSubstitutionTemplateLiteral(expression)) {
|
|
@@ -10064,7 +10385,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
10064
10385
|
for (const item of items) {
|
|
10065
10386
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
10066
10387
|
continue;
|
|
10067
|
-
const full =
|
|
10388
|
+
const full = join14(dir, item.name);
|
|
10068
10389
|
if (item.isDirectory()) {
|
|
10069
10390
|
await walkSourceFiles(full, out);
|
|
10070
10391
|
} else if (item.isFile() && (item.name.endsWith(".tsx") || item.name.endsWith(".ts") || item.name.endsWith(".jsx") || item.name.endsWith(".js")) && !item.name.endsWith(".d.ts")) {
|
|
@@ -10094,7 +10415,7 @@ var init_staticAnalyzeSpaRoutes2 = __esm(() => {
|
|
|
10094
10415
|
|
|
10095
10416
|
// src/svelte/staticAnalyzeSpaRoutes.ts
|
|
10096
10417
|
import { existsSync as existsSync12, promises as fs3 } from "fs";
|
|
10097
|
-
import { join as
|
|
10418
|
+
import { join as join15 } from "path";
|
|
10098
10419
|
var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN3.test(seg) || seg === "**"), joinSegments3 = (parent, child) => {
|
|
10099
10420
|
if (!child)
|
|
10100
10421
|
return parent;
|
|
@@ -10166,7 +10487,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
10166
10487
|
for (const item of items) {
|
|
10167
10488
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
10168
10489
|
continue;
|
|
10169
|
-
const full =
|
|
10490
|
+
const full = join15(dir, item.name);
|
|
10170
10491
|
if (item.isDirectory()) {
|
|
10171
10492
|
await walkSvelteFiles(full, out);
|
|
10172
10493
|
} else if (item.isFile() && item.name.endsWith(".svelte")) {
|
|
@@ -10198,7 +10519,7 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
|
|
|
10198
10519
|
|
|
10199
10520
|
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
10200
10521
|
import { existsSync as existsSync13, promises as fs4 } from "fs";
|
|
10201
|
-
import { join as
|
|
10522
|
+
import { join as join16 } from "path";
|
|
10202
10523
|
import ts5 from "typescript";
|
|
10203
10524
|
var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN4.test(seg) || seg === "**"), readStringLiteral3 = (expression) => {
|
|
10204
10525
|
if (ts5.isStringLiteral(expression) || ts5.isNoSubstitutionTemplateLiteral(expression)) {
|
|
@@ -10404,7 +10725,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
10404
10725
|
for (const item of items) {
|
|
10405
10726
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
10406
10727
|
continue;
|
|
10407
|
-
const full =
|
|
10728
|
+
const full = join16(dir, item.name);
|
|
10408
10729
|
if (item.isDirectory()) {
|
|
10409
10730
|
await walkSourceFiles2(full, out);
|
|
10410
10731
|
} else if (item.isFile() && (item.name.endsWith(".ts") || item.name.endsWith(".js") || item.name.endsWith(".vue")) && !item.name.endsWith(".d.ts")) {
|
|
@@ -10686,7 +11007,7 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
10686
11007
|
|
|
10687
11008
|
// src/utils/imageProcessing.ts
|
|
10688
11009
|
import { existsSync as existsSync15, mkdirSync as mkdirSync3, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs";
|
|
10689
|
-
import { join as
|
|
11010
|
+
import { join as join17, resolve as resolve15 } from "path";
|
|
10690
11011
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
10691
11012
|
for (const size of sizes) {
|
|
10692
11013
|
if (size >= target)
|
|
@@ -10736,7 +11057,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
10736
11057
|
const image2 = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
10737
11058
|
return [...device, ...image2].sort((left, right) => left - right);
|
|
10738
11059
|
}, getCacheDir = (buildDir) => {
|
|
10739
|
-
const dir =
|
|
11060
|
+
const dir = join17(buildDir, ".cache", "images");
|
|
10740
11061
|
if (!existsSync15(dir))
|
|
10741
11062
|
mkdirSync3(dir, { recursive: true });
|
|
10742
11063
|
return dir;
|
|
@@ -10817,8 +11138,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
10817
11138
|
throw err;
|
|
10818
11139
|
}
|
|
10819
11140
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
10820
|
-
const metaPath =
|
|
10821
|
-
const dataPath =
|
|
11141
|
+
const metaPath = join17(cacheDir, `${cacheKey}.meta`);
|
|
11142
|
+
const dataPath = join17(cacheDir, `${cacheKey}.data`);
|
|
10822
11143
|
if (!existsSync15(metaPath) || !existsSync15(dataPath))
|
|
10823
11144
|
return null;
|
|
10824
11145
|
try {
|
|
@@ -10833,7 +11154,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
10833
11154
|
return sharpModule;
|
|
10834
11155
|
sharpLoaded = true;
|
|
10835
11156
|
try {
|
|
10836
|
-
const sharpPath =
|
|
11157
|
+
const sharpPath = resolve15(process.cwd(), "node_modules/sharp");
|
|
10837
11158
|
const mod = await import(sharpPath);
|
|
10838
11159
|
sharpModule = mod.default ?? mod;
|
|
10839
11160
|
return sharpModule;
|
|
@@ -10845,8 +11166,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
10845
11166
|
return null;
|
|
10846
11167
|
}
|
|
10847
11168
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
10848
|
-
const metaPath =
|
|
10849
|
-
const dataPath =
|
|
11169
|
+
const metaPath = join17(cacheDir, `${cacheKey}.meta`);
|
|
11170
|
+
const dataPath = join17(cacheDir, `${cacheKey}.data`);
|
|
10850
11171
|
writeFileSync4(dataPath, buffer);
|
|
10851
11172
|
writeFileSync4(metaPath, JSON.stringify(meta));
|
|
10852
11173
|
};
|
|
@@ -10934,7 +11255,7 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
10934
11255
|
// src/cli/scripts/telemetry.ts
|
|
10935
11256
|
import { existsSync as existsSync16, mkdirSync as mkdirSync4, readFileSync as readFileSync11, writeFileSync as writeFileSync5 } from "fs";
|
|
10936
11257
|
import { homedir } from "os";
|
|
10937
|
-
import { join as
|
|
11258
|
+
import { join as join18 } from "path";
|
|
10938
11259
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
10939
11260
|
try {
|
|
10940
11261
|
if (!existsSync16(configPath))
|
|
@@ -10947,14 +11268,14 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
10947
11268
|
}
|
|
10948
11269
|
};
|
|
10949
11270
|
var init_telemetry = __esm(() => {
|
|
10950
|
-
configDir =
|
|
10951
|
-
configPath =
|
|
11271
|
+
configDir = join18(homedir(), ".absolutejs");
|
|
11272
|
+
configPath = join18(configDir, "telemetry.json");
|
|
10952
11273
|
});
|
|
10953
11274
|
|
|
10954
11275
|
// src/cli/telemetryEvent.ts
|
|
10955
11276
|
import { existsSync as existsSync17, readFileSync as readFileSync12 } from "fs";
|
|
10956
|
-
import { arch, platform } from "os";
|
|
10957
|
-
import { dirname as
|
|
11277
|
+
import { arch as arch2, platform as platform2 } from "os";
|
|
11278
|
+
import { dirname as dirname10, join as join19, parse } from "path";
|
|
10958
11279
|
var checkCandidate = (candidate) => {
|
|
10959
11280
|
if (!existsSync17(candidate)) {
|
|
10960
11281
|
return null;
|
|
@@ -10974,12 +11295,12 @@ var checkCandidate = (candidate) => {
|
|
|
10974
11295
|
}, findPackageVersion = () => {
|
|
10975
11296
|
let { dir } = import.meta;
|
|
10976
11297
|
while (dir !== parse(dir).root) {
|
|
10977
|
-
const candidate =
|
|
11298
|
+
const candidate = join19(dir, "package.json");
|
|
10978
11299
|
const version = checkCandidate(candidate);
|
|
10979
11300
|
if (version) {
|
|
10980
11301
|
return version;
|
|
10981
11302
|
}
|
|
10982
|
-
dir =
|
|
11303
|
+
dir = dirname10(dir);
|
|
10983
11304
|
}
|
|
10984
11305
|
return "unknown";
|
|
10985
11306
|
}, sendTelemetryEvent = (event, payload) => {
|
|
@@ -10991,10 +11312,10 @@ var checkCandidate = (candidate) => {
|
|
|
10991
11312
|
return;
|
|
10992
11313
|
const body = {
|
|
10993
11314
|
anonymousId: config.anonymousId,
|
|
10994
|
-
arch:
|
|
11315
|
+
arch: arch2(),
|
|
10995
11316
|
bunVersion: Bun.version,
|
|
10996
11317
|
event,
|
|
10997
|
-
os:
|
|
11318
|
+
os: platform2(),
|
|
10998
11319
|
payload,
|
|
10999
11320
|
timestamp: new Date().toISOString(),
|
|
11000
11321
|
version: getVersion()
|
|
@@ -11072,18 +11393,18 @@ __export(exports_buildHMRClient, {
|
|
|
11072
11393
|
buildHMRClient: () => buildHMRClient
|
|
11073
11394
|
});
|
|
11074
11395
|
import { existsSync as existsSync18 } from "fs";
|
|
11075
|
-
import { resolve as
|
|
11396
|
+
import { resolve as resolve16 } from "path";
|
|
11076
11397
|
var {build: bunBuild } = globalThis.Bun;
|
|
11077
11398
|
var resolveHmrClientPath = () => {
|
|
11078
11399
|
const projectRoot = process.cwd();
|
|
11079
|
-
const fromSource =
|
|
11400
|
+
const fromSource = resolve16(import.meta.dir, "client/hmrClient.ts");
|
|
11080
11401
|
if (existsSync18(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
11081
11402
|
return fromSource;
|
|
11082
11403
|
}
|
|
11083
|
-
const fromNodeModules =
|
|
11404
|
+
const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
11084
11405
|
if (existsSync18(fromNodeModules))
|
|
11085
11406
|
return fromNodeModules;
|
|
11086
|
-
return
|
|
11407
|
+
return resolve16(import.meta.dir, "dev/client/hmrClient.ts");
|
|
11087
11408
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
11088
11409
|
const entryPoint = hmrClientPath2;
|
|
11089
11410
|
const result = await bunBuild({
|
|
@@ -11100,79 +11421,18 @@ var resolveHmrClientPath = () => {
|
|
|
11100
11421
|
});
|
|
11101
11422
|
return "// HMR client build failed";
|
|
11102
11423
|
}
|
|
11103
|
-
const [firstOutput] = result.outputs;
|
|
11104
|
-
if (!firstOutput)
|
|
11105
|
-
return "// HMR client build failed";
|
|
11106
|
-
return firstOutput.text();
|
|
11107
|
-
};
|
|
11108
|
-
var init_buildHMRClient = __esm(() => {
|
|
11109
|
-
init_telemetryEvent();
|
|
11110
|
-
hmrClientPath2 = resolveHmrClientPath();
|
|
11111
|
-
});
|
|
11112
|
-
|
|
11113
|
-
// src/build/nativeRewrite.ts
|
|
11114
|
-
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
11115
|
-
import { platform as platform2, arch as arch2 } from "os";
|
|
11116
|
-
import { resolve as resolve16 } from "path";
|
|
11117
|
-
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
11118
|
-
if (nativeLib !== null)
|
|
11119
|
-
return nativeLib;
|
|
11120
|
-
const osPlatform = platform2();
|
|
11121
|
-
const cpu = arch2();
|
|
11122
|
-
const platformMap = {
|
|
11123
|
-
"darwin-arm64": "darwin-arm64/fast_ops.dylib",
|
|
11124
|
-
"darwin-x64": "darwin-x64/fast_ops.dylib",
|
|
11125
|
-
"linux-arm64": "linux-arm64/fast_ops.so",
|
|
11126
|
-
"linux-x64": "linux-x64/fast_ops.so",
|
|
11127
|
-
"win32-arm64": "windows-arm64/fast_ops.dll",
|
|
11128
|
-
"win32-x64": "windows-x64/fast_ops.dll"
|
|
11129
|
-
};
|
|
11130
|
-
const libPath = platformMap[`${osPlatform}-${cpu}`];
|
|
11131
|
-
if (!libPath)
|
|
11132
|
-
return null;
|
|
11133
|
-
try {
|
|
11134
|
-
const fullPath = resolve16(import.meta.dir, "../../native/packages", libPath);
|
|
11135
|
-
const lib = dlopen(fullPath, ffiDefinition);
|
|
11136
|
-
nativeLib = lib.symbols;
|
|
11137
|
-
return nativeLib;
|
|
11138
|
-
} catch {
|
|
11139
|
-
return null;
|
|
11140
|
-
}
|
|
11141
|
-
}, nativeRewriteImports = (content, replacements) => {
|
|
11142
|
-
const lib = loadNative();
|
|
11143
|
-
if (!lib)
|
|
11144
|
-
return null;
|
|
11145
|
-
const jsonStr = JSON.stringify(replacements);
|
|
11146
|
-
const contentBuf = Buffer.from(content);
|
|
11147
|
-
const jsonBuf = Buffer.from(jsonStr);
|
|
11148
|
-
const outBuf = Buffer.alloc(content.length * 2);
|
|
11149
|
-
const outLenBuf = new BigUint64Array([BigInt(outBuf.length)]);
|
|
11150
|
-
const result = lib.rewrite_imports(ptr(contentBuf), contentBuf.length, ptr(jsonBuf), jsonBuf.length, ptr(outBuf), ptr(new Uint8Array(outLenBuf.buffer)));
|
|
11151
|
-
if (result < 0)
|
|
11152
|
-
return null;
|
|
11153
|
-
if (result === 0)
|
|
11154
|
-
return content;
|
|
11155
|
-
const outLen = Number(outLenBuf[0]);
|
|
11156
|
-
return outBuf.subarray(0, outLen).toString("utf-8");
|
|
11424
|
+
const [firstOutput] = result.outputs;
|
|
11425
|
+
if (!firstOutput)
|
|
11426
|
+
return "// HMR client build failed";
|
|
11427
|
+
return firstOutput.text();
|
|
11157
11428
|
};
|
|
11158
|
-
var
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
args: [
|
|
11162
|
-
FFIType.ptr,
|
|
11163
|
-
FFIType.u64,
|
|
11164
|
-
FFIType.ptr,
|
|
11165
|
-
FFIType.u64,
|
|
11166
|
-
FFIType.ptr,
|
|
11167
|
-
FFIType.ptr
|
|
11168
|
-
],
|
|
11169
|
-
returns: FFIType.i32
|
|
11170
|
-
}
|
|
11171
|
-
};
|
|
11429
|
+
var init_buildHMRClient = __esm(() => {
|
|
11430
|
+
init_telemetryEvent();
|
|
11431
|
+
hmrClientPath2 = resolveHmrClientPath();
|
|
11172
11432
|
});
|
|
11173
11433
|
|
|
11174
11434
|
// src/build/rewriteReactImports.ts
|
|
11175
|
-
var
|
|
11435
|
+
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), rewriterCache, cacheKey = (vendorPaths) => {
|
|
11176
11436
|
const entries = Object.entries(vendorPaths).sort(([left], [right]) => left.localeCompare(right));
|
|
11177
11437
|
let key = "";
|
|
11178
11438
|
for (const [k2, v2] of entries) {
|
|
@@ -11186,7 +11446,7 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), rewriterC
|
|
|
11186
11446
|
return cached;
|
|
11187
11447
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
11188
11448
|
const lookup = new Map(replacements);
|
|
11189
|
-
const alt = replacements.map(([spec]) =>
|
|
11449
|
+
const alt = replacements.map(([spec]) => escapeRegex2(spec)).join("|");
|
|
11190
11450
|
const fromRegex = new RegExp(`(from\\s*["'])(${alt})(["'])`, "g");
|
|
11191
11451
|
const sideEffectRegex = new RegExp(`(import\\s*["'])(${alt})(["']\\s*;?)`, "g");
|
|
11192
11452
|
const dynamicRegex = new RegExp(`(import\\s*\\(\\s*["'])(${alt})(["']\\s*\\))`, "g");
|
|
@@ -11277,7 +11537,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
11277
11537
|
|
|
11278
11538
|
// src/build/angularLinkerPlugin.ts
|
|
11279
11539
|
import { existsSync as existsSync19, mkdirSync as mkdirSync5, readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "fs";
|
|
11280
|
-
import { dirname as
|
|
11540
|
+
import { dirname as dirname11, join as join20, relative as relative7, resolve as resolve17 } from "path";
|
|
11281
11541
|
import { createHash as createHash3 } from "crypto";
|
|
11282
11542
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
11283
11543
|
name: "angular-linker",
|
|
@@ -11285,7 +11545,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
11285
11545
|
let needsLinking;
|
|
11286
11546
|
let babelTransform;
|
|
11287
11547
|
let linkerPlugin;
|
|
11288
|
-
const cacheDir =
|
|
11548
|
+
const cacheDir = join20(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
11289
11549
|
bld.onLoad({ filter: ANGULAR_LINKER_CANDIDATE_RE }, async (args) => {
|
|
11290
11550
|
const source = await Bun.file(args.path).text();
|
|
11291
11551
|
if (!needsLinking) {
|
|
@@ -11298,7 +11558,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
11298
11558
|
return;
|
|
11299
11559
|
}
|
|
11300
11560
|
const hash = createHash3("md5").update(source).digest("hex");
|
|
11301
|
-
const cachePath =
|
|
11561
|
+
const cachePath = join20(cacheDir, `${hash}.js`);
|
|
11302
11562
|
if (existsSync19(cachePath)) {
|
|
11303
11563
|
return {
|
|
11304
11564
|
contents: readFileSync13(cachePath, "utf-8"),
|
|
@@ -11315,10 +11575,10 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
11315
11575
|
const mod = await import(linkerSpecifier);
|
|
11316
11576
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
11317
11577
|
fileSystem: {
|
|
11318
|
-
dirname:
|
|
11578
|
+
dirname: dirname11,
|
|
11319
11579
|
exists: existsSync19,
|
|
11320
11580
|
readFile: readFileSync13,
|
|
11321
|
-
relative:
|
|
11581
|
+
relative: relative7,
|
|
11322
11582
|
resolve: resolve17
|
|
11323
11583
|
},
|
|
11324
11584
|
linkerJitMode,
|
|
@@ -11357,7 +11617,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
11357
11617
|
|
|
11358
11618
|
// src/build/externalAssetPlugin.ts
|
|
11359
11619
|
import { copyFileSync, existsSync as existsSync20, mkdirSync as mkdirSync6, statSync } from "fs";
|
|
11360
|
-
import { basename as basename5, dirname as
|
|
11620
|
+
import { basename as basename5, dirname as dirname12, join as join21, resolve as resolve18 } from "path";
|
|
11361
11621
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
11362
11622
|
name: "absolute-external-asset",
|
|
11363
11623
|
setup(bld) {
|
|
@@ -11372,7 +11632,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
11372
11632
|
return;
|
|
11373
11633
|
urlPattern.lastIndex = 0;
|
|
11374
11634
|
let match;
|
|
11375
|
-
const sourceDir =
|
|
11635
|
+
const sourceDir = dirname12(args.path);
|
|
11376
11636
|
while ((match = urlPattern.exec(source)) !== null) {
|
|
11377
11637
|
const relPath = match[1];
|
|
11378
11638
|
if (!relPath)
|
|
@@ -11382,10 +11642,10 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
11382
11642
|
continue;
|
|
11383
11643
|
if (!statSync(assetPath).isFile())
|
|
11384
11644
|
continue;
|
|
11385
|
-
const targetPath =
|
|
11645
|
+
const targetPath = join21(outDir, basename5(assetPath));
|
|
11386
11646
|
if (existsSync20(targetPath))
|
|
11387
11647
|
continue;
|
|
11388
|
-
mkdirSync6(
|
|
11648
|
+
mkdirSync6(dirname12(targetPath), { recursive: true });
|
|
11389
11649
|
copyFileSync(assetPath, targetPath);
|
|
11390
11650
|
}
|
|
11391
11651
|
return;
|
|
@@ -11593,7 +11853,7 @@ __export(exports_hmrInjectionPlugin, {
|
|
|
11593
11853
|
applyAngularHmrInjection: () => applyAngularHmrInjection
|
|
11594
11854
|
});
|
|
11595
11855
|
import { readFile as readFile5 } from "fs/promises";
|
|
11596
|
-
import { relative as
|
|
11856
|
+
import { relative as relative8, resolve as resolve19 } from "path";
|
|
11597
11857
|
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
11598
11858
|
const names = new Set;
|
|
11599
11859
|
IMPORT_RE.lastIndex = 0;
|
|
@@ -11773,9 +12033,9 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames =
|
|
|
11773
12033
|
}
|
|
11774
12034
|
if (classNames.length === 0)
|
|
11775
12035
|
return;
|
|
11776
|
-
const relFromGenRoot =
|
|
12036
|
+
const relFromGenRoot = relative8(generatedAngularRoot, componentJsAbsPath).replace(/\\/g, "/");
|
|
11777
12037
|
const userTsPath = resolve19(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
11778
|
-
const projectRel =
|
|
12038
|
+
const projectRel = relative8(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
11779
12039
|
const tail = classNames.map((className) => {
|
|
11780
12040
|
const id = `${projectRel}@${className}`;
|
|
11781
12041
|
return buildHmrTail(className, JSON.stringify(id));
|
|
@@ -11815,11 +12075,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
11815
12075
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve20(path)));
|
|
11816
12076
|
const glob = new Glob5("**/*");
|
|
11817
12077
|
const removals = [];
|
|
11818
|
-
for (const
|
|
11819
|
-
const absolute = resolve20(buildPath,
|
|
12078
|
+
for (const relative9 of glob.scanSync({ cwd: buildPath })) {
|
|
12079
|
+
const absolute = resolve20(buildPath, relative9);
|
|
11820
12080
|
if (currentPaths.has(absolute))
|
|
11821
12081
|
continue;
|
|
11822
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
12082
|
+
if (!HASHED_FILE_PATTERN.test(relative9))
|
|
11823
12083
|
continue;
|
|
11824
12084
|
removals.push(rm2(absolute, { force: true }));
|
|
11825
12085
|
}
|
|
@@ -11835,20 +12095,20 @@ __export(exports_generatedDir, {
|
|
|
11835
12095
|
getGeneratedRoot: () => getGeneratedRoot,
|
|
11836
12096
|
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
|
|
11837
12097
|
});
|
|
11838
|
-
import { join as
|
|
11839
|
-
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) =>
|
|
12098
|
+
import { join as join22 } from "path";
|
|
12099
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) => join22(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME), getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join22(getGeneratedRoot(projectRoot), framework);
|
|
11840
12100
|
var init_generatedDir = () => {};
|
|
11841
12101
|
|
|
11842
12102
|
// src/utils/cleanup.ts
|
|
11843
12103
|
import { rm as rm3 } from "fs/promises";
|
|
11844
|
-
import { join as
|
|
12104
|
+
import { join as join23 } from "path";
|
|
11845
12105
|
var removeIfExists = (path) => rm3(path, { force: true, recursive: true }), cleanFramework = (framework, frameworkDir, skipGenerated = false) => {
|
|
11846
12106
|
const tasks = [];
|
|
11847
12107
|
if (!skipGenerated) {
|
|
11848
12108
|
tasks.push(removeIfExists(getFrameworkGeneratedDir(framework)));
|
|
11849
12109
|
}
|
|
11850
12110
|
if (frameworkDir)
|
|
11851
|
-
tasks.push(removeIfExists(
|
|
12111
|
+
tasks.push(removeIfExists(join23(frameworkDir, "generated")));
|
|
11852
12112
|
return Promise.all(tasks);
|
|
11853
12113
|
}, cleanup = async ({
|
|
11854
12114
|
angularDir,
|
|
@@ -11887,7 +12147,7 @@ var init_commonAncestor = () => {};
|
|
|
11887
12147
|
|
|
11888
12148
|
// src/utils/buildDirectoryLock.ts
|
|
11889
12149
|
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync7, readFileSync as readFileSync14 } from "fs";
|
|
11890
|
-
import { dirname as
|
|
12150
|
+
import { dirname as dirname13, join as join24 } from "path";
|
|
11891
12151
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
11892
12152
|
if (exitHandlersRegistered)
|
|
11893
12153
|
return;
|
|
@@ -11913,7 +12173,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
11913
12173
|
releaseAllSync();
|
|
11914
12174
|
throw err;
|
|
11915
12175
|
});
|
|
11916
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
12176
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join24(dirname13(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
11917
12177
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
11918
12178
|
if (locks.size === 0) {
|
|
11919
12179
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -11930,7 +12190,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
11930
12190
|
locks.delete(buildDirectory);
|
|
11931
12191
|
writeHeldLockEnv(locks);
|
|
11932
12192
|
}, writeLockFileSync = (lockPath, metadata2) => {
|
|
11933
|
-
mkdirSync7(
|
|
12193
|
+
mkdirSync7(dirname13(lockPath), { recursive: true });
|
|
11934
12194
|
writeFileSync7(lockPath, JSON.stringify(metadata2, null, 2), { flag: "wx" });
|
|
11935
12195
|
}, readLockMetadata = (lockPath) => {
|
|
11936
12196
|
try {
|
|
@@ -12050,11 +12310,11 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
12050
12310
|
});
|
|
12051
12311
|
|
|
12052
12312
|
// src/utils/validateSafePath.ts
|
|
12053
|
-
import { resolve as resolve21, relative as
|
|
12313
|
+
import { resolve as resolve21, relative as relative9 } from "path";
|
|
12054
12314
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
12055
12315
|
const absoluteBase = resolve21(baseDirectory);
|
|
12056
12316
|
const absoluteTarget = resolve21(baseDirectory, targetPath);
|
|
12057
|
-
const relativePath = normalizePath(
|
|
12317
|
+
const relativePath = normalizePath(relative9(absoluteBase, absoluteTarget));
|
|
12058
12318
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
12059
12319
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
12060
12320
|
}
|
|
@@ -12068,7 +12328,7 @@ __export(exports_scanVueSsrOnlyPages, {
|
|
|
12068
12328
|
scanVueSsrOnlyPages: () => scanVueSsrOnlyPages
|
|
12069
12329
|
});
|
|
12070
12330
|
import { readdirSync as readdirSync2, readFileSync as readFileSync15 } from "fs";
|
|
12071
|
-
import { join as
|
|
12331
|
+
import { join as join25 } from "path";
|
|
12072
12332
|
import ts7 from "typescript";
|
|
12073
12333
|
var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
12074
12334
|
if (filePath.endsWith(".tsx"))
|
|
@@ -12101,9 +12361,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS2, getScriptKind2 = (filePath) => {
|
|
|
12101
12361
|
continue;
|
|
12102
12362
|
if (entry.name.startsWith("."))
|
|
12103
12363
|
continue;
|
|
12104
|
-
stack.push(
|
|
12364
|
+
stack.push(join25(dir, entry.name));
|
|
12105
12365
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
12106
|
-
out.push(
|
|
12366
|
+
out.push(join25(dir, entry.name));
|
|
12107
12367
|
}
|
|
12108
12368
|
}
|
|
12109
12369
|
}
|
|
@@ -12215,7 +12475,7 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
12215
12475
|
|
|
12216
12476
|
// src/build/scanAngularHandlerCalls.ts
|
|
12217
12477
|
import { readdirSync as readdirSync3, readFileSync as readFileSync16 } from "fs";
|
|
12218
|
-
import { join as
|
|
12478
|
+
import { join as join26 } from "path";
|
|
12219
12479
|
import ts8 from "typescript";
|
|
12220
12480
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
12221
12481
|
if (filePath.endsWith(".tsx"))
|
|
@@ -12248,9 +12508,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS3, getScriptKind3 = (fil
|
|
|
12248
12508
|
continue;
|
|
12249
12509
|
if (entry.name.startsWith("."))
|
|
12250
12510
|
continue;
|
|
12251
|
-
stack.push(
|
|
12511
|
+
stack.push(join26(dir, entry.name));
|
|
12252
12512
|
} else if (entry.isFile() && hasSourceExtension3(entry.name)) {
|
|
12253
|
-
out.push(
|
|
12513
|
+
out.push(join26(dir, entry.name));
|
|
12254
12514
|
}
|
|
12255
12515
|
}
|
|
12256
12516
|
}
|
|
@@ -12365,7 +12625,7 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
12365
12625
|
|
|
12366
12626
|
// src/build/scanAngularPageRoutes.ts
|
|
12367
12627
|
import { readdirSync as readdirSync4, readFileSync as readFileSync17 } from "fs";
|
|
12368
|
-
import { basename as basename7, join as
|
|
12628
|
+
import { basename as basename7, join as join27 } from "path";
|
|
12369
12629
|
import ts9 from "typescript";
|
|
12370
12630
|
var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
12371
12631
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -12405,9 +12665,9 @@ var SOURCE_EXTENSIONS4, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
12405
12665
|
continue;
|
|
12406
12666
|
if (entry.name.startsWith("."))
|
|
12407
12667
|
continue;
|
|
12408
|
-
stack.push(
|
|
12668
|
+
stack.push(join27(dir, entry.name));
|
|
12409
12669
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
12410
|
-
out.push(
|
|
12670
|
+
out.push(join27(dir, entry.name));
|
|
12411
12671
|
}
|
|
12412
12672
|
}
|
|
12413
12673
|
}
|
|
@@ -12484,7 +12744,7 @@ __export(exports_parseAngularConfigImports, {
|
|
|
12484
12744
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
12485
12745
|
});
|
|
12486
12746
|
import { existsSync as existsSync21, readFileSync as readFileSync18 } from "fs";
|
|
12487
|
-
import { dirname as
|
|
12747
|
+
import { dirname as dirname14, isAbsolute as isAbsolute3, join as join28 } from "path";
|
|
12488
12748
|
import ts10 from "typescript";
|
|
12489
12749
|
var findDefineConfigCall = (sf) => {
|
|
12490
12750
|
let result = null;
|
|
@@ -12539,15 +12799,15 @@ var findDefineConfigCall = (sf) => {
|
|
|
12539
12799
|
}, resolveConfigPath = (projectRoot) => {
|
|
12540
12800
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
12541
12801
|
if (envOverride) {
|
|
12542
|
-
const resolved = isAbsolute3(envOverride) ? envOverride :
|
|
12802
|
+
const resolved = isAbsolute3(envOverride) ? envOverride : join28(projectRoot, envOverride);
|
|
12543
12803
|
if (existsSync21(resolved))
|
|
12544
12804
|
return resolved;
|
|
12545
12805
|
}
|
|
12546
12806
|
const candidates = [
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12807
|
+
join28(projectRoot, "absolute.config.ts"),
|
|
12808
|
+
join28(projectRoot, "absolute.config.mts"),
|
|
12809
|
+
join28(projectRoot, "absolute.config.js"),
|
|
12810
|
+
join28(projectRoot, "absolute.config.mjs")
|
|
12551
12811
|
];
|
|
12552
12812
|
for (const candidate of candidates) {
|
|
12553
12813
|
if (existsSync21(candidate))
|
|
@@ -12579,8 +12839,8 @@ var findDefineConfigCall = (sf) => {
|
|
|
12579
12839
|
const importInfo = findImportForBinding(sf, binding);
|
|
12580
12840
|
if (!importInfo)
|
|
12581
12841
|
return null;
|
|
12582
|
-
const configDir2 =
|
|
12583
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
12842
|
+
const configDir2 = dirname14(configPath2);
|
|
12843
|
+
const absolutePath = importInfo.source.startsWith(".") ? join28(configDir2, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute3(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
12584
12844
|
return {
|
|
12585
12845
|
absolutePath,
|
|
12586
12846
|
bindingName: binding,
|
|
@@ -12652,14 +12912,14 @@ __export(exports_compileSvelte, {
|
|
|
12652
12912
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
12653
12913
|
});
|
|
12654
12914
|
import { existsSync as existsSync22 } from "fs";
|
|
12655
|
-
import { mkdir as
|
|
12915
|
+
import { mkdir as mkdir5, stat as stat2 } from "fs/promises";
|
|
12656
12916
|
import {
|
|
12657
|
-
dirname as
|
|
12658
|
-
join as
|
|
12917
|
+
dirname as dirname15,
|
|
12918
|
+
join as join29,
|
|
12659
12919
|
basename as basename8,
|
|
12660
12920
|
extname as extname5,
|
|
12661
12921
|
resolve as resolve22,
|
|
12662
|
-
relative as
|
|
12922
|
+
relative as relative10,
|
|
12663
12923
|
sep as sep2
|
|
12664
12924
|
} from "path";
|
|
12665
12925
|
import { env as env2 } from "process";
|
|
@@ -12703,7 +12963,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12703
12963
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
12704
12964
|
if (!spec.startsWith("."))
|
|
12705
12965
|
return null;
|
|
12706
|
-
const basePath = resolve22(
|
|
12966
|
+
const basePath = resolve22(dirname15(from), spec);
|
|
12707
12967
|
const candidates = [
|
|
12708
12968
|
basePath,
|
|
12709
12969
|
`${basePath}.ts`,
|
|
@@ -12714,14 +12974,14 @@ var resolveDevClientDir2 = () => {
|
|
|
12714
12974
|
`${basePath}.svelte`,
|
|
12715
12975
|
`${basePath}.svelte.ts`,
|
|
12716
12976
|
`${basePath}.svelte.js`,
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12977
|
+
join29(basePath, "index.ts"),
|
|
12978
|
+
join29(basePath, "index.js"),
|
|
12979
|
+
join29(basePath, "index.mjs"),
|
|
12980
|
+
join29(basePath, "index.cjs"),
|
|
12981
|
+
join29(basePath, "index.json"),
|
|
12982
|
+
join29(basePath, "index.svelte"),
|
|
12983
|
+
join29(basePath, "index.svelte.ts"),
|
|
12984
|
+
join29(basePath, "index.svelte.js")
|
|
12725
12985
|
];
|
|
12726
12986
|
const checks = await Promise.all(candidates.map(exists));
|
|
12727
12987
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -12730,7 +12990,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12730
12990
|
const resolved = resolvePackageImport(spec);
|
|
12731
12991
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
12732
12992
|
}
|
|
12733
|
-
const basePath = resolve22(
|
|
12993
|
+
const basePath = resolve22(dirname15(from), spec);
|
|
12734
12994
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
12735
12995
|
if (!explicit) {
|
|
12736
12996
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -12751,8 +13011,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12751
13011
|
return jsPath;
|
|
12752
13012
|
return null;
|
|
12753
13013
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
12754
|
-
const toServer =
|
|
12755
|
-
const toClient =
|
|
13014
|
+
const toServer = relative10(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
13015
|
+
const toClient = relative10(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
12756
13016
|
rewrites.set(rawSpec, {
|
|
12757
13017
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
12758
13018
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12760,10 +13020,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12760
13020
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev2 = false, stylePreprocessors) => {
|
|
12761
13021
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
12762
13022
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
12763
|
-
const clientDir =
|
|
12764
|
-
const indexDir =
|
|
12765
|
-
const serverDir =
|
|
12766
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
13023
|
+
const clientDir = join29(generatedDir, "client");
|
|
13024
|
+
const indexDir = join29(generatedDir, "indexes");
|
|
13025
|
+
const serverDir = join29(generatedDir, "server");
|
|
13026
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir5(dir, { recursive: true })));
|
|
12767
13027
|
const dev = env2.NODE_ENV !== "production";
|
|
12768
13028
|
const build2 = async (src) => {
|
|
12769
13029
|
const memoized = cache.get(src);
|
|
@@ -12790,8 +13050,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12790
13050
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
12791
13051
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedServer) : preprocessedServer;
|
|
12792
13052
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler3.transformSync(preprocessedClient) : preprocessedClient;
|
|
12793
|
-
const rawRel =
|
|
12794
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
13053
|
+
const rawRel = dirname15(relative10(svelteRoot, src)).replace(/\\/g, "/");
|
|
13054
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative10(process.cwd(), dirname15(src)).replace(/\\/g, "/")}` : rawRel;
|
|
12795
13055
|
const baseName = basename8(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12796
13056
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
12797
13057
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -12800,8 +13060,8 @@ var resolveDevClientDir2 = () => {
|
|
|
12800
13060
|
const childBuilt = await Promise.all(childSources.map((child) => build2(child)));
|
|
12801
13061
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
12802
13062
|
const externalRewrites = new Map;
|
|
12803
|
-
const ssrOutputDir =
|
|
12804
|
-
const clientOutputDir =
|
|
13063
|
+
const ssrOutputDir = dirname15(join29(serverDir, relDir, `${baseName}.js`));
|
|
13064
|
+
const clientOutputDir = dirname15(join29(clientDir, relDir, `${baseName}.js`));
|
|
12805
13065
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
12806
13066
|
const rawSpec = importPaths[idx];
|
|
12807
13067
|
if (!rawSpec)
|
|
@@ -12812,15 +13072,15 @@ var resolveDevClientDir2 = () => {
|
|
|
12812
13072
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
12813
13073
|
if (!resolved)
|
|
12814
13074
|
continue;
|
|
12815
|
-
const childRel =
|
|
13075
|
+
const childRel = relative10(svelteRoot, resolved).replace(/\\/g, "/");
|
|
12816
13076
|
if (!childRel.startsWith(".."))
|
|
12817
13077
|
continue;
|
|
12818
13078
|
const childBuilt2 = cache.get(resolved);
|
|
12819
13079
|
if (!childBuilt2)
|
|
12820
13080
|
continue;
|
|
12821
13081
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
12822
|
-
const toServer =
|
|
12823
|
-
const toClient =
|
|
13082
|
+
const toServer = relative10(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
13083
|
+
const toClient = relative10(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
12824
13084
|
externalRewrites.set(origSpec, {
|
|
12825
13085
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
12826
13086
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -12854,7 +13114,7 @@ var resolveDevClientDir2 = () => {
|
|
|
12854
13114
|
}).js;
|
|
12855
13115
|
let code = compiledJs.code.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
12856
13116
|
if (mode === "client" && isDev2) {
|
|
12857
|
-
const moduleKey = `/@src/${
|
|
13117
|
+
const moduleKey = `/@src/${relative10(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
12858
13118
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
12859
13119
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
12860
13120
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -12866,11 +13126,11 @@ var resolveDevClientDir2 = () => {
|
|
|
12866
13126
|
code += islandMetadataExports;
|
|
12867
13127
|
return { code, map: compiledJs.map };
|
|
12868
13128
|
};
|
|
12869
|
-
const ssrPath =
|
|
12870
|
-
const clientPath =
|
|
13129
|
+
const ssrPath = join29(serverDir, relDir, `${baseName}.js`);
|
|
13130
|
+
const clientPath = join29(clientDir, relDir, `${baseName}.js`);
|
|
12871
13131
|
await Promise.all([
|
|
12872
|
-
|
|
12873
|
-
|
|
13132
|
+
mkdir5(dirname15(ssrPath), { recursive: true }),
|
|
13133
|
+
mkdir5(dirname15(clientPath), { recursive: true })
|
|
12874
13134
|
]);
|
|
12875
13135
|
const inlineMap = (map) => map ? `
|
|
12876
13136
|
//# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(map)).toString("base64")}
|
|
@@ -12903,10 +13163,10 @@ var resolveDevClientDir2 = () => {
|
|
|
12903
13163
|
};
|
|
12904
13164
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
12905
13165
|
await Promise.all(roots.map(async ({ client: client2, hasAwaitSlot }) => {
|
|
12906
|
-
const relClientDir =
|
|
13166
|
+
const relClientDir = dirname15(relative10(clientDir, client2));
|
|
12907
13167
|
const name = basename8(client2, extname5(client2));
|
|
12908
|
-
const indexPath =
|
|
12909
|
-
const importRaw =
|
|
13168
|
+
const indexPath = join29(indexDir, relClientDir, `${name}.js`);
|
|
13169
|
+
const importRaw = relative10(dirname15(indexPath), client2).split(sep2).join("/");
|
|
12910
13170
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
12911
13171
|
const hmrImports = isDev2 ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
12912
13172
|
import "${hmrClientPath3}";
|
|
@@ -12977,14 +13237,14 @@ if (typeof window !== "undefined") {
|
|
|
12977
13237
|
setTimeout(releaseStreamingSlots, 0);
|
|
12978
13238
|
}
|
|
12979
13239
|
}`;
|
|
12980
|
-
await
|
|
13240
|
+
await mkdir5(dirname15(indexPath), { recursive: true });
|
|
12981
13241
|
return write2(indexPath, bootstrap);
|
|
12982
13242
|
}));
|
|
12983
13243
|
return {
|
|
12984
13244
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
12985
13245
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
12986
|
-
const rel =
|
|
12987
|
-
return
|
|
13246
|
+
const rel = dirname15(relative10(clientDir, client2));
|
|
13247
|
+
return join29(indexDir, rel, basename8(client2));
|
|
12988
13248
|
}),
|
|
12989
13249
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
12990
13250
|
};
|
|
@@ -12999,7 +13259,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
12999
13259
|
init_lowerAwaitSlotSyntax();
|
|
13000
13260
|
init_renderToReadableStream();
|
|
13001
13261
|
devClientDir2 = resolveDevClientDir2();
|
|
13002
|
-
hmrClientPath3 =
|
|
13262
|
+
hmrClientPath3 = join29(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
13003
13263
|
persistentCache = new Map;
|
|
13004
13264
|
sourceHashCache = new Map;
|
|
13005
13265
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -13411,13 +13671,13 @@ __export(exports_compileVue, {
|
|
|
13411
13671
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
13412
13672
|
});
|
|
13413
13673
|
import { existsSync as existsSync23, readFileSync as readFileSync20, realpathSync as realpathSync2 } from "fs";
|
|
13414
|
-
import { mkdir as
|
|
13674
|
+
import { mkdir as mkdir6 } from "fs/promises";
|
|
13415
13675
|
import {
|
|
13416
13676
|
basename as basename9,
|
|
13417
|
-
dirname as
|
|
13677
|
+
dirname as dirname16,
|
|
13418
13678
|
isAbsolute as isAbsolute4,
|
|
13419
|
-
join as
|
|
13420
|
-
relative as
|
|
13679
|
+
join as join30,
|
|
13680
|
+
relative as relative11,
|
|
13421
13681
|
resolve as resolve23
|
|
13422
13682
|
} from "path";
|
|
13423
13683
|
var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
@@ -13469,14 +13729,14 @@ var resolveDevClientDir3 = () => {
|
|
|
13469
13729
|
return "template-only";
|
|
13470
13730
|
}
|
|
13471
13731
|
return "full";
|
|
13472
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
13732
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
13473
13733
|
const resolved = realpathSync2(cssFilePath);
|
|
13474
13734
|
if (visited.has(resolved))
|
|
13475
13735
|
return "";
|
|
13476
13736
|
visited.add(resolved);
|
|
13477
13737
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
13478
13738
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
13479
|
-
const importedPath = resolve23(
|
|
13739
|
+
const importedPath = resolve23(dirname16(cssFilePath), relPath);
|
|
13480
13740
|
if (!existsSync23(importedPath))
|
|
13481
13741
|
return match;
|
|
13482
13742
|
const importedContent = readFileSync20(importedPath, "utf-8");
|
|
@@ -13533,7 +13793,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13533
13793
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
13534
13794
|
if (cachedResult)
|
|
13535
13795
|
return cachedResult;
|
|
13536
|
-
const relativeFilePath =
|
|
13796
|
+
const relativeFilePath = relative11(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
13537
13797
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
13538
13798
|
const fileBaseName = basename9(sourceFilePath, ".vue");
|
|
13539
13799
|
const componentId = toKebab(fileBaseName);
|
|
@@ -13572,12 +13832,12 @@ var resolveDevClientDir3 = () => {
|
|
|
13572
13832
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
13573
13833
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
13574
13834
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
13575
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve23(
|
|
13835
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute4(path)) && isStylePath(path)).map((path) => isAbsolute4(path) ? path : resolve23(dirname16(sourceFilePath), path));
|
|
13576
13836
|
for (const stylePath of stylePathsImported) {
|
|
13577
13837
|
addStyleImporter(sourceFilePath, stylePath);
|
|
13578
13838
|
}
|
|
13579
13839
|
const childBuildResults = await Promise.all([
|
|
13580
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve23(
|
|
13840
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve23(dirname16(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
13581
13841
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
13582
13842
|
]);
|
|
13583
13843
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -13592,7 +13852,7 @@ var resolveDevClientDir3 = () => {
|
|
|
13592
13852
|
sourceMap: true
|
|
13593
13853
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
13594
13854
|
const strippedScript = stripExports2(compiledScript.content);
|
|
13595
|
-
const sourceDir =
|
|
13855
|
+
const sourceDir = dirname16(sourceFilePath);
|
|
13596
13856
|
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
13597
13857
|
const packageImportRewrites = new Map;
|
|
13598
13858
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -13637,8 +13897,8 @@ var resolveDevClientDir3 = () => {
|
|
|
13637
13897
|
];
|
|
13638
13898
|
let cssOutputPaths = [];
|
|
13639
13899
|
if (isEntryPoint && allCss.length) {
|
|
13640
|
-
const cssOutputFile =
|
|
13641
|
-
await
|
|
13900
|
+
const cssOutputFile = join30(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
13901
|
+
await mkdir6(dirname16(cssOutputFile), { recursive: true });
|
|
13642
13902
|
await write3(cssOutputFile, allCss.join(`
|
|
13643
13903
|
`));
|
|
13644
13904
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -13668,21 +13928,21 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13668
13928
|
};
|
|
13669
13929
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
13670
13930
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
13671
|
-
const clientOutputPath =
|
|
13672
|
-
const serverOutputPath =
|
|
13931
|
+
const clientOutputPath = join30(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
13932
|
+
const serverOutputPath = join30(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
13673
13933
|
const rewritePackageImports = (code, outputPath, mode) => {
|
|
13674
13934
|
let result2 = code;
|
|
13675
13935
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
13676
13936
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
13677
|
-
let rel =
|
|
13937
|
+
let rel = relative11(dirname16(outputPath), targetPath).replace(/\\/g, "/");
|
|
13678
13938
|
if (!rel.startsWith("."))
|
|
13679
13939
|
rel = `./${rel}`;
|
|
13680
13940
|
result2 = result2.replaceAll(bareImport, rel);
|
|
13681
13941
|
}
|
|
13682
13942
|
return result2;
|
|
13683
13943
|
};
|
|
13684
|
-
await
|
|
13685
|
-
await
|
|
13944
|
+
await mkdir6(dirname16(clientOutputPath), { recursive: true });
|
|
13945
|
+
await mkdir6(dirname16(serverOutputPath), { recursive: true });
|
|
13686
13946
|
const clientFinal = rewritePackageImports(clientCode, clientOutputPath, "client");
|
|
13687
13947
|
const serverFinal = rewritePackageImports(serverCode, serverOutputPath, "server");
|
|
13688
13948
|
const inlineSourceMapFor = (finalContent) => {
|
|
@@ -13705,7 +13965,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13705
13965
|
serverPath: serverOutputPath,
|
|
13706
13966
|
spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
|
|
13707
13967
|
tsHelperPaths: [
|
|
13708
|
-
...helperModulePaths.map((helper) => resolveHelperTsPath(
|
|
13968
|
+
...helperModulePaths.map((helper) => resolveHelperTsPath(dirname16(sourceFilePath), helper)),
|
|
13709
13969
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
13710
13970
|
]
|
|
13711
13971
|
};
|
|
@@ -13715,15 +13975,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13715
13975
|
}, compileVue = async (entryPoints, vueRootDir, isDev2 = false, stylePreprocessors, ssrOnlyEntries) => {
|
|
13716
13976
|
const compiler = await import("@vue/compiler-sfc");
|
|
13717
13977
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
13718
|
-
const clientOutputDir =
|
|
13719
|
-
const indexOutputDir =
|
|
13720
|
-
const serverOutputDir =
|
|
13721
|
-
const cssOutputDir =
|
|
13978
|
+
const clientOutputDir = join30(generatedDir, "client");
|
|
13979
|
+
const indexOutputDir = join30(generatedDir, "indexes");
|
|
13980
|
+
const serverOutputDir = join30(generatedDir, "server");
|
|
13981
|
+
const cssOutputDir = join30(generatedDir, "compiled");
|
|
13722
13982
|
await Promise.all([
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13983
|
+
mkdir6(clientOutputDir, { recursive: true }),
|
|
13984
|
+
mkdir6(indexOutputDir, { recursive: true }),
|
|
13985
|
+
mkdir6(serverOutputDir, { recursive: true }),
|
|
13986
|
+
mkdir6(cssOutputDir, { recursive: true })
|
|
13727
13987
|
]);
|
|
13728
13988
|
const buildCache = new Map;
|
|
13729
13989
|
const allTsHelperPaths = new Set;
|
|
@@ -13746,16 +14006,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13746
14006
|
};
|
|
13747
14007
|
}
|
|
13748
14008
|
const entryBaseName = basename9(entryPath, ".vue");
|
|
13749
|
-
const indexOutputFile =
|
|
13750
|
-
const clientOutputFile =
|
|
13751
|
-
await
|
|
14009
|
+
const indexOutputFile = join30(indexOutputDir, `${entryBaseName}.js`);
|
|
14010
|
+
const clientOutputFile = join30(clientOutputDir, relative11(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
14011
|
+
await mkdir6(dirname16(indexOutputFile), { recursive: true });
|
|
13752
14012
|
const vueHmrImports = isDev2 ? [
|
|
13753
14013
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
13754
14014
|
`import "${hmrClientPath4}";`
|
|
13755
14015
|
] : [];
|
|
13756
14016
|
await write3(indexOutputFile, [
|
|
13757
14017
|
...vueHmrImports,
|
|
13758
|
-
`import Comp, * as PageModule from "${
|
|
14018
|
+
`import Comp, * as PageModule from "${relative11(dirname16(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
13759
14019
|
'import { createSSRApp, createApp } from "vue";',
|
|
13760
14020
|
"",
|
|
13761
14021
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -13904,7 +14164,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13904
14164
|
if (!tsPath)
|
|
13905
14165
|
continue;
|
|
13906
14166
|
const sourceCode = await file3(tsPath).text();
|
|
13907
|
-
const helperDir =
|
|
14167
|
+
const helperDir = dirname16(tsPath);
|
|
13908
14168
|
for (const dep of extractImports(sourceCode)) {
|
|
13909
14169
|
if (!dep.startsWith(".") || isStylePath(dep) || dep.endsWith(".vue")) {
|
|
13910
14170
|
continue;
|
|
@@ -13921,11 +14181,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
13921
14181
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
13922
14182
|
const sourceCode = await file3(tsPath).text();
|
|
13923
14183
|
const transpiledCode = transpiler4.transformSync(sourceCode);
|
|
13924
|
-
const relativeJsPath =
|
|
13925
|
-
const outClientPath =
|
|
13926
|
-
const outServerPath =
|
|
13927
|
-
await
|
|
13928
|
-
await
|
|
14184
|
+
const relativeJsPath = relative11(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
14185
|
+
const outClientPath = join30(clientOutputDir, relativeJsPath);
|
|
14186
|
+
const outServerPath = join30(serverOutputDir, relativeJsPath);
|
|
14187
|
+
await mkdir6(dirname16(outClientPath), { recursive: true });
|
|
14188
|
+
await mkdir6(dirname16(outServerPath), { recursive: true });
|
|
13929
14189
|
await write3(outClientPath, transpiledCode);
|
|
13930
14190
|
await write3(outServerPath, transpiledCode);
|
|
13931
14191
|
}));
|
|
@@ -13955,7 +14215,7 @@ var init_compileVue = __esm(() => {
|
|
|
13955
14215
|
init_vueAutoRouterTransform();
|
|
13956
14216
|
init_stylePreprocessor();
|
|
13957
14217
|
devClientDir3 = resolveDevClientDir3();
|
|
13958
|
-
hmrClientPath4 =
|
|
14218
|
+
hmrClientPath4 = join30(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
13959
14219
|
transpiler4 = new Transpiler3({ loader: "ts", target: "browser" });
|
|
13960
14220
|
scriptCache = new Map;
|
|
13961
14221
|
scriptSetupCache = new Map;
|
|
@@ -14437,7 +14697,7 @@ __export(exports_compileAngular, {
|
|
|
14437
14697
|
compileAngular: () => compileAngular
|
|
14438
14698
|
});
|
|
14439
14699
|
import { existsSync as existsSync24, readFileSync as readFileSync21, promises as fs5 } from "fs";
|
|
14440
|
-
import { join as
|
|
14700
|
+
import { join as join31, basename as basename10, sep as sep3, dirname as dirname17, resolve as resolve24, relative as relative12 } from "path";
|
|
14441
14701
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
14442
14702
|
import ts11 from "typescript";
|
|
14443
14703
|
var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
@@ -14480,10 +14740,10 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14480
14740
|
`${candidate}.tsx`,
|
|
14481
14741
|
`${candidate}.js`,
|
|
14482
14742
|
`${candidate}.jsx`,
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14743
|
+
join31(candidate, "index.ts"),
|
|
14744
|
+
join31(candidate, "index.tsx"),
|
|
14745
|
+
join31(candidate, "index.js"),
|
|
14746
|
+
join31(candidate, "index.jsx")
|
|
14487
14747
|
];
|
|
14488
14748
|
return candidates.find((file4) => existsSync24(file4));
|
|
14489
14749
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -14555,7 +14815,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14555
14815
|
if (scan.usesLegacyAnimations)
|
|
14556
14816
|
return true;
|
|
14557
14817
|
for (const specifier of scan.imports) {
|
|
14558
|
-
const importedPath = resolveLocalImport(specifier,
|
|
14818
|
+
const importedPath = resolveLocalImport(specifier, dirname17(resolved));
|
|
14559
14819
|
if (importedPath && await visit(importedPath, visited)) {
|
|
14560
14820
|
return true;
|
|
14561
14821
|
}
|
|
@@ -14614,7 +14874,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14614
14874
|
return `${path.replace(/\.ts$/, ".js")}${query}`;
|
|
14615
14875
|
if (hasJsLikeExtension(path))
|
|
14616
14876
|
return `${path}${query}`;
|
|
14617
|
-
const importerDir =
|
|
14877
|
+
const importerDir = dirname17(importerOutputPath);
|
|
14618
14878
|
const fileCandidate = resolve24(importerDir, `${path}.js`);
|
|
14619
14879
|
if (outputFiles?.has(fileCandidate) || existsSync24(fileCandidate)) {
|
|
14620
14880
|
return `${path}.js${query}`;
|
|
@@ -14647,16 +14907,16 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14647
14907
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
14648
14908
|
if (!isRelativeModuleSpecifier(specifier))
|
|
14649
14909
|
return null;
|
|
14650
|
-
const basePath = resolve24(
|
|
14910
|
+
const basePath = resolve24(dirname17(fromFile), specifier);
|
|
14651
14911
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
14652
14912
|
`${basePath}.ts`,
|
|
14653
14913
|
`${basePath}.tsx`,
|
|
14654
14914
|
`${basePath}.mts`,
|
|
14655
14915
|
`${basePath}.cts`,
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14916
|
+
join31(basePath, "index.ts"),
|
|
14917
|
+
join31(basePath, "index.tsx"),
|
|
14918
|
+
join31(basePath, "index.mts"),
|
|
14919
|
+
join31(basePath, "index.cts")
|
|
14660
14920
|
];
|
|
14661
14921
|
return candidates.map((candidate) => resolve24(candidate)).find((candidate) => existsSync24(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
14662
14922
|
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
@@ -14682,15 +14942,15 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14682
14942
|
const paths = [];
|
|
14683
14943
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14684
14944
|
if (templateUrlMatch?.[1])
|
|
14685
|
-
paths.push(
|
|
14945
|
+
paths.push(join31(fileDir, templateUrlMatch[1]));
|
|
14686
14946
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
14687
14947
|
if (styleUrlMatch?.[1])
|
|
14688
|
-
paths.push(
|
|
14948
|
+
paths.push(join31(fileDir, styleUrlMatch[1]));
|
|
14689
14949
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
14690
14950
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
14691
14951
|
if (urlMatches) {
|
|
14692
14952
|
for (const urlMatch of urlMatches) {
|
|
14693
|
-
paths.push(
|
|
14953
|
+
paths.push(join31(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
14694
14954
|
}
|
|
14695
14955
|
}
|
|
14696
14956
|
return paths.map((path) => resolve24(path));
|
|
@@ -14705,13 +14965,13 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14705
14965
|
return null;
|
|
14706
14966
|
}
|
|
14707
14967
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
14708
|
-
await fs5.mkdir(
|
|
14968
|
+
await fs5.mkdir(dirname17(cachePath), { recursive: true });
|
|
14709
14969
|
await fs5.writeFile(cachePath, JSON.stringify({
|
|
14710
14970
|
source,
|
|
14711
14971
|
version: 1
|
|
14712
14972
|
}), "utf-8");
|
|
14713
14973
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
14714
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
14974
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname17(filePath));
|
|
14715
14975
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
14716
14976
|
const content = await fs5.readFile(resourcePath, "utf-8");
|
|
14717
14977
|
return `${resourcePath}\x00${content}`;
|
|
@@ -14724,7 +14984,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14724
14984
|
safeStableStringify(stylePreprocessors ?? null)
|
|
14725
14985
|
].join("\x00");
|
|
14726
14986
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
14727
|
-
return
|
|
14987
|
+
return join31(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
14728
14988
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
14729
14989
|
const transformedSources = new Map;
|
|
14730
14990
|
const visited = new Set;
|
|
@@ -14751,7 +15011,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14751
15011
|
transformedSource = cached.source;
|
|
14752
15012
|
} else {
|
|
14753
15013
|
stats.cacheMisses += 1;
|
|
14754
|
-
const transformed = await inlineResources(source,
|
|
15014
|
+
const transformed = await inlineResources(source, dirname17(resolvedPath), stylePreprocessors);
|
|
14755
15015
|
transformedSource = transformed.source;
|
|
14756
15016
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
14757
15017
|
}
|
|
@@ -14770,7 +15030,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14770
15030
|
return { stats, transformedSources };
|
|
14771
15031
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
14772
15032
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
14773
|
-
const outputPath = resolve24(
|
|
15033
|
+
const outputPath = resolve24(join31(outDir, relative12(process.cwd(), resolve24(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
14774
15034
|
return [
|
|
14775
15035
|
outputPath,
|
|
14776
15036
|
buildIslandMetadataExports(readFileSync21(inputPath, "utf-8"))
|
|
@@ -14780,7 +15040,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14780
15040
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
14781
15041
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
14782
15042
|
const tsPath = __require.resolve("typescript");
|
|
14783
|
-
const tsRootDir =
|
|
15043
|
+
const tsRootDir = dirname17(tsPath);
|
|
14784
15044
|
return tsRootDir.endsWith("lib") ? tsRootDir : resolve24(tsRootDir, "lib");
|
|
14785
15045
|
});
|
|
14786
15046
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
@@ -14817,7 +15077,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14817
15077
|
const originalGetSourceFile = host.getSourceFile;
|
|
14818
15078
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
14819
15079
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
14820
|
-
const resolvedPath =
|
|
15080
|
+
const resolvedPath = join31(tsLibDir, fileName);
|
|
14821
15081
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
14822
15082
|
}
|
|
14823
15083
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -14872,7 +15132,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14872
15132
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
14873
15133
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
14874
15134
|
content,
|
|
14875
|
-
target:
|
|
15135
|
+
target: join31(outDir, fileName)
|
|
14876
15136
|
}));
|
|
14877
15137
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve24(target)));
|
|
14878
15138
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -14894,7 +15154,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
14894
15154
|
});
|
|
14895
15155
|
});
|
|
14896
15156
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
14897
|
-
await fs5.mkdir(
|
|
15157
|
+
await fs5.mkdir(dirname17(target), { recursive: true });
|
|
14898
15158
|
await fs5.writeFile(target, content, "utf-8");
|
|
14899
15159
|
})), { outputs: entries.length });
|
|
14900
15160
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -15049,7 +15309,7 @@ ${fields}
|
|
|
15049
15309
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
15050
15310
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15051
15311
|
if (templateUrlMatch?.[1]) {
|
|
15052
|
-
const templatePath =
|
|
15312
|
+
const templatePath = join31(fileDir, templateUrlMatch[1]);
|
|
15053
15313
|
if (!existsSync24(templatePath)) {
|
|
15054
15314
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
15055
15315
|
}
|
|
@@ -15080,7 +15340,7 @@ ${fields}
|
|
|
15080
15340
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
15081
15341
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15082
15342
|
if (templateUrlMatch?.[1]) {
|
|
15083
|
-
const templatePath =
|
|
15343
|
+
const templatePath = join31(fileDir, templateUrlMatch[1]);
|
|
15084
15344
|
if (!existsSync24(templatePath)) {
|
|
15085
15345
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
15086
15346
|
}
|
|
@@ -15117,7 +15377,7 @@ ${fields}
|
|
|
15117
15377
|
return source;
|
|
15118
15378
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
15119
15379
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
15120
|
-
return readAndEscapeFile(
|
|
15380
|
+
return readAndEscapeFile(join31(fileDir, styleUrl), stylePreprocessors);
|
|
15121
15381
|
});
|
|
15122
15382
|
const results = await Promise.all(stylePromises);
|
|
15123
15383
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -15128,7 +15388,7 @@ ${fields}
|
|
|
15128
15388
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
15129
15389
|
if (!styleUrlMatch?.[1])
|
|
15130
15390
|
return source;
|
|
15131
|
-
const escaped = await readAndEscapeFile(
|
|
15391
|
+
const escaped = await readAndEscapeFile(join31(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
15132
15392
|
if (!escaped)
|
|
15133
15393
|
return source;
|
|
15134
15394
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -15164,10 +15424,10 @@ ${fields}
|
|
|
15164
15424
|
`${candidate}.js`,
|
|
15165
15425
|
`${candidate}.jsx`,
|
|
15166
15426
|
`${candidate}.json`,
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15427
|
+
join31(candidate, "index.ts"),
|
|
15428
|
+
join31(candidate, "index.tsx"),
|
|
15429
|
+
join31(candidate, "index.js"),
|
|
15430
|
+
join31(candidate, "index.jsx")
|
|
15171
15431
|
];
|
|
15172
15432
|
return candidates.find((file4) => existsSync24(file4));
|
|
15173
15433
|
};
|
|
@@ -15191,13 +15451,13 @@ ${fields}
|
|
|
15191
15451
|
}
|
|
15192
15452
|
};
|
|
15193
15453
|
const toOutputPath = (sourcePath) => {
|
|
15194
|
-
const inputDir =
|
|
15454
|
+
const inputDir = dirname17(sourcePath);
|
|
15195
15455
|
const fileBase = basename10(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
15196
15456
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep3}`)) {
|
|
15197
|
-
return
|
|
15457
|
+
return join31(inputDir, fileBase);
|
|
15198
15458
|
}
|
|
15199
15459
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
15200
|
-
return
|
|
15460
|
+
return join31(outDir, relativeDir, fileBase);
|
|
15201
15461
|
};
|
|
15202
15462
|
const withCacheBuster = (specifier) => {
|
|
15203
15463
|
if (!cacheBuster)
|
|
@@ -15245,10 +15505,10 @@ ${fields}
|
|
|
15245
15505
|
return;
|
|
15246
15506
|
visited.add(resolved);
|
|
15247
15507
|
if (resolved.endsWith(".json") && existsSync24(resolved)) {
|
|
15248
|
-
const inputDir2 =
|
|
15508
|
+
const inputDir2 = dirname17(resolved);
|
|
15249
15509
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
15250
|
-
const targetDir2 =
|
|
15251
|
-
const targetPath2 =
|
|
15510
|
+
const targetDir2 = join31(outDir, relativeDir2);
|
|
15511
|
+
const targetPath2 = join31(targetDir2, basename10(resolved));
|
|
15252
15512
|
await fs5.mkdir(targetDir2, { recursive: true });
|
|
15253
15513
|
await fs5.copyFile(resolved, targetPath2);
|
|
15254
15514
|
allOutputs.push(targetPath2);
|
|
@@ -15260,13 +15520,13 @@ ${fields}
|
|
|
15260
15520
|
if (!existsSync24(actualPath))
|
|
15261
15521
|
return;
|
|
15262
15522
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
15263
|
-
const inlined = await inlineResources(sourceCode,
|
|
15264
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
15265
|
-
const inputDir =
|
|
15523
|
+
const inlined = await inlineResources(sourceCode, dirname17(actualPath), stylePreprocessors);
|
|
15524
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname17(actualPath)).source;
|
|
15525
|
+
const inputDir = dirname17(actualPath);
|
|
15266
15526
|
const fileBase = basename10(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
15267
15527
|
const targetPath = toOutputPath(actualPath);
|
|
15268
|
-
const targetDir =
|
|
15269
|
-
const relativeDir =
|
|
15528
|
+
const targetDir = dirname17(targetPath);
|
|
15529
|
+
const relativeDir = relative12(outDir, targetDir).replace(/\\/g, "/");
|
|
15270
15530
|
const localImports = [];
|
|
15271
15531
|
const importRewrites = new Map;
|
|
15272
15532
|
const fromRegex = /(?:from|import)\s+['"]([^'".][^'"]*|\.\.?\/[^'"]+)['"]/g;
|
|
@@ -15287,7 +15547,7 @@ ${fields}
|
|
|
15287
15547
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
15288
15548
|
if (!resolved2)
|
|
15289
15549
|
return null;
|
|
15290
|
-
const relativeImport =
|
|
15550
|
+
const relativeImport = relative12(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
15291
15551
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
15292
15552
|
importRewrites.set(specifier, relativeRewrite);
|
|
15293
15553
|
return resolved2;
|
|
@@ -15326,7 +15586,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15326
15586
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
15327
15587
|
}
|
|
15328
15588
|
const compiledRoot = compiledParent;
|
|
15329
|
-
const indexesDir =
|
|
15589
|
+
const indexesDir = join31(compiledParent, "indexes");
|
|
15330
15590
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
15331
15591
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve24(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
15332
15592
|
if (!hmr) {
|
|
@@ -15340,10 +15600,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15340
15600
|
absolute: false,
|
|
15341
15601
|
cwd: angularSrcDir
|
|
15342
15602
|
})) {
|
|
15343
|
-
const sourcePath =
|
|
15344
|
-
const cwdRel =
|
|
15345
|
-
const targetPath =
|
|
15346
|
-
await fs5.mkdir(
|
|
15603
|
+
const sourcePath = join31(angularSrcDir, rel);
|
|
15604
|
+
const cwdRel = relative12(cwd, sourcePath);
|
|
15605
|
+
const targetPath = join31(compiledRoot, cwdRel);
|
|
15606
|
+
await fs5.mkdir(dirname17(targetPath), { recursive: true });
|
|
15347
15607
|
await fs5.copyFile(sourcePath, targetPath);
|
|
15348
15608
|
}
|
|
15349
15609
|
});
|
|
@@ -15351,7 +15611,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15351
15611
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
15352
15612
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
15353
15613
|
const resolvedEntry = resolve24(entry);
|
|
15354
|
-
const relativeEntry =
|
|
15614
|
+
const relativeEntry = relative12(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
15355
15615
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
15356
15616
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
15357
15617
|
entry: resolvedEntry
|
|
@@ -15359,9 +15619,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15359
15619
|
const fileBase = basename10(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
15360
15620
|
const jsName = `${fileBase}.js`;
|
|
15361
15621
|
const compiledFallbackPaths = [
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15622
|
+
join31(compiledRoot, relativeEntry),
|
|
15623
|
+
join31(compiledRoot, "pages", jsName),
|
|
15624
|
+
join31(compiledRoot, jsName)
|
|
15365
15625
|
].map((file4) => resolve24(file4));
|
|
15366
15626
|
const resolveRawServerFile = (candidatePaths) => {
|
|
15367
15627
|
const normalizedCandidates = [
|
|
@@ -15423,7 +15683,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15423
15683
|
})() : "no-providers";
|
|
15424
15684
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
15425
15685
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
15426
|
-
const clientFile =
|
|
15686
|
+
const clientFile = join31(indexesDir, jsName);
|
|
15427
15687
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync24(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
15428
15688
|
return {
|
|
15429
15689
|
clientPath: clientFile,
|
|
@@ -15457,11 +15717,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
15457
15717
|
const compiledAppProvidersPath = (() => {
|
|
15458
15718
|
const angularDirAbs = resolve24(outRoot);
|
|
15459
15719
|
const appSourceAbs = resolve24(providersInjection.appProvidersSource);
|
|
15460
|
-
const rel =
|
|
15461
|
-
return
|
|
15720
|
+
const rel = relative12(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
15721
|
+
return join31(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
15462
15722
|
})();
|
|
15463
15723
|
const appProvidersSpec = (() => {
|
|
15464
|
-
const rel =
|
|
15724
|
+
const rel = relative12(dirname17(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
15465
15725
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
15466
15726
|
})();
|
|
15467
15727
|
importLines.push(`import { appProviders as __abs_globalProviders } from "${appProvidersSpec}";`);
|
|
@@ -15486,7 +15746,7 @@ export const providers = [${fragments.join(", ")}];
|
|
|
15486
15746
|
}
|
|
15487
15747
|
}
|
|
15488
15748
|
await traceAngularPhase("wrapper/write-server-output", () => fs5.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
15489
|
-
const relativePath =
|
|
15749
|
+
const relativePath = relative12(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
15490
15750
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
15491
15751
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
15492
15752
|
import "${hmrClientPath5}";
|
|
@@ -15682,7 +15942,7 @@ var init_compileAngular = __esm(() => {
|
|
|
15682
15942
|
init_stylePreprocessor();
|
|
15683
15943
|
init_generatedDir();
|
|
15684
15944
|
devClientDir4 = resolveDevClientDir4();
|
|
15685
|
-
hmrClientPath5 =
|
|
15945
|
+
hmrClientPath5 = join31(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
15686
15946
|
jitContentCache = new Map;
|
|
15687
15947
|
wrapperOutputCache = new Map;
|
|
15688
15948
|
});
|
|
@@ -16406,7 +16666,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
16406
16666
|
invalidateFingerprintCache: () => invalidateFingerprintCache
|
|
16407
16667
|
});
|
|
16408
16668
|
import { existsSync as existsSync25, readFileSync as readFileSync22, statSync as statSync2 } from "fs";
|
|
16409
|
-
import { dirname as
|
|
16669
|
+
import { dirname as dirname18, extname as extname6, relative as relative13, resolve as resolve25 } from "path";
|
|
16410
16670
|
import ts15 from "typescript";
|
|
16411
16671
|
var fail = (reason, detail, location) => ({
|
|
16412
16672
|
ok: false,
|
|
@@ -16517,7 +16777,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16517
16777
|
})();
|
|
16518
16778
|
if (!decoratorName)
|
|
16519
16779
|
continue;
|
|
16520
|
-
const projectRel =
|
|
16780
|
+
const projectRel = relative13(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
16521
16781
|
const id = encodeURIComponent(`${projectRel}@${className}`);
|
|
16522
16782
|
if (decoratorName === "Component") {
|
|
16523
16783
|
const componentDecorator = decorators.find((d2) => {
|
|
@@ -16534,7 +16794,7 @@ var fail = (reason, detail, location) => ({
|
|
|
16534
16794
|
continue;
|
|
16535
16795
|
const decoratorMeta = readDecoratorMeta(args);
|
|
16536
16796
|
const { inputs, outputs } = extractInputsAndOutputs(stmt, null);
|
|
16537
|
-
const componentDir =
|
|
16797
|
+
const componentDir = dirname18(componentFilePath);
|
|
16538
16798
|
const fingerprint = extractFingerprint(stmt, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
16539
16799
|
fingerprintCache.set(id, fingerprint);
|
|
16540
16800
|
} else {
|
|
@@ -17494,7 +17754,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17494
17754
|
});
|
|
17495
17755
|
if (!names.includes(className))
|
|
17496
17756
|
continue;
|
|
17497
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
17757
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname18(startDtsPath));
|
|
17498
17758
|
if (!nextDts)
|
|
17499
17759
|
continue;
|
|
17500
17760
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -17504,7 +17764,7 @@ var fail = (reason, detail, location) => ({
|
|
|
17504
17764
|
const starReExportRe = /export\s*\*\s*from\s*["']([^"']+)["']/g;
|
|
17505
17765
|
while ((m = starReExportRe.exec(content)) !== null) {
|
|
17506
17766
|
const fromPath = m[1] || "";
|
|
17507
|
-
const nextDts = resolveDtsFromSpec(fromPath,
|
|
17767
|
+
const nextDts = resolveDtsFromSpec(fromPath, dirname18(startDtsPath));
|
|
17508
17768
|
if (!nextDts)
|
|
17509
17769
|
continue;
|
|
17510
17770
|
const found = findDtsContainingClass(nextDts, className, visited);
|
|
@@ -18082,7 +18342,7 @@ ${block}
|
|
|
18082
18342
|
}
|
|
18083
18343
|
const kind = params.kind ?? "component";
|
|
18084
18344
|
if (kind !== "component") {
|
|
18085
|
-
const entityId = encodeURIComponent(`${
|
|
18345
|
+
const entityId = encodeURIComponent(`${relative13(projectRoot, componentFilePath).replace(/\\/g, "/")}@${className}`);
|
|
18086
18346
|
const currentEntityFingerprint = extractEntityFingerprint(classNode, className, sourceFile);
|
|
18087
18347
|
const cachedEntityFingerprint = entityFingerprintCache.get(entityId);
|
|
18088
18348
|
if (cachedEntityFingerprint !== undefined && !entityFingerprintsEqual(cachedEntityFingerprint, currentEntityFingerprint)) {
|
|
@@ -18101,7 +18361,7 @@ ${block}
|
|
|
18101
18361
|
rebootstrapRequired: false
|
|
18102
18362
|
};
|
|
18103
18363
|
}
|
|
18104
|
-
if (inheritsDecoratedClass(classNode, sourceFile,
|
|
18364
|
+
if (inheritsDecoratedClass(classNode, sourceFile, dirname18(componentFilePath), projectRoot)) {
|
|
18105
18365
|
return fail("inherits-decorated-class");
|
|
18106
18366
|
}
|
|
18107
18367
|
const decorator = findComponentDecorator(classNode);
|
|
@@ -18113,7 +18373,7 @@ ${block}
|
|
|
18113
18373
|
const projectDefaults = readProjectAngularCompilerOptions(projectRoot);
|
|
18114
18374
|
const decoratorMeta = readDecoratorMeta(decoratorArgs, projectDefaults);
|
|
18115
18375
|
const advancedMetadata = extractAdvancedMetadata(classNode, decoratorArgs, compiler);
|
|
18116
|
-
const componentDir =
|
|
18376
|
+
const componentDir = dirname18(componentFilePath);
|
|
18117
18377
|
let templateText;
|
|
18118
18378
|
let templatePath;
|
|
18119
18379
|
if (decoratorMeta.template !== null) {
|
|
@@ -18166,7 +18426,7 @@ ${block}
|
|
|
18166
18426
|
return fail("class-not-found", "anonymous class");
|
|
18167
18427
|
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
18168
18428
|
const { inputs, outputs, hasDecoratorIO, hasSignalIO } = extractInputsAndOutputs(classNode, compiler);
|
|
18169
|
-
const projectRelPath =
|
|
18429
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
18170
18430
|
const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
18171
18431
|
const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
|
|
18172
18432
|
const cachedFingerprint = fingerprintCache.get(fingerprintId);
|
|
@@ -18874,7 +19134,7 @@ __export(exports_compileEmber, {
|
|
|
18874
19134
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir,
|
|
18875
19135
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
18876
19136
|
getEmberClientCompiledDir: () => getEmberClientCompiledDir,
|
|
18877
|
-
dirname: () =>
|
|
19137
|
+
dirname: () => dirname19,
|
|
18878
19138
|
compileEmberFileSource: () => compileEmberFileSource,
|
|
18879
19139
|
compileEmberFile: () => compileEmberFile,
|
|
18880
19140
|
compileEmber: () => compileEmber,
|
|
@@ -18882,8 +19142,8 @@ __export(exports_compileEmber, {
|
|
|
18882
19142
|
basename: () => basename11
|
|
18883
19143
|
});
|
|
18884
19144
|
import { existsSync as existsSync26 } from "fs";
|
|
18885
|
-
import { mkdir as
|
|
18886
|
-
import { basename as basename11, dirname as
|
|
19145
|
+
import { mkdir as mkdir7, rm as rm4 } from "fs/promises";
|
|
19146
|
+
import { basename as basename11, dirname as dirname19, extname as extname7, join as join32, resolve as resolve26 } from "path";
|
|
18887
19147
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
18888
19148
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
18889
19149
|
if (cachedPreprocessor)
|
|
@@ -18979,7 +19239,7 @@ export const importSync = (specifier) => {
|
|
|
18979
19239
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
18980
19240
|
if (!originalImporter)
|
|
18981
19241
|
return;
|
|
18982
|
-
const candidateBase = resolve26(
|
|
19242
|
+
const candidateBase = resolve26(dirname19(originalImporter), args.path);
|
|
18983
19243
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
18984
19244
|
for (const ext of extensionsToTry) {
|
|
18985
19245
|
const candidate = candidateBase + ext;
|
|
@@ -19002,7 +19262,7 @@ export const importSync = (specifier) => {
|
|
|
19002
19262
|
build2.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
19003
19263
|
if (standalonePackages.has(args.path))
|
|
19004
19264
|
return;
|
|
19005
|
-
const internal =
|
|
19265
|
+
const internal = join32(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
19006
19266
|
if (existsSync26(internal))
|
|
19007
19267
|
return { path: internal };
|
|
19008
19268
|
return;
|
|
@@ -19050,16 +19310,16 @@ export default PageComponent;
|
|
|
19050
19310
|
}
|
|
19051
19311
|
const transpiled = transpiler5.transformSync(preprocessed);
|
|
19052
19312
|
const baseName = basename11(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
19053
|
-
const tmpDir =
|
|
19054
|
-
const serverDir =
|
|
19055
|
-
const clientDir =
|
|
19313
|
+
const tmpDir = join32(compiledRoot, "_tmp");
|
|
19314
|
+
const serverDir = join32(compiledRoot, "server");
|
|
19315
|
+
const clientDir = join32(compiledRoot, "client");
|
|
19056
19316
|
await Promise.all([
|
|
19057
|
-
|
|
19058
|
-
|
|
19059
|
-
|
|
19317
|
+
mkdir7(tmpDir, { recursive: true }),
|
|
19318
|
+
mkdir7(serverDir, { recursive: true }),
|
|
19319
|
+
mkdir7(clientDir, { recursive: true })
|
|
19060
19320
|
]);
|
|
19061
|
-
const tmpPagePath = resolve26(
|
|
19062
|
-
const tmpHarnessPath = resolve26(
|
|
19321
|
+
const tmpPagePath = resolve26(join32(tmpDir, `${baseName}.module.js`));
|
|
19322
|
+
const tmpHarnessPath = resolve26(join32(tmpDir, `${baseName}.harness.js`));
|
|
19063
19323
|
await Promise.all([
|
|
19064
19324
|
write4(tmpPagePath, transpiled),
|
|
19065
19325
|
write4(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -19067,7 +19327,7 @@ export default PageComponent;
|
|
|
19067
19327
|
const stagedSourceMap = new Map([
|
|
19068
19328
|
[tmpPagePath, resolvedEntry]
|
|
19069
19329
|
]);
|
|
19070
|
-
const serverPath =
|
|
19330
|
+
const serverPath = join32(serverDir, `${baseName}.js`);
|
|
19071
19331
|
const buildResult = await bunBuild2({
|
|
19072
19332
|
entrypoints: [tmpHarnessPath],
|
|
19073
19333
|
format: "esm",
|
|
@@ -19084,7 +19344,7 @@ export default PageComponent;
|
|
|
19084
19344
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
19085
19345
|
}
|
|
19086
19346
|
await rm4(tmpDir, { force: true, recursive: true });
|
|
19087
|
-
const clientPath =
|
|
19347
|
+
const clientPath = join32(clientDir, `${baseName}.js`);
|
|
19088
19348
|
await write4(clientPath, transpiled);
|
|
19089
19349
|
return { clientPath, serverPath };
|
|
19090
19350
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -19112,7 +19372,7 @@ export default PageComponent;
|
|
|
19112
19372
|
preprocessed = rewriteTemplateEvalToScope(result.code);
|
|
19113
19373
|
}
|
|
19114
19374
|
return transpiler5.transformSync(preprocessed);
|
|
19115
|
-
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) =>
|
|
19375
|
+
}, clearEmberCompilerCache = () => {}, getEmberCompiledRoot = (_emberDir) => getFrameworkGeneratedDir("ember"), getEmberServerCompiledDir = (emberDir) => join32(getEmberCompiledRoot(emberDir), "server"), getEmberClientCompiledDir = (emberDir) => join32(getEmberCompiledRoot(emberDir), "client");
|
|
19116
19376
|
var init_compileEmber = __esm(() => {
|
|
19117
19377
|
init_generatedDir();
|
|
19118
19378
|
transpiler5 = new Transpiler4({
|
|
@@ -19134,7 +19394,7 @@ __export(exports_buildReactVendor, {
|
|
|
19134
19394
|
buildReactVendor: () => buildReactVendor
|
|
19135
19395
|
});
|
|
19136
19396
|
import { existsSync as existsSync27, mkdirSync as mkdirSync8 } from "fs";
|
|
19137
|
-
import { join as
|
|
19397
|
+
import { join as join33, resolve as resolve27 } from "path";
|
|
19138
19398
|
import { rm as rm5 } from "fs/promises";
|
|
19139
19399
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
19140
19400
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -19176,14 +19436,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
19176
19436
|
`)}
|
|
19177
19437
|
`;
|
|
19178
19438
|
}, buildReactVendor = async (buildDir) => {
|
|
19179
|
-
const vendorDir =
|
|
19439
|
+
const vendorDir = join33(buildDir, "react", "vendor");
|
|
19180
19440
|
mkdirSync8(vendorDir, { recursive: true });
|
|
19181
|
-
const tmpDir =
|
|
19441
|
+
const tmpDir = join33(buildDir, "_vendor_tmp");
|
|
19182
19442
|
mkdirSync8(tmpDir, { recursive: true });
|
|
19183
19443
|
const specifiers = reactSpecifiers;
|
|
19184
19444
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
19185
19445
|
const safeName = toSafeFileName(specifier);
|
|
19186
|
-
const entryPath =
|
|
19446
|
+
const entryPath = join33(tmpDir, `${safeName}.ts`);
|
|
19187
19447
|
const source = await generateEntrySource(specifier);
|
|
19188
19448
|
await Bun.write(entryPath, source);
|
|
19189
19449
|
return entryPath;
|
|
@@ -19248,7 +19508,7 @@ __export(exports_buildAngularVendor, {
|
|
|
19248
19508
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
19249
19509
|
});
|
|
19250
19510
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
19251
|
-
import { join as
|
|
19511
|
+
import { join as join34 } from "path";
|
|
19252
19512
|
import { rm as rm6 } from "fs/promises";
|
|
19253
19513
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
19254
19514
|
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, isResolvable = (specifier) => {
|
|
@@ -19345,14 +19605,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19345
19605
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
19346
19606
|
return Array.from(angular).filter(isResolvable);
|
|
19347
19607
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
19348
|
-
const vendorDir =
|
|
19608
|
+
const vendorDir = join34(buildDir, "angular", "vendor");
|
|
19349
19609
|
mkdirSync9(vendorDir, { recursive: true });
|
|
19350
|
-
const tmpDir =
|
|
19610
|
+
const tmpDir = join34(buildDir, "_angular_vendor_tmp");
|
|
19351
19611
|
mkdirSync9(tmpDir, { recursive: true });
|
|
19352
19612
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
19353
19613
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
19354
19614
|
const safeName = toSafeFileName2(specifier);
|
|
19355
|
-
const entryPath =
|
|
19615
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
19356
19616
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
19357
19617
|
return entryPath;
|
|
19358
19618
|
}));
|
|
@@ -19383,9 +19643,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19383
19643
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
19384
19644
|
return computeAngularVendorPaths(specifiers);
|
|
19385
19645
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
19386
|
-
const vendorDir =
|
|
19646
|
+
const vendorDir = join34(buildDir, "angular", "vendor", "server");
|
|
19387
19647
|
mkdirSync9(vendorDir, { recursive: true });
|
|
19388
|
-
const tmpDir =
|
|
19648
|
+
const tmpDir = join34(buildDir, "_angular_server_vendor_tmp");
|
|
19389
19649
|
mkdirSync9(tmpDir, { recursive: true });
|
|
19390
19650
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
19391
19651
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -19396,7 +19656,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19396
19656
|
const specifiers = Array.from(allSpecs);
|
|
19397
19657
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
19398
19658
|
const safeName = toSafeFileName2(specifier);
|
|
19399
|
-
const entryPath =
|
|
19659
|
+
const entryPath = join34(tmpDir, `${safeName}.ts`);
|
|
19400
19660
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
19401
19661
|
return entryPath;
|
|
19402
19662
|
}));
|
|
@@ -19418,9 +19678,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
19418
19678
|
return specifiers;
|
|
19419
19679
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
19420
19680
|
const paths = {};
|
|
19421
|
-
const vendorDir =
|
|
19681
|
+
const vendorDir = join34(buildDir, "angular", "vendor", "server");
|
|
19422
19682
|
for (const specifier of specifiers) {
|
|
19423
|
-
paths[specifier] =
|
|
19683
|
+
paths[specifier] = join34(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
19424
19684
|
}
|
|
19425
19685
|
return paths;
|
|
19426
19686
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -19476,17 +19736,17 @@ __export(exports_buildVueVendor, {
|
|
|
19476
19736
|
buildVueVendor: () => buildVueVendor
|
|
19477
19737
|
});
|
|
19478
19738
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
19479
|
-
import { join as
|
|
19739
|
+
import { join as join35 } from "path";
|
|
19480
19740
|
import { rm as rm7 } from "fs/promises";
|
|
19481
19741
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
19482
19742
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
19483
|
-
const vendorDir =
|
|
19743
|
+
const vendorDir = join35(buildDir, "vue", "vendor");
|
|
19484
19744
|
mkdirSync10(vendorDir, { recursive: true });
|
|
19485
|
-
const tmpDir =
|
|
19745
|
+
const tmpDir = join35(buildDir, "_vue_vendor_tmp");
|
|
19486
19746
|
mkdirSync10(tmpDir, { recursive: true });
|
|
19487
19747
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
19488
19748
|
const safeName = toSafeFileName3(specifier);
|
|
19489
|
-
const entryPath =
|
|
19749
|
+
const entryPath = join35(tmpDir, `${safeName}.ts`);
|
|
19490
19750
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
19491
19751
|
`);
|
|
19492
19752
|
return entryPath;
|
|
@@ -19514,7 +19774,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
19514
19774
|
const { readFileSync: readFileSync23, writeFileSync: writeFileSync9, readdirSync: readdirSync5 } = await import("fs");
|
|
19515
19775
|
const files = readdirSync5(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
19516
19776
|
for (const file5 of files) {
|
|
19517
|
-
const filePath =
|
|
19777
|
+
const filePath = join35(vendorDir, file5);
|
|
19518
19778
|
const content = readFileSync23(filePath, "utf-8");
|
|
19519
19779
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
19520
19780
|
continue;
|
|
@@ -19541,7 +19801,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
19541
19801
|
buildSvelteVendor: () => buildSvelteVendor
|
|
19542
19802
|
});
|
|
19543
19803
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
19544
|
-
import { join as
|
|
19804
|
+
import { join as join36 } from "path";
|
|
19545
19805
|
import { rm as rm8 } from "fs/promises";
|
|
19546
19806
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
19547
19807
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -19555,13 +19815,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
19555
19815
|
const specifiers = resolveVendorSpecifiers();
|
|
19556
19816
|
if (specifiers.length === 0)
|
|
19557
19817
|
return;
|
|
19558
|
-
const vendorDir =
|
|
19818
|
+
const vendorDir = join36(buildDir, "svelte", "vendor");
|
|
19559
19819
|
mkdirSync11(vendorDir, { recursive: true });
|
|
19560
|
-
const tmpDir =
|
|
19820
|
+
const tmpDir = join36(buildDir, "_svelte_vendor_tmp");
|
|
19561
19821
|
mkdirSync11(tmpDir, { recursive: true });
|
|
19562
19822
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
19563
19823
|
const safeName = toSafeFileName4(specifier);
|
|
19564
|
-
const entryPath =
|
|
19824
|
+
const entryPath = join36(tmpDir, `${safeName}.ts`);
|
|
19565
19825
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
19566
19826
|
`);
|
|
19567
19827
|
return entryPath;
|
|
@@ -19599,185 +19859,6 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
19599
19859
|
];
|
|
19600
19860
|
});
|
|
19601
19861
|
|
|
19602
|
-
// src/build/rewriteImportsPlugin.ts
|
|
19603
|
-
var exports_rewriteImportsPlugin = {};
|
|
19604
|
-
__export(exports_rewriteImportsPlugin, {
|
|
19605
|
-
rewriteVendorDirectories: () => rewriteVendorDirectories,
|
|
19606
|
-
rewriteImportsInContent: () => rewriteImportsInContent,
|
|
19607
|
-
rewriteBuildOutputsWith: () => rewriteBuildOutputsWith,
|
|
19608
|
-
rewriteBuildOutputs: () => rewriteBuildOutputs,
|
|
19609
|
-
jsRewriteImports: () => jsRewriteImports,
|
|
19610
|
-
fixMissingReExportNamespacesInContent: () => fixMissingReExportNamespacesInContent,
|
|
19611
|
-
buildWithImportRewrite: () => buildWithImportRewrite
|
|
19612
|
-
});
|
|
19613
|
-
import { readdir as readdir3 } from "fs/promises";
|
|
19614
|
-
import { join as join35 } from "path";
|
|
19615
|
-
var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewriteImports = (content, replacements) => {
|
|
19616
|
-
let result = content;
|
|
19617
|
-
for (const [specifier, webPath] of replacements) {
|
|
19618
|
-
const escaped = escapeRegex2(specifier);
|
|
19619
|
-
const fromRegex = new RegExp(`(from\\s*["'])${escaped}(["'])`, "g");
|
|
19620
|
-
const sideEffectRegex = new RegExp(`(import\\s*["'])${escaped}(["'])`, "g");
|
|
19621
|
-
const dynamicRegex = new RegExp(`(import\\s*\\(\\s*["'])${escaped}(["']\\s*\\))`, "g");
|
|
19622
|
-
result = result.replace(fromRegex, `$1${webPath}$2`);
|
|
19623
|
-
result = result.replace(sideEffectRegex, `$1${webPath}$2`);
|
|
19624
|
-
result = result.replace(dynamicRegex, `$1${webPath}$2`);
|
|
19625
|
-
}
|
|
19626
|
-
return result;
|
|
19627
|
-
}, rewriteImportsInContent = (content, vendorPaths) => {
|
|
19628
|
-
if (Object.keys(vendorPaths).length === 0)
|
|
19629
|
-
return content;
|
|
19630
|
-
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
19631
|
-
const native = nativeRewriteImports(content, replacements);
|
|
19632
|
-
return native ?? jsRewriteImports(content, replacements);
|
|
19633
|
-
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
19634
|
-
const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
|
|
19635
|
-
REEXPORT_PATTERN.lastIndex = 0;
|
|
19636
|
-
const missing = [];
|
|
19637
|
-
let match;
|
|
19638
|
-
while ((match = REEXPORT_PATTERN.exec(content)) !== null) {
|
|
19639
|
-
const ident = match[1];
|
|
19640
|
-
if (!ident)
|
|
19641
|
-
continue;
|
|
19642
|
-
const nsImportRe = new RegExp(`\\bimport\\s*\\*\\s*as\\s+${ident}\\s+from\\b`);
|
|
19643
|
-
if (nsImportRe.test(content))
|
|
19644
|
-
continue;
|
|
19645
|
-
const declRe = new RegExp(`\\b(?:const|let|var|function|class)\\s+${ident}\\b`);
|
|
19646
|
-
if (declRe.test(content))
|
|
19647
|
-
continue;
|
|
19648
|
-
const namedImportRe = new RegExp(`\\bimport\\s*\\{[^}]*\\b${ident}\\b[^}]*\\}\\s*from\\b`);
|
|
19649
|
-
if (namedImportRe.test(content))
|
|
19650
|
-
continue;
|
|
19651
|
-
const importPathRe = /(?:from\s+|import\s*)["']([^"']+)["']/g;
|
|
19652
|
-
let pathMatch;
|
|
19653
|
-
let sourcePath;
|
|
19654
|
-
while ((pathMatch = importPathRe.exec(content)) !== null) {
|
|
19655
|
-
const p2 = pathMatch[1];
|
|
19656
|
-
if (!p2)
|
|
19657
|
-
continue;
|
|
19658
|
-
const base = p2.split("/").pop()?.replace(/\.[mc]?js$/, "");
|
|
19659
|
-
if (!base)
|
|
19660
|
-
continue;
|
|
19661
|
-
const normalized = base.startsWith("_") ? base.slice(1) : base;
|
|
19662
|
-
if (normalized === ident || normalized.endsWith(`_${ident}`)) {
|
|
19663
|
-
sourcePath = p2;
|
|
19664
|
-
break;
|
|
19665
|
-
}
|
|
19666
|
-
}
|
|
19667
|
-
if (sourcePath)
|
|
19668
|
-
missing.push({ ident, path: sourcePath });
|
|
19669
|
-
}
|
|
19670
|
-
if (missing.length === 0)
|
|
19671
|
-
return content;
|
|
19672
|
-
const seen = new Set;
|
|
19673
|
-
const unique = missing.filter((entry) => {
|
|
19674
|
-
if (seen.has(entry.ident))
|
|
19675
|
-
return false;
|
|
19676
|
-
seen.add(entry.ident);
|
|
19677
|
-
return true;
|
|
19678
|
-
});
|
|
19679
|
-
const inserts = unique.map((entry) => `import * as ${entry.ident} from "${entry.path}";`).join(`
|
|
19680
|
-
`);
|
|
19681
|
-
return `${inserts}
|
|
19682
|
-
${content}`;
|
|
19683
|
-
}, isReadableArtifact = (artifact) => artifact.path.endsWith(".js"), rewriteBuildOutputs = async (outputs, vendorPaths) => {
|
|
19684
|
-
if (Object.keys(vendorPaths).length === 0)
|
|
19685
|
-
return;
|
|
19686
|
-
await Promise.all(outputs.filter(isReadableArtifact).map(async (artifact) => {
|
|
19687
|
-
let original;
|
|
19688
|
-
try {
|
|
19689
|
-
original = await artifact.text();
|
|
19690
|
-
} catch (err) {
|
|
19691
|
-
const code = err.code;
|
|
19692
|
-
if (code === "ENOENT")
|
|
19693
|
-
return;
|
|
19694
|
-
throw err;
|
|
19695
|
-
}
|
|
19696
|
-
const rewritten = rewriteImportsInContent(original, vendorPaths);
|
|
19697
|
-
if (rewritten === original)
|
|
19698
|
-
return;
|
|
19699
|
-
try {
|
|
19700
|
-
await Bun.write(artifact.path, rewritten);
|
|
19701
|
-
} catch (err) {
|
|
19702
|
-
const code = err.code;
|
|
19703
|
-
if (code === "ENOENT")
|
|
19704
|
-
return;
|
|
19705
|
-
throw err;
|
|
19706
|
-
}
|
|
19707
|
-
}));
|
|
19708
|
-
}, rewriteBuildOutputsWith = async (outputs, resolveVendorPaths) => {
|
|
19709
|
-
await Promise.all(outputs.filter(isReadableArtifact).map(async (artifact) => {
|
|
19710
|
-
const vendorPaths = resolveVendorPaths(artifact);
|
|
19711
|
-
if (Object.keys(vendorPaths).length === 0)
|
|
19712
|
-
return;
|
|
19713
|
-
let original;
|
|
19714
|
-
try {
|
|
19715
|
-
original = await artifact.text();
|
|
19716
|
-
} catch (err) {
|
|
19717
|
-
const code = err.code;
|
|
19718
|
-
if (code === "ENOENT")
|
|
19719
|
-
return;
|
|
19720
|
-
throw err;
|
|
19721
|
-
}
|
|
19722
|
-
const rewritten = rewriteImportsInContent(original, vendorPaths);
|
|
19723
|
-
if (rewritten === original)
|
|
19724
|
-
return;
|
|
19725
|
-
try {
|
|
19726
|
-
await Bun.write(artifact.path, rewritten);
|
|
19727
|
-
} catch (err) {
|
|
19728
|
-
const code = err.code;
|
|
19729
|
-
if (code === "ENOENT")
|
|
19730
|
-
return;
|
|
19731
|
-
throw err;
|
|
19732
|
-
}
|
|
19733
|
-
}));
|
|
19734
|
-
}, rewriteVendorDirectories = async (vendorDirs, vendorPaths) => {
|
|
19735
|
-
if (Object.keys(vendorPaths).length === 0)
|
|
19736
|
-
return;
|
|
19737
|
-
const allFiles = [];
|
|
19738
|
-
for (const dir of vendorDirs) {
|
|
19739
|
-
try {
|
|
19740
|
-
const entries = await readdir3(dir);
|
|
19741
|
-
for (const entry of entries) {
|
|
19742
|
-
if (entry.endsWith(".js"))
|
|
19743
|
-
allFiles.push(join35(dir, entry));
|
|
19744
|
-
}
|
|
19745
|
-
} catch {}
|
|
19746
|
-
}
|
|
19747
|
-
await Promise.all(allFiles.map(async (filePath) => {
|
|
19748
|
-
let original;
|
|
19749
|
-
try {
|
|
19750
|
-
original = await Bun.file(filePath).text();
|
|
19751
|
-
} catch (err) {
|
|
19752
|
-
const code = err.code;
|
|
19753
|
-
if (code === "ENOENT")
|
|
19754
|
-
return;
|
|
19755
|
-
throw err;
|
|
19756
|
-
}
|
|
19757
|
-
let next = rewriteImportsInContent(original, vendorPaths);
|
|
19758
|
-
next = fixMissingReExportNamespacesInContent(next);
|
|
19759
|
-
if (next === original)
|
|
19760
|
-
return;
|
|
19761
|
-
try {
|
|
19762
|
-
await Bun.write(filePath, next);
|
|
19763
|
-
} catch (err) {
|
|
19764
|
-
const code = err.code;
|
|
19765
|
-
if (code === "ENOENT")
|
|
19766
|
-
return;
|
|
19767
|
-
throw err;
|
|
19768
|
-
}
|
|
19769
|
-
}));
|
|
19770
|
-
}, buildWithImportRewrite = async (pendingBuild, vendorPaths) => {
|
|
19771
|
-
const result = await pendingBuild;
|
|
19772
|
-
if (result.outputs.length > 0) {
|
|
19773
|
-
await rewriteBuildOutputs(result.outputs, vendorPaths);
|
|
19774
|
-
}
|
|
19775
|
-
return result;
|
|
19776
|
-
};
|
|
19777
|
-
var init_rewriteImportsPlugin = __esm(() => {
|
|
19778
|
-
init_nativeRewrite();
|
|
19779
|
-
});
|
|
19780
|
-
|
|
19781
19862
|
// src/core/build.ts
|
|
19782
19863
|
import {
|
|
19783
19864
|
copyFileSync as copyFileSync2,
|
|
@@ -19789,7 +19870,7 @@ import {
|
|
|
19789
19870
|
statSync as statSync3,
|
|
19790
19871
|
writeFileSync as writeFileSync9
|
|
19791
19872
|
} from "fs";
|
|
19792
|
-
import { basename as basename12, dirname as
|
|
19873
|
+
import { basename as basename12, dirname as dirname20, extname as extname8, join as join37, relative as relative14, resolve as resolve28 } from "path";
|
|
19793
19874
|
import { cwd, env as env3, exit } from "process";
|
|
19794
19875
|
var {
|
|
19795
19876
|
build: bunBuild7,
|
|
@@ -19870,8 +19951,8 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19870
19951
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
19871
19952
|
const glob = new Glob8("htmx*.min.js");
|
|
19872
19953
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
19873
|
-
const src =
|
|
19874
|
-
const dest =
|
|
19954
|
+
const src = join37(htmxDir, relPath);
|
|
19955
|
+
const dest = join37(htmxDestDir, "htmx.min.js");
|
|
19875
19956
|
copyFileSync2(src, dest);
|
|
19876
19957
|
return;
|
|
19877
19958
|
}
|
|
@@ -19946,7 +20027,7 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19946
20027
|
vuePagesPath
|
|
19947
20028
|
}) => {
|
|
19948
20029
|
const { readdirSync: readDir } = await import("fs");
|
|
19949
|
-
const devIndexDir =
|
|
20030
|
+
const devIndexDir = join37(buildPath, "_src_indexes");
|
|
19950
20031
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
19951
20032
|
if (reactIndexesPath && reactPagesPath) {
|
|
19952
20033
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -19962,37 +20043,37 @@ var isDev2, isBuildTraceEnabled = () => {
|
|
|
19962
20043
|
return;
|
|
19963
20044
|
}
|
|
19964
20045
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
19965
|
-
const pagesRel =
|
|
20046
|
+
const pagesRel = relative14(process.cwd(), resolve28(reactPagesPath)).replace(/\\/g, "/");
|
|
19966
20047
|
for (const file5 of indexFiles) {
|
|
19967
|
-
let content = readFileSync23(
|
|
20048
|
+
let content = readFileSync23(join37(reactIndexesPath, file5), "utf-8");
|
|
19968
20049
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
19969
|
-
writeFileSync9(
|
|
20050
|
+
writeFileSync9(join37(devIndexDir, file5), content);
|
|
19970
20051
|
}
|
|
19971
20052
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
19972
|
-
const svelteIndexDir =
|
|
20053
|
+
const svelteIndexDir = join37(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
19973
20054
|
const sveltePageEntries = svelteEntries.filter((file5) => resolve28(file5).startsWith(resolve28(sveltePagesPath)));
|
|
19974
20055
|
for (const entry of sveltePageEntries) {
|
|
19975
20056
|
const name = basename12(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
19976
|
-
const indexFile =
|
|
20057
|
+
const indexFile = join37(svelteIndexDir, "pages", `${name}.js`);
|
|
19977
20058
|
if (!existsSync28(indexFile))
|
|
19978
20059
|
continue;
|
|
19979
20060
|
let content = readFileSync23(indexFile, "utf-8");
|
|
19980
|
-
const srcRel =
|
|
20061
|
+
const srcRel = relative14(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
19981
20062
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
19982
|
-
writeFileSync9(
|
|
20063
|
+
writeFileSync9(join37(devIndexDir, `${name}.svelte.js`), content);
|
|
19983
20064
|
}
|
|
19984
20065
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
19985
|
-
const vueIndexDir =
|
|
20066
|
+
const vueIndexDir = join37(getFrameworkGeneratedDir("vue"), "indexes");
|
|
19986
20067
|
const vuePageEntries = vueEntries.filter((file5) => resolve28(file5).startsWith(resolve28(vuePagesPath)));
|
|
19987
20068
|
for (const entry of vuePageEntries) {
|
|
19988
20069
|
const name = basename12(entry, ".vue");
|
|
19989
|
-
const indexFile =
|
|
20070
|
+
const indexFile = join37(vueIndexDir, `${name}.js`);
|
|
19990
20071
|
if (!existsSync28(indexFile))
|
|
19991
20072
|
continue;
|
|
19992
20073
|
let content = readFileSync23(indexFile, "utf-8");
|
|
19993
|
-
const srcRel =
|
|
20074
|
+
const srcRel = relative14(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
|
|
19994
20075
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
19995
|
-
writeFileSync9(
|
|
20076
|
+
writeFileSync9(join37(devIndexDir, `${name}.vue.js`), content);
|
|
19996
20077
|
}
|
|
19997
20078
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
19998
20079
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -20065,7 +20146,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20065
20146
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
20066
20147
|
const urlFileMap = new Map;
|
|
20067
20148
|
for (const srcPath of urlReferencedFiles) {
|
|
20068
|
-
const rel =
|
|
20149
|
+
const rel = relative14(projectRoot, srcPath).replace(/\\/g, "/");
|
|
20069
20150
|
const name = basename12(srcPath);
|
|
20070
20151
|
const mtime = Math.round(statSync3(srcPath).mtimeMs);
|
|
20071
20152
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -20080,7 +20161,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20080
20161
|
const output = nonReactClientOutputs.find((artifact) => basename12(artifact.path).startsWith(`${srcBase}.`));
|
|
20081
20162
|
if (!output)
|
|
20082
20163
|
continue;
|
|
20083
|
-
urlFileMap.set(basename12(srcPath), `/${
|
|
20164
|
+
urlFileMap.set(basename12(srcPath), `/${relative14(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
20084
20165
|
}
|
|
20085
20166
|
return urlFileMap;
|
|
20086
20167
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -20215,10 +20296,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20215
20296
|
restoreTracePhase();
|
|
20216
20297
|
return;
|
|
20217
20298
|
}
|
|
20218
|
-
const traceDir =
|
|
20299
|
+
const traceDir = join37(buildPath2, ".absolute-trace");
|
|
20219
20300
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
20220
20301
|
mkdirSync12(traceDir, { recursive: true });
|
|
20221
|
-
writeFileSync9(
|
|
20302
|
+
writeFileSync9(join37(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
20222
20303
|
events: traceEvents,
|
|
20223
20304
|
frameworks: traceFrameworkNames,
|
|
20224
20305
|
generatedAt: new Date().toISOString(),
|
|
@@ -20249,15 +20330,15 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20249
20330
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
20250
20331
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
20251
20332
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
20252
|
-
const reactIndexesPath = reactDir &&
|
|
20253
|
-
const reactPagesPath = reactDir &&
|
|
20254
|
-
const htmlPagesPath = htmlDir &&
|
|
20255
|
-
const htmlScriptsPath = htmlDir &&
|
|
20256
|
-
const sveltePagesPath = svelteDir &&
|
|
20257
|
-
const vuePagesPath = vueDir &&
|
|
20258
|
-
const htmxPagesPath = htmxDir &&
|
|
20259
|
-
const angularPagesPath = angularDir &&
|
|
20260
|
-
const emberPagesPath = emberDir &&
|
|
20333
|
+
const reactIndexesPath = reactDir && join37(getFrameworkGeneratedDir("react"), "indexes");
|
|
20334
|
+
const reactPagesPath = reactDir && join37(reactDir, "pages");
|
|
20335
|
+
const htmlPagesPath = htmlDir && join37(htmlDir, "pages");
|
|
20336
|
+
const htmlScriptsPath = htmlDir && join37(htmlDir, "scripts");
|
|
20337
|
+
const sveltePagesPath = svelteDir && join37(svelteDir, "pages");
|
|
20338
|
+
const vuePagesPath = vueDir && join37(vueDir, "pages");
|
|
20339
|
+
const htmxPagesPath = htmxDir && join37(htmxDir, "pages");
|
|
20340
|
+
const angularPagesPath = angularDir && join37(angularDir, "pages");
|
|
20341
|
+
const emberPagesPath = emberDir && join37(emberDir, "pages");
|
|
20261
20342
|
const frontends = [
|
|
20262
20343
|
reactDir,
|
|
20263
20344
|
htmlDir,
|
|
@@ -20288,7 +20369,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20288
20369
|
const sourceClientRoots = [
|
|
20289
20370
|
htmlDir,
|
|
20290
20371
|
htmxDir,
|
|
20291
|
-
islandBootstrapPath &&
|
|
20372
|
+
islandBootstrapPath && dirname20(islandBootstrapPath)
|
|
20292
20373
|
].filter((dir) => Boolean(dir));
|
|
20293
20374
|
const usesGenerated = Boolean(reactDir) || Boolean(svelteDir) || Boolean(vueDir) || Boolean(angularDir);
|
|
20294
20375
|
if (usesGenerated)
|
|
@@ -20316,8 +20397,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20316
20397
|
const [firstEntry] = serverDirMap;
|
|
20317
20398
|
if (!firstEntry)
|
|
20318
20399
|
throw new Error("Expected at least one server directory entry");
|
|
20319
|
-
serverRoot =
|
|
20320
|
-
serverOutDir =
|
|
20400
|
+
serverRoot = join37(firstEntry.dir, firstEntry.subdir);
|
|
20401
|
+
serverOutDir = join37(buildPath, basename12(firstEntry.dir));
|
|
20321
20402
|
} else if (serverDirMap.length > 1) {
|
|
20322
20403
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
20323
20404
|
serverOutDir = buildPath;
|
|
@@ -20345,7 +20426,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20345
20426
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
20346
20427
|
}
|
|
20347
20428
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
20348
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
20429
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join37(buildPath, "assets"), {
|
|
20349
20430
|
force: true,
|
|
20350
20431
|
recursive: true
|
|
20351
20432
|
}));
|
|
@@ -20455,11 +20536,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20455
20536
|
}
|
|
20456
20537
|
}
|
|
20457
20538
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
20458
|
-
const htmlConventionsOutDir =
|
|
20539
|
+
const htmlConventionsOutDir = join37(buildPath, "conventions", "html");
|
|
20459
20540
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
20460
20541
|
const htmlPathRemap = new Map;
|
|
20461
20542
|
for (const sourcePath of htmlConventionSources) {
|
|
20462
|
-
const dest =
|
|
20543
|
+
const dest = join37(htmlConventionsOutDir, basename12(sourcePath));
|
|
20463
20544
|
cpSync(sourcePath, dest, { force: true });
|
|
20464
20545
|
htmlPathRemap.set(sourcePath, dest);
|
|
20465
20546
|
}
|
|
@@ -20502,7 +20583,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20502
20583
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
20503
20584
|
if (entry.startsWith(resolve28(reactIndexesPath))) {
|
|
20504
20585
|
const pageName = basename12(entry, ".tsx");
|
|
20505
|
-
return
|
|
20586
|
+
return join37(reactPagesPath, `${pageName}.tsx`);
|
|
20506
20587
|
}
|
|
20507
20588
|
return null;
|
|
20508
20589
|
}) : allReactEntries;
|
|
@@ -20621,14 +20702,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20621
20702
|
try {
|
|
20622
20703
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
20623
20704
|
const { readdir: readdir4 } = await import("fs/promises");
|
|
20624
|
-
const { join:
|
|
20705
|
+
const { join: join38 } = await import("path");
|
|
20625
20706
|
const walk = async (dir) => {
|
|
20626
20707
|
const entries = await readdir4(dir, {
|
|
20627
20708
|
withFileTypes: true
|
|
20628
20709
|
});
|
|
20629
20710
|
const out = [];
|
|
20630
20711
|
for (const entry of entries) {
|
|
20631
|
-
const full =
|
|
20712
|
+
const full = join38(dir, entry.name);
|
|
20632
20713
|
if (entry.isDirectory()) {
|
|
20633
20714
|
out.push(...await walk(full));
|
|
20634
20715
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -20693,7 +20774,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20693
20774
|
const compileReactConventions = async () => {
|
|
20694
20775
|
if (reactConventionSources.length === 0)
|
|
20695
20776
|
return emptyStringArray;
|
|
20696
|
-
const destDir =
|
|
20777
|
+
const destDir = join37(buildPath, "conventions", "react");
|
|
20697
20778
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20698
20779
|
mkdirSync12(destDir, { recursive: true });
|
|
20699
20780
|
const destPaths = [];
|
|
@@ -20709,7 +20790,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20709
20790
|
naming: `${idx}-[name].[ext]`,
|
|
20710
20791
|
outdir: destDir,
|
|
20711
20792
|
plugins: [stylePreprocessorPlugin2],
|
|
20712
|
-
root:
|
|
20793
|
+
root: dirname20(source),
|
|
20713
20794
|
target: "bun",
|
|
20714
20795
|
throw: false,
|
|
20715
20796
|
tsconfig: "./tsconfig.json"
|
|
@@ -20737,7 +20818,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20737
20818
|
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 }
|
|
20738
20819
|
]);
|
|
20739
20820
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
20740
|
-
const destDir =
|
|
20821
|
+
const destDir = join37(buildPath, "conventions", framework);
|
|
20741
20822
|
rmSync2(destDir, { force: true, recursive: true });
|
|
20742
20823
|
mkdirSync12(destDir, { recursive: true });
|
|
20743
20824
|
const destPaths = [];
|
|
@@ -20811,7 +20892,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20811
20892
|
}
|
|
20812
20893
|
})) : {
|
|
20813
20894
|
entries: [],
|
|
20814
|
-
generatedRoot:
|
|
20895
|
+
generatedRoot: join37(buildPath, "_island_entries")
|
|
20815
20896
|
};
|
|
20816
20897
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
20817
20898
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -20847,7 +20928,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20847
20928
|
return {};
|
|
20848
20929
|
}
|
|
20849
20930
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
20850
|
-
const refreshEntry =
|
|
20931
|
+
const refreshEntry = join37(reactIndexesPath, "_refresh.tsx");
|
|
20851
20932
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
20852
20933
|
reactClientEntryPoints.push(refreshEntry);
|
|
20853
20934
|
}
|
|
@@ -20983,19 +21064,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
20983
21064
|
throw: false
|
|
20984
21065
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
20985
21066
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
20986
|
-
rmSync2(
|
|
21067
|
+
rmSync2(join37(buildPath, "react", "generated", "indexes"), {
|
|
20987
21068
|
force: true,
|
|
20988
21069
|
recursive: true
|
|
20989
21070
|
});
|
|
20990
21071
|
}
|
|
20991
21072
|
if (angularDir && angularClientPaths.length > 0) {
|
|
20992
|
-
rmSync2(
|
|
21073
|
+
rmSync2(join37(buildPath, "angular", "indexes"), {
|
|
20993
21074
|
force: true,
|
|
20994
21075
|
recursive: true
|
|
20995
21076
|
});
|
|
20996
21077
|
}
|
|
20997
21078
|
if (islandClientEntryPoints.length > 0) {
|
|
20998
|
-
rmSync2(
|
|
21079
|
+
rmSync2(join37(buildPath, "islands"), {
|
|
20999
21080
|
force: true,
|
|
21000
21081
|
recursive: true
|
|
21001
21082
|
});
|
|
@@ -21087,7 +21168,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21087
21168
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
21088
21169
|
entrypoints: globalCssEntries,
|
|
21089
21170
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
21090
|
-
outdir: stylesDir ?
|
|
21171
|
+
outdir: stylesDir ? join37(buildPath, basename12(stylesDir)) : buildPath,
|
|
21091
21172
|
plugins: [stylePreprocessorPlugin2],
|
|
21092
21173
|
root: stylesDir || clientRoot,
|
|
21093
21174
|
target: "browser",
|
|
@@ -21096,7 +21177,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21096
21177
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
21097
21178
|
entrypoints: vueCssPaths,
|
|
21098
21179
|
naming: `[name].[hash].[ext]`,
|
|
21099
|
-
outdir:
|
|
21180
|
+
outdir: join37(buildPath, assetsPath ? basename12(assetsPath) : "assets", "css"),
|
|
21100
21181
|
target: "browser",
|
|
21101
21182
|
throw: false
|
|
21102
21183
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -21170,10 +21251,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21170
21251
|
if (serverOutputs.length > 0 && angularServerVendorPaths2 && Object.keys(angularServerVendorPaths2).length > 0) {
|
|
21171
21252
|
const { rewriteBuildOutputsWith: rewriteBuildOutputsWith2 } = await Promise.resolve().then(() => (init_rewriteImportsPlugin(), exports_rewriteImportsPlugin));
|
|
21172
21253
|
await tracePhase("postprocess/server-angular-vendor-imports", () => rewriteBuildOutputsWith2(serverOutputs, (artifact) => {
|
|
21173
|
-
const fileDir =
|
|
21254
|
+
const fileDir = dirname20(artifact.path);
|
|
21174
21255
|
const relativePaths = {};
|
|
21175
21256
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
21176
|
-
const rel =
|
|
21257
|
+
const rel = relative14(fileDir, absolute);
|
|
21177
21258
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
21178
21259
|
}
|
|
21179
21260
|
return relativePaths;
|
|
@@ -21278,7 +21359,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21278
21359
|
const parentArtifact = serverJsByPascalName.get(parentName);
|
|
21279
21360
|
if (!parentArtifact)
|
|
21280
21361
|
return;
|
|
21281
|
-
const sourceDir =
|
|
21362
|
+
const sourceDir = dirname20(source);
|
|
21282
21363
|
const entries = routes.flatMap(({ path, importPath }) => {
|
|
21283
21364
|
const childSourcePath = resolve28(sourceDir, importPath);
|
|
21284
21365
|
const childName = basename12(childSourcePath, ".vue");
|
|
@@ -21303,7 +21384,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21303
21384
|
if (skipAngularClientBundle) {
|
|
21304
21385
|
for (const clientPath of angularClientPaths) {
|
|
21305
21386
|
const fileBase = basename12(clientPath, ".js");
|
|
21306
|
-
const relFromCwd =
|
|
21387
|
+
const relFromCwd = relative14(projectRoot, clientPath).replace(/\\/g, "/");
|
|
21307
21388
|
manifest[`${toPascal(fileBase)}Index`] = `/@src/${relFromCwd}`;
|
|
21308
21389
|
}
|
|
21309
21390
|
}
|
|
@@ -21328,7 +21409,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21328
21409
|
const processHtmlPages = async () => {
|
|
21329
21410
|
if (!(htmlDir && htmlPagesPath))
|
|
21330
21411
|
return;
|
|
21331
|
-
const outputHtmlPages = isSingle ?
|
|
21412
|
+
const outputHtmlPages = isSingle ? join37(buildPath, "pages") : join37(buildPath, basename12(htmlDir), "pages");
|
|
21332
21413
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
21333
21414
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
21334
21415
|
force: true,
|
|
@@ -21353,14 +21434,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21353
21434
|
const processHtmxPages = async () => {
|
|
21354
21435
|
if (!(htmxDir && htmxPagesPath))
|
|
21355
21436
|
return;
|
|
21356
|
-
const outputHtmxPages = isSingle ?
|
|
21437
|
+
const outputHtmxPages = isSingle ? join37(buildPath, "pages") : join37(buildPath, basename12(htmxDir), "pages");
|
|
21357
21438
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
21358
21439
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
21359
21440
|
force: true,
|
|
21360
21441
|
recursive: true
|
|
21361
21442
|
});
|
|
21362
21443
|
if (shouldCopyHtmx) {
|
|
21363
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
21444
|
+
const htmxDestDir = isSingle ? buildPath : join37(buildPath, basename12(htmxDir));
|
|
21364
21445
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
21365
21446
|
}
|
|
21366
21447
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -21427,9 +21508,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
21427
21508
|
writeBuildTrace(buildPath);
|
|
21428
21509
|
return { conventions: conventionsMap, manifest };
|
|
21429
21510
|
}
|
|
21430
|
-
writeFileSync9(
|
|
21511
|
+
writeFileSync9(join37(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
21431
21512
|
if (Object.keys(conventionsMap).length > 0) {
|
|
21432
|
-
writeFileSync9(
|
|
21513
|
+
writeFileSync9(join37(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
21433
21514
|
}
|
|
21434
21515
|
writeBuildTrace(buildPath);
|
|
21435
21516
|
if (mode === "production") {
|
|
@@ -21552,7 +21633,7 @@ var init_build = __esm(() => {
|
|
|
21552
21633
|
|
|
21553
21634
|
// src/build/buildEmberVendor.ts
|
|
21554
21635
|
import { mkdirSync as mkdirSync13, existsSync as existsSync29 } from "fs";
|
|
21555
|
-
import { join as
|
|
21636
|
+
import { join as join38 } from "path";
|
|
21556
21637
|
import { rm as rm9 } from "fs/promises";
|
|
21557
21638
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
21558
21639
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -21604,7 +21685,7 @@ export const importSync = (specifier) => {
|
|
|
21604
21685
|
if (standaloneSpecifiers.has(specifier)) {
|
|
21605
21686
|
return { resolveTo: specifier, specifier };
|
|
21606
21687
|
}
|
|
21607
|
-
const emberInternalPath =
|
|
21688
|
+
const emberInternalPath = join38(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
21608
21689
|
if (!existsSync29(emberInternalPath)) {
|
|
21609
21690
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
21610
21691
|
}
|
|
@@ -21636,7 +21717,7 @@ export const importSync = (specifier) => {
|
|
|
21636
21717
|
if (standalonePackages.has(args.path)) {
|
|
21637
21718
|
return;
|
|
21638
21719
|
}
|
|
21639
|
-
const internal =
|
|
21720
|
+
const internal = join38(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21640
21721
|
if (existsSync29(internal)) {
|
|
21641
21722
|
return { path: internal };
|
|
21642
21723
|
}
|
|
@@ -21644,16 +21725,16 @@ export const importSync = (specifier) => {
|
|
|
21644
21725
|
});
|
|
21645
21726
|
}
|
|
21646
21727
|
}), buildEmberVendor = async (buildDir, cwd2 = process.cwd()) => {
|
|
21647
|
-
const vendorDir =
|
|
21728
|
+
const vendorDir = join38(buildDir, "ember", "vendor");
|
|
21648
21729
|
mkdirSync13(vendorDir, { recursive: true });
|
|
21649
|
-
const tmpDir =
|
|
21730
|
+
const tmpDir = join38(buildDir, "_ember_vendor_tmp");
|
|
21650
21731
|
mkdirSync13(tmpDir, { recursive: true });
|
|
21651
|
-
const macrosShimPath =
|
|
21732
|
+
const macrosShimPath = join38(tmpDir, "embroider_macros_shim.js");
|
|
21652
21733
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
21653
21734
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd2));
|
|
21654
21735
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
21655
21736
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
21656
|
-
const entryPath =
|
|
21737
|
+
const entryPath = join38(tmpDir, `${safeName}.js`);
|
|
21657
21738
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
21658
21739
|
` : generateVendorEntrySource2(resolution);
|
|
21659
21740
|
await Bun.write(entryPath, source);
|
|
@@ -22029,7 +22110,7 @@ var init_clientManager = __esm(() => {
|
|
|
22029
22110
|
|
|
22030
22111
|
// src/dev/pathUtils.ts
|
|
22031
22112
|
import { existsSync as existsSync31, readdirSync as readdirSync5, readFileSync as readFileSync25 } from "fs";
|
|
22032
|
-
import { dirname as
|
|
22113
|
+
import { dirname as dirname21, resolve as resolve31 } from "path";
|
|
22033
22114
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
22034
22115
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
22035
22116
|
return "ignored";
|
|
@@ -22157,10 +22238,10 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
22157
22238
|
refs.push(strMatch[1]);
|
|
22158
22239
|
}
|
|
22159
22240
|
}
|
|
22160
|
-
const componentDir =
|
|
22241
|
+
const componentDir = dirname21(full);
|
|
22161
22242
|
for (const ref of refs) {
|
|
22162
22243
|
const refAbs = normalizePath(resolve31(componentDir, ref));
|
|
22163
|
-
const refDir = normalizePath(
|
|
22244
|
+
const refDir = normalizePath(dirname21(refAbs));
|
|
22164
22245
|
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
22165
22246
|
continue;
|
|
22166
22247
|
}
|
|
@@ -22288,7 +22369,7 @@ var init_pathUtils = __esm(() => {
|
|
|
22288
22369
|
// src/dev/fileWatcher.ts
|
|
22289
22370
|
import { watch } from "fs";
|
|
22290
22371
|
import { existsSync as existsSync32, readdirSync as readdirSync6, statSync as statSync4 } from "fs";
|
|
22291
|
-
import { dirname as
|
|
22372
|
+
import { dirname as dirname22, join as join39, resolve as resolve32 } from "path";
|
|
22292
22373
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
22293
22374
|
try {
|
|
22294
22375
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -22321,7 +22402,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22321
22402
|
for (const name of entries) {
|
|
22322
22403
|
if (shouldSkipFilename(name, isStylesDir))
|
|
22323
22404
|
continue;
|
|
22324
|
-
const child =
|
|
22405
|
+
const child = join39(eventDir, name).replace(/\\/g, "/");
|
|
22325
22406
|
let st2;
|
|
22326
22407
|
try {
|
|
22327
22408
|
st2 = statSync4(child);
|
|
@@ -22346,12 +22427,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
22346
22427
|
return;
|
|
22347
22428
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
22348
22429
|
if (event === "rename") {
|
|
22349
|
-
const eventDir =
|
|
22430
|
+
const eventDir = dirname22(join39(absolutePath, filename)).replace(/\\/g, "/");
|
|
22350
22431
|
atomicRecoveryScan(eventDir);
|
|
22351
22432
|
}
|
|
22352
22433
|
return;
|
|
22353
22434
|
}
|
|
22354
|
-
const fullPath =
|
|
22435
|
+
const fullPath = join39(absolutePath, filename).replace(/\\/g, "/");
|
|
22355
22436
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
22356
22437
|
return;
|
|
22357
22438
|
}
|
|
@@ -22721,7 +22802,7 @@ __export(exports_resolveOwningComponents, {
|
|
|
22721
22802
|
invalidateResourceIndex: () => invalidateResourceIndex
|
|
22722
22803
|
});
|
|
22723
22804
|
import { readdirSync as readdirSync7, readFileSync as readFileSync27, statSync as statSync5 } from "fs";
|
|
22724
|
-
import { dirname as
|
|
22805
|
+
import { dirname as dirname23, extname as extname9, join as join40, resolve as resolve36 } from "path";
|
|
22725
22806
|
import ts16 from "typescript";
|
|
22726
22807
|
var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
22727
22808
|
const out = [];
|
|
@@ -22736,7 +22817,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22736
22817
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
22737
22818
|
continue;
|
|
22738
22819
|
}
|
|
22739
|
-
const full =
|
|
22820
|
+
const full = join40(dir, entry.name);
|
|
22740
22821
|
if (entry.isDirectory()) {
|
|
22741
22822
|
visit(full);
|
|
22742
22823
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -22875,7 +22956,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22875
22956
|
return null;
|
|
22876
22957
|
}
|
|
22877
22958
|
const sf = ts16.createSourceFile(childFilePath, source, ts16.ScriptTarget.ES2022, true, ts16.ScriptKind.TS);
|
|
22878
|
-
const childDir =
|
|
22959
|
+
const childDir = dirname23(childFilePath);
|
|
22879
22960
|
for (const stmt of sf.statements) {
|
|
22880
22961
|
if (!ts16.isImportDeclaration(stmt))
|
|
22881
22962
|
continue;
|
|
@@ -22932,7 +23013,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
22932
23013
|
const parentFile = new Map;
|
|
22933
23014
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
22934
23015
|
const classes = parseDecoratedClasses(tsPath);
|
|
22935
|
-
const componentDir =
|
|
23016
|
+
const componentDir = dirname23(tsPath);
|
|
22936
23017
|
for (const cls of classes) {
|
|
22937
23018
|
const entity = {
|
|
22938
23019
|
className: cls.className,
|
|
@@ -23109,8 +23190,8 @@ __export(exports_moduleServer, {
|
|
|
23109
23190
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
23110
23191
|
});
|
|
23111
23192
|
import { existsSync as existsSync33, readFileSync as readFileSync28, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
23112
|
-
import { basename as basename14, dirname as
|
|
23113
|
-
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
23193
|
+
import { basename as basename14, dirname as dirname24, extname as extname10, join as join41, resolve as resolve37, relative as relative15 } from "path";
|
|
23194
|
+
var SRC_PREFIX = "/@src/", jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
23114
23195
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
23115
23196
|
const allExports = [];
|
|
23116
23197
|
let match;
|
|
@@ -23162,11 +23243,11 @@ ${stubs}
|
|
|
23162
23243
|
}
|
|
23163
23244
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
23164
23245
|
const absPath = resolve37(fileDir, relPath);
|
|
23165
|
-
const rel =
|
|
23246
|
+
const rel = relative15(projectRoot, absPath);
|
|
23166
23247
|
const extension = extname10(rel);
|
|
23167
23248
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
23168
23249
|
if (extname10(srcPath) === ".svelte") {
|
|
23169
|
-
srcPath =
|
|
23250
|
+
srcPath = relative15(projectRoot, resolveSvelteModulePath(resolve37(projectRoot, srcPath)));
|
|
23170
23251
|
}
|
|
23171
23252
|
return srcUrl(srcPath, projectRoot);
|
|
23172
23253
|
}, NODE_BUILTIN_RE, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -23178,7 +23259,7 @@ ${stubs}
|
|
|
23178
23259
|
"import"
|
|
23179
23260
|
]);
|
|
23180
23261
|
if (fromExports)
|
|
23181
|
-
return
|
|
23262
|
+
return relative15(projectRoot, fromExports);
|
|
23182
23263
|
try {
|
|
23183
23264
|
const isScoped = specifier.startsWith("@");
|
|
23184
23265
|
const parts = specifier.split("/");
|
|
@@ -23186,19 +23267,19 @@ ${stubs}
|
|
|
23186
23267
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
23187
23268
|
if (!subpath) {
|
|
23188
23269
|
const pkgDir = resolve37(projectRoot, "node_modules", packageName ?? "");
|
|
23189
|
-
const pkgJsonPath =
|
|
23270
|
+
const pkgJsonPath = join41(pkgDir, "package.json");
|
|
23190
23271
|
if (existsSync33(pkgJsonPath)) {
|
|
23191
23272
|
const pkg = JSON.parse(readFileSync28(pkgJsonPath, "utf-8"));
|
|
23192
23273
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
23193
23274
|
if (esmEntry) {
|
|
23194
23275
|
const resolved = resolve37(pkgDir, esmEntry);
|
|
23195
23276
|
if (existsSync33(resolved))
|
|
23196
|
-
return
|
|
23277
|
+
return relative15(projectRoot, resolved);
|
|
23197
23278
|
}
|
|
23198
23279
|
}
|
|
23199
23280
|
}
|
|
23200
23281
|
} catch {}
|
|
23201
|
-
return
|
|
23282
|
+
return relative15(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
23202
23283
|
} catch {
|
|
23203
23284
|
return;
|
|
23204
23285
|
}
|
|
@@ -23223,28 +23304,28 @@ ${stubs}
|
|
|
23223
23304
|
};
|
|
23224
23305
|
result = result.replace(/^((?:import\s+[^"'`;]+?\s+from|export\s+[^"'`;]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
23225
23306
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
23226
|
-
const fileDir =
|
|
23307
|
+
const fileDir = dirname24(filePath);
|
|
23227
23308
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
23228
23309
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
23229
23310
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
23230
23311
|
const rewriteAbsoluteToSrc = (_match, prefix, absPath, _ext, suffix) => {
|
|
23231
23312
|
if (absPath.startsWith(projectRoot)) {
|
|
23232
|
-
const rel2 =
|
|
23313
|
+
const rel2 = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
23233
23314
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
23234
23315
|
}
|
|
23235
|
-
const rel =
|
|
23316
|
+
const rel = relative15(projectRoot, absPath).replace(/\\/g, "/");
|
|
23236
23317
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
23237
23318
|
};
|
|
23238
23319
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, rewriteAbsoluteToSrc);
|
|
23239
23320
|
result = result.replace(/(import\s*\(\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["']\s*\))/g, rewriteAbsoluteToSrc);
|
|
23240
23321
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
23241
23322
|
const absPath = resolve37(fileDir, relPath);
|
|
23242
|
-
const rel =
|
|
23323
|
+
const rel = relative15(projectRoot, absPath);
|
|
23243
23324
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
23244
23325
|
});
|
|
23245
23326
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
23246
23327
|
const absPath = resolve37(fileDir, relPath);
|
|
23247
|
-
const rel =
|
|
23328
|
+
const rel = relative15(projectRoot, absPath);
|
|
23248
23329
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
23249
23330
|
});
|
|
23250
23331
|
return result;
|
|
@@ -23300,7 +23381,7 @@ ${code}`;
|
|
|
23300
23381
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
23301
23382
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
23302
23383
|
${transpiled}`;
|
|
23303
|
-
const relPath =
|
|
23384
|
+
const relPath = relative15(projectRoot, filePath).replace(/\\/g, "/");
|
|
23304
23385
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
23305
23386
|
transpiled += buildIslandMetadataExports(raw);
|
|
23306
23387
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
@@ -23461,11 +23542,11 @@ ${code}`;
|
|
|
23461
23542
|
if (compiled.css?.code) {
|
|
23462
23543
|
const cssPath = `${filePath}.css`;
|
|
23463
23544
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
23464
|
-
const cssUrl = srcUrl(
|
|
23545
|
+
const cssUrl = srcUrl(relative15(projectRoot, cssPath), projectRoot);
|
|
23465
23546
|
code = `import "${cssUrl}";
|
|
23466
23547
|
${code}`;
|
|
23467
23548
|
}
|
|
23468
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
23549
|
+
const moduleUrl = `${SRC_PREFIX}${relative15(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
23469
23550
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
23470
23551
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
23471
23552
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -23566,7 +23647,7 @@ ${code}`;
|
|
|
23566
23647
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
23567
23648
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
23568
23649
|
const hmrBase = vueDir ? resolve37(vueDir) : projectRoot;
|
|
23569
|
-
const hmrId =
|
|
23650
|
+
const hmrId = relative15(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
23570
23651
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
23571
23652
|
result += [
|
|
23572
23653
|
"",
|
|
@@ -23912,13 +23993,21 @@ var init_moduleServer = __esm(() => {
|
|
|
23912
23993
|
loader: "js",
|
|
23913
23994
|
trimUnusedImports: true
|
|
23914
23995
|
});
|
|
23996
|
+
legacyDecoratorTsconfig = JSON.stringify({
|
|
23997
|
+
compilerOptions: {
|
|
23998
|
+
emitDecoratorMetadata: true,
|
|
23999
|
+
experimentalDecorators: true
|
|
24000
|
+
}
|
|
24001
|
+
});
|
|
23915
24002
|
tsTranspiler2 = new Bun.Transpiler({
|
|
23916
24003
|
loader: "ts",
|
|
23917
|
-
trimUnusedImports: true
|
|
24004
|
+
trimUnusedImports: true,
|
|
24005
|
+
tsconfig: legacyDecoratorTsconfig
|
|
23918
24006
|
});
|
|
23919
24007
|
tsxTranspiler = new Bun.Transpiler({
|
|
23920
24008
|
loader: "tsx",
|
|
23921
|
-
trimUnusedImports: true
|
|
24009
|
+
trimUnusedImports: true,
|
|
24010
|
+
tsconfig: legacyDecoratorTsconfig
|
|
23922
24011
|
});
|
|
23923
24012
|
TRANSPILABLE = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs"]);
|
|
23924
24013
|
ALL_EXPORTS_RE = /export\s+(?:type|interface|const|let|var|function|class|enum|abstract\s+class)\s+(\w+)/g;
|
|
@@ -23977,6 +24066,9 @@ export function __legacyMetadataTS(k, v) {
|
|
|
23977
24066
|
return Reflect.metadata(k, v);
|
|
23978
24067
|
}
|
|
23979
24068
|
}
|
|
24069
|
+
export function __legacyDecorateParamTS(paramIndex, decorator) {
|
|
24070
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
24071
|
+
}
|
|
23980
24072
|
`.trim();
|
|
23981
24073
|
SRC_IMPORT_RE = /\/@src\/([^"'?\s]+)/g;
|
|
23982
24074
|
SRC_URL_PREFIX = SRC_PREFIX;
|
|
@@ -24028,7 +24120,7 @@ __export(exports_hmrCompiler, {
|
|
|
24028
24120
|
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
24029
24121
|
encodeHmrComponentId: () => encodeHmrComponentId
|
|
24030
24122
|
});
|
|
24031
|
-
import { dirname as
|
|
24123
|
+
import { dirname as dirname25, relative as relative16, resolve as resolve38 } from "path";
|
|
24032
24124
|
import { performance as performance2 } from "perf_hooks";
|
|
24033
24125
|
var getApplyMetadataModule = async (encodedId) => {
|
|
24034
24126
|
const decoded = decodeURIComponent(encodedId);
|
|
@@ -24038,7 +24130,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
24038
24130
|
const filePathRel = decoded.slice(0, at2);
|
|
24039
24131
|
const className = decoded.slice(at2 + 1);
|
|
24040
24132
|
const componentFilePath = resolve38(process.cwd(), filePathRel);
|
|
24041
|
-
const projectRelPath =
|
|
24133
|
+
const projectRelPath = relative16(process.cwd(), componentFilePath).replace(/\\/g, "/");
|
|
24042
24134
|
const cacheKey2 = encodeURIComponent(`${projectRelPath}@${className}`);
|
|
24043
24135
|
const { takePendingModule: takePendingModule2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
24044
24136
|
const cached = takePendingModule2(cacheKey2);
|
|
@@ -24048,7 +24140,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
24048
24140
|
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
24049
24141
|
const owners = resolveOwningComponents2({
|
|
24050
24142
|
changedFilePath: componentFilePath,
|
|
24051
|
-
userAngularRoot:
|
|
24143
|
+
userAngularRoot: dirname25(componentFilePath)
|
|
24052
24144
|
});
|
|
24053
24145
|
const owner = owners.find((o3) => o3.className === className);
|
|
24054
24146
|
const kind = owner?.kind ?? "component";
|
|
@@ -24060,7 +24152,7 @@ var getApplyMetadataModule = async (encodedId) => {
|
|
|
24060
24152
|
}
|
|
24061
24153
|
return null;
|
|
24062
24154
|
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
24063
|
-
const projectRel =
|
|
24155
|
+
const projectRel = relative16(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
24064
24156
|
return `${projectRel}@${className}`;
|
|
24065
24157
|
};
|
|
24066
24158
|
var init_hmrCompiler = __esm(() => {
|
|
@@ -24256,7 +24348,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
24256
24348
|
|
|
24257
24349
|
// src/dev/rebuildTrigger.ts
|
|
24258
24350
|
import { existsSync as existsSync34, rmSync as rmSync3 } from "fs";
|
|
24259
|
-
import { basename as basename15, dirname as
|
|
24351
|
+
import { basename as basename15, dirname as dirname26, join as join42, relative as relative17, resolve as resolve41, sep as sep4 } from "path";
|
|
24260
24352
|
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) => {
|
|
24261
24353
|
if (!config.tailwind)
|
|
24262
24354
|
return;
|
|
@@ -24373,8 +24465,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24373
24465
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
24374
24466
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd2);
|
|
24375
24467
|
for (const candidate of [
|
|
24376
|
-
|
|
24377
|
-
`${
|
|
24468
|
+
join42(generatedDir, relJs),
|
|
24469
|
+
`${join42(generatedDir, relJs)}.map`
|
|
24378
24470
|
]) {
|
|
24379
24471
|
try {
|
|
24380
24472
|
rmSync3(candidate, { force: true });
|
|
@@ -24578,15 +24670,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24578
24670
|
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
24579
24671
|
const buildDir = state.resolvedPaths.buildDir;
|
|
24580
24672
|
const destPath = resolve41(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
24581
|
-
const { mkdir:
|
|
24582
|
-
const { dirname:
|
|
24583
|
-
await
|
|
24673
|
+
const { mkdir: mkdir8, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
24674
|
+
const { dirname: dirname27 } = await import("path");
|
|
24675
|
+
await mkdir8(dirname27(destPath), { recursive: true });
|
|
24584
24676
|
await copyFile(absSource, destPath);
|
|
24585
24677
|
const bytes = await readFile6(destPath);
|
|
24586
24678
|
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
24587
24679
|
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
24588
24680
|
state.fileHashes.set(absSource, currentHash);
|
|
24589
|
-
logHmrUpdate(
|
|
24681
|
+
logHmrUpdate(relative17(process.cwd(), filePath));
|
|
24590
24682
|
broadcastToClients(state, {
|
|
24591
24683
|
data: {
|
|
24592
24684
|
framework: urlPrefix || "public",
|
|
@@ -24604,7 +24696,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24604
24696
|
return;
|
|
24605
24697
|
if (framework === "unknown") {
|
|
24606
24698
|
invalidate(resolve41(filePath));
|
|
24607
|
-
const relPath =
|
|
24699
|
+
const relPath = relative17(process.cwd(), filePath);
|
|
24608
24700
|
logHmrUpdate(relPath);
|
|
24609
24701
|
const angularDir = state.resolvedPaths.angularDir;
|
|
24610
24702
|
let hasAngularDependent = false;
|
|
@@ -24779,7 +24871,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
24779
24871
|
const keepByDir = new Map;
|
|
24780
24872
|
const prefixByDir = new Map;
|
|
24781
24873
|
for (const artifact of freshOutputs) {
|
|
24782
|
-
const dir =
|
|
24874
|
+
const dir = dirname26(artifact.path);
|
|
24783
24875
|
const name = basename15(artifact.path);
|
|
24784
24876
|
const [prefix] = name.split(".");
|
|
24785
24877
|
if (!prefix)
|
|
@@ -25192,7 +25284,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25192
25284
|
try {
|
|
25193
25285
|
const { invalidateModule: invalidateModule2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
25194
25286
|
for (const tsFile of tsFilesToRefresh) {
|
|
25195
|
-
const rel =
|
|
25287
|
+
const rel = relative17(angularDirAbs, tsFile).replace(/\\/g, "/").replace(/\.[tj]sx?$/, ".js");
|
|
25196
25288
|
const compiledFile = resolve41(compiledRoot, rel);
|
|
25197
25289
|
invalidateModule2(compiledFile);
|
|
25198
25290
|
}
|
|
@@ -25233,12 +25325,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25233
25325
|
try {
|
|
25234
25326
|
const { primeComponentFingerprint: primeComponentFingerprint2 } = await Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler));
|
|
25235
25327
|
const { readdir: readdir5 } = await import("fs/promises");
|
|
25236
|
-
const { join:
|
|
25328
|
+
const { join: join43 } = await import("path");
|
|
25237
25329
|
const walk = async (dir) => {
|
|
25238
25330
|
const entries = await readdir5(dir, { withFileTypes: true });
|
|
25239
25331
|
const files = [];
|
|
25240
25332
|
for (const entry of entries) {
|
|
25241
|
-
const full =
|
|
25333
|
+
const full = join43(dir, entry.name);
|
|
25242
25334
|
if (entry.isDirectory()) {
|
|
25243
25335
|
files.push(...await walk(full));
|
|
25244
25336
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -25338,7 +25430,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25338
25430
|
}, getModuleUrl = async (pageFile) => {
|
|
25339
25431
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
25340
25432
|
invalidateModule2(pageFile);
|
|
25341
|
-
const rel =
|
|
25433
|
+
const rel = relative17(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
25342
25434
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
25343
25435
|
warmCache2(url);
|
|
25344
25436
|
return url;
|
|
@@ -25369,7 +25461,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25369
25461
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
25370
25462
|
if (pageModuleUrl) {
|
|
25371
25463
|
const serverDuration = Date.now() - startTime;
|
|
25372
|
-
state.lastHmrPath =
|
|
25464
|
+
state.lastHmrPath = relative17(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
25373
25465
|
state.lastHmrFramework = "react";
|
|
25374
25466
|
broadcastToClients(state, {
|
|
25375
25467
|
data: {
|
|
@@ -25704,7 +25796,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25704
25796
|
const { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths } = await compileVue2(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
25705
25797
|
const serverEntries = [...vueServerPaths];
|
|
25706
25798
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
25707
|
-
const cssOutDir =
|
|
25799
|
+
const cssOutDir = join42(buildDir, state.resolvedPaths.assetsDir ? basename15(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
25708
25800
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
25709
25801
|
const [serverResult, clientResult, cssResult] = await Promise.all([
|
|
25710
25802
|
serverEntries.length > 0 ? bunBuild9({
|
|
@@ -25860,7 +25952,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25860
25952
|
const duration = Date.now() - startTime;
|
|
25861
25953
|
const [primary] = emberFiles;
|
|
25862
25954
|
if (primary) {
|
|
25863
|
-
state.lastHmrPath =
|
|
25955
|
+
state.lastHmrPath = relative17(process.cwd(), primary).replace(/\\/g, "/");
|
|
25864
25956
|
state.lastHmrFramework = "ember";
|
|
25865
25957
|
logHmrUpdate(primary, "ember", duration);
|
|
25866
25958
|
}
|
|
@@ -25945,7 +26037,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
25945
26037
|
if (!buildReference?.source) {
|
|
25946
26038
|
return;
|
|
25947
26039
|
}
|
|
25948
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve41(
|
|
26040
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve41(dirname26(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
25949
26041
|
islandFiles.add(resolve41(sourcePath));
|
|
25950
26042
|
}, resolveIslandSourceFiles = async (config) => {
|
|
25951
26043
|
const registryPath = config.islands?.registry;
|
|
@@ -26103,7 +26195,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
26103
26195
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
26104
26196
|
const pascalName = toPascal(baseName);
|
|
26105
26197
|
const vueRoot = config.vueDirectory;
|
|
26106
|
-
const hmrId = vueRoot ?
|
|
26198
|
+
const hmrId = vueRoot ? relative17(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
26107
26199
|
const cssKey = `${pascalName}CSS`;
|
|
26108
26200
|
const cssUrl = manifest[cssKey] || null;
|
|
26109
26201
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -26699,7 +26791,7 @@ __export(exports_buildDepVendor, {
|
|
|
26699
26791
|
buildDepVendor: () => buildDepVendor
|
|
26700
26792
|
});
|
|
26701
26793
|
import { mkdirSync as mkdirSync14 } from "fs";
|
|
26702
|
-
import { join as
|
|
26794
|
+
import { join as join43 } from "path";
|
|
26703
26795
|
import { rm as rm10 } from "fs/promises";
|
|
26704
26796
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
26705
26797
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -26810,7 +26902,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26810
26902
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
26811
26903
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
26812
26904
|
const safeName = toSafeFileName6(specifier);
|
|
26813
|
-
const entryPath =
|
|
26905
|
+
const entryPath = join43(tmpDir, `${safeName}.ts`);
|
|
26814
26906
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
26815
26907
|
return { entryPath, specifier };
|
|
26816
26908
|
}));
|
|
@@ -26871,9 +26963,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
26871
26963
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
26872
26964
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
26873
26965
|
return {};
|
|
26874
|
-
const vendorDir =
|
|
26966
|
+
const vendorDir = join43(buildDir, "vendor");
|
|
26875
26967
|
mkdirSync14(vendorDir, { recursive: true });
|
|
26876
|
-
const tmpDir =
|
|
26968
|
+
const tmpDir = join43(buildDir, "_dep_vendor_tmp");
|
|
26877
26969
|
mkdirSync14(tmpDir, { recursive: true });
|
|
26878
26970
|
const allSpecs = new Set(initialSpecs);
|
|
26879
26971
|
const alreadyScanned = new Set;
|
|
@@ -27574,12 +27666,12 @@ __export(exports_devtoolsJson, {
|
|
|
27574
27666
|
devtoolsJson: () => devtoolsJson
|
|
27575
27667
|
});
|
|
27576
27668
|
import { existsSync as existsSync35, mkdirSync as mkdirSync15, readFileSync as readFileSync29, writeFileSync as writeFileSync10 } from "fs";
|
|
27577
|
-
import { dirname as
|
|
27669
|
+
import { dirname as dirname27, join as join44, resolve as resolve43 } from "path";
|
|
27578
27670
|
import { Elysia as Elysia3 } from "elysia";
|
|
27579
27671
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
27580
27672
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
27581
27673
|
return uuid;
|
|
27582
|
-
}, 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) => resolve43(uuidCachePath ??
|
|
27674
|
+
}, 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) => resolve43(uuidCachePath ?? join44(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
27583
27675
|
if (!existsSync35(cachePath))
|
|
27584
27676
|
return null;
|
|
27585
27677
|
try {
|
|
@@ -27601,7 +27693,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
27601
27693
|
if (cachedUuid)
|
|
27602
27694
|
return setGlobalUuid(cachedUuid);
|
|
27603
27695
|
const uuid = crypto.randomUUID();
|
|
27604
|
-
mkdirSync15(
|
|
27696
|
+
mkdirSync15(dirname27(cachePath), { recursive: true });
|
|
27605
27697
|
writeFileSync10(cachePath, uuid, "utf-8");
|
|
27606
27698
|
return setGlobalUuid(uuid);
|
|
27607
27699
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
@@ -27618,11 +27710,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
27618
27710
|
if (process.env.WSL_DISTRO_NAME) {
|
|
27619
27711
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
27620
27712
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
27621
|
-
return
|
|
27713
|
+
return join44("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
27622
27714
|
}
|
|
27623
27715
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
27624
27716
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
27625
|
-
return
|
|
27717
|
+
return join44("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
27626
27718
|
}
|
|
27627
27719
|
return root;
|
|
27628
27720
|
};
|
|
@@ -27854,7 +27946,7 @@ __export(exports_prerender, {
|
|
|
27854
27946
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
27855
27947
|
});
|
|
27856
27948
|
import { mkdirSync as mkdirSync16, readFileSync as readFileSync30 } from "fs";
|
|
27857
|
-
import { join as
|
|
27949
|
+
import { join as join45 } from "path";
|
|
27858
27950
|
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) => {
|
|
27859
27951
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
27860
27952
|
await Bun.write(metaPath, String(Date.now()));
|
|
@@ -27920,7 +28012,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
27920
28012
|
return false;
|
|
27921
28013
|
const html = await res.text();
|
|
27922
28014
|
const fileName = routeToFilename(route);
|
|
27923
|
-
const filePath =
|
|
28015
|
+
const filePath = join45(prerenderDir, fileName);
|
|
27924
28016
|
await Bun.write(filePath, html);
|
|
27925
28017
|
await writeTimestamp(filePath);
|
|
27926
28018
|
return true;
|
|
@@ -27946,13 +28038,13 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
27946
28038
|
}
|
|
27947
28039
|
const html = await res.text();
|
|
27948
28040
|
const fileName = routeToFilename(route);
|
|
27949
|
-
const filePath =
|
|
28041
|
+
const filePath = join45(prerenderDir, fileName);
|
|
27950
28042
|
await Bun.write(filePath, html);
|
|
27951
28043
|
await writeTimestamp(filePath);
|
|
27952
28044
|
result.routes.set(route, filePath);
|
|
27953
28045
|
log2?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
27954
28046
|
}, prerender = async (port, outDir, staticConfig, log2) => {
|
|
27955
|
-
const prerenderDir =
|
|
28047
|
+
const prerenderDir = join45(outDir, "_prerendered");
|
|
27956
28048
|
mkdirSync16(prerenderDir, { recursive: true });
|
|
27957
28049
|
const baseUrl = `http://localhost:${port}`;
|
|
27958
28050
|
let routes;
|
|
@@ -28054,7 +28146,7 @@ __export(exports_serverEntryWatcher, {
|
|
|
28054
28146
|
});
|
|
28055
28147
|
import { existsSync as existsSync39, statSync as statSync8, watch as watch2 } from "fs";
|
|
28056
28148
|
import { createRequire as createRequire2 } from "module";
|
|
28057
|
-
import { dirname as
|
|
28149
|
+
import { dirname as dirname28, join as join49, resolve as resolve46 } from "path";
|
|
28058
28150
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || ATOMIC_WRITE_TEMP_PATTERNS2.some((re2) => re2.test(filename)), startServerEntryWatcher = () => {
|
|
28059
28151
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
28060
28152
|
return;
|
|
@@ -28063,10 +28155,10 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
28063
28155
|
return;
|
|
28064
28156
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
28065
28157
|
const entryPath = resolve46(main);
|
|
28066
|
-
const entryDir =
|
|
28158
|
+
const entryDir = dirname28(entryPath);
|
|
28067
28159
|
const entryBase = entryPath.slice(entryDir.length + 1);
|
|
28068
28160
|
const configPath2 = resolve46(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
28069
|
-
const configDir2 =
|
|
28161
|
+
const configDir2 = dirname28(configPath2);
|
|
28070
28162
|
const configBase = configPath2.slice(configDir2.length + 1);
|
|
28071
28163
|
const recentlyHandled = new Map;
|
|
28072
28164
|
let entryReloadTimer = null;
|
|
@@ -28157,7 +28249,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ATOMIC_WRITE_TEMP
|
|
|
28157
28249
|
continue;
|
|
28158
28250
|
let st2;
|
|
28159
28251
|
try {
|
|
28160
|
-
st2 = statSync8(
|
|
28252
|
+
st2 = statSync8(join49(dir, entry.name));
|
|
28161
28253
|
} catch {
|
|
28162
28254
|
continue;
|
|
28163
28255
|
}
|
|
@@ -28415,7 +28507,6 @@ init_staticIslandPages();
|
|
|
28415
28507
|
var {file } = globalThis.Bun;
|
|
28416
28508
|
|
|
28417
28509
|
// src/core/islandPageContext.ts
|
|
28418
|
-
init_constants();
|
|
28419
28510
|
var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient";
|
|
28420
28511
|
var ISLAND_MARKER = 'data-island="true"';
|
|
28421
28512
|
var MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__";
|
|
@@ -28536,61 +28627,69 @@ var pipeStreamWithHeadInjection = (stream, markup) => {
|
|
|
28536
28627
|
var pipeStreamWithIslandMarkerDetection = (stream, markup) => {
|
|
28537
28628
|
const encoder = new TextEncoder;
|
|
28538
28629
|
const decoder = new TextDecoder;
|
|
28539
|
-
const
|
|
28540
|
-
const
|
|
28541
|
-
if (
|
|
28542
|
-
controller.enqueue(encoder.encode(
|
|
28543
|
-
return { injected, pending: "" };
|
|
28630
|
+
const headLookbehind = CLOSING_HEAD_TAG2.length - 1;
|
|
28631
|
+
const enqueue = (controller, text) => {
|
|
28632
|
+
if (text.length > 0) {
|
|
28633
|
+
controller.enqueue(encoder.encode(text));
|
|
28544
28634
|
}
|
|
28545
|
-
|
|
28546
|
-
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
const next = `${pending.slice(0, injectAt)}${markup}${pending.slice(injectAt)}`;
|
|
28550
|
-
controller.enqueue(encoder.encode(next));
|
|
28551
|
-
return { injected: true, pending: "" };
|
|
28635
|
+
};
|
|
28636
|
+
const processHolding = (controller, held) => {
|
|
28637
|
+
if (!held.includes(ISLAND_MARKER)) {
|
|
28638
|
+
return { held, injected: false, pending: "", sawHead: true };
|
|
28552
28639
|
}
|
|
28553
|
-
|
|
28554
|
-
|
|
28555
|
-
pending: flushSafePendingText(controller, encoder, pending, lookbehind)
|
|
28556
|
-
};
|
|
28640
|
+
enqueue(controller, `${markup}${held}`);
|
|
28641
|
+
return { held: "", injected: true, pending: "", sawHead: true };
|
|
28557
28642
|
};
|
|
28558
|
-
const
|
|
28559
|
-
const
|
|
28560
|
-
if (
|
|
28561
|
-
|
|
28643
|
+
const processHead = (controller, pending) => {
|
|
28644
|
+
const headIndex = pending.indexOf(CLOSING_HEAD_TAG2);
|
|
28645
|
+
if (headIndex < 0) {
|
|
28646
|
+
return {
|
|
28647
|
+
held: "",
|
|
28648
|
+
injected: false,
|
|
28649
|
+
pending: flushSafePendingText(controller, encoder, pending, headLookbehind),
|
|
28650
|
+
sawHead: false
|
|
28651
|
+
};
|
|
28562
28652
|
}
|
|
28563
|
-
controller.
|
|
28653
|
+
enqueue(controller, pending.slice(0, headIndex));
|
|
28654
|
+
return processHolding(controller, pending.slice(headIndex));
|
|
28564
28655
|
};
|
|
28565
|
-
const
|
|
28566
|
-
|
|
28567
|
-
|
|
28568
|
-
return
|
|
28656
|
+
const processChunk = (controller, state, chunk) => {
|
|
28657
|
+
if (state.injected) {
|
|
28658
|
+
enqueue(controller, chunk);
|
|
28659
|
+
return state;
|
|
28569
28660
|
}
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28574
|
-
pending: processed.pending
|
|
28575
|
-
};
|
|
28661
|
+
if (!state.sawHead) {
|
|
28662
|
+
return processHead(controller, state.pending + chunk);
|
|
28663
|
+
}
|
|
28664
|
+
return processHolding(controller, state.held + chunk);
|
|
28576
28665
|
};
|
|
28577
|
-
const
|
|
28578
|
-
const
|
|
28579
|
-
|
|
28580
|
-
|
|
28581
|
-
|
|
28582
|
-
|
|
28666
|
+
const finishMarkerStream = (controller, state) => {
|
|
28667
|
+
const tail = decoder.decode();
|
|
28668
|
+
const remainder = state.injected ? tail : (state.sawHead ? state.held : state.pending) + tail;
|
|
28669
|
+
enqueue(controller, remainder);
|
|
28670
|
+
controller.close();
|
|
28671
|
+
};
|
|
28672
|
+
const runMarkerLoop = (controller, reader) => {
|
|
28673
|
+
const consumeNext = async (state) => {
|
|
28674
|
+
const { done, value } = await readStreamChunk(reader);
|
|
28675
|
+
if (done || !value) {
|
|
28676
|
+
return state;
|
|
28583
28677
|
}
|
|
28584
|
-
return
|
|
28678
|
+
return consumeNext(processChunk(controller, state, streamChunkToString2(value, decoder)));
|
|
28585
28679
|
};
|
|
28586
|
-
return
|
|
28680
|
+
return consumeNext({
|
|
28681
|
+
held: "",
|
|
28682
|
+
injected: false,
|
|
28683
|
+
pending: "",
|
|
28684
|
+
sawHead: false
|
|
28685
|
+
});
|
|
28587
28686
|
};
|
|
28588
28687
|
return new ReadableStream({
|
|
28589
28688
|
async start(controller) {
|
|
28590
28689
|
const reader = stream.getReader();
|
|
28591
28690
|
try {
|
|
28592
|
-
const
|
|
28593
|
-
|
|
28691
|
+
const finalState = await runMarkerLoop(controller, reader);
|
|
28692
|
+
finishMarkerStream(controller, finalState);
|
|
28594
28693
|
} catch (error) {
|
|
28595
28694
|
controller.error(error);
|
|
28596
28695
|
}
|
|
@@ -28713,12 +28812,12 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
28713
28812
|
// src/core/prepare.ts
|
|
28714
28813
|
init_loadConfig();
|
|
28715
28814
|
import { existsSync as existsSync37, readdirSync as readdirSync8, readFileSync as readFileSync31 } from "fs";
|
|
28716
|
-
import { basename as basename16, join as
|
|
28815
|
+
import { basename as basename16, join as join46, relative as relative18, resolve as resolve45 } from "path";
|
|
28717
28816
|
import { Elysia as Elysia5 } from "elysia";
|
|
28718
28817
|
|
|
28719
28818
|
// src/core/loadIslandRegistry.ts
|
|
28720
28819
|
init_islandEntries();
|
|
28721
|
-
import { resolve as
|
|
28820
|
+
import { resolve as resolve11 } from "path";
|
|
28722
28821
|
var isRecord6 = (value) => typeof value === "object" && value !== null;
|
|
28723
28822
|
var resolveRegistryExport2 = (mod) => {
|
|
28724
28823
|
if (isRecord6(mod.islandRegistry))
|
|
@@ -28730,7 +28829,7 @@ var resolveRegistryExport2 = (mod) => {
|
|
|
28730
28829
|
var isRegistryModuleExport = (value) => isRecord6(value);
|
|
28731
28830
|
var isIslandRegistryInput = (value) => isRecord6(value);
|
|
28732
28831
|
var loadIslandRegistry = async (registryPath) => {
|
|
28733
|
-
const resolvedRegistryPath =
|
|
28832
|
+
const resolvedRegistryPath = resolve11(registryPath);
|
|
28734
28833
|
const buildInfo = await loadIslandRegistryBuildInfo(resolvedRegistryPath);
|
|
28735
28834
|
if (buildInfo.definitions.length > 0) {
|
|
28736
28835
|
return buildInfo.registry;
|
|
@@ -29086,7 +29185,7 @@ var warmPrewarmDirs = async (prewarmDirs, warmCache2, SRC_URL_PREFIX2) => {
|
|
|
29086
29185
|
for (const file5 of files) {
|
|
29087
29186
|
if (file5.includes("/node_modules/"))
|
|
29088
29187
|
continue;
|
|
29089
|
-
const rel =
|
|
29188
|
+
const rel = relative18(process.cwd(), file5).replace(/\\/g, "/");
|
|
29090
29189
|
warmCache2(`${SRC_URL_PREFIX2}${rel}`);
|
|
29091
29190
|
}
|
|
29092
29191
|
};
|
|
@@ -29114,7 +29213,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
29114
29213
|
const srcPath = resolve45(devIndexDir, fileName);
|
|
29115
29214
|
if (!existsSync37(srcPath))
|
|
29116
29215
|
continue;
|
|
29117
|
-
const rel =
|
|
29216
|
+
const rel = relative18(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
29118
29217
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
29119
29218
|
}
|
|
29120
29219
|
};
|
|
@@ -29233,7 +29332,7 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
29233
29332
|
continue;
|
|
29234
29333
|
const name = basename16(entry, ".html");
|
|
29235
29334
|
const route = name === "index" ? "/" : `/${name}`;
|
|
29236
|
-
map.set(route,
|
|
29335
|
+
map.set(route, join46(prerenderDir, entry));
|
|
29237
29336
|
}
|
|
29238
29337
|
return map;
|
|
29239
29338
|
};
|
|
@@ -29293,7 +29392,7 @@ var prepare = async (configOrPath) => {
|
|
|
29293
29392
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
29294
29393
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
29295
29394
|
stepStartedAt = performance.now();
|
|
29296
|
-
const conventionsPath =
|
|
29395
|
+
const conventionsPath = join46(buildDir, "conventions.json");
|
|
29297
29396
|
if (existsSync37(conventionsPath)) {
|
|
29298
29397
|
const conventions2 = JSON.parse(readFileSync31(conventionsPath, "utf-8"));
|
|
29299
29398
|
setConventions(conventions2);
|
|
@@ -29307,12 +29406,12 @@ var prepare = async (configOrPath) => {
|
|
|
29307
29406
|
prefix: "",
|
|
29308
29407
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
29309
29408
|
});
|
|
29310
|
-
const generatedAssetsRoot =
|
|
29409
|
+
const generatedAssetsRoot = join46(buildDir, ".absolutejs");
|
|
29311
29410
|
const generatedAssetsPlugin = new Elysia5({
|
|
29312
29411
|
name: "absolutejs-generated-assets"
|
|
29313
29412
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
29314
29413
|
const requestedPath = resolve45(generatedAssetsRoot, params["*"]);
|
|
29315
|
-
if (
|
|
29414
|
+
if (relative18(generatedAssetsRoot, requestedPath).startsWith("..")) {
|
|
29316
29415
|
set.status = 404;
|
|
29317
29416
|
return "Not Found";
|
|
29318
29417
|
}
|
|
@@ -29326,7 +29425,7 @@ var prepare = async (configOrPath) => {
|
|
|
29326
29425
|
});
|
|
29327
29426
|
recordStep("create static plugin", stepStartedAt);
|
|
29328
29427
|
stepStartedAt = performance.now();
|
|
29329
|
-
const prerenderDir =
|
|
29428
|
+
const prerenderDir = join46(buildDir, "_prerendered");
|
|
29330
29429
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
29331
29430
|
recordStep("load prerender map", stepStartedAt);
|
|
29332
29431
|
if (prerenderMap.size > 0) {
|
|
@@ -29391,10 +29490,10 @@ import {
|
|
|
29391
29490
|
readFileSync as readFileSync32,
|
|
29392
29491
|
rmSync as rmSync4
|
|
29393
29492
|
} from "fs";
|
|
29394
|
-
import { join as
|
|
29395
|
-
var CERT_DIR =
|
|
29396
|
-
var CERT_PATH =
|
|
29397
|
-
var KEY_PATH =
|
|
29493
|
+
import { join as join47 } from "path";
|
|
29494
|
+
var CERT_DIR = join47(process.cwd(), ".absolutejs");
|
|
29495
|
+
var CERT_PATH = join47(CERT_DIR, "cert.pem");
|
|
29496
|
+
var KEY_PATH = join47(CERT_DIR, "key.pem");
|
|
29398
29497
|
var CERT_VALIDITY_DAYS = 365;
|
|
29399
29498
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
29400
29499
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
@@ -29514,12 +29613,12 @@ import {
|
|
|
29514
29613
|
writeFileSync as writeFileSync11
|
|
29515
29614
|
} from "fs";
|
|
29516
29615
|
import { homedir as homedir2 } from "os";
|
|
29517
|
-
import { basename as basename17, join as
|
|
29616
|
+
import { basename as basename17, join as join48 } from "path";
|
|
29518
29617
|
var registeredPids = new Set;
|
|
29519
29618
|
var exitHandlerRegistered = false;
|
|
29520
|
-
var instanceFilePath = (pid) =>
|
|
29521
|
-
var instanceLogPath = (pid) =>
|
|
29522
|
-
var instanceRegistryDir = () =>
|
|
29619
|
+
var instanceFilePath = (pid) => join48(instanceRegistryDir(), `${pid}.json`);
|
|
29620
|
+
var instanceLogPath = (pid) => join48(instanceRegistryDir(), `${pid}.log`);
|
|
29621
|
+
var instanceRegistryDir = () => join48(homedir2(), ".absolutejs", "instances");
|
|
29523
29622
|
var removeInstanceFilesSync = (pid) => {
|
|
29524
29623
|
try {
|
|
29525
29624
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -29554,7 +29653,7 @@ var registerInstance = (record) => {
|
|
|
29554
29653
|
return record;
|
|
29555
29654
|
};
|
|
29556
29655
|
var resolveProjectName = (cwd2) => {
|
|
29557
|
-
const parsed = readJsonFile(
|
|
29656
|
+
const parsed = readJsonFile(join48(cwd2, "package.json"));
|
|
29558
29657
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
29559
29658
|
return parsed.name;
|
|
29560
29659
|
}
|
|
@@ -35931,7 +36030,7 @@ var getEnv = (key) => {
|
|
|
35931
36030
|
};
|
|
35932
36031
|
// src/utils/projectRoot.ts
|
|
35933
36032
|
import { existsSync as existsSync41 } from "fs";
|
|
35934
|
-
import { dirname as
|
|
36033
|
+
import { dirname as dirname29, resolve as resolve48 } from "path";
|
|
35935
36034
|
var CONFIG_CANDIDATES = [
|
|
35936
36035
|
"absolute.config.ts",
|
|
35937
36036
|
"absolute.config.js",
|
|
@@ -35951,7 +36050,7 @@ var findProjectRoot = () => {
|
|
|
35951
36050
|
if (packageRoot === null && existsSync41(resolve48(dir, "package.json"))) {
|
|
35952
36051
|
packageRoot = dir;
|
|
35953
36052
|
}
|
|
35954
|
-
const parent =
|
|
36053
|
+
const parent = dirname29(dir);
|
|
35955
36054
|
if (parent === dir) {
|
|
35956
36055
|
return packageRoot ?? start;
|
|
35957
36056
|
}
|
|
@@ -36187,5 +36286,5 @@ export {
|
|
|
36187
36286
|
ANGULAR_INIT_TIMEOUT_MS
|
|
36188
36287
|
};
|
|
36189
36288
|
|
|
36190
|
-
//# debugId=
|
|
36289
|
+
//# debugId=C5D7127FA2204C7B64756E2164756E21
|
|
36191
36290
|
//# sourceMappingURL=index.js.map
|