edacation 0.2.1 → 0.2.3
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/README.md +14 -7
- package/dist/cli/index.js +141 -127
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tool.js +7 -3
- package/dist/cli/tool.js.map +1 -1
- package/dist/cli/util.d.ts +1 -1
- package/dist/cli/util.js +7 -3
- package/dist/cli/util.js.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/project/configuration.js +32 -29
- package/dist/project/configuration.js.map +1 -1
- package/dist/project/devices.js +4 -1
- package/dist/project/devices.js.map +1 -1
- package/dist/project/index.js +21 -5
- package/dist/project/index.js.map +1 -1
- package/dist/project/nextpnr.d.ts +2 -2
- package/dist/project/nextpnr.js +23 -19
- package/dist/project/nextpnr.js.map +1 -1
- package/dist/project/project.d.ts +7 -7
- package/dist/project/project.js +18 -14
- package/dist/project/project.js.map +1 -1
- package/dist/project/target.d.ts +1 -1
- package/dist/project/target.js +23 -12
- package/dist/project/target.js.map +1 -1
- package/dist/project/yosys.d.ts +2 -2
- package/dist/project/yosys.js +34 -28
- package/dist/project/yosys.js.map +1 -1
- package/dist/util.d.ts +5 -5
- package/dist/util.js +18 -8
- package/dist/util.js.map +1 -1
- package/package.json +10 -8
package/dist/project/index.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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("./configuration.js"), exports);
|
|
18
|
+
__exportStar(require("./devices.js"), exports);
|
|
19
|
+
__exportStar(require("./nextpnr.js"), exports);
|
|
20
|
+
__exportStar(require("./project.js"), exports);
|
|
21
|
+
__exportStar(require("./yosys.js"), exports);
|
|
6
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,6CAA2B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProjectConfiguration } from './configuration.js';
|
|
2
|
-
import { Project } from './project.js';
|
|
1
|
+
import type { ProjectConfiguration } from './configuration.js';
|
|
2
|
+
import type { Project } from './project.js';
|
|
3
3
|
export interface NextpnrWorkerOptions {
|
|
4
4
|
inputFiles: string[];
|
|
5
5
|
outputFiles: string[];
|
package/dist/project/nextpnr.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNextpnrWorkerOptions = exports.parseNextpnrArguments = exports.generateNextpnrWorkerOptions = void 0;
|
|
4
|
+
const string_args_parser_1 = require("string-args-parser");
|
|
5
|
+
const devices_js_1 = require("./devices.js");
|
|
6
|
+
const target_js_1 = require("./target.js");
|
|
4
7
|
const DEFAULT_OPTIONS = {
|
|
5
8
|
placedSvg: true,
|
|
6
9
|
routedSvg: true,
|
|
7
10
|
routedJson: true
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
const target = getTarget(configuration, targetId);
|
|
11
|
-
const options = getOptions(configuration, targetId, 'nextpnr', DEFAULT_OPTIONS);
|
|
12
|
-
const vendor = VENDORS[target.vendor];
|
|
12
|
+
const generateNextpnrWorkerOptions = (configuration, targetId) => {
|
|
13
|
+
const target = (0, target_js_1.getTarget)(configuration, targetId);
|
|
14
|
+
const options = (0, target_js_1.getOptions)(configuration, targetId, 'nextpnr', DEFAULT_OPTIONS);
|
|
15
|
+
const vendor = devices_js_1.VENDORS[target.vendor];
|
|
13
16
|
const family = vendor.families[target.family];
|
|
14
17
|
const device = family.devices[target.device];
|
|
15
|
-
const inputFiles = [
|
|
16
|
-
getTargetFile(target, `${family.architecture}.json`)
|
|
17
|
-
];
|
|
18
|
+
const inputFiles = [(0, target_js_1.getTargetFile)(target, `${family.architecture}.json`)];
|
|
18
19
|
const outputFiles = [];
|
|
19
20
|
const tool = `nextpnr-${family.architecture}`;
|
|
20
21
|
const args = [];
|
|
@@ -57,17 +58,17 @@ export const generateNextpnrWorkerOptions = (configuration, targetId) => {
|
|
|
57
58
|
}
|
|
58
59
|
args.push('--json', inputFiles[0]);
|
|
59
60
|
if (options.placedSvg) {
|
|
60
|
-
const file = getTargetFile(target, 'placed.svg');
|
|
61
|
+
const file = (0, target_js_1.getTargetFile)(target, 'placed.svg');
|
|
61
62
|
outputFiles.push(file);
|
|
62
63
|
args.push('--placed-svg', file);
|
|
63
64
|
}
|
|
64
65
|
if (options.routedSvg) {
|
|
65
|
-
const file = getTargetFile(target, 'routed.svg');
|
|
66
|
+
const file = (0, target_js_1.getTargetFile)(target, 'routed.svg');
|
|
66
67
|
outputFiles.push(file);
|
|
67
68
|
args.push('--routed-svg', file);
|
|
68
69
|
}
|
|
69
70
|
if (options.routedJson) {
|
|
70
|
-
const file = getTargetFile(target, 'routed.nextpnr.json');
|
|
71
|
+
const file = (0, target_js_1.getTargetFile)(target, 'routed.nextpnr.json');
|
|
71
72
|
outputFiles.push(file);
|
|
72
73
|
args.push('--write', file);
|
|
73
74
|
}
|
|
@@ -78,13 +79,15 @@ export const generateNextpnrWorkerOptions = (configuration, targetId) => {
|
|
|
78
79
|
arguments: args
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
82
|
+
exports.generateNextpnrWorkerOptions = generateNextpnrWorkerOptions;
|
|
83
|
+
const parseNextpnrArguments = (args) => args.flatMap((arg) => (0, string_args_parser_1.parseArgs)(arg));
|
|
84
|
+
exports.parseNextpnrArguments = parseNextpnrArguments;
|
|
85
|
+
const getNextpnrWorkerOptions = (project, targetId) => {
|
|
86
|
+
const generated = (0, exports.generateNextpnrWorkerOptions)(project.getConfiguration(), targetId);
|
|
87
|
+
const inputFiles = (0, target_js_1.getCombined)(project.getConfiguration(), targetId, 'nextpnr', 'inputFiles', generated.inputFiles);
|
|
88
|
+
const outputFiles = (0, target_js_1.getCombined)(project.getConfiguration(), targetId, 'nextpnr', 'outputFiles', generated.outputFiles);
|
|
86
89
|
const tool = generated.tool;
|
|
87
|
-
const args = getCombined(project.getConfiguration(), targetId, 'nextpnr', 'arguments', generated.arguments, parseNextpnrArguments);
|
|
90
|
+
const args = (0, target_js_1.getCombined)(project.getConfiguration(), targetId, 'nextpnr', 'arguments', generated.arguments, exports.parseNextpnrArguments);
|
|
88
91
|
return {
|
|
89
92
|
inputFiles,
|
|
90
93
|
outputFiles,
|
|
@@ -92,4 +95,5 @@ export const getNextpnrWorkerOptions = (project, targetId) => {
|
|
|
92
95
|
arguments: args
|
|
93
96
|
};
|
|
94
97
|
};
|
|
98
|
+
exports.getNextpnrWorkerOptions = getNextpnrWorkerOptions;
|
|
95
99
|
//# sourceMappingURL=nextpnr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextpnr.js","sourceRoot":"","sources":["../../src/project/nextpnr.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"nextpnr.js","sourceRoot":"","sources":["../../src/project/nextpnr.ts"],"names":[],"mappings":";;;AAAA,2DAA6C;AAG7C,6CAAkD;AAElD,2CAA8E;AAS9E,MAAM,eAAe,GAAmB;IACpC,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;CACnB,CAAC;AAEK,MAAM,4BAA4B,GAAG,CACxC,aAAmC,EACnC,QAAgB,EACI,EAAE;IACtB,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAA,sBAAU,EAAC,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAEhF,MAAM,MAAM,GAAI,oBAAkC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAE7C,MAAM,UAAU,GAAG,CAAC,IAAA,yBAAa,EAAC,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC;IAE1E,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,MAAM,IAAI,GAAG,WAAW,MAAM,CAAC,YAAY,EAAE,CAAC;IAC9C,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,QAAQ,MAAM,CAAC,YAAY,EAAE;QACzB,KAAK,MAAM,CAAC,CAAC;YACT,IAAI,CAA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,OAAO,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACpH,MAAM,WAAW,GAAG,IAAA,uBAAW,EAC3B,OAAO,CAAC,gBAAgB,EAAE,EAC1B,QAAQ,EACR,SAAS,EACT,aAAa,EACb,SAAS,CAAC,WAAW,CACxB,CAAC;IAEF,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAA,uBAAW,EACpB,OAAO,CAAC,gBAAgB,EAAE,EAC1B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,SAAS,CAAC,SAAS,EACnB,6BAAqB,CACxB,CAAC;IAEF,OAAO;QACH,UAAU;QACV,WAAW;QACX,IAAI;QACJ,SAAS,EAAE,IAAI;KAClB,CAAC;AACN,CAAC,CAAC;AA5BW,QAAA,uBAAuB,2BA4BlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProjectConfiguration } from './configuration.js';
|
|
1
|
+
import { type ProjectConfiguration } from './configuration.js';
|
|
2
2
|
export interface ProjectState {
|
|
3
3
|
name: string;
|
|
4
4
|
inputFiles: string[];
|
|
@@ -14,12 +14,12 @@ export declare class Project {
|
|
|
14
14
|
getName(): string;
|
|
15
15
|
getInputFiles(): string[];
|
|
16
16
|
hasInputFile(filePath: string): boolean;
|
|
17
|
-
addInputFiles(filePaths: string[]):
|
|
18
|
-
removeInputFiles(filePaths: string[]):
|
|
17
|
+
addInputFiles(filePaths: string[]): void;
|
|
18
|
+
removeInputFiles(filePaths: string[]): void;
|
|
19
19
|
getOutputFiles(): string[];
|
|
20
20
|
hasOutputFile(filePath: string): boolean;
|
|
21
|
-
addOutputFiles(filePaths: string[]):
|
|
22
|
-
removeOutputFiles(filePaths: string[]):
|
|
21
|
+
addOutputFiles(filePaths: string[]): void;
|
|
22
|
+
removeOutputFiles(filePaths: string[]): void;
|
|
23
23
|
getConfiguration(): {
|
|
24
24
|
targets: {
|
|
25
25
|
id: string;
|
|
@@ -114,6 +114,6 @@ export declare class Project {
|
|
|
114
114
|
updateConfiguration(configuration: Partial<ProjectConfiguration>): void;
|
|
115
115
|
static serialize(project: Project): ProjectState;
|
|
116
116
|
static deserialize(data: ProjectState, ..._args: unknown[]): Project;
|
|
117
|
-
static loadFromData(rawData: Uint8Array):
|
|
118
|
-
static storeToData(project: Project):
|
|
117
|
+
static loadFromData(rawData: Uint8Array): Project;
|
|
118
|
+
static storeToData(project: Project): Uint8Array;
|
|
119
119
|
}
|
package/dist/project/project.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Project = void 0;
|
|
4
|
+
const util_js_1 = require("../util.js");
|
|
5
|
+
const configuration_js_1 = require("./configuration.js");
|
|
6
|
+
class Project {
|
|
7
|
+
constructor(name, inputFiles = [], outputFiles = [], configuration = configuration_js_1.DEFAULT_CONFIGURATION) {
|
|
5
8
|
this.name = name;
|
|
6
9
|
this.inputFiles = inputFiles;
|
|
7
10
|
this.outputFiles = outputFiles;
|
|
8
|
-
const config = schemaProjectConfiguration.safeParse(configuration);
|
|
11
|
+
const config = configuration_js_1.schemaProjectConfiguration.safeParse(configuration);
|
|
9
12
|
if (config.success) {
|
|
10
13
|
this.configuration = config.data;
|
|
11
14
|
}
|
|
12
15
|
else {
|
|
13
|
-
throw new Error(`Failed to parse project configuration: ${config.error}`);
|
|
16
|
+
throw new Error(`Failed to parse project configuration: ${config.error.toString()}`);
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
getName() {
|
|
@@ -22,7 +25,7 @@ export class Project {
|
|
|
22
25
|
hasInputFile(filePath) {
|
|
23
26
|
return this.inputFiles.some((file) => file === filePath);
|
|
24
27
|
}
|
|
25
|
-
|
|
28
|
+
addInputFiles(filePaths) {
|
|
26
29
|
for (const filePath of filePaths) {
|
|
27
30
|
if (!this.hasInputFile(filePath)) {
|
|
28
31
|
this.inputFiles.push(filePath);
|
|
@@ -32,7 +35,7 @@ export class Project {
|
|
|
32
35
|
return a < b ? -1 : 1;
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
|
-
|
|
38
|
+
removeInputFiles(filePaths) {
|
|
36
39
|
this.inputFiles = this.inputFiles.filter((file) => !filePaths.includes(file));
|
|
37
40
|
}
|
|
38
41
|
getOutputFiles() {
|
|
@@ -41,7 +44,7 @@ export class Project {
|
|
|
41
44
|
hasOutputFile(filePath) {
|
|
42
45
|
return this.outputFiles.some((file) => file === filePath);
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
addOutputFiles(filePaths) {
|
|
45
48
|
for (const filePath of filePaths) {
|
|
46
49
|
if (!this.hasOutputFile(filePath)) {
|
|
47
50
|
this.outputFiles.push(filePath);
|
|
@@ -51,7 +54,7 @@ export class Project {
|
|
|
51
54
|
return a < b ? -1 : 1;
|
|
52
55
|
});
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
removeOutputFiles(filePaths) {
|
|
55
58
|
this.outputFiles = this.outputFiles.filter((file) => !filePaths.includes(file));
|
|
56
59
|
}
|
|
57
60
|
getConfiguration() {
|
|
@@ -78,14 +81,15 @@ export class Project {
|
|
|
78
81
|
const configuration = data.configuration ?? {};
|
|
79
82
|
return new Project(name, inputFiles, outputFiles, configuration);
|
|
80
83
|
}
|
|
81
|
-
static
|
|
82
|
-
const data = decodeJSON(rawData);
|
|
84
|
+
static loadFromData(rawData) {
|
|
85
|
+
const data = (0, util_js_1.decodeJSON)(rawData);
|
|
83
86
|
const project = Project.deserialize(data);
|
|
84
87
|
return project;
|
|
85
88
|
}
|
|
86
|
-
static
|
|
89
|
+
static storeToData(project) {
|
|
87
90
|
const data = Project.serialize(project);
|
|
88
|
-
return encodeJSON(data, true);
|
|
91
|
+
return (0, util_js_1.encodeJSON)(data, true);
|
|
89
92
|
}
|
|
90
93
|
}
|
|
94
|
+
exports.Project = Project;
|
|
91
95
|
//# sourceMappingURL=project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":";;;AAAA,wCAAkD;AAElD,yDAAgH;AAShH,MAAa,OAAO;IAMhB,YACI,IAAY,EACZ,aAAuB,EAAE,EACzB,cAAwB,EAAE,EAC1B,gBAAsC,wCAAqB;QAE3D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,MAAM,MAAM,GAAG,6CAA0B,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACnE,IAAI,MAAM,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;SACpC;aAAM;YACH,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SACxF;IACL,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,aAAa;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,YAAY,CAAC,QAAgB;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAED,aAAa,CAAC,SAAmB;QAC7B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;gBAC9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,Q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 +1,4 @@
|
|
|
1
|
-
import { ProjectConfiguration, TargetConfiguration, TargetDefaultsConfiguration, TargetOptionTypes, WorkerId } from './configuration.js';
|
|
1
|
+
import type { ProjectConfiguration, TargetConfiguration, TargetDefaultsConfiguration, TargetOptionTypes, WorkerId } from './configuration.js';
|
|
2
2
|
export declare const getTargetDefaults: (configuration: ProjectConfiguration) => TargetDefaultsConfiguration;
|
|
3
3
|
export declare const getTarget: (configuration: ProjectConfiguration, targetId: string) => TargetConfiguration;
|
|
4
4
|
export declare const getTargetFile: (target: TargetConfiguration, file: string) => string;
|
package/dist/project/target.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getCombined = exports.getOptions = exports.getTargetFile = exports.getTarget = exports.getTargetDefaults = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const getTargetDefaults = (configuration) => {
|
|
3
9
|
return configuration.defaults ?? {};
|
|
4
10
|
};
|
|
5
|
-
|
|
11
|
+
exports.getTargetDefaults = getTargetDefaults;
|
|
12
|
+
const getTarget = (configuration, targetId) => {
|
|
6
13
|
const target = configuration.targets.find((target) => target.id === targetId);
|
|
7
14
|
if (!target) {
|
|
8
15
|
throw new Error(`Target "${targetId}" could not be found.`);
|
|
9
16
|
}
|
|
10
17
|
return target;
|
|
11
18
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
exports.getTarget = getTarget;
|
|
20
|
+
const getTargetFile = (target, file) => path_1.default.join(target.directory ?? '.', file);
|
|
21
|
+
exports.getTargetFile = getTargetFile;
|
|
22
|
+
const getOptions = (configuration, targetId, workerId, defaultValues) => {
|
|
23
|
+
const targetDefaults = (0, exports.getTargetDefaults)(configuration)[workerId];
|
|
24
|
+
const target = (0, exports.getTarget)(configuration, targetId)[workerId];
|
|
16
25
|
const defaultConfig = targetDefaults ? targetDefaults.options : undefined;
|
|
17
26
|
const config = target ? target.options : undefined;
|
|
18
27
|
return {
|
|
@@ -21,16 +30,18 @@ export const getOptions = (configuration, targetId, workerId, defaultValues) =>
|
|
|
21
30
|
...config
|
|
22
31
|
};
|
|
23
32
|
};
|
|
33
|
+
exports.getOptions = getOptions;
|
|
24
34
|
const defaultParse = (values) => values;
|
|
25
|
-
|
|
26
|
-
const targetDefaults = getTargetDefaults(configuration)[workerId];
|
|
27
|
-
const target = getTarget(configuration, targetId)[workerId];
|
|
35
|
+
const getCombined = (configuration, targetId, workerId, configId, generated, parse = defaultParse) => {
|
|
36
|
+
const targetDefaults = (0, exports.getTargetDefaults)(configuration)[workerId];
|
|
37
|
+
const target = (0, exports.getTarget)(configuration, targetId)[workerId];
|
|
28
38
|
const defaultConfig = targetDefaults ? targetDefaults[configId] : undefined;
|
|
29
39
|
const config = target ? target[configId] : undefined;
|
|
30
40
|
return [
|
|
31
|
-
...(!config || config.useGenerated
|
|
32
|
-
...(!config || config.useDefault) && !!defaultConfig ? parse(defaultConfig.values) : [],
|
|
41
|
+
...(!config || config.useGenerated ? generated : []),
|
|
42
|
+
...((!config || config.useDefault) && !!defaultConfig ? parse(defaultConfig.values) : []),
|
|
33
43
|
...(config ? parse(config.values) : [])
|
|
34
44
|
];
|
|
35
45
|
};
|
|
46
|
+
exports.getCombined = getCombined;
|
|
36
47
|
//# sourceMappingURL=target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../src/project/target.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../src/project/target.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAYjB,MAAM,iBAAiB,GAAG,CAAC,aAAmC,E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AAM,YAAY,GAAG,CAAC,MAAgB,EAAE,EAAE,CAAC,MAAM,CAAC;AAE3C,MAAM,WAAW,GAAG,CACvB,aAAmC,EACnC,QAAgB,EAChB,QAAkB,EAClB,QAAgB,EAChB,SAAmB,EACnB,QAAwC,YAAY,EACtD,EAAE;IACA,MAAM,cAAc,GAAG,IAAA,yBAAiB,EAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAA,iBAAS,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IAE5D,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAE,cAAc,CAAC,QAAQ,CAA4B,CAAC,CAAC,CAAC,SAAS,CAAC;IACxG,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAE,MAAM,CAAC,QAAQ,CAAkC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvF,OAAO;QACH,GAAG,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACzF,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAC;AACN,CAAC,CAAC;AAnBW,QAAA,WAAW,eAmBtB"}
|
package/dist/project/yosys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ProjectConfiguration } from './configuration.js';
|
|
2
|
+
import type { Project } from './project.js';
|
|
3
3
|
export interface YosysWorkerOptions {
|
|
4
4
|
inputFiles: string[];
|
|
5
5
|
outputFiles: string[];
|
package/dist/project/yosys.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateYosysSynthCommands = exports.generateYosysRTLCommands = exports.getYosysWorkerOptions = exports.generateYosysWorkerOptions = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const util_js_1 = require("../util.js");
|
|
9
|
+
const devices_js_1 = require("./devices.js");
|
|
10
|
+
const target_js_1 = require("./target.js");
|
|
5
11
|
const DEFAULT_OPTIONS = {
|
|
6
12
|
optimize: true
|
|
7
13
|
};
|
|
8
|
-
|
|
9
|
-
const target = getTarget(configuration, targetId);
|
|
10
|
-
const options = getOptions(configuration, targetId, 'yosys', DEFAULT_OPTIONS);
|
|
11
|
-
const vendor = VENDORS[target.vendor];
|
|
14
|
+
const generateYosysWorkerOptions = (configuration, projectInputFiles, targetId) => {
|
|
15
|
+
const target = (0, target_js_1.getTarget)(configuration, targetId);
|
|
16
|
+
const options = (0, target_js_1.getOptions)(configuration, targetId, 'yosys', DEFAULT_OPTIONS);
|
|
17
|
+
const vendor = devices_js_1.VENDORS[target.vendor];
|
|
12
18
|
const family = vendor.families[target.family];
|
|
13
|
-
const inputFiles = projectInputFiles.filter((inputFile) => FILE_EXTENSIONS_HDL.includes(
|
|
14
|
-
const outputFiles = [
|
|
15
|
-
getTargetFile(target, `${family.architecture}.json`)
|
|
16
|
-
];
|
|
19
|
+
const inputFiles = projectInputFiles.filter((inputFile) => util_js_1.FILE_EXTENSIONS_HDL.includes(path_1.default.extname(inputFile).substring(1)));
|
|
20
|
+
const outputFiles = [(0, target_js_1.getTargetFile)(target, `${family.architecture}.json`)];
|
|
17
21
|
const tool = 'yosys';
|
|
18
|
-
const commands = [
|
|
19
|
-
...inputFiles.map((file) => `read_verilog ${file}`),
|
|
20
|
-
'proc;'
|
|
21
|
-
];
|
|
22
|
+
const commands = [...inputFiles.map((file) => `read_verilog -sv ${file}`), 'proc;'];
|
|
22
23
|
if (options.optimize) {
|
|
23
24
|
commands.push('opt;');
|
|
24
25
|
}
|
|
@@ -36,12 +37,13 @@ export const generateYosysWorkerOptions = (configuration, projectInputFiles, tar
|
|
|
36
37
|
commands: commands
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const
|
|
40
|
+
exports.generateYosysWorkerOptions = generateYosysWorkerOptions;
|
|
41
|
+
const getYosysWorkerOptions = (project, targetId) => {
|
|
42
|
+
const generated = (0, exports.generateYosysWorkerOptions)(project.getConfiguration(), project.getInputFiles(), targetId);
|
|
43
|
+
const inputFiles = (0, target_js_1.getCombined)(project.getConfiguration(), targetId, 'yosys', 'inputFiles', generated.inputFiles);
|
|
44
|
+
const outputFiles = (0, target_js_1.getCombined)(project.getConfiguration(), targetId, 'yosys', 'outputFiles', generated.outputFiles);
|
|
43
45
|
const tool = generated.tool;
|
|
44
|
-
const commands = getCombined(project.getConfiguration(), targetId, 'yosys', 'commands', generated.commands);
|
|
46
|
+
const commands = (0, target_js_1.getCombined)(project.getConfiguration(), targetId, 'yosys', 'commands', generated.commands);
|
|
45
47
|
return {
|
|
46
48
|
inputFiles,
|
|
47
49
|
outputFiles,
|
|
@@ -49,35 +51,39 @@ export const getYosysWorkerOptions = (project, targetId) => {
|
|
|
49
51
|
commands
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
exports.getYosysWorkerOptions = getYosysWorkerOptions;
|
|
55
|
+
const generateYosysRTLCommands = (inputFiles) => {
|
|
56
|
+
const verilogFiles = inputFiles.filter((file) => util_js_1.FILE_EXTENSIONS_VERILOG.includes(path_1.default.extname(file).substring(1)));
|
|
54
57
|
// Yosys commands taken from yosys2digitaljs (https://github.com/tilk/yosys2digitaljs/blob/1b4afeae61/src/index.js#L1225)
|
|
55
58
|
return [
|
|
56
|
-
...verilogFiles.map((file) => `read_verilog ${file}`),
|
|
59
|
+
...verilogFiles.map((file) => `read_verilog -sv ${file}`),
|
|
57
60
|
'hierarchy -auto-top',
|
|
58
61
|
'proc;',
|
|
59
62
|
'opt;',
|
|
60
63
|
'memory -nomap;',
|
|
61
64
|
'wreduce -memx;',
|
|
62
65
|
'opt -full;',
|
|
66
|
+
'tee -q -o stats.digitaljs.json stat -json *;',
|
|
63
67
|
'write_json rtl.digitaljs.json',
|
|
64
68
|
''
|
|
65
69
|
];
|
|
66
70
|
};
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
exports.generateYosysRTLCommands = generateYosysRTLCommands;
|
|
72
|
+
const generateYosysSynthCommands = (inputFiles) => {
|
|
73
|
+
const verilogFiles = inputFiles.filter((file) => util_js_1.FILE_EXTENSIONS_VERILOG.includes(path_1.default.extname(file).substring(1)));
|
|
69
74
|
return [
|
|
70
|
-
...verilogFiles.map((file) => `read_verilog ${file}`),
|
|
75
|
+
...verilogFiles.map((file) => `read_verilog -sv ${file}`),
|
|
71
76
|
'proc;',
|
|
72
77
|
'opt;',
|
|
73
78
|
'synth -lut 4',
|
|
74
79
|
'write_json luts.digitaljs.json',
|
|
75
80
|
'design -reset',
|
|
76
|
-
...verilogFiles.map((file) => `read_verilog ${file}`),
|
|
81
|
+
...verilogFiles.map((file) => `read_verilog -sv ${file}`),
|
|
77
82
|
'proc;',
|
|
78
83
|
'opt;',
|
|
79
84
|
'synth_ecp5 -json ecp5.json;',
|
|
80
85
|
''
|
|
81
86
|
];
|
|
82
87
|
};
|
|
88
|
+
exports.generateYosysSynthCommands = generateYosysSynthCommands;
|
|
83
89
|
//# sourceMappingURL=yosys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yosys.js","sourceRoot":"","sources":["../../src/project/yosys.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"yosys.js","sourceRoot":"","sources":["../../src/project/yosys.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wCAAwE;AAGxE,6CAAkD;AAElD,2CAA8E;AAS9E,MAAM,eAAe,GAAiB;IAClC,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEK,MAAM,0BAA0B,GAAG,CACtC,aAAmC,EACnC,iBAA2B,EAC3B,QAAgB,EACE,EAAE;IACpB,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAA,sBAAU,EAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAI,oBAAkC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAE9C,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CACtD,6BAAmB,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CACrE,CAAC;IACF,MAAM,WAAW,GAAG,CAAC,IAAA,yBAAa,EAAC,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC;IAE3E,MAAM,IAAI,GAAG,OAAO,CAAC;IACrB,MAAM,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IAEpF,IAAI,OAAO,CAAC,QAAQ,EAAE;QAClB,QAAQ,CAAC,IAAI,CAAC,MAAM,C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1
|
-
/// <reference types="node"
|
|
2
|
-
/// <reference types="node"
|
|
3
|
-
/// <reference types="node"
|
|
4
|
-
/// <reference types="node"
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
5
|
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
6
6
|
export declare const encodeText: (input: string) => Uint8Array;
|
|
7
7
|
export declare const encodeJSON: (input: unknown, pretty?: boolean) => Uint8Array;
|
|
8
8
|
export declare const decodeText: (input: NodeJS.ArrayBufferView | ArrayBuffer) => string;
|
|
9
|
-
export declare const decodeJSON: (input: NodeJS.ArrayBufferView | ArrayBuffer) =>
|
|
9
|
+
export declare const decodeJSON: (input: NodeJS.ArrayBufferView | ArrayBuffer) => unknown;
|
|
10
10
|
export declare const FILE_EXTENSIONS_VERILOG: string[];
|
|
11
11
|
export declare const FILE_EXTENSIONS_VHDL: string[];
|
|
12
12
|
export declare const FILE_EXTENSIONS_HDL: string[];
|
package/dist/util.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatArguments = exports.FILE_EXTENSIONS_HDL = exports.FILE_EXTENSIONS_VHDL = exports.FILE_EXTENSIONS_VERILOG = exports.decodeJSON = exports.decodeText = exports.encodeJSON = exports.encodeText = void 0;
|
|
1
4
|
const textEncoder = new TextEncoder();
|
|
2
5
|
const textDecoder = new TextDecoder();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const encodeText = (input) => textEncoder.encode(input.endsWith('\n') ? input : `${input}\n`);
|
|
7
|
+
exports.encodeText = encodeText;
|
|
8
|
+
const encodeJSON = (input, pretty = false) => (0, exports.encodeText)(JSON.stringify(input, undefined, pretty ? 4 : undefined));
|
|
9
|
+
exports.encodeJSON = encodeJSON;
|
|
10
|
+
const decodeText = (input) => textDecoder.decode(input);
|
|
11
|
+
exports.decodeText = decodeText;
|
|
12
|
+
const decodeJSON = (input) => JSON.parse((0, exports.decodeText)(input));
|
|
13
|
+
exports.decodeJSON = decodeJSON;
|
|
14
|
+
exports.FILE_EXTENSIONS_VERILOG = ['v', 'vh', 'sv', 'svh'];
|
|
15
|
+
exports.FILE_EXTENSIONS_VHDL = ['vhd'];
|
|
16
|
+
exports.FILE_EXTENSIONS_HDL = [...exports.FILE_EXTENSIONS_VERILOG, ...exports.FILE_EXTENSIONS_VHDL];
|
|
17
|
+
const formatArguments = (args) => args.reduce((prev, arg) => arg.startsWith('--')
|
|
18
|
+
? [...prev, arg]
|
|
19
|
+
: [...prev.slice(0, prev.length - 1), `${prev[prev.length - 1]} ${arg}`], []);
|
|
20
|
+
exports.formatArguments = formatArguments;
|
|
11
21
|
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAIA,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AACtC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAE/B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;AAAhG,QAAA,UAAU,cAAsF;AACtG,MAAM,UAAU,GAAG,CAAC,KAAc,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE,CACzD,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAD5D,QAAA,UAAU,cACkD;AAElE,MAAM,UAAU,GAAG,CAAC,KAA2C,EAAU,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAAhG,QAAA,UAAU,cAAsF;AACtG,MAAM,UAAU,GAAG,CAAC,KAA2C,EAAW,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;AAArG,QAAA,UAAU,cAA2F;AAErG,QAAA,uBAAuB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACnD,QAAA,oBAAoB,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,QAAA,mBAAmB,GAAG,CAAC,GAAG,+BAAuB,EAAE,GAAG,4BAAoB,CAAC,CAAC;AAElF,MAAM,eAAe,GAAG,CAAC,IAAc,EAAE,EAAE,CAC9C,IAAI,CAAC,MAAM,CACP,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CACV,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC;IAChB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,EAChF,EAAc,CACjB,CAAC;AAPO,QAAA,eAAe,mBAOtB"}
|
package/package.json
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
"name": "edacation",
|
|
3
3
|
"description": "Library and CLI for interacting with Yosys and nextpnr.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.3",
|
|
6
6
|
"contributors": [
|
|
7
|
-
"Danielle Huisman <danielle@huisman.me> (https://github.com/DanielleHuisman)"
|
|
7
|
+
"Danielle Huisman <danielle@huisman.me> (https://github.com/DanielleHuisman)",
|
|
8
|
+
"Mike Almeloo <git@mikealmel.ooo> (https://github.com/DismissedGuy)"
|
|
8
9
|
],
|
|
9
10
|
"repository": "github:EDAcation/edacation",
|
|
10
11
|
"keywords": [
|
|
@@ -13,7 +14,6 @@
|
|
|
13
14
|
"yosys",
|
|
14
15
|
"nextpnr"
|
|
15
16
|
],
|
|
16
|
-
"type": "module",
|
|
17
17
|
"main": "./dist/index.js",
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"files": [
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"bin": "./dist/cli/index.js",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"lint": "eslint",
|
|
28
|
+
"lint": "eslint ./src --ext ts",
|
|
29
29
|
"clean": "rm -rf dist",
|
|
30
30
|
"build": "yarn run clean && yarn run lint && tsc",
|
|
31
|
-
"
|
|
31
|
+
"prepare": "yarn run build",
|
|
32
32
|
"dev": "node --loader ts-node/esm src/cli/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
"zod": "^3.21.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"@typescript-eslint/
|
|
44
|
-
"eslint": "^
|
|
42
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
44
|
+
"@typescript-eslint/parser": "^6.12.0",
|
|
45
|
+
"eslint": "^8.54.0",
|
|
45
46
|
"eslint-config-google": "^0.14.0",
|
|
46
47
|
"eslint-plugin-import": "^2.27.5",
|
|
48
|
+
"prettier": "^3.1.0",
|
|
47
49
|
"ts-node": "^10.9.1",
|
|
48
50
|
"typescript": "^5.0.4"
|
|
49
51
|
}
|