@absolutejs/absolute 0.19.0-beta.772 → 0.19.0-beta.773
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 +94 -78
- package/dist/angular/index.js.map +5 -5
- package/dist/angular/server.js +94 -78
- package/dist/angular/server.js.map +5 -5
- package/dist/build.js +350 -299
- package/dist/build.js.map +5 -5
- package/dist/cli/index.js +27 -3
- package/dist/client/index.js +27 -11
- package/dist/client/index.js.map +4 -4
- package/dist/index.js +408 -357
- package/dist/index.js.map +5 -5
- package/dist/islands/index.js +52 -36
- package/dist/islands/index.js.map +4 -4
- package/dist/react/browser.js +7 -7
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +101 -101
- package/dist/react/components/index.js +104 -104
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/index.js +63 -47
- package/dist/react/index.js.map +4 -4
- package/dist/react/server.js +2 -2
- package/dist/react/server.js.map +1 -1
- package/dist/src/angular/resolveAngularPackage.d.ts +6 -4
- package/dist/svelte/index.js +29 -13
- package/dist/svelte/index.js.map +4 -4
- package/dist/svelte/server.js +3 -3
- package/dist/svelte/server.js.map +1 -1
- package/dist/vue/index.js +53 -37
- package/dist/vue/index.js.map +4 -4
- package/dist/vue/server.js +2 -2
- package/dist/vue/server.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1070,9 +1070,9 @@ var requireCurrentIslandRegistry = () => {
|
|
|
1070
1070
|
};
|
|
1071
1071
|
|
|
1072
1072
|
// src/angular/resolveAngularPackage.ts
|
|
1073
|
-
import { existsSync } from "fs";
|
|
1074
|
-
import { resolve } from "path";
|
|
1075
|
-
var
|
|
1073
|
+
import { existsSync, readFileSync } from "fs";
|
|
1074
|
+
import { join, resolve } from "path";
|
|
1075
|
+
var resolveAngularPackageDir = (specifier) => {
|
|
1076
1076
|
const fromCompiledRuntime = process.env.ABSOLUTE_BUILD_DIR ? resolve(process.env.ABSOLUTE_BUILD_DIR, "node_modules", specifier) : null;
|
|
1077
1077
|
if (fromCompiledRuntime && existsSync(fromCompiledRuntime)) {
|
|
1078
1078
|
return fromCompiledRuntime;
|
|
@@ -1081,13 +1081,27 @@ var resolveAngularPackage = (specifier) => {
|
|
|
1081
1081
|
if (existsSync(fromProject)) {
|
|
1082
1082
|
return fromProject;
|
|
1083
1083
|
}
|
|
1084
|
+
return null;
|
|
1085
|
+
}, resolvePackageEntry = (packageDir) => {
|
|
1086
|
+
try {
|
|
1087
|
+
const pkg = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf-8"));
|
|
1088
|
+
const rootExport = pkg.exports?.["."];
|
|
1089
|
+
const entry = (typeof rootExport === "string" ? rootExport : rootExport?.default) ?? pkg.module ?? pkg.main ?? "index.js";
|
|
1090
|
+
return join(packageDir, entry);
|
|
1091
|
+
} catch {
|
|
1092
|
+
return packageDir;
|
|
1093
|
+
}
|
|
1094
|
+
}, resolveAngularPackage = (specifier) => {
|
|
1095
|
+
const packageDir = resolveAngularPackageDir(specifier);
|
|
1096
|
+
if (packageDir)
|
|
1097
|
+
return resolvePackageEntry(packageDir);
|
|
1084
1098
|
return specifier;
|
|
1085
1099
|
};
|
|
1086
1100
|
var init_resolveAngularPackage = () => {};
|
|
1087
1101
|
|
|
1088
1102
|
// src/angular/injectorPatch.ts
|
|
1089
|
-
import { existsSync as existsSync2, readFileSync, writeFileSync } from "fs";
|
|
1090
|
-
import { dirname, join } from "path";
|
|
1103
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
1104
|
+
import { dirname, join as join2 } from "path";
|
|
1091
1105
|
var applyInjectorPatch = (chunkPath, content) => {
|
|
1092
1106
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
1093
1107
|
return;
|
|
@@ -1123,16 +1137,16 @@ var applyInjectorPatch = (chunkPath, content) => {
|
|
|
1123
1137
|
}
|
|
1124
1138
|
writeFileSync(chunkPath, patched, "utf-8");
|
|
1125
1139
|
}, resolveAngularCoreDir = () => {
|
|
1126
|
-
const resolved =
|
|
1127
|
-
if (existsSync2(
|
|
1140
|
+
const resolved = resolveAngularPackageDir("@angular/core");
|
|
1141
|
+
if (resolved && existsSync2(join2(resolved, "package.json"))) {
|
|
1128
1142
|
return resolved;
|
|
1129
1143
|
}
|
|
1130
1144
|
return dirname(__require.resolve("@angular/core/package.json"));
|
|
1131
1145
|
}, patchAngularInjectorSingleton = () => {
|
|
1132
1146
|
try {
|
|
1133
1147
|
const coreDir = resolveAngularCoreDir();
|
|
1134
|
-
const chunkPath =
|
|
1135
|
-
const content =
|
|
1148
|
+
const chunkPath = join2(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
1149
|
+
const content = readFileSync2(chunkPath, "utf-8");
|
|
1136
1150
|
applyInjectorPatch(chunkPath, content);
|
|
1137
1151
|
} catch {}
|
|
1138
1152
|
};
|
|
@@ -1301,7 +1315,9 @@ var initDominoAdapter = (platformServer) => {
|
|
|
1301
1315
|
import(resolveAngularPackage("@angular/common")),
|
|
1302
1316
|
import(resolveAngularPackage("@angular/core"))
|
|
1303
1317
|
]);
|
|
1304
|
-
if (
|
|
1318
|
+
if (true) {
|
|
1319
|
+
core.enableProdMode();
|
|
1320
|
+
}
|
|
1305
1321
|
initDominoAdapter(platformServer);
|
|
1306
1322
|
return {
|
|
1307
1323
|
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
@@ -1744,8 +1760,8 @@ var init_islandSsr = __esm(() => {
|
|
|
1744
1760
|
});
|
|
1745
1761
|
|
|
1746
1762
|
// src/build/resolvePackageImport.ts
|
|
1747
|
-
import { resolve as resolve2, join as
|
|
1748
|
-
import { existsSync as existsSync3, readFileSync as
|
|
1763
|
+
import { resolve as resolve2, join as join3 } from "path";
|
|
1764
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
|
|
1749
1765
|
var resolveExportPath = (entry, conditions) => {
|
|
1750
1766
|
if (typeof entry === "string")
|
|
1751
1767
|
return entry;
|
|
@@ -1767,14 +1783,14 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
1767
1783
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
1768
1784
|
const exportKey = subpath ? `./${subpath}` : ".";
|
|
1769
1785
|
const currentPackageJsonPath = resolve2(process.cwd(), "package.json");
|
|
1770
|
-
const currentPackageJson = existsSync3(currentPackageJsonPath) ? JSON.parse(
|
|
1786
|
+
const currentPackageJson = existsSync3(currentPackageJsonPath) ? JSON.parse(readFileSync3(currentPackageJsonPath, "utf-8")) : null;
|
|
1771
1787
|
const currentPackageDir = currentPackageJson?.name === packageName ? process.cwd() : null;
|
|
1772
1788
|
const packageDir = currentPackageDir ?? resolve2(process.cwd(), "node_modules", packageName ?? "");
|
|
1773
|
-
const packageJsonPath =
|
|
1789
|
+
const packageJsonPath = join3(packageDir, "package.json");
|
|
1774
1790
|
if (!existsSync3(packageJsonPath))
|
|
1775
1791
|
return null;
|
|
1776
1792
|
try {
|
|
1777
|
-
const packageJson = currentPackageDir && currentPackageJson ? currentPackageJson : JSON.parse(
|
|
1793
|
+
const packageJson = currentPackageDir && currentPackageJson ? currentPackageJson : JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
|
|
1778
1794
|
const { exports } = packageJson;
|
|
1779
1795
|
if (!exports)
|
|
1780
1796
|
return null;
|
|
@@ -1938,10 +1954,10 @@ __export(exports_stylePreprocessor, {
|
|
|
1938
1954
|
compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
|
|
1939
1955
|
compileStyleFileIfNeeded: () => compileStyleFileIfNeeded
|
|
1940
1956
|
});
|
|
1941
|
-
import { existsSync as existsSync4, readFileSync as
|
|
1957
|
+
import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
|
|
1942
1958
|
import { readFile } from "fs/promises";
|
|
1943
1959
|
import { createRequire } from "module";
|
|
1944
|
-
import { dirname as dirname2, extname, isAbsolute, join as
|
|
1960
|
+
import { dirname as dirname2, extname, isAbsolute, join as join4, relative, resolve as resolve3 } from "path";
|
|
1945
1961
|
import { fileURLToPath } from "url";
|
|
1946
1962
|
var CSS_EXTENSION_PATTERN, 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|styl(?:us)?)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less|styl(?:us)?)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
|
|
1947
1963
|
const normalized = filePathOrLanguage.toLowerCase();
|
|
@@ -1978,7 +1994,7 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
|
|
|
1978
1994
|
return empty;
|
|
1979
1995
|
}
|
|
1980
1996
|
try {
|
|
1981
|
-
const parsed = JSON.parse(stripJsonComments(
|
|
1997
|
+
const parsed = JSON.parse(stripJsonComments(readFileSync4(tsconfigPath, "utf-8")));
|
|
1982
1998
|
const compilerOptions = parsed.compilerOptions ?? {};
|
|
1983
1999
|
const baseUrl = resolve3(cwd, compilerOptions.baseUrl ?? ".");
|
|
1984
2000
|
tsconfigAliasCache = {
|
|
@@ -2019,13 +2035,13 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
|
|
|
2019
2035
|
const ext = extname(basePath);
|
|
2020
2036
|
const paths = ext ? [basePath] : getLanguageExtensions(language).flatMap((extension) => [
|
|
2021
2037
|
`${basePath}${extension}`,
|
|
2022
|
-
|
|
2038
|
+
join4(basePath, `index${extension}`)
|
|
2023
2039
|
]);
|
|
2024
2040
|
if (language === "scss" || language === "sass") {
|
|
2025
2041
|
return paths.flatMap((path) => {
|
|
2026
2042
|
const dir = dirname2(path);
|
|
2027
2043
|
const base = path.slice(dir.length + 1);
|
|
2028
|
-
return [path,
|
|
2044
|
+
return [path, join4(dir, `_${base}`)];
|
|
2029
2045
|
});
|
|
2030
2046
|
}
|
|
2031
2047
|
return paths;
|
|
@@ -2101,7 +2117,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
2101
2117
|
const config = normalizePostcssModule(loaded);
|
|
2102
2118
|
const value = typeof config === "function" ? await config({
|
|
2103
2119
|
cwd: process.cwd(),
|
|
2104
|
-
env: "
|
|
2120
|
+
env: "test"
|
|
2105
2121
|
}) : config;
|
|
2106
2122
|
return normalizePostcssModule(value) ?? {};
|
|
2107
2123
|
}, normalizePostcssPlugins = (plugins) => {
|
|
@@ -2166,7 +2182,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
2166
2182
|
if (fileLanguage !== "scss" && fileLanguage !== "sass" && fileLanguage !== null)
|
|
2167
2183
|
return null;
|
|
2168
2184
|
return {
|
|
2169
|
-
contents: preprocessLoadedStyle(
|
|
2185
|
+
contents: preprocessLoadedStyle(readFileSync4(filePath, "utf-8"), filePath, entryFile, loadPaths, language, config),
|
|
2170
2186
|
syntax: filePath.endsWith(".sass") ? "indented" : "scss"
|
|
2171
2187
|
};
|
|
2172
2188
|
}
|
|
@@ -2327,7 +2343,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
|
|
|
2327
2343
|
}
|
|
2328
2344
|
return compileStyleSource(filePath, undefined, undefined, config);
|
|
2329
2345
|
}, compileStyleFileIfNeededSync = (filePath, config) => {
|
|
2330
|
-
const rawContents =
|
|
2346
|
+
const rawContents = readFileSync4(filePath, "utf-8");
|
|
2331
2347
|
const language = getStyleLanguage(filePath);
|
|
2332
2348
|
if (config?.postcss) {
|
|
2333
2349
|
throw new Error(`Unable to compile ${filePath}: PostCSS preprocessing is async-only.`);
|
|
@@ -2368,19 +2384,19 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
2368
2384
|
STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less|styl(?:us)?)$/i;
|
|
2369
2385
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
2370
2386
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
2371
|
-
requireFromCwd = createRequire(
|
|
2387
|
+
requireFromCwd = createRequire(join4(process.cwd(), "package.json"));
|
|
2372
2388
|
stylePreprocessorPlugin = createStylePreprocessorPlugin();
|
|
2373
2389
|
});
|
|
2374
2390
|
|
|
2375
2391
|
// src/core/svelteServerModule.ts
|
|
2376
2392
|
import { mkdir, readdir } from "fs/promises";
|
|
2377
|
-
import { basename as basename2, dirname as dirname3, extname as extname2, join as
|
|
2393
|
+
import { basename as basename2, dirname as dirname3, extname as extname2, join as join5, relative as relative2, resolve as resolve4 } from "path";
|
|
2378
2394
|
var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
2379
2395
|
const importPath = relative2(dirname3(from), target).replace(/\\/g, "/");
|
|
2380
2396
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
2381
2397
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
2382
2398
|
for (const entry of entries) {
|
|
2383
|
-
const entryPath =
|
|
2399
|
+
const entryPath = join5(dir, entry.name);
|
|
2384
2400
|
if (entry.isDirectory())
|
|
2385
2401
|
stack.push(entryPath);
|
|
2386
2402
|
if (entry.isFile() && entry.name === targetFileName) {
|
|
@@ -2410,11 +2426,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
2410
2426
|
if (cachedPath !== undefined) {
|
|
2411
2427
|
return cachedPath;
|
|
2412
2428
|
}
|
|
2413
|
-
if (!sourcePath.includes(`${
|
|
2429
|
+
if (!sourcePath.includes(`${join5(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
|
|
2414
2430
|
originalSourcePathCache.set(sourcePath, sourcePath);
|
|
2415
2431
|
return sourcePath;
|
|
2416
2432
|
}
|
|
2417
|
-
const resolvedSourcePath = await findSourceFileByBasename(
|
|
2433
|
+
const resolvedSourcePath = await findSourceFileByBasename(join5(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
|
|
2418
2434
|
const nextPath = resolvedSourcePath ?? sourcePath;
|
|
2419
2435
|
originalSourcePathCache.set(sourcePath, nextPath);
|
|
2420
2436
|
return nextPath;
|
|
@@ -2430,11 +2446,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
2430
2446
|
`${basePath}.mjs`,
|
|
2431
2447
|
`${basePath}.cjs`,
|
|
2432
2448
|
`${basePath}.json`,
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2449
|
+
join5(basePath, "index.ts"),
|
|
2450
|
+
join5(basePath, "index.js"),
|
|
2451
|
+
join5(basePath, "index.mjs"),
|
|
2452
|
+
join5(basePath, "index.cjs"),
|
|
2453
|
+
join5(basePath, "index.json")
|
|
2438
2454
|
];
|
|
2439
2455
|
const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
|
|
2440
2456
|
const foundIndex = existResults.indexOf(true);
|
|
@@ -2442,7 +2458,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
2442
2458
|
}, getCachedModulePath = (sourcePath) => {
|
|
2443
2459
|
const relativeSourcePath = relative2(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
2444
2460
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
2445
|
-
return
|
|
2461
|
+
return join5(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
2446
2462
|
}, resolveSvelteImport = async (spec, from) => {
|
|
2447
2463
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
2448
2464
|
const resolved = resolvePackageImport(spec);
|
|
@@ -2543,7 +2559,7 @@ var init_svelteServerModule = __esm(() => {
|
|
|
2543
2559
|
init_lowerIslandSyntax();
|
|
2544
2560
|
init_lowerAwaitSlotSyntax();
|
|
2545
2561
|
init_stylePreprocessor();
|
|
2546
|
-
serverCacheRoot =
|
|
2562
|
+
serverCacheRoot = join5(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
2547
2563
|
compiledModuleCache = new Map;
|
|
2548
2564
|
originalSourcePathCache = new Map;
|
|
2549
2565
|
transpiler = new Bun.Transpiler({
|
|
@@ -3216,7 +3232,7 @@ var hasErrorConvention = (framework) => {
|
|
|
3216
3232
|
var setConventions = (map) => {
|
|
3217
3233
|
Reflect.set(globalThis, CONVENTIONS_KEY, map);
|
|
3218
3234
|
};
|
|
3219
|
-
var isDev = () =>
|
|
3235
|
+
var isDev = () => false;
|
|
3220
3236
|
var buildErrorProps = (error) => {
|
|
3221
3237
|
const message = error instanceof Error ? error.message : String(error);
|
|
3222
3238
|
const stack = isDev() && error instanceof Error ? error.stack : undefined;
|
|
@@ -3482,37 +3498,37 @@ var handleReactPageRequest = async (input) => {
|
|
|
3482
3498
|
// src/react/Island.tsx
|
|
3483
3499
|
init_islandMarkupAttributes();
|
|
3484
3500
|
init_renderIslandMarkup();
|
|
3485
|
-
import {
|
|
3501
|
+
import { jsx } from "react/jsx-runtime";
|
|
3486
3502
|
var Island = async (props) => {
|
|
3487
3503
|
if (typeof window !== "undefined") {
|
|
3488
|
-
return /* @__PURE__ */
|
|
3504
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3489
3505
|
...getIslandMarkerAttributes(props),
|
|
3490
3506
|
suppressHydrationWarning: true
|
|
3491
|
-
}
|
|
3507
|
+
});
|
|
3492
3508
|
}
|
|
3493
3509
|
const result = await renderIslandResult(requireCurrentIslandRegistry(), props);
|
|
3494
|
-
return /* @__PURE__ */
|
|
3510
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3495
3511
|
...result.attributes,
|
|
3496
3512
|
dangerouslySetInnerHTML: { __html: result.html }
|
|
3497
|
-
}
|
|
3513
|
+
});
|
|
3498
3514
|
};
|
|
3499
3515
|
// src/react/createIsland.tsx
|
|
3500
3516
|
init_islandMarkupAttributes();
|
|
3501
3517
|
init_renderIslandMarkup();
|
|
3502
|
-
import {
|
|
3518
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3503
3519
|
var createTypedIsland = (registry) => {
|
|
3504
3520
|
const Island2 = async (props) => {
|
|
3505
3521
|
if (typeof window !== "undefined") {
|
|
3506
|
-
return /* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
3507
3523
|
...getIslandMarkerAttributes(props),
|
|
3508
3524
|
suppressHydrationWarning: true
|
|
3509
|
-
}
|
|
3525
|
+
});
|
|
3510
3526
|
}
|
|
3511
3527
|
const result = await renderIslandResult(registry, props);
|
|
3512
|
-
return /* @__PURE__ */
|
|
3528
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
3513
3529
|
...result.attributes,
|
|
3514
3530
|
dangerouslySetInnerHTML: { __html: result.html }
|
|
3515
|
-
}
|
|
3531
|
+
});
|
|
3516
3532
|
};
|
|
3517
3533
|
return Island2;
|
|
3518
3534
|
};
|
|
@@ -3643,5 +3659,5 @@ export {
|
|
|
3643
3659
|
Island
|
|
3644
3660
|
};
|
|
3645
3661
|
|
|
3646
|
-
//# debugId=
|
|
3662
|
+
//# debugId=F60E9BCA23B8A84764756E2164756E21
|
|
3647
3663
|
//# sourceMappingURL=index.js.map
|