@absolutejs/absolute 0.19.0-beta.847 → 0.19.0-beta.848

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-COIC1V/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-hLHonn/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-COIC1V/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-hLHonn/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-COIC1V/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-hLHonn/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";
@@ -1430,12 +1430,42 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1430
1430
  code: await compileStyleSource(path, content, language, config)
1431
1431
  };
1432
1432
  }
1433
- }), compileStyleFileIfNeeded = async (filePath, config) => {
1433
+ }), CSS_IMPORT_PATTERN, resolveCssImportsAsync = async (content, baseDir, visited) => {
1434
+ const matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));
1435
+ if (matches.length === 0)
1436
+ return content;
1437
+ let cursor = 0;
1438
+ const parts = [];
1439
+ for (const match of matches) {
1440
+ const importPath = match[1];
1441
+ if (importPath === undefined)
1442
+ continue;
1443
+ const start = match.index ?? 0;
1444
+ const end = start + match[0].length;
1445
+ parts.push(content.slice(cursor, start));
1446
+ const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
1447
+ if (visited.has(fullPath) || !existsSync3(fullPath)) {
1448
+ parts.push(visited.has(fullPath) ? "" : match[0]);
1449
+ cursor = end;
1450
+ continue;
1451
+ }
1452
+ const nextVisited = new Set(visited);
1453
+ nextVisited.add(fullPath);
1454
+ const imported = await readFile(fullPath, "utf-8");
1455
+ parts.push(await resolveCssImportsAsync(imported, dirname(fullPath), nextVisited));
1456
+ cursor = end;
1457
+ }
1458
+ parts.push(content.slice(cursor));
1459
+ return parts.join("");
1460
+ }, compileStyleFileIfNeeded = async (filePath, config) => {
1434
1461
  if (!isPreprocessableStylePath(filePath)) {
1435
- return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
1462
+ const raw = await readFile(filePath, "utf-8");
1463
+ const processed = await runPostcss(raw, filePath, config);
1464
+ return resolveCssImportsAsync(processed, dirname(filePath), new Set([filePath]));
1436
1465
  }
1437
- return compileStyleSource(filePath, undefined, undefined, config);
1438
- }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
1466
+ const compiled = await compileStyleSource(filePath, undefined, undefined, config);
1467
+ return resolveCssImportsAsync(compiled, dirname(filePath), new Set([filePath]));
1468
+ }, resolveCssImportsSync = (content, baseDir, visited) => {
1439
1469
  return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
1440
1470
  const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
1441
1471
  if (visited.has(fullPath))
@@ -3320,6 +3350,16 @@ var init_lowerDeferSyntax = __esm(() => {
3320
3350
  init_constants();
3321
3351
  });
3322
3352
 
3353
+ // src/utils/generatedDir.ts
3354
+ var exports_generatedDir = {};
3355
+ __export(exports_generatedDir, {
3356
+ getGeneratedRoot: () => getGeneratedRoot,
3357
+ getFrameworkGeneratedDir: () => getFrameworkGeneratedDir
3358
+ });
3359
+ import { join as join5 } from "path";
3360
+ var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getGeneratedRoot = (projectRoot = process.cwd()) => join5(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME), getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join5(getGeneratedRoot(projectRoot), framework);
3361
+ var init_generatedDir = () => {};
3362
+
3323
3363
  // src/build/compileAngular.ts
3324
3364
  var exports_compileAngular = {};
3325
3365
  __export(exports_compileAngular, {
@@ -3329,7 +3369,7 @@ __export(exports_compileAngular, {
3329
3369
  compileAngular: () => compileAngular
3330
3370
  });
3331
3371
  import { existsSync as existsSync4, readFileSync as readFileSync4, promises as fs } from "fs";
3332
- import { join as join5, basename as basename3, sep, dirname as dirname3, resolve as resolve5, relative as relative3 } from "path";
3372
+ import { join as join6, basename as basename3, sep, dirname as dirname3, resolve as resolve5, relative as relative3 } from "path";
3333
3373
  import ts from "typescript";
3334
3374
  var traceAngularPhase = async (name, fn, metadata) => {
3335
3375
  const tracePhase = globalThis.__absoluteBuildTracePhase;
@@ -3371,10 +3411,10 @@ var traceAngularPhase = async (name, fn, metadata) => {
3371
3411
  `${candidate}.tsx`,
3372
3412
  `${candidate}.js`,
3373
3413
  `${candidate}.jsx`,
3374
- join5(candidate, "index.ts"),
3375
- join5(candidate, "index.tsx"),
3376
- join5(candidate, "index.js"),
3377
- join5(candidate, "index.jsx")
3414
+ join6(candidate, "index.ts"),
3415
+ join6(candidate, "index.tsx"),
3416
+ join6(candidate, "index.js"),
3417
+ join6(candidate, "index.jsx")
3378
3418
  ];
3379
3419
  return candidates.find((file) => existsSync4(file));
3380
3420
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
@@ -3563,10 +3603,10 @@ ${registrations}
3563
3603
  `${basePath}.tsx`,
3564
3604
  `${basePath}.mts`,
3565
3605
  `${basePath}.cts`,
3566
- join5(basePath, "index.ts"),
3567
- join5(basePath, "index.tsx"),
3568
- join5(basePath, "index.mts"),
3569
- join5(basePath, "index.cts")
3606
+ join6(basePath, "index.ts"),
3607
+ join6(basePath, "index.tsx"),
3608
+ join6(basePath, "index.mts"),
3609
+ join6(basePath, "index.cts")
3570
3610
  ];
3571
3611
  return candidates.map((candidate) => resolve5(candidate)).find((candidate) => existsSync4(candidate) && !candidate.endsWith(".d.ts")) ?? null;
3572
3612
  }, readFileForAotTransform = async (fileName, readFile2) => {
@@ -3592,15 +3632,15 @@ ${registrations}
3592
3632
  const paths = [];
3593
3633
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
3594
3634
  if (templateUrlMatch?.[1])
3595
- paths.push(join5(fileDir, templateUrlMatch[1]));
3635
+ paths.push(join6(fileDir, templateUrlMatch[1]));
3596
3636
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
3597
3637
  if (styleUrlMatch?.[1])
3598
- paths.push(join5(fileDir, styleUrlMatch[1]));
3638
+ paths.push(join6(fileDir, styleUrlMatch[1]));
3599
3639
  const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
3600
3640
  const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
3601
3641
  if (urlMatches) {
3602
3642
  for (const urlMatch of urlMatches) {
3603
- paths.push(join5(fileDir, urlMatch.replace(/['"]/g, "")));
3643
+ paths.push(join6(fileDir, urlMatch.replace(/['"]/g, "")));
3604
3644
  }
3605
3645
  }
3606
3646
  return paths.map((path) => resolve5(path));
@@ -3634,7 +3674,7 @@ ${registrations}
3634
3674
  safeStableStringify(stylePreprocessors ?? null)
3635
3675
  ].join("\x00");
3636
3676
  const cacheKey = Bun.hash(cacheInput).toString(BASE_36_RADIX);
3637
- return join5(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey}.json`);
3677
+ return join6(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey}.json`);
3638
3678
  }, precomputeAotResourceTransforms = async (inputPaths, readFile2, stylePreprocessors) => {
3639
3679
  const transformedSources = new Map;
3640
3680
  const visited = new Set;
@@ -3680,7 +3720,7 @@ ${registrations}
3680
3720
  return { stats, transformedSources };
3681
3721
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
3682
3722
  const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
3683
- const outputPath = resolve5(join5(outDir, relative3(process.cwd(), resolve5(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
3723
+ const outputPath = resolve5(join6(outDir, relative3(process.cwd(), resolve5(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
3684
3724
  return [
3685
3725
  outputPath,
3686
3726
  buildIslandMetadataExports(readFileSync4(inputPath, "utf-8"))
@@ -3727,7 +3767,7 @@ ${registrations}
3727
3767
  const originalGetSourceFile = host.getSourceFile;
3728
3768
  host.getSourceFile = (fileName, languageVersion, onError) => {
3729
3769
  if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
3730
- const resolvedPath = join5(tsLibDir, fileName);
3770
+ const resolvedPath = join6(tsLibDir, fileName);
3731
3771
  return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
3732
3772
  }
3733
3773
  return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
@@ -3782,7 +3822,7 @@ ${registrations}
3782
3822
  const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
3783
3823
  const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
3784
3824
  content,
3785
- target: join5(outDir, fileName)
3825
+ target: join6(outDir, fileName)
3786
3826
  }));
3787
3827
  const outputFiles = new Set(rawEntries.map(({ target }) => resolve5(target)));
3788
3828
  return rawEntries.map(({ content, target }) => {
@@ -3957,7 +3997,7 @@ ${fields}
3957
3997
  }, inlineTemplateAndLowerDefer = async (source, fileDir) => {
3958
3998
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
3959
3999
  if (templateUrlMatch?.[1]) {
3960
- const templatePath = join5(fileDir, templateUrlMatch[1]);
4000
+ const templatePath = join6(fileDir, templateUrlMatch[1]);
3961
4001
  if (!existsSync4(templatePath)) {
3962
4002
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
3963
4003
  }
@@ -3988,7 +4028,7 @@ ${fields}
3988
4028
  }, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
3989
4029
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
3990
4030
  if (templateUrlMatch?.[1]) {
3991
- const templatePath = join5(fileDir, templateUrlMatch[1]);
4031
+ const templatePath = join6(fileDir, templateUrlMatch[1]);
3992
4032
  if (!existsSync4(templatePath)) {
3993
4033
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
3994
4034
  }
@@ -4025,7 +4065,7 @@ ${fields}
4025
4065
  return source;
4026
4066
  const stylePromises = urlMatches.map((urlMatch) => {
4027
4067
  const styleUrl = urlMatch.replace(/['"]/g, "");
4028
- return readAndEscapeFile(join5(fileDir, styleUrl), stylePreprocessors);
4068
+ return readAndEscapeFile(join6(fileDir, styleUrl), stylePreprocessors);
4029
4069
  });
4030
4070
  const results = await Promise.all(stylePromises);
4031
4071
  const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
@@ -4036,7 +4076,7 @@ ${fields}
4036
4076
  const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
4037
4077
  if (!styleUrlMatch?.[1])
4038
4078
  return source;
4039
- const escaped = await readAndEscapeFile(join5(fileDir, styleUrlMatch[1]), stylePreprocessors);
4079
+ const escaped = await readAndEscapeFile(join6(fileDir, styleUrlMatch[1]), stylePreprocessors);
4040
4080
  if (!escaped)
4041
4081
  return source;
4042
4082
  return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
@@ -4071,10 +4111,10 @@ ${fields}
4071
4111
  `${candidate}.tsx`,
4072
4112
  `${candidate}.js`,
4073
4113
  `${candidate}.jsx`,
4074
- join5(candidate, "index.ts"),
4075
- join5(candidate, "index.tsx"),
4076
- join5(candidate, "index.js"),
4077
- join5(candidate, "index.jsx")
4114
+ join6(candidate, "index.ts"),
4115
+ join6(candidate, "index.tsx"),
4116
+ join6(candidate, "index.js"),
4117
+ join6(candidate, "index.jsx")
4078
4118
  ];
4079
4119
  return candidates.find((file) => existsSync4(file));
4080
4120
  };
@@ -4101,7 +4141,7 @@ ${fields}
4101
4141
  const inputDir = dirname3(sourcePath);
4102
4142
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
4103
4143
  const fileBase = basename3(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
4104
- return join5(outDir, relativeDir, fileBase);
4144
+ return join6(outDir, relativeDir, fileBase);
4105
4145
  };
4106
4146
  const withCacheBuster = (specifier) => {
4107
4147
  if (!cacheBuster)
@@ -4159,7 +4199,7 @@ ${fields}
4159
4199
  const inputDir = dirname3(actualPath);
4160
4200
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
4161
4201
  const fileBase = basename3(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
4162
- const targetDir = join5(outDir, relativeDir);
4202
+ const targetDir = join6(outDir, relativeDir);
4163
4203
  const targetPath = toOutputPath(actualPath);
4164
4204
  const localImports = [];
4165
4205
  const importRewrites = new Map;
@@ -4213,13 +4253,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4213
4253
  }
4214
4254
  return allOutputs;
4215
4255
  }, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
4216
- const compiledParent = join5(outRoot, "generated");
4256
+ const compiledParent = getFrameworkGeneratedDir("angular");
4217
4257
  if (entryPoints.length === 0) {
4218
4258
  const emptyPaths = [];
4219
4259
  return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
4220
4260
  }
4221
4261
  const compiledRoot = compiledParent;
4222
- const indexesDir = join5(compiledParent, "indexes");
4262
+ const indexesDir = join6(compiledParent, "indexes");
4223
4263
  await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
4224
4264
  const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve5(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
4225
4265
  const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
@@ -4233,9 +4273,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4233
4273
  const fileBase = basename3(resolvedEntry).replace(/\.[tj]s$/, "");
4234
4274
  const jsName = `${fileBase}.js`;
4235
4275
  const compiledFallbackPaths = [
4236
- join5(compiledRoot, relativeEntry),
4237
- join5(compiledRoot, "pages", jsName),
4238
- join5(compiledRoot, jsName)
4276
+ join6(compiledRoot, relativeEntry),
4277
+ join6(compiledRoot, "pages", jsName),
4278
+ join6(compiledRoot, jsName)
4239
4279
  ].map((file) => resolve5(file));
4240
4280
  const resolveRawServerFile = (candidatePaths) => {
4241
4281
  const normalizedCandidates = [
@@ -4280,7 +4320,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
4280
4320
  const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
4281
4321
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
4282
4322
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
4283
- const clientFile = join5(indexesDir, jsName);
4323
+ const clientFile = join6(indexesDir, jsName);
4284
4324
  if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync4(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
4285
4325
  return {
4286
4326
  clientPath: clientFile,
@@ -4515,9 +4555,10 @@ var init_compileAngular = __esm(() => {
4515
4555
  init_sourceMetadata();
4516
4556
  init_lowerDeferSyntax();
4517
4557
  init_stylePreprocessor();
4558
+ init_generatedDir();
4518
4559
  devClientDir = resolveDevClientDir();
4519
- hmrClientPath = join5(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
4520
- hmrRuntimePath = join5(devClientDir, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
4560
+ hmrClientPath = join6(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
4561
+ hmrRuntimePath = join6(devClientDir, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
4521
4562
  jitContentCache = new Map;
4522
4563
  wrapperOutputCache = new Map;
4523
4564
  });
@@ -13628,7 +13669,7 @@ init_constants();
13628
13669
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
13629
13670
  import { mkdir as mkdir2, symlink } from "fs/promises";
13630
13671
  import { tmpdir } from "os";
13631
- import { basename as basename4, dirname as dirname4, join as join6, resolve as resolve6 } from "path";
13672
+ import { basename as basename4, dirname as dirname4, join as join7, resolve as resolve6 } from "path";
13632
13673
  import { pathToFileURL } from "url";
13633
13674
 
13634
13675
  // src/core/islandPageContext.ts
@@ -14448,11 +14489,11 @@ var ensureAngularCompiler = () => {
14448
14489
  return compilerImportPromise;
14449
14490
  };
14450
14491
  var readAngularPageModule = (value) => isRecord5(value) ? value : null;
14451
- var resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join6(tmpdir(), "absolutejs", "generated", "angular-ssr");
14492
+ var resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join7(tmpdir(), "absolutejs", "generated", "angular-ssr");
14452
14493
  var createAngularRuntimeCacheBuster = () => `${Date.now().toString(BASE_36_RADIX)}.${Math.random().toString(BASE_36_RADIX).substring(2, RANDOM_ID_END_INDEX)}`;
14453
14494
  var ensureAngularSsrNodeModules = async (outDir) => {
14454
14495
  const outRoot = resolve6(dirname4(dirname4(outDir)));
14455
- const nodeModulesLink = join6(outRoot, "node_modules");
14496
+ const nodeModulesLink = join7(outRoot, "node_modules");
14456
14497
  if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
14457
14498
  return;
14458
14499
  }
@@ -15004,5 +15045,5 @@ export {
15004
15045
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
15005
15046
  };
15006
15047
 
15007
- //# debugId=6F99FC8C0F34774664756E2164756E21
15048
+ //# debugId=BCDBB77EEE4BE49164756E2164756E21
15008
15049
  //# sourceMappingURL=index.js.map