@tscircuit/cli 0.1.141 → 0.1.142

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 +23 -16
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -442238,7 +442238,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
442238
442238
  import { execSync as execSync2 } from "node:child_process";
442239
442239
  var import_semver2 = __toESM2(require_semver2(), 1);
442240
442240
  // package.json
442241
- var version = "0.1.140";
442241
+ var version = "0.1.141";
442242
442242
  var package_default = {
442243
442243
  name: "@tscircuit/cli",
442244
442244
  version,
@@ -498742,6 +498742,7 @@ var snapshotProject = async ({
498742
498742
  threeD = false,
498743
498743
  pcbOnly = false,
498744
498744
  schematicOnly = false,
498745
+ filePaths = [],
498745
498746
  onExit = (code) => process.exit(code),
498746
498747
  onError = (msg) => console.error(msg),
498747
498748
  onSuccess = (msg) => console.log(msg)
@@ -498751,20 +498752,25 @@ var snapshotProject = async ({
498751
498752
  ...DEFAULT_IGNORED_PATTERNS,
498752
498753
  ...ignored.map(normalizeIgnorePattern)
498753
498754
  ];
498754
- const boardFiles = globbySync(["**/*.board.tsx", "**/*.circuit.tsx"], {
498755
- cwd: projectDir,
498756
- ignore
498757
- });
498758
- let files = boardFiles.map((f) => path26.join(projectDir, f));
498759
- const entry = await getEntrypoint({
498760
- projectDir,
498761
- onError,
498762
- onSuccess: () => {}
498763
- });
498764
- if (entry) {
498765
- const resolved = path26.resolve(projectDir, entry);
498766
- if (!files.includes(resolved)) {
498767
- files.unshift(resolved);
498755
+ let files = [];
498756
+ if (filePaths.length > 0) {
498757
+ files = filePaths.map((f) => path26.resolve(projectDir, f));
498758
+ } else {
498759
+ const boardFiles = globbySync(["**/*.board.tsx", "**/*.circuit.tsx"], {
498760
+ cwd: projectDir,
498761
+ ignore
498762
+ });
498763
+ files = boardFiles.map((f) => path26.join(projectDir, f));
498764
+ const entry = await getEntrypoint({
498765
+ projectDir,
498766
+ onError,
498767
+ onSuccess: () => {}
498768
+ });
498769
+ if (entry) {
498770
+ const resolved = path26.resolve(projectDir, entry);
498771
+ if (!files.includes(resolved)) {
498772
+ files.unshift(resolved);
498773
+ }
498768
498774
  }
498769
498775
  }
498770
498776
  if (files.length === 0) {
@@ -498817,12 +498823,13 @@ ${mismatches.join(`
498817
498823
 
498818
498824
  // cli/snapshot/register.ts
498819
498825
  var registerSnapshot = (program3) => {
498820
- 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) => {
498826
+ program3.command("snapshot").argument("[file]", "Path to the board or circuit file").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 (file, options) => {
498821
498827
  await snapshotProject({
498822
498828
  update: options.update ?? false,
498823
498829
  threeD: options["3d"] ?? false,
498824
498830
  pcbOnly: options.pcbOnly ?? false,
498825
498831
  schematicOnly: options.schematicOnly ?? false,
498832
+ filePaths: file ? [file] : [],
498826
498833
  onExit: (code) => process.exit(code),
498827
498834
  onError: (msg) => console.error(msg),
498828
498835
  onSuccess: (msg) => console.log(msg)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.141",
3
+ "version": "0.1.142",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",