https://github.com/stared/yarn-adding-pure-typescript-package-example
https://github.com/stared/yarn-adding-pure-typescript-package-example
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stared/yarn-adding-pure-typescript-package-example
- Owner: stared
- Created: 2019-10-04T10:16:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:10:03.000Z (over 2 years ago)
- Last Synced: 2025-01-13T19:56:09.762Z (5 months ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yarn-adding-pure-typescript-package-example
Use as an example https://github.com/stared/quantum-tensors I just created.
I've found one way to go:
```
yarn add stared/quantum-tensors#master
```I changed a few things in build paths, and now it is fine.
## New
In quantum-tensors I added:
```
"scripts": {
...,
"postinstall": "tsc --outDir ./build"
}
```Now it just works with `yarn add/upgrade` with no extra scripts.
## Old
Then, each time you want to upgrade quantum-tensors
```
yarn upgrade quantum-tensors && cd node_modules/quantum-tensors && tsc --outDir ./build
```
It downloads new source files, builds JS and type definition files. So it both works AND gives correct VCS support for types.In fact, you can add a script in `package.json`
```
"scripts": {
"start": "tsc --outDir ./build && node ./build/main.js",
"upgrade-quantum-tensors": "yarn upgrade quantum-tensors && cd node_modules/quantum-tensors && tsc --outDir ./build"
}
```