@absolutejs/absolute 0.19.0-beta.760 → 0.19.0-beta.762

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.
package/dist/index.js CHANGED
@@ -43701,7 +43701,10 @@ __export(exports_compileAngular, {
43701
43701
  import { existsSync as existsSync16, readFileSync as readFileSync10, promises as fs2 } from "fs";
43702
43702
  import { join as join15, basename as basename7, sep as sep3, dirname as dirname11, resolve as resolve19, relative as relative9 } from "path";
43703
43703
  import ts2 from "typescript";
43704
- var readTsconfigPathAliases = () => {
43704
+ var traceAngularPhase = async (name, fn, metadata2) => {
43705
+ const tracePhase = globalThis.__absoluteBuildTracePhase;
43706
+ return tracePhase ? tracePhase(`compile/angular/${name}`, fn, metadata2) : await fn();
43707
+ }, readTsconfigPathAliases = () => {
43705
43708
  try {
43706
43709
  const configPath2 = resolve19(process.cwd(), "tsconfig.json");
43707
43710
  const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
@@ -43951,18 +43954,20 @@ ${registrations}
43951
43954
  await Promise.all(inputPaths.map((inputPath) => transformFile(inputPath)));
43952
43955
  return transformedSources;
43953
43956
  }, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
43954
- const islandMetadataByOutputPath = new Map(inputPaths.map((inputPath) => {
43957
+ const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
43955
43958
  const outputPath = resolve19(join15(outDir, relative9(process.cwd(), resolve19(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
43956
43959
  return [
43957
43960
  outputPath,
43958
43961
  buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"))
43959
43962
  ];
43960
- }));
43961
- const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
43962
- const tsPath = __require.resolve("typescript");
43963
- const tsRootDir = dirname11(tsPath);
43964
- const tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve19(tsRootDir, "lib");
43965
- const config = readConfiguration("./tsconfig.json");
43963
+ })), { entries: inputPaths.length });
43964
+ const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
43965
+ const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
43966
+ const tsPath = __require.resolve("typescript");
43967
+ const tsRootDir = dirname11(tsPath);
43968
+ return tsRootDir.endsWith("lib") ? tsRootDir : resolve19(tsRootDir, "lib");
43969
+ });
43970
+ const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
43966
43971
  const options = {
43967
43972
  emitDecoratorMetadata: true,
43968
43973
  esModuleInterop: true,
@@ -43985,7 +43990,7 @@ ${registrations}
43985
43990
  options.incremental = false;
43986
43991
  options.tsBuildInfoFile = undefined;
43987
43992
  options.rootDir = process.cwd();
43988
- const host = ts2.createCompilerHost(options);
43993
+ const host = await traceAngularPhase("aot/create-compiler-host", () => ts2.createCompilerHost(options));
43989
43994
  const originalGetDefaultLibLocation = host.getDefaultLibLocation;
43990
43995
  host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
43991
43996
  const originalGetDefaultLibFileName = host.getDefaultLibFileName;
@@ -44008,7 +44013,7 @@ ${registrations}
44008
44013
  emitted[relativePath] = text;
44009
44014
  };
44010
44015
  const originalReadFile = host.readFile;
44011
- const aotTransformedSources = await precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors);
44016
+ const aotTransformedSources = await traceAngularPhase("aot/precompute-resources", () => precomputeAotResourceTransforms(inputPaths, originalReadFile?.bind(host), stylePreprocessors), { entries: inputPaths.length });
44012
44017
  host.readFile = (fileName) => {
44013
44018
  const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
44014
44019
  if (typeof source !== "string")
@@ -44029,42 +44034,46 @@ ${registrations}
44029
44034
  };
44030
44035
  let diagnostics;
44031
44036
  try {
44032
- ({ diagnostics } = performCompilation({
44037
+ ({ diagnostics } = await traceAngularPhase("aot/perform-compilation", () => performCompilation({
44033
44038
  emitFlags: EmitFlags.Default,
44034
44039
  host,
44035
44040
  options,
44036
44041
  rootNames: inputPaths
44037
- }));
44042
+ }), { entries: inputPaths.length }));
44038
44043
  } finally {
44039
44044
  host.readFile = originalReadFile;
44040
44045
  host.getSourceFile = originalGetSourceFileForCompile;
44041
44046
  }
44042
- throwOnCompilationErrors(diagnostics);
44043
- const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
44044
- content,
44045
- target: join15(outDir, fileName)
44046
- }));
44047
- const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
44048
- const entries = rawEntries.map(({ content, target }) => {
44049
- let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
44050
- const rewritten = rewriteRelativeJsSpecifier(target, path2, outputFiles);
44051
- if (rewritten !== path2) {
44052
- return `from ${quote}${rewritten}${quote}`;
44053
- }
44054
- return match;
44055
- });
44056
- processedContent = processedContent.replace(/\u0275\u0275domElementStart/g, "\u0275\u0275elementStart").replace(/\u0275\u0275domElementEnd/g, "\u0275\u0275elementEnd").replace(/\u0275\u0275domElement\(/g, "\u0275\u0275element(").replace(/\u0275\u0275domProperty/g, "\u0275\u0275property").replace(/\u0275\u0275domListener/g, "\u0275\u0275listener");
44057
- processedContent = processedContent.replace(/import\s*{\s*([^}]*)\bInjectFlags\b([^}]*)\s*}\s*from\s*['"]@angular\/core['"]/g, (match, before, after) => {
44058
- const cleaned = (before + after).replace(/,\s*,/g, ",").replace(/^\s*,\s*/, "").replace(/,\s*$/, "");
44059
- return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
44047
+ await traceAngularPhase("aot/check-diagnostics", () => throwOnCompilationErrors(diagnostics));
44048
+ const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
44049
+ const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
44050
+ content,
44051
+ target: join15(outDir, fileName)
44052
+ }));
44053
+ const outputFiles = new Set(rawEntries.map(({ target }) => resolve19(target)));
44054
+ return rawEntries.map(({ content, target }) => {
44055
+ let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path2) => {
44056
+ const rewritten = rewriteRelativeJsSpecifier(target, path2, outputFiles);
44057
+ if (rewritten !== path2) {
44058
+ return `from ${quote}${rewritten}${quote}`;
44059
+ }
44060
+ return match;
44061
+ });
44062
+ processedContent = processedContent.replace(/\u0275\u0275domElementStart/g, "\u0275\u0275elementStart").replace(/\u0275\u0275domElementEnd/g, "\u0275\u0275elementEnd").replace(/\u0275\u0275domElement\(/g, "\u0275\u0275element(").replace(/\u0275\u0275domProperty/g, "\u0275\u0275property").replace(/\u0275\u0275domListener/g, "\u0275\u0275listener");
44063
+ processedContent = processedContent.replace(/import\s*{\s*([^}]*)\bInjectFlags\b([^}]*)\s*}\s*from\s*['"]@angular\/core['"]/g, (match, before, after) => {
44064
+ const cleaned = (before + after).replace(/,\s*,/g, ",").replace(/^\s*,\s*/, "").replace(/,\s*$/, "");
44065
+ return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
44066
+ });
44067
+ processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
44068
+ processedContent += islandMetadataByOutputPath.get(resolve19(target)) ?? "";
44069
+ return { content: processedContent, target };
44060
44070
  });
