@absolutejs/absolute 0.19.0-beta.996 → 0.19.0-beta.998

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-HqKPzO/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-abAmj8/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-HqKPzO/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-abAmj8/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-HqKPzO/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-abAmj8/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -1730,6 +1730,7 @@ var init_svelteServerModule = __esm(() => {
1730
1730
  });
1731
1731
 
1732
1732
  // src/core/vueServerModule.ts
1733
+ import { existsSync as existsSync4, readFileSync as readFileSync4, realpathSync } from "fs";
1733
1734
  import { mkdir as mkdir2 } from "fs/promises";
1734
1735
  import { dirname as dirname3, join as join5, relative as relative3, resolve as resolve5 } from "path";
1735
1736
  var {Transpiler } = globalThis.Bun;
@@ -1775,6 +1776,11 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot2, compiledModuleCache2, tran
1775
1776
  const componentId = Bun.hash(sourcePath).toString(BASE_36_RADIX).slice(0, ISLAND_COMPONENT_ID_LENGTH);
1776
1777
  const hasScript = descriptor.script || descriptor.scriptSetup;
1777
1778
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
1779
+ fs: {
1780
+ fileExists: existsSync4,
1781
+ readFile: (file) => existsSync4(file) ? readFileSync4(file, "utf-8") : undefined,
1782
+ realpath: realpathSync
1783
+ },
1778
1784
  id: componentId,
1779
1785
  inlineTemplate: false
1780
1786
  }) : { bindings: {}, content: "export default {};" };
@@ -3517,7 +3523,7 @@ __export(exports_compileAngular, {
3517
3523
  compileAngularFile: () => compileAngularFile,
3518
3524
  compileAngular: () => compileAngular
3519
3525
  });
3520
- import { existsSync as existsSync4, readFileSync as readFileSync4, promises as fs } from "fs";
3526
+ import { existsSync as existsSync5, readFileSync as readFileSync5, promises as fs } from "fs";
3521
3527
  import { join as join7, basename as basename3, sep, dirname as dirname4, resolve as resolve6, relative as relative4 } from "path";
3522
3528
  var {Glob } = globalThis.Bun;
3523
3529
  import ts from "typescript";
@@ -3566,7 +3572,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
3566
3572
  join7(candidate, "index.js"),
3567
3573
  join7(candidate, "index.jsx")
3568
3574
  ];
3569
- return candidates.find((file) => existsSync4(file));
3575
+ return candidates.find((file) => existsSync5(file));
3570
3576
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
3571
3577
  const baseDir = resolve6(rootDir);
3572
3578
  const tsconfigAliases = readTsconfigPathAliases();
