@tscircuit/cli 0.1.938 → 0.1.939

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
@@ -73488,11 +73488,13 @@ var projectConfigSchema = z.object({
73488
73488
  snapshotsDir: z.string().optional(),
73489
73489
  prebuildCommand: z.string().optional(),
73490
73490
  buildCommand: z.string().optional(),
73491
+ kicadProjectEntrypointPath: z.string().optional(),
73491
73492
  kicadLibraryEntrypointPath: z.string().optional(),
73492
73493
  kicadLibraryName: z.string().optional(),
73493
73494
  alwaysUseLatestTscircuitOnCloud: z.boolean().optional(),
73494
73495
  build: z.object({
73495
73496
  circuitJson: z.boolean().optional(),
73497
+ kicadProject: z.boolean().optional(),
73496
73498
  kicadLibrary: z.boolean().optional(),
73497
73499
  kicadPcm: z.boolean().optional(),
73498
73500
  previewImages: z.boolean().optional(),
@@ -74387,7 +74389,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74387
74389
  import { execSync as execSync2 } from "node:child_process";
74388
74390
  var import_semver2 = __toESM2(require_semver2(), 1);
74389
74391
  // package.json
74390
- var version = "0.1.937";
74392
+ var version = "0.1.938";
74391
74393
  var package_default = {
74392
74394
  name: "@tscircuit/cli",
74393
74395
  main: "dist/cli/main.js",
@@ -174663,8 +174665,8 @@ var resolveBuildOptions = ({
174663
174665
  }
174664
174666
  const configBuild = projectConfig2?.build;
174665
174667
  const configAppliedOpts = [];
174666
- if (!cliOptions?.kicad && configBuild?.kicadLibrary) {
174667
- configAppliedOpts.push("kicad");
174668
+ if (!cliOptions?.kicadProject && configBuild?.kicadProject) {
174669
+ configAppliedOpts.push("kicad-project");
174668
174670
  }
174669
174671
  if (!cliOptions?.kicadLibrary && configBuild?.kicadLibrary) {
174670
174672
  configAppliedOpts.push("kicad-library");
@@ -174683,7 +174685,7 @@ var resolveBuildOptions = ({
174683
174685
  }
174684
174686
  const options = {
174685
174687
  ...cliOptions,
174686
- kicad: cliOptions?.kicad ?? configBuild?.kicadLibrary,
174688
+ kicadProject: cliOptions?.kicadProject ?? configBuild?.kicadProject,
174687
174689
  kicadLibrary: cliOptions?.kicadLibrary ?? configBuild?.kicadLibrary,
174688
174690
  kicadPcm: cliOptions?.kicadPcm ?? configBuild?.kicadPcm,
174689
174691
  previewImages: cliOptions?.previewImages ?? configBuild?.previewImages,
@@ -175697,7 +175699,7 @@ async function buildFilesWithWorkerPool(options) {
175697
175699
  // cli/build/register.ts
175698
175700
  var normalizeRelativePath = (projectDir, targetPath) => path55.relative(projectDir, targetPath).split(path55.sep).join("/");
175699
175701
  var registerBuild = (program3) => {
175700
- program3.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("--kicad", "Generate KiCad project directories for each successful build output").option("--kicad-library", "Generate KiCad library in dist/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("--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").action(async (file, options) => {
175702
+ program3.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("--kicad-project", "Generate KiCad project directories for each successful build output").option("--kicad-library", "Generate KiCad library in dist/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("--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").action(async (file, options) => {
175701
175703
  try {
175702
175704
  const resolvedRoot = path55.resolve(process.cwd());
175703
175705
  let projectDir;
@@ -175730,13 +175732,17 @@ var registerBuild = (program3) => {
175730
175732
  if (handled) {
175731
175733
  return;
175732
175734
  }
175735
+ let fileOrDirForBuild = file;
175736
+ if (!file && resolvedOptions?.kicadProject && projectConfig2?.kicadProjectEntrypointPath) {
175737
+ fileOrDirForBuild = projectConfig2.kicadProjectEntrypointPath;
175738
+ }
175733
175739
  const {
175734
175740
  circuitFiles,
175735
175741
  mainEntrypoint,
175736
175742
  previewComponentPath,
175737
175743
  siteDefaultComponentPath
175738
175744
  } = await getBuildEntrypoints({
175739
- fileOrDir: file
175745
+ fileOrDir: fileOrDirForBuild
175740
175746
  });
175741
175747
  const platformConfig2 = (() => {
175742
175748
  if (!resolvedOptions?.disablePcb && !resolvedOptions?.disablePartsEngine) {
@@ -175764,7 +175770,7 @@ var registerBuild = (program3) => {
175764
175770
  const staticFileReferences = [];
175765
175771
  const builtFiles = [];
175766
175772
  const kicadProjects = [];
175767
- const shouldGenerateKicad = resolvedOptions?.kicad || resolvedOptions?.kicadLibrary;
175773
+ const shouldGenerateKicadProject = resolvedOptions?.kicadProject || resolvedOptions?.kicadLibrary;
175768
175774
  const buildOptions = {
175769
175775
  ignoreErrors: resolvedOptions?.ignoreErrors,
175770
175776
  ignoreWarnings: resolvedOptions?.ignoreWarnings,
@@ -175793,7 +175799,7 @@ var registerBuild = (program3) => {
175793
175799
  fileStaticAssetUrl: `./${normalizedOutputPath}`
175794
175800
  });
175795
175801
  }
175796
- if (buildOutcome.ok && shouldGenerateKicad) {
175802
+ if (buildOutcome.ok && shouldGenerateKicadProject) {
175797
175803
  let circuitJson = buildOutcome.circuitJson;
175798
175804
  if (!circuitJson && fs54.existsSync(outputPath)) {
175799
175805
  circuitJson = JSON.parse(fs54.readFileSync(outputPath, "utf-8"));
@@ -175805,7 +175811,7 @@ var registerBuild = (program3) => {
175805
175811
  circuitJson,
175806
175812
  outputDir: projectOutputDir,
175807
175813
  projectName,
175808
- writeFiles: Boolean(resolvedOptions?.kicad)
175814
+ writeFiles: Boolean(resolvedOptions?.kicadProject)
175809
175815
  });
175810
175816
  kicadProjects.push({
175811
175817
  ...project,
@@ -176005,7 +176011,7 @@ var registerBuild = (program3) => {
176005
176011
  resolvedOptions?.previewImages && "preview-images",
176006
176012
  resolvedOptions?.allImages && "all-images",
176007
176013
  resolvedOptions?.glbs && "glbs",
176008
- resolvedOptions?.kicad && "kicad",
176014
+ resolvedOptions?.kicadProject && "kicad-project",
176009
176015
  resolvedOptions?.kicadLibrary && "kicad-library",
176010
176016
  resolvedOptions?.kicadPcm && "kicad-pcm",
176011
176017
  resolvedOptions?.previewGltf && "preview-gltf"
package/dist/lib/index.js CHANGED
@@ -60414,7 +60414,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60414
60414
  }));
60415
60415
  };
60416
60416
  // package.json
60417
- var version = "0.1.937";
60417
+ var version = "0.1.938";
60418
60418
  var package_default = {
60419
60419
  name: "@tscircuit/cli",
60420
60420
  main: "dist/cli/main.js",
@@ -67475,11 +67475,13 @@ var projectConfigSchema = z21.object({
67475
67475
  snapshotsDir: z21.string().optional(),
67476
67476
  prebuildCommand: z21.string().optional(),
67477
67477
  buildCommand: z21.string().optional(),
67478
+ kicadProjectEntrypointPath: z21.string().optional(),
67478
67479
  kicadLibraryEntrypointPath: z21.string().optional(),
67479
67480
  kicadLibraryName: z21.string().optional(),
67480
67481
  alwaysUseLatestTscircuitOnCloud: z21.boolean().optional(),
67481
67482
  build: z21.object({
67482
67483
  circuitJson: z21.boolean().optional(),
67484
+ kicadProject: z21.boolean().optional(),
67483
67485
  kicadLibrary: z21.boolean().optional(),
67484
67486
  kicadPcm: z21.boolean().optional(),
67485
67487
  previewImages: z21.boolean().optional(),
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ".": "./dist/cli/main.js",
6
6
  "./lib": "./dist/lib/index.js"
7
7
  },
8
- "version": "0.1.938",
8
+ "version": "0.1.939",
9
9
  "devDependencies": {
10
10
  "@babel/standalone": "^7.26.9",
11
11
  "@biomejs/biome": "^1.9.4",
@@ -48,6 +48,10 @@
48
48
  "type": "string",
49
49
  "description": "Override command used for cloud builds."
50
50
  },
51
+ "kicadProjectEntrypointPath": {
52
+ "type": "string",
53
+ "description": "Entry file for KiCad project generation (.kicad_pro, .kicad_sch, .kicad_pcb)."
54
+ },
51
55
  "kicadLibraryEntrypointPath": {
52
56
  "type": "string",
53
57
  "description": "Entry file for KiCad footprint library generation."
@@ -68,6 +72,10 @@
68
72
  "type": "boolean",
69
73
  "description": "Enable circuit JSON output in build."
70
74
  },
75
+ "kicadProject": {
76
+ "type": "boolean",
77
+ "description": "Enable KiCad project output (.kicad_pro, .kicad_sch, .kicad_pcb) in build."
78
+ },
71
79
  "kicadLibrary": {
72
80
  "type": "boolean",
73
81
  "description": "Enable KiCad library output in build."