@tscircuit/cli 0.1.1528 → 0.1.1530

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/cli/main.js CHANGED
@@ -100768,7 +100768,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
100768
100768
  // lib/getVersion.ts
100769
100769
  import { createRequire as createRequire2 } from "node:module";
100770
100770
  // package.json
100771
- var version = "0.1.1527";
100771
+ var version = "0.1.1528";
100772
100772
  var package_default = {
100773
100773
  name: "@tscircuit/cli",
100774
100774
  version,
@@ -100783,7 +100783,6 @@ var package_default = {
100783
100783
  "@tscircuit/circuit-json-placement-analysis": "^0.0.6",
100784
100784
  "@tscircuit/circuit-json-routing-analysis": "^0.0.1",
100785
100785
  "@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#b6d5fe675adc26a2fc988aa081e6fb51e6bf696a",
100786
- "@tscircuit/eecircuit-engine": "https://jscdn.tscircuit.com/@tscircuit/eecircuit-engine/1.7.4.tgz",
100787
100786
  "@tscircuit/eval": "^0.0.933",
100788
100787
  "@tscircuit/fake-snippets": "^0.0.182",
100789
100788
  "@tscircuit/fake-ul-kicad-proxy": "github:tscircuit/fake-ul-kicad-proxy#d174c33c1b17a52d7a9dc3c2b5506d6fd593bed7",
@@ -257043,12 +257042,12 @@ import path60 from "node:path";
257043
257042
  import os8 from "node:os";
257044
257043
  var sim = null;
257045
257044
  var fetchSimulation = async () => {
257046
- const tempFilePath = path60.join(os8.tmpdir(), "eecircuit-engine-1.5.2.mjs");
257045
+ const tempFilePath = path60.join(os8.tmpdir(), `tscircuit-eecircuit-engine-1.7.4.mjs`);
257047
257046
  if (!existsSync14(tempFilePath)) {
257048
- const url2 = "https://cdn.jsdelivr.net/npm/eecircuit-engine@1.5.2/+esm";
257047
+ const url2 = `https://jscdn.tscircuit.com/@tscircuit/eecircuit-engine/1.7.4/dist/eecircuit-engine.mjs`;
257049
257048
  const response = await fetch(url2);
257050
257049
  if (!response.ok) {
257051
- throw new Error(`Failed to fetch eecircuit-engine from ${url2}: ${response.statusText}`);
257050
+ throw new Error(`Failed to fetch @tscircuit/eecircuit-engine from ${url2}: ${response.statusText}`);
257052
257051
  }
257053
257052
  const scriptContent = await response.text();
257054
257053
  await fs56.writeFile(tempFilePath, scriptContent);
@@ -278298,6 +278297,7 @@ var snapshotFilesWithWorkerPool = async (options) => {
278298
278297
  threeD: job.options.threeD,
278299
278298
  pcbOnly: job.options.pcbOnly,
278300
278299
  schematicOnly: job.options.schematicOnly,
278300
+ simulationOnly: job.options.simulationOnly,
278301
278301
  forceUpdate: job.options.forceUpdate,
278302
278302
  platformConfig: job.options.platformConfig,
278303
278303
  pcbSnapshotSettings: job.options.pcbSnapshotSettings,
@@ -278396,6 +278396,7 @@ var processSnapshotFile = async ({
278396
278396
  threeD,
278397
278397
  pcbOnly,
278398
278398
  schematicOnly,
278399
+ simulationOnly,
278399
278400
  forceUpdate,
278400
278401
  platformConfig: platformConfig2,
278401
278402
  pcbSnapshotSettings,
@@ -278438,40 +278439,42 @@ var processSnapshotFile = async ({
278438
278439
  `)
278439
278440
  };
278440
278441
  }
278441
- try {
278442
- pcbSvg = convertCircuitJsonToPcbSvg5(circuitJson, {
278443
- ...pcbSnapshotSettings,
278444
- layer: pcbLayer
278445
- });
278446
- } catch (error) {
278447
- const errorMessage = error instanceof Error ? error.message : String(error);
278448
- return {
278449
- ok: false,
278450
- didUpdate: false,
278451
- successPaths,
278452
- warningMessages,
278453
- mismatches,
278454
- errorMessage: kleur_default.red(`
278442
+ if (!simulationOnly) {
278443
+ try {
278444
+ pcbSvg = convertCircuitJsonToPcbSvg5(circuitJson, {
278445
+ ...pcbSnapshotSettings,
278446
+ layer: pcbLayer
278447
+ });
278448
+ } catch (error) {
278449
+ const errorMessage = error instanceof Error ? error.message : String(error);
278450
+ return {
278451
+ ok: false,
278452
+ didUpdate: false,
278453
+ successPaths,
278454
+ warningMessages,
278455
+ mismatches,
278456
+ errorMessage: kleur_default.red(`
278455
278457
  ❌ Failed to generate PCB SVG for ${relativeFilePath}:
278456
278458
  `) + kleur_default.red(` ${errorMessage}
278457
278459
  `)
278458
- };
278459
- }
278460
- try {
278461
- schSvg = convertCircuitJsonToSchematicSvg5(circuitJson);
278462
- } catch (error) {
278463
- const errorMessage = error instanceof Error ? error.message : String(error);
278464
- return {
278465
- ok: false,
278466
- didUpdate: false,
278467
- successPaths,
278468
- warningMessages,
278469
- mismatches,
278470
- errorMessage: kleur_default.red(`
278460
+ };
278461
+ }
278462
+ try {
278463
+ schSvg = convertCircuitJsonToSchematicSvg5(circuitJson);
278464
+ } catch (error) {
278465
+ const errorMessage = error instanceof Error ? error.message : String(error);
278466
+ return {
278467
+ ok: false,
278468
+ didUpdate: false,
278469
+ successPaths,
278470
+ warningMessages,
278471
+ mismatches,
278472
+ errorMessage: kleur_default.red(`
278471
278473
  ❌ Failed to generate schematic SVG for ${relativeFilePath}:
278472
278474
  `) + kleur_default.red(` ${errorMessage}
278473
278475
  `)
278474
- };
278476
+ };
278477
+ }
278475
278478
  }
278476
278479
  try {
278477
278480
  simulationSvgAssets = getSimulationSvgAssetsFromCircuitJson(circuitJson);
@@ -278490,7 +278493,7 @@ var processSnapshotFile = async ({
278490
278493
  };
278491
278494
  }
278492
278495
  let png3d = null;
278493
- if (threeD) {
278496
+ if (threeD && !simulationOnly) {
278494
278497
  try {
278495
278498
  const glbBuffer = await convertCircuitJsonToGltf6(circuitJson, getCircuitJsonToGltfOptions({ format: "glb" }));
278496
278499
  if (!(glbBuffer instanceof ArrayBuffer)) {
@@ -278545,7 +278548,7 @@ var processSnapshotFile = async ({
278545
278548
  fs65.mkdirSync(snapDir, { recursive: true });
278546
278549
  const base = path69.basename(file).replace(/\.[^.]+$/, "");
278547
278550
  const snapshots = [];
278548
- if (pcbOnly || !schematicOnly) {
278551
+ if (!simulationOnly && (pcbOnly || !schematicOnly)) {
278549
278552
  let pcbSnapshotType = "pcb";
278550
278553
  if (pcbLayer) {
278551
278554
  pcbSnapshotType = pcbLayer;
@@ -278556,13 +278559,13 @@ var processSnapshotFile = async ({
278556
278559
  isBinary: false
278557
278560
  });
278558
278561
  }
278559
- if (schematicOnly || !pcbOnly) {
278562
+ if (!simulationOnly && (schematicOnly || !pcbOnly)) {
278560
278563
  snapshots.push({ type: "schematic", content: schSvg, isBinary: false });
278561
278564
  }
278562
278565
  if (threeD && png3d) {
278563
278566
  snapshots.push({ type: "3d", content: png3d, isBinary: true });
278564
278567
  }
278565
- if (!pcbOnly && !schematicOnly && simulationSvgAssets) {
278568
+ if ((simulationOnly || !pcbOnly && !schematicOnly) && simulationSvgAssets) {
278566
278569
  snapshots.push({
278567
278570
  type: "simulation",
278568
278571
  content: simulationSvgAssets.simulationSvg,
@@ -278631,6 +278634,7 @@ var snapshotProject = async ({
278631
278634
  threeD = false,
278632
278635
  pcbOnly = false,
278633
278636
  schematicOnly = false,
278637
+ simulationOnly = false,
278634
278638
  filePaths = [],
278635
278639
  forceUpdate = false,
278636
278640
  onExit: onExit2 = (code) => process.exit(code),
@@ -278710,6 +278714,7 @@ var snapshotProject = async ({
278710
278714
  threeD,
278711
278715
  pcbOnly,
278712
278716
  schematicOnly,
278717
+ simulationOnly,
278713
278718
  forceUpdate,
278714
278719
  platformConfig: platformConfig2,
278715
278720
  pcbSnapshotSettings,
@@ -278750,6 +278755,7 @@ var snapshotProject = async ({
278750
278755
  threeD,
278751
278756
  pcbOnly,
278752
278757
  schematicOnly,
278758
+ simulationOnly,
278753
278759
  forceUpdate,
278754
278760
  platformConfig: mergedPlatformConfig,
278755
278761
  pcbSnapshotSettings,
@@ -278782,7 +278788,7 @@ Run with --update to fix.`);
278782
278788
 
278783
278789
  // cli/snapshot/register.ts
278784
278790
  var registerSnapshot = (program3) => {
278785
- 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("--layer <layer>", "Generate a PCB snapshot for one layer: top or bottom (implies --pcb-only)").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) => {
278791
+ 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("--simulation-only", "Generate only simulation snapshots").option("--layer <layer>", "Generate a PCB snapshot for one layer: top or bottom (implies --pcb-only)").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) => {
278786
278792
  if (options.cameraPreset && !CAMERA_PRESET_NAMES.includes(options.cameraPreset)) {
278787
278793
  console.error(`Unknown camera preset "${options.cameraPreset}". Valid presets: ${CAMERA_PRESET_NAMES.join(", ")}`);
278788
278794
  process.exit(1);
@@ -278798,6 +278804,10 @@ var registerSnapshot = (program3) => {
278798
278804
  console.error("A PCB layer snapshot cannot be combined with --schematic-only.");
278799
278805
  process.exit(1);
278800
278806
  }
278807
+ if (options.simulationOnly && (options.pcbOnly || options.schematicOnly || Boolean(pcbLayer) || options["3d"] || options.cameraPreset)) {
278808
+ console.error("--simulation-only cannot be combined with --pcb-only, --schematic-only, --layer, --3d, or --camera-preset.");
278809
+ process.exit(1);
278810
+ }
278801
278811
  let pcbOnly = options.pcbOnly ?? false;
278802
278812
  if (pcbLayer) {
278803
278813
  pcbOnly = true;
@@ -278808,6 +278818,7 @@ var registerSnapshot = (program3) => {
278808
278818
  threeD: options["3d"] ?? false,
278809
278819
  pcbOnly,
278810
278820
  schematicOnly: options.schematicOnly ?? false,
278821
+ simulationOnly: options.simulationOnly ?? false,
278811
278822
  pcbLayer,
278812
278823
  forceUpdate: options.forceUpdate ?? false,
278813
278824
  filePaths: target ? [target] : [],
@@ -13607,6 +13607,7 @@ var processSnapshotFile = async ({
13607
13607
  threeD,
13608
13608
  pcbOnly,
13609
13609
  schematicOnly,
13610
+ simulationOnly,
13610
13611
  forceUpdate,
13611
13612
  platformConfig,
13612
13613
  pcbSnapshotSettings,
@@ -13649,40 +13650,42 @@ var processSnapshotFile = async ({
13649
13650
  `)
13650
13651
  };
13651
13652
  }
13652
- try {
13653
- pcbSvg = convertCircuitJsonToPcbSvg(circuitJson, {
13654
- ...pcbSnapshotSettings,
13655
- layer: pcbLayer
13656
- });
13657
- } catch (error) {
13658
- const errorMessage = error instanceof Error ? error.message : String(error);
13659
- return {
13660
- ok: false,
13661
- didUpdate: false,
13662
- successPaths,
13663
- warningMessages,
13664
- mismatches,
13665
- errorMessage: kleur_default.red(`
13653
+ if (!simulationOnly) {
13654
+ try {
13655
+ pcbSvg = convertCircuitJsonToPcbSvg(circuitJson, {
13656
+ ...pcbSnapshotSettings,
13657
+ layer: pcbLayer
13658
+ });
13659
+ } catch (error) {
13660
+ const errorMessage = error instanceof Error ? error.message : String(error);
13661
+ return {
13662
+ ok: false,
13663
+ didUpdate: false,
13664
+ successPaths,
13665
+ warningMessages,
13666
+ mismatches,
13667
+ errorMessage: kleur_default.red(`
13666
13668
  ❌ Failed to generate PCB SVG for ${relativeFilePath}:
13667
13669
  `) + kleur_default.red(` ${errorMessage}
13668
13670
  `)
13669
- };
13670
- }
13671
- try {
13672
- schSvg = convertCircuitJsonToSchematicSvg(circuitJson);
13673
- } catch (error) {
13674
- const errorMessage = error instanceof Error ? error.message : String(error);
13675
- return {
13676
- ok: false,
13677
- didUpdate: false,
13678
- successPaths,
13679
- warningMessages,
13680
- mismatches,
13681
- errorMessage: kleur_default.red(`
13671
+ };
13672
+ }
13673
+ try {
13674
+ schSvg = convertCircuitJsonToSchematicSvg(circuitJson);
13675
+ } catch (error) {
13676
+ const errorMessage = error instanceof Error ? error.message : String(error);
13677
+ return {
13678
+ ok: false,
13679
+ didUpdate: false,
13680
+ successPaths,
13681
+ warningMessages,
13682
+ mismatches,
13683
+ errorMessage: kleur_default.red(`
13682
13684
  ❌ Failed to generate schematic SVG for ${relativeFilePath}:
13683
13685
  `) + kleur_default.red(` ${errorMessage}
13684
13686
  `)
13685
- };
13687
+ };
13688
+ }
13686
13689
  }
13687
13690
  try {
13688
13691
  simulationSvgAssets = getSimulationSvgAssetsFromCircuitJson(circuitJson);
@@ -13701,7 +13704,7 @@ var processSnapshotFile = async ({
13701
13704
  };
13702
13705
  }
13703
13706
  let png3d = null;
13704
- if (threeD) {
13707
+ if (threeD && !simulationOnly) {
13705
13708
  try {
13706
13709
  const glbBuffer = await convertCircuitJsonToGltf(circuitJson, getCircuitJsonToGltfOptions({ format: "glb" }));
13707
13710
  if (!(glbBuffer instanceof ArrayBuffer)) {
@@ -13756,7 +13759,7 @@ var processSnapshotFile = async ({
13756
13759
  fs10.mkdirSync(snapDir, { recursive: true });
13757
13760
  const base = path11.basename(file).replace(/\.[^.]+$/, "");
13758
13761
  const snapshots = [];
13759
- if (pcbOnly || !schematicOnly) {
13762
+ if (!simulationOnly && (pcbOnly || !schematicOnly)) {
13760
13763
  let pcbSnapshotType = "pcb";
13761
13764
  if (pcbLayer) {
13762
13765
  pcbSnapshotType = pcbLayer;
@@ -13767,13 +13770,13 @@ var processSnapshotFile = async ({
13767
13770
  isBinary: false
13768
13771
  });
13769
13772
  }
13770
- if (schematicOnly || !pcbOnly) {
13773
+ if (!simulationOnly && (schematicOnly || !pcbOnly)) {
13771
13774
  snapshots.push({ type: "schematic", content: schSvg, isBinary: false });
13772
13775
  }
13773
13776
  if (threeD && png3d) {
13774
13777
  snapshots.push({ type: "3d", content: png3d, isBinary: true });
13775
13778
  }
13776
- if (!pcbOnly && !schematicOnly && simulationSvgAssets) {
13779
+ if ((simulationOnly || !pcbOnly && !schematicOnly) && simulationSvgAssets) {
13777
13780
  snapshots.push({
13778
13781
  type: "simulation",
13779
13782
  content: simulationSvgAssets.simulationSvg,
@@ -14059,6 +14062,7 @@ var handleSnapshotFile = async (filePath, projectDir, snapshotsDirName, options)
14059
14062
  threeD: options.threeD,
14060
14063
  pcbOnly: options.pcbOnly,
14061
14064
  schematicOnly: options.schematicOnly,
14065
+ simulationOnly: options.simulationOnly,
14062
14066
  forceUpdate: options.forceUpdate,
14063
14067
  platformConfig,
14064
14068
  pcbSnapshotSettings: options.pcbSnapshotSettings,
package/dist/lib/index.js CHANGED
@@ -65365,7 +65365,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
65365
65365
  }));
65366
65366
  };
65367
65367
  // package.json
65368
- var version = "0.1.1527";
65368
+ var version = "0.1.1528";
65369
65369
  var package_default = {
65370
65370
  name: "@tscircuit/cli",
65371
65371
  version,
@@ -65380,7 +65380,6 @@ var package_default = {
65380
65380
  "@tscircuit/circuit-json-placement-analysis": "^0.0.6",
65381
65381
  "@tscircuit/circuit-json-routing-analysis": "^0.0.1",
65382
65382
  "@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#b6d5fe675adc26a2fc988aa081e6fb51e6bf696a",
65383
- "@tscircuit/eecircuit-engine": "https://jscdn.tscircuit.com/@tscircuit/eecircuit-engine/1.7.4.tgz",
65384
65383
  "@tscircuit/eval": "^0.0.933",
65385
65384
  "@tscircuit/fake-snippets": "^0.0.182",
65386
65385
  "@tscircuit/fake-ul-kicad-proxy": "github:tscircuit/fake-ul-kicad-proxy#d174c33c1b17a52d7a9dc3c2b5506d6fd593bed7",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1528",
3
+ "version": "0.1.1530",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",
@@ -12,7 +12,6 @@
12
12
  "@tscircuit/circuit-json-placement-analysis": "^0.0.6",
13
13
  "@tscircuit/circuit-json-routing-analysis": "^0.0.1",
14
14
  "@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#b6d5fe675adc26a2fc988aa081e6fb51e6bf696a",
15
- "@tscircuit/eecircuit-engine": "https://jscdn.tscircuit.com/@tscircuit/eecircuit-engine/1.7.4.tgz",
16
15
  "@tscircuit/eval": "^0.0.933",
17
16
  "@tscircuit/fake-snippets": "^0.0.182",
18
17
  "@tscircuit/fake-ul-kicad-proxy": "github:tscircuit/fake-ul-kicad-proxy#d174c33c1b17a52d7a9dc3c2b5506d6fd593bed7",