Skip to content

Commit

Permalink
feat: bundle types (#177)
Browse files Browse the repository at this point in the history
* feat: bundle types

* fix: move deps

* fix: update deps
  • Loading branch information
superical authored Jul 16, 2024
1 parent d5364b2 commit 61114ca
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 506 deletions.
27 changes: 24 additions & 3 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ build_types() {
{
"name": "@govtechsg/document-store",
"version": "1.0.0",
"main": "index.ts",
"main": "index.js",
"module": "index.mjs",
"types": "./types/index.d.ts",
"exports": {
"types": "./types/index.d.ts",
"require": "./index.js",
"default": "./index.mjs"
},
"repository": "git+https://github.com/Open-Attestation/document-store.git",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -47,9 +54,23 @@ EOF

npm install "@typechain/$target" --save-dev --no-fund --no-audit

npx typechain --target $target --out-dir . '../../artifacts/src/**/*[^dbg].json'
npx --yes typechain --target $target --out-dir ./output '../../artifacts/src/**/*[^dbg].json'

echo "✅ Completed building types for $target!"
echo "Typechain build completed."

npm install --no-save rollup-plugin-typescript2 @rollup/plugin-commonjs @rollup/plugin-node-resolve

cp ../../rollup.config.mjs .

npx --yes rollup -c

mkdir -p types && mv .build/types-$target/output/* types/

rm -rf .build output rollup.config.mjs

echo "Bundling completed."

echo "✅ Completed building for $target!"
}

publish_types() {
Expand Down
Loading

0 comments on commit 61114ca

Please sign in to comment.