44061
- processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
44062
- processedContent += islandMetadataByOutputPath.get(resolve19(target)) ?? "";
44063
- return { content: processedContent, target };
44064
44071
  });
44065
- await Promise.all(entries.map(({ target }) => fs2.mkdir(dirname11(target), { recursive: true })));
44066
- await Promise.all(entries.map(({ target, content }) => fs2.writeFile(target, content, "utf-8")));
44067
- return entries.map(({ target }) => target);
44072
+ await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
44073
+ await fs2.mkdir(dirname11(target), { recursive: true });
44074
+ await fs2.writeFile(target, content, "utf-8");
44075
+ })), { outputs: entries.length });
44076
+ return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
44068
44077
  }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => compileAngularFiles([inputPath], outDir, stylePreprocessors), jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), findUncommentedMatch = (source, pattern) => {
44069
44078
  const re2 = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
44070
44079
  let match;
@@ -44153,31 +44162,31 @@ ${importLine}${source.slice(insertAt)}`;
44153
44162
  }
44154
44163
  return parts.join("");
44155
44164
  }, buildDeferSlotTemplateResolver = () => ` __absoluteDeferTemplateExpressionCache = new Map<string, string>();
44156
- __absoluteDeferResolveTemplateExpression(expression: string) {
44157
- const cached = this.__absoluteDeferTemplateExpressionCache.get(expression);
44158
- if (cached !== undefined) return cached;
44159
-
44160
- const scope = new Proxy(this, {
44161
- get: (_target, property) => {
44162
- const value = (this as Record<PropertyKey, unknown>)[property];
44163
- return typeof value === "function" ? value.bind(this) : value;
44164
- }
44165
- });
44166
- let value = '';
44167
- try {
44168
- const evaluate = new Function(
44169
- 'scope',
44170
- "with (scope) { return (" + expression + "); }"
44171
- );
44172
-
44173
- const resolvedValue = evaluate(scope);
44174
- value = resolvedValue == null ? '' : String(resolvedValue);
44175
- } catch (_error) {
44176
- value = '';
44177
- }
44178
- this.__absoluteDeferTemplateExpressionCache.set(expression, value);
44179
- return value;
44180
- }
44165
+ ` + ` __absoluteDeferResolveTemplateExpression(expression: string) {
44166
+ ` + ` const cached = this.__absoluteDeferTemplateExpressionCache.get(expression);
44167
+ ` + ` if (cached !== undefined) return cached;
44168
+ ` + `
44169
+ ` + ` const scope = new Proxy(this, {
44170
+ ` + ` get: (_target, property) => {
44171
+ ` + ` const value = (this as Record<PropertyKey, unknown>)[property];
44172
+ ` + ` return typeof value === "function" ? value.bind(this) : value;
44173
+ ` + ` }
44174
+ ` + ` });
44175
+ ` + ` let value = '';
44176
+ ` + ` try {
44177
+ ` + ` const evaluate = new Function(
44178
+ ` + ` 'scope',
44179
+ ` + ` "with (scope) { return (" + expression + "); }"
44180
+ ` + ` );
44181
+ ` + `
44182
+ ` + ` const resolvedValue = evaluate(scope);
44183
+ ` + ` value = resolvedValue == null ? '' : String(resolvedValue);
44184
+ ` + ` } catch (_error) {
44185
+ ` + ` value = '';
44186
+ ` + ` }
44187
+ ` + ` this.__absoluteDeferTemplateExpressionCache.set(expression, value);
44188
+ ` + ` return value;
44189
+ ` + ` }
44181
44190
 
44182
44191
  `, buildDeferSlotFields = (slots) => [
44183
44192
  buildDeferSlotTemplateResolver(),
@@ -44191,8 +44200,8 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
44191
44200
  ` : ` __absoluteDeferData${index} = () => ({});
44192
44201
  `;
44193
44202
  return `${htmlField + dataField} __absoluteDeferResolvePayload${index} = () => new Promise<any>((resolve) => {
44194
- setTimeout(() => resolve({ kind: 'angular-defer', state: 'resolved', html: this.__absoluteDeferHtml${index}(), data: this.__absoluteDeferData${index}() }), ${slot.delayMs});
44195
- });
44203
+ ` + ` setTimeout(() => resolve({ kind: 'angular-defer', state: 'resolved', html: this.__absoluteDeferHtml${index}(), data: this.__absoluteDeferData${index}() }), ${slot.delayMs});
44204
+ ` + ` });
44196
44205
  `;
44197
44206
  })
