@tscircuit/cli 0.1.1668 → 0.1.1670
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 +57 -28
- package/dist/cli/main.js +79 -45
- package/dist/cli/snapshot/snapshot.worker.js +57 -32
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
|
@@ -15654,35 +15654,55 @@ import {
|
|
|
15654
15654
|
isSimulationTransientVoltageGraph
|
|
15655
15655
|
} from "circuit-to-svg";
|
|
15656
15656
|
var isSimulationTransientCurrentGraph = (element) => element.type === "simulation_transient_current_graph";
|
|
15657
|
-
var getSimulationSvgInputs = (circuitJson) => {
|
|
15658
|
-
const
|
|
15659
|
-
|
|
15660
|
-
return;
|
|
15661
|
-
const simulationTransientCurrentGraphIds = circuitJson.filter((element) => isSimulationTransientCurrentGraph(element) && element.simulation_experiment_id === simulationExperiment.simulation_experiment_id).map((element) => element.simulation_transient_current_graph_id);
|
|
15662
|
-
const simulationTransientVoltageGraphIds = circuitJson.filter((element) => isSimulationTransientVoltageGraph(element) && element.simulation_experiment_id === simulationExperiment.simulation_experiment_id).map((element) => element.simulation_transient_voltage_graph_id);
|
|
15657
|
+
var getSimulationSvgInputs = (circuitJson, simulationExperimentId) => {
|
|
15658
|
+
const simulationTransientCurrentGraphIds = circuitJson.filter((element) => isSimulationTransientCurrentGraph(element) && element.simulation_experiment_id === simulationExperimentId).map((element) => element.simulation_transient_current_graph_id);
|
|
15659
|
+
const simulationTransientVoltageGraphIds = circuitJson.filter((element) => isSimulationTransientVoltageGraph(element) && element.simulation_experiment_id === simulationExperimentId).map((element) => element.simulation_transient_voltage_graph_id);
|
|
15663
15660
|
if (simulationTransientCurrentGraphIds.length === 0 && simulationTransientVoltageGraphIds.length === 0) {
|
|
15664
15661
|
return;
|
|
15665
15662
|
}
|
|
15666
15663
|
return {
|
|
15667
|
-
simulation_experiment_id:
|
|
15664
|
+
simulation_experiment_id: simulationExperimentId,
|
|
15668
15665
|
simulation_transient_current_graph_ids: simulationTransientCurrentGraphIds,
|
|
15669
15666
|
simulation_transient_voltage_graph_ids: simulationTransientVoltageGraphIds
|
|
15670
15667
|
};
|
|
15671
15668
|
};
|
|
15669
|
+
var toFileNameSuffix = (value) => value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
15670
|
+
var getUniqueFileNameSuffixes = (simulations) => {
|
|
15671
|
+
const usedSuffixes = new Set;
|
|
15672
|
+
return simulations.map((simulation) => {
|
|
15673
|
+
const baseSuffix = toFileNameSuffix(simulation.name) || toFileNameSuffix(simulation.simulation_experiment_id) || "simulation";
|
|
15674
|
+
let suffix = baseSuffix;
|
|
15675
|
+
let duplicateIndex = 2;
|
|
15676
|
+
while (usedSuffixes.has(suffix)) {
|
|
15677
|
+
suffix = `${baseSuffix}-${duplicateIndex++}`;
|
|
15678
|
+
}
|
|
15679
|
+
usedSuffixes.add(suffix);
|
|
15680
|
+
return suffix;
|
|
15681
|
+
});
|
|
15682
|
+
};
|
|
15672
15683
|
var getSimulationSvgAssetsFromCircuitJson = (circuitJson) => {
|
|
15673
|
-
const
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
|
|
15684
|
-
|
|
15685
|
-
|
|
15684
|
+
const simulationExperiments = circuitJson.filter(isSimulationExperiment);
|
|
15685
|
+
const fileNameSuffixes = getUniqueFileNameSuffixes(simulationExperiments);
|
|
15686
|
+
return simulationExperiments.flatMap((simulationExperiment, index) => {
|
|
15687
|
+
const simulationSvgInputs = getSimulationSvgInputs(circuitJson, simulationExperiment.simulation_experiment_id);
|
|
15688
|
+
if (!simulationSvgInputs)
|
|
15689
|
+
return [];
|
|
15690
|
+
return [
|
|
15691
|
+
{
|
|
15692
|
+
simulationExperimentId: simulationExperiment.simulation_experiment_id,
|
|
15693
|
+
simulationExperimentName: simulationExperiment.name,
|
|
15694
|
+
fileNameSuffix: fileNameSuffixes[index],
|
|
15695
|
+
simulationSvg: convertCircuitJsonToSimulationGraphSvg({
|
|
15696
|
+
circuitJson,
|
|
15697
|
+
...simulationSvgInputs
|
|
15698
|
+
}),
|
|
15699
|
+
schematicSimulationSvg: convertCircuitJsonToSchematicSimulationSvg({
|
|
15700
|
+
circuitJson,
|
|
15701
|
+
...simulationSvgInputs
|
|
15702
|
+
})
|
|
15703
|
+
}
|
|
15704
|
+
];
|
|
15705
|
+
});
|
|
15686
15706
|
};
|
|
15687
15707
|
|
|
15688
15708
|
// node_modules/conf/dist/source/index.js
|
|
@@ -17130,15 +17150,24 @@ var writeSimulationSvgAssetsFromCircuitJson = (circuitJson, outputDir, imageForm
|
|
|
17130
17150
|
return false;
|
|
17131
17151
|
}
|
|
17132
17152
|
const simulationSvgAssets = getSimulationSvgAssetsFromCircuitJson(circuitJson);
|
|
17133
|
-
if (
|
|
17153
|
+
if (simulationSvgAssets.length === 0)
|
|
17134
17154
|
return false;
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
|
|
17139
|
-
|
|
17140
|
-
|
|
17141
|
-
|
|
17155
|
+
const hasMultipleSimulations = simulationSvgAssets.length > 1;
|
|
17156
|
+
const simulationFileNames = [];
|
|
17157
|
+
const schematicSimulationFileNames = [];
|
|
17158
|
+
for (const simulationSvgAsset of simulationSvgAssets) {
|
|
17159
|
+
if (imageFormats.simulationSvgs) {
|
|
17160
|
+
const fileName = hasMultipleSimulations ? `simulation-${simulationSvgAsset.fileNameSuffix}.svg` : "simulation.svg";
|
|
17161
|
+
fs12.writeFileSync(path16.join(outputDir, fileName), simulationSvgAsset.simulationSvg, "utf-8");
|
|
17162
|
+
simulationFileNames.push(fileName);
|
|
17163
|
+
}
|
|
17164
|
+
if (imageFormats.simulationSchematicSvgs) {
|
|
17165
|
+
const fileName = hasMultipleSimulations ? `simulation-schematic-${simulationSvgAsset.fileNameSuffix}.svg` : "simulation-schematic.svg";
|
|
17166
|
+
fs12.writeFileSync(path16.join(outputDir, fileName), simulationSvgAsset.schematicSimulationSvg, "utf-8");
|
|
17167
|
+
schematicSimulationFileNames.push(fileName);
|
|
17168
|
+
}
|
|
17169
|
+
}
|
|
17170
|
+
return { simulationFileNames, schematicSimulationFileNames };
|
|
17142
17171
|
};
|
|
17143
17172
|
var writeGlbFromCircuitJson = async (circuitJson, glbOutputPath) => {
|
|
17144
17173
|
const circuitJsonWithFileUrls = convertModelUrlsToFileUrls(circuitJson);
|
package/dist/cli/main.js
CHANGED
|
@@ -118347,7 +118347,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
118347
118347
|
// lib/getVersion.ts
|
|
118348
118348
|
import { createRequire as createRequire2 } from "node:module";
|
|
118349
118349
|
// package.json
|
|
118350
|
-
var version = "0.1.
|
|
118350
|
+
var version = "0.1.1669";
|
|
118351
118351
|
var package_default = {
|
|
118352
118352
|
name: "@tscircuit/cli",
|
|
118353
118353
|
version,
|
|
@@ -118371,7 +118371,7 @@ var package_default = {
|
|
|
118371
118371
|
"@tscircuit/krt-wasm": "^0.1.6",
|
|
118372
118372
|
"@tscircuit/math-utils": "0.0.36",
|
|
118373
118373
|
"@tscircuit/props": "^0.0.567",
|
|
118374
|
-
"@tscircuit/runframe": "^0.0.
|
|
118374
|
+
"@tscircuit/runframe": "^0.0.2205",
|
|
118375
118375
|
"@tscircuit/schematic-match-adapt": "^0.0.22",
|
|
118376
118376
|
"@tscircuit/solver-utils": "0.0.16",
|
|
118377
118377
|
"@types/bun": "^1.2.2",
|
|
@@ -133408,35 +133408,55 @@ import {
|
|
|
133408
133408
|
isSimulationTransientVoltageGraph
|
|
133409
133409
|
} from "circuit-to-svg";
|
|
133410
133410
|
var isSimulationTransientCurrentGraph = (element) => element.type === "simulation_transient_current_graph";
|
|
133411
|
-
var getSimulationSvgInputs = (circuitJson) => {
|
|
133412
|
-
const
|
|
133413
|
-
|
|
133414
|
-
return;
|
|
133415
|
-
const simulationTransientCurrentGraphIds = circuitJson.filter((element) => isSimulationTransientCurrentGraph(element) && element.simulation_experiment_id === simulationExperiment.simulation_experiment_id).map((element) => element.simulation_transient_current_graph_id);
|
|
133416
|
-
const simulationTransientVoltageGraphIds = circuitJson.filter((element) => isSimulationTransientVoltageGraph(element) && element.simulation_experiment_id === simulationExperiment.simulation_experiment_id).map((element) => element.simulation_transient_voltage_graph_id);
|
|
133411
|
+
var getSimulationSvgInputs = (circuitJson, simulationExperimentId) => {
|
|
133412
|
+
const simulationTransientCurrentGraphIds = circuitJson.filter((element) => isSimulationTransientCurrentGraph(element) && element.simulation_experiment_id === simulationExperimentId).map((element) => element.simulation_transient_current_graph_id);
|
|
133413
|
+
const simulationTransientVoltageGraphIds = circuitJson.filter((element) => isSimulationTransientVoltageGraph(element) && element.simulation_experiment_id === simulationExperimentId).map((element) => element.simulation_transient_voltage_graph_id);
|
|
133417
133414
|
if (simulationTransientCurrentGraphIds.length === 0 && simulationTransientVoltageGraphIds.length === 0) {
|
|
133418
133415
|
return;
|
|
133419
133416
|
}
|
|
133420
133417
|
return {
|
|
133421
|
-
simulation_experiment_id:
|
|
133418
|
+
simulation_experiment_id: simulationExperimentId,
|
|
133422
133419
|
simulation_transient_current_graph_ids: simulationTransientCurrentGraphIds,
|
|
133423
133420
|
simulation_transient_voltage_graph_ids: simulationTransientVoltageGraphIds
|
|
133424
133421
|
};
|
|
133425
133422
|
};
|
|
133423
|
+
var toFileNameSuffix = (value) => value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
133424
|
+
var getUniqueFileNameSuffixes = (simulations) => {
|
|
133425
|
+
const usedSuffixes = new Set;
|
|
133426
|
+
return simulations.map((simulation) => {
|
|
133427
|
+
const baseSuffix = toFileNameSuffix(simulation.name) || toFileNameSuffix(simulation.simulation_experiment_id) || "simulation";
|
|
133428
|
+
let suffix = baseSuffix;
|
|
133429
|
+
let duplicateIndex = 2;
|
|
133430
|
+
while (usedSuffixes.has(suffix)) {
|
|
133431
|
+
suffix = `${baseSuffix}-${duplicateIndex++}`;
|
|
133432
|
+
}
|
|
133433
|
+
usedSuffixes.add(suffix);
|
|
133434
|
+
return suffix;
|
|
133435
|
+
});
|
|
133436
|
+
};
|
|
133426
133437
|
var getSimulationSvgAssetsFromCircuitJson = (circuitJson) => {
|
|
133427
|
-
const
|
|
133428
|
-
|
|
133429
|
-
|
|
133430
|
-
|
|
133431
|
-
|
|
133432
|
-
|
|
133433
|
-
|
|
133434
|
-
|
|
133435
|
-
|
|
133436
|
-
|
|
133437
|
-
|
|
133438
|
-
|
|
133439
|
-
|
|
133438
|
+
const simulationExperiments = circuitJson.filter(isSimulationExperiment);
|
|
133439
|
+
const fileNameSuffixes = getUniqueFileNameSuffixes(simulationExperiments);
|
|
133440
|
+
return simulationExperiments.flatMap((simulationExperiment, index) => {
|
|
133441
|
+
const simulationSvgInputs = getSimulationSvgInputs(circuitJson, simulationExperiment.simulation_experiment_id);
|
|
133442
|
+
if (!simulationSvgInputs)
|
|
133443
|
+
return [];
|
|
133444
|
+
return [
|
|
133445
|
+
{
|
|
133446
|
+
simulationExperimentId: simulationExperiment.simulation_experiment_id,
|
|
133447
|
+
simulationExperimentName: simulationExperiment.name,
|
|
133448
|
+
fileNameSuffix: fileNameSuffixes[index],
|
|
133449
|
+
simulationSvg: convertCircuitJsonToSimulationGraphSvg({
|
|
133450
|
+
circuitJson,
|
|
133451
|
+
...simulationSvgInputs
|
|
133452
|
+
}),
|
|
133453
|
+
schematicSimulationSvg: convertCircuitJsonToSchematicSimulationSvg({
|
|
133454
|
+
circuitJson,
|
|
133455
|
+
...simulationSvgInputs
|
|
133456
|
+
})
|
|
133457
|
+
}
|
|
133458
|
+
];
|
|
133459
|
+
});
|
|
133440
133460
|
};
|
|
133441
133461
|
|
|
133442
133462
|
// cli/build/worker-binary-utils.ts
|
|
@@ -133464,15 +133484,24 @@ var writeSimulationSvgAssetsFromCircuitJson = (circuitJson, outputDir, imageForm
|
|
|
133464
133484
|
return false;
|
|
133465
133485
|
}
|
|
133466
133486
|
const simulationSvgAssets = getSimulationSvgAssetsFromCircuitJson(circuitJson);
|
|
133467
|
-
if (
|
|
133487
|
+
if (simulationSvgAssets.length === 0)
|
|
133468
133488
|
return false;
|
|
133469
|
-
|
|
133470
|
-
|
|
133471
|
-
|
|
133472
|
-
|
|
133473
|
-
|
|
133489
|
+
const hasMultipleSimulations = simulationSvgAssets.length > 1;
|
|
133490
|
+
const simulationFileNames = [];
|
|
133491
|
+
const schematicSimulationFileNames = [];
|
|
133492
|
+
for (const simulationSvgAsset of simulationSvgAssets) {
|
|
133493
|
+
if (imageFormats.simulationSvgs) {
|
|
133494
|
+
const fileName = hasMultipleSimulations ? `simulation-${simulationSvgAsset.fileNameSuffix}.svg` : "simulation.svg";
|
|
133495
|
+
fs31.writeFileSync(path34.join(outputDir, fileName), simulationSvgAsset.simulationSvg, "utf-8");
|
|
133496
|
+
simulationFileNames.push(fileName);
|
|
133497
|
+
}
|
|
133498
|
+
if (imageFormats.simulationSchematicSvgs) {
|
|
133499
|
+
const fileName = hasMultipleSimulations ? `simulation-schematic-${simulationSvgAsset.fileNameSuffix}.svg` : "simulation-schematic.svg";
|
|
133500
|
+
fs31.writeFileSync(path34.join(outputDir, fileName), simulationSvgAsset.schematicSimulationSvg, "utf-8");
|
|
133501
|
+
schematicSimulationFileNames.push(fileName);
|
|
133502
|
+
}
|
|
133474
133503
|
}
|
|
133475
|
-
return
|
|
133504
|
+
return { simulationFileNames, schematicSimulationFileNames };
|
|
133476
133505
|
};
|
|
133477
133506
|
var writeGlbFromCircuitJson = async (circuitJson, glbOutputPath) => {
|
|
133478
133507
|
const circuitJsonWithFileUrls = convertModelUrlsToFileUrls(circuitJson);
|
|
@@ -133652,11 +133681,11 @@ var generatePreviewAssets = async ({
|
|
|
133652
133681
|
try {
|
|
133653
133682
|
const wroteSimulationSvgs = writeSimulationSvgAssetsFromCircuitJson(circuitJson, outputDir, imageFormats);
|
|
133654
133683
|
if (wroteSimulationSvgs) {
|
|
133655
|
-
|
|
133656
|
-
console.log(`${prefix}Written
|
|
133684
|
+
for (const fileName of wroteSimulationSvgs.simulationFileNames) {
|
|
133685
|
+
console.log(`${prefix}Written ${fileName}`);
|
|
133657
133686
|
}
|
|
133658
|
-
|
|
133659
|
-
console.log(`${prefix}Written
|
|
133687
|
+
for (const fileName of wroteSimulationSvgs.schematicSimulationFileNames) {
|
|
133688
|
+
console.log(`${prefix}Written ${fileName}`);
|
|
133660
133689
|
}
|
|
133661
133690
|
}
|
|
133662
133691
|
} catch (error) {
|
|
@@ -314494,7 +314523,7 @@ var processSnapshotFile = async ({
|
|
|
314494
314523
|
let circuitJson;
|
|
314495
314524
|
let pcbSvg;
|
|
314496
314525
|
let schSvg;
|
|
314497
|
-
let simulationSvgAssets;
|
|
314526
|
+
let simulationSvgAssets = [];
|
|
314498
314527
|
try {
|
|
314499
314528
|
if (isCircuitJsonFile(file)) {
|
|
314500
314529
|
const parsed = JSON.parse(fs71.readFileSync(file, "utf-8"));
|
|
@@ -314639,17 +314668,22 @@ var processSnapshotFile = async ({
|
|
|
314639
314668
|
if (threeD && png3d) {
|
|
314640
314669
|
snapshots.push({ type: "3d", content: png3d, isBinary: true });
|
|
314641
314670
|
}
|
|
314642
|
-
if ((simulationOnly || !pcbOnly && !schematicOnly) && simulationSvgAssets) {
|
|
314643
|
-
|
|
314644
|
-
|
|
314645
|
-
|
|
314646
|
-
|
|
314647
|
-
|
|
314648
|
-
|
|
314649
|
-
|
|
314650
|
-
|
|
314651
|
-
|
|
314652
|
-
|
|
314671
|
+
if ((simulationOnly || !pcbOnly && !schematicOnly) && simulationSvgAssets.length > 0) {
|
|
314672
|
+
const hasMultipleSimulations = simulationSvgAssets.length > 1;
|
|
314673
|
+
for (const simulationSvgAsset of simulationSvgAssets) {
|
|
314674
|
+
const simulationType = hasMultipleSimulations ? `simulation-${simulationSvgAsset.fileNameSuffix}` : "simulation";
|
|
314675
|
+
const schematicSimulationType = hasMultipleSimulations ? `schematic-simulation-${simulationSvgAsset.fileNameSuffix}` : "schematic-simulation";
|
|
314676
|
+
snapshots.push({
|
|
314677
|
+
type: simulationType,
|
|
314678
|
+
content: simulationSvgAsset.simulationSvg,
|
|
314679
|
+
isBinary: false
|
|
314680
|
+
});
|
|
314681
|
+
snapshots.push({
|
|
314682
|
+
type: schematicSimulationType,
|
|
314683
|
+
content: simulationSvgAsset.schematicSimulationSvg,
|
|
314684
|
+
isBinary: false
|
|
314685
|
+
});
|
|
314686
|
+
}
|
|
314653
314687
|
}
|
|
314654
314688
|
for (const snapshot of snapshots) {
|
|
314655
314689
|
const { type } = snapshot;
|
|
@@ -3802,35 +3802,55 @@ import {
|
|
|
3802
3802
|
isSimulationTransientVoltageGraph
|
|
3803
3803
|
} from "circuit-to-svg";
|
|
3804
3804
|
var isSimulationTransientCurrentGraph = (element) => element.type === "simulation_transient_current_graph";
|
|
3805
|
-
var getSimulationSvgInputs = (circuitJson) => {
|
|
3806
|
-
const
|
|
3807
|
-
|
|
3808
|
-
return;
|
|
3809
|
-
const simulationTransientCurrentGraphIds = circuitJson.filter((element) => isSimulationTransientCurrentGraph(element) && element.simulation_experiment_id === simulationExperiment.simulation_experiment_id).map((element) => element.simulation_transient_current_graph_id);
|
|
3810
|
-
const simulationTransientVoltageGraphIds = circuitJson.filter((element) => isSimulationTransientVoltageGraph(element) && element.simulation_experiment_id === simulationExperiment.simulation_experiment_id).map((element) => element.simulation_transient_voltage_graph_id);
|
|
3805
|
+
var getSimulationSvgInputs = (circuitJson, simulationExperimentId) => {
|
|
3806
|
+
const simulationTransientCurrentGraphIds = circuitJson.filter((element) => isSimulationTransientCurrentGraph(element) && element.simulation_experiment_id === simulationExperimentId).map((element) => element.simulation_transient_current_graph_id);
|
|
3807
|
+
const simulationTransientVoltageGraphIds = circuitJson.filter((element) => isSimulationTransientVoltageGraph(element) && element.simulation_experiment_id === simulationExperimentId).map((element) => element.simulation_transient_voltage_graph_id);
|
|
3811
3808
|
if (simulationTransientCurrentGraphIds.length === 0 && simulationTransientVoltageGraphIds.length === 0) {
|
|
3812
3809
|
return;
|
|
3813
3810
|
}
|
|
3814
3811
|
return {
|
|
3815
|
-
simulation_experiment_id:
|
|
3812
|
+
simulation_experiment_id: simulationExperimentId,
|
|
3816
3813
|
simulation_transient_current_graph_ids: simulationTransientCurrentGraphIds,
|
|
3817
3814
|
simulation_transient_voltage_graph_ids: simulationTransientVoltageGraphIds
|
|
3818
3815
|
};
|
|
3819
3816
|
};
|
|
3817
|
+
var toFileNameSuffix = (value) => value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
3818
|
+
var getUniqueFileNameSuffixes = (simulations) => {
|
|
3819
|
+
const usedSuffixes = new Set;
|
|
3820
|
+
return simulations.map((simulation) => {
|
|
3821
|
+
const baseSuffix = toFileNameSuffix(simulation.name) || toFileNameSuffix(simulation.simulation_experiment_id) || "simulation";
|
|
3822
|
+
let suffix = baseSuffix;
|
|
3823
|
+
let duplicateIndex = 2;
|
|
3824
|
+
while (usedSuffixes.has(suffix)) {
|
|
3825
|
+
suffix = `${baseSuffix}-${duplicateIndex++}`;
|
|
3826
|
+
}
|
|
3827
|
+
usedSuffixes.add(suffix);
|
|
3828
|
+
return suffix;
|
|
3829
|
+
});
|
|
3830
|
+
};
|
|
3820
3831
|
var getSimulationSvgAssetsFromCircuitJson = (circuitJson) => {
|
|
3821
|
-
const
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3832
|
+
const simulationExperiments = circuitJson.filter(isSimulationExperiment);
|
|
3833
|
+
const fileNameSuffixes = getUniqueFileNameSuffixes(simulationExperiments);
|
|
3834
|
+
return simulationExperiments.flatMap((simulationExperiment, index) => {
|
|
3835
|
+
const simulationSvgInputs = getSimulationSvgInputs(circuitJson, simulationExperiment.simulation_experiment_id);
|
|
3836
|
+
if (!simulationSvgInputs)
|
|
3837
|
+
return [];
|
|
3838
|
+
return [
|
|
3839
|
+
{
|
|
3840
|
+
simulationExperimentId: simulationExperiment.simulation_experiment_id,
|
|
3841
|
+
simulationExperimentName: simulationExperiment.name,
|
|
3842
|
+
fileNameSuffix: fileNameSuffixes[index],
|
|
3843
|
+
simulationSvg: convertCircuitJsonToSimulationGraphSvg({
|
|
3844
|
+
circuitJson,
|
|
3845
|
+
...simulationSvgInputs
|
|
3846
|
+
}),
|
|
3847
|
+
schematicSimulationSvg: convertCircuitJsonToSchematicSimulationSvg({
|
|
3848
|
+
circuitJson,
|
|
3849
|
+
...simulationSvgInputs
|
|
3850
|
+
})
|
|
3851
|
+
}
|
|
3852
|
+
];
|
|
3853
|
+
});
|
|
3834
3854
|
};
|
|
3835
3855
|
|
|
3836
3856
|
// lib/shared/compare-images.ts
|
|
@@ -3890,7 +3910,7 @@ var processSnapshotFile = async ({
|
|
|
3890
3910
|
let circuitJson;
|
|
3891
3911
|
let pcbSvg;
|
|
3892
3912
|
let schSvg;
|
|
3893
|
-
let simulationSvgAssets;
|
|
3913
|
+
let simulationSvgAssets = [];
|
|
3894
3914
|
try {
|
|
3895
3915
|
if (isCircuitJsonFile(file)) {
|
|
3896
3916
|
const parsed = JSON.parse(fs8.readFileSync(file, "utf-8"));
|
|
@@ -4035,17 +4055,22 @@ var processSnapshotFile = async ({
|
|
|
4035
4055
|
if (threeD && png3d) {
|
|
4036
4056
|
snapshots.push({ type: "3d", content: png3d, isBinary: true });
|
|
4037
4057
|
}
|
|
4038
|
-
if ((simulationOnly || !pcbOnly && !schematicOnly) && simulationSvgAssets) {
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4058
|
+
if ((simulationOnly || !pcbOnly && !schematicOnly) && simulationSvgAssets.length > 0) {
|
|
4059
|
+
const hasMultipleSimulations = simulationSvgAssets.length > 1;
|
|
4060
|
+
for (const simulationSvgAsset of simulationSvgAssets) {
|
|
4061
|
+
const simulationType = hasMultipleSimulations ? `simulation-${simulationSvgAsset.fileNameSuffix}` : "simulation";
|
|
4062
|
+
const schematicSimulationType = hasMultipleSimulations ? `schematic-simulation-${simulationSvgAsset.fileNameSuffix}` : "schematic-simulation";
|
|
4063
|
+
snapshots.push({
|
|
4064
|
+
type: simulationType,
|
|
4065
|
+
content: simulationSvgAsset.simulationSvg,
|
|
4066
|
+
isBinary: false
|
|
4067
|
+
});
|
|
4068
|
+
snapshots.push({
|
|
4069
|
+
type: schematicSimulationType,
|
|
4070
|
+
content: simulationSvgAsset.schematicSimulationSvg,
|
|
4071
|
+
isBinary: false
|
|
4072
|
+
});
|
|
4073
|
+
}
|
|
4049
4074
|
}
|
|
4050
4075
|
for (const snapshot of snapshots) {
|
|
4051
4076
|
const { type } = snapshot;
|
package/dist/lib/index.js
CHANGED
|
@@ -65811,7 +65811,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
65811
65811
|
}));
|
|
65812
65812
|
};
|
|
65813
65813
|
// package.json
|
|
65814
|
-
var version = "0.1.
|
|
65814
|
+
var version = "0.1.1669";
|
|
65815
65815
|
var package_default = {
|
|
65816
65816
|
name: "@tscircuit/cli",
|
|
65817
65817
|
version,
|
|
@@ -65835,7 +65835,7 @@ var package_default = {
|
|
|
65835
65835
|
"@tscircuit/krt-wasm": "^0.1.6",
|
|
65836
65836
|
"@tscircuit/math-utils": "0.0.36",
|
|
65837
65837
|
"@tscircuit/props": "^0.0.567",
|
|
65838
|
-
"@tscircuit/runframe": "^0.0.
|
|
65838
|
+
"@tscircuit/runframe": "^0.0.2205",
|
|
65839
65839
|
"@tscircuit/schematic-match-adapt": "^0.0.22",
|
|
65840
65840
|
"@tscircuit/solver-utils": "0.0.16",
|
|
65841
65841
|
"@types/bun": "^1.2.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1670",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@tscircuit/krt-wasm": "^0.1.6",
|
|
22
22
|
"@tscircuit/math-utils": "0.0.36",
|
|
23
23
|
"@tscircuit/props": "^0.0.567",
|
|
24
|
-
"@tscircuit/runframe": "^0.0.
|
|
24
|
+
"@tscircuit/runframe": "^0.0.2205",
|
|
25
25
|
"@tscircuit/schematic-match-adapt": "^0.0.22",
|
|
26
26
|
"@tscircuit/solver-utils": "0.0.16",
|
|
27
27
|
"@types/bun": "^1.2.2",
|