@modular-circuit/transpiler 0.0.66 → 0.0.68

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.
@@ -1,8 +1,8 @@
1
1
  import { type NL_NetList } from '@modular-circuit/electronics-model';
2
- import type { ConvertGraphToKiCadContext } from './context';
2
+ import type { ConnectionGraphMap } from './context';
3
3
  export declare class GraphConverter {
4
4
  private ctx;
5
- constructor(ctx: ConvertGraphToKiCadContext);
5
+ constructor(ctx: ConnectionGraphMap);
6
6
  convert_to_netlist(): NL_NetList;
7
7
  }
8
8
  //# sourceMappingURL=graph_converter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph_converter.d.ts","sourceRoot":"","sources":["../../../src/converter/graph_to_netlist/graph_converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EAIhB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AAE3D,qBAAa,cAAc;IACN,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,0BAA0B;IAEnD,kBAAkB,IAAI,UAAU;CA4ExC"}
1
+ {"version":3,"file":"graph_converter.d.ts","sourceRoot":"","sources":["../../../src/converter/graph_to_netlist/graph_converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EAIhB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEnD,qBAAa,cAAc;IACN,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,kBAAkB;IAE3C,kBAAkB,IAAI,UAAU;CA4ExC"}
@@ -1 +1 @@
1
- {"version":3,"file":"collect_sub_sheets.d.ts","sourceRoot":"","sources":["../../src/utils/collect_sub_sheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGxE,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,EAAE,cAAc;;;;GAsC7G"}
1
+ {"version":3,"file":"collect_sub_sheets.d.ts","sourceRoot":"","sources":["../../src/utils/collect_sub_sheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGxE,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,EAAE,cAAc;;;;GA+C7G"}
@@ -72,7 +72,7 @@ var __read = (this && this.__read) || function (o, n) {
72
72
  }
73
73
  return ar;
74
74
  };
75
- import { parse_module_name, remove_filename_path_prefix, unzipFile } from '@modular-circuit/utils';
75
+ import { KICAD_SHC_FILE_EXT, parse_module_name, remove_filename_path_prefix, unzipFile } from '@modular-circuit/utils';
76
76
  export function collect_sub_sheets(dependencies, module_resolver) {
77
77
  return __awaiter(this, void 0, void 0, function () {
78
78
  var sheets, module_main_sheet, modules, _a, _b, _c, k, v, zip_achieve_url, module_1, zip_achieve, files, _d, _e, _f, name, content, fileName, e_1_1;
@@ -97,10 +97,14 @@ export function collect_sub_sheets(dependencies, module_resolver) {
97
97
  return [4 /*yield*/, module_resolver.get_module_circuit(__assign(__assign({}, parse_module_name(k)), { version: v }))];
98
98
  case 4:
99
99
  module_1 = _j.sent();
100
- if (!zip_achieve_url || !module_1)
101
- throw new Error("Module ".concat(k, "/").concat(v, " not found"));
102
- if (!module_1.main)
103
- throw new Error("Missing main entry in module ".concat(k, "/").concat(v));
100
+ if (!zip_achieve_url || !module_1) {
101
+ console.error("Module ".concat(k, "/").concat(v, " not found"));
102
+ return [3 /*break*/, 7];
103
+ }
104
+ if (!module_1.main) {
105
+ console.error("Missing main entry in module ".concat(k, "/").concat(v));
106
+ return [3 /*break*/, 7];
107
+ }
104
108
  module_main_sheet[k] = module_1.main;
105
109
  modules[k] = module_1;
106
110
  return [4 /*yield*/, fetch(zip_achieve_url).then(function (res) { return res.arrayBuffer(); })];
@@ -112,11 +116,13 @@ export function collect_sub_sheets(dependencies, module_resolver) {
112
116
  try {
113
117
  for (_d = (e_2 = void 0, __values(Object.entries(files))), _e = _d.next(); !_e.done; _e = _d.next()) {
114
118
  _f = __read(_e.value, 2), name = _f[0], content = _f[1];
115
- if (name.endsWith('.kicad_sch')) {
119
+ if (name.endsWith(KICAD_SHC_FILE_EXT)) {
116
120
  fileName = remove_filename_path_prefix(name);
117
- // FIXME
118
- if (fileName in sheets)
119
- throw new Error("Duplicate sheet name: ".concat(fileName));
121
+ // FIXME : Should auto rename the sheets and remapping them
122
+ if (fileName in sheets) {
123
+ console.error("Duplicate sheet name: ".concat(fileName));
124
+ continue;
125
+ }
120
126
  sheets[fileName] = content;
121
127
  }
122
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-circuit/transpiler",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "description": "Intermediate representation of the modular circuit",
5
5
  "main": "./build/index.js",
6
6
  "files": [
@@ -29,7 +29,7 @@
29
29
  "@modular-circuit/ir": "0.0.58",
30
30
  "@modular-circuit/perc": "0.0.58",
31
31
  "@modular-circuit/electronics-model": "0.0.50",
32
- "@modular-circuit/utils": "0.0.36"
32
+ "@modular-circuit/utils": "0.0.37"
33
33
  },
34
34
  "scripts": {
35
35
  "clean": "rimraf build",