Package library as @moduletrace/twui npm package
- Move components/ to src/ and compile to dist/ with tsc - Add root barrel export plus deep-import subpath exports and base.css export - Post-compile step: copy base.css, add .js import extensions, mark client modules - Add publish.sh and .npmrc for the Gitea npm registry - Fix type errors, guard TinyMCE env access, drop ace-builds type dependency - Rename clashing props type names, remove Next.js scaffolding and unused deps Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ -z "${1:-}" ]; then
|
||||
msg="Updates"
|
||||
else
|
||||
msg="$1"
|
||||
fi
|
||||
|
||||
# Always use the project's TypeScript (global `tsc` may not emit)
|
||||
export PATH="$(pwd)/node_modules/.bin:$PATH"
|
||||
|
||||
if [ ! -x "./node_modules/.bin/tsc" ]; then
|
||||
echo "Installing dependencies..."
|
||||
bun install
|
||||
fi
|
||||
|
||||
echo "Typechecking..."
|
||||
tsc -p tsconfig.json --noEmit
|
||||
|
||||
echo "Testing..."
|
||||
bun test src
|
||||
|
||||
echo "Compiling..."
|
||||
# Clear emit output AND incremental cache. Otherwise a prior --noEmit run leaves
|
||||
# tsbuildinfo "up to date" and tsc emits nothing after `rm -rf dist`.
|
||||
rm -rf dist tsconfig.tsbuildinfo
|
||||
tsc -p tsconfig.json
|
||||
bun scripts/post-compile.ts
|
||||
|
||||
for f in dist/index.js dist/index.d.ts dist/base.css; do
|
||||
if [ ! -f "$f" ]; then
|
||||
echo "ERROR: compile failed — $f was not produced"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Build OK"
|
||||
|
||||
echo "Publishing package..."
|
||||
git add -A
|
||||
git commit -m "$msg" || true
|
||||
git push || true
|
||||
bun publish
|
||||
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user