44198
44207
  ].join(`
@@ -44472,14 +44481,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44472
44481
  }
44473
44482
  const compiledRoot = compiledParent;
44474
44483
  const indexesDir = join15(compiledParent, "indexes");
44475
- await fs2.mkdir(indexesDir, { recursive: true });
44476
- const aotOutputs = hmr ? [] : await compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors);
44477
- const usesLegacyAngularAnimations = createLegacyAngularAnimationUsageResolver(outRoot);
44484
+ await traceAngularPhase("setup/create-indexes-dir", () => fs2.mkdir(indexesDir, { recursive: true }));
44485
+ const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve19(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
44486
+ const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
44478
44487
  const compileTasks = entryPoints.map(async (entry) => {
44479
44488
  const resolvedEntry = resolve19(entry);
44480
44489
  const relativeEntry = relative9(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
44481
44490
  const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
44482
- let outputs = hmr ? await compileEntry() : aotOutputs;
44491
+ let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
44492
+ entry: resolvedEntry
44493
+ }) : aotOutputs;
44483
44494
  const fileBase = basename7(resolvedEntry).replace(/\.[tj]s$/, "");
44484
44495
  const jsName = `${fileBase}.js`;
44485
44496
  const compiledFallbackPaths = [
@@ -44501,13 +44512,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44501
44512
  }
44502
44513
  return candidate;
44503
44514
  };
44504
- let rawServerFile = resolveRawServerFile(outputs);
44515
+ let rawServerFile = await traceAngularPhase("wrapper/resolve-server-output", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
44505
44516
  if (!rawServerFile) {
44506
- rawServerFile = resolveRawServerFile([]);
44517
+ rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
44507
44518
  }
44508
44519
  if (rawServerFile && !existsSync16(rawServerFile)) {
44509
44520
  outputs = hmr ? await compileEntry() : aotOutputs;
44510
- rawServerFile = resolveRawServerFile(outputs);
44521
+ rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
44511
44522
  }
44512
44523
  if (!rawServerFile || !existsSync16(rawServerFile)) {
44513
44524
  throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
@@ -44515,7 +44526,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44515
44526
  ...compiledFallbackPaths
44516
44527
  ].join(", ")}`);
44517
44528
  }
44518
- const original = await fs2.readFile(rawServerFile, "utf-8");
44529
+ const original = await traceAngularPhase("wrapper/read-server-output", () => fs2.readFile(rawServerFile, "utf-8"), { entry: resolvedEntry });
44519
44530
  const detectExportedComponentClass = (source, fallback) => {
44520
44531
  const defaultMatch = source.match(/export\s+default\s+([A-Za-z_$][\w$]*)\s*;/);
44521
44532
  if (defaultMatch)
@@ -44525,8 +44536,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44525
44536
  return exportClassMatch[1];
44526
44537
  return fallback;
44527
44538
  };
44528
- const componentClassName = detectExportedComponentClass(original, `${toPascal(fileBase)}Component`);
44529
- const usesLegacyAnimations = await usesLegacyAngularAnimations(resolvedEntry);
44539
+ const componentClassName = await traceAngularPhase("wrapper/detect-component-class", () => detectExportedComponentClass(original, `${toPascal(fileBase)}Component`), { entry: resolvedEntry });
44540
+ const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
44530
44541
  const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
44531
44542
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
44532
44543
  const clientFile = join15(indexesDir, jsName);
@@ -44570,7 +44581,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
44570
44581
  `);
44571
44582
  await fs2.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
44572
44583
  }
44573
- await fs2.writeFile(rawServerFile, rewritten, "utf-8");
44584
+ await traceAngularPhase("wrapper/write-server-output", () => fs2.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
44574
44585
  const relativePath = relative9(indexesDir, rawServerFile).replace(/\\/g, "/");
44575
44586
  const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
44576
44587
  const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
@@ -44749,7 +44760,7 @@ if (pageHasRawStreamingSlots) {
44749
44760
  `.trim();
44750
44761
  const indexHash = Bun.hash(hydration).toString(BASE_36_RADIX);
44751
44762
  const indexUnchanged = cachedWrapper?.indexHash === indexHash;
44752
- await fs2.writeFile(clientFile, hydration, "utf-8");
44763
+ await traceAngularPhase("wrapper/write-client-index", () => fs2.writeFile(clientFile, hydration, "utf-8"), { entry: resolvedEntry });
44753
44764
  wrapperOutputCache.set(resolvedEntry, {
44754
44765
  indexHash,
44755
44766
  serverHash: serverContentHash
@@ -44760,9 +44771,11 @@ if (pageHasRawStreamingSlots) {
44760
44771
  serverPath: rawServerFile
44761
44772
  };
44762
44773
  });
