@modular-circuit/transpiler 0.1.0 → 0.1.1
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -1
- package/dist/index.mjs +10 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -466,6 +466,7 @@ declare function collect_sub_sheets_by_id(module_ids: string[], module_resolver:
|
|
|
466
466
|
sheets: Record<string, string>;
|
|
467
467
|
module_main_sheet: Record<string, string>;
|
|
468
468
|
modules: Record<string, ModuleCircuit>;
|
|
469
|
+
boards: Record<string, string>;
|
|
469
470
|
}>;
|
|
470
471
|
|
|
471
472
|
declare const gen_lib_gnd: (value: string) => LIB_SYMBOL;
|
package/dist/index.d.ts
CHANGED
|
@@ -466,6 +466,7 @@ declare function collect_sub_sheets_by_id(module_ids: string[], module_resolver:
|
|
|
466
466
|
sheets: Record<string, string>;
|
|
467
467
|
module_main_sheet: Record<string, string>;
|
|
468
468
|
modules: Record<string, ModuleCircuit>;
|
|
469
|
+
boards: Record<string, string>;
|
|
469
470
|
}>;
|
|
470
471
|
|
|
471
472
|
declare const gen_lib_gnd: (value: string) => LIB_SYMBOL;
|
package/dist/index.js
CHANGED
|
@@ -286,6 +286,7 @@ var StringFormatter = class {
|
|
|
286
286
|
var import_utils2 = require("@modular-circuit/utils");
|
|
287
287
|
async function collect_sub_sheets_by_id(module_ids, module_resolver) {
|
|
288
288
|
const sheets = {};
|
|
289
|
+
const boards = {};
|
|
289
290
|
const module_main_sheet = {};
|
|
290
291
|
const modules = {};
|
|
291
292
|
for (const id of module_ids) {
|
|
@@ -316,10 +317,17 @@ async function collect_sub_sheets_by_id(module_ids, module_resolver) {
|
|
|
316
317
|
continue;
|
|
317
318
|
}
|
|
318
319
|
sheets[fileName] = content;
|
|
320
|
+
} else if (name.endsWith(import_utils2.KICAD_PCB_FILE_EXT)) {
|
|
321
|
+
const fileName = (0, import_utils2.remove_filename_path_prefix)(name);
|
|
322
|
+
if (fileName in boards) {
|
|
323
|
+
console.error(`Duplicate module name: ${fileName}`);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
boards[fileName] = content;
|
|
319
327
|
}
|
|
320
328
|
}
|
|
321
329
|
}
|
|
322
|
-
return { sheets, module_main_sheet, modules };
|
|
330
|
+
return { sheets, module_main_sheet, modules, boards };
|
|
323
331
|
}
|
|
324
332
|
|
|
325
333
|
// src/converter/kicad_sexpr/eeschema/printer.ts
|
package/dist/index.mjs
CHANGED
|
@@ -166,12 +166,14 @@ var StringFormatter = class {
|
|
|
166
166
|
// src/utils/collect_sub_sheets_by_id.ts
|
|
167
167
|
import {
|
|
168
168
|
fmt_module_name,
|
|
169
|
+
KICAD_PCB_FILE_EXT,
|
|
169
170
|
KICAD_SHC_FILE_EXT as KICAD_SHC_FILE_EXT2,
|
|
170
171
|
remove_filename_path_prefix as remove_filename_path_prefix2,
|
|
171
172
|
unzipFile as unzipFile2
|
|
172
173
|
} from "@modular-circuit/utils";
|
|
173
174
|
async function collect_sub_sheets_by_id(module_ids, module_resolver) {
|
|
174
175
|
const sheets = {};
|
|
176
|
+
const boards = {};
|
|
175
177
|
const module_main_sheet = {};
|
|
176
178
|
const modules = {};
|
|
177
179
|
for (const id of module_ids) {
|
|
@@ -202,10 +204,17 @@ async function collect_sub_sheets_by_id(module_ids, module_resolver) {
|
|
|
202
204
|
continue;
|
|
203
205
|
}
|
|
204
206
|
sheets[fileName] = content;
|
|
207
|
+
} else if (name.endsWith(KICAD_PCB_FILE_EXT)) {
|
|
208
|
+
const fileName = remove_filename_path_prefix2(name);
|
|
209
|
+
if (fileName in boards) {
|
|
210
|
+
console.error(`Duplicate module name: ${fileName}`);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
boards[fileName] = content;
|
|
205
214
|
}
|
|
206
215
|
}
|
|
207
216
|
}
|
|
208
|
-
return { sheets, module_main_sheet, modules };
|
|
217
|
+
return { sheets, module_main_sheet, modules, boards };
|
|
209
218
|
}
|
|
210
219
|
|
|
211
220
|
// src/converter/kicad_sexpr/eeschema/printer.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/transpiler",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Intermediate representation of the modular circuit",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"js-base64": "^3.7.7",
|
|
32
32
|
"jszip": "^3.10.1",
|
|
33
33
|
"@modular-circuit/electronics-model": "0.1.0",
|
|
34
|
-
"@modular-circuit/
|
|
35
|
-
"@modular-circuit/
|
|
36
|
-
"@modular-circuit/utils": "0.1.
|
|
34
|
+
"@modular-circuit/perc": "0.1.1",
|
|
35
|
+
"@modular-circuit/ir": "0.1.1",
|
|
36
|
+
"@modular-circuit/utils": "0.1.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"clean": "rimraf dist",
|