@tscircuit/cli 0.1.1190 → 0.1.1192

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.
@@ -11529,9 +11529,8 @@ function analyzeCircuitJson(circuitJson) {
11529
11529
  }
11530
11530
 
11531
11531
  // lib/shared/generate-circuit-json.tsx
11532
- var import_make_vfs = __toESM(require_dist(), 1);
11533
- import path2 from "node:path";
11534
11532
  import fs2 from "node:fs";
11533
+ import path2 from "node:path";
11535
11534
  import { pathToFileURL } from "node:url";
11536
11535
  import Debug from "debug";
11537
11536
 
@@ -11549,6 +11548,9 @@ var abbreviateStringifyObject = (obj) => {
11549
11548
  })));
11550
11549
  };
11551
11550
 
11551
+ // lib/shared/generate-circuit-json.tsx
11552
+ var import_make_vfs = __toESM(require_dist(), 1);
11553
+
11552
11554
  // lib/shared/importFromUserLand.ts
11553
11555
  import { createRequire as createRequire2 } from "node:module";
11554
11556
  import fs from "node:fs";
@@ -11598,7 +11600,8 @@ async function generateCircuitJson({
11598
11600
  outputFileName,
11599
11601
  saveToFile = false,
11600
11602
  platformConfig,
11601
- injectedProps
11603
+ injectedProps,
11604
+ onAsyncEffectStatus
11602
11605
  }) {
11603
11606
  debug(`Generating circuit JSON for ${filePath}`);
11604
11607
  const React = await importFromUserLand("react");
@@ -11648,7 +11651,21 @@ async function generateCircuitJson({
11648
11651
  runner.add(/* @__PURE__ */ jsxDEV(Component, {
11649
11652
  ...injectedProps ?? {}
11650
11653
  }, undefined, false, undefined, this));
11651
- await runner.renderUntilSettled();
11654
+ runner.render();
11655
+ const loggedAsyncEffectNames = new Set;
11656
+ while (runner._hasIncompleteAsyncEffects()) {
11657
+ for (const asyncEffect of runner.getRunningAsyncEffects()) {
11658
+ const asyncEffectName = asyncEffect.effectName;
11659
+ if (!asyncEffectName || loggedAsyncEffectNames.has(asyncEffectName)) {
11660
+ continue;
11661
+ }
11662
+ loggedAsyncEffectNames.add(asyncEffectName);
11663
+ onAsyncEffectStatus?.(asyncEffectName);
11664
+ }
11665
+ await new Promise((resolve2) => setTimeout(resolve2, 100));
11666
+ runner.render();
11667
+ }
11668
+ runner.emit("renderComplete");
11652
11669
  const circuitJson = await runner.getCircuitJson();
11653
11670
  if (saveToFile) {
11654
11671
  debug(`Saving circuit JSON to ${outputPath}`);
@@ -11656,7 +11673,8 @@ async function generateCircuitJson({
11656
11673
  }
11657
11674
  return {
11658
11675
  circuitJson,
11659
- outputPath
11676
+ outputPath,
11677
+ rootCircuit: runner
11660
11678
  };
11661
11679
  }
11662
11680
 
@@ -13543,7 +13561,7 @@ var loadCircuitJsonFromInputFile = (filePath) => {
13543
13561
  const parsed = JSON.parse(fs10.readFileSync(filePath, "utf-8"));
13544
13562
  return Array.isArray(parsed) ? parsed : [];
13545
13563
  };
13546
- var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputDir, projectDir, options, workerLog) => {
13564
+ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputDir, projectDir, options, workerLog, workerStatus) => {
13547
13565
  const errors = [];
13548
13566
  const warnings = [];
13549
13567
  const startedAt = options?.profile ? performance.now() : 0;
@@ -13557,7 +13575,10 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
13557
13575
  const circuitJson = isPrebuiltCircuitJson ? loadCircuitJsonFromInputFile(filePath) : (await generateCircuitJson({
13558
13576
  filePath,
13559
13577
  platformConfig: completePlatformConfig,
13560
- injectedProps: options?.injectedProps
13578
+ injectedProps: options?.injectedProps,
13579
+ onAsyncEffectStatus: (asyncEffectName) => {
13580
+ workerStatus(`waiting on ${asyncEffectName}…`);
13581
+ }
13561
13582
  })).circuitJson;
13562
13583
  fs10.mkdirSync(path13.dirname(outputPath), { recursive: true });
13563
13584
  fs10.writeFileSync(outputPath, JSON.stringify(circuitJson, null, 2));
@@ -13654,6 +13675,8 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
13654
13675
  warnings,
13655
13676
  durationMs: options?.profile ? performance.now() - startedAt : undefined
13656
13677
  };
13678
+ } finally {
13679
+ workerStatus(null);
13657
13680
  }
13658
13681
  };
13659
13682
 
@@ -13671,9 +13694,16 @@ var workerLog = (...args) => {
13671
13694
  log_lines: [line]
13672
13695
  });
