@tscircuit/cli 0.1.1095 → 0.1.1097

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
@@ -71664,7 +71664,7 @@ var registerStaticAssetLoaders = () => {
71664
71664
  // cli/main.ts
71665
71665
  var import_perfect_cli = __toESM2(require_dist2(), 1);
71666
71666
  // package.json
71667
- var version = "0.1.1094";
71667
+ var version = "0.1.1096";
71668
71668
  var package_default = {
71669
71669
  name: "@tscircuit/cli",
71670
71670
  version,
@@ -75424,6 +75424,7 @@ var projectConfigSchema = z.object({
75424
75424
  kicadPcm: z.boolean().optional(),
75425
75425
  previewImages: z.boolean().optional(),
75426
75426
  glbs: z.boolean().optional(),
75427
+ routingDisabled: z.boolean().optional(),
75427
75428
  typescriptLibrary: z.boolean().optional()
75428
75429
  }).optional()
75429
75430
  });
@@ -81400,6 +81401,27 @@ var findBoardFiles = ({
81400
81401
  };
81401
81402
 
81402
81403
  // cli/build/get-build-entrypoints.ts
81404
+ class BuildNoMatchingFilesError extends Error {
81405
+ directoryPath;
81406
+ includeBoardFilePatterns;
81407
+ constructor({
81408
+ directoryPath,
81409
+ includeBoardFilePatterns,
81410
+ hasConfiguredIncludeBoardFiles,
81411
+ projectDir
81412
+ }) {
81413
+ const relativeDirectory = path35.relative(projectDir, directoryPath) || ".";
81414
+ const patternSourceMessage = hasConfiguredIncludeBoardFiles ? "Searched using tscircuit.config.json includeBoardFiles" : "Searched using default includeBoardFiles";
81415
+ super([
81416
+ `No buildable files found in directory: "${relativeDirectory}"`,
81417
+ `${patternSourceMessage}: ${JSON.stringify(includeBoardFilePatterns)}`
81418
+ ].join(`
81419
+ `));
81420
+ this.name = "BuildNoMatchingFilesError";
81421
+ this.directoryPath = directoryPath;
81422
+ this.includeBoardFilePatterns = includeBoardFilePatterns;
81423
+ }
81424
+ }
81403
81425
  var isSubPath2 = (maybeChild, maybeParent) => {
81404
81426
  const relative3 = path35.relative(maybeParent, maybeChild);
81405
81427
  return relative3 === "" || !relative3.startsWith("..") && !path35.isAbsolute(relative3);
@@ -81478,12 +81500,18 @@ async function getBuildEntrypoints({
81478
81500
  const resolvedPreviewComponentPath2 = projectConfig2?.previewComponentPath ? path35.resolve(resolvedRoot, projectConfig2.previewComponentPath) : undefined;
81479
81501
  const resolvedSiteDefaultComponentPath2 = projectConfig2?.siteDefaultComponentPath ? path35.resolve(resolvedRoot, projectConfig2.siteDefaultComponentPath) : undefined;
81480
81502
  if (includeBoardFiles) {
81481
- const circuitFiles = findBoardFiles({
81482
- projectDir: resolvedRoot,
81483
- filePaths: [resolved]
81484
- }).filter((file) => isSubPath2(file, resolved));
81503
+ const hasConfiguredIncludeBoardFiles = Boolean(projectConfig2?.includeBoardFiles?.some((pattern) => pattern.trim()));
81504
+ const matchedFiles = findBoardFiles({
81505
+ projectDir: resolvedRoot
81506
+ });
81507
+ const circuitFiles = matchedFiles.filter((file) => isSubPath2(file, resolved));
81485
81508
  if (circuitFiles.length === 0) {
81486
- throw new Error(`There were no files to build found matching the includeBoardFiles globs: ${JSON.stringify(includeBoardFilePatterns)}`);
81509
+ throw new BuildNoMatchingFilesError({
81510
+ directoryPath: resolved,
81511
+ includeBoardFilePatterns,
81512
+ hasConfiguredIncludeBoardFiles,
81513
+ projectDir: resolvedRoot
81514
+ });
81487
81515
  }
81488
81516
  return {
81489
81517
  projectDir: resolvedRoot,
@@ -81613,6 +81641,9 @@ var resolveBuildOptions = ({
81613
81641
  if (!cliOptions?.glbs && configBuild?.glbs) {
81614
81642
  configAppliedOpts.push("glbs");
81615
81643
  }
81644
+ if (cliOptions?.routingDisabled === undefined && configBuild?.routingDisabled) {
81645
+ configAppliedOpts.push("routing-disabled");
81646
+ }
81616
81647
  if (!cliOptions?.transpile && configBuild?.typescriptLibrary) {
81617
81648
  configAppliedOpts.push("transpile");
81618
81649
  }
@@ -81624,6 +81655,7 @@ var resolveBuildOptions = ({
81624
81655
  kicadPcm: cliOptions?.kicadPcm ?? configBuild?.kicadPcm,
81625
81656
  previewImages: cliOptions?.previewImages ?? configBuild?.previewImages,
81626
81657
  glbs: cliOptions?.glbs ?? configBuild?.glbs,
81658
+ routingDisabled: cliOptions?.routingDisabled ?? configBuild?.routingDisabled,
81627
81659
  transpile: cliOptions?.transpile ?? configBuild?.typescriptLibrary
81628
81660
  };
81629
81661
  return { options, configAppliedOpts };
@@ -82319,7 +82351,7 @@ var getOutputDirName = (relativePath) => {
82319
82351
  return relativePath.replace(/(\.board|\.circuit)?\.tsx$/, "").replace(/\.circuit\.json$/, "");
82320
82352
  };
82321
82353
  var registerBuild = (program2) => {
82322
- 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-config", "Ignore options from tscircuit.config.json").option("--disable-pcb", "Disable PCB outputs").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("--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", "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-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) => {
82354
+ 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-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("--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", "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-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) => {
82323
82355
  try {
82324
82356
  const transpileExplicitlyRequested = options?.transpile === true;
82325
82357
  const resolvedRoot = path39.resolve(process.cwd());
@@ -82366,13 +82398,16 @@ var registerBuild = (program2) => {
82366
82398
  fileOrDir: fileOrDirForBuild
82367
82399
  });
82368
82400
  const platformConfig = (() => {
82369
- if (!resolvedOptions?.disablePcb && !resolvedOptions?.disablePartsEngine) {
82401
+ if (!resolvedOptions?.disablePcb && !resolvedOptions?.routingDisabled && !resolvedOptions?.disablePartsEngine) {
82370
82402
  return;
82371
82403
  }
82372
82404
  const config = {};
82373
82405
  if (resolvedOptions?.disablePcb) {
82374
82406
  config.pcbDisabled = true;
82375
82407
  }
82408
+ if (resolvedOptions?.routingDisabled) {
82409
+ config.routingDisabled = true;
82410
+ }
82376
82411
  if (resolvedOptions?.disablePartsEngine) {
82377
82412
  config.partsEngineDisabled = true;
82378
82413
  }
@@ -82758,6 +82793,10 @@ var registerBuild = (program2) => {
82758
82793
  }
82759
82794
  exitBuild(0, "build finished successfully");
82760
82795
  } catch (error) {
82796
+ if (error instanceof BuildNoMatchingFilesError) {
82797
+ console.error(error.message);
82798
+ exitBuild(1, "no matching build files found");
82799
+ }
82761
82800
  const message = error instanceof Error ? error.message : String(error);
82762
82801
  console.error(message);
82763
82802
  exitBuild(1, "unexpected exception");
package/dist/lib/index.js CHANGED
@@ -60435,7 +60435,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60435
60435
  }));
60436
60436
  };
60437
60437
  // package.json
60438
- var version = "0.1.1094";
60438
+ var version = "0.1.1096";
60439
60439
  var package_default = {
60440
60440
  name: "@tscircuit/cli",
60441
60441
  version,
@@ -67743,6 +67743,7 @@ var projectConfigSchema = z21.object({
67743
67743
  kicadPcm: z21.boolean().optional(),
67744
67744
  previewImages: z21.boolean().optional(),
67745
67745
  glbs: z21.boolean().optional(),
67746
+ routingDisabled: z21.boolean().optional(),
67746
67747
  typescriptLibrary: z21.boolean().optional()
67747
67748
  }).optional()
67748
67749
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1095",
3
+ "version": "0.1.1097",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",
@@ -96,6 +96,10 @@
96
96
  "type": "boolean",
97
97
  "description": "Enable GLB 3D model outputs for each circuit in build."
98
98
  },
99
+ "routingDisabled": {
100
+ "type": "boolean",
101
+ "description": "Disable routing during circuit generation in build."
102
+ },
99
103
  "typescriptLibrary": {
100
104
  "type": "boolean",
101
105
  "description": "Enable TypeScript library output in build."