@tscircuit/cli 0.1.765 → 0.1.766
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/main.js +34 -2
- package/package.json +1 -1
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.
|
|
74130
|
+
var version = "0.1.765";
|
|
74131
74131
|
var package_default = {
|
|
74132
74132
|
name: "@tscircuit/cli",
|
|
74133
74133
|
version,
|
|
@@ -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("");
|