circuitscript 0.0.36 → 0.0.37
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/cjs/export.js +1 -0
- package/dist/cjs/globals.js +1 -0
- package/dist/cjs/helpers.js +10 -9
- package/dist/cjs/main.js +0 -3
- package/dist/cjs/visitor.js +3 -0
- package/dist/esm/export.mjs +1 -0
- package/dist/esm/globals.mjs +1 -0
- package/dist/esm/helpers.mjs +10 -9
- package/dist/esm/main.mjs +0 -3
- package/dist/esm/visitor.mjs +3 -0
- package/dist/types/globals.d.ts +2 -1
- package/dist/types/helpers.d.ts +0 -1
- package/package.json +1 -1
package/dist/cjs/export.js
CHANGED
|
@@ -53,6 +53,7 @@ function generateKiCADNetList(netlist) {
|
|
|
53
53
|
if (instance.typeProp !== globals_js_1.ComponentTypes.label &&
|
|
54
54
|
instance.typeProp !== globals_js_1.ComponentTypes.net &&
|
|
55
55
|
instance.typeProp !== globals_js_1.ComponentTypes.point &&
|
|
56
|
+
instance.typeProp !== globals_js_1.ComponentTypes.frame &&
|
|
56
57
|
instance.typeProp !== null) {
|
|
57
58
|
console.log('Skipping', instance.instanceName);
|
|
58
59
|
}
|
package/dist/cjs/globals.js
CHANGED
|
@@ -78,6 +78,7 @@ var ComponentTypes;
|
|
|
78
78
|
ComponentTypes["net"] = "net";
|
|
79
79
|
ComponentTypes["label"] = "label";
|
|
80
80
|
ComponentTypes["point"] = "point";
|
|
81
|
+
ComponentTypes["frame"] = "frame";
|
|
81
82
|
})(ComponentTypes || (exports.ComponentTypes = ComponentTypes = {}));
|
|
82
83
|
var ReferenceTypes;
|
|
83
84
|
(function (ReferenceTypes) {
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -161,7 +161,7 @@ function validateScript(scriptData, options) {
|
|
|
161
161
|
}
|
|
162
162
|
exports.validateScript = validateScript;
|
|
163
163
|
function renderScript(scriptData, outputPath, options) {
|
|
164
|
-
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false,
|
|
164
|
+
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, showStats = false } = options;
|
|
165
165
|
const onErrorHandler = (line, column, message, error) => {
|
|
166
166
|
if (error instanceof visitor_js_1.VisitorExecutionException) {
|
|
167
167
|
console.log('Error', line, column, message, error.errorMessage);
|
|
@@ -194,14 +194,6 @@ function renderScript(scriptData, outputPath, options) {
|
|
|
194
194
|
catch (err) {
|
|
195
195
|
console.log('Error during annotation: ', err);
|
|
196
196
|
}
|
|
197
|
-
if (kicadNetlistPath) {
|
|
198
|
-
const { tree: kicadNetList, missingFootprints } = (0, export_js_1.generateKiCADNetList)(visitor.getNetList());
|
|
199
|
-
missingFootprints.forEach(entry => {
|
|
200
|
-
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
201
|
-
});
|
|
202
|
-
(0, fs_1.writeFileSync)(kicadNetlistPath, (0, export_js_1.printTree)(kicadNetList));
|
|
203
|
-
console.log('Generated KiCad netlist file');
|
|
204
|
-
}
|
|
205
197
|
const { sequence, nets } = visitor.getGraph();
|
|
206
198
|
const tmpSequence = sequence.map(item => {
|
|
207
199
|
const tmp = [...item];
|
|
@@ -230,6 +222,15 @@ function renderScript(scriptData, outputPath, options) {
|
|
|
230
222
|
outputDefaultZoom = 1;
|
|
231
223
|
}
|
|
232
224
|
}
|
|
225
|
+
if (fileExtension === 'net') {
|
|
226
|
+
const { tree: kicadNetList, missingFootprints } = (0, export_js_1.generateKiCADNetList)(visitor.getNetList());
|
|
227
|
+
missingFootprints.forEach(entry => {
|
|
228
|
+
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
229
|
+
});
|
|
230
|
+
(0, fs_1.writeFileSync)(outputPath, (0, export_js_1.printTree)(kicadNetList));
|
|
231
|
+
console.log('Generated file', outputPath);
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
233
234
|
const layoutEngine = new layout_js_1.LayoutEngine();
|
|
234
235
|
const layoutTimer = new utils_js_1.SimpleStopwatch();
|
|
235
236
|
const sheetFrames = layoutEngine.runLayout(sequence, nets);
|
package/dist/cjs/main.js
CHANGED
|
@@ -21,7 +21,6 @@ async function main() {
|
|
|
21
21
|
.argument('[output path]', 'Output path')
|
|
22
22
|
.option('-i, --input text <input text>', 'Input text directly')
|
|
23
23
|
.option('-c, --current-directory <path>', 'Set current directory')
|
|
24
|
-
.option('-k, --kicad-netlist <filename>', 'Create KiCad netlist')
|
|
25
24
|
.option('-w, --watch', 'Watch for file changes')
|
|
26
25
|
.option('-n, --dump-nets', 'Dump out net information')
|
|
27
26
|
.option('-d, --dump-data', 'Dump data during parsing')
|
|
@@ -38,7 +37,6 @@ async function main() {
|
|
|
38
37
|
const watchFileChanges = options.watch;
|
|
39
38
|
const dumpNets = options.dumpNets;
|
|
40
39
|
const dumpData = options.dumpData;
|
|
41
|
-
const kicadNetlist = options.kicadNetlist;
|
|
42
40
|
let currentDirectory = options.currentDirectory ?? null;
|
|
43
41
|
if (watchFileChanges) {
|
|
44
42
|
console.log('watching for file changes...');
|
|
@@ -75,7 +73,6 @@ async function main() {
|
|
|
75
73
|
defaultLibsPath,
|
|
76
74
|
dumpNets,
|
|
77
75
|
dumpData,
|
|
78
|
-
kicadNetlistPath: kicadNetlist,
|
|
79
76
|
showStats: options.stats,
|
|
80
77
|
};
|
|
81
78
|
let outputPath = null;
|
package/dist/cjs/visitor.js
CHANGED
package/dist/esm/export.mjs
CHANGED
|
@@ -50,6 +50,7 @@ export function generateKiCADNetList(netlist) {
|
|
|
50
50
|
if (instance.typeProp !== ComponentTypes.label &&
|
|
51
51
|
instance.typeProp !== ComponentTypes.net &&
|
|
52
52
|
instance.typeProp !== ComponentTypes.point &&
|
|
53
|
+
instance.typeProp !== ComponentTypes.frame &&
|
|
53
54
|
instance.typeProp !== null) {
|
|
54
55
|
console.log('Skipping', instance.instanceName);
|
|
55
56
|
}
|
package/dist/esm/globals.mjs
CHANGED
|
@@ -75,6 +75,7 @@ export var ComponentTypes;
|
|
|
75
75
|
ComponentTypes["net"] = "net";
|
|
76
76
|
ComponentTypes["label"] = "label";
|
|
77
77
|
ComponentTypes["point"] = "point";
|
|
78
|
+
ComponentTypes["frame"] = "frame";
|
|
78
79
|
})(ComponentTypes || (ComponentTypes = {}));
|
|
79
80
|
export var ReferenceTypes;
|
|
80
81
|
(function (ReferenceTypes) {
|
package/dist/esm/helpers.mjs
CHANGED
|
@@ -150,7 +150,7 @@ export function validateScript(scriptData, options) {
|
|
|
150
150
|
return visitorResolver;
|
|
151
151
|
}
|
|
152
152
|
export function renderScript(scriptData, outputPath, options) {
|
|
153
|
-
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false,
|
|
153
|
+
const { currentDirectory = null, defaultLibsPath, dumpNets = false, dumpData = false, showStats = false } = options;
|
|
154
154
|
const onErrorHandler = (line, column, message, error) => {
|
|
155
155
|
if (error instanceof VisitorExecutionException) {
|
|
156
156
|
console.log('Error', line, column, message, error.errorMessage);
|
|
@@ -183,14 +183,6 @@ export function renderScript(scriptData, outputPath, options) {
|
|
|
183
183
|
catch (err) {
|
|
184
184
|
console.log('Error during annotation: ', err);
|
|
185
185
|
}
|
|
186
|
-
if (kicadNetlistPath) {
|
|
187
|
-
const { tree: kicadNetList, missingFootprints } = generateKiCADNetList(visitor.getNetList());
|
|
188
|
-
missingFootprints.forEach(entry => {
|
|
189
|
-
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
190
|
-
});
|
|
191
|
-
writeFileSync(kicadNetlistPath, printTree(kicadNetList));
|
|
192
|
-
console.log('Generated KiCad netlist file');
|
|
193
|
-
}
|
|
194
186
|
const { sequence, nets } = visitor.getGraph();
|
|
195
187
|
const tmpSequence = sequence.map(item => {
|
|
196
188
|
const tmp = [...item];
|
|
@@ -219,6 +211,15 @@ export function renderScript(scriptData, outputPath, options) {
|
|
|
219
211
|
outputDefaultZoom = 1;
|
|
220
212
|
}
|
|
221
213
|
}
|
|
214
|
+
if (fileExtension === 'net') {
|
|
215
|
+
const { tree: kicadNetList, missingFootprints } = generateKiCADNetList(visitor.getNetList());
|
|
216
|
+
missingFootprints.forEach(entry => {
|
|
217
|
+
console.log(`${entry.refdes} (${entry.instanceName}) does not have footprint`);
|
|
218
|
+
});
|
|
219
|
+
writeFileSync(outputPath, printTree(kicadNetList));
|
|
220
|
+
console.log('Generated file', outputPath);
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
222
223
|
const layoutEngine = new LayoutEngine();
|
|
223
224
|
const layoutTimer = new SimpleStopwatch();
|
|
224
225
|
const sheetFrames = layoutEngine.runLayout(sequence, nets);
|
package/dist/esm/main.mjs
CHANGED
|
@@ -16,7 +16,6 @@ export default async function main() {
|
|
|
16
16
|
.argument('[output path]', 'Output path')
|
|
17
17
|
.option('-i, --input text <input text>', 'Input text directly')
|
|
18
18
|
.option('-c, --current-directory <path>', 'Set current directory')
|
|
19
|
-
.option('-k, --kicad-netlist <filename>', 'Create KiCad netlist')
|
|
20
19
|
.option('-w, --watch', 'Watch for file changes')
|
|
21
20
|
.option('-n, --dump-nets', 'Dump out net information')
|
|
22
21
|
.option('-d, --dump-data', 'Dump data during parsing')
|
|
@@ -33,7 +32,6 @@ export default async function main() {
|
|
|
33
32
|
const watchFileChanges = options.watch;
|
|
34
33
|
const dumpNets = options.dumpNets;
|
|
35
34
|
const dumpData = options.dumpData;
|
|
36
|
-
const kicadNetlist = options.kicadNetlist;
|
|
37
35
|
let currentDirectory = options.currentDirectory ?? null;
|
|
38
36
|
if (watchFileChanges) {
|
|
39
37
|
console.log('watching for file changes...');
|
|
@@ -70,7 +68,6 @@ export default async function main() {
|
|
|
70
68
|
defaultLibsPath,
|
|
71
69
|
dumpNets,
|
|
72
70
|
dumpData,
|
|
73
|
-
kicadNetlistPath: kicadNetlist,
|
|
74
71
|
showStats: options.stats,
|
|
75
72
|
};
|
|
76
73
|
let outputPath = null;
|
package/dist/esm/visitor.mjs
CHANGED
package/dist/types/globals.d.ts
CHANGED
package/dist/types/helpers.d.ts
CHANGED