@tscircuit/cli 0.1.963 → 0.1.964
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 +10 -7
- package/dist/lib/index.js +5 -4
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -74389,7 +74389,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
74389
74389
|
import { execSync as execSync2 } from "node:child_process";
|
|
74390
74390
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
74391
74391
|
// package.json
|
|
74392
|
-
var version = "0.1.
|
|
74392
|
+
var version = "0.1.963";
|
|
74393
74393
|
var package_default = {
|
|
74394
74394
|
name: "@tscircuit/cli",
|
|
74395
74395
|
main: "dist/cli/main.js",
|
|
@@ -80883,7 +80883,8 @@ async function buildKicadPcm({
|
|
|
80883
80883
|
projectDir,
|
|
80884
80884
|
distDir,
|
|
80885
80885
|
baseUrl: baseUrlOption,
|
|
80886
|
-
circuitJsonToKicadModule
|
|
80886
|
+
circuitJsonToKicadModule,
|
|
80887
|
+
kicadLibraryName: kicadLibraryNameOption
|
|
80887
80888
|
}) {
|
|
80888
80889
|
const packageJsonPath = path18.join(projectDir, "package.json");
|
|
80889
80890
|
if (!fs15.existsSync(packageJsonPath)) {
|
|
@@ -80895,7 +80896,7 @@ async function buildKicadPcm({
|
|
|
80895
80896
|
const version2 = packageJson.version || "1.0.0";
|
|
80896
80897
|
const author = getPackageAuthor(packageJson.name || "") || "tscircuit";
|
|
80897
80898
|
const description = packageJson.description || "";
|
|
80898
|
-
const libraryName = resolveKicadLibraryName({ projectDir });
|
|
80899
|
+
const libraryName = kicadLibraryNameOption ?? resolveKicadLibraryName({ projectDir });
|
|
80899
80900
|
const kicadLibOutputDir = path18.join(distDir, "kicad-library-pcm");
|
|
80900
80901
|
const kicadPcmPackageId = `com_tscircuit_${author}_${packageName}`.replace(/\./g, "_");
|
|
80901
80902
|
console.log("Converting to KiCad library for PCM...");
|
|
@@ -80919,7 +80920,7 @@ async function buildKicadPcm({
|
|
|
80919
80920
|
kicadLibraryPath: kicadLibOutputDir,
|
|
80920
80921
|
outputDir: pcmOutputDir,
|
|
80921
80922
|
baseUrl,
|
|
80922
|
-
displayName: projectConfig?.kicadLibraryName || undefined
|
|
80923
|
+
displayName: kicadLibraryNameOption || projectConfig?.kicadLibraryName || undefined
|
|
80923
80924
|
});
|
|
80924
80925
|
console.log(` KiCad PCM assets generated at ${kleur_default.dim(path18.relative(process.cwd(), pcmOutputDir))}`);
|
|
80925
80926
|
console.log(` Repository URL: ${kleur_default.cyan(`${baseUrl}/pcm/repository.json`)}`);
|
|
@@ -174797,6 +174798,7 @@ var resolveBuildOptions = ({
|
|
|
174797
174798
|
...cliOptions,
|
|
174798
174799
|
kicadProject: cliOptions?.kicadProject ?? configBuild?.kicadProject,
|
|
174799
174800
|
kicadLibrary: cliOptions?.kicadLibrary ?? configBuild?.kicadLibrary,
|
|
174801
|
+
kicadLibraryName: cliOptions?.kicadLibraryName ?? projectConfig2?.kicadLibraryName,
|
|
174800
174802
|
kicadPcm: cliOptions?.kicadPcm ?? configBuild?.kicadPcm,
|
|
174801
174803
|
previewImages: cliOptions?.previewImages ?? configBuild?.previewImages,
|
|
174802
174804
|
glbs: cliOptions?.glbs ?? configBuild?.glbs,
|
|
@@ -175805,7 +175807,7 @@ async function buildFilesWithWorkerPool(options) {
|
|
|
175805
175807
|
// cli/build/register.ts
|
|
175806
175808
|
var normalizeRelativePath = (projectDir, targetPath) => path55.relative(projectDir, targetPath).split(path55.sep).join("/");
|
|
175807
175809
|
var registerBuild = (program3) => {
|
|
175808
|
-
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) => {
|
|
175810
|
+
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("--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("--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) => {
|
|
175809
175811
|
try {
|
|
175810
175812
|
const resolvedRoot = path55.resolve(process.cwd());
|
|
175811
175813
|
let projectDir;
|
|
@@ -176061,7 +176063,7 @@ var registerBuild = (program3) => {
|
|
|
176061
176063
|
process.exit(1);
|
|
176062
176064
|
}
|
|
176063
176065
|
} else {
|
|
176064
|
-
const libraryName = resolveKicadLibraryName({ projectDir });
|
|
176066
|
+
const libraryName = resolvedOptions?.kicadLibraryName || resolveKicadLibraryName({ projectDir });
|
|
176065
176067
|
const kicadLibOutputDir = path55.join(distDir, "kicad-library");
|
|
176066
176068
|
try {
|
|
176067
176069
|
await convertToKicadLibrary({
|
|
@@ -176099,7 +176101,8 @@ var registerBuild = (program3) => {
|
|
|
176099
176101
|
await buildKicadPcm({
|
|
176100
176102
|
entryFile,
|
|
176101
176103
|
projectDir,
|
|
176102
|
-
distDir
|
|
176104
|
+
distDir,
|
|
176105
|
+
kicadLibraryName: resolvedOptions?.kicadLibraryName
|
|
176103
176106
|
});
|
|
176104
176107
|
} catch (err) {
|
|
176105
176108
|
console.error(`Error generating KiCad PCM assets: ${err instanceof Error ? err.message : err}`);
|
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.
|
|
60417
|
+
var version = "0.1.963";
|
|
60418
60418
|
var package_default = {
|
|
60419
60419
|
name: "@tscircuit/cli",
|
|
60420
60420
|
main: "dist/cli/main.js",
|
|
@@ -67671,7 +67671,8 @@ async function buildKicadPcm({
|
|
|
67671
67671
|
projectDir,
|
|
67672
67672
|
distDir,
|
|
67673
67673
|
baseUrl: baseUrlOption,
|
|
67674
|
-
circuitJsonToKicadModule
|
|
67674
|
+
circuitJsonToKicadModule,
|
|
67675
|
+
kicadLibraryName: kicadLibraryNameOption
|
|
67675
67676
|
}) {
|
|
67676
67677
|
const packageJsonPath = path12.join(projectDir, "package.json");
|
|
67677
67678
|
if (!fs10.existsSync(packageJsonPath)) {
|
|
@@ -67683,7 +67684,7 @@ async function buildKicadPcm({
|
|
|
67683
67684
|
const version2 = packageJson.version || "1.0.0";
|
|
67684
67685
|
const author = getPackageAuthor(packageJson.name || "") || "tscircuit";
|
|
67685
67686
|
const description = packageJson.description || "";
|
|
67686
|
-
const libraryName = resolveKicadLibraryName({ projectDir });
|
|
67687
|
+
const libraryName = kicadLibraryNameOption ?? resolveKicadLibraryName({ projectDir });
|
|
67687
67688
|
const kicadLibOutputDir = path12.join(distDir, "kicad-library-pcm");
|
|
67688
67689
|
const kicadPcmPackageId = `com_tscircuit_${author}_${packageName}`.replace(/\./g, "_");
|
|
67689
67690
|
console.log("Converting to KiCad library for PCM...");
|
|
@@ -67707,7 +67708,7 @@ async function buildKicadPcm({
|
|
|
67707
67708
|
kicadLibraryPath: kicadLibOutputDir,
|
|
67708
67709
|
outputDir: pcmOutputDir,
|
|
67709
67710
|
baseUrl,
|
|
67710
|
-
displayName: projectConfig?.kicadLibraryName || undefined
|
|
67711
|
+
displayName: kicadLibraryNameOption || projectConfig?.kicadLibraryName || undefined
|
|
67711
67712
|
});
|
|
67712
67713
|
console.log(` KiCad PCM assets generated at ${kleur_default.dim(path12.relative(process.cwd(), pcmOutputDir))}`);
|
|
67713
67714
|
console.log(` Repository URL: ${kleur_default.cyan(`${baseUrl}/pcm/repository.json`)}`);
|