44763
- const results = await Promise.all(compileTasks);
44764
- const serverPaths = results.map((r) => r.serverPath);
44765
- const clientPaths = results.map((r) => r.clientPath);
44774
+ const results = await traceAngularPhase("wrapper/process-entries", () => Promise.all(compileTasks), { entries: entryPoints.length });
44775
+ const { clientPaths, serverPaths } = await traceAngularPhase("wrapper/collect-paths", () => ({
44776
+ clientPaths: results.map((r) => r.clientPath),
44777
+ serverPaths: results.map((r) => r.serverPath)
44778
+ }), { entries: results.length });
44766
44779
  return {
44767
44780
  allIndexesUnchanged: hmr && results.every((r) => r.indexUnchanged),
44768
44781
  clientPaths,
@@ -45296,7 +45309,10 @@ import {
45296
45309
  import { basename as basename8, dirname as dirname12, join as join20, relative as relative10, resolve as resolve21 } from "path";
45297
45310
  import { cwd, env as env3, exit } from "process";
45298
45311
  var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
45299
- var isDev2, collectConventionSourceFiles = (entry) => {
45312
+ var isDev2, isBuildTraceEnabled = () => {
45313
+ const value2 = env3.ABSOLUTE_BUILD_TRACE?.toLowerCase();
45314
+ return value2 === "1" || value2 === "true" || value2 === "yes";
45315
+ }, collectConventionSourceFiles = (entry) => {
45300
45316
  if (!entry)
45301
45317
  return [];
45302
45318
  const files = [];
@@ -45622,7 +45638,68 @@ ${content.slice(firstUseIdx)}`;
45622
45638
  }) => {
45623
45639
  const buildStart = performance.now();
45624
45640
  const projectRoot = cwd();
45625
- await resolveAbsoluteVersion();
45641
+ const traceEnabled = isBuildTraceEnabled();
45642
+ const traceEvents = [];
45643
+ let traceFrameworkNames = [];
45644
+ const traceGlobal = globalThis;
45645
+ const previousTracePhase = traceGlobal.__absoluteBuildTracePhase;
45646
+ const restoreTracePhase = () => {
45647
+ if (previousTracePhase) {
45648
+ traceGlobal.__absoluteBuildTracePhase = previousTracePhase;
45649
+ } else {
45650
+ delete traceGlobal.__absoluteBuildTracePhase;
45651
+ }
45652
+ };
45653
+ const tracePhase = async (name, fn, metadata2) => {
45654
+ if (!traceEnabled)
45655
+ return await fn();
45656
+ const phaseStart = performance.now();
45657
+ try {
45658
+ const result = await fn();
45659
+ traceEvents.push({
45660
+ durationMs: performance.now() - phaseStart,
45661
+ metadata: metadata2,
45662
+ name,
45663
+ ok: true,
45664
+ startMs: phaseStart - buildStart
45665
+ });
45666
+ return result;
45667
+ } catch (error) {
45668
+ traceEvents.push({
45669
+ durationMs: performance.now() - phaseStart,
45670
+ metadata: {
45671
+ ...metadata2,
45672
+ error: error instanceof Error ? error.message : String(error)
45673
+ },
45674
+ name,
45675
+ ok: false,
45676
+ startMs: phaseStart - buildStart
45677
+ });
45678
+ throw error;
45679
+ }
45680
+ };
45681
+ if (traceEnabled) {
45682
+ traceGlobal.__absoluteBuildTracePhase = tracePhase;
45683
+ }
45684
+ const writeBuildTrace = (buildPath2) => {
45685
+ if (!traceEnabled) {
45686
+ restoreTracePhase();
45687
+ return;
45688
+ }
45689
+ const traceDir = join20(buildPath2, ".absolute-trace");
45690
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
45691
+ mkdirSync10(traceDir, { recursive: true });
45692
+ writeFileSync7(join20(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
45693
+ events: traceEvents,
45694
+ frameworks: traceFrameworkNames,
45695
+ generatedAt: new Date().toISOString(),
45696
+ mode: mode ?? (isDev2 ? "development" : "production"),
45697
+ totalDurationMs: performance.now() - buildStart,
45698
+ version: 1
45699
+ }, null, 2));
45700
+ restoreTracePhase();
45701
+ };
45702
+ await tracePhase("absolute/version", () => resolveAbsoluteVersion());
45626
45703
  const isIncremental = incrementalFiles && incrementalFiles.length > 0;
45627
45704
  const styleTransformConfig = createStyleTransformConfig(stylePreprocessors, postcss);
45628
45705
  const stylePreprocessorPlugin2 = createStylePreprocessorPlugin(styleTransformConfig);
@@ -45667,6 +45744,7 @@ ${content.slice(firstUseIdx)}`;
45667
45744
  vueDir && "vue",
45668
45745
  angularDir && "angular"
45669
45746
  ].filter((name) => Boolean(name));
45747
+ traceFrameworkNames = frameworkNames;
45670
45748
  sendTelemetryEvent("build:start", {
45671
45749
  framework: frameworkNames[0],
45672
45750
  frameworks: frameworkNames,
@@ -45708,9 +45786,9 @@ ${content.slice(firstUseIdx)}`;
45708
45786
  serverOutDir = buildPath;
45709
45787
  }
45710
45788
  const publicPath = publicDirectory && validateSafePath(publicDirectory, projectRoot);
45711
- mkdirSync10(buildPath, { recursive: true });
45789
+ await tracePhase("build-dir/create", () => mkdirSync10(buildPath, { recursive: true }));
45712
45790
  if (publicPath)
45713
- cpSync(publicPath, buildPath, { force: true, recursive: true });
45791
+ await tracePhase("public/copy", () => cpSync(publicPath, buildPath, { force: true, recursive: true }));
45714
45792
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
45715
45793
  if (!isIncremental || !incrementalFiles)
45716
45794
  return entryPoints;
@@ -45727,15 +45805,15 @@ ${content.slice(firstUseIdx)}`;
45727
45805
  return matchingEntries;
45728
45806
  };
45729
45807
  if (reactIndexesPath && reactPagesPath) {
45730
- await generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr);
45808
+ await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
45731
45809
  }
45732
45810
  if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/assets/")))) {
45733
- cpSync(assetsPath, join20(buildPath, "assets"), {
45811
+ await tracePhase("assets/copy", () => cpSync(assetsPath, join20(buildPath, "assets"), {
45734
45812
  force: true,
45735
45813
  recursive: true
45736
- });
45814
+ }));
45737
45815
  }
45738
- const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? compileTailwindConfig(tailwind, buildPath, styleTransformConfig) : undefined;
45816
+ const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig)) : undefined;
45739
45817
  const emptyConventionResult = {
45740
45818
  conventions: undefined,
45741
45819
  pageFiles: []
@@ -45751,13 +45829,13 @@ ${content.slice(firstUseIdx)}`;
45751
45829
  allGlobalCssEntries
45752
45830
  ] = await Promise.all([
45753
45831
  tailwindPromise,
45754
- reactIndexesPath ? scanEntryPoints(reactIndexesPath, "*.tsx") : [],
45755
- htmlScriptsPath ? scanEntryPoints(htmlScriptsPath, "*.{js,ts}") : [],
45756
- reactPagesPath ? scanConventions(reactPagesPath, "*.tsx") : emptyConventionResult,
45757
- sveltePagesPath ? scanConventions(sveltePagesPath, "*.svelte") : emptyConventionResult,
45758
- vuePagesPath ? scanConventions(vuePagesPath, "*.vue") : emptyConventionResult,
45759
- angularPagesPath ? scanConventions(angularPagesPath, "*.ts") : emptyConventionResult,
45760
- stylesDir ? scanCssEntryPoints(stylesDir, stylesIgnore) : []
45832
+ reactIndexesPath ? tracePhase("scan/react-indexes", () => scanEntryPoints(reactIndexesPath, "*.tsx")) : [],
45833
+ htmlScriptsPath ? tracePhase("scan/html-scripts", () => scanEntryPoints(htmlScriptsPath, "*.{js,ts}")) : [],
45834
+ reactPagesPath ? tracePhase("scan/react-conventions", () => scanConventions(reactPagesPath, "*.tsx")) : emptyConventionResult,
45835
+ sveltePagesPath ? tracePhase("scan/svelte-conventions", () => scanConventions(sveltePagesPath, "*.svelte")) : emptyConventionResult,
45836
+ vuePagesPath ? tracePhase("scan/vue-conventions", () => scanConventions(vuePagesPath, "*.vue")) : emptyConventionResult,
45837
+ angularPagesPath ? tracePhase("scan/angular-conventions", () => scanConventions(angularPagesPath, "*.ts")) : emptyConventionResult,
45838
+ stylesDir ? tracePhase("scan/css", () => scanCssEntryPoints(stylesDir, stylesIgnore)) : []
45761
45839
  ]);
45762
45840
  const allSvelteEntries = svelteConventionResult.pageFiles;
45763
45841
  const allVueEntries = vueConventionResult.pageFiles;
@@ -45797,12 +45875,12 @@ ${content.slice(firstUseIdx)}`;
45797
45875
  htmlDir,
45798
45876
  htmxDir
45799
45877
  ].filter((dir) => Boolean(dir));
