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

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.
@@ -359,10 +359,10 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
359
359
  });
360
360
 
361
361
  // src/build/stylePreprocessor.ts
362
- import { readFileSync as readFileSync2 } from "fs";
363
362
  import { readFile } from "fs/promises";
364
- import { dirname, extname } from "path";
365
- 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) => {
363
+ import { createRequire } from "module";
364
+ import { dirname, extname, join as join2 } from "path";
365
+ 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) => {
366
366
  const normalized = filePathOrLanguage.toLowerCase();
367
367
  if (normalized === "scss" || normalized.endsWith(".scss"))
368
368
  return "scss";
@@ -426,27 +426,6 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
426
426
  return readFile(filePath, "utf-8");
427
427
  }
428
428
  return compileStyleSource(filePath);
429
- }, compileStyleFileIfNeededSync = (filePath) => {
430
- const contents = readFileSync2(filePath, "utf-8");
431
- const language = getStyleLanguage(filePath);
432
- if (language === "scss" || language === "sass") {
433
- let sass;
434
- try {
435
- sass = requireOptionalPeer("sass");
436
- } catch {
437
- throw missingDependencyError("sass", filePath);
438
- }
439
- return sass.compileString(contents, {
440
- loadPaths: [dirname(filePath), process.cwd()],
441
- style: "expanded",
442
- syntax: language === "sass" ? "indented" : "scss",
443
- url: new URL(`file://${filePath}`)
444
- }).css;
445
- }
446
- if (language === "less") {
447
- throw new Error(`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
448
- }
449
- return contents;
450
429
  };
451
430
  var init_stylePreprocessor = __esm(() => {
452
431
  STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
@@ -454,6 +433,7 @@ var init_stylePreprocessor = __esm(() => {
454
433
  STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
455
434
  importOptionalPeer = new Function("specifier", "return import(specifier)");
456
435
  requireOptionalPeer = new Function("specifier", "return require(specifier)");
436
+ requireFromCwd = createRequire(join2(process.cwd(), "package.json"));
457
437
  stylePreprocessorPlugin = {
458
438
  name: "absolute-style-preprocessor",
459
439
  setup(build) {
@@ -492,13 +472,13 @@ var init_stylePreprocessor = __esm(() => {
492
472
 
493
473
  // src/core/svelteServerModule.ts
494
474
  import { mkdir, readdir } from "fs/promises";
495
- import { basename, dirname as dirname2, extname as extname2, join as join2, relative, resolve as resolve2 } from "path";
475
+ import { basename, dirname as dirname2, extname as extname2, join as join3, relative, resolve as resolve2 } from "path";
496
476
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
497
477
  const importPath = relative(dirname2(from), target).replace(/\\/g, "/");
498
478
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
499
479
  }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
500
480
  for (const entry of entries) {
501
- const entryPath = join2(dir, entry.name);
481
+ const entryPath = join3(dir, entry.name);
502
482
  if (entry.isDirectory())
503
483
  stack.push(entryPath);
504
484
  if (entry.isFile() && entry.name === targetFileName) {
@@ -528,11 +508,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
528
508
  if (cachedPath !== undefined) {
529
509
  return cachedPath;
530
510
  }
531
- if (!sourcePath.includes(`${join2(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
511
+ if (!sourcePath.includes(`${join3(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
532
512
  originalSourcePathCache.set(sourcePath, sourcePath);
533
513
  return sourcePath;
534
514
  }
535
- const resolvedSourcePath = await findSourceFileByBasename(join2(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
515
+ const resolvedSourcePath = await findSourceFileByBasename(join3(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
536
516
  const nextPath = resolvedSourcePath ?? sourcePath;
537
517
  originalSourcePathCache.set(sourcePath, nextPath);
538
518
  return nextPath;
@@ -548,11 +528,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
548
528
  `${basePath}.mjs`,
549
529
  `${basePath}.cjs`,
550
530
  `${basePath}.json`,
551
- join2(basePath, "index.ts"),
552
- join2(basePath, "index.js"),
553
- join2(basePath, "index.mjs"),
554
- join2(basePath, "index.cjs"),
555
- join2(basePath, "index.json")
531
+ join3(basePath, "index.ts"),
532
+ join3(basePath, "index.js"),
533
+ join3(basePath, "index.mjs"),
534
+ join3(basePath, "index.cjs"),
535
+ join3(basePath, "index.json")
556
536
  ];
557
537
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
558
538
  const foundIndex = existResults.indexOf(true);
@@ -560,7 +540,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
560
540
  }, getCachedModulePath = (sourcePath) => {
561
541
  const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
562
542
  const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
563
- return join2(serverCacheRoot, `${normalizedSourcePath}.server.js`);
543
+ return join3(serverCacheRoot, `${normalizedSourcePath}.server.js`);
564
544
  }, resolveSvelteImport = async (spec, from) => {
565
545
  if (!spec.startsWith(".") && !spec.startsWith("/")) {
566
546
  const resolved = resolvePackageImport(spec);
@@ -661,7 +641,7 @@ var init_svelteServerModule = __esm(() => {
661
641
  init_lowerIslandSyntax();
662
642
  init_lowerAwaitSlotSyntax();
663
643
  init_stylePreprocessor();
664
- serverCacheRoot = join2(process.cwd(), ".absolutejs", "islands", "svelte");
644
+ serverCacheRoot = join3(process.cwd(), ".absolutejs", "islands", "svelte");
665
645
  compiledModuleCache = new Map;
666
646
  originalSourcePathCache = new Map;
667
647
  transpiler = new Bun.Transpiler({
@@ -2302,8 +2282,8 @@ var init_pageHandler = __esm(() => {
2302
2282
  });
2303
2283
 
2304
2284
  // src/angular/injectorPatch.ts
2305
- import { existsSync as existsSync2, readFileSync as readFileSync3, writeFileSync } from "fs";
2306
- import { dirname as dirname3, join as join3, resolve as resolve3 } from "path";
2285
+ import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
2286
+ import { dirname as dirname3, join as join4, resolve as resolve3 } from "path";
2307
2287
  var applyInjectorPatch = (chunkPath, content) => {
2308
2288
  if (content.includes('Symbol.for("angular.currentInjector")')) {
2309
2289
  return;
@@ -2340,15 +2320,15 @@ var applyInjectorPatch = (chunkPath, content) => {
2340
2320
  writeFileSync(chunkPath, patched, "utf-8");
2341
2321
  }, resolveAngularCoreDir = () => {
2342
2322
  const fromProject = resolve3(process.cwd(), "node_modules/@angular/core");
2343
- if (existsSync2(join3(fromProject, "package.json"))) {
2323
+ if (existsSync2(join4(fromProject, "package.json"))) {
2344
2324
  return fromProject;
2345
2325
  }
2346
2326
  return dirname3(__require.resolve("@angular/core/package.json"));
2347
2327
  }, patchAngularInjectorSingleton = () => {
2348
2328
  try {
2349
2329
  const coreDir = resolveAngularCoreDir();
2350
- const chunkPath = join3(coreDir, "fesm2022", "_not_found-chunk.mjs");
2351
- const content = readFileSync3(chunkPath, "utf-8");
2330
+ const chunkPath = join4(coreDir, "fesm2022", "_not_found-chunk.mjs");
2331
+ const content = readFileSync2(chunkPath, "utf-8");
2352
2332
  applyInjectorPatch(chunkPath, content);
2353
2333
  } catch {}
2354
2334
  };
@@ -3180,5 +3160,5 @@ export {
3180
3160
  createTypedIsland
3181
3161
  };
3182
3162
 
3183
- //# debugId=97DAE1850D134FCF64756E2164756E21
3163
+ //# debugId=FEADEE763F16AA9D64756E2164756E21
3184
3164
  //# sourceMappingURL=index.js.map