@absolutejs/absolute 0.19.0-beta.811 → 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-BrsDXP/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-BrsDXP/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-BrsDXP/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
@@ -17709,7 +17754,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
17709
17754
  minify: false,
17710
17755
  naming: "[name].[ext]",
17711
17756
  outdir: vendorDir,
17712
- splitting: true,
17757
+ splitting: false,
17713
17758
  target: "browser",
17714
17759
  throw: false
17715
17760
  });
@@ -18149,5 +18194,5 @@ export {
18149
18194
  build
18150
18195
  };
18151
18196
 
18152
- //# debugId=58B6E34D3C5D015364756E2164756E21
18197
+ //# debugId=C3B3BFEF1E7A757364756E2164756E21
18153
18198
  //# sourceMappingURL=build.js.map