@tscircuit/cli 0.1.773 → 0.1.774
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 +19 -8
- package/package.json +1 -1
- package/types/tscircuit.config.schema.json +4 -0
package/dist/main.js
CHANGED
|
@@ -73560,6 +73560,7 @@ var projectConfigSchema = z.object({
|
|
|
73560
73560
|
snapshotsDir: z.string().optional(),
|
|
73561
73561
|
prebuildCommand: z.string().optional(),
|
|
73562
73562
|
buildCommand: z.string().optional(),
|
|
73563
|
+
kicadLibraryEntrypointPath: z.string().optional(),
|
|
73563
73564
|
alwaysUseLatestTscircuitOnCloud: z.boolean().optional(),
|
|
73564
73565
|
build: z.object({
|
|
73565
73566
|
circuitJson: z.boolean().optional(),
|
|
@@ -74440,7 +74441,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
74440
74441
|
import { execSync as execSync2 } from "node:child_process";
|
|
74441
74442
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
74442
74443
|
// package.json
|
|
74443
|
-
var version = "0.1.
|
|
74444
|
+
var version = "0.1.773";
|
|
74444
74445
|
var package_default = {
|
|
74445
74446
|
name: "@tscircuit/cli",
|
|
74446
74447
|
version,
|
|
@@ -85376,6 +85377,7 @@ var availableGlobalConfigKeys = [
|
|
|
85376
85377
|
];
|
|
85377
85378
|
var availableProjectConfigKeys = [
|
|
85378
85379
|
"mainEntrypoint",
|
|
85380
|
+
"kicadLibraryEntrypointPath",
|
|
85379
85381
|
"previewComponentPath",
|
|
85380
85382
|
"siteDefaultComponentPath",
|
|
85381
85383
|
"prebuildCommand",
|
|
@@ -85383,7 +85385,7 @@ var availableProjectConfigKeys = [
|
|
|
85383
85385
|
];
|
|
85384
85386
|
var registerConfigSet = (program3) => {
|
|
85385
85387
|
const configCommand = program3.commands.find((c) => c.name() === "config");
|
|
85386
|
-
configCommand.command("set").description("Set a configuration value (global or project-specific)").argument("<key>", "Configuration key (e.g., alwaysCloneWithAuthorName, mainEntrypoint, previewComponentPath, siteDefaultComponentPath, prebuildCommand, buildCommand)").argument("<value>", "Value to set").action((key, value) => {
|
|
85388
|
+
configCommand.command("set").description("Set a configuration value (global or project-specific)").argument("<key>", "Configuration key (e.g., alwaysCloneWithAuthorName, mainEntrypoint, kicadLibraryEntrypointPath, previewComponentPath, siteDefaultComponentPath, prebuildCommand, buildCommand)").argument("<value>", "Value to set").action((key, value) => {
|
|
85387
85389
|
if (availableGlobalConfigKeys.some((k) => k === key)) {
|
|
85388
85390
|
if (key === "alwaysCloneWithAuthorName") {
|
|
85389
85391
|
const booleanValue = value.toLowerCase() === "true";
|
|
@@ -85392,7 +85394,7 @@ var registerConfigSet = (program3) => {
|
|
|
85392
85394
|
}
|
|
85393
85395
|
} else if (availableProjectConfigKeys.some((k) => k === key)) {
|
|
85394
85396
|
const projectDir = process.cwd();
|
|
85395
|
-
if (key === "mainEntrypoint" || key === "previewComponentPath" || key === "siteDefaultComponentPath" || key === "prebuildCommand" || key === "buildCommand") {
|
|
85397
|
+
if (key === "mainEntrypoint" || key === "kicadLibraryEntrypointPath" || key === "previewComponentPath" || key === "siteDefaultComponentPath" || key === "prebuildCommand" || key === "buildCommand") {
|
|
85396
85398
|
const projectConfig = loadProjectConfig(projectDir) ?? {};
|
|
85397
85399
|
projectConfig[key] = value;
|
|
85398
85400
|
if (saveProjectConfig(projectConfig, projectDir)) {
|
|
@@ -176631,9 +176633,13 @@ var registerBuild = (program3) => {
|
|
|
176631
176633
|
fileOrDir: file,
|
|
176632
176634
|
includeBoardFiles: false
|
|
176633
176635
|
});
|
|
176634
|
-
const
|
|
176636
|
+
const projectConfig2 = loadProjectConfig(projectDir);
|
|
176637
|
+
const entryFile = projectConfig2?.kicadLibraryEntrypointPath != null ? await getEntrypoint({
|
|
176638
|
+
filePath: projectConfig2.kicadLibraryEntrypointPath,
|
|
176639
|
+
projectDir
|
|
176640
|
+
}) : kicadEntrypoint;
|
|
176635
176641
|
if (!entryFile) {
|
|
176636
|
-
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");
|
|
176642
|
+
console.error("No entry file found for KiCad library generation. Make sure you have a lib/index.ts or set mainEntrypoint/kicadLibraryEntrypointPath in tscircuit.config.json");
|
|
176637
176643
|
if (!resolvedOptions?.ignoreErrors) {
|
|
176638
176644
|
process.exit(1);
|
|
176639
176645
|
}
|
|
@@ -176661,15 +176667,20 @@ var registerBuild = (program3) => {
|
|
|
176661
176667
|
fileOrDir: file,
|
|
176662
176668
|
includeBoardFiles: false
|
|
176663
176669
|
});
|
|
176664
|
-
|
|
176665
|
-
|
|
176670
|
+
const projectConfig2 = loadProjectConfig(projectDir);
|
|
176671
|
+
const entryFile = projectConfig2?.kicadLibraryEntrypointPath != null ? await getEntrypoint({
|
|
176672
|
+
filePath: projectConfig2.kicadLibraryEntrypointPath,
|
|
176673
|
+
projectDir
|
|
176674
|
+
}) : kicadEntrypoint;
|
|
176675
|
+
if (!entryFile) {
|
|
176676
|
+
console.error("No entry file found for KiCad PCM generation. Make sure you have a lib/index.ts or set mainEntrypoint/kicadLibraryEntrypointPath in tscircuit.config.json");
|
|
176666
176677
|
if (!resolvedOptions?.ignoreErrors) {
|
|
176667
176678
|
process.exit(1);
|
|
176668
176679
|
}
|
|
176669
176680
|
} else {
|
|
176670
176681
|
try {
|
|
176671
176682
|
await buildKicadPcm({
|
|
176672
|
-
entryFile
|
|
176683
|
+
entryFile,
|
|
176673
176684
|
projectDir,
|
|
176674
176685
|
distDir
|
|
176675
176686
|
});
|
package/package.json
CHANGED
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"type": "string",
|
|
49
49
|
"description": "Override command used for cloud builds."
|
|
50
50
|
},
|
|
51
|
+
"kicadLibraryEntrypointPath": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Entry file for KiCad footprint library generation."
|
|
54
|
+
},
|
|
51
55
|
"build": {
|
|
52
56
|
"type": "object",
|
|
53
57
|
"additionalProperties": false,
|