@modular-circuit/transpiler 0.0.76 → 0.0.77

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 (34) hide show
  1. package/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.js +19 -108
  2. package/build/builder/graph_to_kicad/index.js +4 -59
  3. package/build/converter/graph_to_netlist/graph_converter.js +51 -171
  4. package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.js +1 -1
  5. package/build/converter/kicad_sexpr/eeschema/printer.js +245 -290
  6. package/build/converter/link_to_netlist/converter.js +77 -135
  7. package/build/converter/link_to_netlist/links/converter_base.js +38 -131
  8. package/build/converter/link_to_netlist/links/converters.js +316 -554
  9. package/build/converter/netlist_to_kicad/calc_boxes_pos.d.ts +1 -1
  10. package/build/converter/netlist_to_kicad/calc_boxes_pos.d.ts.map +1 -1
  11. package/build/converter/netlist_to_kicad/calc_boxes_pos.js +36 -101
  12. package/build/converter/netlist_to_kicad/layout.js +28 -32
  13. package/build/converter/netlist_to_kicad/netlist_converter.d.ts +1 -1
  14. package/build/converter/netlist_to_kicad/netlist_converter.d.ts.map +1 -1
  15. package/build/converter/netlist_to_kicad/netlist_converter.js +128 -300
  16. package/build/kicad/constraints/index.js +1 -1
  17. package/build/kicad/label/net_label.js +2 -2
  18. package/build/kicad/label/sheet_pin.js +11 -19
  19. package/build/kicad/project/kicad_prl.js +3 -3
  20. package/build/kicad/project/kicad_pro.js +4 -4
  21. package/build/kicad/project/kicad_project_achieve.js +31 -45
  22. package/build/kicad/project/wildcards_and_files_ext.js +61 -61
  23. package/build/kicad/sheet/sheet.js +3 -3
  24. package/build/kicad/symbols/lib_symbol/gnd.js +6 -6
  25. package/build/kicad/symbols/lib_symbol/vcc.js +7 -7
  26. package/build/kicad/symbols/sch_symbol/gnd.js +9 -9
  27. package/build/kicad/symbols/sch_symbol/vcc.js +9 -9
  28. package/build/kicad/symbols/symbol_utils.js +1 -1
  29. package/build/kicad/wire/gen_wire.js +4 -4
  30. package/build/utils/collect_sub_sheets.js +37 -151
  31. package/build/utils/constraints.js +6 -6
  32. package/build/utils/filter_null_undefined.js +2 -31
  33. package/build/utils/string_formatter.js +23 -29
  34. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  // millimeters
