From c033f782b84167d6fe1a4280690f8929a009c0ed Mon Sep 17 00:00:00 2001 From: dancoffman Date: Fri, 4 Nov 2022 18:47:30 -0700 Subject: [PATCH] Start working on NPM publish --- bindings/node.js/.npmignore | 16 ++++++++++++++++ bindings/node.js/Makefile | 11 +++++++++-- bindings/node.js/package.json | 2 +- bindings/node.js/rollup.config.js | 6 +++++- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 bindings/node.js/.npmignore diff --git a/bindings/node.js/.npmignore b/bindings/node.js/.npmignore new file mode 100644 index 0000000..f1513e1 --- /dev/null +++ b/bindings/node.js/.npmignore @@ -0,0 +1,16 @@ +.vscode +build +node_modules +.gitignore +.npmignore +.prettierignore +.prettierrc.json +*.o +*.node +test.ts +kzg.ts +jest.config.js +rollup.config.js +tsconfig.json +babel.config.js +dist/blst/bindings diff --git a/bindings/node.js/Makefile b/bindings/node.js/Makefile index 9aae264..8280cb6 100644 --- a/bindings/node.js/Makefile +++ b/bindings/node.js/Makefile @@ -3,8 +3,8 @@ all: clean build format test bundle clean: yarn node-gyp clean rm -rf build + rm -rf dist rm -f *.node - rm -f dist/kzg.node rm -f *.a rm -f *.o @@ -18,5 +18,12 @@ test: build format: yarn prettier --write . -bundle: +bundle: clean yarn rollup --config rollup.config.js --bundleConfigAsCjs + mkdir -p dist/deps/c-kzg + cp -r ../../blst dist/deps + cp ../../src/c_kzg_4844.c dist/deps/c-kzg + cp ../../src/c_kzg_4844.h dist/deps/c-kzg + +publish: + npm publish diff --git a/bindings/node.js/package.json b/bindings/node.js/package.json index 5c15850..7103aa9 100644 --- a/bindings/node.js/package.json +++ b/bindings/node.js/package.json @@ -1,6 +1,6 @@ { "name": "c-kzg", - "version": "0.0.1", + "version": "0.0.2", "description": "NodeJS bindings for C-KZG", "author": "Dan Coffman", "license": "MIT", diff --git a/bindings/node.js/rollup.config.js b/bindings/node.js/rollup.config.js index 383c4bc..5d0528d 100644 --- a/bindings/node.js/rollup.config.js +++ b/bindings/node.js/rollup.config.js @@ -6,5 +6,9 @@ export default { dir: "dist", format: "cjs", }, - plugins: [typescript()], + plugins: [ + typescript({ + exclude: ["test.ts"], + }), + ], };