13673
13696
  };
13697
+ var workerStatus = (statusLine) => {
13698
+ sendMessage({
13699
+ message_type: "worker_log",
13700
+ log_lines: [],
13701
+ status_line: statusLine
13702
+ });
13703
+ };
13674
13704
  parentPort.on("message", async (msg) => {
13675
13705
  if (msg.message_type === "build_file") {
13676
- const result = await handleBuildFile(msg.file_path, msg.output_path, msg.glb_output_path, msg.preview_output_dir, msg.project_dir, msg.options, workerLog);
13706
+ const result = await handleBuildFile(msg.file_path, msg.output_path, msg.glb_output_path, msg.preview_output_dir, msg.project_dir, msg.options, workerLog, workerStatus);
13677
13707
  sendMessage(result);
13678
13708
  }
13679
13709
  });
package/dist/cli/main.js CHANGED
@@ -99964,7 +99964,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
99964
99964
  // lib/getVersion.ts
99965
99965
  import { createRequire as createRequire2 } from "node:module";
99966
99966
  // package.json
99967
- var version = "0.1.1189";
99967
+ var version = "0.1.1190";
99968
99968
  var package_default = {
99969
99969
  name: "@tscircuit/cli",
99970
99970
  version,
@@ -100031,7 +100031,7 @@ var package_default = {
100031
100031
  redaxios: "^0.5.1",
100032
100032
  semver: "^7.6.3",
100033
100033
  tempy: "^3.1.0",
100034
- tscircuit: "0.0.1579-libonly",
100034
+ tscircuit: "0.0.1590-libonly",
100035
100035
  tsx: "^4.7.1",
100036
100036
  "typed-ky": "^0.0.4",
100037
100037
  zod: "^3.23.8",
@@ -109050,9 +109050,8 @@ function analyzeCircuitJson(circuitJson) {
109050
109050
  }
109051
109051
 
109052
109052
  // lib/shared/generate-circuit-json.tsx
109053
- var import_make_vfs = __toESM2(require_dist4(), 1);
109054
- import path25 from "node:path";
109055
109053
  import fs24 from "node:fs";
109054
+ import path25 from "node:path";
109056
109055
  import { pathToFileURL as pathToFileURL2 } from "node:url";
109057
109056
  import Debug from "debug";
109058
109057
 
@@ -109071,6 +109070,7 @@ var abbreviateStringifyObject = (obj) => {
109071
109070
  };
109072
109071
 
109073
109072
  // lib/shared/generate-circuit-json.tsx
109073
+ var import_make_vfs = __toESM2(require_dist4(), 1);
109074
109074
  import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
109075
109075
  var debug = Debug("tsci:generate-circuit-json");
109076
109076
  var ALLOWED_FILE_EXTENSIONS = [
@@ -109090,7 +109090,8 @@ async function generateCircuitJson({
109090
109090
  outputFileName,
109091
109091
  saveToFile = false,
109092
109092
  platformConfig,
109093
- injectedProps
109093
+ injectedProps,
109094
+ onAsyncEffectStatus
109094
109095
  }) {
109095
109096
  debug(`Generating circuit JSON for ${filePath}`);
109096
109097
  const React = await importFromUserLand("react");
@@ -109140,7 +109141,21 @@ async function generateCircuitJson({
109140
109141
  runner.add(/* @__PURE__ */ jsxDEV2(Component, {
109141
109142
  ...injectedProps ?? {}
109142
109143
  }, undefined, false, undefined, this));
109143
- await runner.renderUntilSettled();
109144
+ runner.render();
109145
+ const loggedAsyncEffectNames = new Set;
109146
+ while (runner._hasIncompleteAsyncEffects()) {
109147
+ for (const asyncEffect of runner.getRunningAsyncEffects()) {
109148
+ const asyncEffectName = asyncEffect.effectName;
109149
+ if (!asyncEffectName || loggedAsyncEffectNames.has(asyncEffectName)) {
109150
+ continue;
109151
+ }
109152
+ loggedAsyncEffectNames.add(asyncEffectName);
109153
+ onAsyncEffectStatus?.(asyncEffectName);
109154
+ }
109155
+ await new Promise((resolve3) => setTimeout(resolve3, 100));
109156
+ runner.render();
109157
+ }
109158
+ runner.emit("renderComplete");
109144
109159
  const circuitJson = await runner.getCircuitJson();
109145
109160
  if (saveToFile) {
109146
109161
  debug(`Saving circuit JSON to ${outputPath}`);
@@ -109148,7 +109163,8 @@ async function generateCircuitJson({
109148
109163
  }
109149
109164
  return {
109150
109165
  circuitJson,
109151
- outputPath
109166
+ outputPath,
109167
+ rootCircuit: runner
109152
109168
  };
109153
109169
  }
109154
109170
 
@@ -110696,7 +110712,8 @@ class ThreadWorkerPool {
110696
110712
  }
110697
110713
  const runningForMs = now - worker.currentJobStartedAt;
110698
110714
  const jobDescription = this.describeJob(worker.currentJob.job);
110699
- return `w${index}:busy task=${jobDescription} running_ms=${runningForMs}`;
110715
+ const statusSuffix = worker.currentStatus ? ` status=${worker.currentStatus}` : "";
110716
+ return `w${index}:busy task=${jobDescription} running_ms=${runningForMs}${statusSuffix}`;
110700
110717
  });
110701
110718
  this.options.onLog?.([
110702
110719
  `[worker-pool] heartbeat: workers busy=${busyWorkers}/${totalWorkers}, idle=${idleWorkers}, queued_jobs=${queuedJobs} | ${workerDetails.join(" | ")}`
@@ -110717,7 +110734,8 @@ class ThreadWorkerPool {
110717
110734
  busy: false,
110718
110735
  currentJob: null,
110719
110736
  currentJobStartedAt: null,
110720
- timeoutId: null
110737
+ timeoutId: null,
110738
+ currentStatus: null
110721
110739
  };
110722
110740
  this.attachWorkerHandlers(threadWorker);
110723
110741
  return threadWorker;
@@ -110762,6 +110780,7 @@ class ThreadWorkerPool {
110762
110780
  threadWorker.busy = false;
110763
110781
  threadWorker.currentJob = null;
110764
110782
  threadWorker.currentJobStartedAt = null;
110783
+ threadWorker.currentStatus = null;
110765
110784
  this.attachWorkerHandlers(threadWorker);
110766
110785
  }
110767
110786
  finishJob(threadWorker, action) {
@@ -110772,6 +110791,7 @@ class ThreadWorkerPool {
110772
110791
  this.clearWorkerTimeout(threadWorker);
110773
110792
  threadWorker.currentJob = null;
110774
110793
  threadWorker.currentJobStartedAt = null;
110794
+ threadWorker.currentStatus = null;
110775
110795
  threadWorker.busy = false;
110776
110796
  action(job);
110777
110797
  this.processQueue();
@@ -110783,6 +110803,7 @@ class ThreadWorkerPool {
110783
110803
  return;
110784
110804
  }
110785
110805
  if (this.options.isLogMessage(message)) {
110806
+ threadWorker.currentStatus = this.options.getStatusLine?.(message) ?? null;
110786
110807
  this.options.onLog?.(this.options.getLogLines(message));
110787
110808
  return;
110788
110809
  }
@@ -110837,6 +110858,7 @@ class ThreadWorkerPool {
110837
110858
  availableWorker.busy = true;
110838
110859
  availableWorker.currentJob = queuedJob;
110839
110860
  availableWorker.currentJobStartedAt = Date.now();
110861
+ availableWorker.currentStatus = null;
110840
110862
  this.startJobTimeout(availableWorker);
110841
110863
  availableWorker.worker.postMessage(this.options.createMessage(queuedJob.job));
110842
110864
  }
@@ -110902,6 +110924,7 @@ async function buildFilesWithWorkerPool(options) {
110902
110924
  }),
110903
110925
  isLogMessage: (message) => message.message_type === "worker_log",
110904
110926
  getLogLines: (message) => message.message_type === "worker_log" ? message.log_lines : [],
110927
+ getStatusLine: (message) => message.message_type === "worker_log" ? message.status_line ?? null : null,
110905
110928
  isCompletionMessage: (message) => message.message_type === "build_completed",
110906
110929
  getResult: (message) => {
110907
110930
  const completedMessage = message;
@@ -110932,7 +110955,8 @@ async function buildFilesWithWorkerPool(options) {
110932
110955
  },
110933
110956
  cancellationError,
110934
110957
  jobTimeoutMs: Number.isFinite(workerJobTimeoutMs) && workerJobTimeoutMs > 0 ? workerJobTimeoutMs : undefined,
110935
- onLog: options.onLog
110958
+ onLog: options.onLog,
110959
+ heartbeatIntervalMs: 100
110936
110960
  });
110937
110961
  const results = [];
110938
110962
  const promises = [];
@@ -111010,7 +111034,7 @@ var getOutputDirName = (relativePath) => {
111010
111034
  return relativePath.replace(/(\.board|\.circuit)?\.tsx$/, "").replace(/\.circuit\.json$/, "");
111011
111035
  };
111012
111036
  var registerBuild = (program2) => {
111013
- program2.command("build").description("Run tscircuit eval and output circuit json").argument("[file]", "Path to the entry file").option("--ci", "Run install and optional prebuild/build commands (or default CI build)").option("--ignore-errors", "Do not exit with code 1 on errors").option("--ignore-warnings", "Do not log warnings").option("--ignore-netlist-drc", "Ignore netlist DRC errors/warnings").option("--ignore-pin-specification-drc", "Ignore pin-specification DRC errors/warnings").option("--ignore-placement-drc", "Ignore placement DRC errors/warnings").option("--ignore-routing-drc", "Ignore routing DRC errors/warnings").option("--ignore-config", "Ignore options from tscircuit.config.json").option("--disable-pcb", "Disable PCB outputs").option("--routing-disabled", "Disable routing during circuit generation").option("--disable-parts-engine", "Disable the parts engine").option("--site", "Generate a static site in the dist directory").option("--transpile", "Transpile the entry file to JavaScript").option("--preview-images", "Generate preview images in the dist directory").option("--all-images", "Generate preview images for every successful build output").option("--pngs", "Generate PNG outputs during build generation").option("--pcb-png", "Generate PCB PNG outputs during build generation").option("--svgs", "Generate SVG outputs during build generation").option("--pcb-svgs", "Generate PCB SVG outputs during build generation").option("--schematic-svgs", "Generate schematic SVG outputs during build generation").option("--3d-png", "Generate 3D PNG outputs during build generation").option("--3d", "Generate 3D PNG outputs during build generation").option("--pcb-only", "Generate only PCB SVG outputs during build generation").option("--schematic-only", "Generate only schematic SVG outputs during build generation").option("--kicad-project", "Generate KiCad project directories for each successful build output").option("--kicad-project-zip", "Generate a zipped KiCad project for each successful build output").option("--kicad-library", "Generate KiCad library in dist/kicad-library").option("--kicad-library-name <name>", "Specify the name of the KiCad library").option("--preview-gltf", "Generate a GLTF file from the preview entrypoint").option("--glbs", "Generate GLB 3D model files for every successful build").option("--profile", "Log per-circuit circuit.json generation time during build").option("--kicad-pcm", "Generate KiCad PCM (Plugin and Content Manager) assets in dist/pcm").option("--use-cdn-javascript", "Use CDN-hosted JavaScript instead of bundled standalone file for --site").option("--concurrency <number>", "Number of files to build in parallel (default: 1)", "1").option("--inject-props <json>", "Inject JSON props into the built file's default export").option("--inject-props-file <path>", "Inject JSON props from a file into the built file's default export").action(async (file, options) => {
111037
+ program2.command("build").description("Run tscircuit eval and output circuit json").argument("[file]", "Path to the entry file").option("--ci", "Run install and optional prebuild/build commands (or default CI build)").option("--ignore-errors", "Do not exit with code 1 on errors").option("--ignore-warnings", "Do not log warnings").option("--ignore-netlist-drc", "Ignore netlist DRC errors/warnings").option("--ignore-pin-specification-drc", "Ignore pin-specification DRC errors/warnings").option("--ignore-placement-drc", "Ignore placement DRC errors/warnings").option("--ignore-routing-drc", "Ignore routing DRC errors/warnings").option("--ignore-config", "Ignore options from tscircuit.config.json").option("--disable-pcb", "Disable PCB outputs").option("--routing-disabled", "Disable routing during circuit generation").option("--disable-parts-engine", "Disable the parts engine").option("--site", "Generate a static site in the dist directory").option("--transpile", "Transpile the entry file to JavaScript").option("--preview-images", "Generate preview images in the dist directory").option("--all-images", "Generate preview images for every successful build output").option("--pngs", "Generate PNG outputs during build generation").option("--pcb-png", "Generate PCB PNG outputs during build generation").option("--svgs", "Generate SVG outputs during build generation").option("--pcb-svgs", "Generate PCB SVG outputs during build generation").option("--schematic-svgs", "Generate schematic SVG outputs during build generation").option("--3d-png", "Generate 3D PNG outputs during build generation").option("--3d", "Generate 3D PNG outputs during build generation").option("--pcb-only", "Generate only PCB SVG outputs during build generation").option("--schematic-only", "Generate only schematic SVG outputs during build generation").option("--kicad-project", "Generate KiCad project directories for each successful build output").option("--kicad-project-zip", "Generate a zipped KiCad project for each successful build output").option("--kicad-library", "Generate KiCad library in dist/kicad-library").option("--kicad-library-name <name>", "Specify the name of the KiCad library").option("--preview-gltf", "Generate a GLTF file from the preview entrypoint").option("--show-courtyards", "Show courtyard outlines in PCB SVG outputs").option("--glbs", "Generate GLB 3D model files for every successful build").option("--profile", "Log per-circuit circuit.json generation time during build").option("--kicad-pcm", "Generate KiCad PCM (Plugin and Content Manager) assets in dist/pcm").option("--use-cdn-javascript", "Use CDN-hosted JavaScript instead of bundled standalone file for --site").option("--concurrency <number>", "Number of files to build in parallel (default: 1)", "1").option("--inject-props <json>", "Inject JSON props into the built file's default export").option("--inject-props-file <path>", "Inject JSON props from a file into the built file's default export").action(async (file, options) => {
111014
111038
  try {
111015
111039
  const transpileExplicitlyRequested = options?.transpile === true;
111016
111040
  const resolvedRoot = path39.resolve(process.cwd());
@@ -111115,7 +111139,7 @@ var registerBuild = (program2) => {
111115
111139
  injectedProps,
111116
111140
  generatePreviewAssets: false,
111117
111141
  imageFormats: imageFormatSelection,
111118
- pcbSnapshotSettings: projectConfig?.pcbSnapshotSettings
111142
+ pcbSnapshotSettings: resolvedOptions?.showCourtyards ? { ...projectConfig?.pcbSnapshotSettings, showCourtyards: true } : projectConfig?.pcbSnapshotSettings
111119
111143
  };
111120
111144
  const shouldGeneratePreviewImages = Boolean((resolvedOptions?.previewImages || resolvedOptions?.allImages || hasExplicitImageFormatSelection) && hasAnyImageFormatSelected(imageFormatSelection));
111121
111145
  const shouldGenerateAllPreviewImages = Boolean(resolvedOptions?.allImages);
@@ -111315,7 +111339,10 @@ var registerBuild = (program2) => {
111315
111339
  previewComponentPath,
111316
111340
  allImages: shouldGenerateAllPreviewImages,
111317
111341
  imageFormats: imageFormatSelection,
111318
- pcbSnapshotSettings: projectConfig?.pcbSnapshotSettings
111342
+ pcbSnapshotSettings: resolvedOptions?.showCourtyards ? {
111343
+ ...projectConfig?.pcbSnapshotSettings,
111344
+ showCourtyards: true
111345
+ } : projectConfig?.pcbSnapshotSettings
111319
111346
  });
111320
111347
  }
111321
111348
  }
@@ -250365,6 +250392,7 @@ var exportSnippet = async ({
250365
250392
  format,
250366
250393
  outputPath,
250367
250394
  platformConfig: platformConfig2,
250395
+ pcbSnapshotSettings,
250368
250396
  writeFile = true,
250369
250397
  onExit = (code) => process.exit(code),
250370
250398
  onError = (message) => console.error(message),
@@ -250432,7 +250460,7 @@ var exportSnippet = async ({
250432
250460
  outputContent = convertCircuitJsonToSchematicSvg3(circuitJson);
250433
250461
  break;
250434
250462
  case "pcb-svg":
250435
- outputContent = convertCircuitJsonToPcbSvg3(circuitJson);
250463
+ outputContent = convertCircuitJsonToPcbSvg3(circuitJson, pcbSnapshotSettings);
250436
250464
  break;
250437
250465
  case "specctra-dsn":
250438
250466
  outputContent = convertCircuitJsonToDsnString(circuitJson);
@@ -250780,7 +250808,7 @@ var resultToCsv = (result) => {
250780
250808
  import path57 from "node:path";
250781
250809
  import { promises as fs55 } from "node:fs";
250782
250810
  var registerExport = (program2) => {
250783
- program2.command("export").description("Export tscircuit code to various formats").argument("<file>", "Path to the package file").option("-f, --format <format>", `Output format (${ALLOWED_EXPORT_FORMATS.join(", ")})`).option("-o, --output <path>", "Output file path").option("--disable-parts-engine", "Disable the parts engine").action(async (file, options) => {
250811
+ program2.command("export").description("Export tscircuit code to various formats").argument("<file>", "Path to the package file").option("-f, --format <format>", `Output format (${ALLOWED_EXPORT_FORMATS.join(", ")})`).option("-o, --output <path>", "Output file path").option("--disable-parts-engine", "Disable the parts engine").option("--show-courtyards", "Show courtyard outlines in PCB SVG output").action(async (file, options) => {
250784
250812
  const formatOption = options.format ?? "json";
250785
250813
  const platformConfig2 = options.disablePartsEngine === true ? { partsEngineDisabled: true } : undefined;
250786
250814
  if (formatOption === "spice") {
@@ -250806,6 +250834,7 @@ var registerExport = (program2) => {
250806
250834
  format,
250807
250835
  outputPath: options.output,
250808
250836
  platformConfig: platformConfig2,
250837
+ pcbSnapshotSettings: options.showCourtyards ? { showCourtyards: true } : undefined,
250809
250838
  onExit: (code) => process.exit(code),
250810
250839
  onError: (message) => console.error(message),
250811
250840
  onSuccess: ({ outputDestination }) => console.log(`Exported to ${outputDestination}!`)
@@ -273674,6 +273703,7 @@ var snapshotProject = async ({
273674
273703
  onError = (msg) => console.error(msg),
273675
273704
  onSuccess = (msg) => console.log(msg),
273676
273705
  platformConfig: platformConfig2,
273706
+ pcbSnapshotSettingsOverride,
273677
273707
  createDiff: createDiff2 = false,
273678
273708
  cameraPreset,
273679
273709
  concurrency = 1
@@ -273715,6 +273745,7 @@ var snapshotProject = async ({
273715
273745
  return onExit2(0);
273716
273746
  }
273717
273747
  const snapshotsDirName = getSnapshotsDir(projectDir);
273748
+ const pcbSnapshotSettings = pcbSnapshotSettingsOverride ? { ...projectConfig2?.pcbSnapshotSettings, ...pcbSnapshotSettingsOverride } : projectConfig2?.pcbSnapshotSettings;
273718
273749
  const mismatches = [];
273719
273750
  let didUpdate = false;
273720
273751
  const concurrencyValue = Math.max(1, concurrency);
@@ -273744,7 +273775,7 @@ var snapshotProject = async ({
273744
273775
  schematicOnly,
273745
273776
  forceUpdate,
273746
273777
  platformConfig: platformConfig2,
273747
- pcbSnapshotSettings: projectConfig2?.pcbSnapshotSettings,
273778
+ pcbSnapshotSettings,
273748
273779
  createDiff: createDiff2,
273749
273780
  cameraPreset
273750
273781
  },
@@ -273783,7 +273814,7 @@ var snapshotProject = async ({
273783
273814
  schematicOnly,
273784
273815
  forceUpdate,
273785
273816
  platformConfig: platformConfig2,
273786
- pcbSnapshotSettings: projectConfig2?.pcbSnapshotSettings,
273817
+ pcbSnapshotSettings,
273787
273818
  createDiff: createDiff2,
273788
273819
  cameraPreset
273789
273820
  });
@@ -273812,7 +273843,7 @@ Run with --update to fix.`);
273812
273843
 
273813
273844
  // cli/snapshot/register.ts
273814
273845
  var registerSnapshot = (program3) => {
273815
- program3.command("snapshot").argument("[path]", "Path to file, directory, or glob pattern (e.g., 'examples/**/*.tsx')").description("Generate schematic and PCB snapshots (add --3d for 3d preview)").option("-u, --update", "Update snapshots on disk").option("--force-update", "Force update snapshots even if they match").option("--3d", "Generate 3d preview snapshots").option("--pcb-only", "Generate only PCB snapshots").option("--schematic-only", "Generate only schematic snapshots").option("--disable-parts-engine", "Disable the parts engine").option("--camera-preset <preset>", `Camera angle preset for 3D snapshots (implies --3d). Valid presets: ${CAMERA_PRESET_NAMES.join(", ")}`).option("--ci", "Enable CI mode with snapshot diff artifacts").option("--test", "Enable test mode with snapshot diff artifacts").option("--concurrency <number>", "Number of files to snapshot in parallel (default: 1)", "1").action(async (target, options) => {
273846
+ program3.command("snapshot").argument("[path]", "Path to file, directory, or glob pattern (e.g., 'examples/**/*.tsx')").description("Generate schematic and PCB snapshots (add --3d for 3d preview)").option("-u, --update", "Update snapshots on disk").option("--force-update", "Force update snapshots even if they match").option("--3d", "Generate 3d preview snapshots").option("--pcb-only", "Generate only PCB snapshots").option("--schematic-only", "Generate only schematic snapshots").option("--disable-parts-engine", "Disable the parts engine").option("--show-courtyards", "Show courtyard outlines in PCB snapshots").option("--camera-preset <preset>", `Camera angle preset for 3D snapshots (implies --3d). Valid presets: ${CAMERA_PRESET_NAMES.join(", ")}`).option("--ci", "Enable CI mode with snapshot diff artifacts").option("--test", "Enable test mode with snapshot diff artifacts").option("--concurrency <number>", "Number of files to snapshot in parallel (default: 1)", "1").action(async (target, options) => {
273816
273847
  if (options.cameraPreset && !CAMERA_PRESET_NAMES.includes(options.cameraPreset)) {
273817
273848
  console.error(`Unknown camera preset "${options.cameraPreset}". Valid presets: ${CAMERA_PRESET_NAMES.join(", ")}`);
273818
273849
  process.exit(1);
@@ -273826,6 +273857,7 @@ var registerSnapshot = (program3) => {
273826
273857
  forceUpdate: options.forceUpdate ?? false,
273827
273858
  filePaths: target ? [target] : [],
273828
273859
  platformConfig: options.disablePartsEngine ? { partsEngineDisabled: true } : undefined,
273860
+ pcbSnapshotSettingsOverride: options.showCourtyards ? { showCourtyards: true } : undefined,
273829
273861
  cameraPreset: options.cameraPreset,
273830
273862
  createDiff: (options.ci ?? false) || (options.test ?? false),
273831
273863
  onExit: (code) => process.exit(code),
@@ -11667,9 +11667,8 @@ function applyCameraPreset(preset, cam) {
11667
11667
  }
11668
11668
 
11669
11669
  // lib/shared/generate-circuit-json.tsx
11670
- var import_make_vfs = __toESM(require_dist(), 1);
11671
- import path2 from "node:path";
11672
11670
  import fs2 from "node:fs";
11671
+ import path2 from "node:path";
11673
11672
  import { pathToFileURL } from "node:url";
11674
11673
  import Debug from "debug";
11675
11674
 
@@ -11687,6 +11686,9 @@ var abbreviateStringifyObject = (obj) => {
11687
11686
  })));
11688
11687
  };
11689
11688
 
11689
+ // lib/shared/generate-circuit-json.tsx
11690
+ var import_make_vfs = __toESM(require_dist(), 1);
11691
+
11690
11692
  // lib/shared/importFromUserLand.ts
11691
11693
  import { createRequire as createRequire2 } from "node:module";
11692
11694
  import fs from "node:fs";
@@ -11736,7 +11738,8 @@ async function generateCircuitJson({
11736
11738
  outputFileName,
11737
11739
  saveToFile = false,
11738
11740
  platformConfig,
11739
- injectedProps
11741
+ injectedProps,
11742
+ onAsyncEffectStatus
11740
11743
  }) {
11741
11744
  debug(`Generating circuit JSON for ${filePath}`);
11742
11745
  const React = await importFromUserLand("react");
@@ -11786,7 +11789,21 @@ async function generateCircuitJson({
11786
11789
  runner.add(/* @__PURE__ */ jsxDEV(Component, {
11787
11790
  ...injectedProps ?? {}
11788
11791
  }, undefined, false, undefined, this));
11789
- await runner.renderUntilSettled();
11792
+ runner.render();
11793
+ const loggedAsyncEffectNames = new Set;
11794
+ while (runner._hasIncompleteAsyncEffects()) {
11795
+ for (const asyncEffect of runner.getRunningAsyncEffects()) {
11796
+ const asyncEffectName = asyncEffect.effectName;
11797
+ if (!asyncEffectName || loggedAsyncEffectNames.has(asyncEffectName)) {
11798
+ continue;
11799
+ }
11800
+ loggedAsyncEffectNames.add(asyncEffectName);
11801
+ onAsyncEffectStatus?.(asyncEffectName);
11802
+ }
11803
+ await new Promise((resolve2) => setTimeout(resolve2, 100));
11804
+ runner.render();
11805
+ }
11806
+ runner.emit("renderComplete");
11790
11807
  const circuitJson = await runner.getCircuitJson();
11791
11808
  if (saveToFile) {
11792
11809
  debug(`Saving circuit JSON to ${outputPath}`);
@@ -11794,7 +11811,8 @@ async function generateCircuitJson({
11794
11811
  }
11795
11812
  return {
11796
11813
  circuitJson,
11797
- outputPath
11814
+ outputPath,
11815
+ rootCircuit: runner
11798
11816
  };
11799
11817
  }
11800
11818
 
package/dist/lib/index.js CHANGED
@@ -60678,7 +60678,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60678
60678
  }));
60679
60679
  };
60680
60680
  // package.json
60681
- var version = "0.1.1189";
60681
+ var version = "0.1.1190";
60682
60682
  var package_default = {
60683
60683
  name: "@tscircuit/cli",
60684
60684
  version,
@@ -60745,7 +60745,7 @@ var package_default = {
60745
60745
  redaxios: "^0.5.1",
60746
60746
  semver: "^7.6.3",
60747
60747
  tempy: "^3.1.0",
60748
- tscircuit: "0.0.1579-libonly",
60748
+ tscircuit: "0.0.1590-libonly",
60749
60749
  tsx: "^4.7.1",
60750
60750
  "typed-ky": "^0.0.4",
60751
60751
  zod: "^3.23.8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1190",
3
+ "version": "0.1.1192",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",
@@ -64,7 +64,7 @@
64
64
  "redaxios": "^0.5.1",
65
65
  "semver": "^7.6.3",
66
66
  "tempy": "^3.1.0",
67
- "tscircuit": "0.0.1579-libonly",
67
+ "tscircuit": "0.0.1590-libonly",
68
68
  "tsx": "^4.7.1",
69
69
  "typed-ky": "^0.0.4",
70
70
  "zod": "^3.23.8",