2
- export var PAPER_SIZE = {
2
+ export const PAPER_SIZE = {
3
3
  A0: { width: 841, height: 1189 },
4
4
  A1: { width: 594, height: 841 },
5
5
  A2: { width: 420, height: 594 },
@@ -10,8 +10,8 @@ export var PAPER_SIZE = {
10
10
  A7: { width: 74, height: 105 },
11
11
  A8: { width: 52, height: 74 },
12
12
  };
13
- export var DEFAULT_PAPER_SIZE = PAPER_SIZE.A4;
14
- export var GENERATOR_NAME = 'modular_circuit';
15
- export var SCH_VERSION = 20231120;
16
- export var PAPER = 'A4';
17
- export var GENERATOR_VERSION = '8.0';
13
+ export const DEFAULT_PAPER_SIZE = PAPER_SIZE.A4;
14
+ export const GENERATOR_NAME = 'modular_circuit';
15
+ export const SCH_VERSION = 20231120;
16
+ export const PAPER = 'A4';
17
+ export const GENERATOR_VERSION = '8.0';
@@ -1,38 +1,9 @@
1
- var __read = (this && this.__read) || function (o, n) {
2
- var m = typeof Symbol === "function" && o[Symbol.iterator];
3
- if (!m) return o;
4
- var i = m.call(o), r, ar = [], e;
5
- try {
6
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
- }
8
- catch (error) { e = { error: error }; }
9
- finally {
10
- try {
11
- if (r && !r.done && (m = i["return"])) m.call(i);
12
- }
13
- finally { if (e) throw e.error; }
14
- }
15
- return ar;
16
- };
17
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
- if (ar || !(i in from)) {
20
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
- ar[i] = from[i];
22
- }
23
- }
24
- return to.concat(ar || Array.prototype.slice.call(from));
25
- };
26
1
  export function filterNullOrUndefined(originalMethod, _context) {
27
- function replacementMethod() {
28
- var args = [];
29
- for (var _i = 0; _i < arguments.length; _i++) {
30
- args[_i] = arguments[_i];
31
- }
2
+ function replacementMethod(...args) {
32
3
  if (args.length === 0 || (args.length === 1 && (args[0] === undefined || args[0] === null)))
33
4
  return '';
34
5
  // @ts-ignore
35
- var result = originalMethod.call.apply(originalMethod, __spreadArray([this], __read(args), false));
6
+ const result = originalMethod.call(this, ...args);
36
7
  return result;
37
8
  }
38
9
  return replacementMethod;
@@ -1,35 +1,29 @@
1
- export var tab = '\t';
2
- var StringFormatter = /** @class */ (function () {
3
- function StringFormatter(intend) {
4
- if (intend === void 0) { intend = 0; }
1
+ export const tab = '\t';
2
+ export class StringFormatter {
3
+ intend;
4
+ content = '';
5
+ constructor(intend = 0) {
5
6
  this.intend = intend;
6
- this.content = '';
7
7
  }
8
- StringFormatter.prototype.toString = function () {
8
+ toString() {
9
9
  return this.content;
10
- };
11
- Object.defineProperty(StringFormatter.prototype, "intend_level", {
12
- get: function () {
13
- return this.intend;
14
- },
15
- enumerable: false,
16
- configurable: true
17
- });
18
- StringFormatter.prototype.enter_scope = function () {
10
+ }
11
+ get intend_level() {
12
+ return this.intend;
13
+ }
14
+ enter_scope() {
19
15
  this.intend += 1;
20
- };
21
- StringFormatter.prototype.exit_scope = function () {
16
+ }
17
+ exit_scope() {
22
18
  this.intend -= 1;
23
- };
24
- StringFormatter.prototype.append = function (str) {
19
+ }
20
+ append(str) {
25
21
  this.content += str;
26
- };
27
- StringFormatter.prototype.append_line = function (str) {
28
- this.content += "".concat(tab.repeat(this.intend)).concat(str);
29
- };
30
- StringFormatter.prototype.append_quote = function (str) {
31
- this.append("\"".concat(str, "\""));
32
- };
33
- return StringFormatter;
34
- }());
35
- export { StringFormatter };
22
+ }
23
+ append_line(str) {
24
+ this.content += `${tab.repeat(this.intend)}${str}`;
25
+ }
26
+ append_quote(str) {
27
+ this.append(`"${str}"`);
28
+ }
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-circuit/transpiler",
3
- "version": "0.0.76",
3
+ "version": "0.0.77",
4
4
  "description": "Intermediate representation of the modular circuit",
5
5
  "main": "./build/index.js",
6
6
  "files": [
@@ -27,10 +27,10 @@
27
27
  "js-base64": "^3.7.7",
28
28
  "jszip": "^3.10.1",
29
29
  "yoga-layout": "^3.2.1",
30
- "@modular-circuit/electronics-model": "0.0.51",
31
- "@modular-circuit/perc": "0.0.58",
32
- "@modular-circuit/utils": "0.0.37",
33
- "@modular-circuit/ir": "0.0.58"
30
+ "@modular-circuit/electronics-model": "0.0.52",
31
+ "@modular-circuit/ir": "0.0.59",
32
+ "@modular-circuit/perc": "0.0.59",
33
+ "@modular-circuit/utils": "0.0.38"
34
34
  },
35
35
  "scripts": {
36
36
  "clean": "rimraf build",