@absolutejs/absolute 0.19.0-beta.690 → 0.19.0-beta.691

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
@@ -2568,8 +2568,9 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
2568
2568
  // src/build/stylePreprocessor.ts
2569
2569
  import { readFileSync as readFileSync3 } from "fs";
2570
2570
  import { readFile } from "fs/promises";
2571
- import { dirname as dirname3, extname } from "path";
2572
- var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
2571
+ import { createRequire } from "module";
2572
+ import { dirname as dirname3, extname, join as join3 } from "path";
2573
+ var 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)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
2573
2574
  const normalized = filePathOrLanguage.toLowerCase();
2574
2575
  if (normalized === "scss" || normalized.endsWith(".scss"))
2575
2576
  return "scss";
@@ -2578,7 +2579,13 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2578
2579
  if (normalized === "less" || normalized.endsWith(".less"))
2579
2580
  return "less";
2580
2581
  return null;
2581
- }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), compileStyleSource = async (filePath, source, languageHint) => {
2582
+ }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), requireOptionalPeerSync = (specifier) => {
2583
+ try {
2584
+ return requireFromCwd(specifier);
2585
+ } catch {
2586
+ return requireOptionalPeer(specifier);
2587
+ }
2588
+ }, compileStyleSource = async (filePath, source, languageHint) => {
2582
2589
  const language = getStyleLanguage(languageHint ?? filePath);
2583
2590
  const contents = source ?? await readFile(filePath, "utf-8");
2584
2591
  if (language === "scss" || language === "sass") {
@@ -2639,7 +2646,7 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2639
2646
  if (language === "scss" || language === "sass") {
2640
2647
  let sass;
2641
2648
  try {
2642
- sass = requireOptionalPeer("sass");
2649
+ sass = requireOptionalPeerSync("sass");
2643
2650
  } catch {
2644
2651
  throw missingDependencyError("sass", filePath);
2645
2652
  }
@@ -2661,6 +2668,7 @@ var init_stylePreprocessor = __esm(() => {
2661
2668
  STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
2662
2669
  importOptionalPeer = new Function("specifier", "return import(specifier)");
2663
2670
  requireOptionalPeer = new Function("specifier", "return require(specifier)");
2671
+ requireFromCwd = createRequire(join3(process.cwd(), "package.json"));
2664
2672
  stylePreprocessorPlugin = {
2665
2673
  name: "absolute-style-preprocessor",
2666
2674
  setup(build) {
@@ -2699,13 +2707,13 @@ var init_stylePreprocessor = __esm(() => {
2699
2707
 
2700
2708
  // src/core/svelteServerModule.ts
2701
2709
  import { mkdir, readdir as readdir2 } from "fs/promises";
2702
- import { basename as basename3, dirname as dirname4, extname as extname2, join as join3, relative, resolve as resolve4 } from "path";
2710
+ import { basename as basename3, dirname as dirname4, extname as extname2, join as join4, relative, resolve as resolve4 } from "path";
2703
2711
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
2704
2712
  const importPath = relative(dirname4(from), target).replace(/\\/g, "/");
2705
2713
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
2706
2714
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
2707
2715
  for (const entry of entries) {
2708
- const entryPath = join3(dir, entry.name);
2716
+ const entryPath = join4(dir, entry.name);
2709
2717
  if (entry.isDirectory())
2710
2718
  stack.push(entryPath);
2711
2719
  if (entry.isFile() && entry.name === targetFileName) {
@@ -2735,11 +2743,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2735
2743
  if (cachedPath !== undefined) {
2736
2744
  return cachedPath;
2737
2745
  }
2738
- if (!sourcePath.includes(`${join3(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
2746
+ if (!sourcePath.includes(`${join4(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
2739
2747
  originalSourcePathCache.set(sourcePath, sourcePath);
2740
2748
  return sourcePath;
2741
2749
  }
2742
- const resolvedSourcePath = await findSourceFileByBasename(join3(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
2750
+ const resolvedSourcePath = await findSourceFileByBasename(join4(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
2743
2751
  const nextPath = resolvedSourcePath ?? sourcePath;
2744
2752
  originalSourcePathCache.set(sourcePath, nextPath);
2745
2753
  return nextPath;
@@ -2755,11 +2763,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2755
2763
  `${basePath}.mjs`,
2756
2764
  `${basePath}.cjs`,
2757
2765
  `${basePath}.json`,
2758
- join3(basePath, "index.ts"),
2759
- join3(basePath, "index.js"),
2760
- join3(basePath, "index.mjs"),
2761
- join3(basePath, "index.cjs"),
2762
- join3(basePath, "index.json")
2766
+ join4(basePath, "index.ts"),
2767
+ join4(basePath, "index.js"),
2768
+ join4(basePath, "index.mjs"),
2769
+ join4(basePath, "index.cjs"),
2770
+ join4(basePath, "index.json")
2763
2771
  ];
2764
2772
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
2765
2773
  const foundIndex = existResults.indexOf(true);
@@ -2767,7 +2775,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2767
2775
  }, getCachedModulePath = (sourcePath) => {
2768
2776
  const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
2769
2777
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
2770
- return join3(serverCacheRoot, `${normalizedSourcePath}.server.js`);
2778
+ return join4(serverCacheRoot, `${normalizedSourcePath}.server.js`);
2771
2779
  }, resolveSvelteImport = async (spec, from) => {
2772
2780
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
2773
2781
  const resolved = resolvePackageImport(spec);
@@ -2868,7 +2876,7 @@ var init_svelteServerModule = __esm(() => {
2868
2876
  init_lowerIslandSyntax();
2869
2877
  init_lowerAwaitSlotSyntax();
2870
2878
  init_stylePreprocessor();
2871
- serverCacheRoot = join3(process.cwd(), ".absolutejs", "islands", "svelte");
2879
+ serverCacheRoot = join4(process.cwd(), ".absolutejs", "islands", "svelte");
2872
2880
  compiledModuleCache = new Map;
2873
2881
  originalSourcePathCache = new Map;
2874
2882
  transpiler = new Bun.Transpiler({
@@ -3736,5 +3744,5 @@ export {
3736
3744
  Image_default as Image
3737
3745
  };
3738
3746
 
3739
- //# debugId=8E4E80B5A66DAE2664756E2164756E21
3747
+ //# debugId=69CBD443187E1B2F64756E2164756E21
3740
3748
  //# sourceMappingURL=index.js.map