@tscircuit/cli 0.1.856 → 0.1.857

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.
@@ -16,6 +16,15 @@ var __toESM = (mod, isNodeMode, target) => {
16
16
  return to;
17
17
  };
18
18
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, {
22
+ get: all[name],
23
+ enumerable: true,
24
+ configurable: true,
25
+ set: (newValue) => all[name] = () => newValue
26
+ });
27
+ };
19
28
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
29
 
21
30
  // node_modules/make-vfs/dist/index.js
@@ -29,7 +38,7 @@ var require_dist = __commonJS((exports, module) => {
29
38
  var __commonJS2 = (cb, mod) => function __require2() {
30
39
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
31
40
  };
32
- var __export = (target, all) => {
41
+ var __export2 = (target, all) => {
33
42
  for (var name in all)
34
43
  __defProp2(target, name, { get: all[name], enumerable: true });
35
44
  };
@@ -2335,7 +2344,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
2335
2344
  }
2336
2345
  });
2337
2346
  var src_exports = {};
2338
- __export(src_exports, {
2347
+ __export2(src_exports, {
2339
2348
  getMatchingFilePaths: () => getMatchingFilePaths,
2340
2349
  getVirtualFileSystemFromDirPath: () => getVirtualFileSystemFromDirPath,
2341
2350
  getVirtualFilesystemModuleFromDirPath: () => getVirtualFilesystemModuleFromDirPath
package/dist/main.js CHANGED
@@ -17,6 +17,15 @@ var __toESM2 = (mod, isNodeMode, target) => {
17
17
  return to;
18
18
  };
19
19
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
+ var __export2 = (target, all) => {
21
+ for (var name in all)
22
+ __defProp2(target, name, {
23
+ get: all[name],
24
+ enumerable: true,
25
+ configurable: true,
26
+ set: (newValue) => all[name] = () => newValue
27
+ });
28
+ };
20
29
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
21
30
 
22
31
  // node_modules/commander/lib/error.js
@@ -16050,7 +16059,7 @@ var require_dist3 = __commonJS((exports2, module2) => {
16050
16059
  var __commonJS2 = (cb, mod) => function __require2() {
16051
16060
  return mod || (0, cb[__getOwnPropNames22(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16052
16061
  };
16053
- var __export2 = (target, all) => {
16062
+ var __export22 = (target, all) => {
16054
16063
  for (var name in all)
16055
16064
  __defProp22(target, name, { get: all[name], enumerable: true });
16056
16065
  };
@@ -32706,7 +32715,7 @@ var crypto = new Crypto();
32706
32715
  }
32707
32716
  });
32708
32717
  var src_exports = {};
32709
- __export2(src_exports, {
32718
+ __export22(src_exports, {
32710
32719
  buildToFetchEvent: () => buildToFetchEvent,
32711
32720
  buildToHeaders: () => buildToHeaders,
32712
32721
  buildToNodeHandler: () => buildToNodeHandler,
@@ -49287,7 +49296,7 @@ var require_load = __commonJS((exports2, module2) => {
49287
49296
  var __getProtoOf3 = Object.getPrototypeOf;
49288
49297
  var __hasOwnProp3 = Object.prototype.hasOwnProperty;
49289
49298
  var __name2 = (target, value) => __defProp3(target, "name", { value, configurable: true });
49290
- var __export2 = (target, all) => {
49299
+ var __export3 = (target, all) => {
49291
49300
  for (var name in all)
49292
49301
  __defProp3(target, name, { get: all[name], enumerable: true });
49293
49302
  };
@@ -49302,7 +49311,7 @@ var require_load = __commonJS((exports2, module2) => {
49302
49311
  var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target, mod));
49303
49312
  var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
49304
49313
  var load_exports2 = {};
49305
- __export2(load_exports2, {
49314
+ __export3(load_exports2, {
49306
49315
  load: () => load2
49307
49316
  });
49308
49317
  module2.exports = __toCommonJS2(load_exports2);
@@ -49522,7 +49531,7 @@ var require_dist5 = __commonJS((exports2, module2) => {
49522
49531
  var __commonJS2 = (cb, mod) => function __require2() {
49523
49532
  return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
49524
49533
  };
49525
- var __export2 = (target, all) => {
49534
+ var __export3 = (target, all) => {
49526
49535
  for (var name in all)
49527
49536
  __defProp3(target, name, { get: all[name], enumerable: true });
49528
49537
  };
@@ -51828,7 +51837,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
51828
51837
  }
51829
51838
  });
51830
51839
  var src_exports = {};
51831
- __export2(src_exports, {
51840
+ __export3(src_exports, {
51832
51841
  getMatchingFilePaths: () => getMatchingFilePaths,
51833
51842
  getVirtualFileSystemFromDirPath: () => getVirtualFileSystemFromDirPath,
51834
51843
  getVirtualFilesystemModuleFromDirPath: () => getVirtualFilesystemModuleFromDirPath,
@@ -51939,7 +51948,7 @@ var require_dist6 = __commonJS((exports2, module2) => {
51939
51948
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
51940
51949
  var __getOwnPropNames3 = Object.getOwnPropertyNames;
51941
51950
  var __hasOwnProp3 = Object.prototype.hasOwnProperty;
51942
- var __export2 = (target, all) => {
51951
+ var __export3 = (target, all) => {
51943
51952
  for (var name in all)
51944
51953
  __defProp3(target, name, { get: all[name], enumerable: true });
51945
51954
  };
@@ -51953,7 +51962,7 @@ var require_dist6 = __commonJS((exports2, module2) => {
51953
51962
  };
51954
51963
  var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
51955
51964
  var src_exports = {};
51956
- __export2(src_exports, {
51965
+ __export3(src_exports, {
51957
51966
  default: () => src_default,
51958
51967
  getRouteMatcher: () => getRouteMatcher,
51959
51968
  getRouteMatcherUgly: () => getRouteMatcherUgly
@@ -67162,7 +67171,7 @@ var require_dist7 = __commonJS((exports2, module2) => {
67162
67171
  }
67163
67172
  return target;
67164
67173
  };
67165
- var __export2 = (target, all) => {
67174
+ var __export3 = (target, all) => {
67166
67175
  for (var name in all)
67167
67176
  __defProp3(target, name, { get: all[name], enumerable: true });
67168
67177
  };
@@ -67197,7 +67206,7 @@ var require_dist7 = __commonJS((exports2, module2) => {
67197
67206
  });
67198
67207
  };
67199
67208
  var src_exports = {};
67200
- __export2(src_exports, {
67209
+ __export3(src_exports, {
67201
67210
  getCommandFromPath: () => getCommandFromPath,
67202
67211
  getCommandPathOnly: () => getCommandPathOnly,
67203
67212
  perfectCli: () => perfectCli
@@ -67493,7 +67502,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67493
67502
  var __commonJS2 = (cb, mod) => function __require2() {
67494
67503
  return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
67495
67504
  };
67496
- var __export2 = (target, all) => {
67505
+ var __export3 = (target, all) => {
67497
67506
  for (var name in all)
67498
67507
  __defProp3(target, name, { get: all[name], enumerable: true });
67499
67508
  };
@@ -69799,7 +69808,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69799
69808
  }
69800
69809
  });
69801
69810
  var src_exports = {};
69802
- __export2(src_exports, {
69811
+ __export3(src_exports, {
69803
69812
  getMatchingFilePaths: () => getMatchingFilePaths2,
69804
69813
  getVirtualFileSystemFromDirPath: () => getVirtualFileSystemFromDirPath,
69805
69814
  getVirtualFilesystemModuleFromDirPath: () => getVirtualFilesystemModuleFromDirPath
@@ -74375,7 +74384,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74375
74384
  import { execSync as execSync2 } from "node:child_process";
74376
74385
  var import_semver2 = __toESM2(require_semver2(), 1);
74377
74386
  // package.json
74378
- var version = "0.1.855";
74387
+ var version = "0.1.856";
74379
74388
  var package_default = {
74380
74389
  name: "@tscircuit/cli",
74381
74390
  version,
@@ -76264,6 +76273,14 @@ import path15 from "node:path";
76264
76273
  import { pathToFileURL } from "node:url";
76265
76274
 
76266
76275
  // node_modules/circuit-json-to-kicad/dist/index.js
76276
+ var exports_dist = {};
76277
+ __export2(exports_dist, {
76278
+ KicadLibraryConverter: () => KicadLibraryConverter,
76279
+ CircuitJsonToKicadSchConverter: () => CircuitJsonToKicadSchConverter,
76280
+ CircuitJsonToKicadProConverter: () => CircuitJsonToKicadProConverter,
76281
+ CircuitJsonToKicadPcbConverter: () => CircuitJsonToKicadPcbConverter,
76282
+ CircuitJsonToKicadLibraryConverter: () => CircuitJsonToKicadLibraryConverter
76283
+ });
76267
76284
  import { KicadSch } from "kicadts";
76268
76285
  import { cju } from "@tscircuit/circuit-json-util";
76269
76286
  import { compose, translate, scale } from "transformation-matrix";
@@ -78710,6 +78727,83 @@ var CircuitJsonToKicadPcbConverter = class {
78710
78727
  return this.ctx.kicadPcb.getString();
78711
78728
  }
78712
78729
  };
78730
+ var CircuitJsonToKicadProConverter = class {
78731
+ ctx;
78732
+ project;
78733
+ constructor(circuitJson, options = {}) {
78734
+ const projectName = options.projectName ?? circuitJson?.project?.name ?? "circuit-json-project";
78735
+ const schematicFilename = options.schematicFilename ?? `${projectName}.kicad_sch`;
78736
+ const pcbFilename = options.pcbFilename ?? `${projectName}.kicad_pcb`;
78737
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
78738
+ this.ctx = {
78739
+ db: cju3(circuitJson),
78740
+ circuitJson
78741
+ };
78742
+ this.project = {
78743
+ version: 1,
78744
+ head: {
78745
+ generator: "circuit-json-to-kicad",
78746
+ generator_version: "0.0.1",
78747
+ project_name: projectName,
78748
+ created: timestamp,
78749
+ modified: timestamp
78750
+ },
78751
+ meta: {
78752
+ version: 1
78753
+ },
78754
+ text_variables: {},
78755
+ libraries: {
78756
+ pinned_symbol_libs: [],
78757
+ pinned_footprint_libs: []
78758
+ },
78759
+ boards: [],
78760
+ cvpcb: {
78761
+ meta: {
78762
+ version: 0
78763
+ }
78764
+ },
78765
+ erc: {
78766
+ meta: {
78767
+ version: 0
78768
+ },
78769
+ erc_exclusions: []
78770
+ },
78771
+ net_settings: {
78772
+ meta: {
78773
+ version: 1
78774
+ },
78775
+ last_net_id: 0,
78776
+ classes: []
78777
+ },
78778
+ pcbnew: {
78779
+ page_layout_descr_file: "",
78780
+ last_paths: {}
78781
+ },
78782
+ schematic: {
78783
+ meta: {
78784
+ version: 1
78785
+ },
78786
+ page_layout_descr_file: "",
78787
+ last_opened_files: [schematicFilename]
78788
+ },
78789
+ board: {
78790
+ meta: {
78791
+ version: 1
78792
+ },
78793
+ last_opened_board: pcbFilename
78794
+ },
78795
+ sheets: [[Math.random().toString(36).substring(2, 15), "Root"]]
78796
+ };
78797
+ }
78798
+ runUntilFinished() {}
78799
+ getOutput() {
78800
+ return this.project;
78801
+ }
78802
+ getOutputString() {
78803
+ return `${JSON.stringify(this.project, null, 2)}
78804
+ `;
78805
+ }
78806
+ };
78713
78807
  var GenerateKicadSchAndPcbStage = class extends ConverterStage {
78714
78808
  _step() {
78715
78809
  const schConverter = new CircuitJsonToKicadSchConverter(this.ctx.circuitJson);
@@ -79981,13 +80075,15 @@ async function convertToKicadLibrary({
79981
80075
  libraryName,
79982
80076
  outputDir,
79983
80077
  isPcm,
79984
- kicadPcmPackageId
80078
+ kicadPcmPackageId,
80079
+ circuitJsonToKicadModule
79985
80080
  }) {
79986
80081
  const absoluteFilePath = path15.isAbsolute(filePath) ? filePath : path15.resolve(process.cwd(), filePath);
79987
80082
  const React = await importFromUserLand("react");
79988
80083
  globalThis.React = React;
79989
80084
  const userLandTscircuit = await importFromUserLand("tscircuit");
79990
- const converter = new KicadLibraryConverter({
80085
+ const { KicadLibraryConverter: KicadLibraryConverter2 } = circuitJsonToKicadModule ?? exports_dist;
80086
+ const converter = new KicadLibraryConverter2({
79991
80087
  kicadLibraryName: libraryName,
79992
80088
  entrypoint: absoluteFilePath,
79993
80089
  buildFileToCircuitJson: async (filePath2, componentName) => {
@@ -80271,7 +80367,8 @@ async function buildKicadPcm({
80271
80367
  entryFile,
80272
80368
  projectDir,
80273
80369
  distDir,
80274
- baseUrl: baseUrlOption
80370
+ baseUrl: baseUrlOption,
80371
+ circuitJsonToKicadModule
80275
80372
  }) {
80276
80373
  const packageJsonPath = path18.join(projectDir, "package.json");
80277
80374
  if (!fs15.existsSync(packageJsonPath)) {
@@ -80292,7 +80389,8 @@ async function buildKicadPcm({
80292
80389
  libraryName,
80293
80390
  outputDir: kicadLibOutputDir,
80294
80391
  isPcm: true,
80295
- kicadPcmPackageId
80392
+ kicadPcmPackageId,
80393
+ circuitJsonToKicadModule
80296
80394
  });
80297
80395
  const pcmOutputDir = path18.join(distDir, "pcm");
80298
80396
  const envDeploymentUrl = process.env.TSCIRCUIT_DEPLOYMENT_URL?.replace(/\/+$/, "");
@@ -87918,7 +88016,7 @@ var __require2 = /* @__PURE__ */ ((x) => __require)(function(x) {
87918
88016
  var __commonJS2 = (cb, mod) => function __require22() {
87919
88017
  return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
87920
88018
  };
87921
- var __export2 = (target, all) => {
88019
+ var __export3 = (target, all) => {
87922
88020
  for (var name in all)
87923
88021
  __defProp3(target, name, { get: all[name], enumerable: true });
87924
88022
  };
@@ -88712,7 +88810,7 @@ var require_svgson_umd = __commonJS2({
88712
88810
  }
88713
88811
  });
88714
88812
  var dist_exports = {};
88715
- __export2(dist_exports, {
88813
+ __export3(dist_exports, {
88716
88814
  all_layers: () => all_layers,
88717
88815
  any_circuit_element: () => any_circuit_element,
88718
88816
  any_soup_element: () => any_soup_element,
@@ -88890,7 +88988,7 @@ __export2(dist_exports, {
88890
88988
  wave_shape: () => wave_shape
88891
88989
  });
88892
88990
  var external_exports = {};
88893
- __export2(external_exports, {
88991
+ __export3(external_exports, {
88894
88992
  BRAND: () => BRAND,
88895
88993
  DIRTY: () => DIRTY,
88896
88994
  EMPTY_PATH: () => EMPTY_PATH,
@@ -122696,7 +122794,7 @@ var import_constants14 = __toESM3(require_constants6(), 1);
122696
122794
  var import_debug62 = __toESM3(require_browser(), 1);
122697
122795
  var import_debug72 = __toESM3(require_browser(), 1);
122698
122796
  var esm_exports2 = {};
122699
- __export2(esm_exports2, {
122797
+ __export3(esm_exports2, {
122700
122798
  DocumentPosition: () => DocumentPosition,
122701
122799
  append: () => append,
122702
122800
  appendChild: () => appendChild,
@@ -155911,12 +156009,12 @@ var import_jsx_runtime5 = __toESM3(require_jsx_runtime(), 1);
155911
156009
  var import_jsx_runtime6 = __toESM3(require_jsx_runtime(), 1);
155912
156010
  var import_react7 = __toESM3(require_react(), 1);
155913
156011
  var __defProp32 = Object.defineProperty;
155914
- var __export3 = (target, all) => {
156012
+ var __export32 = (target, all) => {
155915
156013
  for (var name in all)
155916
156014
  __defProp32(target, name, { get: all[name], enumerable: true });
155917
156015
  };
155918
156016
  var components_exports = {};
155919
- __export3(components_exports, {
156017
+ __export32(components_exports, {
155920
156018
  AnalogSimulation: () => AnalogSimulation,
155921
156019
  Battery: () => Battery,
155922
156020
  Board: () => Board,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.856",
3
+ "version": "0.1.857",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",