45800
- const urlReferencedFilesPromise = scanWorkerReferences(allFrameworkDirs);
45878
+ const urlReferencedFilesPromise = tracePhase("scan/worker-references", () => scanWorkerReferences(allFrameworkDirs));
45801
45879
  const shouldCompileSvelte = svelteDir && svelteEntries.length > 0;
45802
45880
  const shouldCompileVue = vueDir && vueEntries.length > 0;
45803
45881
  const shouldCompileAngular = angularDir && angularEntries.length > 0;
45804
45882
  const emptyStringArray = [];
45805
- const islandBuildInfo = islandRegistryPath ? await loadIslandRegistryBuildInfo(islandRegistryPath) : null;
45883
+ const islandBuildInfo = islandRegistryPath ? await tracePhase("islands/registry", () => loadIslandRegistryBuildInfo(islandRegistryPath)) : null;
45806
45884
  const islandFrameworkSources = islandBuildInfo ? collectIslandFrameworkSources(islandBuildInfo) : {};
45807
45885
  const islandSvelteSources = islandFrameworkSources.svelte ?? emptyStringArray;
45808
45886
  const islandVueSources = islandFrameworkSources.vue ?? emptyStringArray;
@@ -45818,28 +45896,28 @@ ${content.slice(firstUseIdx)}`;
45818
45896
  { vueClientPaths: islandVueClientPaths },
45819
45897
  { clientPaths: islandAngularClientPaths }
45820
45898
  ] = await Promise.all([
45821
- shouldCompileSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteEntries, svelteDir, new Map, hmr, styleTransformConfig)) : {
45899
+ shouldCompileSvelte ? tracePhase("compile/svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteEntries, svelteDir, new Map, hmr, styleTransformConfig))) : {
45822
45900
  svelteClientPaths: [...emptyStringArray],
45823
45901
  svelteIndexPaths: [...emptyStringArray],
45824
45902
  svelteServerPaths: [...emptyStringArray]
45825
45903
  },
45826
- shouldCompileVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, styleTransformConfig)) : {
45904
+ shouldCompileVue ? tracePhase("compile/vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, styleTransformConfig))) : {
45827
45905
  vueClientPaths: [...emptyStringArray],
45828
45906
  vueCssPaths: [...emptyStringArray],
45829
45907
  vueIndexPaths: [...emptyStringArray],
45830
45908
  vueServerPaths: [...emptyStringArray]
45831
45909
  },
45832
- shouldCompileAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularEntries, angularDir, hmr, styleTransformConfig)) : {
45910
+ shouldCompileAngular ? tracePhase("compile/angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularEntries, angularDir, hmr, styleTransformConfig))) : {
45833
45911
  clientPaths: [...emptyStringArray],
45834
45912
  serverPaths: [...emptyStringArray]
45835
45913
  },
45836
- shouldCompileIslandSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig)) : {
45914
+ shouldCompileIslandSvelte ? tracePhase("compile/island-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, styleTransformConfig))) : {
45837
45915
  svelteClientPaths: [...emptyStringArray]
45838
45916
  },
45839
- shouldCompileIslandVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(islandVueSources, vueDir, hmr, styleTransformConfig)) : {
45917
+ shouldCompileIslandVue ? tracePhase("compile/island-vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(islandVueSources, vueDir, hmr, styleTransformConfig))) : {
45840
45918
  vueClientPaths: [...emptyStringArray]
45841
45919
  },
45842
- shouldCompileIslandAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(islandAngularSources, angularDir, hmr, styleTransformConfig)) : {
45920
+ shouldCompileIslandAngular ? tracePhase("compile/island-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(islandAngularSources, angularDir, hmr, styleTransformConfig))) : {
45843
45921
  clientPaths: [...emptyStringArray]
45844
45922
  }
45845
45923
  ]);
@@ -45871,8 +45949,8 @@ ${content.slice(firstUseIdx)}`;
45871
45949
  const vueConventionSources = collectConventionSourceFiles(conventionsMap.vue);
