@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/cli/index.js
CHANGED
|
@@ -33,7 +33,10 @@ var getDurationString = (duration) => {
|
|
|
33
33
|
} else if (duration < MILLISECONDS_IN_A_MINUTE) {
|
|
34
34
|
durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
|
|
35
35
|
} else {
|
|
36
|
-
|
|
36
|
+
const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
|
|
37
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
38
|
+
const seconds = totalSeconds % 60;
|
|
39
|
+
durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
|
|
37
40
|
}
|
|
38
41
|
return durationString;
|
|
39
42
|
};
|
package/dist/index.js
CHANGED
|
@@ -3151,7 +3151,10 @@ var getDurationString = (duration) => {
|
|
|
3151
3151
|
} else if (duration < MILLISECONDS_IN_A_MINUTE) {
|
|
3152
3152
|
durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
|
|
3153
3153
|
} else {
|
|
3154
|
-
|
|
3154
|
+
const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
|
|
3155
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
3156
|
+
const seconds = totalSeconds % 60;
|
|
3157
|
+
durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
|
|
3155
3158
|
}
|
|
3156
3159
|
return durationString;
|
|
3157
3160
|
};
|
|
@@ -43690,6 +43693,7 @@ var init_lowerDeferSyntax = __esm(() => {
|
|
|
43690
43693
|
// src/build/compileAngular.ts
|
|
43691
43694
|
var exports_compileAngular = {};
|
|
43692
43695
|
__export(exports_compileAngular, {
|
|
43696
|
+
compileAngularFiles: () => compileAngularFiles,
|
|
43693
43697
|
compileAngularFileJIT: () => compileAngularFileJIT,
|
|
43694
43698
|
compileAngularFile: () => compileAngularFile,
|
|
43695
43699
|
compileAngular: () => compileAngular
|
|
@@ -43697,15 +43701,7 @@ __export(exports_compileAngular, {
|
|
|
43697
43701
|
import { existsSync as existsSync16, readFileSync as readFileSync10, promises as fs2 } from "fs";
|
|
43698
43702
|
import { join as join15, basename as basename7, sep as sep3, dirname as dirname11, resolve as resolve19, relative as relative9 } from "path";
|
|
43699
43703
|
import ts2 from "typescript";
|
|
43700
|
-
|
|
43701
|
-
var computeConfigHash = () => {
|
|
43702
|
-
try {
|
|
43703
|
-
const content = readFileSync10("./tsconfig.json", "utf-8");
|
|
43704
|
-
return createHash2("md5").update(content).digest("hex");
|
|
43705
|
-
} catch {
|
|
43706
|
-
return "";
|
|
43707
|
-
}
|
|
43708
|
-
}, readTsconfigPathAliases = () => {
|
|
43704
|
+
var readTsconfigPathAliases = () => {
|
|
43709
43705
|
try {
|
|
43710
43706
|
const configPath2 = resolve19(process.cwd(), "tsconfig.json");
|
|
43711
43707
|
const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
|
|
@@ -43856,6 +43852,21 @@ ${registrations}
|
|
|
43856
43852
|
if (fileName.startsWith(outDir))
|
|
43857
43853
|
return fileName.substring(outDir.length + 1);
|
|
43858
43854
|
return fileName;
|
|
43855
|
+
}, hasJsLikeExtension = (path2) => /\.(js|ts|mjs|cjs)$/.test(path2), rewriteRelativeJsSpecifier = (importerOutputPath, specifier, outputFiles) => {
|
|
43856
|
+
if (specifier.endsWith(".ts"))
|
|
43857
|
+
return specifier.replace(/\.ts$/, ".js");
|
|
43858
|
+
if (hasJsLikeExtension(specifier))
|
|
43859
|
+
return specifier;
|
|
43860
|
+
const importerDir = dirname11(importerOutputPath);
|
|
43861
|
+
const fileCandidate = resolve19(importerDir, `${specifier}.js`);
|
|
43862
|
+
if (outputFiles?.has(fileCandidate) || existsSync16(fileCandidate)) {
|
|
43863
|
+
return `${specifier}.js`;
|
|
43864
|
+
}
|
|
43865
|
+
const indexCandidate = resolve19(importerDir, specifier, "index.js");
|
|
43866
|
+
if (outputFiles?.has(indexCandidate) || existsSync16(indexCandidate)) {
|
|
43867
|
+
return `${specifier}/index.js`;
|
|
43868
|
+
}
|
|
43869
|
+
return `${specifier}.js`;
|
|
43859
43870
|
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
43860
43871
|
const sourceFile = ts2.createSourceFile(fileName, source, ts2.ScriptTarget.Latest, true, ts2.ScriptKind.TS);
|
|
43861
43872
|
const specifiers = [];
|
|
@@ -43896,7 +43907,7 @@ ${registrations}
|
|
|
43896
43907
|
if (typeof hostSource === "string")
|
|
43897
43908
|
return hostSource;
|
|
43898
43909
|
return fs2.readFile(fileName, "utf-8");
|
|
43899
|
-
}, precomputeAotResourceTransforms = async (
|
|
43910
|
+
}, precomputeAotResourceTransforms = async (inputPaths, readFile4, stylePreprocessors) => {
|
|
43900
43911
|
const transformedSources = new Map;
|
|
43901
43912
|
const visited = new Set;
|
|
43902
43913
|
const transformFile = async (filePath) => {
|
|
@@ -43916,70 +43927,59 @@ ${registrations}
|
|
|
43916
43927
|
await transformFile(resolvedImport);
|
|
43917
43928
|
}));
|
|
43918
43929
|
};
|
|
43919
|
-
await transformFile(inputPath);
|
|
43930
|
+
await Promise.all(inputPaths.map((inputPath) => transformFile(inputPath)));
|
|
43920
43931
|
return transformedSources;
|
|
43921
|
-
},
|
|
43922
|
-
const
|
|
43932
|
+
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
43933
|
+
const islandMetadataByOutputPath = new Map(inputPaths.map((inputPath) => {
|
|
43934
|
+
const outputPath = resolve19(join15(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
43935
|
+
return [
|
|
43936
|
+
outputPath,
|
|
43937
|
+
buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"))
|
|
43938
|
+
];
|
|
43939
|
+
}));
|
|
43923
43940
|
const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
|
|
43924
|
-
const
|
|
43925
|
-
const
|
|
43926
|
-
|
|
43927
|
-
|
|
43928
|
-
|
|
43929
|
-
|
|
43930
|
-
|
|
43931
|
-
|
|
43932
|
-
|
|
43933
|
-
|
|
43934
|
-
|
|
43935
|
-
|
|
43936
|
-
|
|
43937
|
-
|
|
43938
|
-
|
|
43939
|
-
options
|
|
43940
|
-
|
|
43941
|
-
|
|
43942
|
-
|
|
43943
|
-
|
|
43944
|
-
|
|
43945
|
-
|
|
43946
|
-
|
|
43947
|
-
|
|
43948
|
-
|
|
43949
|
-
|
|
43950
|
-
|
|
43951
|
-
|
|
43952
|
-
|
|
43953
|
-
|
|
43954
|
-
|
|
43955
|
-
|
|
43956
|
-
|
|
43957
|
-
|
|
43958
|
-
|
|
43959
|
-
|
|
43960
|
-
|
|
43961
|
-
|
|
43962
|
-
|
|
43963
|
-
|
|
43964
|
-
|
|
43965
|
-
|
|
43966
|
-
};
|
|
43967
|
-
const originalGetSourceFile = host.getSourceFile;
|
|
43968
|
-
host.getSourceFile = (fileName, languageVersion, onError2) => {
|
|
43969
|
-
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
43970
|
-
const resolvedPath = join15(tsLibDir, fileName);
|
|
43971
|
-
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError2);
|
|
43972
|
-
}
|
|
43973
|
-
return originalGetSourceFile?.call(host, fileName, languageVersion, onError2);
|
|
43974
|
-
};
|
|
43975
|
-
globalThis.__angularCompilerCache = {
|
|
43976
|
-
configHash,
|
|
43977
|
-
host,
|
|
43978
|
-
lastUsed: Date.now(),
|
|
43979
|
-
options: { ...options },
|
|
43980
|
-
tsLibDir
|
|
43981
|
-
};
|
|
43982
|
-
}
|
|
43941
|
+
const tsPath = __require.resolve("typescript");
|
|
43942
|
+
const tsRootDir = dirname11(tsPath);
|
|
43943
|
+
const tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve19(tsRootDir, "lib");
|
|
43944
|
+
const config = readConfiguration("./tsconfig.json");
|
|
43945
|
+
const options = {
|
|
43946
|
+
emitDecoratorMetadata: true,
|
|
43947
|
+
esModuleInterop: true,
|
|
43948
|
+
experimentalDecorators: true,
|
|
43949
|
+
module: ts2.ModuleKind.ESNext,
|
|
43950
|
+
moduleResolution: ts2.ModuleResolutionKind.Bundler,
|
|
43951
|
+
newLine: ts2.NewLineKind.LineFeed,
|
|
43952
|
+
noLib: false,
|
|
43953
|
+
outDir,
|
|
43954
|
+
skipLibCheck: true,
|
|
43955
|
+
target: ts2.ScriptTarget.ES2022,
|
|
43956
|
+
...config.options
|
|
43957
|
+
};
|
|
43958
|
+
options.target = ts2.ScriptTarget.ES2022;
|
|
43959
|
+
options.experimentalDecorators = true;
|
|
43960
|
+
options.emitDecoratorMetadata = true;
|
|
43961
|
+
options.newLine = ts2.NewLineKind.LineFeed;
|
|
43962
|
+
options.outDir = outDir;
|
|
43963
|
+
options.noEmit = false;
|
|
43964
|
+
options.incremental = false;
|
|
43965
|
+
options.tsBuildInfoFile = undefined;
|
|
43966
|
+
options.rootDir = process.cwd();
|
|
43967
|
+
const host = ts2.createCompilerHost(options);
|
|
43968
|
+
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
43969
|
+
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
43970
|
+
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
43971
|
+
host.getDefaultLibFileName = (opts) => {
|
|
43972
|
+
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
43973
|
+
return basename7(fileName);
|
|
43974
|
+
};
|
|
43975
|
+
const originalGetSourceFile = host.getSourceFile;
|
|
43976
|
+
host.getSourceFile = (fileName, languageVersion, onError2) => {
|
|
43977
|
+
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
43978
|
+
const resolvedPath = join15(tsLibDir, fileName);
|
|
43979
|
+
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError2);
|
|
43980
|
+
}
|
|
43981
|
+
return originalGetSourceFile?.call(host, fileName, languageVersion, onError2);
|
|
43982
|
+
};
|
|
43983
43983
|
const emitted = {};
|
|
43984
43984
|
const resolvedOutDir = resolve19(outDir);
|
|
43985
43985
|
host.writeFile = (fileName, text) => {
|
|
@@ -43987,7 +43987,7 @@ ${registrations}
|
|
|
43987
43987
|
emitted[relativePath] = text;
|
|
43988
43988
|
};
|
|
43989
43989
|
const originalReadFile = host.readFile;
|
|
43990
|
-
const aotTransformedSources = await precomputeAotResourceTransforms(
|
|
43990
|
+
const aotTransformedSources = await precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors);
|
|
43991
43991
|
host.readFile = (fileName) => {
|
|
43992
43992
|
const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
|
|
43993
43993
|
if (typeof source !== "string")
|
|
@@ -44012,18 +44012,23 @@ ${registrations}
|
|
|
44012
44012
|
emitFlags: EmitFlags.Default,
|
|
44013
44013
|
host,
|
|
44014
44014
|
options,
|
|
44015
|
-
rootNames:
|
|
44015
|
+
rootNames: inputPaths
|
|
44016
44016
|
}));
|
|
44017
44017
|
} finally {
|
|
44018
44018
|
host.readFile = originalReadFile;
|
|
44019
44019
|
host.getSourceFile = originalGetSourceFileForCompile;
|
|
44020
44020
|
}
|
|
44021
44021
|
throwOnCompilationErrors(diagnostics);
|
|
44022
|
-
const
|
|
44023
|
-
|
|
44022
|
+
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
44023
|
+
content,
|
|
44024
|
+
target: join15(outDir, fileName)
|
|
44025
|
+
}));
|
|
44026
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
|
|
44027
|
+
const entries = rawEntries.map(({ content, target }) => {
|
|
44024
44028
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
|
|
44025
|
-
|
|
44026
|
-
|
|
44029
|
+
const rewritten = rewriteRelativeJsSpecifier(target, path2, outputFiles);
|
|
44030
|
+
if (rewritten !== path2) {
|
|
44031
|
+
return `from ${quote}${rewritten}${quote}`;
|
|
44027
44032
|
}
|
|
44028
44033
|
return match;
|
|
44029
44034
|
});
|
|
@@ -44033,13 +44038,13 @@ ${registrations}
|
|
|
44033
44038
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
44034
44039
|
});
|
|
44035
44040
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
44036
|
-
processedContent +=
|
|
44041
|
+
processedContent += islandMetadataByOutputPath.get(resolve19(target)) ?? "";
|
|
44037
44042
|
return { content: processedContent, target };
|
|
44038
44043
|
});
|
|
44039
44044
|
await Promise.all(entries.map(({ target }) => fs2.mkdir(dirname11(target), { recursive: true })));
|
|
44040
44045
|
await Promise.all(entries.map(({ target, content }) => fs2.writeFile(target, content, "utf-8")));
|
|
44041
44046
|
return entries.map(({ target }) => target);
|
|
44042
|
-
}, jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
44047
|
+
}, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
|
|
44043
44048
|
const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
|
|
44044
44049
|
let match;
|
|
44045
44050
|
while ((match = re2.exec(source)) !== null) {
|
|
@@ -44336,6 +44341,7 @@ ${fields}
|
|
|
44336
44341
|
};
|
|
44337
44342
|
const transpileAndRewrite = (sourceCode, relativeDir, actualPath, importRewrites) => {
|
|
44338
44343
|
let processedContent = angularTranspiler.transformSync(sourceCode);
|
|
44344
|
+
const outputPath = toOutputPath(actualPath);
|
|
44339
44345
|
const rewriteBareImport = (prefix, specifier, suffix) => {
|
|
44340
44346
|
const rewritten = importRewrites.get(specifier);
|
|
44341
44347
|
if (rewritten) {
|
|
@@ -44350,11 +44356,9 @@ ${fields}
|
|
|
44350
44356
|
processedContent = processedContent.replace(/(import\s+['"])([^'"]+)(['"])/g, (_, prefix, specifier, suffix) => rewriteBareImport(prefix, specifier, suffix));
|
|
44351
44357
|
processedContent = processedContent.replace(/(import\(\s*['"])([^'"]+)(['"]\s*\))/g, (_, prefix, specifier, suffix) => rewriteBareImport(prefix, specifier, suffix));
|
|
44352
44358
|
processedContent = processedContent.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
|
|
44353
|
-
|
|
44354
|
-
|
|
44355
|
-
|
|
44356
|
-
if (path2.endsWith(".ts")) {
|
|
44357
|
-
return `from ${quote}${path2.replace(/\.ts$/, ".js")}${quote}`;
|
|
44359
|
+
const rewritten = rewriteRelativeJsSpecifier(outputPath, path2);
|
|
44360
|
+
if (rewritten !== path2) {
|
|
44361
|
+
return `from ${quote}${rewritten}${quote}`;
|
|
44358
44362
|
}
|
|
44359
44363
|
return match;
|
|
44360
44364
|
});
|
|
@@ -44448,11 +44452,12 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
44448
44452
|
const compiledRoot = compiledParent;
|
|
44449
44453
|
const indexesDir = join15(compiledParent, "indexes");
|
|
44450
44454
|
await fs2.mkdir(indexesDir, { recursive: true });
|
|
44455
|
+
const aotOutputs = hmr ? [] : await compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors);
|
|
44451
44456
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
44452
44457
|
const resolvedEntry = resolve19(entry);
|
|
44453
44458
|
const relativeEntry = relative9(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
44454
|
-
const compileEntry = () =>
|
|
44455
|
-
let outputs = await compileEntry();
|
|
44459
|
+
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
44460
|
+
let outputs = hmr ? await compileEntry() : aotOutputs;
|
|
44456
44461
|
const fileBase = basename7(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
44457
44462
|
const jsName = `${fileBase}.js`;
|
|
44458
44463
|
const compiledFallbackPaths = [
|
|
@@ -44479,7 +44484,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
44479
44484
|
rawServerFile = resolveRawServerFile([]);
|
|
44480
44485
|
}
|
|
44481
44486
|
if (rawServerFile && !existsSync16(rawServerFile)) {
|
|
44482
|
-
outputs = await compileEntry();
|
|
44487
|
+
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
44483
44488
|
rawServerFile = resolveRawServerFile(outputs);
|
|
44484
44489
|
}
|
|
44485
44490
|
if (!rawServerFile || !existsSync16(rawServerFile)) {
|
|
@@ -58560,5 +58565,5 @@ export {
|
|
|
58560
58565
|
ANGULAR_INIT_TIMEOUT_MS
|
|
58561
58566
|
};
|
|
58562
58567
|
|
|
58563
|
-
//# debugId=
|
|
58568
|
+
//# debugId=6AC746B610DD2DD564756E2164756E21
|
|
58564
58569
|
//# sourceMappingURL=index.js.map
|