@absolutejs/absolute 0.19.0-beta.810 → 0.19.0-beta.812

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-bAURJ8/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-U2IMYb/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-bAURJ8/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-U2IMYb/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-bAURJ8/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-U2IMYb/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";
package/dist/build.js CHANGED
@@ -9575,22 +9575,66 @@ var init_commonAncestor = () => {};
9575
9575
  // src/utils/buildDirectoryLock.ts
9576
9576
  import { mkdir as mkdir3, rm as rm4, stat as stat2, writeFile as writeFile4 } from "fs/promises";
9577
9577
  import { dirname as dirname8, join as join13 } from "path";
9578
- var DEFAULT_LOCK_TIMEOUT_MS = 120000, DEFAULT_STALE_LOCK_MS, LOCK_POLL_MS = 250, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join13(dirname8(buildDirectory), `.${buildDirectory.split(/[\\/]/).pop()}.lock`), acquireBuildDirectoryLock = async (buildDirectory, options = {}) => {
9578
+ var DEFAULT_LOCK_TIMEOUT_MS = 120000, DEFAULT_STALE_LOCK_MS, LOCK_POLL_MS = 250, heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join13(dirname8(buildDirectory), `.${buildDirectory.split(/[\\/]/).pop()}.lock`), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
9579
+ `).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
9580
+ if (locks.size === 0) {
9581
+ delete process.env[HELD_LOCKS_ENV];
9582
+ return;
9583
+ }
9584
+ process.env[HELD_LOCKS_ENV] = Array.from(locks).join(`
9585
+ `);
9586
+ }, markHeldLock = (buildDirectory) => {
9587
+ const locks = readHeldLockEnv();
9588
+ locks.add(buildDirectory);
9589
+ writeHeldLockEnv(locks);
9590
+ }, unmarkHeldLock = (buildDirectory) => {
9591
+ const locks = readHeldLockEnv();
9592
+ locks.delete(buildDirectory);
9593
+ writeHeldLockEnv(locks);
9594
+ }, acquireBuildDirectoryLock = async (buildDirectory, options = {}) => {
9595
+ if (readHeldLockEnv().has(buildDirectory)) {
9596
+ return async () => {};
9597
+ }
9598
+ const heldLock = heldLocks.get(buildDirectory);
9599
+ if (heldLock) {
9600
+ heldLock.count += 1;
9601
+ return async () => {
9602
+ heldLock.count -= 1;
9603
+ if (heldLock.count === 0) {
9604
+ heldLocks.delete(buildDirectory);
9605
+ await heldLock.release();
9606
+ }
9607
+ };
9608
+ }
9579
9609
  const lockPath = lockPathForBuildDirectory(buildDirectory);
9580
9610
  const staleLockMs = options.staleLockMs ?? DEFAULT_STALE_LOCK_MS;
9581
9611
  const timeoutMs = options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS;
9582
9612
  const start = Date.now();
9583
9613
  while (true) {
9584
9614
  try {
9615
+ await mkdir3(dirname8(lockPath), { recursive: true });
9585
9616
  await mkdir3(lockPath);
9586
9617
  await writeFile4(join13(lockPath, "owner"), JSON.stringify({
9587
9618
  buildDirectory,
9588
9619
  createdAt: new Date().toISOString(),
9589
9620
  pid: process.pid
9590
9621
  }, null, 2));
9591
- return async () => {
9622
+ const release = async () => {
9592
9623
  await rm4(lockPath, { force: true, recursive: true }).catch(() => {});
9593
9624
  };
9625
+ heldLocks.set(buildDirectory, { count: 1, release });
9626
+ markHeldLock(buildDirectory);
9627
+ return async () => {
9628
+ const current = heldLocks.get(buildDirectory);
9629
+ if (!current)
9630
+ return;
9631
+ current.count -= 1;
9632
+ if (current.count > 0)
9633
+ return;
9634
+ heldLocks.delete(buildDirectory);
9635
+ unmarkHeldLock(buildDirectory);
9636
+ await current.release();
9637
+ };
9594
9638
  } catch (error) {
9595
9639
  if (!isAlreadyExistsError(error))
9596
9640
  throw error;
@@ -9617,6 +9661,7 @@ var DEFAULT_LOCK_TIMEOUT_MS = 120000, DEFAULT_STALE_LOCK_MS, LOCK_POLL_MS = 250,
9617
9661
  };
9618
9662
  var init_buildDirectoryLock = __esm(() => {
9619
9663
  DEFAULT_STALE_LOCK_MS = 10 * 60000;
9664
+ heldLocks = new Map;
9620
9665
  });
9621
9666
 
9622
9667
  // src/utils/validateSafePath.ts
@@ -12321,14 +12366,14 @@ import { mkdirSync as mkdirSync7 } from "fs";
12321
12366
  import { join as join18 } from "path";
12322
12367
  import { rm as rm6 } from "fs/promises";
12323
12368
  var {build: bunBuild3, Glob: Glob6 } = globalThis.Bun;
12324
- var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
12369
+ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
12325
12370
  try {
12326
12371
  Bun.resolveSync(specifier, process.cwd());
12327
12372
  return true;
12328
12373
  } catch {
12329
12374
  return false;
12330
12375
  }
12331
- }, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAngularBrowserSpecifier = (spec) => spec.startsWith("@angular/") && !SERVER_ONLY_ANGULAR_SPECIFIERS.has(spec), scanSourceImports = async (directories) => {
12376
+ }, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAngularBrowserSpecifier = (spec) => spec.startsWith("@angular/") && !SERVER_ONLY_ANGULAR_SPECIFIERS.has(spec) && !isBuildOnlyAngularSpecifier(spec), scanSourceImports = async (directories) => {
12332
12377
  const angular = new Set;
12333
12378
  const transitiveRoots = new Set;
12334
12379
  const transpiler4 = new Bun.Transpiler({ loader: "tsx" });
@@ -12515,6 +12560,10 @@ var init_buildAngularVendor = __esm(() => {
12515
12560
  "@angular/platform-server",
12516
12561
  "@angular/ssr"
12517
12562
  ]);
12563
+ BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES = [
12564
+ "@angular/compiler-cli",
12565
+ "@angular/localize/tools"
12566
+ ];
12518
12567
  SCAN_SKIP_DIRS = new Set([
12519
12568
  "node_modules",
12520
12569
  "build",
@@ -17705,7 +17754,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17705
17754
  minify: false,
17706
17755
  naming: "[name].[ext]",
17707
17756
  outdir: vendorDir,
17708
- splitting: true,
17757
+ splitting: false,
17709
17758
  target: "browser",
17710
17759
  throw: false
17711
17760
  });
@@ -18145,5 +18194,5 @@ export {
18145
18194
  build
18146
18195
  };
18147
18196
 
18148
- //# debugId=C28D21060C56A41A64756E2164756E21
18197
+ //# debugId=C3B3BFEF1E7A757364756E2164756E21
18149
18198
  //# sourceMappingURL=build.js.map