@absolutejs/absolute 0.19.0-beta.977 → 0.19.0-beta.979
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +89 -118
- package/dist/angular/index.js.map +5 -6
- package/dist/angular/server.js +87 -116
- package/dist/angular/server.js.map +5 -6
- package/dist/build.js +267 -276
- package/dist/build.js.map +6 -6
- package/dist/index.js +275 -284
- package/dist/index.js.map +6 -6
- package/dist/src/build/emitAngularProvidersFiles.d.ts +1 -1
- package/dist/src/build/runAngularHandlerScan.d.ts +0 -9
- package/package.json +1 -1
- package/dist/src/angular/loadGlobalProviders.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-RAJTFd/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-RAJTFd/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-RAJTFd/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
package/dist/angular/index.js
CHANGED
|
@@ -3517,8 +3517,8 @@ __export(exports_compileAngular, {
|
|
|
3517
3517
|
compileAngularFile: () => compileAngularFile,
|
|
3518
3518
|
compileAngular: () => compileAngular
|
|
3519
3519
|
});
|
|
3520
|
-
import { existsSync as
|
|
3521
|
-
import { join as
|
|
3520
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
3521
|
+
import { join as join8, basename as basename3, sep, dirname as dirname4, resolve as resolve6, relative as relative4 } from "path";
|
|
3522
3522
|
var {Glob } = globalThis.Bun;
|
|
3523
3523
|
import ts from "typescript";
|
|
3524
3524
|
var traceAngularPhase = async (name, fn, metadata) => {
|
|
@@ -3561,12 +3561,12 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3561
3561
|
`${candidate}.tsx`,
|
|
3562
3562
|
`${candidate}.js`,
|
|
3563
3563
|
`${candidate}.jsx`,
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3564
|
+
join8(candidate, "index.ts"),
|
|
3565
|
+
join8(candidate, "index.tsx"),
|
|
3566
|
+
join8(candidate, "index.js"),
|
|
3567
|
+
join8(candidate, "index.jsx")
|
|
3568
3568
|
];
|
|
3569
|
-
return candidates.find((file) =>
|
|
3569
|
+
return candidates.find((file) => existsSync5(file));
|
|
3570
3570
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
3571
3571
|
const baseDir = resolve6(rootDir);
|
|
3572
3572
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -3647,11 +3647,11 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3647
3647
|
}, resolveDevClientDir = () => {
|
|
3648
3648
|
const projectRoot = process.cwd();
|
|
3649
3649
|
const fromSource = resolve6(import.meta.dir, "../dev/client");
|
|
3650
|
-
if (
|
|
3650
|
+
if (existsSync5(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
3651
3651
|
return fromSource;
|
|
3652
3652
|
}
|
|
3653
3653
|
const fromNodeModules = resolve6(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
3654
|
-
if (
|
|
3654
|
+
if (existsSync5(fromNodeModules))
|
|
3655
3655
|
return fromNodeModules;
|
|
3656
3656
|
return resolve6(import.meta.dir, "./dev/client");
|
|
3657
3657
|
}, devClientDir, hmrClientPath, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -3697,11 +3697,11 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3697
3697
|
return `${path}${query}`;
|
|
3698
3698
|
const importerDir = dirname4(importerOutputPath);
|
|
3699
3699
|
const fileCandidate = resolve6(importerDir, `${path}.js`);
|
|
3700
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
3700
|
+
if (outputFiles?.has(fileCandidate) || existsSync5(fileCandidate)) {
|
|
3701
3701
|
return `${path}.js${query}`;
|
|
3702
3702
|
}
|
|
3703
3703
|
const indexCandidate = resolve6(importerDir, path, "index.js");
|
|
3704
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
3704
|
+
if (outputFiles?.has(indexCandidate) || existsSync5(indexCandidate)) {
|
|
3705
3705
|
return `${path}/index.js${query}`;
|
|
3706
3706
|
}
|
|
3707
3707
|
return `${path}.js${query}`;
|
|
@@ -3734,12 +3734,12 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3734
3734
|
`${basePath}.tsx`,
|
|
3735
3735
|
`${basePath}.mts`,
|
|
3736
3736
|
`${basePath}.cts`,
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3737
|
+
join8(basePath, "index.ts"),
|
|
3738
|
+
join8(basePath, "index.tsx"),
|
|
3739
|
+
join8(basePath, "index.mts"),
|
|
3740
|
+
join8(basePath, "index.cts")
|
|
3741
3741
|
];
|
|
3742
|
-
return candidates.map((candidate) => resolve6(candidate)).find((candidate) =>
|
|
3742
|
+
return candidates.map((candidate) => resolve6(candidate)).find((candidate) => existsSync5(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
3743
3743
|
}, readFileForAotTransform = async (fileName, readFile2) => {
|
|
3744
3744
|
const hostSource = readFile2?.(fileName);
|
|
3745
3745
|
if (typeof hostSource === "string")
|
|
@@ -3763,15 +3763,15 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3763
3763
|
const paths = [];
|
|
3764
3764
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
3765
3765
|
if (templateUrlMatch?.[1])
|
|
3766
|
-
paths.push(
|
|
3766
|
+
paths.push(join8(fileDir, templateUrlMatch[1]));
|
|
3767
3767
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
3768
3768
|
if (styleUrlMatch?.[1])
|
|
3769
|
-
paths.push(
|
|
3769
|
+
paths.push(join8(fileDir, styleUrlMatch[1]));
|
|
3770
3770
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
3771
3771
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
3772
3772
|
if (urlMatches) {
|
|
3773
3773
|
for (const urlMatch of urlMatches) {
|
|
3774
|
-
paths.push(
|
|
3774
|
+
paths.push(join8(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
3775
3775
|
}
|
|
3776
3776
|
}
|
|
3777
3777
|
return paths.map((path) => resolve6(path));
|
|
@@ -3805,7 +3805,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3805
3805
|
safeStableStringify(stylePreprocessors ?? null)
|
|
3806
3806
|
].join("\x00");
|
|
3807
3807
|
const cacheKey = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
3808
|
-
return
|
|
3808
|
+
return join8(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey}.json`);
|
|
3809
3809
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile2, stylePreprocessors) => {
|
|
3810
3810
|
const transformedSources = new Map;
|
|
3811
3811
|
const visited = new Set;
|
|
@@ -3820,7 +3820,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3820
3820
|
if (visited.has(resolvedPath))
|
|
3821
3821
|
return;
|
|
3822
3822
|
visited.add(resolvedPath);
|
|
3823
|
-
if (!
|
|
3823
|
+
if (!existsSync5(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
3824
3824
|
return;
|
|
3825
3825
|
stats.filesVisited += 1;
|
|
3826
3826
|
const source = await readFileForAotTransform(resolvedPath, readFile2);
|
|
@@ -3851,7 +3851,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3851
3851
|
return { stats, transformedSources };
|
|
3852
3852
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
3853
3853
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
3854
|
-
const outputPath = resolve6(
|
|
3854
|
+
const outputPath = resolve6(join8(outDir, relative4(process.cwd(), resolve6(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
3855
3855
|
return [
|
|
3856
3856
|
outputPath,
|
|
3857
3857
|
buildIslandMetadataExports(readFileSync4(inputPath, "utf-8"))
|
|
@@ -3893,12 +3893,12 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3893
3893
|
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
3894
3894
|
host.getDefaultLibFileName = (opts) => {
|
|
3895
3895
|
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
3896
|
-
return
|
|
3896
|
+
return basename3(fileName);
|
|
3897
3897
|
};
|
|
3898
3898
|
const originalGetSourceFile = host.getSourceFile;
|
|
3899
3899
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
3900
3900
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
3901
|
-
const resolvedPath =
|
|
3901
|
+
const resolvedPath = join8(tsLibDir, fileName);
|
|
3902
3902
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
3903
3903
|
}
|
|
3904
3904
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -3953,7 +3953,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3953
3953
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
3954
3954
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
3955
3955
|
content,
|
|
3956
|
-
target:
|
|
3956
|
+
target: join8(outDir, fileName)
|
|
3957
3957
|
}));
|
|
3958
3958
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve6(target)));
|
|
3959
3959
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -3994,7 +3994,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
|
|
|
3994
3994
|
return null;
|
|
3995
3995
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
3996
3996
|
const sourceEntry = resolve6(import.meta.dir, "../angular/components/index.ts");
|
|
3997
|
-
if (
|
|
3997
|
+
if (existsSync5(sourceEntry)) {
|
|
3998
3998
|
return sourceEntry.replace(/\\/g, "/");
|
|
3999
3999
|
}
|
|
4000
4000
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -4122,7 +4122,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
4122
4122
|
${fields}
|
|
4123
4123
|
`);
|
|
4124
4124
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
4125
|
-
if (!
|
|
4125
|
+
if (!existsSync5(filePath)) {
|
|
4126
4126
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
4127
4127
|
}
|
|
4128
4128
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -4130,8 +4130,8 @@ ${fields}
|
|
|
4130
4130
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
4131
4131
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
4132
4132
|
if (templateUrlMatch?.[1]) {
|
|
4133
|
-
const templatePath =
|
|
4134
|
-
if (!
|
|
4133
|
+
const templatePath = join8(fileDir, templateUrlMatch[1]);
|
|
4134
|
+
if (!existsSync5(templatePath)) {
|
|
4135
4135
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
4136
4136
|
}
|
|
4137
4137
|
const templateRaw2 = await fs.readFile(templatePath, "utf-8");
|
|
@@ -4161,8 +4161,8 @@ ${fields}
|
|
|
4161
4161
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
4162
4162
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
4163
4163
|
if (templateUrlMatch?.[1]) {
|
|
4164
|
-
const templatePath =
|
|
4165
|
-
if (!
|
|
4164
|
+
const templatePath = join8(fileDir, templateUrlMatch[1]);
|
|
4165
|
+
if (!existsSync5(templatePath)) {
|
|
4166
4166
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
4167
4167
|
}
|
|
4168
4168
|
const templateRaw2 = readFileSync4(templatePath, "utf-8");
|
|
@@ -4198,7 +4198,7 @@ ${fields}
|
|
|
4198
4198
|
return source;
|
|
4199
4199
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
4200
4200
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
4201
|
-
return readAndEscapeFile(
|
|
4201
|
+
return readAndEscapeFile(join8(fileDir, styleUrl), stylePreprocessors);
|
|
4202
4202
|
});
|
|
4203
4203
|
const results = await Promise.all(stylePromises);
|
|
4204
4204
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -4209,7 +4209,7 @@ ${fields}
|
|
|
4209
4209
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
4210
4210
|
if (!styleUrlMatch?.[1])
|
|
4211
4211
|
return source;
|
|
4212
|
-
const escaped = await readAndEscapeFile(
|
|
4212
|
+
const escaped = await readAndEscapeFile(join8(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
4213
4213
|
if (!escaped)
|
|
4214
4214
|
return source;
|
|
4215
4215
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -4245,12 +4245,12 @@ ${fields}
|
|
|
4245
4245
|
`${candidate}.js`,
|
|
4246
4246
|
`${candidate}.jsx`,
|
|
4247
4247
|
`${candidate}.json`,
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4248
|
+
join8(candidate, "index.ts"),
|
|
4249
|
+
join8(candidate, "index.tsx"),
|
|
4250
|
+
join8(candidate, "index.js"),
|
|
4251
|
+
join8(candidate, "index.jsx")
|
|
4252
4252
|
];
|
|
4253
|
-
return candidates.find((file) =>
|
|
4253
|
+
return candidates.find((file) => existsSync5(file));
|
|
4254
4254
|
};
|
|
4255
4255
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
4256
4256
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -4273,9 +4273,12 @@ ${fields}
|
|
|
4273
4273
|
};
|
|
4274
4274
|
const toOutputPath = (sourcePath) => {
|
|
4275
4275
|
const inputDir = dirname4(sourcePath);
|
|
4276
|
+
const fileBase = basename3(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
4277
|
+
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep}`)) {
|
|
4278
|
+
return join8(inputDir, fileBase);
|
|
4279
|
+
}
|
|
4276
4280
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
4277
|
-
|
|
4278
|
-
return join9(outDir, relativeDir, fileBase);
|
|
4281
|
+
return join8(outDir, relativeDir, fileBase);
|
|
4279
4282
|
};
|
|
4280
4283
|
const withCacheBuster = (specifier) => {
|
|
4281
4284
|
if (!cacheBuster)
|
|
@@ -4322,11 +4325,11 @@ ${fields}
|
|
|
4322
4325
|
if (visited.has(resolved))
|
|
4323
4326
|
return;
|
|
4324
4327
|
visited.add(resolved);
|
|
4325
|
-
if (resolved.endsWith(".json") &&
|
|
4328
|
+
if (resolved.endsWith(".json") && existsSync5(resolved)) {
|
|
4326
4329
|
const inputDir2 = dirname4(resolved);
|
|
4327
4330
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
4328
|
-
const targetDir2 =
|
|
4329
|
-
const targetPath2 =
|
|
4331
|
+
const targetDir2 = join8(outDir, relativeDir2);
|
|
4332
|
+
const targetPath2 = join8(targetDir2, basename3(resolved));
|
|
4330
4333
|
await fs.mkdir(targetDir2, { recursive: true });
|
|
4331
4334
|
await fs.copyFile(resolved, targetPath2);
|
|
4332
4335
|
allOutputs.push(targetPath2);
|
|
@@ -4335,16 +4338,16 @@ ${fields}
|
|
|
4335
4338
|
let actualPath = resolved;
|
|
4336
4339
|
if (!actualPath.endsWith(".ts"))
|
|
4337
4340
|
actualPath += ".ts";
|
|
4338
|
-
if (!
|
|
4341
|
+
if (!existsSync5(actualPath))
|
|
4339
4342
|
return;
|
|
4340
4343
|
let sourceCode = await fs.readFile(actualPath, "utf-8");
|
|
4341
4344
|
const inlined = await inlineResources(sourceCode, dirname4(actualPath), stylePreprocessors);
|
|
4342
4345
|
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname4(actualPath)).source;
|
|
4343
4346
|
const inputDir = dirname4(actualPath);
|
|
4344
|
-
const
|
|
4345
|
-
const fileBase = basename4(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
4346
|
-
const targetDir = join9(outDir, relativeDir);
|
|
4347
|
+
const fileBase = basename3(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
4347
4348
|
const targetPath = toOutputPath(actualPath);
|
|
4349
|
+
const targetDir = dirname4(targetPath);
|
|
4350
|
+
const relativeDir = relative4(outDir, targetDir).replace(/\\/g, "/");
|
|
4348
4351
|
const localImports = [];
|
|
4349
4352
|
const importRewrites = new Map;
|
|
4350
4353
|
const fromRegex = /(?:from|import)\s+['"]([^'".][^'"]*|\.\.?\/[^'"]+)['"]/g;
|
|
@@ -4373,7 +4376,7 @@ ${fields}
|
|
|
4373
4376
|
const isEntry = resolve6(actualPath) === resolve6(entryPath);
|
|
4374
4377
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
4375
4378
|
const cacheKey = actualPath;
|
|
4376
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !
|
|
4379
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync5(targetPath);
|
|
4377
4380
|
if (shouldWriteFile) {
|
|
4378
4381
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
4379
4382
|
await fs.mkdir(targetDir, { recursive: true });
|
|
@@ -4385,7 +4388,7 @@ ${fields}
|
|
|
4385
4388
|
};
|
|
4386
4389
|
await transpileFile(inputPath);
|
|
4387
4390
|
const entryOutputPath = toOutputPath(entryPath);
|
|
4388
|
-
if (
|
|
4391
|
+
if (existsSync5(entryOutputPath)) {
|
|
4389
4392
|
const entryOutput = await fs.readFile(entryOutputPath, "utf-8");
|
|
4390
4393
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
4391
4394
|
`);
|
|
@@ -4404,23 +4407,23 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
4404
4407
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
4405
4408
|
}
|
|
4406
4409
|
const compiledRoot = compiledParent;
|
|
4407
|
-
const indexesDir =
|
|
4410
|
+
const indexesDir = join8(compiledParent, "indexes");
|
|
4408
4411
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
4409
4412
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve6(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
4410
4413
|
if (!hmr) {
|
|
4411
4414
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
4412
4415
|
const cwd = process.cwd();
|
|
4413
4416
|
const angularSrcDir = resolve6(outRoot);
|
|
4414
|
-
if (!
|
|
4417
|
+
if (!existsSync5(angularSrcDir))
|
|
4415
4418
|
return;
|
|
4416
4419
|
const jsonGlob = new Glob("**/*.json");
|
|
4417
4420
|
for (const rel of jsonGlob.scanSync({
|
|
4418
4421
|
absolute: false,
|
|
4419
4422
|
cwd: angularSrcDir
|
|
4420
4423
|
})) {
|
|
4421
|
-
const sourcePath =
|
|
4424
|
+
const sourcePath = join8(angularSrcDir, rel);
|
|
4422
4425
|
const cwdRel = relative4(cwd, sourcePath);
|
|
4423
|
-
const targetPath =
|
|
4426
|
+
const targetPath = join8(compiledRoot, cwdRel);
|
|
4424
4427
|
await fs.mkdir(dirname4(targetPath), { recursive: true });
|
|
4425
4428
|
await fs.copyFile(sourcePath, targetPath);
|
|
4426
4429
|
}
|
|
@@ -4434,27 +4437,27 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
4434
4437
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
4435
4438
|
entry: resolvedEntry
|
|
4436
4439
|
}) : aotOutputs;
|
|
4437
|
-
const fileBase =
|
|
4440
|
+
const fileBase = basename3(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
4438
4441
|
const jsName = `${fileBase}.js`;
|
|
4439
4442
|
const compiledFallbackPaths = [
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
+
join8(compiledRoot, relativeEntry),
|
|
4444
|
+
join8(compiledRoot, "pages", jsName),
|
|
4445
|
+
join8(compiledRoot, jsName)
|
|
4443
4446
|
].map((file) => resolve6(file));
|
|
4444
4447
|
const resolveRawServerFile = (candidatePaths) => {
|
|
4445
4448
|
const normalizedCandidates = [
|
|
4446
4449
|
...candidatePaths.map((file) => resolve6(file)),
|
|
4447
4450
|
...compiledFallbackPaths
|
|
4448
4451
|
];
|
|
4449
|
-
let candidate = normalizedCandidates.find((file) =>
|
|
4452
|
+
let candidate = normalizedCandidates.find((file) => existsSync5(file) && file.endsWith(`${sep}${relativeEntry}`));
|
|
4450
4453
|
if (!candidate) {
|
|
4451
|
-
candidate = normalizedCandidates.find((file) =>
|
|
4454
|
+
candidate = normalizedCandidates.find((file) => existsSync5(file) && file.endsWith(`${sep}pages${sep}${jsName}`));
|
|
4452
4455
|
}
|
|
4453
4456
|
if (!candidate) {
|
|
4454
|
-
candidate = normalizedCandidates.find((file) =>
|
|
4457
|
+
candidate = normalizedCandidates.find((file) => existsSync5(file) && file.endsWith(`${sep}${jsName}`));
|
|
4455
4458
|
}
|
|
4456
4459
|
if (!candidate) {
|
|
4457
|
-
candidate = normalizedCandidates.find((file) =>
|
|
4460
|
+
candidate = normalizedCandidates.find((file) => existsSync5(file));
|
|
4458
4461
|
}
|
|
4459
4462
|
return candidate;
|
|
4460
4463
|
};
|
|
@@ -4462,11 +4465,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
4462
4465
|
if (!rawServerFile) {
|
|
4463
4466
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
4464
4467
|
}
|
|
4465
|
-
if (rawServerFile && !
|
|
4468
|
+
if (rawServerFile && !existsSync5(rawServerFile)) {
|
|
4466
4469
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
4467
4470
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
4468
4471
|
}
|
|
4469
|
-
if (!rawServerFile || !
|
|
4472
|
+
if (!rawServerFile || !existsSync5(rawServerFile)) {
|
|
4470
4473
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
4471
4474
|
...outputs,
|
|
4472
4475
|
...compiledFallbackPaths
|
|
@@ -4487,8 +4490,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
4487
4490
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
4488
4491
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
4489
4492
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
4490
|
-
const clientFile =
|
|
4491
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
4493
|
+
const clientFile = join8(indexesDir, jsName);
|
|
4494
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync5(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
4492
4495
|
return {
|
|
4493
4496
|
clientPath: clientFile,
|
|
4494
4497
|
indexUnchanged: true,
|
|
@@ -4510,16 +4513,24 @@ export default ${componentClassName};
|
|
|
4510
4513
|
if (usesLegacyAnimations) {
|
|
4511
4514
|
rewritten += `
|
|
4512
4515
|
export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
4516
|
+
`;
|
|
4517
|
+
}
|
|
4518
|
+
const providersServerPath = join8(compiledParent, "providers", `${toPascal(fileBase)}.providers.js`);
|
|
4519
|
+
if (existsSync5(providersServerPath)) {
|
|
4520
|
+
const rel = relative4(dirname4(rawServerFile), providersServerPath).replace(/\\/g, "/");
|
|
4521
|
+
const specifier = rel.startsWith(".") ? rel : `./${rel}`;
|
|
4522
|
+
rewritten += `
|
|
4523
|
+
export { providers } from "${specifier}";
|
|
4513
4524
|
`;
|
|
4514
4525
|
}
|
|
4515
4526
|
await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
4516
4527
|
const relativePath = relative4(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
4517
4528
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
4518
4529
|
const manifestKeyForProviders = toPascal(fileBase);
|
|
4519
|
-
const
|
|
4520
|
-
const hasGeneratedProviders =
|
|
4530
|
+
const providersServerFilePath = join8(compiledParent, "providers", `${manifestKeyForProviders}.providers.js`);
|
|
4531
|
+
const hasGeneratedProviders = existsSync5(providersServerFilePath);
|
|
4521
4532
|
const providersImportPath = hasGeneratedProviders ? (() => {
|
|
4522
|
-
const rel = relative4(indexesDir,
|
|
4533
|
+
const rel = relative4(indexesDir, providersServerFilePath.replace(/\.js$/, "")).replace(/\\/g, "/");
|
|
4523
4534
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
4524
4535
|
})() : null;
|
|
4525
4536
|
const generatedProvidersImport = providersImportPath ? `import { providers as generatedProviders } from '${providersImportPath}';` : "var generatedProviders = null;";
|
|
@@ -4723,7 +4734,7 @@ var init_compileAngular = __esm(() => {
|
|
|
4723
4734
|
init_stylePreprocessor();
|
|
4724
4735
|
init_generatedDir();
|
|
4725
4736
|
devClientDir = resolveDevClientDir();
|
|
4726
|
-
hmrClientPath =
|
|
4737
|
+
hmrClientPath = join8(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
4727
4738
|
jitContentCache = new Map;
|
|
4728
4739
|
wrapperOutputCache = new Map;
|
|
4729
4740
|
});
|
|
@@ -13834,7 +13845,7 @@ init_constants();
|
|
|
13834
13845
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
13835
13846
|
import { mkdir as mkdir3, symlink } from "fs/promises";
|
|
13836
13847
|
import { tmpdir } from "os";
|
|
13837
|
-
import { basename as
|
|
13848
|
+
import { basename as basename4, dirname as dirname5, join as join9, resolve as resolve7 } from "path";
|
|
13838
13849
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
13839
13850
|
|
|
13840
13851
|
// src/core/islandPageContext.ts
|
|
@@ -14702,44 +14713,6 @@ var matchAngularBasePath = (mounts, urlPath) => {
|
|
|
14702
14713
|
return "/";
|
|
14703
14714
|
};
|
|
14704
14715
|
|
|
14705
|
-
// src/angular/loadGlobalProviders.ts
|
|
14706
|
-
init_generatedDir();
|
|
14707
|
-
import { existsSync as existsSync5 } from "fs";
|
|
14708
|
-
import { basename as basename3, join as join8 } from "path";
|
|
14709
|
-
var cache = new Map;
|
|
14710
|
-
var BUN_CONTENT_HASH = /\.[a-z0-9]{8}$/;
|
|
14711
|
-
var SSR_INFIX = /\.ssr$/;
|
|
14712
|
-
var manifestKeyForPagePath = (pageSourcePath) => {
|
|
14713
|
-
let stem = basename3(pageSourcePath).replace(/\.[cm]?[tj]sx?$/, "");
|
|
14714
|
-
let prev;
|
|
14715
|
-
do {
|
|
14716
|
-
prev = stem;
|
|
14717
|
-
stem = stem.replace(BUN_CONTENT_HASH, "").replace(SSR_INFIX, "");
|
|
14718
|
-
} while (stem !== prev);
|
|
14719
|
-
return toPascal(stem);
|
|
14720
|
-
};
|
|
14721
|
-
var loadPageProviders = async (pageSourcePath) => {
|
|
14722
|
-
const manifestKey = manifestKeyForPagePath(pageSourcePath);
|
|
14723
|
-
const cached2 = cache.get(manifestKey);
|
|
14724
|
-
if (cached2)
|
|
14725
|
-
return cached2;
|
|
14726
|
-
const generatedFile = join8(getFrameworkGeneratedDir("angular", process.cwd()), "providers", `${manifestKey}.providers.ts`);
|
|
14727
|
-
if (!existsSync5(generatedFile)) {
|
|
14728
|
-
cache.set(manifestKey, []);
|
|
14729
|
-
return [];
|
|
14730
|
-
}
|
|
14731
|
-
try {
|
|
14732
|
-
const mod = await import(generatedFile);
|
|
14733
|
-
const providers = Array.isArray(mod.providers) ? mod.providers : [];
|
|
14734
|
-
cache.set(manifestKey, providers);
|
|
14735
|
-
return providers;
|
|
14736
|
-
} catch (error) {
|
|
14737
|
-
console.warn(`[absolute/angular] failed to load generated providers for "${manifestKey}":`, error);
|
|
14738
|
-
cache.set(manifestKey, []);
|
|
14739
|
-
return [];
|
|
14740
|
-
}
|
|
14741
|
-
};
|
|
14742
|
-
|
|
14743
14716
|
// src/angular/pageHandler.ts
|
|
14744
14717
|
var lastSelector = "angular-page";
|
|
14745
14718
|
var isRecord5 = (value) => typeof value === "object" && value !== null;
|
|
@@ -14761,11 +14734,11 @@ var ensureAngularCompiler = () => {
|
|
|
14761
14734
|
return compilerImportPromise;
|
|
14762
14735
|
};
|
|
14763
14736
|
var readAngularPageModule = (value) => isRecord5(value) ? value : null;
|
|
14764
|
-
var resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ??
|
|
14737
|
+
var resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join9(tmpdir(), "absolutejs", "generated", "angular-ssr");
|
|
14765
14738
|
var createAngularRuntimeCacheBuster = () => `${Date.now().toString(BASE_36_RADIX)}.${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
|
|
14766
14739
|
var ensureAngularSsrNodeModules = async (outDir) => {
|
|
14767
14740
|
const outRoot = resolve7(dirname5(dirname5(outDir)));
|
|
14768
|
-
const nodeModulesLink =
|
|
14741
|
+
const nodeModulesLink = join9(outRoot, "node_modules");
|
|
14769
14742
|
if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
|
|
14770
14743
|
return;
|
|
14771
14744
|
}
|
|
@@ -14808,7 +14781,7 @@ var resolveRuntimeAngularModulePath = async (pagePath) => {
|
|
|
14808
14781
|
const { compileAngularFileJIT: compileAngularFileJIT2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
14809
14782
|
const cacheBuster = createAngularRuntimeCacheBuster();
|
|
14810
14783
|
const outputs = await compileAngularFileJIT2(pagePath, outDir, process.cwd(), undefined, cacheBuster);
|
|
14811
|
-
const expectedFileName =
|
|
14784
|
+
const expectedFileName = basename4(pagePath).replace(/\.ts$/, ".js");
|
|
14812
14785
|
const runtimePagePath = outputs.find((output) => output.endsWith(`/${expectedFileName}`)) ?? outputs.find((output) => output.endsWith(`\\${expectedFileName}`)) ?? outputs[0] ?? pagePath;
|
|
14813
14786
|
return {
|
|
14814
14787
|
path: runtimePagePath,
|
|
@@ -14879,9 +14852,8 @@ var handleAngularPageRequest = async (input) => {
|
|
|
14879
14852
|
const htmlString = `<!DOCTYPE html><html>${resolvedHeadTag}<body><${selector}></${selector}></body></html>`;
|
|
14880
14853
|
resetSsrSanitizer();
|
|
14881
14854
|
const sanitizer = getSsrSanitizer(deps);
|
|
14882
|
-
const
|
|
14883
|
-
const
|
|
14884
|
-
const legacyPageProviders = pageProviders.length > 0 ? [] : Array.isArray(legacyProvidersExport) ? legacyProvidersExport : [];
|
|
14855
|
+
const pageProvidersExport = Reflect.get(pageModule, "providers");
|
|
14856
|
+
const pageProviders = Array.isArray(pageProvidersExport) ? pageProvidersExport : [];
|
|
14885
14857
|
const routeMounts = await loadAngularRouteMounts();
|
|
14886
14858
|
const requestUrlPath = input.request ? new URL(input.request.url).pathname : "/";
|
|
14887
14859
|
const inferredBasePath = matchAngularBasePath(routeMounts, requestUrlPath);
|
|
@@ -14895,7 +14867,6 @@ var handleAngularPageRequest = async (input) => {
|
|
|
14895
14867
|
...await buildRouterRedirectProviders(deps, responseInit),
|
|
14896
14868
|
...inferredBasePathProvider,
|
|
14897
14869
|
...pageProviders,
|
|
14898
|
-
...legacyPageProviders,
|
|
14899
14870
|
...await buildServerAnimationProviders(usesLegacyAnimations)
|
|
14900
14871
|
];
|
|
14901
14872
|
const providers = buildProviders(deps, sanitizer, input.request, maybeRequestContext, responseInit, combinedProviders);
|
|
@@ -15072,8 +15043,8 @@ var buildCacheKey = (instance, key) => {
|
|
|
15072
15043
|
return `${className}:${suffix}`;
|
|
15073
15044
|
};
|
|
15074
15045
|
var restoreFromCacheCore = (instance, key) => {
|
|
15075
|
-
const
|
|
15076
|
-
const stored =
|
|
15046
|
+
const cache = getCache();
|
|
15047
|
+
const stored = cache.get(key);
|
|
15077
15048
|
if (!stored)
|
|
15078
15049
|
return false;
|
|
15079
15050
|
for (const [prop, value] of Object.entries(stored)) {
|
|
@@ -15435,5 +15406,5 @@ export {
|
|
|
15435
15406
|
ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
|
|
15436
15407
|
};
|
|
15437
15408
|
|
|
15438
|
-
//# debugId=
|
|
15409
|
+
//# debugId=2E7164982FC4029764756E2164756E21
|
|
15439
15410
|
//# sourceMappingURL=index.js.map
|