@modular-circuit/packager 0.0.16

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-current Alberto Schiabel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Modular Circuit Runtime
2
+
3
+ Runtime for Modular Circuit
@@ -0,0 +1,6 @@
1
+ import type { IR_Graph } from '@modular-circuit/ir';
2
+ /**
3
+ * 设计的扁平化表示
4
+ */
5
+ export type FlatDesign = Record<string, IR_Graph>;
6
+ //# sourceMappingURL=flat_design.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat_design.d.ts","sourceRoot":"","sources":["../src/flat_design.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA"}
File without changes
@@ -0,0 +1,30 @@
1
+ import type { ModuleIndex, Project } from '@modular-circuit/ir';
2
+ import type { ERC_REPORT, ERC_SETTING } from '@modular-circuit/perc';
3
+ import type { FlatDesign } from './flat_design';
4
+ export interface I_Packager {
5
+ /**
6
+ * 项目信息
7
+ */
8
+ project: Project;
9
+ /**
10
+ * ERC检查设置
11
+ */
12
+ erc_settings: ERC_SETTING;
13
+ /**
14
+ * 对项目执行ERC检查
15
+ */
16
+ erc(designs: FlatDesign): Promise<ERC_REPORT>;
17
+ /**
18
+ * 将项目转换为kicad项目
19
+ */
20
+ convert_to_kicad(designs: FlatDesign): Promise<Error[] | true>;
21
+ /**
22
+ * 添加模块至项目依赖
23
+ */
24
+ add_module_dependency(deps: ModuleIndex): void;
25
+ /**
26
+ *获取模块的依赖列表
27
+ */
28
+ get_module_dependencies(): ModuleIndex[];
29
+ }
30
+ //# sourceMappingURL=i_packager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i_packager.d.ts","sourceRoot":"","sources":["../src/i_packager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,YAAY,EAAE,WAAW,CAAA;IAEzB;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE7C;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAA;IAE9D;;OAEG;IACH,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAE9C;;OAEG;IACH,uBAAuB,IAAI,WAAW,EAAE,CAAA;CACzC"}
File without changes
@@ -0,0 +1,5 @@
1
+ export * from './flat_design';
2
+ export * from './i_packager';
3
+ export * from './packager';
4
+ export * from './packager_wrapper';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
package/build/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from './flat_design';
2
+ export * from './i_packager';
3
+ export * from './packager';
4
+ export * from './packager_wrapper';
@@ -0,0 +1,41 @@
1
+ {
2
+ "markers": [
3
+ {
4
+ "uuid": "12345678-1234-1234-1234-123456789abc",
5
+ "pos": {
6
+ "x": 100,
7
+ "y": 200
8
+ },
9
+ "maker_type": "ERC_ERROR",
10
+ "excluded": false,
11
+ "comment": "This is a comment for the marker.",
12
+ "severity": "ERROR",
13
+ "rc_item_id": "33345678-1234-1234-1234-123456789abc",
14
+ "bounding_box": {
15
+ "min": {
16
+ "x": 50,
17
+ "y": 150
18
+ },
19
+ "max": {
20
+ "x": 150,
21
+ "y": 250
22
+ }
23
+ }
24
+ }
25
+ ],
26
+ "erc_errors": [
27
+ {
28
+ "sheet_specific": true,
29
+ "sheet_specific_path": "/sheets/sheet1",
30
+ "main_item_sheet_path": "/sheets/sheet1/items/item1",
31
+ "aux_item_sheet_path": "/sheets/sheet1/items/item2",
32
+ "eda_item_ids": ["12345678-1234-1234-1234-123456789ab1", "12345678-1234-1234-1234-123456789abe"],
33
+ "error_code": 1001,
34
+ "error_message": "An error occurred due to reason X.",
35
+ "error_title": "Error Title",
36
+ "setting_key": "error.setting.key",
37
+ "parent_id": "12345678-1234-1234-1234-123456789abc",
38
+ "uuid": "33345678-1234-1234-1234-123456789abc"
39
+ }
40
+ ]
41
+ }
@@ -0,0 +1,76 @@
1
+ declare const ERC_REPORT_SAMPLE: Promise<{
2
+ default: {
3
+ markers: {
4
+ uuid: string;
5
+ pos: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ maker_type: string;
10
+ excluded: boolean;
11
+ comment: string;
12
+ severity: string;
13
+ rc_item_id: string;
14
+ bounding_box: {
15
+ min: {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ max: {
20
+ x: number;
21
+ y: number;
22
+ };
23
+ };
24
+ }[];
25
+ erc_errors: {
26
+ sheet_specific: boolean;
27
+ sheet_specific_path: string;
28
+ main_item_sheet_path: string;
29
+ aux_item_sheet_path: string;
30
+ eda_item_ids: string[];
31
+ error_code: number;
32
+ error_message: string;
33
+ error_title: string;
34
+ setting_key: string;
35
+ parent_id: string;
36
+ uuid: string;
37
+ }[];
38
+ };
39
+ markers: {
40
+ uuid: string;
41
+ pos: {
42
+ x: number;
43
+ y: number;
44
+ };
45
+ maker_type: string;
46
+ excluded: boolean;
47
+ comment: string;
48
+ severity: string;
49
+ rc_item_id: string;
50
+ bounding_box: {
51
+ min: {
52
+ x: number;
53
+ y: number;
54
+ };
55
+ max: {
56
+ x: number;
57
+ y: number;
58
+ };
59
+ };
60
+ }[];
61
+ erc_errors: {
62
+ sheet_specific: boolean;
63
+ sheet_specific_path: string;
64
+ main_item_sheet_path: string;
65
+ aux_item_sheet_path: string;
66
+ eda_item_ids: string[];
67
+ error_code: number;
68
+ error_message: string;
69
+ error_title: string;
70
+ setting_key: string;
71
+ parent_id: string;
72
+ uuid: string;
73
+ }[];
74
+ }>;
75
+ export { ERC_REPORT_SAMPLE };
76
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mock/error_report/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ var ERC_REPORT_SAMPLE = import('./erc_report_sample.json');
2
+ export { ERC_REPORT_SAMPLE };
@@ -0,0 +1,3 @@
1
+ export * from './error_report';
2
+ export * from './module_bom';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mock/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './error_report';
2
+ export * from './module_bom';
@@ -0,0 +1,4 @@
1
+ import type { ModuleBom } from '@modular-circuit/ir';
2
+ declare const ModuleBOM: Promise<ModuleBom>;
3
+ export { ModuleBOM };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mock/module_bom/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,QAAA,MAAM,SAAS,EAAkC,OAAO,CAAC,SAAS,CAAC,CAAA;AAEnE,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ var ModuleBOM = import('./module_bom.json');
2
+ export { ModuleBOM };
@@ -0,0 +1,123 @@
1
+ {
2
+ "PowerModule": [
3
+ {
4
+ "Designator": "U1",
5
+ "Type": "Regulator",
6
+ "MPN": "LM7805CT",
7
+ "Manufacturer": "Texas Instruments",
8
+ "Value": "5V",
9
+ "Description": "5V voltage regulator",
10
+ "Category": "Active",
11
+ "Package": "TO-220",
12
+ "Lifecycle": "Active",
13
+ "Footprint": "",
14
+ "Datasheet": "",
15
+ "component": {
16
+ "Type": "Regulator",
17
+ "MPN": "LM7805CT",
18
+ "Manufacturer": "Texas Instruments",
19
+ "Value": "5V",
20
+ "Description": "5V voltage regulator",
21
+ "Category": "Active",
22
+ "Package": "TO-220",
23
+ "Lifecycle": "Active",
24
+ "Footprint": "",
25
+ "Datasheet": ""
26
+ },
27
+ "alternatives": [
28
+ {
29
+ "Type": "Regulator",
30
+ "MPN": "KA7805ETU",
31
+ "Manufacturer": "ON Semiconductor",
32
+ "Value": "5V",
33
+ "Description": "5V voltage regulator alternative",
34
+ "Category": "Active",
35
+ "Package": "TO-220",
36
+ "Lifecycle": "Active",
37
+ "Footprint": "",
38
+ "Datasheet": ""
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "Designator": "C1",
44
+ "Type": "Capacitor",
45
+ "MPN": "CL21A106KAYNNNE",
46
+ "Manufacturer": "Samsung",
47
+ "Value": "10µF",
48
+ "Description": "10µF ceramic capacitor",
49
+ "Category": "Passive",
50
+ "Package": "1206",
51
+ "Lifecycle": "Active",
52
+ "Footprint": "",
53
+ "Datasheet": "",
54
+ "component": {
55
+ "Type": "Capacitor",
56
+ "MPN": "CL21A106KAYNNNE",
57
+ "Manufacturer": "Samsung",
58
+ "Value": "10µF",
59
+ "Description": "10µF ceramic capacitor",
60
+ "Category": "Passive",
61
+ "Package": "1206",
62
+ "Lifecycle": "Active",
63
+ "Footprint": "",
64
+ "Datasheet": ""
65
+ },
66
+ "alternatives": [
67
+ {
68
+ "Type": "Capacitor",
69
+ "MPN": "GRM31CR71E106KA12L",
70
+ "Manufacturer": "Murata",
71
+ "Value": "10µF",
72
+ "Description": "Murata 10µF capacitor alternative",
73
+ "Category": "Passive",
74
+ "Package": "1206",
75
+ "Lifecycle": "Active",
76
+ "Footprint": "",
77
+ "Datasheet": ""
78
+ }
79
+ ]
80
+ }
81
+ ],
82
+ "MicrocontrollerModule": [
83
+ {
84
+ "Designator": "U2",
85
+ "Type": "Microcontroller",
86
+ "MPN": "ATmega328P-AU",
87
+ "Manufacturer": "Microchip",
88
+ "Value": "32KB Flash",
89
+ "Description": "8-bit AVR microcontroller",
90
+ "Category": "Active",
91
+ "Package": "TQFP-32",
92
+ "Lifecycle": "Active",
93
+ "Footprint": "",
94
+ "Datasheet": "",
95
+ "component": {
96
+ "Type": "Microcontroller",
97
+ "MPN": "ATmega328P-AU",
98
+ "Manufacturer": "Microchip",
99
+ "Value": "32KB Flash",
100
+ "Description": "8-bit AVR microcontroller",
101
+ "Category": "Active",
102
+ "Package": "TQFP-32",
103
+ "Lifecycle": "Active",
104
+ "Footprint": "",
105
+ "Datasheet": ""
106
+ },
107
+ "alternatives": [
108
+ {
109
+ "Type": "Microcontroller",
110
+ "MPN": "PIC16F877A-I/PT",
111
+ "Manufacturer": "Microchip",
112
+ "Value": "14KB Flash",
113
+ "Description": "PIC16 microcontroller alternative",
114
+ "Category": "Active",
115
+ "Package": "TQFP-44",
116
+ "Lifecycle": "Active",
117
+ "Footprint": "",
118
+ "Datasheet": ""
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ }
@@ -0,0 +1,22 @@
1
+ import type { Project } from '@modular-circuit/ir';
2
+ import type { ModuleIndex, ModuleResolver } from '@modular-circuit/ir';
3
+ import type { ERC_REPORT, ERC_SETTING } from '@modular-circuit/perc';
4
+ import type { FlatDesign } from './flat_design';
5
+ import type { I_Packager } from './i_packager';
6
+ export interface PackagerContext {
7
+ project: Project;
8
+ module_resolver: ModuleResolver;
9
+ erc_settings: ERC_SETTING;
10
+ }
11
+ export declare class Packager implements I_Packager {
12
+ project: Project;
13
+ erc_settings: ERC_SETTING;
14
+ private module_resolver;
15
+ private constructor();
16
+ add_module_dependency(deps: ModuleIndex): void;
17
+ get_module_dependencies(): ModuleIndex[];
18
+ erc(_designs: FlatDesign): Promise<ERC_REPORT>;
19
+ convert_to_kicad(_designs: FlatDesign): Promise<Error[] | true>;
20
+ static create_new_pkg(ctx: PackagerContext): Packager;
21
+ }
22
+ //# sourceMappingURL=packager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../src/packager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,EAAE,cAAc,CAAA;IAC/B,YAAY,EAAE,WAAW,CAAA;CAC1B;AAED,qBAAa,QAAS,YAAW,UAAU;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,WAAW,CAAA;IAChC,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO;IAMP,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAG9C,uBAAuB,IAAI,WAAW,EAAE;IAMlC,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAG9C,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC;IAIrE,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,eAAe;CAG3C"}
@@ -0,0 +1,83 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { fmt_module_name, parse_module_name } from '@modular-circuit/utils';
49
+ var Packager = /** @class */ (function () {
50
+ function Packager(ctx) {
51
+ this.project = ctx.project;
52
+ this.module_resolver = ctx.module_resolver;
53
+ this.erc_settings = ctx.erc_settings;
54
+ }
55
+ Packager.prototype.add_module_dependency = function (deps) {
56
+ this.project.dependencies[fmt_module_name(deps)] = deps.version;
57
+ };
58
+ Packager.prototype.get_module_dependencies = function () {
59
+ var _this = this;
60
+ return Object.keys(this.project.dependencies).map(function (v) {
61
+ return __assign(__assign({}, parse_module_name(v)), { version: _this.project.dependencies[v] });
62
+ });
63
+ };
64
+ Packager.prototype.erc = function (_designs) {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ return __generator(this, function (_a) {
67
+ return [2 /*return*/, { erc_errors: [], markers: [] }];
68
+ });
69
+ });
70
+ };
71
+ Packager.prototype.convert_to_kicad = function (_designs) {
72
+ return __awaiter(this, void 0, void 0, function () {
73
+ return __generator(this, function (_a) {
74
+ throw new Error('Method not implemented.');
75
+ });
76
+ });
77
+ };
78
+ Packager.create_new_pkg = function (ctx) {
79
+ return new Packager(ctx);
80
+ };
81
+ return Packager;
82
+ }());
83
+ export { Packager };
@@ -0,0 +1,6 @@
1
+ import type { FlatDesign } from './flat_design';
2
+ import { type PackagerContext } from './packager';
3
+ export type I_PackagerContext = Omit<PackagerContext, 'erc_settings'>;
4
+ export declare function erc(ctx: I_PackagerContext, designs: FlatDesign): Promise<import("@modular-circuit/perc").ERC_REPORT>;
5
+ export declare function convert_to_kicad(ctx: I_PackagerContext, designs: FlatDesign): Promise<true | Error[]>;
6
+ //# sourceMappingURL=packager_wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packager_wrapper.d.ts","sourceRoot":"","sources":["../src/packager_wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAA;AAErE,wBAAgB,GAAG,CAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,EAAE,UAAU,uDAK9D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,EAAE,UAAU,2BAK3E"}
@@ -0,0 +1,19 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { DEFAULT_ERC_SETTING } from '@modular-circuit/perc';
13
+ import { Packager } from './packager';
14
+ export function erc(ctx, designs) {
15
+ return Packager.create_new_pkg(__assign(__assign({}, ctx), { erc_settings: DEFAULT_ERC_SETTING })).erc(designs);
16
+ }
17
+ export function convert_to_kicad(ctx, designs) {
18
+ return Packager.create_new_pkg(__assign(__assign({}, ctx), { erc_settings: DEFAULT_ERC_SETTING })).convert_to_kicad(designs);
19
+ }
@@ -0,0 +1 @@
1
+ {"root":["../src/flat_design.ts","../src/i_packager.ts","../src/index.ts","../src/packager.ts","../src/packager_wrapper.ts","../src/mock/index.ts","../src/mock/error_report/index.ts","../src/mock/module_bom/index.ts"],"version":"5.8.3"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@modular-circuit/packager",
3
+ "version": "0.0.16",
4
+ "description": "Intermediate representation of the modular circuit",
5
+ "main": "./build/index.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./build/index.js",
9
+ "require": "./build/index.js",
10
+ "types": "./build/index.d.ts"
11
+ }
12
+ },
13
+ "files": [
14
+ "build"
15
+ ],
16
+ "keywords": [],
17
+ "author": "",
18
+ "license": "ISC",
19
+ "devDependencies": {
20
+ "@biomejs/biome": "^1.8.3",
21
+ "esbuild": "^0.20.2",
22
+ "tsup": "^8.3.0",
23
+ "typescript": "^5.4.5"
24
+ },
25
+ "dependencies": {
26
+ "@modular-circuit/ir": "0.0.51",
27
+ "@modular-circuit/utils": "0.0.29",
28
+ "@modular-circuit/perc": "0.0.51"
29
+ },
30
+ "scripts": {
31
+ "clean": "rimraf build",
32
+ "prebuild": "pnpm clean",
33
+ "build": "tsc --build tsconfig.build.json",
34
+ "lint:ci": "biome ci",
35
+ "lint": "biome check --fix --unsafe",
36
+ "test:unit": "vitest --workspace ../../vitest.workspace.ts --project unit run"
37
+ }
38
+ }