@@ -3647,11 +3653,11 @@ var traceAngularPhase = async (name, fn, metadata) => {
3647
3653
  }, resolveDevClientDir = () => {
3648
3654
  const projectRoot = process.cwd();
3649
3655
  const fromSource = resolve6(import.meta.dir, "../dev/client");
3650
- if (existsSync4(fromSource) && fromSource.startsWith(projectRoot)) {
3656
+ if (existsSync5(fromSource) && fromSource.startsWith(projectRoot)) {
3651
3657
  return fromSource;
3652
3658
  }
3653
3659
  const fromNodeModules = resolve6(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
3654
- if (existsSync4(fromNodeModules))
3660
+ if (existsSync5(fromNodeModules))
3655
3661
  return fromNodeModules;
3656
3662
  return resolve6(import.meta.dir, "./dev/client");
3657
3663
  }, devClientDir, hmrClientPath, formatDiagnosticMessage = (diagnostic) => {
@@ -3697,11 +3703,11 @@ var traceAngularPhase = async (name, fn, metadata) => {
3697
3703
  return `${path}${query}`;
3698
3704
  const importerDir = dirname4(importerOutputPath);
3699
3705
  const fileCandidate = resolve6(importerDir, `${path}.js`);
3700
- if (outputFiles?.has(fileCandidate) || existsSync4(fileCandidate)) {
3706
+ if (outputFiles?.has(fileCandidate) || existsSync5(fileCandidate)) {
3701
3707
  return `${path}.js${query}`;
3702
3708
  }
3703
3709
  const indexCandidate = resolve6(importerDir, path, "index.js");
3704
- if (outputFiles?.has(indexCandidate) || existsSync4(indexCandidate)) {
3710
+ if (outputFiles?.has(indexCandidate) || existsSync5(indexCandidate)) {
3705
3711
  return `${path}/index.js${query}`;
3706
3712
  }
3707
3713
  return `${path}.js${query}`;
@@ -3739,7 +3745,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
3739
3745
  join7(basePath, "index.mts"),
3740
3746
  join7(basePath, "index.cts")
3741
3747
  ];
3742
- return candidates.map((candidate) => resolve6(candidate)).find((candidate) => existsSync4(candidate) && !candidate.endsWith(".d.ts")) ?? null;
3748
+ return candidates.map((candidate) => resolve6(candidate)).find((candidate) => existsSync5(candidate) && !candidate.endsWith(".d.ts")) ?? null;
3743
3749
  }, readFileForAotTransform = async (fileName, readFile2) => {
3744
3750
  const hostSource = readFile2?.(fileName);
3745
3751
  if (typeof hostSource === "string")
@@ -3820,7 +3826,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
3820
3826
  if (visited.has(resolvedPath))
3821
3827
  return;
3822
3828
  visited.add(resolvedPath);
3823
- if (!existsSync4(resolvedPath) || resolvedPath.endsWith(".d.ts"))
3829
+ if (!existsSync5(resolvedPath) || resolvedPath.endsWith(".d.ts"))
3824
3830
  return;
3825
3831
  stats.filesVisited += 1;
3826
3832
  const source = await readFileForAotTransform(resolvedPath, readFile2);
@@ -3854,7 +3860,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
3854
3860
  const outputPath = resolve6(join7(outDir, relative4(process.cwd(), resolve6(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
3855
3861
  return [
3856
3862
  outputPath,
3857
- buildIslandMetadataExports(readFileSync4(inputPath, "utf-8"))
3863
+ buildIslandMetadataExports(readFileSync5(inputPath, "utf-8"))
3858
3864
  ];
3859
3865
  })), { entries: inputPaths.length });
3860
3866
  await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
@@ -3994,7 +4000,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
3994
4000
  return null;
3995
4001
  }, resolveAngularDeferImportSpecifier = () => {
3996
4002
  const sourceEntry = resolve6(import.meta.dir, "../angular/components/index.ts");
3997
- if (existsSync4(sourceEntry)) {
4003
+ if (existsSync5(sourceEntry)) {
3998
4004
  return sourceEntry.replace(/\\/g, "/");
3999
4005
  }
4000
4006
  return "@absolutejs/absolute/angular/components";
@@ -4122,7 +4128,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
4122
4128
  ${fields}
4123
4129
  `);
4124
4130
  }, readAndEscapeFile = async (filePath, stylePreprocessors) => {
4125
- if (!existsSync4(filePath)) {
4131
+ if (!existsSync5(filePath)) {
4126
4132
  throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
4127
4133
  }
4128
4134
  const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
@@ -4131,7 +4137,7 @@ ${fields}
4131
4137
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
4132
4138
  if (templateUrlMatch?.[1]) {
4133
4139
  const templatePath = join7(fileDir, templateUrlMatch[1]);
4134
- if (!existsSync4(templatePath)) {
4140
+ if (!existsSync5(templatePath)) {
4135
4141
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
4136
4142
  }
4137
4143
  const templateRaw2 = await fs.readFile(templatePath, "utf-8");
@@ -4162,10 +4168,10 @@ ${fields}
4162
4168
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
4163
4169
  if (templateUrlMatch?.[1]) {
4164
4170
  const templatePath = join7(fileDir, templateUrlMatch[1]);
4165
- if (!existsSync4(templatePath)) {
4171
+ if (!existsSync5(templatePath)) {
4166
4172
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
4167
4173
  }
4168
- const templateRaw2 = readFileSync4(templatePath, "utf-8");
4174
+ const templateRaw2 = readFileSync5(templatePath, "utf-8");
4169
4175
  const lowered2 = lowerAngularDeferSyntax(templateRaw2);
4170
4176
  const escaped2 = escapeTemplateContent(lowered2.template);
4171
4177
  const replacedSource2 = source.slice(0, templateUrlMatch.index) + `template: \`${escaped2}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
@@ -4250,7 +4256,7 @@ ${fields}
4250
4256
  join7(candidate, "index.js"),
4251
4257
  join7(candidate, "index.jsx")
4252
4258
  ];
4253
- return candidates.find((file) => existsSync4(file));
4259
+ return candidates.find((file) => existsSync5(file));
4254
4260
  };
4255
4261
  const resolveLocalImport = (specifier, fromDir) => {
4256
4262
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
@@ -4325,7 +4331,7 @@ ${fields}
4325
4331
  if (visited.has(resolved))
4326
4332
  return;
4327
4333
  visited.add(resolved);
4328
- if (resolved.endsWith(".json") && existsSync4(resolved)) {
4334
+ if (resolved.endsWith(".json") && existsSync5(resolved)) {
4329
4335
  const inputDir2 = dirname4(resolved);
4330
4336
  const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
4331
4337
  const targetDir2 = join7(outDir, relativeDir2);
@@ -4338,7 +4344,7 @@ ${fields}
4338
4344
  let actualPath = resolved;
4339
4345
  if (!actualPath.endsWith(".ts"))
4340
4346
  actualPath += ".ts";
4341
- if (!existsSync4(actualPath))
4347
+ if (!existsSync5(actualPath))
4342
4348
  return;
4343
4349
  let sourceCode = await fs.readFile(actualPath, "utf-8");
4344
4350
  const inlined = await inlineResources(sourceCode, dirname4(actualPath), stylePreprocessors);
@@ -4376,7 +4382,7 @@ ${fields}
4376
4382
  const isEntry = resolve6(actualPath) === resolve6(entryPath);
4377
4383
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
4378
4384
  const cacheKey = actualPath;
4379
- const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync4(targetPath);
4385
+ const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync5(targetPath);
4380
4386
  if (shouldWriteFile) {
4381
4387
  const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
4382
4388
  await fs.mkdir(targetDir, { recursive: true });
@@ -4388,7 +4394,7 @@ ${fields}
4388
4394
  };
4389
4395
  await transpileFile(inputPath);
4390
4396
  const entryOutputPath = toOutputPath(entryPath);
4391
- if (existsSync4(entryOutputPath)) {
4397
+ if (existsSync5(entryOutputPath)) {
4392
4398
  const entryOutput = await fs.readFile(entryOutputPath, "utf-8");
4393
4399
  const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
4394
4400
  `);
@@ -4414,7 +4420,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4414
4420
  await traceAngularPhase("aot/copy-json-resources", async () => {
4415
4421
  const cwd = process.cwd();
4416
4422
  const angularSrcDir = resolve6(outRoot);
4417
- if (!existsSync4(angularSrcDir))
4423
+ if (!existsSync5(angularSrcDir))
4418
4424
  return;
4419
4425
  const jsonGlob = new Glob("**/*.json");
4420
4426
  for (const rel of jsonGlob.scanSync({
@@ -4449,15 +4455,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4449
4455
  ...candidatePaths.map((file) => resolve6(file)),
4450
4456
  ...compiledFallbackPaths
4451
4457
  ];
4452
- let candidate = normalizedCandidates.find((file) => existsSync4(file) && file.endsWith(`${sep}${relativeEntry}`));
4458
+ let candidate = normalizedCandidates.find((file) => existsSync5(file) && file.endsWith(`${sep}${relativeEntry}`));
4453
4459
  if (!candidate) {
4454
- candidate = normalizedCandidates.find((file) => existsSync4(file) && file.endsWith(`${sep}pages${sep}${jsName}`));
4460
+ candidate = normalizedCandidates.find((file) => existsSync5(file) && file.endsWith(`${sep}pages${sep}${jsName}`));
4455
4461
  }
4456
4462
  if (!candidate) {
4457
- candidate = normalizedCandidates.find((file) => existsSync4(file) && file.endsWith(`${sep}${jsName}`));
4463
+ candidate = normalizedCandidates.find((file) => existsSync5(file) && file.endsWith(`${sep}${jsName}`));
4458
4464
  }
4459
4465
  if (!candidate) {
4460
- candidate = normalizedCandidates.find((file) => existsSync4(file));
4466
+ candidate = normalizedCandidates.find((file) => existsSync5(file));
4461
4467
  }
4462
4468
  return candidate;
4463
4469
  };
@@ -4465,11 +4471,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4465
4471
  if (!rawServerFile) {
4466
4472
  rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
4467
4473
  }
4468
- if (rawServerFile && !existsSync4(rawServerFile)) {
4474
+ if (rawServerFile && !existsSync5(rawServerFile)) {
4469
4475
  outputs = hmr ? await compileEntry() : aotOutputs;
4470
4476
  rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
4471
4477
  }
4472
- if (!rawServerFile || !existsSync4(rawServerFile)) {
4478
+ if (!rawServerFile || !existsSync5(rawServerFile)) {
4473
4479
  throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
4474
4480
  ...outputs,
4475
4481
  ...compiledFallbackPaths
@@ -4492,7 +4498,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4492
4498
  const providersHashInput = providersInjection ? (() => {
4493
4499
  let providersSourceContent = "";
4494
4500
  try {
4495
- providersSourceContent = readFileSync4(providersInjection.appProvidersSource, "utf-8");
4501
+ providersSourceContent = readFileSync5(providersInjection.appProvidersSource, "utf-8");
4496
4502
  } catch {}
4497
4503
  return JSON.stringify({
4498
4504
  basePath: pageInjectionForHash?.basePath ?? null,
@@ -4503,7 +4509,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4503
4509
  const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
4504
4510
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
4505
4511
  const clientFile = join7(indexesDir, jsName);
4506
- if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync4(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
4512
+ if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync5(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
4507
4513
  return {
4508
4514
  clientPath: clientFile,
4509
4515
  indexUnchanged: true,
@@ -15390,5 +15396,5 @@ export {
15390
15396
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
15391
15397
  };
15392
15398
 
15393
- //# debugId=44A39DBA5FC9C91464756E2164756E21
15399
+ //# debugId=8F32AEC124BC3D1D64756E2164756E21
15394
15400
  //# sourceMappingURL=index.js.map