45872
45950
  if (svelteConventionSources.length > 0 || vueConventionSources.length > 0) {
45873
45951
  const [svelteConvResult, vueConvResult] = await Promise.all([
45874
- svelteConventionSources.length > 0 && svelteDir ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false, styleTransformConfig)) : { svelteServerPaths: emptyStringArray },
45875
- vueConventionSources.length > 0 && vueDir ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false, styleTransformConfig)) : { vueServerPaths: emptyStringArray }
45952
+ svelteConventionSources.length > 0 && svelteDir ? tracePhase("compile/convention-svelte", () => Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false, styleTransformConfig))) : { svelteServerPaths: emptyStringArray },
45953
+ vueConventionSources.length > 0 && vueDir ? tracePhase("compile/convention-vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false, styleTransformConfig))) : { vueServerPaths: emptyStringArray }
45876
45954
  ]);
45877
45955
  const copyConventionFiles = (framework, sources, compiledPaths) => {
45878
45956
  const destDir = join20(buildPath, "conventions", framework);
@@ -45907,7 +45985,7 @@ ${content.slice(firstUseIdx)}`;
45907
45985
  ...islandBootstrapPath ? [islandBootstrapPath] : [],
45908
45986
  ...urlReferencedFiles
45909
45987
  ];
45910
- const islandEntryResult = islandBuildInfo ? await generateIslandEntryPoints({
45988
+ const islandEntryResult = islandBuildInfo ? await tracePhase("islands/client-entry-generation", () => generateIslandEntryPoints({
45911
45989
  buildInfo: islandBuildInfo,
45912
45990
  buildPath,
45913
45991
  clientPathMaps: {
@@ -45915,7 +45993,7 @@ ${content.slice(firstUseIdx)}`;
45915
45993
  svelte: islandSvelteClientPathMap,
45916
45994
  vue: islandVueClientPathMap
45917
45995
  }
45918
- }) : {
45996
+ })) : {
45919
45997
  entries: [],
45920
45998
  generatedRoot: join20(buildPath, "_island_entries")
45921
45999
  };
@@ -45949,6 +46027,7 @@ ${content.slice(firstUseIdx)}`;
45949
46027
  vue: allVueEntries.length
45950
46028
  }
45951
46029
  });
46030
+ writeBuildTrace(buildPath);
45952
46031
  return {};
45953
46032
  }
45954
46033
  if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
@@ -46032,7 +46111,7 @@ ${content.slice(firstUseIdx)}`;
46032
46111
  globalCssResult,
46033
46112
  vueCssResult
