Skip to content

Commit

Permalink
chore: Fix barretenberg noir typescript wrapper (noir-lang#2922)
Browse files Browse the repository at this point in the history
Co-authored-by: Koby Hall <[email protected]>
Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tom French <[email protected]>
  • Loading branch information
4 people committed Oct 2, 2023
1 parent ce0e388 commit 0a51b17
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
15 changes: 15 additions & 0 deletions tooling/noir_js_backend_barretenberg/fixup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Put these package.json files in the cjs and
# mjs directory respectively, so that
# tools can recognise that the .js files are either
# commonjs or ESM files.
cat >lib/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF

cat >lib/esm/package.json <<!EOF
{
"type": "module"
}
!EOF
12 changes: 6 additions & 6 deletions tooling/noir_js_backend_barretenberg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"license": "(MIT OR Apache-2.0)",
"type": "module",
"source": "src/index.ts",
"main": "lib/cjs/index.cjs",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"exports": {
"require": "./lib/cjs/index.cjs",
"default": "./lib/esm/index.js",
"types": "./lib/esm/index.d.ts"
"require": "./lib/cjs/index.js",
"types": "./lib/esm/index.d.ts",
"default": "./lib/esm/index.js"
},
"types": "lib/esm/index.d.ts",
"scripts": {
"dev": "tsc --watch",
"build": "yarn clean && tsc && tsc -p ./tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs && mv ./lib/cjs/serialize.js ./lib/cjs/serialize.cjs && mv ./lib/cjs/base64_decode.js ./lib/cjs/base64_decode.cjs",
"build": "yarn clean && tsc && tsc -p ./tsconfig.cjs.json && ./fixup.sh",
"clean": "rm -rf ./lib",
"prettier": "prettier 'src/**/*.ts'",
"prettier:fix": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
Expand All @@ -40,4 +40,4 @@
"prettier": "3.0.3",
"typescript": "5.1.5"
}
}
}
2 changes: 1 addition & 1 deletion tooling/noir_js_backend_barretenberg/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "esnext",
"declaration": true,
"emitDeclarationOnly": false,
"module": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "./lib/esm",
"esModuleInterop": true,
Expand Down

0 comments on commit 0a51b17

Please sign in to comment.