@absolutejs/absolute 0.19.0-beta.756 → 0.19.0-beta.758
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 +95 -90
- package/dist/angular/index.js.map +4 -4
- package/dist/angular/server.js +95 -90
- package/dist/angular/server.js.map +4 -4
- package/dist/build.js +95 -90
- package/dist/build.js.map +4 -4
- package/dist/cli/index.js +4 -1
- package/dist/index.js +95 -90
- package/dist/index.js.map +4 -4
- package/dist/react/index.js +5 -2
- package/dist/react/index.js.map +3 -3
- package/dist/react/server.js +5 -2
- package/dist/react/server.js.map +3 -3
- package/dist/src/build/compileAngular.d.ts +1 -13
- package/dist/svelte/index.js +5 -2
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +5 -2
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +5 -2
- package/dist/vue/index.js.map +3 -3
- package/dist/vue/server.js +5 -2
- package/dist/vue/server.js.map +3 -3
- package/package.json +7 -7
package/dist/angular/index.js
CHANGED
|
@@ -2536,7 +2536,10 @@ var getDurationString = (duration) => {
|
|
|
2536
2536
|
} else if (duration < MILLISECONDS_IN_A_MINUTE) {
|
|
2537
2537
|
durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
|
|
2538
2538
|
} else {
|
|
2539
|
-
|
|
2539
|
+
const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
|
|
2540
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
2541
|
+
const seconds = totalSeconds % 60;
|
|
2542
|
+
durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
|
|
2540
2543
|
}
|
|
2541
2544
|
return durationString;
|
|
2542
2545
|
};
|
|
@@ -3219,6 +3222,7 @@ var init_lowerDeferSyntax = __esm(() => {
|
|
|
3219
3222
|
// src/build/compileAngular.ts
|
|
3220
3223
|
var exports_compileAngular = {};
|
|
3221
3224
|
__export(exports_compileAngular, {
|
|
3225
|
+
compileAngularFiles: () => compileAngularFiles,
|
|
3222
3226
|
compileAngularFileJIT: () => compileAngularFileJIT,
|
|
3223
3227
|
compileAngularFile: () => compileAngularFile,
|
|
3224
3228
|
compileAngular: () => compileAngular
|
|
@@ -3226,15 +3230,7 @@ __export(exports_compileAngular, {
|
|
|
3226
3230
|
import { existsSync as existsSync5, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
3227
3231
|
import { join as join5, basename as basename3, sep, dirname as dirname4, resolve as resolve6, relative as relative3 } from "path";
|
|
3228
3232
|
import ts from "typescript";
|
|
3229
|
-
|
|
3230
|
-
var computeConfigHash = () => {
|
|
3231
|
-
try {
|
|
3232
|
-
const content = readFileSync4("./tsconfig.json", "utf-8");
|
|
3233
|
-
return createHash("md5").update(content).digest("hex");
|
|
3234
|
-
} catch {
|
|
3235
|
-
return "";
|
|
3236
|
-
}
|
|
3237
|
-
}, readTsconfigPathAliases = () => {
|
|
3233
|
+
var readTsconfigPathAliases = () => {
|
|
3238
3234
|
try {
|
|
3239
3235
|
const configPath = resolve6(process.cwd(), "tsconfig.json");
|
|
3240
3236
|
const config = ts.readConfigFile(configPath, ts.sys.readFile).config;
|
|
@@ -3385,6 +3381,21 @@ ${registrations}
|
|
|
3385
3381
|
if (fileName.startsWith(outDir))
|
|
3386
3382
|
return fileName.substring(outDir.length + 1);
|
|
3387
3383
|
return fileName;
|
|
3384
|
+
}, hasJsLikeExtension = (path) => /\.(js|ts|mjs|cjs)$/.test(path), rewriteRelativeJsSpecifier = (importerOutputPath, specifier, outputFiles) => {
|
|
3385
|
+
if (specifier.endsWith(".ts"))
|
|
3386
|
+
return specifier.replace(/\.ts$/, ".js");
|
|
3387
|
+
if (hasJsLikeExtension(specifier))
|
|
3388
|
+
return specifier;
|
|
3389
|
+
const importerDir = dirname4(importerOutputPath);
|
|
3390
|
+
const fileCandidate = resolve6(importerDir, `${specifier}.js`);
|
|
3391
|
+
if (outputFiles?.has(fileCandidate) || existsSync5(fileCandidate)) {
|
|
3392
|
+
return `${specifier}.js`;
|
|
3393
|
+
}
|
|
3394
|
+
const indexCandidate = resolve6(importerDir, specifier, "index.js");
|
|
3395
|
+
if (outputFiles?.has(indexCandidate) || existsSync5(indexCandidate)) {
|
|
3396
|
+
return `${specifier}/index.js`;
|
|
3397
|
+
}
|
|
3398
|
+
return `${specifier}.js`;
|
|
3388
3399
|
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
3389
3400
|
const sourceFile = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
3390
3401
|
const specifiers = [];
|
|
@@ -3425,7 +3436,7 @@ ${registrations}
|
|
|
3425
3436
|
if (typeof hostSource === "string")
|
|
3426
3437
|
return hostSource;
|
|
3427
3438
|
return fs.readFile(fileName, "utf-8");
|
|
3428
|
-
}, precomputeAotResourceTransforms = async (
|
|
3439
|
+
}, precomputeAotResourceTransforms = async (inputPaths, readFile2, stylePreprocessors) => {
|
|
3429
3440
|
const transformedSources = new Map;
|
|
3430
3441
|
const visited = new Set;
|
|
3431
3442
|
const transformFile = async (filePath) => {
|
|
@@ -3445,70 +3456,59 @@ ${registrations}
|
|
|
3445
3456
|
await transformFile(resolvedImport);
|
|
3446
3457
|
}));
|
|
3447
3458
|
};
|
|
3448
|
-
await transformFile(inputPath);
|
|
3459
|
+
await Promise.all(inputPaths.map((inputPath) => transformFile(inputPath)));
|
|
3449
3460
|
return transformedSources;
|
|
3450
|
-
},
|
|
3451
|
-
const
|
|
3461
|
+
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
3462
|
+
const islandMetadataByOutputPath = new Map(inputPaths.map((inputPath) => {
|
|
3463
|
+
const outputPath = resolve6(join5(outDir, relative3(process.cwd(), resolve6(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
3464
|
+
return [
|
|
3465
|
+
outputPath,
|
|
3466
|
+
buildIslandMetadataExports(readFileSync4(inputPath, "utf-8"))
|
|
3467
|
+
];
|
|
3468
|
+
}));
|
|
3452
3469
|
const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
|
|
3453
|
-
const
|
|
3454
|
-
const
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
options
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
};
|
|
3496
|
-
const originalGetSourceFile = host.getSourceFile;
|
|
3497
|
-
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
3498
|
-
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
3499
|
-
const resolvedPath = join5(tsLibDir, fileName);
|
|
3500
|
-
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
3501
|
-
}
|
|
3502
|
-
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
3503
|
-
};
|
|
3504
|
-
globalThis.__angularCompilerCache = {
|
|
3505
|
-
configHash,
|
|
3506
|
-
host,
|
|
3507
|
-
lastUsed: Date.now(),
|
|
3508
|
-
options: { ...options },
|
|
3509
|
-
tsLibDir
|
|
3510
|
-
};
|
|
3511
|
-
}
|
|
3470
|
+
const tsPath = __require.resolve("typescript");
|
|
3471
|
+
const tsRootDir = dirname4(tsPath);
|
|
3472
|
+
const tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve6(tsRootDir, "lib");
|
|
3473
|
+
const config = readConfiguration("./tsconfig.json");
|
|
3474
|
+
const options = {
|
|
3475
|
+
emitDecoratorMetadata: true,
|
|
3476
|
+
esModuleInterop: true,
|
|
3477
|
+
experimentalDecorators: true,
|
|
3478
|
+
module: ts.ModuleKind.ESNext,
|
|
3479
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
3480
|
+
newLine: ts.NewLineKind.LineFeed,
|
|
3481
|
+
noLib: false,
|
|
3482
|
+
outDir,
|
|
3483
|
+
skipLibCheck: true,
|
|
3484
|
+
target: ts.ScriptTarget.ES2022,
|
|
3485
|
+
...config.options
|
|
3486
|
+
};
|
|
3487
|
+
options.target = ts.ScriptTarget.ES2022;
|
|
3488
|
+
options.experimentalDecorators = true;
|
|
3489
|
+
options.emitDecoratorMetadata = true;
|
|
3490
|
+
options.newLine = ts.NewLineKind.LineFeed;
|
|
3491
|
+
options.outDir = outDir;
|
|
3492
|
+
options.noEmit = false;
|
|
3493
|
+
options.incremental = false;
|
|
3494
|
+
options.tsBuildInfoFile = undefined;
|
|
3495
|
+
options.rootDir = process.cwd();
|
|
3496
|
+
const host = ts.createCompilerHost(options);
|
|
3497
|
+
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
3498
|
+
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
3499
|
+
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
3500
|
+
host.getDefaultLibFileName = (opts) => {
|
|
3501
|
+
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
3502
|
+
return basename3(fileName);
|
|
3503
|
+
};
|
|
3504
|
+
const originalGetSourceFile = host.getSourceFile;
|
|
3505
|
+
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
3506
|
+
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
3507
|
+
const resolvedPath = join5(tsLibDir, fileName);
|
|
3508
|
+
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
3509
|
+
}
|
|
3510
|
+
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
3511
|
+
};
|
|
3512
3512
|
const emitted = {};
|
|
3513
3513
|
const resolvedOutDir = resolve6(outDir);
|
|
3514
3514
|
host.writeFile = (fileName, text) => {
|
|
@@ -3516,7 +3516,7 @@ ${registrations}
|
|
|
3516
3516
|
emitted[relativePath] = text;
|
|
3517
3517
|
};
|
|
3518
3518
|
const originalReadFile = host.readFile;
|
|
3519
|
-
const aotTransformedSources = await precomputeAotResourceTransforms(
|
|
3519
|
+
const aotTransformedSources = await precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors);
|
|
3520
3520
|
host.readFile = (fileName) => {
|
|
3521
3521
|
const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
|
|
3522
3522
|
if (typeof source !== "string")
|
|
@@ -3541,18 +3541,23 @@ ${registrations}
|
|
|
3541
3541
|
emitFlags: EmitFlags.Default,
|
|
3542
3542
|
host,
|
|
3543
3543
|
options,
|
|
3544
|
-
rootNames:
|
|
3544
|
+
rootNames: inputPaths
|
|
3545
3545
|
}));
|
|
3546
3546
|
} finally {
|
|
3547
3547
|
host.readFile = originalReadFile;
|
|
3548
3548
|
host.getSourceFile = originalGetSourceFileForCompile;
|
|
3549
3549
|
}
|
|
3550
3550
|
throwOnCompilationErrors(diagnostics);
|
|
3551
|
-
const
|
|
3552
|
-
|
|
3551
|
+
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
3552
|
+
content,
|
|
3553
|
+
target: join5(outDir, fileName)
|
|
3554
|
+
}));
|
|
3555
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve6(target)));
|
|
3556
|
+
const entries = rawEntries.map(({ content, target }) => {
|
|
3553
3557
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
3554
|
-
|
|
3555
|
-
|
|
3558
|
+
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
3559
|
+
if (rewritten !== path) {
|
|
3560
|
+
return `from ${quote}${rewritten}${quote}`;
|
|
3556
3561
|
}
|
|
3557
3562
|
return match;
|
|
3558
3563
|
});
|
|
@@ -3562,13 +3567,13 @@ ${registrations}
|
|
|
3562
3567
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
3563
3568
|
});
|
|
3564
3569
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
3565
|
-
processedContent +=
|
|
3570
|
+
processedContent += islandMetadataByOutputPath.get(resolve6(target)) ?? "";
|
|
3566
3571
|
return { content: processedContent, target };
|
|
3567
3572
|
});
|
|
3568
3573
|
await Promise.all(entries.map(({ target }) => fs.mkdir(dirname4(target), { recursive: true })));
|
|
3569
3574
|
await Promise.all(entries.map(({ target, content }) => fs.writeFile(target, content, "utf-8")));
|
|
3570
3575
|
return entries.map(({ target }) => target);
|
|
3571
|
-
}, jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
3576
|
+
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
3572
3577
|
const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
3573
3578
|
let match;
|
|
3574
3579
|
while ((match = re.exec(source)) !== null) {
|
|
@@ -3865,6 +3870,7 @@ ${fields}
|
|
|
3865
3870
|
};
|
|
3866
3871
|
const transpileAndRewrite = (sourceCode, relativeDir, actualPath, importRewrites) => {
|
|
3867
3872
|
let processedContent = angularTranspiler.transformSync(sourceCode);
|
|
3873
|
+
const outputPath = toOutputPath(actualPath);
|
|
3868
3874
|
const rewriteBareImport = (prefix, specifier, suffix) => {
|
|
3869
3875
|
const rewritten = importRewrites.get(specifier);
|
|
3870
3876
|
if (rewritten) {
|
|
@@ -3879,11 +3885,9 @@ ${fields}
|
|
|
3879
3885
|
processedContent = processedContent.replace(/(import\s+['"])([^'"]+)(['"])/g, (_, prefix, specifier, suffix) => rewriteBareImport(prefix, specifier, suffix));
|
|
3880
3886
|
processedContent = processedContent.replace(/(import\(\s*['"])([^'"]+)(['"]\s*\))/g, (_, prefix, specifier, suffix) => rewriteBareImport(prefix, specifier, suffix));
|
|
3881
3887
|
processedContent = processedContent.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
if (path.endsWith(".ts")) {
|
|
3886
|
-
return `from ${quote}${path.replace(/\.ts$/, ".js")}${quote}`;
|
|
3888
|
+
const rewritten = rewriteRelativeJsSpecifier(outputPath, path);
|
|
3889
|
+
if (rewritten !== path) {
|
|
3890
|
+
return `from ${quote}${rewritten}${quote}`;
|
|
3887
3891
|
}
|
|
3888
3892
|
return match;
|
|
3889
3893
|
});
|
|
@@ -3977,11 +3981,12 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
3977
3981
|
const compiledRoot = compiledParent;
|
|
3978
3982
|
const indexesDir = join5(compiledParent, "indexes");
|
|
3979
3983
|
await fs.mkdir(indexesDir, { recursive: true });
|
|
3984
|
+
const aotOutputs = hmr ? [] : await compileAngularFiles(entryPoints.map((entry) => resolve6(entry)), compiledRoot, stylePreprocessors);
|
|
3980
3985
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
3981
3986
|
const resolvedEntry = resolve6(entry);
|
|
3982
3987
|
const relativeEntry = relative3(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
3983
|
-
const compileEntry = () =>
|
|
3984
|
-
let outputs = await compileEntry();
|
|
3988
|
+
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
3989
|
+
let outputs = hmr ? await compileEntry() : aotOutputs;
|
|
3985
3990
|
const fileBase = basename3(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
3986
3991
|
const jsName = `${fileBase}.js`;
|
|
3987
3992
|
const compiledFallbackPaths = [
|
|
@@ -4008,7 +4013,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
4008
4013
|
rawServerFile = resolveRawServerFile([]);
|
|
4009
4014
|
}
|
|
4010
4015
|
if (rawServerFile && !existsSync5(rawServerFile)) {
|
|
4011
|
-
outputs = await compileEntry();
|
|
4016
|
+
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
4012
4017
|
rawServerFile = resolveRawServerFile(outputs);
|
|
4013
4018
|
}
|
|
4014
4019
|
if (!rawServerFile || !existsSync5(rawServerFile)) {
|
|
@@ -14773,5 +14778,5 @@ export {
|
|
|
14773
14778
|
ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
|
|
14774
14779
|
};
|
|
14775
14780
|
|
|
14776
|
-
//# debugId=
|
|
14781
|
+
//# debugId=9EDCD10103870EF364756E2164756E21
|
|
14777
14782
|
//# sourceMappingURL=index.js.map
|