@absolutejs/absolute 0.20.0-beta.33 → 0.20.0-beta.35

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-eEye07/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-kztPfQ/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-eEye07/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-kztPfQ/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-eEye07/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-kztPfQ/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";
@@ -4541,7 +4541,15 @@ import { existsSync as existsSync5, readFileSync as readFileSync5, promises as f
4541
4541
  import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve7, relative as relative5 } from "path";
4542
4542
  var {Glob } = globalThis.Bun;
4543
4543
  import ts from "typescript";
4544
- var traceAngularPhase = async (name, fn, metadata) => {
4544
+ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
4545
+ const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
4546
+ try {
4547
+ await fs.writeFile(temporaryPath, content, "utf-8");
4548
+ await fs.rename(temporaryPath, path);
4549
+ } finally {
4550
+ await fs.rm(temporaryPath, { force: true });
4551
+ }
4552
+ }, traceAngularPhase = async (name, fn, metadata) => {
4545
4553
  const tracePhase = globalThis.__absoluteBuildTracePhase;
4546
4554
  return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata) : await fn();
4547
4555
  }, readTsconfigPathAliases = () => {
@@ -4807,10 +4815,10 @@ var traceAngularPhase = async (name, fn, metadata) => {
4807
4815
  }
4808
4816
  }, writeResourceCacheFile = async (cachePath, source) => {
4809
4817
  await fs.mkdir(dirname5(cachePath), { recursive: true });
4810
- await fs.writeFile(cachePath, JSON.stringify({
4818
+ await writeTextFileAtomically(cachePath, JSON.stringify({
4811
4819
  source,
4812
4820
  version: 1
4813
- }), "utf-8");
4821
+ }));
4814
4822
  }, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
4815
4823
  const resourcePaths = collectAngularResourcePaths(source, dirname5(filePath));
4816
4824
  const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
@@ -4996,7 +5004,7 @@ var traceAngularPhase = async (name, fn, metadata) => {
4996
5004
  });
4997
5005
  await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
4998
5006
  await fs.mkdir(dirname5(target), { recursive: true });
4999
- await fs.writeFile(target, content, "utf-8");
5007
+ await writeTextFileAtomically(target, content);
5000
5008
  })), { outputs: entries.length });
5001
5009
  return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
5002
5010
  }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, invalidateAngularJitCache = (filePath) => {
@@ -5461,7 +5469,7 @@ ${fields}
5461
5469
  const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
5462
5470
  const preservedInjection = await readPreservedInjection(targetPath);
5463
5471
  await fs.mkdir(targetDir, { recursive: true });
5464
- await fs.writeFile(targetPath, processedContent + preservedInjection, "utf-8");
5472
+ await writeTextFileAtomically(targetPath, processedContent + preservedInjection);
5465
5473
  jitContentCache.set(cacheKey, contentHash);
5466
5474
  }
5467
5475
  allOutputs.push(targetPath);
@@ -5477,7 +5485,7 @@ ${fields}
5477
5485
  export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
5478
5486
  ` : withoutLegacyFlag;
5479
5487
  if (nextEntryOutput !== entryOutput) {
5480
- await fs.writeFile(entryOutputPath, nextEntryOutput, "utf-8");
5488
+ await writeTextFileAtomically(entryOutputPath, nextEntryOutput);
5481
5489
  }
5482
5490
  }
5483
5491
  return allOutputs;
@@ -5647,7 +5655,7 @@ export const providers = [${fragments.join(", ")}];
5647
5655
  `;
5648
5656
  }
5649
5657
  }
5650
- await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
5658
+ await traceAngularPhase("wrapper/write-server-output", () => writeTextFileAtomically(rawServerFile, rewritten), { entry: resolvedEntry });
5651
5659
  const relativePath = relative5(indexesDir, rawServerFile).replace(/\\/g, "/");
5652
5660
  const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
5653
5661
  const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
@@ -5846,7 +5854,7 @@ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
5846
5854
  `.trim();
5847
5855
  const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
5848
5856
  const indexUnchanged = cachedWrapper?.indexHash === indexHash;
5849
- await traceAngularPhase("wrapper/write-client-index", () => fs.writeFile(clientFile, hydration, "utf-8"), { entry: resolvedEntry });
5857
+ await traceAngularPhase("wrapper/write-client-index", () => writeTextFileAtomically(clientFile, hydration), { entry: resolvedEntry });
5850
5858
  wrapperOutputCache.set(resolvedEntry, {
5851
5859
  indexHash,
5852
5860
  serverHash: serverContentHash
@@ -16594,5 +16602,5 @@ export {
16594
16602
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
16595
16603
  };
16596
16604
 
16597
- //# debugId=80A7E2F73AC84CE064756E2164756E21
16605
+ //# debugId=1C61B9B930534F7864756E2164756E21
16598
16606
  //# sourceMappingURL=index.js.map