@tscircuit/cli 0.1.1761 → 0.1.1762

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.
@@ -13073,6 +13073,7 @@ var formatIgnoredDrcCounts = (counts) => [
13073
13073
  var DEFAULT_IMAGE_FORMAT_SELECTION = {
13074
13074
  threeDPngs: true,
13075
13075
  pcbPngs: false,
13076
+ schematicPngs: false,
13076
13077
  pcbSvgs: true,
13077
13078
  schematicSvgs: true,
13078
13079
  simulationSvgs: false,
@@ -13081,13 +13082,14 @@ var DEFAULT_IMAGE_FORMAT_SELECTION = {
13081
13082
  var EMPTY_IMAGE_FORMAT_SELECTION = {
13082
13083
  threeDPngs: false,
13083
13084
  pcbPngs: false,
13085
+ schematicPngs: false,
13084
13086
  pcbSvgs: false,
13085
13087
  schematicSvgs: false,
13086
13088
  simulationSvgs: false,
13087
13089
  simulationSchematicSvgs: false
13088
13090
  };
13089
- var hasAnyImageFormatSelected = (selection) => selection.threeDPngs || selection.pcbPngs || selection.pcbSvgs || selection.schematicSvgs || selection.simulationSvgs || selection.simulationSchematicSvgs;
13090
- var hasNewOutputFlags = (options) => Boolean(options?.pngs || options?.pcbPng || options?.svgs || options?.pcbSvgs || options?.simulationSvgs || options?.simulationSchematicSvgs || options?.schematicSvgs);
13091
+ var hasAnyImageFormatSelected = (selection) => selection.threeDPngs || selection.pcbPngs || selection.schematicPngs || selection.pcbSvgs || selection.schematicSvgs || selection.simulationSvgs || selection.simulationSchematicSvgs;
13092
+ var hasNewOutputFlags = (options) => Boolean(options?.pngs || options?.pcbPng || options?.schematicPng || options?.svgs || options?.pcbSvgs || options?.simulationSvgs || options?.simulationSchematicSvgs || options?.schematicSvgs);
13091
13093
  var hasEstablishedOutputFlags = (options) => Boolean(options?.["3d"] || options?.["3dPng"] || options?.pcbOnly || options?.schematicOnly);
13092
13094
  var resolveImageFormatSelection = (options) => {
13093
13095
  const hasNewFlags = hasNewOutputFlags(options);
@@ -13103,6 +13105,7 @@ var resolveImageFormatSelection = (options) => {
13103
13105
  const selection2 = {
13104
13106
  threeDPngs: Boolean(options?.["3d"] || options?.["3dPng"]),
13105
13107
  pcbPngs: false,
13108
+ schematicPngs: false,
13106
13109
  pcbSvgs: true,
13107
13110
  schematicSvgs: true,
13108
13111
  simulationSvgs: false,
@@ -13131,6 +13134,9 @@ var resolveImageFormatSelection = (options) => {
13131
13134
  if (options?.pcbPng) {
13132
13135
  selection.pcbPngs = true;
13133
13136
  }
13137
+ if (options?.schematicPng) {
13138
+ selection.schematicPngs = true;
13139
+ }
13134
13140
  if (options?.schematicSvgs) {
13135
13141
  selection.schematicSvgs = true;
13136
13142
  }
@@ -17217,6 +17223,10 @@ var writeImageAssetsFromCircuitJson = async (circuitJson, options) => {
17217
17223
  const schematicSvg = convertCircuitJsonToSchematicSvg(circuitJson);
17218
17224
  fs12.writeFileSync(path16.join(outputDir, "schematic.svg"), schematicSvg, "utf-8");
17219
17225
  }
17226
+ if (imageFormats.schematicPngs) {
17227
+ const schematicSvg = convertCircuitJsonToSchematicSvg(circuitJson);
17228
+ fs12.writeFileSync(path16.join(outputDir, "schematic.png"), await convertSvgToPngBuffer(schematicSvg));
17229
+ }
17220
17230
  writeSimulationSvgAssetsFromCircuitJson(circuitJson, outputDir, imageFormats);
17221
17231
  if (imageFormats.threeDPngs) {
17222
17232
  const pngBuffer = await renderCircuitJsonTo3dPng(circuitJson);
package/dist/cli/main.js CHANGED
@@ -118506,7 +118506,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
118506
118506
  // lib/getVersion.ts
118507
118507
  import { createRequire as createRequire2 } from "node:module";
118508
118508
  // package.json
118509
- var version = "0.1.1760";
118509
+ var version = "0.1.1761";
118510
118510
  var package_default = {
118511
118511
  name: "@tscircuit/cli",
118512
118512
  version,
@@ -133804,6 +133804,10 @@ var writeImageAssetsFromCircuitJson = async (circuitJson, options) => {
133804
133804
  const schematicSvg = convertCircuitJsonToSchematicSvg(circuitJson);
133805
133805
  fs31.writeFileSync(path34.join(outputDir, "schematic.svg"), schematicSvg, "utf-8");
133806
133806
  }
133807
+ if (imageFormats.schematicPngs) {
133808
+ const schematicSvg = convertCircuitJsonToSchematicSvg(circuitJson);
133809
+ fs31.writeFileSync(path34.join(outputDir, "schematic.png"), await convertSvgToPngBuffer(schematicSvg));
133810
+ }
133807
133811
  writeSimulationSvgAssetsFromCircuitJson(circuitJson, outputDir, imageFormats);
133808
133812
  if (imageFormats.threeDPngs) {
133809
133813
  const pngBuffer = await renderCircuitJsonTo3dPng(circuitJson);
@@ -133947,6 +133951,16 @@ var generatePreviewAssets = async ({
133947
133951
  console.error(`${prefix}Failed to generate schematic SVG:`, error);
133948
133952
  }
133949
133953
  }
133954
+ if (imageFormats.schematicPngs) {
133955
+ try {
133956
+ console.log(`${prefix}Generating schematic PNG...`);
133957
+ const schematicSvg = convertCircuitJsonToSchematicSvg2(circuitJson);
133958
+ fs34.writeFileSync(path37.join(outputDir, "schematic.png"), await convertSvgToPngBuffer(schematicSvg));
133959
+ console.log(`${prefix}Written schematic.png`);
133960
+ } catch (error) {
133961
+ console.error(`${prefix}Failed to generate schematic PNG:`, error);
133962
+ }
133963
+ }
133950
133964
  if (imageFormats.simulationSvgs || imageFormats.simulationSchematicSvgs) {
133951
133965
  try {
133952
133966
  const wroteSimulationSvgs = writeSimulationSvgAssetsFromCircuitJson(circuitJson, outputDir, imageFormats);
@@ -134377,6 +134391,7 @@ async function getBuildEntrypoints({
134377
134391
  var DEFAULT_IMAGE_FORMAT_SELECTION = {
134378
134392
  threeDPngs: true,
134379
134393
  pcbPngs: false,
134394
+ schematicPngs: false,
134380
134395
  pcbSvgs: true,
134381
134396
  schematicSvgs: true,
134382
134397
  simulationSvgs: false,
@@ -134385,13 +134400,14 @@ var DEFAULT_IMAGE_FORMAT_SELECTION = {
134385
134400
  var EMPTY_IMAGE_FORMAT_SELECTION = {
134386
134401
  threeDPngs: false,
134387
134402
  pcbPngs: false,
134403
+ schematicPngs: false,
134388
134404
  pcbSvgs: false,
134389
134405
  schematicSvgs: false,
134390
134406
  simulationSvgs: false,
134391
134407
  simulationSchematicSvgs: false
134392
134408
  };
134393
- var hasAnyImageFormatSelected = (selection) => selection.threeDPngs || selection.pcbPngs || selection.pcbSvgs || selection.schematicSvgs || selection.simulationSvgs || selection.simulationSchematicSvgs;
134394
- var hasNewOutputFlags = (options) => Boolean(options?.pngs || options?.pcbPng || options?.svgs || options?.pcbSvgs || options?.simulationSvgs || options?.simulationSchematicSvgs || options?.schematicSvgs);
134409
+ var hasAnyImageFormatSelected = (selection) => selection.threeDPngs || selection.pcbPngs || selection.schematicPngs || selection.pcbSvgs || selection.schematicSvgs || selection.simulationSvgs || selection.simulationSchematicSvgs;
134410
+ var hasNewOutputFlags = (options) => Boolean(options?.pngs || options?.pcbPng || options?.schematicPng || options?.svgs || options?.pcbSvgs || options?.simulationSvgs || options?.simulationSchematicSvgs || options?.schematicSvgs);
134395
134411
  var hasEstablishedOutputFlags = (options) => Boolean(options?.["3d"] || options?.["3dPng"] || options?.pcbOnly || options?.schematicOnly);
134396
134412
  var resolveImageFormatSelection = (options) => {
134397
134413
  const hasNewFlags = hasNewOutputFlags(options);
@@ -134407,6 +134423,7 @@ var resolveImageFormatSelection = (options) => {
134407
134423
  const selection2 = {
134408
134424
  threeDPngs: Boolean(options?.["3d"] || options?.["3dPng"]),
134409
134425
  pcbPngs: false,
134426
+ schematicPngs: false,
134410
134427
  pcbSvgs: true,
134411
134428
  schematicSvgs: true,
134412
134429
  simulationSvgs: false,
@@ -134435,6 +134452,9 @@ var resolveImageFormatSelection = (options) => {
134435
134452
  if (options?.pcbPng) {
134436
134453
  selection.pcbPngs = true;
134437
134454
  }
134455
+ if (options?.schematicPng) {
134456
+ selection.schematicPngs = true;
134457
+ }
134438
134458
  if (options?.schematicSvgs) {
134439
134459
  selection.schematicSvgs = true;
134440
134460
  }
@@ -135212,7 +135232,7 @@ var parseInjectedProps = ({
135212
135232
  return parsed;
135213
135233
  };
135214
135234
  var registerBuild = (program2) => {
135215
- 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("--simulation-svgs", "Generate simulation graph SVG outputs during build generation").option("--simulation-schematic-svgs", "Generate schematic simulation 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("--step", "Generate STEP 3D model files for every successful build").option("--profile", "Log per-circuit circuit.json generation time during build").option("--autorouter-debug", "Log autorouting phase diagnostics during circuit generation").option("--autorouter-timeout <duration>", 'Abort an autorouting phase after a duration, e.g. "120s" or "2m"').option("--autorouter-debug-dir <path>", "Directory for autorouting debug artifacts (default: dist/autorouter-debug)").option("--autorouter-dump-srj [mode]", 'Dump SimpleRouteJson inputs/outputs: "all", "failed", or "phase:<index>" (default: failed)').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) => {
135235
+ 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("--schematic-png", "Generate schematic 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("--simulation-svgs", "Generate simulation graph SVG outputs during build generation").option("--simulation-schematic-svgs", "Generate schematic simulation 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("--step", "Generate STEP 3D model files for every successful build").option("--profile", "Log per-circuit circuit.json generation time during build").option("--autorouter-debug", "Log autorouting phase diagnostics during circuit generation").option("--autorouter-timeout <duration>", 'Abort an autorouting phase after a duration, e.g. "120s" or "2m"').option("--autorouter-debug-dir <path>", "Directory for autorouting debug artifacts (default: dist/autorouter-debug)").option("--autorouter-dump-srj [mode]", 'Dump SimpleRouteJson inputs/outputs: "all", "failed", or "phase:<index>" (default: failed)').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) => {
135216
135236
  try {
135217
135237
  const transpileExplicitlyRequested = options?.transpile === true;
135218
135238
  const resolvedRoot = path44.resolve(process.cwd());
@@ -135706,6 +135726,7 @@ var registerBuild = (program2) => {
135706
135726
  resolvedOptions?.allImages && "all-images",
135707
135727
  resolvedOptions?.pngs && "pngs",
135708
135728
  resolvedOptions?.pcbPng && "pcb-png",
135729
+ resolvedOptions?.schematicPng && "schematic-png",
135709
135730
  resolvedOptions?.svgs && "svgs",
135710
135731
  resolvedOptions?.pcbSvgs && "pcb-svgs",
135711
135732
  resolvedOptions?.schematicSvgs && "schematic-svgs",
package/dist/lib/index.js CHANGED
@@ -65757,7 +65757,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
65757
65757
  }));
65758
65758
  };
65759
65759
  // package.json
65760
- var version = "0.1.1760";
65760
+ var version = "0.1.1761";
65761
65761
  var package_default = {
65762
65762
  name: "@tscircuit/cli",
65763
65763
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1761",
3
+ "version": "0.1.1762",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",