46034
46113
  ] = await Promise.all([
46035
- serverEntryPoints.length > 0 ? bunBuild7({
46114
+ serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7({
46036
46115
  entrypoints: serverEntryPoints,
46037
46116
  external: [
46038
46117
  "react",
@@ -46054,9 +46133,9 @@ ${content.slice(firstUseIdx)}`;
46054
46133
  target: "bun",
46055
46134
  throw: false,
46056
46135
  tsconfig: "./tsconfig.json"
46057
- }) : undefined,
46058
- reactBuildConfig ? bunBuild7(reactBuildConfig) : undefined,
46059
- nonReactClientEntryPoints.length > 0 ? bunBuild7({
46136
+ })) : undefined,
46137
+ reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
46138
+ nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7({
46060
46139
  define: vueDirectory ? vueFeatureFlags : undefined,
46061
46140
  entrypoints: nonReactClientEntryPoints,
46062
46141
  external: Object.keys(nonReactExternalPaths),
@@ -46074,8 +46153,8 @@ ${content.slice(firstUseIdx)}`;
46074
46153
  target: "browser",
46075
46154
  throw: false,
46076
46155
  tsconfig: "./tsconfig.json"
46077
- }) : undefined,
46078
- islandClientEntryPoints.length > 0 ? bunBuild7({
46156
+ })) : undefined,
46157
+ islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7({
46079
46158
  define: vueDirectory ? vueFeatureFlags : undefined,
46080
46159
  entrypoints: islandClientEntryPoints,
46081
46160
  external: Object.keys(nonReactExternalPaths),
@@ -46092,8 +46171,8 @@ ${content.slice(firstUseIdx)}`;
46092
46171
  target: "browser",
46093
46172
  throw: false,
46094
46173
  tsconfig: "./tsconfig.json"
46095
- }) : undefined,
46096
- globalCssEntries.length > 0 ? bunBuild7({
46174
+ })) : undefined,
46175
+ globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7({
46097
46176
  entrypoints: globalCssEntries,
46098
46177
  naming: `[dir]/[name].[hash].[ext]`,
46099
46178
  outdir: stylesDir ? join20(buildPath, basename8(stylesDir)) : buildPath,
@@ -46101,14 +46180,14 @@ ${content.slice(firstUseIdx)}`;
46101
46180
  root: stylesDir || clientRoot,
46102
46181
  target: "browser",
46103
46182
  throw: false
46104
- }) : undefined,
46105
- vueCssPaths.length > 0 ? bunBuild7({
46183
+ })) : undefined,
46184
+ vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7({
46106
46185
  entrypoints: vueCssPaths,
46107
46186
  naming: `[name].[hash].[ext]`,
46108
46187
  outdir: join20(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
46109
46188
  target: "browser",
46110
46189
  throw: false
46111
- }) : undefined
46190
+ })) : undefined
46112
46191
  ]);
46113
46192
  const serverLogs = serverResult?.logs ?? [];
46114
46193
  const serverOutputs = serverResult?.outputs ?? [];
@@ -46122,10 +46201,10 @@ ${content.slice(firstUseIdx)}`;
46122
46201
  }
46123
46202
  const reactClientOutputPaths = reactClientOutputs.map((artifact) => artifact.path);
46124
46203
  if (vendorPaths && reactClientOutputPaths.length > 0) {
46125
- await rewriteReactImports(reactClientOutputPaths, vendorPaths);
46204
+ await tracePhase("postprocess/react-imports", () => rewriteReactImports(reactClientOutputPaths, vendorPaths));
46126
46205
  }
46127
46206
  if (hmr && reactClientOutputPaths.length > 0) {
46128
- await patchRefreshGlobals(reactClientOutputPaths);
46207
+ await tracePhase("postprocess/react-refresh-globals", () => patchRefreshGlobals(reactClientOutputPaths));
46129
46208
  }
46130
46209
  const nonReactClientLogs = nonReactClientResult?.logs ?? [];
46131
46210
  const nonReactClientOutputs = nonReactClientResult?.outputs ?? [];
@@ -46134,16 +46213,16 @@ ${content.slice(firstUseIdx)}`;
46134
46213
  const islandClientOutputs = islandClientResult?.outputs ?? [];
46135
46214
  const islandClientOutputPaths = islandClientOutputs.map((artifact) => artifact.path);
46136
46215
  if (vendorPaths && nonReactClientOutputPaths.length > 0) {
46137
- await rewriteReactImports(nonReactClientOutputPaths, vendorPaths);
46216
+ await tracePhase("postprocess/non-react-react-imports", () => rewriteReactImports(nonReactClientOutputPaths, vendorPaths));
46138
46217
  }
46139
46218
  if (hmr && nonReactClientOutputPaths.length > 0) {
46140
- await patchRefreshGlobals(nonReactClientOutputPaths);
46219
+ await tracePhase("postprocess/non-react-refresh-globals", () => patchRefreshGlobals(nonReactClientOutputPaths));
46141
46220
  }
46142
46221
  if (vendorPaths && islandClientOutputPaths.length > 0) {
46143
- await rewriteReactImports(islandClientOutputPaths, vendorPaths);
46222
+ await tracePhase("postprocess/island-react-imports", () => rewriteReactImports(islandClientOutputPaths, vendorPaths));
46144
46223
  }
46145
46224
  if (hmr && islandClientOutputPaths.length > 0) {
46146
- await patchRefreshGlobals(islandClientOutputPaths);
46225
+ await tracePhase("postprocess/island-refresh-globals", () => patchRefreshGlobals(islandClientOutputPaths));
46147
46226
  }
