@tscircuit/cli 0.1.135 → 0.1.137

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.
Files changed (2) hide show
  1. package/dist/main.js +14 -6
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -442169,7 +442169,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
442169
442169
  import { execSync as execSync2 } from "node:child_process";
442170
442170
  var import_semver2 = __toESM2(require_semver2(), 1);
442171
442171
  // package.json
442172
- var version = "0.1.134";
442172
+ var version = "0.1.136";
442173
442173
  var package_default = {
442174
442174
  name: "@tscircuit/cli",
442175
442175
  version,
@@ -497049,6 +497049,8 @@ var snapshotProject = async ({
497049
497049
  update = false,
497050
497050
  ignored = [],
497051
497051
  threeD = false,
497052
+ pcbOnly = false,
497053
+ schematicOnly = false,
497052
497054
  onExit = (code) => process.exit(code),
497053
497055
  onError = (msg) => console.error(msg),
497054
497056
  onSuccess = (msg) => console.log(msg)
@@ -497086,10 +497088,13 @@ var snapshotProject = async ({
497086
497088
  const snapDir = path26.join(path26.dirname(file), "__snapshots__");
497087
497089
  fs26.mkdirSync(snapDir, { recursive: true });
497088
497090
  const base = path26.basename(file).replace(/\.tsx$/, "");
497089
- const snapshotPairs = [
497090
- ["pcb", pcbSvg],
497091
- ["schematic", schSvg]
497092
- ];
497091
+ const snapshotPairs = [];
497092
+ const includePcb = pcbOnly || !schematicOnly;
497093
+ const includeSchematic = schematicOnly || !pcbOnly;
497094
+ if (includePcb)
497095
+ snapshotPairs.push(["pcb", pcbSvg]);
497096
+ if (includeSchematic)
497097
+ snapshotPairs.push(["schematic", schSvg]);
497093
497098
  if (threeD && svg3d) {
497094
497099
  snapshotPairs.push(["3d", svg3d]);
497095
497100
  }
@@ -497097,6 +497102,7 @@ var snapshotProject = async ({
497097
497102
  const snapPath = path26.join(snapDir, `${base}-${type}.snap.svg`);
497098
497103
  if (update || !fs26.existsSync(snapPath)) {
497099
497104
  fs26.writeFileSync(snapPath, svg);
497105
+ console.log("✅", kleur_default.gray(path26.relative(projectDir, snapPath)));
497100
497106
  } else {
497101
497107
  const existing = fs26.readFileSync(snapPath, "utf-8");
497102
497108
  if (existing !== svg)
@@ -497120,10 +497126,12 @@ ${mismatches.join(`
497120
497126
 
497121
497127
  // cli/snapshot/register.ts
497122
497128
  var registerSnapshot = (program3) => {
497123
- program3.command("snapshot").description("Generate schematic and PCB snapshots (add --3d for 3d preview)").option("-u, --update", "Update snapshots on disk").option("--3d", "Generate 3d preview snapshots").action(async (options) => {
497129
+ program3.command("snapshot").description("Generate schematic and PCB snapshots (add --3d for 3d preview)").option("-u, --update", "Update snapshots on disk").option("--3d", "Generate 3d preview snapshots").option("--pcb-only", "Generate only PCB snapshots").option("--schematic-only", "Generate only schematic snapshots").action(async (options) => {
497124
497130
  await snapshotProject({
497125
497131
  update: options.update ?? false,
497126
497132
  threeD: options["3d"] ?? false,
497133
+ pcbOnly: options.pcbOnly ?? false,
497134
+ schematicOnly: options.schematicOnly ?? false,
497127
497135
  onExit: (code) => process.exit(code),
497128
497136
  onError: (msg) => console.error(msg),
497129
497137
  onSuccess: (msg) => console.log(msg)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.135",
3
+ "version": "0.1.137",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",