@modular-circuit/transpiler 0.0.59 → 0.0.61
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/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.js +15 -12
- package/build/builder/graph_to_kicad/index.js +8 -5
- package/build/builder/index.js +5 -1
- package/build/converter/graph_to_netlist/context.js +2 -0
- package/build/converter/graph_to_netlist/graph_converter.js +9 -5
- package/build/converter/graph_to_netlist/index.js +18 -2
- package/build/converter/index.js +19 -3
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/index.js +7 -4
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.js +4 -1
- package/build/converter/kicad_sexpr/eeschema/index.js +18 -2
- package/build/converter/kicad_sexpr/eeschema/printer.js +28 -24
- package/build/converter/kicad_sexpr/index.js +18 -2
- package/build/converter/kicad_sexpr/pcb/index.js +2 -1
- package/build/converter/link_to_netlist/context.js +2 -0
- package/build/converter/link_to_netlist/converter.js +35 -31
- package/build/converter/link_to_netlist/index.js +18 -2
- package/build/converter/link_to_netlist/links/converter_base.js +9 -3
- package/build/converter/link_to_netlist/links/converters.js +54 -39
- package/build/converter/link_to_netlist/links/index.js +18 -2
- package/build/converter/netlist_to_kicad/context.js +2 -0
- package/build/converter/netlist_to_kicad/index.js +19 -3
- package/build/converter/netlist_to_kicad/layout.js +11 -6
- package/build/converter/netlist_to_kicad/netlist_converter.js +32 -28
- package/build/index.js +21 -5
- package/build/kicad/constraints/index.js +4 -1
- package/build/kicad/label/index.js +18 -2
- package/build/kicad/label/net_label.js +9 -5
- package/build/kicad/label/sheet_pin.js +10 -6
- package/build/kicad/project/index.js +18 -2
- package/build/kicad/project/kicad_prl.js +5 -1
- package/build/kicad/project/kicad_pro.js +7 -3
- package/build/kicad/project/kicad_project_achieve.js +18 -14
- package/build/kicad/project/wildcards_and_files_ext.js +65 -61
- package/build/kicad/sheet/index.js +17 -1
- package/build/kicad/sheet/sheet.js +10 -6
- package/build/kicad/symbols/index.js +18 -2
- package/build/kicad/symbols/lib_symbol/gnd.js +19 -15
- package/build/kicad/symbols/lib_symbol/index.js +18 -2
- package/build/kicad/symbols/lib_symbol/vcc.js +19 -15
- package/build/kicad/symbols/sch_symbol/gnd.js +15 -11
- package/build/kicad/symbols/sch_symbol/index.js +18 -2
- package/build/kicad/symbols/sch_symbol/vcc.js +15 -11
- package/build/kicad/symbols/symbol_utils.js +5 -1
- package/build/utils/collect_sub_sheets.js +9 -6
- package/build/utils/constraints.js +9 -6
- package/build/utils/filter_null_undefined.js +4 -1
- package/build/utils/index.js +20 -4
- package/build/utils/string_formatter.js +7 -3
- package/package.json +5 -5
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gen_sch_vcc = void 0;
|
|
4
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
5
|
+
const constraints_1 = require("../../constraints");
|
|
6
|
+
const symbol_utils_1 = require("../symbol_utils");
|
|
7
|
+
const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
5
8
|
lib_id: `power:${value}`,
|
|
6
9
|
at: { position, rotation: 0 },
|
|
7
10
|
unit: 1,
|
|
@@ -10,14 +13,14 @@ export const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
|
10
13
|
on_board: true,
|
|
11
14
|
dnp: false,
|
|
12
15
|
fields_autoplaced: true,
|
|
13
|
-
uuid: gen_uuid(),
|
|
16
|
+
uuid: (0, utils_1.gen_uuid)(),
|
|
14
17
|
properties: [
|
|
15
18
|
{
|
|
16
19
|
name: 'Reference',
|
|
17
|
-
text: gen_pwr_ref(pwr_number),
|
|
20
|
+
text: (0, symbol_utils_1.gen_pwr_ref)(pwr_number),
|
|
18
21
|
at: { position: { x: position.x, y: position.y + 3.81 }, rotation: 0 },
|
|
19
22
|
effects: {
|
|
20
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
23
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
21
24
|
hide: true,
|
|
22
25
|
},
|
|
23
26
|
},
|
|
@@ -26,7 +29,7 @@ export const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
|
26
29
|
text: `${value}`,
|
|
27
30
|
at: { position: { x: position.x, y: position.y - 5.08 }, rotation: 0 },
|
|
28
31
|
effects: {
|
|
29
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
32
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
30
33
|
},
|
|
31
34
|
},
|
|
32
35
|
{
|
|
@@ -34,7 +37,7 @@ export const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
|
34
37
|
text: '',
|
|
35
38
|
at: { position, rotation: 0 },
|
|
36
39
|
effects: {
|
|
37
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
40
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
38
41
|
hide: true,
|
|
39
42
|
},
|
|
40
43
|
},
|
|
@@ -43,7 +46,7 @@ export const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
|
43
46
|
text: '',
|
|
44
47
|
at: { position, rotation: 0 },
|
|
45
48
|
effects: {
|
|
46
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
49
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
47
50
|
hide: true,
|
|
48
51
|
},
|
|
49
52
|
},
|
|
@@ -52,7 +55,7 @@ export const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
|
52
55
|
text: `Power symbol creates a global label with name \\"${value}\\"`,
|
|
53
56
|
at: { position, rotation: 0 },
|
|
54
57
|
effects: {
|
|
55
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
58
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
56
59
|
hide: true,
|
|
57
60
|
},
|
|
58
61
|
},
|
|
@@ -64,3 +67,4 @@ export const gen_sch_vcc = (value, pwr_number, port_id, position) => ({
|
|
|
64
67
|
},
|
|
65
68
|
],
|
|
66
69
|
});
|
|
70
|
+
exports.gen_sch_vcc = gen_sch_vcc;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collect_sub_sheets = collect_sub_sheets;
|
|
4
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
5
|
+
async function collect_sub_sheets(dependencies, module_resolver) {
|
|
3
6
|
const sheets = {};
|
|
4
7
|
const module_main_sheet = {};
|
|
5
8
|
const modules = {};
|
|
6
9
|
for (const [k, v] of Object.entries(dependencies)) {
|
|
7
10
|
// Get the URL for the ZIP archive
|
|
8
11
|
const zip_achieve_url = await module_resolver.get_module_achieve({
|
|
9
|
-
...parse_module_name(k),
|
|
12
|
+
...(0, utils_1.parse_module_name)(k),
|
|
10
13
|
version: v,
|
|
11
14
|
});
|
|
12
15
|
const module = await module_resolver.get_module_circuit({
|
|
13
|
-
...parse_module_name(k),
|
|
16
|
+
...(0, utils_1.parse_module_name)(k),
|
|
14
17
|
version: v,
|
|
15
18
|
});
|
|
16
19
|
if (!zip_achieve_url || !module)
|
|
@@ -21,10 +24,10 @@ export async function collect_sub_sheets(dependencies, module_resolver) {
|
|
|
21
24
|
modules[k] = module;
|
|
22
25
|
// Fetch the ZIP archive
|
|
23
26
|
const zip_achieve = await fetch(zip_achieve_url).then((res) => res.arrayBuffer());
|
|
24
|
-
const files = await unzipFile(zip_achieve);
|
|
27
|
+
const files = await (0, utils_1.unzipFile)(zip_achieve);
|
|
25
28
|
for (const [name, content] of Object.entries(files)) {
|
|
26
29
|
if (name.endsWith('.kicad_sch')) {
|
|
27
|
-
const fileName = remove_filename_path_prefix(name);
|
|
30
|
+
const fileName = (0, utils_1.remove_filename_path_prefix)(name);
|
|
28
31
|
// FIXME
|
|
29
32
|
if (fileName in sheets)
|
|
30
33
|
throw new Error(`Duplicate sheet name: ${fileName}`);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// millimeters
|
|
2
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GENERATOR_VERSION = exports.PAPER = exports.SCH_VERSION = exports.GENERATOR_NAME = exports.DEFAULT_PAPER_SIZE = exports.PAPER_SIZE = void 0;
|
|
5
|
+
exports.PAPER_SIZE = {
|
|
3
6
|
A0: { width: 841, height: 1189 },
|
|
4
7
|
A1: { width: 594, height: 841 },
|
|
5
8
|
A2: { width: 420, height: 594 },
|
|
@@ -10,8 +13,8 @@ export const PAPER_SIZE = {
|
|
|
10
13
|
A7: { width: 74, height: 105 },
|
|
11
14
|
A8: { width: 52, height: 74 },
|
|
12
15
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
exports.DEFAULT_PAPER_SIZE = exports.PAPER_SIZE.A4;
|
|
17
|
+
exports.GENERATOR_NAME = 'modular_circuit';
|
|
18
|
+
exports.SCH_VERSION = 20231120;
|
|
19
|
+
exports.PAPER = 'A4';
|
|
20
|
+
exports.GENERATOR_VERSION = '8.0';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterNullOrUndefined = filterNullOrUndefined;
|
|
4
|
+
function filterNullOrUndefined(originalMethod, _context) {
|
|
2
5
|
function replacementMethod(...args) {
|
|
3
6
|
if (args.length === 0 || (args.length === 1 && (args[0] === undefined || args[0] === null)))
|
|
4
7
|
return '';
|
package/build/utils/index.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./collect_sub_sheets"), exports);
|
|
18
|
+
__exportStar(require("./constraints"), exports);
|
|
19
|
+
__exportStar(require("./filter_null_undefined"), exports);
|
|
20
|
+
__exportStar(require("./string_formatter"), exports);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringFormatter = exports.tab = void 0;
|
|
4
|
+
exports.tab = '\t';
|
|
5
|
+
class StringFormatter {
|
|
3
6
|
intend;
|
|
4
7
|
content = '';
|
|
5
8
|
constructor(intend = 0) {
|
|
@@ -21,9 +24,10 @@ export class StringFormatter {
|
|
|
21
24
|
this.content += str;
|
|
22
25
|
}
|
|
23
26
|
append_line(str) {
|
|
24
|
-
this.content += `${tab.repeat(this.intend)}${str}`;
|
|
27
|
+
this.content += `${exports.tab.repeat(this.intend)}${str}`;
|
|
25
28
|
}
|
|
26
29
|
append_quote(str) {
|
|
27
30
|
this.append(`"${str}"`);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
exports.StringFormatter = StringFormatter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/transpiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"description": "Intermediate representation of the modular circuit",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"js-base64": "^3.7.7",
|
|
28
28
|
"jszip": "^3.10.1",
|
|
29
|
-
"@modular-circuit/ir": "0.0.
|
|
30
|
-
"@modular-circuit/
|
|
31
|
-
"@modular-circuit/
|
|
32
|
-
"@modular-circuit/utils": "0.0.
|
|
29
|
+
"@modular-circuit/ir": "0.0.54",
|
|
30
|
+
"@modular-circuit/perc": "0.0.54",
|
|
31
|
+
"@modular-circuit/electronics-model": "0.0.46",
|
|
32
|
+
"@modular-circuit/utils": "0.0.32"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"clean": "rimraf build",
|