@tscircuit/cli 0.1.1004 → 0.1.1006

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.1003";
71667
+ var version = "0.1.1005";
71668
71668
  var package_default = {
71669
71669
  name: "@tscircuit/cli",
71670
71670
  main: "dist/cli/main.js",
@@ -175360,7 +175360,7 @@ export default () => (
175360
175360
  )
175361
175361
  `);
175362
175362
  if (saveProjectConfig(null, projectDir)) {
175363
- console.log("Updated tscircuit.config.json with mainEntrypoint: 'index.circuit.tsx'");
175363
+ console.log("Created tscircuit.config.json with schema");
175364
175364
  }
175365
175365
  writeFileIfNotExists(path58.join(projectDir, ".npmrc"), `
175366
175366
  @tsci:registry=https://npm.tscircuit.com
@@ -177038,18 +177038,27 @@ var snapshotProject = async ({
177038
177038
  const snapshotsDirName = getSnapshotsDir(projectDir);
177039
177039
  const mismatches = [];
177040
177040
  let didUpdate = false;
177041
+ const isCircuitJsonFile = (filePath) => {
177042
+ const normalizedPath = filePath.toLowerCase().replaceAll("\\", "/");
177043
+ return normalizedPath.endsWith(".circuit.json") || normalizedPath.endsWith("/circuit.json");
177044
+ };
177041
177045
  for (const file of boardFiles) {
177042
177046
  const relativeFilePath = path60.relative(projectDir, file);
177043
177047
  let circuitJson;
177044
177048
  let pcbSvg;
177045
177049
  let schSvg;
177046
177050
  try {
177047
- const completePlatformConfig = getCompletePlatformConfig(platformConfig2);
177048
- const result = await generateCircuitJson({
177049
- filePath: file,
177050
- platformConfig: completePlatformConfig
177051
- });
177052
- circuitJson = result.circuitJson;
177051
+ if (isCircuitJsonFile(file)) {
177052
+ const parsed = JSON.parse(fs60.readFileSync(file, "utf-8"));
177053
+ circuitJson = Array.isArray(parsed) ? parsed : [];
177054
+ } else {
177055
+ const completePlatformConfig = getCompletePlatformConfig(platformConfig2);
177056
+ const result = await generateCircuitJson({
177057
+ filePath: file,
177058
+ platformConfig: completePlatformConfig
177059
+ });
177060
+ circuitJson = result.circuitJson;
177061
+ }
177053
177062
  } catch (error) {
177054
177063
  const errorMessage = error instanceof Error ? error.message : String(error);
177055
177064
  onError(kleur_default.red(`
@@ -177093,7 +177102,7 @@ var snapshotProject = async ({
177093
177102
  const fileDir = path60.dirname(file);
177094
177103
  const relativeDir = path60.relative(projectDir, fileDir);
177095
177104
  const snapDir2 = snapshotsDirName ? path60.join(projectDir, snapshotsDirName, relativeDir) : path60.join(fileDir, "__snapshots__");
177096
- const base2 = path60.basename(file).replace(/\.tsx$/, "");
177105
+ const base2 = path60.basename(file).replace(/\.[^.]+$/, "");
177097
177106
  const snap3dPath = path60.join(snapDir2, `${base2}-3d.snap.png`);
177098
177107
  const existing3dSnapshot = fs60.existsSync(snap3dPath);
177099
177108
  if (existing3dSnapshot) {
@@ -177118,7 +177127,7 @@ var snapshotProject = async ({
177118
177127
  }
177119
177128
  const snapDir = snapshotsDirName ? path60.join(projectDir, snapshotsDirName, path60.relative(projectDir, path60.dirname(file))) : path60.join(path60.dirname(file), "__snapshots__");
177120
177129
  fs60.mkdirSync(snapDir, { recursive: true });
177121
- const base = path60.basename(file).replace(/\.tsx$/, "");
177130
+ const base = path60.basename(file).replace(/\.[^.]+$/, "");
177122
177131
  const snapshots = [];
177123
177132
  if (pcbOnly || !schematicOnly) {
177124
177133
  snapshots.push({ type: "pcb", content: pcbSvg, isBinary: false });
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.1003";
60435
+ var version = "0.1.1005";
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.1004",
8
+ "version": "0.1.1006",
9
9
  "devDependencies": {
10
10
  "@babel/standalone": "^7.26.9",
11
11
  "@biomejs/biome": "^1.9.4",