@tscircuit/cli 0.1.258 → 0.1.259
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 +12 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -72386,7 +72386,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
72386
72386
|
import { execSync as execSync2 } from "node:child_process";
|
|
72387
72387
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
72388
72388
|
// package.json
|
|
72389
|
-
var version = "0.1.
|
|
72389
|
+
var version = "0.1.258";
|
|
72390
72390
|
var package_default = {
|
|
72391
72391
|
name: "@tscircuit/cli",
|
|
72392
72392
|
version,
|
|
@@ -197800,6 +197800,7 @@ function analyzeCircuitJson(circuitJson) {
|
|
|
197800
197800
|
// cli/build/build-file.ts
|
|
197801
197801
|
var buildFile = async (input, output, projectDir, options) => {
|
|
197802
197802
|
try {
|
|
197803
|
+
console.log("Generating circuit JSON...");
|
|
197803
197804
|
const result = await generateCircuitJson({
|
|
197804
197805
|
filePath: input,
|
|
197805
197806
|
platformConfig: options?.platformConfig
|
|
@@ -197944,14 +197945,20 @@ var buildPreviewImages = async ({
|
|
|
197944
197945
|
try {
|
|
197945
197946
|
const circuitJsonRaw = fs29.readFileSync(previewBuild.outputPath, "utf-8");
|
|
197946
197947
|
const circuitJson = JSON.parse(circuitJsonRaw);
|
|
197948
|
+
console.log("Generating PCB SVG...");
|
|
197947
197949
|
const pcbSvg = convertCircuitJsonToPcbSvg3(circuitJson);
|
|
197950
|
+
console.log("Generating schematic SVG...");
|
|
197948
197951
|
const schematicSvg = convertCircuitJsonToSchematicSvg2(circuitJson);
|
|
197952
|
+
console.log("Generating 3D SVG...");
|
|
197949
197953
|
const simple3dSvg = await convertCircuitJsonToSimple3dSvg(circuitJson);
|
|
197950
197954
|
fs29.writeFileSync(path28.join(distDir, "pcb.svg"), pcbSvg, "utf-8");
|
|
197955
|
+
console.log("Written pcb.svg");
|
|
197951
197956
|
fs29.writeFileSync(path28.join(distDir, "schematic.svg"), schematicSvg, "utf-8");
|
|
197957
|
+
console.log("Written schematic.svg");
|
|
197952
197958
|
if (simple3dSvg) {
|
|
197953
197959
|
const pngBuffer = await sharp(Buffer.from(simple3dSvg)).png().toBuffer();
|
|
197954
197960
|
fs29.writeFileSync(path28.join(distDir, "3d.png"), pngBuffer);
|
|
197961
|
+
console.log("Written 3d.png");
|
|
197955
197962
|
}
|
|
197956
197963
|
} catch (error) {
|
|
197957
197964
|
console.error("Failed to generate preview images:", error);
|
|
@@ -197978,11 +197985,13 @@ var registerBuild = (program3) => {
|
|
|
197978
197985
|
})();
|
|
197979
197986
|
const distDir = path29.join(projectDir, "dist");
|
|
197980
197987
|
fs30.mkdirSync(distDir, { recursive: true });
|
|
197988
|
+
console.log(`Building ${circuitFiles.length} file(s)...`);
|
|
197981
197989
|
let hasErrors = false;
|
|
197982
197990
|
const staticFileReferences = [];
|
|
197983
197991
|
const builtFiles = [];
|
|
197984
197992
|
for (const filePath of circuitFiles) {
|
|
197985
197993
|
const relative9 = path29.relative(projectDir, filePath);
|
|
197994
|
+
console.log(`Building ${relative9}...`);
|
|
197986
197995
|
const outputDirName = relative9.replace(/(\.board|\.circuit)?\.tsx$/, "");
|
|
197987
197996
|
const outputPath = path29.join(distDir, outputDirName, "circuit.json");
|
|
197988
197997
|
const ok = await buildFile(filePath, outputPath, projectDir, {
|
|
@@ -198010,7 +198019,9 @@ var registerBuild = (program3) => {
|
|
|
198010
198019
|
if (hasErrors && !options?.ignoreErrors) {
|
|
198011
198020
|
process.exit(1);
|
|
198012
198021
|
}
|
|
198022
|
+
console.log("Build complete!");
|
|
198013
198023
|
if (options?.previewImages) {
|
|
198024
|
+
console.log("Generating preview images...");
|
|
198014
198025
|
await buildPreviewImages({
|
|
198015
198026
|
builtFiles,
|
|
198016
198027
|
distDir,
|