@absolutejs/absolute 0.20.0-beta.126 → 0.20.0-beta.127
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/CHANGELOG.md +9 -0
- package/README.md +19 -0
- package/changelog.json +16 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +35 -29
- package/dist/angular/index.js.map +5 -4
- package/dist/angular/server.js +35 -29
- package/dist/angular/server.js.map +5 -4
- package/dist/build/buildWorker.js +9 -3
- package/dist/build.js +210 -201
- package/dist/build.js.map +8 -7
- package/dist/cli/{compile-smcnjyhb.js → compile-0epdbdcx.js} +1 -1
- package/dist/cli/{index-9q8yn5ax.js → index-54q7pxcx.js} +1 -0
- package/dist/cli/{index-fx42yxhy.js → index-79ppyst7.js} +1 -1
- package/dist/cli/index.js +4 -4
- package/dist/cli/{mobile-50c5tahh.js → mobile-49hyrgrj.js} +1 -1
- package/dist/cli/{prerender-vvrj9vjg.js → prerender-yex2zwj3.js} +1 -1
- package/dist/cli/{start-pdacfgcc.js → start-m0p0qbep.js} +1 -1
- package/dist/index.js +229 -217
- package/dist/index.js.map +11 -9
- package/dist/islands/index.js +10 -4
- package/dist/islands/index.js.map +5 -4
- package/dist/mobile/remoteMacAgentEntry.js +1 -1
- package/dist/react/index.js +10 -4
- package/dist/react/index.js.map +5 -4
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/isFile.d.ts +4 -0
- package/dist/src/utils/isPrerendering.d.ts +5 -0
- package/dist/svelte/index.js +10 -4
- package/dist/svelte/index.js.map +5 -4
- package/dist/vue/index.js +10 -4
- package/dist/vue/index.js.map +5 -4
- package/package.json +2 -2
package/dist/angular/server.js
CHANGED
|
@@ -2877,6 +2877,11 @@ var init_svelteServerModule = __esm(() => {
|
|
|
2877
2877
|
});
|
|
2878
2878
|
});
|
|
2879
2879
|
|
|
2880
|
+
// src/utils/isFile.ts
|
|
2881
|
+
import { statSync } from "fs";
|
|
2882
|
+
var isFile = (path) => statSync(path, { throwIfNoEntry: false })?.isFile() ?? false;
|
|
2883
|
+
var init_isFile = () => {};
|
|
2884
|
+
|
|
2880
2885
|
// src/utils/vueCompiler.ts
|
|
2881
2886
|
var exports_vueCompiler = {};
|
|
2882
2887
|
__export(exports_vueCompiler, {
|
|
@@ -2895,7 +2900,7 @@ var createVueCompiler = async () => {
|
|
|
2895
2900
|
};
|
|
2896
2901
|
|
|
2897
2902
|
// src/core/vueServerModule.ts
|
|
2898
|
-
import {
|
|
2903
|
+
import { readFileSync as readFileSync4, realpathSync } from "fs";
|
|
2899
2904
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
2900
2905
|
import { dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
|
|
2901
2906
|
var {Transpiler } = globalThis.Bun;
|
|
@@ -2942,9 +2947,9 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
2942
2947
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
2943
2948
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
2944
2949
|
fs: {
|
|
2945
|
-
fileExists:
|
|
2950
|
+
fileExists: isFile,
|
|
2946
2951
|
realpath: realpathSync,
|
|
2947
|
-
readFile: (file) =>
|
|
2952
|
+
readFile: (file) => isFile(file) ? readFileSync4(file, "utf-8") : undefined
|
|
2948
2953
|
},
|
|
2949
2954
|
id: componentId,
|
|
2950
2955
|
inlineTemplate: false
|
|
@@ -2989,6 +2994,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
2989
2994
|
};
|
|
2990
2995
|
var init_vueServerModule = __esm(() => {
|
|
2991
2996
|
init_constants();
|
|
2997
|
+
init_isFile();
|
|
2992
2998
|
serverCacheRoot3 = join7(process.cwd(), ".absolutejs", "islands", "vue");
|
|
2993
2999
|
compiledModuleCache3 = new Map;
|
|
2994
3000
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
@@ -5177,7 +5183,7 @@ __export(exports_compileAngular, {
|
|
|
5177
5183
|
compileAngularFiles: () => compileAngularFiles,
|
|
5178
5184
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
5179
5185
|
});
|
|
5180
|
-
import { existsSync as
|
|
5186
|
+
import { existsSync as existsSync4, readFileSync as readFileSync5, promises as fs } from "fs";
|
|
5181
5187
|
import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve6, relative as relative5 } from "path";
|
|
5182
5188
|
var {Glob } = globalThis.Bun;
|
|
5183
5189
|
import ts from "typescript";
|
|
@@ -5234,7 +5240,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5234
5240
|
join9(candidate, "index.js"),
|
|
5235
5241
|
join9(candidate, "index.jsx")
|
|
5236
5242
|
];
|
|
5237
|
-
return candidates.find((file) =>
|
|
5243
|
+
return candidates.find((file) => existsSync4(file));
|
|
5238
5244
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
5239
5245
|
const baseDir = resolve6(rootDir);
|
|
5240
5246
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -5315,11 +5321,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5315
5321
|
}, resolveDevClientDir = () => {
|
|
5316
5322
|
const projectRoot = process.cwd();
|
|
5317
5323
|
const fromSource = resolve6(import.meta.dir, "../dev/client");
|
|
5318
|
-
if (
|
|
5324
|
+
if (existsSync4(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
5319
5325
|
return fromSource;
|
|
5320
5326
|
}
|
|
5321
5327
|
const fromNodeModules = resolve6(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
5322
|
-
if (
|
|
5328
|
+
if (existsSync4(fromNodeModules))
|
|
5323
5329
|
return fromNodeModules;
|
|
5324
5330
|
return resolve6(import.meta.dir, "./dev/client");
|
|
5325
5331
|
}, devClientDir, hmrClientPath, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -5365,11 +5371,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5365
5371
|
return `${path}${query}`;
|
|
5366
5372
|
const importerDir = dirname5(importerOutputPath);
|
|
5367
5373
|
const fileCandidate = resolve6(importerDir, `${path}.js`);
|
|
5368
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
5374
|
+
if (outputFiles?.has(fileCandidate) || existsSync4(fileCandidate)) {
|
|
5369
5375
|
return `${path}.js${query}`;
|
|
5370
5376
|
}
|
|
5371
5377
|
const indexCandidate = resolve6(importerDir, path, "index.js");
|
|
5372
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
5378
|
+
if (outputFiles?.has(indexCandidate) || existsSync4(indexCandidate)) {
|
|
5373
5379
|
return `${path}/index.js${query}`;
|
|
5374
5380
|
}
|
|
5375
5381
|
return `${path}.js${query}`;
|
|
@@ -5407,7 +5413,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5407
5413
|
join9(basePath, "index.mts"),
|
|
5408
5414
|
join9(basePath, "index.cts")
|
|
5409
5415
|
];
|
|
5410
|
-
return candidates.map((candidate) => resolve6(candidate)).find((candidate) =>
|
|
5416
|
+
return candidates.map((candidate) => resolve6(candidate)).find((candidate) => existsSync4(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
5411
5417
|
}, readFileForAotTransform = async (fileName, readFile2) => {
|
|
5412
5418
|
const hostSource = readFile2?.(fileName);
|
|
5413
5419
|
if (typeof hostSource === "string")
|
|
@@ -5488,7 +5494,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5488
5494
|
if (visited.has(resolvedPath))
|
|
5489
5495
|
return;
|
|
5490
5496
|
visited.add(resolvedPath);
|
|
5491
|
-
if (!
|
|
5497
|
+
if (!existsSync4(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
5492
5498
|
return;
|
|
5493
5499
|
stats.filesVisited += 1;
|
|
5494
5500
|
const source = await readFileForAotTransform(resolvedPath, readFile2);
|
|
@@ -5662,7 +5668,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5662
5668
|
return null;
|
|
5663
5669
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
5664
5670
|
const sourceEntry = resolve6(import.meta.dir, "../angular/components/index.ts");
|
|
5665
|
-
if (
|
|
5671
|
+
if (existsSync4(sourceEntry)) {
|
|
5666
5672
|
return sourceEntry.replace(/\\/g, "/");
|
|
5667
5673
|
}
|
|
5668
5674
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -5790,7 +5796,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
5790
5796
|
${fields}
|
|
5791
5797
|
`);
|
|
5792
5798
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
5793
|
-
if (!
|
|
5799
|
+
if (!existsSync4(filePath)) {
|
|
5794
5800
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
5795
5801
|
}
|
|
5796
5802
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -5799,7 +5805,7 @@ ${fields}
|
|
|
5799
5805
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
5800
5806
|
if (templateUrlMatch?.[1]) {
|
|
5801
5807
|
const templatePath = join9(fileDir, templateUrlMatch[1]);
|
|
5802
|
-
if (!
|
|
5808
|
+
if (!existsSync4(templatePath)) {
|
|
5803
5809
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
5804
5810
|
}
|
|
5805
5811
|
const templateRaw2 = await fs.readFile(templatePath, "utf-8");
|
|
@@ -5830,7 +5836,7 @@ ${fields}
|
|
|
5830
5836
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
5831
5837
|
if (templateUrlMatch?.[1]) {
|
|
5832
5838
|
const templatePath = join9(fileDir, templateUrlMatch[1]);
|
|
5833
|
-
if (!
|
|
5839
|
+
if (!existsSync4(templatePath)) {
|
|
5834
5840
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
5835
5841
|
}
|
|
5836
5842
|
const templateRaw2 = readFileSync5(templatePath, "utf-8");
|
|
@@ -5978,7 +5984,7 @@ ${fields}
|
|
|
5978
5984
|
join9(candidate, "index.js"),
|
|
5979
5985
|
join9(candidate, "index.jsx")
|
|
5980
5986
|
];
|
|
5981
|
-
return candidates.find((file) =>
|
|
5987
|
+
return candidates.find((file) => existsSync4(file));
|
|
5982
5988
|
};
|
|
5983
5989
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
5984
5990
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -6053,7 +6059,7 @@ ${fields}
|
|
|
6053
6059
|
if (visited.has(resolved))
|
|
6054
6060
|
return;
|
|
6055
6061
|
visited.add(resolved);
|
|
6056
|
-
if (resolved.endsWith(".json") &&
|
|
6062
|
+
if (resolved.endsWith(".json") && existsSync4(resolved)) {
|
|
6057
6063
|
const inputDir2 = dirname5(resolved);
|
|
6058
6064
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
6059
6065
|
const targetDir2 = join9(outDir, relativeDir2);
|
|
@@ -6066,7 +6072,7 @@ ${fields}
|
|
|
6066
6072
|
let actualPath = resolved;
|
|
6067
6073
|
if (!actualPath.endsWith(".ts"))
|
|
6068
6074
|
actualPath += ".ts";
|
|
6069
|
-
if (!
|
|
6075
|
+
if (!existsSync4(actualPath))
|
|
6070
6076
|
return;
|
|
6071
6077
|
let sourceCode = await fs.readFile(actualPath, "utf-8");
|
|
6072
6078
|
const inlined = await inlineResources(sourceCode, dirname5(actualPath), stylePreprocessors);
|
|
@@ -6104,7 +6110,7 @@ ${fields}
|
|
|
6104
6110
|
const isEntry = resolve6(actualPath) === resolve6(entryPath);
|
|
6105
6111
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
6106
6112
|
const cacheKey2 = actualPath;
|
|
6107
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
6113
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync4(targetPath);
|
|
6108
6114
|
if (shouldWriteFile) {
|
|
6109
6115
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
6110
6116
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -6117,7 +6123,7 @@ ${fields}
|
|
|
6117
6123
|
};
|
|
6118
6124
|
await transpileFile(inputPath);
|
|
6119
6125
|
const entryOutputPath = toOutputPath(entryPath);
|
|
6120
|
-
if (
|
|
6126
|
+
if (existsSync4(entryOutputPath)) {
|
|
6121
6127
|
const entryOutput = await fs.readFile(entryOutputPath, "utf-8");
|
|
6122
6128
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
6123
6129
|
`);
|
|
@@ -6143,7 +6149,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
6143
6149
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
6144
6150
|
const cwd = process.cwd();
|
|
6145
6151
|
const angularSrcDir = resolve6(outRoot);
|
|
6146
|
-
if (!
|
|
6152
|
+
if (!existsSync4(angularSrcDir))
|
|
6147
6153
|
return;
|
|
6148
6154
|
const jsonGlob = new Glob("**/*.json");
|
|
6149
6155
|
for (const rel of jsonGlob.scanSync({
|
|
@@ -6178,15 +6184,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
6178
6184
|
...candidatePaths.map((file) => resolve6(file)),
|
|
6179
6185
|
...compiledFallbackPaths
|
|
6180
6186
|
];
|
|
6181
|
-
let candidate = normalizedCandidates.find((file) =>
|
|
6187
|
+
let candidate = normalizedCandidates.find((file) => existsSync4(file) && file.endsWith(`${sep}${relativeEntry}`));
|
|
6182
6188
|
if (!candidate) {
|
|
6183
|
-
candidate = normalizedCandidates.find((file) =>
|
|
6189
|
+
candidate = normalizedCandidates.find((file) => existsSync4(file) && file.endsWith(`${sep}pages${sep}${jsName}`));
|
|
6184
6190
|
}
|
|
6185
6191
|
if (!candidate) {
|
|
6186
|
-
candidate = normalizedCandidates.find((file) =>
|
|
6192
|
+
candidate = normalizedCandidates.find((file) => existsSync4(file) && file.endsWith(`${sep}${jsName}`));
|
|
6187
6193
|
}
|
|
6188
6194
|
if (!candidate) {
|
|
6189
|
-
candidate = normalizedCandidates.find((file) =>
|
|
6195
|
+
candidate = normalizedCandidates.find((file) => existsSync4(file));
|
|
6190
6196
|
}
|
|
6191
6197
|
return candidate;
|
|
6192
6198
|
};
|
|
@@ -6194,11 +6200,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
6194
6200
|
if (!rawServerFile) {
|
|
6195
6201
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
6196
6202
|
}
|
|
6197
|
-
if (rawServerFile && !
|
|
6203
|
+
if (rawServerFile && !existsSync4(rawServerFile)) {
|
|
6198
6204
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
6199
6205
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
6200
6206
|
}
|
|
6201
|
-
if (!rawServerFile || !
|
|
6207
|
+
if (!rawServerFile || !existsSync4(rawServerFile)) {
|
|
6202
6208
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
6203
6209
|
...outputs,
|
|
6204
6210
|
...compiledFallbackPaths
|
|
@@ -6234,7 +6240,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
6234
6240
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
6235
6241
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
6236
6242
|
const clientFile = join9(indexesDir, jsName);
|
|
6237
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
6243
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync4(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
6238
6244
|
return {
|
|
6239
6245
|
clientPath: clientFile,
|
|
6240
6246
|
indexUnchanged: true,
|
|
@@ -7319,5 +7325,5 @@ export {
|
|
|
7319
7325
|
withPendingTask
|
|
7320
7326
|
};
|
|
7321
7327
|
|
|
7322
|
-
//# debugId=
|
|
7328
|
+
//# debugId=A594F494E6F4308F64756E2164756E21
|
|
7323
7329
|
//# sourceMappingURL=server.js.map
|