c-kzg-4844/bindings/node.js/Makefile

38 lines
833 B
Makefile
Raw Normal View History

2022-11-04 19:06:06 +00:00
all: clean build format test bundle
clean:
yarn node-gyp clean
rm -rf build
2022-11-05 01:47:30 +00:00
rm -rf dist
2022-11-03 19:57:46 +00:00
rm -f *.node
rm -f *.a
rm -f *.o
2022-11-04 06:14:11 +00:00
build: kzg.cxx kzg.ts package.json binding.gyp Makefile
cd ../../src && make c_kzg_4844.o && cp c_kzg_4844.o ../bindings/node.js
2022-11-22 20:11:05 +00:00
yarn install
yarn node-gyp rebuild
2022-11-04 05:52:34 +00:00
test: build
yarn jest
format:
yarn prettier --write .
2022-11-05 01:47:30 +00:00
bundle: clean
yarn rollup --config rollup.config.js --bundleConfigAsCjs
2022-11-05 01:47:30 +00:00
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
2022-11-05 07:36:38 +00:00
publish: bundle
2022-11-05 07:28:36 +00:00
mv binding.gyp binding.gyp.bak
2022-11-07 22:35:10 +00:00
cp binding.dist.gyp binding.gyp
npm publish && mv binding.gyp.bak binding.gyp || mv binding.gyp.bak binding.gyp
linux-test: bundle
docker build -t "linux-test" .
docker logs --follow `docker run -d linux-test`