@tscircuit/cli 0.1.1187 → 0.1.1189
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/build/build.worker.js +5 -4
- package/dist/cli/main.js +22 -10
- package/dist/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -13515,14 +13515,14 @@ var writeGlbFromCircuitJson = async (circuitJson, glbOutputPath) => {
|
|
|
13515
13515
|
fs9.writeFileSync(glbOutputPath, Buffer.from(glbData));
|
|
13516
13516
|
};
|
|
13517
13517
|
var writeImageAssetsFromCircuitJson = async (circuitJson, options) => {
|
|
13518
|
-
const { outputDir, imageFormats } = options;
|
|
13518
|
+
const { outputDir, imageFormats, pcbSnapshotSettings } = options;
|
|
13519
13519
|
fs9.mkdirSync(outputDir, { recursive: true });
|
|
13520
13520
|
if (imageFormats.pcbSvgs) {
|
|
13521
|
-
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson);
|
|
13521
|
+
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson, pcbSnapshotSettings);
|
|
13522
13522
|
fs9.writeFileSync(path12.join(outputDir, "pcb.svg"), pcbSvg, "utf-8");
|
|
13523
13523
|
}
|
|
13524
13524
|
if (imageFormats.pcbPngs) {
|
|
13525
|
-
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson);
|
|
13525
|
+
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson, pcbSnapshotSettings);
|
|
13526
13526
|
fs9.writeFileSync(path12.join(outputDir, "pcb.png"), await convertSvgToPngBuffer(pcbSvg));
|
|
13527
13527
|
}
|
|
13528
13528
|
if (imageFormats.schematicSvgs) {
|
|
@@ -13604,7 +13604,8 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
|
|
|
13604
13604
|
workerLog(`Generating preview assets for ${path13.relative(projectDir, resolvedPreviewOutputDir)} in same worker...`);
|
|
13605
13605
|
await writeImageAssetsFromCircuitJson(circuitJson, {
|
|
13606
13606
|
outputDir: resolvedPreviewOutputDir,
|
|
13607
|
-
imageFormats: options?.imageFormats ?? DEFAULT_IMAGE_FORMAT_SELECTION
|
|
13607
|
+
imageFormats: options?.imageFormats ?? DEFAULT_IMAGE_FORMAT_SELECTION,
|
|
13608
|
+
pcbSnapshotSettings: options?.pcbSnapshotSettings
|
|
13608
13609
|
});
|
|
13609
13610
|
previewOk = true;
|
|
13610
13611
|
} catch (err) {
|
package/dist/cli/main.js
CHANGED
|
@@ -99964,7 +99964,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
99964
99964
|
// lib/getVersion.ts
|
|
99965
99965
|
import { createRequire as createRequire2 } from "node:module";
|
|
99966
99966
|
// package.json
|
|
99967
|
-
var version = "0.1.
|
|
99967
|
+
var version = "0.1.1188";
|
|
99968
99968
|
var package_default = {
|
|
99969
99969
|
name: "@tscircuit/cli",
|
|
99970
99970
|
version,
|
|
@@ -109761,7 +109761,8 @@ var generatePreviewAssets = async ({
|
|
|
109761
109761
|
build,
|
|
109762
109762
|
outputDir,
|
|
109763
109763
|
distDir,
|
|
109764
|
-
imageFormats
|
|
109764
|
+
imageFormats,
|
|
109765
|
+
pcbSnapshotSettings
|
|
109765
109766
|
}) => {
|
|
109766
109767
|
const prefixRelative = path32.relative(distDir, outputDir) || ".";
|
|
109767
109768
|
const prefix = prefixRelative === "." ? "" : `[${prefixRelative}] `;
|
|
@@ -109777,7 +109778,7 @@ var generatePreviewAssets = async ({
|
|
|
109777
109778
|
if (imageFormats.pcbSvgs) {
|
|
109778
109779
|
try {
|
|
109779
109780
|
console.log(`${prefix}Generating PCB SVG...`);
|
|
109780
|
-
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson);
|
|
109781
|
+
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson, pcbSnapshotSettings);
|
|
109781
109782
|
fs30.writeFileSync(path32.join(outputDir, "pcb.svg"), pcbSvg, "utf-8");
|
|
109782
109783
|
console.log(`${prefix}Written pcb.svg`);
|
|
109783
109784
|
} catch (error) {
|
|
@@ -109787,7 +109788,7 @@ var generatePreviewAssets = async ({
|
|
|
109787
109788
|
if (imageFormats.pcbPngs) {
|
|
109788
109789
|
try {
|
|
109789
109790
|
console.log(`${prefix}Generating PCB PNG...`);
|
|
109790
|
-
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson);
|
|
109791
|
+
const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson, pcbSnapshotSettings);
|
|
109791
109792
|
fs30.writeFileSync(path32.join(outputDir, "pcb.png"), await convertSvgToPngBuffer(pcbSvg));
|
|
109792
109793
|
console.log(`${prefix}Written pcb.png`);
|
|
109793
109794
|
} catch (error) {
|
|
@@ -109825,7 +109826,8 @@ var buildPreviewImages = async ({
|
|
|
109825
109826
|
mainEntrypoint,
|
|
109826
109827
|
previewComponentPath,
|
|
109827
109828
|
allImages,
|
|
109828
|
-
imageFormats
|
|
109829
|
+
imageFormats,
|
|
109830
|
+
pcbSnapshotSettings
|
|
109829
109831
|
}) => {
|
|
109830
109832
|
const successfulBuilds = builtFiles.filter((file) => file.ok);
|
|
109831
109833
|
const previewEntrypoint = previewComponentPath || mainEntrypoint;
|
|
@@ -109841,7 +109843,8 @@ var buildPreviewImages = async ({
|
|
|
109841
109843
|
build,
|
|
109842
109844
|
outputDir,
|
|
109843
109845
|
distDir,
|
|
109844
|
-
imageFormats
|
|
109846
|
+
imageFormats,
|
|
109847
|
+
pcbSnapshotSettings
|
|
109845
109848
|
});
|
|
109846
109849
|
}
|
|
109847
109850
|
return;
|
|
@@ -109861,6 +109864,7 @@ var buildPreviewImages = async ({
|
|
|
109861
109864
|
await generatePreviewAssets({
|
|
109862
109865
|
build: previewBuild,
|
|
109863
109866
|
outputDir: path32.dirname(previewBuild.outputPath),
|
|
109867
|
+
pcbSnapshotSettings,
|
|
109864
109868
|
distDir,
|
|
109865
109869
|
imageFormats
|
|
109866
109870
|
});
|
|
@@ -111110,7 +111114,8 @@ var registerBuild = (program2) => {
|
|
|
111110
111114
|
profile: resolvedOptions?.profile,
|
|
111111
111115
|
injectedProps,
|
|
111112
111116
|
generatePreviewAssets: false,
|
|
111113
|
-
imageFormats: imageFormatSelection
|
|
111117
|
+
imageFormats: imageFormatSelection,
|
|
111118
|
+
pcbSnapshotSettings: projectConfig?.pcbSnapshotSettings
|
|
111114
111119
|
};
|
|
111115
111120
|
const shouldGeneratePreviewImages = Boolean((resolvedOptions?.previewImages || resolvedOptions?.allImages || hasExplicitImageFormatSelection) && hasAnyImageFormatSelected(imageFormatSelection));
|
|
111116
111121
|
const shouldGenerateAllPreviewImages = Boolean(resolvedOptions?.allImages);
|
|
@@ -111309,7 +111314,8 @@ var registerBuild = (program2) => {
|
|
|
111309
111314
|
mainEntrypoint,
|
|
111310
111315
|
previewComponentPath,
|
|
111311
111316
|
allImages: shouldGenerateAllPreviewImages,
|
|
111312
|
-
imageFormats: imageFormatSelection
|
|
111317
|
+
imageFormats: imageFormatSelection,
|
|
111318
|
+
pcbSnapshotSettings: projectConfig?.pcbSnapshotSettings
|
|
111313
111319
|
});
|
|
111314
111320
|
}
|
|
111315
111321
|
}
|
|
@@ -244768,7 +244774,8 @@ import { promisify as promisify3 } from "node:util";
|
|
|
244768
244774
|
import { convertCircuitJsonToGltf as convertCircuitJsonToGltf4 } from "circuit-json-to-gltf";
|
|
244769
244775
|
import {
|
|
244770
244776
|
convertCircuitJsonToPcbSvg as convertCircuitJsonToPcbSvg3,
|
|
244771
|
-
convertCircuitJsonToSchematicSvg as convertCircuitJsonToSchematicSvg3
|
|
244777
|
+
convertCircuitJsonToSchematicSvg as convertCircuitJsonToSchematicSvg3,
|
|
244778
|
+
convertCircuitJsonToAssemblySvg as convertCircuitJsonToAssemblySvg2
|
|
244772
244779
|
} from "circuit-to-svg";
|
|
244773
244780
|
|
|
244774
244781
|
// node_modules/dsn-converter/dist/index.js
|
|
@@ -250332,13 +250339,15 @@ var ALLOWED_EXPORT_FORMATS = [
|
|
|
250332
250339
|
"kicad_zip",
|
|
250333
250340
|
"kicad-library",
|
|
250334
250341
|
"srj",
|
|
250335
|
-
"step"
|
|
250342
|
+
"step",
|
|
250343
|
+
"assembly-svg"
|
|
250336
250344
|
];
|
|
250337
250345
|
var OUTPUT_EXTENSIONS = {
|
|
250338
250346
|
json: ".circuit.json",
|
|
250339
250347
|
"circuit-json": ".circuit.json",
|
|
250340
250348
|
"schematic-svg": "-schematic.svg",
|
|
250341
250349
|
"pcb-svg": "-pcb.svg",
|
|
250350
|
+
"assembly-svg": "-assembly.svg",
|
|
250342
250351
|
gerbers: "-gerbers.zip",
|
|
250343
250352
|
"readable-netlist": "-readable.netlist",
|
|
250344
250353
|
gltf: ".gltf",
|
|
@@ -250536,6 +250545,9 @@ var exportSnippet = async ({
|
|
|
250536
250545
|
case "step":
|
|
250537
250546
|
outputContent = await circuitJsonToStep(circuitJson);
|
|
250538
250547
|
break;
|
|
250548
|
+
case "assembly-svg":
|
|
250549
|
+
outputContent = convertCircuitJsonToAssemblySvg2(circuitJson);
|
|
250550
|
+
break;
|
|
250539
250551
|
default:
|
|
250540
250552
|
outputContent = JSON.stringify(circuitJson, null, 2);
|
|
250541
250553
|
}
|
package/dist/lib/index.js
CHANGED
|
@@ -60678,7 +60678,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
60678
60678
|
}));
|
|
60679
60679
|
};
|
|
60680
60680
|
// package.json
|
|
60681
|
-
var version = "0.1.
|
|
60681
|
+
var version = "0.1.1188";
|
|
60682
60682
|
var package_default = {
|
|
60683
60683
|
name: "@tscircuit/cli",
|
|
60684
60684
|
version,
|