@tscircuit/cli 0.1.765 → 0.1.767

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.
Files changed (2) hide show
  1. package/dist/main.js +35 -3
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -74127,7 +74127,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74127
74127
  import { execSync as execSync2 } from "node:child_process";
74128
74128
  var import_semver2 = __toESM2(require_semver2(), 1);
74129
74129
  // package.json
74130
- var version = "0.1.764";
74130
+ var version = "0.1.766";
74131
74131
  var package_default = {
74132
74132
  name: "@tscircuit/cli",
74133
74133
  version,
@@ -74140,7 +74140,7 @@ var package_default = {
74140
74140
  "@tscircuit/file-server": "^0.0.32",
74141
74141
  "@tscircuit/math-utils": "0.0.29",
74142
74142
  "@tscircuit/props": "^0.0.441",
74143
- "@tscircuit/runframe": "^0.0.1493",
74143
+ "@tscircuit/runframe": "^0.0.1494",
74144
74144
  "@tscircuit/schematic-match-adapt": "^0.0.22",
74145
74145
  "@types/bun": "^1.2.2",
74146
74146
  "@types/configstore": "^6.0.2",
@@ -172710,7 +172710,8 @@ var applyCiBuildOptions = async ({
172710
172710
  transpile: options?.transpile ?? true,
172711
172711
  site: options?.site ?? true,
172712
172712
  useCdnJavascript: options?.useCdnJavascript ?? true,
172713
- ignoreErrors: options?.ignoreErrors ?? true
172713
+ ignoreErrors: options?.ignoreErrors ?? true,
172714
+ kicadFootprintLibrary: options?.kicadFootprintLibrary ?? projectConfig2?.build?.kicadLibrary ?? false
172714
172715
  },
172715
172716
  handled: false
172716
172717
  };
@@ -173623,6 +173624,36 @@ var registerBuild = (program3) => {
173623
173624
  });
173624
173625
  fs45.writeFileSync(path45.join(distDir, "index.html"), indexHtml);
173625
173626
  }
173627
+ if (resolvedOptions?.kicadFootprintLibrary) {
173628
+ console.log("Generating KiCad footprint library...");
173629
+ const { mainEntrypoint: kicadEntrypoint } = await getBuildEntrypoints({
173630
+ fileOrDir: file,
173631
+ includeBoardFiles: false
173632
+ });
173633
+ const entryFile = kicadEntrypoint;
173634
+ if (!entryFile) {
173635
+ console.error("No entry file found for KiCad library generation. Make sure you have a lib/index.ts or set mainEntrypoint in tscircuit.config.json");
173636
+ if (!resolvedOptions?.ignoreErrors) {
173637
+ process.exit(1);
173638
+ }
173639
+ } else {
173640
+ const libraryName = path45.basename(projectDir);
173641
+ const kicadLibOutputDir = path45.join(distDir, "kicad-library");
173642
+ try {
173643
+ await convertToKicadLibrary({
173644
+ filePath: entryFile,
173645
+ libraryName,
173646
+ outputDir: kicadLibOutputDir
173647
+ });
173648
+ console.log(` KiCad library generated at ${kleur_default.dim(path45.relative(process.cwd(), kicadLibOutputDir))}`);
173649
+ } catch (err) {
173650
+ console.error(`Error generating KiCad library: ${err instanceof Error ? err.message : err}`);
173651
+ if (!resolvedOptions?.ignoreErrors) {
173652
+ process.exit(1);
173653
+ }
173654
+ }
173655
+ }
173656
+ }
173626
173657
  const successCount = builtFiles.filter((f2) => f2.ok).length;
173627
173658
  const failCount = builtFiles.length - successCount;
173628
173659
  const enabledOpts = [
@@ -173631,6 +173662,7 @@ var registerBuild = (program3) => {
173631
173662
  resolvedOptions?.previewImages && "preview-images",
173632
173663
  resolvedOptions?.allImages && "all-images",
173633
173664
  resolvedOptions?.kicad && "kicad",
173665
+ resolvedOptions?.kicadFootprintLibrary && "kicad-footprint-library",
173634
173666
  resolvedOptions?.previewGltf && "preview-gltf"
173635
173667
  ].filter(Boolean);
173636
173668
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.765",
3
+ "version": "0.1.767",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",
@@ -10,7 +10,7 @@
10
10
  "@tscircuit/file-server": "^0.0.32",
11
11
  "@tscircuit/math-utils": "0.0.29",
12
12
  "@tscircuit/props": "^0.0.441",
13
- "@tscircuit/runframe": "^0.0.1493",
13
+ "@tscircuit/runframe": "^0.0.1494",
14
14
  "@tscircuit/schematic-match-adapt": "^0.0.22",
15
15
  "@types/bun": "^1.2.2",
16
16
  "@types/configstore": "^6.0.2",