@absolutejs/absolute 0.19.0-beta.690 → 0.19.0-beta.692
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/index.js +104 -103
- package/dist/angular/index.js.map +4 -4
- package/dist/angular/server.js +104 -103
- package/dist/angular/server.js.map +4 -4
- package/dist/build.js +258 -257
- package/dist/build.js.map +4 -4
- package/dist/index.js +299 -298
- package/dist/index.js.map +4 -4
- package/dist/islands/index.js +16 -36
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +16 -36
- package/dist/react/index.js.map +3 -3
- package/dist/svelte/index.js +21 -41
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +16 -36
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +16 -36
- package/dist/vue/index.js.map +3 -3
- package/package.json +7 -7
package/dist/angular/server.js
CHANGED
|
@@ -1352,10 +1352,10 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
1352
1352
|
});
|
|
1353
1353
|
|
|
1354
1354
|
// src/build/stylePreprocessor.ts
|
|
1355
|
-
import { readFileSync as readFileSync3 } from "fs";
|
|
1356
1355
|
import { readFile } from "fs/promises";
|
|
1357
|
-
import {
|
|
1358
|
-
|
|
1356
|
+
import { createRequire } from "module";
|
|
1357
|
+
import { dirname as dirname2, extname, join as join3 } from "path";
|
|
1358
|
+
var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
|
|
1359
1359
|
const normalized = filePathOrLanguage.toLowerCase();
|
|
1360
1360
|
if (normalized === "scss" || normalized.endsWith(".scss"))
|
|
1361
1361
|
return "scss";
|
|
@@ -1419,27 +1419,6 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
|
|
|
1419
1419
|
return readFile(filePath, "utf-8");
|
|
1420
1420
|
}
|
|
1421
1421
|
return compileStyleSource(filePath);
|
|
1422
|
-
}, compileStyleFileIfNeededSync = (filePath) => {
|
|
1423
|
-
const contents = readFileSync3(filePath, "utf-8");
|
|
1424
|
-
const language = getStyleLanguage(filePath);
|
|
1425
|
-
if (language === "scss" || language === "sass") {
|
|
1426
|
-
let sass;
|
|
1427
|
-
try {
|
|
1428
|
-
sass = requireOptionalPeer("sass");
|
|
1429
|
-
} catch {
|
|
1430
|
-
throw missingDependencyError("sass", filePath);
|
|
1431
|
-
}
|
|
1432
|
-
return sass.compileString(contents, {
|
|
1433
|
-
loadPaths: [dirname2(filePath), process.cwd()],
|
|
1434
|
-
style: "expanded",
|
|
1435
|
-
syntax: language === "sass" ? "indented" : "scss",
|
|
1436
|
-
url: new URL(`file://${filePath}`)
|
|
1437
|
-
}).css;
|
|
1438
|
-
}
|
|
1439
|
-
if (language === "less") {
|
|
1440
|
-
throw new Error(`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
|
|
1441
|
-
}
|
|
1442
|
-
return contents;
|
|
1443
1422
|
};
|
|
1444
1423
|
var init_stylePreprocessor = __esm(() => {
|
|
1445
1424
|
STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
|
|
@@ -1447,6 +1426,7 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
1447
1426
|
STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
|
|
1448
1427
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
1449
1428
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
1429
|
+
requireFromCwd = createRequire(join3(process.cwd(), "package.json"));
|
|
1450
1430
|
stylePreprocessorPlugin = {
|
|
1451
1431
|
name: "absolute-style-preprocessor",
|
|
1452
1432
|
setup(build) {
|
|
@@ -1485,13 +1465,13 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
1485
1465
|
|
|
1486
1466
|
// src/core/svelteServerModule.ts
|
|
1487
1467
|
import { mkdir, readdir } from "fs/promises";
|
|
1488
|
-
import { basename as basename2, dirname as dirname3, extname as extname2, join as
|
|
1468
|
+
import { basename as basename2, dirname as dirname3, extname as extname2, join as join4, relative, resolve as resolve4 } from "path";
|
|
1489
1469
|
var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
1490
1470
|
const importPath = relative(dirname3(from), target).replace(/\\/g, "/");
|
|
1491
1471
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
1492
1472
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
1493
1473
|
for (const entry of entries) {
|
|
1494
|
-
const entryPath =
|
|
1474
|
+
const entryPath = join4(dir, entry.name);
|
|
1495
1475
|
if (entry.isDirectory())
|
|
1496
1476
|
stack.push(entryPath);
|
|
1497
1477
|
if (entry.isFile() && entry.name === targetFileName) {
|
|
@@ -1521,11 +1501,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
1521
1501
|
if (cachedPath !== undefined) {
|
|
1522
1502
|
return cachedPath;
|
|
1523
1503
|
}
|
|
1524
|
-
if (!sourcePath.includes(`${
|
|
1504
|
+
if (!sourcePath.includes(`${join4(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
|
|
1525
1505
|
originalSourcePathCache.set(sourcePath, sourcePath);
|
|
1526
1506
|
return sourcePath;
|
|
1527
1507
|
}
|
|
1528
|
-
const resolvedSourcePath = await findSourceFileByBasename(
|
|
1508
|
+
const resolvedSourcePath = await findSourceFileByBasename(join4(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
|
|
1529
1509
|
const nextPath = resolvedSourcePath ?? sourcePath;
|
|
1530
1510
|
originalSourcePathCache.set(sourcePath, nextPath);
|
|
1531
1511
|
return nextPath;
|
|
@@ -1541,11 +1521,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
1541
1521
|
`${basePath}.mjs`,
|
|
1542
1522
|
`${basePath}.cjs`,
|
|
1543
1523
|
`${basePath}.json`,
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1524
|
+
join4(basePath, "index.ts"),
|
|
1525
|
+
join4(basePath, "index.js"),
|
|
1526
|
+
join4(basePath, "index.mjs"),
|
|
1527
|
+
join4(basePath, "index.cjs"),
|
|
1528
|
+
join4(basePath, "index.json")
|
|
1549
1529
|
];
|
|
1550
1530
|
const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
|
|
1551
1531
|
const foundIndex = existResults.indexOf(true);
|
|
@@ -1553,7 +1533,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
1553
1533
|
}, getCachedModulePath = (sourcePath) => {
|
|
1554
1534
|
const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
1555
1535
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
1556
|
-
return
|
|
1536
|
+
return join4(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
1557
1537
|
}, resolveSvelteImport = async (spec, from) => {
|
|
1558
1538
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
1559
1539
|
const resolved = resolvePackageImport(spec);
|
|
@@ -1654,7 +1634,7 @@ var init_svelteServerModule = __esm(() => {
|
|
|
1654
1634
|
init_lowerIslandSyntax();
|
|
1655
1635
|
init_lowerAwaitSlotSyntax();
|
|
1656
1636
|
init_stylePreprocessor();
|
|
1657
|
-
serverCacheRoot =
|
|
1637
|
+
serverCacheRoot = join4(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
1658
1638
|
compiledModuleCache = new Map;
|
|
1659
1639
|
originalSourcePathCache = new Map;
|
|
1660
1640
|
transpiler = new Bun.Transpiler({
|
|
@@ -3538,13 +3518,13 @@ __export(exports_compileAngular, {
|
|
|
3538
3518
|
compileAngularFile: () => compileAngularFile,
|
|
3539
3519
|
compileAngular: () => compileAngular
|
|
3540
3520
|
});
|
|
3541
|
-
import { existsSync as existsSync4, readFileSync as
|
|
3542
|
-
import { join as
|
|
3521
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3, promises as fs } from "fs";
|
|
3522
|
+
import { join as join5, basename as basename3, sep, dirname as dirname4, resolve as resolve5, relative as relative2 } from "path";
|
|
3543
3523
|
import ts from "typescript";
|
|
3544
3524
|
import { createHash } from "crypto";
|
|
3545
3525
|
var computeConfigHash = () => {
|
|
3546
3526
|
try {
|
|
3547
|
-
const content =
|
|
3527
|
+
const content = readFileSync3("./tsconfig.json", "utf-8");
|
|
3548
3528
|
return createHash("md5").update(content).digest("hex");
|
|
3549
3529
|
} catch {
|
|
3550
3530
|
return "";
|
|
@@ -3601,8 +3581,70 @@ ${registrations}
|
|
|
3601
3581
|
if (fileName.startsWith(outDir))
|
|
3602
3582
|
return fileName.substring(outDir.length + 1);
|
|
3603
3583
|
return fileName;
|
|
3584
|
+
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
3585
|
+
const sourceFile = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
3586
|
+
const specifiers = [];
|
|
3587
|
+
const addSpecifier = (node) => {
|
|
3588
|
+
if (!node || !ts.isStringLiteralLike(node))
|
|
3589
|
+
return;
|
|
3590
|
+
const specifier = node.text;
|
|
3591
|
+
if (isRelativeModuleSpecifier(specifier))
|
|
3592
|
+
specifiers.push(specifier);
|
|
3593
|
+
};
|
|
3594
|
+
const visit = (node) => {
|
|
3595
|
+
if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
|
|
3596
|
+
addSpecifier(node.moduleSpecifier);
|
|
3597
|
+
} else if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword) {
|
|
3598
|
+
addSpecifier(node.arguments[0]);
|
|
3599
|
+
}
|
|
3600
|
+
ts.forEachChild(node, visit);
|
|
3601
|
+
};
|
|
3602
|
+
visit(sourceFile);
|
|
3603
|
+
return specifiers;
|
|
3604
|
+
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
3605
|
+
if (!isRelativeModuleSpecifier(specifier))
|
|
3606
|
+
return null;
|
|
3607
|
+
const basePath = resolve5(dirname4(fromFile), specifier);
|
|
3608
|
+
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
3609
|
+
`${basePath}.ts`,
|
|
3610
|
+
`${basePath}.tsx`,
|
|
3611
|
+
`${basePath}.mts`,
|
|
3612
|
+
`${basePath}.cts`,
|
|
3613
|
+
join5(basePath, "index.ts"),
|
|
3614
|
+
join5(basePath, "index.tsx"),
|
|
3615
|
+
join5(basePath, "index.mts"),
|
|
3616
|
+
join5(basePath, "index.cts")
|
|
3617
|
+
];
|
|
3618
|
+
return candidates.map((candidate) => resolve5(candidate)).find((candidate) => existsSync4(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
3619
|
+
}, readFileForAotTransform = async (fileName, readFile2) => {
|
|
3620
|
+
const hostSource = readFile2?.(fileName);
|
|
3621
|
+
if (typeof hostSource === "string")
|
|
3622
|
+
return hostSource;
|
|
3623
|
+
return fs.readFile(fileName, "utf-8");
|
|
3624
|
+
}, precomputeAotResourceTransforms = async (inputPath, readFile2) => {
|
|
3625
|
+
const transformedSources = new Map;
|
|
3626
|
+
const visited = new Set;
|
|
3627
|
+
const transformFile = async (filePath) => {
|
|
3628
|
+
const resolvedPath = resolve5(filePath);
|
|
3629
|
+
if (visited.has(resolvedPath))
|
|
3630
|
+
return;
|
|
3631
|
+
visited.add(resolvedPath);
|
|
3632
|
+
if (!existsSync4(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
3633
|
+
return;
|
|
3634
|
+
const source = await readFileForAotTransform(resolvedPath, readFile2);
|
|
3635
|
+
const transformed = await inlineResources(source, dirname4(resolvedPath));
|
|
3636
|
+
transformedSources.set(resolvedPath, transformed.source);
|
|
3637
|
+
const imports = extractLocalImportSpecifiers(source, resolvedPath);
|
|
3638
|
+
await Promise.all(imports.map(async (specifier) => {
|
|
3639
|
+
const resolvedImport = resolveLocalTsImport(resolvedPath, specifier);
|
|
3640
|
+
if (resolvedImport)
|
|
3641
|
+
await transformFile(resolvedImport);
|
|
3642
|
+
}));
|
|
3643
|
+
};
|
|
3644
|
+
await transformFile(inputPath);
|
|
3645
|
+
return transformedSources;
|
|
3604
3646
|
}, compileAngularFile = async (inputPath, outDir) => {
|
|
3605
|
-
const islandMetadataExports = buildIslandMetadataExports(
|
|
3647
|
+
const islandMetadataExports = buildIslandMetadataExports(readFileSync3(inputPath, "utf-8"));
|
|
3606
3648
|
const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
|
|
3607
3649
|
const configHash = computeConfigHash();
|
|
3608
3650
|
const cached = globalThis.__angularCompilerCache;
|
|
@@ -3650,7 +3692,7 @@ ${registrations}
|
|
|
3650
3692
|
const originalGetSourceFile = host.getSourceFile;
|
|
3651
3693
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
3652
3694
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
3653
|
-
const resolvedPath =
|
|
3695
|
+
const resolvedPath = join5(tsLibDir, fileName);
|
|
3654
3696
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
3655
3697
|
}
|
|
3656
3698
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -3670,7 +3712,7 @@ ${registrations}
|
|
|
3670
3712
|
emitted[relativePath] = text;
|
|
3671
3713
|
};
|
|
3672
3714
|
const originalReadFile = host.readFile;
|
|
3673
|
-
const
|
|
3715
|
+
const aotTransformedSources = await precomputeAotResourceTransforms(inputPath, originalReadFile?.bind(host));
|
|
3674
3716
|
host.readFile = (fileName) => {
|
|
3675
3717
|
const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
|
|
3676
3718
|
if (typeof source !== "string")
|
|
@@ -3679,12 +3721,7 @@ ${registrations}
|
|
|
3679
3721
|
return source;
|
|
3680
3722
|
}
|
|
3681
3723
|
const resolvedPath = resolve5(fileName);
|
|
3682
|
-
|
|
3683
|
-
if (cached2 !== undefined)
|
|
3684
|
-
return cached2;
|
|
3685
|
-
const transformed = inlineResourcesSync(source, dirname4(resolvedPath)).source;
|
|
3686
|
-
aotTransformCache.set(resolvedPath, transformed);
|
|
3687
|
-
return transformed;
|
|
3724
|
+
return aotTransformedSources.get(resolvedPath) ?? source;
|
|
3688
3725
|
};
|
|
3689
3726
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
3690
3727
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
@@ -3708,7 +3745,7 @@ ${registrations}
|
|
|
3708
3745
|
}
|
|
3709
3746
|
throwOnCompilationErrors(diagnostics);
|
|
3710
3747
|
const entries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => {
|
|
3711
|
-
const target =
|
|
3748
|
+
const target = join5(outDir, fileName);
|
|
3712
3749
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
3713
3750
|
if (!path.match(/\.(js|ts|mjs|cjs)$/)) {
|
|
3714
3751
|
return `from ${quote}${path}.js${quote}`;
|
|
@@ -3864,7 +3901,7 @@ ${fields}
|
|
|
3864
3901
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
3865
3902
|
const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
3866
3903
|
if (templateUrlMatch?.[1]) {
|
|
3867
|
-
const templatePath =
|
|
3904
|
+
const templatePath = join5(fileDir, templateUrlMatch[1]);
|
|
3868
3905
|
if (!existsSync4(templatePath)) {
|
|
3869
3906
|
return { deferSlots: [], source };
|
|
3870
3907
|
}
|
|
@@ -3895,11 +3932,11 @@ ${fields}
|
|
|
3895
3932
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
3896
3933
|
const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
3897
3934
|
if (templateUrlMatch?.[1]) {
|
|
3898
|
-
const templatePath =
|
|
3935
|
+
const templatePath = join5(fileDir, templateUrlMatch[1]);
|
|
3899
3936
|
if (!existsSync4(templatePath)) {
|
|
3900
3937
|
return { deferSlots: [], source };
|
|
3901
3938
|
}
|
|
3902
|
-
const templateRaw2 =
|
|
3939
|
+
const templateRaw2 = readFileSync3(templatePath, "utf-8");
|
|
3903
3940
|
const lowered2 = lowerAngularDeferSyntax(templateRaw2);
|
|
3904
3941
|
const escaped2 = escapeTemplateContent(lowered2.template);
|
|
3905
3942
|
const replacedSource2 = source.replace(/templateUrl\s*:\s*['"][^'"]+['"]/, `template: \`${escaped2}\``);
|
|
@@ -3923,42 +3960,6 @@ ${fields}
|
|
|
3923
3960
|
deferSlots: lowered.slots,
|
|
3924
3961
|
source: injectDeferSlotFields(replacedSource, lowered.slots, resolveAngularDeferImportSpecifier())
|
|
3925
3962
|
};
|
|
3926
|
-
}, readAndEscapeFileSync = (filePath) => {
|
|
3927
|
-
if (!existsSync4(filePath))
|
|
3928
|
-
return null;
|
|
3929
|
-
const content = compileStyleFileIfNeededSync(filePath);
|
|
3930
|
-
return escapeTemplateContent(content);
|
|
3931
|
-
}, inlineStyleUrlsSync = (source, fileDir) => {
|
|
3932
|
-
const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
3933
|
-
if (!styleUrlsMatch?.[1])
|
|
3934
|
-
return source;
|
|
3935
|
-
const urlMatches = styleUrlsMatch[1].match(/['"]([^'"]+)['"]/g);
|
|
3936
|
-
if (!urlMatches)
|
|
3937
|
-
return source;
|
|
3938
|
-
const inlinedStyles = urlMatches.map((urlMatch) => {
|
|
3939
|
-
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
3940
|
-
return readAndEscapeFileSync(join4(fileDir, styleUrl));
|
|
3941
|
-
}).filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
3942
|
-
if (inlinedStyles.length === 0)
|
|
3943
|
-
return source;
|
|
3944
|
-
return source.replace(/styleUrls\s*:\s*\[[^\]]+\]/, `styles: [${inlinedStyles.join(", ")}]`);
|
|
3945
|
-
}, inlineSingleStyleUrlSync = (source, fileDir) => {
|
|
3946
|
-
const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
3947
|
-
if (!styleUrlMatch?.[1])
|
|
3948
|
-
return source;
|
|
3949
|
-
const escaped = readAndEscapeFileSync(join4(fileDir, styleUrlMatch[1]));
|
|
3950
|
-
if (!escaped)
|
|
3951
|
-
return source;
|
|
3952
|
-
return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
|
|
3953
|
-
}, inlineResourcesSync = (source, fileDir) => {
|
|
3954
|
-
const inlinedTemplate = inlineTemplateAndLowerDeferSync(source, fileDir);
|
|
3955
|
-
let result = inlinedTemplate.source;
|
|
3956
|
-
result = inlineStyleUrlsSync(result, fileDir);
|
|
3957
|
-
result = inlineSingleStyleUrlSync(result, fileDir);
|
|
3958
|
-
return {
|
|
3959
|
-
deferSlots: inlinedTemplate.deferSlots,
|
|
3960
|
-
source: result
|
|
3961
|
-
};
|
|
3962
3963
|
}, inlineStyleUrls = async (source, fileDir) => {
|
|
3963
3964
|
const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
3964
3965
|
if (!styleUrlsMatch?.[1])
|
|
@@ -3968,7 +3969,7 @@ ${fields}
|
|
|
3968
3969
|
return source;
|
|
3969
3970
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
3970
3971
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
3971
|
-
return readAndEscapeFile(
|
|
3972
|
+
return readAndEscapeFile(join5(fileDir, styleUrl));
|
|
3972
3973
|
});
|
|
3973
3974
|
const results = await Promise.all(stylePromises);
|
|
3974
3975
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -3979,7 +3980,7 @@ ${fields}
|
|
|
3979
3980
|
const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
3980
3981
|
if (!styleUrlMatch?.[1])
|
|
3981
3982
|
return source;
|
|
3982
|
-
const escaped = await readAndEscapeFile(
|
|
3983
|
+
const escaped = await readAndEscapeFile(join5(fileDir, styleUrlMatch[1]));
|
|
3983
3984
|
if (!escaped)
|
|
3984
3985
|
return source;
|
|
3985
3986
|
return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
|
|
@@ -4054,8 +4055,8 @@ ${fields}
|
|
|
4054
4055
|
const inputDir = dirname4(actualPath);
|
|
4055
4056
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
4056
4057
|
const fileBase = basename3(actualPath).replace(/\.ts$/, ".js");
|
|
4057
|
-
const targetDir =
|
|
4058
|
-
const targetPath =
|
|
4058
|
+
const targetDir = join5(outDir, relativeDir);
|
|
4059
|
+
const targetPath = join5(targetDir, fileBase);
|
|
4059
4060
|
const localImports = [];
|
|
4060
4061
|
const fromRegex = /(?:from|import)\s+['"](\.\.?\/[^'"]+)['"]/g;
|
|
4061
4062
|
const dynamicImportRegex = /import\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g;
|
|
@@ -4088,13 +4089,13 @@ ${fields}
|
|
|
4088
4089
|
await transpileFile(inputPath);
|
|
4089
4090
|
return allOutputs;
|
|
4090
4091
|
}, compileAngular = async (entryPoints, outRoot, hmr = false) => {
|
|
4091
|
-
const compiledParent =
|
|
4092
|
+
const compiledParent = join5(outRoot, "generated");
|
|
4092
4093
|
if (entryPoints.length === 0) {
|
|
4093
4094
|
const emptyPaths = [];
|
|
4094
4095
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
4095
4096
|
}
|
|
4096
4097
|
const compiledRoot = compiledParent;
|
|
4097
|
-
const indexesDir =
|
|
4098
|
+
const indexesDir = join5(compiledParent, "indexes");
|
|
4098
4099
|
await fs.mkdir(indexesDir, { recursive: true });
|
|
4099
4100
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
4100
4101
|
const resolvedEntry = resolve5(entry);
|
|
@@ -4104,9 +4105,9 @@ ${fields}
|
|
|
4104
4105
|
const fileBase = basename3(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
4105
4106
|
const jsName = `${fileBase}.js`;
|
|
4106
4107
|
const compiledFallbackPaths = [
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4108
|
+
join5(compiledRoot, relativeEntry),
|
|
4109
|
+
join5(compiledRoot, "pages", jsName),
|
|
4110
|
+
join5(compiledRoot, jsName)
|
|
4110
4111
|
].map((file) => resolve5(file));
|
|
4111
4112
|
const resolveRawServerFile = (candidatePaths) => {
|
|
4112
4113
|
const normalizedCandidates = [
|
|
@@ -4140,7 +4141,7 @@ ${fields}
|
|
|
4140
4141
|
const componentClassName = `${toPascal(fileBase)}Component`;
|
|
4141
4142
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
4142
4143
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
4143
|
-
const clientFile =
|
|
4144
|
+
const clientFile = join5(indexesDir, jsName);
|
|
4144
4145
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync4(clientFile)) {
|
|
4145
4146
|
return {
|
|
4146
4147
|
clientPath: clientFile,
|
|
@@ -4328,8 +4329,8 @@ var init_compileAngular = __esm(() => {
|
|
|
4328
4329
|
init_lowerDeferSyntax();
|
|
4329
4330
|
init_stylePreprocessor();
|
|
4330
4331
|
devClientDir = resolveDevClientDir();
|
|
4331
|
-
hmrClientPath =
|
|
4332
|
-
hmrRuntimePath =
|
|
4332
|
+
hmrClientPath = join5(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
4333
|
+
hmrRuntimePath = join5(devClientDir, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
|
|
4333
4334
|
jitContentCache = new Map;
|
|
4334
4335
|
wrapperOutputCache = new Map;
|
|
4335
4336
|
});
|
|
@@ -4338,15 +4339,15 @@ var init_compileAngular = __esm(() => {
|
|
|
4338
4339
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
4339
4340
|
import { mkdir as mkdir2, symlink } from "fs/promises";
|
|
4340
4341
|
import { tmpdir } from "os";
|
|
4341
|
-
import { basename as basename4, dirname as dirname5, join as
|
|
4342
|
+
import { basename as basename4, dirname as dirname5, join as join6, resolve as resolve6 } from "path";
|
|
4342
4343
|
var ssrDirty = false, lastSelector = "angular-page", isRecord5 = (value) => typeof value === "object" && value !== null, isAngularComponent = (value) => typeof value === "function", compilerImportPromise = null, ensureAngularCompiler = () => {
|
|
4343
4344
|
if (!compilerImportPromise) {
|
|
4344
4345
|
compilerImportPromise = import("@angular/compiler");
|
|
4345
4346
|
}
|
|
4346
4347
|
return compilerImportPromise;
|
|
4347
|
-
}, readAngularPageModule = (value) => isRecord5(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ??
|
|
4348
|
+
}, readAngularPageModule = (value) => isRecord5(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join6(tmpdir(), "absolutejs", "generated", "angular-ssr"), ensureAngularSsrNodeModules = async (outDir) => {
|
|
4348
4349
|
const outRoot = resolve6(dirname5(dirname5(outDir)));
|
|
4349
|
-
const nodeModulesLink =
|
|
4350
|
+
const nodeModulesLink = join6(outRoot, "node_modules");
|
|
4350
4351
|
if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
|
|
4351
4352
|
return;
|
|
4352
4353
|
}
|
|
@@ -4479,5 +4480,5 @@ export {
|
|
|
4479
4480
|
handleAngularPageRequest
|
|
4480
4481
|
};
|
|
4481
4482
|
|
|
4482
|
-
//# debugId=
|
|
4483
|
+
//# debugId=83C0617F91D12C6964756E2164756E21
|
|
4483
4484
|
//# sourceMappingURL=server.js.map
|