@absolutejs/absolute 0.19.0-beta.772 → 0.19.0-beta.774

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/vue/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 resolveAngularPackage = (specifier) => {
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 as dirname2, join } from "path";
1103
+ import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
1104
+ import { dirname as dirname2, 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 = resolveAngularPackage("@angular/core");
1127
- if (existsSync2(join(resolved, "package.json"))) {
1140
+ const resolved = resolveAngularPackageDir("@angular/core");
1141
+ if (resolved && existsSync2(join2(resolved, "package.json"))) {
1128
1142
  return resolved;
1129
1143
  }
1130
1144
  return dirname2(__require.resolve("@angular/core/package.json"));
1131
1145
  }, patchAngularInjectorSingleton = () => {
1132
1146
  try {
1133
1147
  const coreDir = resolveAngularCoreDir();
1134
- const chunkPath = join(coreDir, "fesm2022", "_not_found-chunk.mjs");
1135
- const content = readFileSync(chunkPath, "utf-8");
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
  };
@@ -1744,8 +1758,8 @@ var init_islandSsr = __esm(() => {
1744
1758
  });
1745
1759
 
1746
1760
  // src/build/resolvePackageImport.ts
1747
- import { resolve as resolve2, join as join2 } from "path";
1748
- import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
1761
+ import { resolve as resolve2, join as join3 } from "path";
1762
+ import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
1749
1763
  var resolveExportPath = (entry, conditions) => {
1750
1764
  if (typeof entry === "string")
1751
1765
  return entry;
@@ -1767,14 +1781,14 @@ var resolveExportPath = (entry, conditions) => {
1767
1781
  const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
1768
1782
  const exportKey = subpath ? `./${subpath}` : ".";
1769
1783
  const currentPackageJsonPath = resolve2(process.cwd(), "package.json");
1770
- const currentPackageJson = existsSync3(currentPackageJsonPath) ? JSON.parse(readFileSync2(currentPackageJsonPath, "utf-8")) : null;
1784
+ const currentPackageJson = existsSync3(currentPackageJsonPath) ? JSON.parse(readFileSync3(currentPackageJsonPath, "utf-8")) : null;
1771
1785
  const currentPackageDir = currentPackageJson?.name === packageName ? process.cwd() : null;
1772
1786
  const packageDir = currentPackageDir ?? resolve2(process.cwd(), "node_modules", packageName ?? "");
1773
- const packageJsonPath = join2(packageDir, "package.json");
1787
+ const packageJsonPath = join3(packageDir, "package.json");
1774
1788
  if (!existsSync3(packageJsonPath))
1775
1789
  return null;
1776
1790
  try {
1777
- const packageJson = currentPackageDir && currentPackageJson ? currentPackageJson : JSON.parse(readFileSync2(packageJsonPath, "utf-8"));
1791
+ const packageJson = currentPackageDir && currentPackageJson ? currentPackageJson : JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
1778
1792
  const { exports } = packageJson;
1779
1793
  if (!exports)
1780
1794
  return null;
@@ -1938,10 +1952,10 @@ __export(exports_stylePreprocessor, {
1938
1952
  compileStyleFileIfNeededSync: () => compileStyleFileIfNeededSync,
1939
1953
  compileStyleFileIfNeeded: () => compileStyleFileIfNeeded
1940
1954
  });
1941
- import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
1955
+ import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
1942
1956
  import { readFile } from "fs/promises";
1943
1957
  import { createRequire } from "module";
1944
- import { dirname as dirname3, extname, isAbsolute, join as join3, relative, resolve as resolve3 } from "path";
1958
+ import { dirname as dirname3, extname, isAbsolute, join as join4, relative, resolve as resolve3 } from "path";
1945
1959
  import { fileURLToPath } from "url";
1946
1960
  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
1961
  const normalized = filePathOrLanguage.toLowerCase();
@@ -1978,7 +1992,7 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
1978
1992
  return empty;
1979
1993
  }
1980
1994
  try {
1981
- const parsed = JSON.parse(stripJsonComments(readFileSync3(tsconfigPath, "utf-8")));
1995
+ const parsed = JSON.parse(stripJsonComments(readFileSync4(tsconfigPath, "utf-8")));
1982
1996
  const compilerOptions = parsed.compilerOptions ?? {};
1983
1997
  const baseUrl = resolve3(cwd, compilerOptions.baseUrl ?? ".");
1984
1998
  tsconfigAliasCache = {
@@ -2019,13 +2033,13 @@ var CSS_EXTENSION_PATTERN, STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTE
2019
2033
  const ext = extname(basePath);
2020
2034
  const paths = ext ? [basePath] : getLanguageExtensions(language).flatMap((extension) => [
2021
2035
  `${basePath}${extension}`,
2022
- join3(basePath, `index${extension}`)
2036
+ join4(basePath, `index${extension}`)
2023
2037
  ]);
2024
2038
  if (language === "scss" || language === "sass") {
2025
2039
  return paths.flatMap((path) => {
2026
2040
  const dir = dirname3(path);
2027
2041
  const base = path.slice(dir.length + 1);
2028
- return [path, join3(dir, `_${base}`)];
2042
+ return [path, join4(dir, `_${base}`)];
2029
2043
  });
2030
2044
  }
2031
2045
  return paths;
@@ -2166,7 +2180,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2166
2180
  if (fileLanguage !== "scss" && fileLanguage !== "sass" && fileLanguage !== null)
2167
2181
  return null;
2168
2182
  return {
2169
- contents: preprocessLoadedStyle(readFileSync3(filePath, "utf-8"), filePath, entryFile, loadPaths, language, config),
2183
+ contents: preprocessLoadedStyle(readFileSync4(filePath, "utf-8"), filePath, entryFile, loadPaths, language, config),
2170
2184
  syntax: filePath.endsWith(".sass") ? "indented" : "scss"
2171
2185
  };
2172
2186
  }
@@ -2327,7 +2341,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2327
2341
  }
2328
2342
  return compileStyleSource(filePath, undefined, undefined, config);
2329
2343
  }, compileStyleFileIfNeededSync = (filePath, config) => {
2330
- const rawContents = readFileSync3(filePath, "utf-8");
2344
+ const rawContents = readFileSync4(filePath, "utf-8");
2331
2345
  const language = getStyleLanguage(filePath);
2332
2346
  if (config?.postcss) {
2333
2347
  throw new Error(`Unable to compile ${filePath}: PostCSS preprocessing is async-only.`);
@@ -2368,19 +2382,19 @@ var init_stylePreprocessor = __esm(() => {
2368
2382
  STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less|styl(?:us)?)$/i;
2369
2383
  importOptionalPeer = new Function("specifier", "return import(specifier)");
2370
2384
  requireOptionalPeer = new Function("specifier", "return require(specifier)");
2371
- requireFromCwd = createRequire(join3(process.cwd(), "package.json"));
2385
+ requireFromCwd = createRequire(join4(process.cwd(), "package.json"));
2372
2386
  stylePreprocessorPlugin = createStylePreprocessorPlugin();
2373
2387
  });
2374
2388
 
2375
2389
  // src/core/svelteServerModule.ts
2376
2390
  import { mkdir, readdir as readdir2 } from "fs/promises";
2377
- import { basename as basename3, dirname as dirname4, extname as extname2, join as join4, relative as relative2, resolve as resolve4 } from "path";
2391
+ import { basename as basename3, dirname as dirname4, extname as extname2, join as join5, relative as relative2, resolve as resolve4 } from "path";
2378
2392
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
2379
2393
  const importPath = relative2(dirname4(from), target).replace(/\\/g, "/");
2380
2394
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
2381
2395
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
2382
2396
  for (const entry of entries) {
2383
- const entryPath = join4(dir, entry.name);
2397
+ const entryPath = join5(dir, entry.name);
2384
2398
  if (entry.isDirectory())
2385
2399
  stack.push(entryPath);
2386
2400
  if (entry.isFile() && entry.name === targetFileName) {
@@ -2410,11 +2424,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2410
2424
  if (cachedPath !== undefined) {
2411
2425
  return cachedPath;
2412
2426
  }
2413
- if (!sourcePath.includes(`${join4(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
2427
+ if (!sourcePath.includes(`${join5(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
2414
2428
  originalSourcePathCache.set(sourcePath, sourcePath);
2415
2429
  return sourcePath;
2416
2430
  }
2417
- const resolvedSourcePath = await findSourceFileByBasename(join4(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
2431
+ const resolvedSourcePath = await findSourceFileByBasename(join5(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
2418
2432
  const nextPath = resolvedSourcePath ?? sourcePath;
2419
2433
  originalSourcePathCache.set(sourcePath, nextPath);
2420
2434
  return nextPath;
@@ -2430,11 +2444,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2430
2444
  `${basePath}.mjs`,
2431
2445
  `${basePath}.cjs`,
2432
2446
  `${basePath}.json`,
2433
- join4(basePath, "index.ts"),
2434
- join4(basePath, "index.js"),
2435
- join4(basePath, "index.mjs"),
2436
- join4(basePath, "index.cjs"),
2437
- join4(basePath, "index.json")
2447
+ join5(basePath, "index.ts"),
2448
+ join5(basePath, "index.js"),
2449
+ join5(basePath, "index.mjs"),
2450
+ join5(basePath, "index.cjs"),
2451
+ join5(basePath, "index.json")
2438
2452
  ];
2439
2453
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
2440
2454
  const foundIndex = existResults.indexOf(true);
@@ -2442,7 +2456,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2442
2456
  }, getCachedModulePath = (sourcePath) => {
2443
2457
  const relativeSourcePath = relative2(process.cwd(), sourcePath).replace(/\\/g, "/");
2444
2458
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
2445
- return join4(serverCacheRoot, `${normalizedSourcePath}.server.js`);
2459
+ return join5(serverCacheRoot, `${normalizedSourcePath}.server.js`);
2446
2460
  }, resolveSvelteImport = async (spec, from) => {
2447
2461
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
2448
2462
  const resolved = resolvePackageImport(spec);
@@ -2543,7 +2557,7 @@ var init_svelteServerModule = __esm(() => {
2543
2557
  init_lowerIslandSyntax();
2544
2558
  init_lowerAwaitSlotSyntax();
2545
2559
  init_stylePreprocessor();
2546
- serverCacheRoot = join4(process.cwd(), ".absolutejs", "islands", "svelte");
2560
+ serverCacheRoot = join5(process.cwd(), ".absolutejs", "islands", "svelte");
2547
2561
  compiledModuleCache = new Map;
2548
2562
  originalSourcePathCache = new Map;
2549
2563
  transpiler = new Bun.Transpiler({
@@ -4272,5 +4286,5 @@ export {
4272
4286
  Image
4273
4287
  };
4274
4288
 
4275
- //# debugId=BC6B96F7D19D8FA864756E2164756E21
4289
+ //# debugId=DF3D0241A99B876F64756E2164756E21
4276
4290
  //# sourceMappingURL=index.js.map