Skip to content

Commit

Permalink
Fix tsc generation (#1886)
Browse files Browse the repository at this point in the history
## Description

`tsc` generated directory structure reflects source structure, starting from `rootDir` specified in ts-config. We can't set it to `src/reanimated2` because it has to contain _all_ sources (including d.ts files we have in repo root). To workaround that we move generated directory two levels upper.

This PR also splits `type:generate` task to make it more maintainable.
  • Loading branch information
jakub-gonet authored Mar 31, 2021
1 parent 4b4cd45 commit 798d963
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"lint-check": "eslint --ext '.js,.ts,.tsx' src/ && yarn prettier --check src/",
"release": "npm login && release-it",
"type:check": "yarn tsc --noEmit",
"type:generate": "rm -rf lib/ && mkdir lib/ && cp -RL src/ lib/ && find ./lib -type f -name \"*.ts\" -and -not -name \"*.d.ts\" -delete && yarn tsc"
"type:generate": "yarn type:generate:clean && yarn type:generate:cp-js-src && yarn type:generate:tsc-and-mv",
"type:generate:clean": "rm -rf lib/ && mkdir lib/",
"type:generate:cp-js-src": "cp -RL src/ lib/ && find ./lib -type f -name \"*.ts\" -and -not -name \"*.d.ts\" -delete",
"type:generate:tsc-and-mv": "yarn tsc && mv lib/reanimated2/src/reanimated2/* lib/reanimated2 && rm -r lib/reanimated2/src/"
},
"main": "lib/Animated.js",
"module": "lib/Animated",
Expand Down

0 comments on commit 798d963

Please sign in to comment.