Fix CJS types (#2880)

* Fix Vue type error

* Add separate CTS types

* Add “Are The Types Wrong” CLI

* wip

* Bump node versions in workflows

* wip

* wip

* wip

* yolo

* yolo (again?)

* wip

* wip
This commit is contained in:
Jordan Pittman
2023-12-12 11:43:34 -05:00
committed by GitHub
parent c2096b0ddd
commit c25e2e6036
14 changed files with 233 additions and 14 deletions
+8 -2
View File
@@ -35,11 +35,17 @@ NODE_ENV=production $esbuild $input --format=esm --outfile=$DST/$name.esm
NODE_ENV=production $esbuild $input --format=cjs --outfile=$DST/$name.prod.cjs --minify --bundle --pure:React.createElement --define:process.env.TEST_BYPASS_TRACKED_POINTER="false" --define:__DEV__="false" ${sharedOptions[@]} $@ &
NODE_ENV=development $esbuild $input --format=cjs --outfile=$DST/$name.dev.cjs --bundle --pure:React.createElement --define:process.env.TEST_BYPASS_TRACKED_POINTER="false" --define:__DEV__="true" ${sharedOptions[@]} $@ &
# Generate types
# Generate ESM types
tsc --emitDeclarationOnly --outDir $DST &
wait
# Generate CJS types
# This is a bit of a hack, but it works because the same output works for both
cp $DST/index.d.ts $DST/index.d.cts
# Copy build files over
cp -rf ./build/ $DST
cp -rf ./build/* $DST/
# Wait for all the scripts to finish
wait