46148
46227
  if (nonReactClientResult && !nonReactClientResult.success && nonReactClientLogs.length > 0) {
46149
46228
  extractBuildError(nonReactClientLogs, "non-react-client", "Non-React client", frameworkNames, isIncremental, throwOnError);
@@ -46163,11 +46242,11 @@ ${content.slice(firstUseIdx)}`;
46163
46242
  };
46164
46243
  if (nonReactClientOutputs.length > 0 && Object.keys(allNonReactVendorPaths).length > 0) {
46165
46244
  const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
46166
- await rewriteImports2(nonReactClientOutputs.map((artifact) => artifact.path), allNonReactVendorPaths);
46245
+ await tracePhase("postprocess/non-react-vendor-imports", () => rewriteImports2(nonReactClientOutputs.map((artifact) => artifact.path), allNonReactVendorPaths));
46167
46246
  }
46168
46247
  if (islandClientOutputs.length > 0 && Object.keys(allIslandVendorPaths).length > 0) {
46169
46248
  const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
46170
- await rewriteImports2(islandClientOutputs.map((artifact) => artifact.path), allIslandVendorPaths);
46249
+ await tracePhase("postprocess/island-vendor-imports", () => rewriteImports2(islandClientOutputs.map((artifact) => artifact.path), allIslandVendorPaths));
46171
46250
  }
46172
46251
  const cssLogs = [
46173
46252
  ...globalCssResult?.logs ?? [],
@@ -46189,11 +46268,11 @@ ${content.slice(firstUseIdx)}`;
46189
46268
  ];
46190
46269
  if (urlReferencedFiles.length > 0) {
46191
46270
  const urlFileMap = buildUrlFileMap(urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs);
46192
- rewriteUrlReferences(allClientOutputPaths, urlFileMap);
46271
+ await tracePhase("postprocess/url-references", () => rewriteUrlReferences(allClientOutputPaths, urlFileMap));
46193
46272
  }
46194
46273
  const vueOutputPaths = nonReactClientOutputs.map((artifact) => artifact.path).filter((path2) => path2.includes("/vue/"));
46195
46274
  if (hmr && vueDirectory) {
46196
- vueOutputPaths.forEach((outputPath) => injectVueComposableTracking(outputPath, projectRoot));
46275
+ await tracePhase("postprocess/vue-hmr", () => vueOutputPaths.forEach((outputPath) => injectVueComposableTracking(outputPath, projectRoot)));
46197
46276
  }
46198
46277
  const allLogs = [
46199
46278
  ...serverLogs,
@@ -46283,18 +46362,21 @@ ${content.slice(firstUseIdx)}`;
46283
46362
  manifest[fileName] = htmxFile;
46284
46363
  }
46285
46364
  };
46286
- await Promise.all([processHtmlPages(), processHtmxPages()]);
46365
+ await Promise.all([
46366
+ tracePhase("postprocess/html-pages", processHtmlPages),
46367
+ tracePhase("postprocess/htmx-pages", processHtmxPages)
46368
+ ]);
46287
46369
  if (!isIncremental) {
46288
- await cleanStaleOutputs(buildPath, [
46370
+ await tracePhase("cleanup/stale-outputs", () => cleanStaleOutputs(buildPath, [
46289
46371
  ...serverOutputs.map((a) => a.path),
46290
46372
  ...reactClientOutputs.map((a) => a.path),
46291
46373
  ...nonReactClientOutputs.map((a) => a.path),
46292
46374
  ...islandClientOutputs.map((a) => a.path),
46293
46375
  ...cssOutputs.map((a) => a.path)
46294
- ]);
46376
+ ]));
46295
46377
  }
46296
46378
  if (hmr) {
46297
- await copyDevIndexes({
46379
+ await tracePhase("dev/copy-indexes", () => copyDevIndexes({
46298
46380
  buildPath,
46299
46381
  reactIndexesPath,
46300
46382
  reactPagesPath,
@@ -46304,14 +46386,14 @@ ${content.slice(firstUseIdx)}`;
46304
46386
  vueDir,
46305
46387
  vueEntries,
46306
46388
  vuePagesPath
46307
- });
46389
+ }));
46308
46390
  }
46309
- await cleanup({
46391
+ await tracePhase("cleanup/generated", () => cleanup({
46310
46392
  angularDir,
46311
46393
  reactDir,
46312
46394
  svelteDir,
46313
46395
  vueDir
46314
- });
46396
+ }));
46315
46397
  if (!isIncremental) {
46316
46398
  globalThis.__hmrBuildDuration = performance.now() - buildStart;
46317
46399
  }
@@ -46320,12 +46402,15 @@ ${content.slice(firstUseIdx)}`;
46320
46402
  frameworks: frameworkNames,
46321
46403
  mode: mode ?? (isDev2 ? "development" : "production")
46322
46404
  });
46323
- if (isIncremental)
46405
+ if (isIncremental) {
46406
+ writeBuildTrace(buildPath);
46324
46407
  return { conventions: conventionsMap, manifest };
46408
+ }
46325
46409
  writeFileSync7(join20(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
46326
46410
  if (Object.keys(conventionsMap).length > 0) {
46327
46411
  writeFileSync7(join20(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
46328
46412
  }
46413
+ writeBuildTrace(buildPath);
46329
46414
  return { conventions: conventionsMap, manifest };
46330
46415
  };
46331
46416
  var init_build = __esm(() => {
@@ -58588,5 +58673,5 @@ export {
58588
58673
  ANGULAR_INIT_TIMEOUT_MS
58589
58674
  };
58590
58675
 
58591
- //# debugId=9C7C0E7B717B7EB164756E2164756E21
58676
+ //# debugId=64A59FBF213B352B64756E2164756E21
58592
58677
  //# sourceMappingURL=index.js.map