fix: package.json missing 'type': 'module' inconsistent with AGENTS.md (#850)

Update tsconfig.json to use NodeNext module system (fixes CJS/ESM conflict),
enable ts-node ESM mode, and add .js extensions to relative imports so the
built output and ts-node dev script both work correctly with "type":"module".
This commit is contained in:
openhands 2026-03-16 06:35:05 +00:00
parent 0c43054f42
commit 3f24faba18
3 changed files with 10 additions and 6 deletions

View file

@ -10,8 +10,8 @@
import * as fs from 'fs';
import * as path from 'path';
import { parse } from './parser';
import { transpile } from './transpiler';
import { parse } from './parser.js';
import { transpile } from './transpiler.js';
function main(): void {
const args = process.argv.slice(2);

View file

@ -8,7 +8,7 @@
* Only the subset of instructions used in optimizer_v3.push3 is implemented.
*/
import { Node } from './parser';
import { Node } from './parser.js';
interface TranspilerState {
dStack: string[]; // DYADIC stack (Solidity expressions)

View file

@ -1,8 +1,9 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["ES2020"],
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022"],
"outDir": "dist",
"rootDir": "src",
"strict": true,
@ -10,6 +11,9 @@
"skipLibCheck": true,
"resolveJsonModule": true
},
"ts-node": {
"esm": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}