Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bundle types #177

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading