@tscircuit/cli 0.1.1008 → 0.1.1009

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/main.js CHANGED
@@ -71664,7 +71664,7 @@ var registerStaticAssetLoaders = () => {
71664
71664
  // cli/main.ts
71665
71665
  var import_perfect_cli = __toESM2(require_dist2(), 1);
71666
71666
  // package.json
71667
- var version = "0.1.1007";
71667
+ var version = "0.1.1008";
71668
71668
  var package_default = {
71669
71669
  name: "@tscircuit/cli",
71670
71670
  main: "dist/cli/main.js",
@@ -176985,12 +176985,12 @@ import { renderGLTFToPNGBufferFromGLBBuffer as renderGLTFToPNGBufferFromGLBBuffe
176985
176985
  // lib/shared/compare-images.ts
176986
176986
  import looksSame from "looks-same";
176987
176987
  import fs59 from "node:fs/promises";
176988
- var compareAndCreateDiff = async (buffer1, buffer2, diffPath) => {
176988
+ var compareAndCreateDiff = async (buffer1, buffer2, diffPath, createDiff = true) => {
176989
176989
  const { equal: equal2 } = await looksSame(buffer1, buffer2, {
176990
176990
  strict: false,
176991
176991
  tolerance: 2
176992
176992
  });
176993
- if (!equal2) {
176993
+ if (!equal2 && createDiff) {
176994
176994
  if (diffPath.endsWith(".png")) {
176995
176995
  await looksSame.createDiff({
176996
176996
  reference: buffer1,
@@ -177018,7 +177018,8 @@ var snapshotProject = async ({
177018
177018
  onExit: onExit2 = (code) => process.exit(code),
177019
177019
  onError = (msg) => console.error(msg),
177020
177020
  onSuccess = (msg) => console.log(msg),
177021
- platformConfig: platformConfig2
177021
+ platformConfig: platformConfig2,
177022
+ createDiff = false
177022
177023
  } = {}) => {
177023
177024
  const projectDir = process.cwd();
177024
177025
  const ignore = [
@@ -177157,7 +177158,7 @@ var snapshotProject = async ({
177157
177158
  }
177158
177159
  const oldContentBuffer = fs60.readFileSync(snapPath);
177159
177160
  const diffPath = snapPath.replace(is3d ? ".snap.png" : ".snap.svg", is3d ? ".diff.png" : ".diff.svg");
177160
- const { equal: equal2 } = await compareAndCreateDiff(oldContentBuffer, newContentBuffer, diffPath);
177161
+ const { equal: equal2 } = await compareAndCreateDiff(oldContentBuffer, newContentBuffer, diffPath, createDiff);
177161
177162
  if (update) {
177162
177163
  if (!forceUpdate && equal2) {
177163
177164
  console.log("✅", kleur_default.gray(path60.relative(projectDir, snapPath)));
@@ -177167,7 +177168,7 @@ var snapshotProject = async ({
177167
177168
  didUpdate = true;
177168
177169
  }
177169
177170
  } else if (!equal2) {
177170
- mismatches.push(`${snapPath} (diff: ${diffPath})`);
177171
+ mismatches.push(createDiff ? `${snapPath} (diff: ${diffPath})` : snapPath);
177171
177172
  } else {
177172
177173
  console.log("✅", kleur_default.gray(path60.relative(projectDir, snapPath)));
177173
177174
  }
@@ -177191,7 +177192,7 @@ Run with --update to fix.`);
177191
177192
 
177192
177193
  // cli/snapshot/register.ts
177193
177194
  var registerSnapshot = (program3) => {
177194
- program3.command("snapshot").argument("[path]", "Path to file, directory, or glob pattern (e.g., 'examples/**/*.tsx')").description("Generate schematic and PCB snapshots (add --3d for 3d preview)").option("-u, --update", "Update snapshots on disk").option("--force-update", "Force update snapshots even if they match").option("--3d", "Generate 3d preview snapshots").option("--pcb-only", "Generate only PCB snapshots").option("--schematic-only", "Generate only schematic snapshots").option("--disable-parts-engine", "Disable the parts engine").action(async (target, options) => {
177195
+ program3.command("snapshot").argument("[path]", "Path to file, directory, or glob pattern (e.g., 'examples/**/*.tsx')").description("Generate schematic and PCB snapshots (add --3d for 3d preview)").option("-u, --update", "Update snapshots on disk").option("--force-update", "Force update snapshots even if they match").option("--3d", "Generate 3d preview snapshots").option("--pcb-only", "Generate only PCB snapshots").option("--schematic-only", "Generate only schematic snapshots").option("--disable-parts-engine", "Disable the parts engine").option("--ci", "Enable CI mode with snapshot diff artifacts").option("--test", "Enable test mode with snapshot diff artifacts").action(async (target, options) => {
177195
177196
  await snapshotProject({
177196
177197
  update: options.update ?? false,
177197
177198
  threeD: options["3d"] ?? false,
@@ -177200,6 +177201,7 @@ var registerSnapshot = (program3) => {
177200
177201
  forceUpdate: options.forceUpdate ?? false,
177201
177202
  filePaths: target ? [target] : [],
177202
177203
  platformConfig: options.disablePartsEngine ? { partsEngineDisabled: true } : undefined,
177204
+ createDiff: (options.ci ?? false) || (options.test ?? false),
177203
177205
  onExit: (code) => process.exit(code),
177204
177206
  onError: (msg) => console.error(msg),
177205
177207
  onSuccess: (msg) => console.log(msg)
package/dist/lib/index.js CHANGED
@@ -60432,7 +60432,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60432
60432
  }));
60433
60433
  };
60434
60434
  // package.json
60435
- var version = "0.1.1007";
60435
+ var version = "0.1.1008";
60436
60436
  var package_default = {
60437
60437
  name: "@tscircuit/cli",
60438
60438
  main: "dist/cli/main.js",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ".": "./dist/cli/main.js",
6
6
  "./lib": "./dist/lib/index.js"
7
7
  },
8
- "version": "0.1.1008",
8
+ "version": "0.1.1009",
9
9
  "devDependencies": {
10
10
  "@babel/standalone": "^7.26.9",
11
11
  "@biomejs/biome": "^1.9.4",