@tscircuit/cli 0.1.1187 → 0.1.1188
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 +14 -8
- 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.1187";
|
|
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
|
}
|
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.1187";
|
|
60682
60682
|
var package_default = {
|
|
60683
60683
|
name: "@tscircuit/cli",
|
|
60684
60684
|
version,
|