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

fix the handling of types/dist/index.js which breaks integration CI #2396

Merged
merged 1 commit into from
Nov 18, 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
6 changes: 5 additions & 1 deletion shared/types/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
set -euxo pipefail

# npx tsx emitCheckers.ts # this is done only as needed
rm -rf dist
npx typia generate --input ./checkers --output ./dist
cp ./checkers/index.js ./dist
cp ./checkers/index.js ./dist/index.ts
# esbuild will emit js files from ts files,
# note that package.json:files[] only include dist/*.js;
node esbuild.config.mjs
# sed -i.bk "s|.ts'|.js'|g" dist/index.js
# rm dist/index.js
# mv dist/index.js.bk dist/index.js
# after packing, should remove dist/*.js except dist/index.js
# see package.json:scripts.postpack
6 changes: 3 additions & 3 deletions shared/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"#shared": "@sjcrh/proteinpaint-shared"
},
"scripts": {
"generate": "node dev.mjs",
"predev": "tsx emitCheckers.ts",
"dev": "node --watch-path=src --watch-path=checkers dev.mjs",
"prepare": "ts-patch install",
"build": "./build.sh",
"prepack": "./build.sh",
"postpack": "cd dist && ls *.js | grep -xvF index.js | xargs rm -f",
"postpack": "rm dist/*.js && mv dist/index.ts dist/index.js",
"test": "tsc",
"doc": "./doc.sh",
"generate": "typia generate --input ./checkers --output ./dist"
"doc": "./doc.sh"
},
"devDependencies": {
"ts-node": "^10.9.2",
Expand Down
Loading