https://github.com/rencire/ts-lib-starter
Starter project structure for typescript projects
https://github.com/rencire/ts-lib-starter
husky jest library lint-staged nix prettier starter ts-jest tslint typescript
Last synced: 3 months ago
JSON representation
Starter project structure for typescript projects
- Host: GitHub
- URL: https://github.com/rencire/ts-lib-starter
- Owner: rencire
- License: gpl-3.0
- Created: 2018-03-21T02:23:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T15:15:59.000Z (over 3 years ago)
- Last Synced: 2025-06-03T16:06:57.398Z (about 1 year ago)
- Topics: husky, jest, library, lint-staged, nix, prettier, starter, ts-jest, tslint, typescript
- Language: JavaScript
- Homepage:
- Size: 500 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typescript lib starter
An opinionated typescript starter project with focus on packaging modern code for ES modules on Browser and NodeJS runtimes.
- Transpiles Typescript source to ES2018 files.
- Specifyes `type: "module"` in `package.json` to assume all `.js` files are using ES modules.
- Can still write `commonjs` files via `.cjs` file extension.
- See [docs](https://nodejs.org/docs/latest-v12.x/api/esm.html#esm_code_package_json_code_code_type_code_field) for more info.
- Output a type declaration file to `lib/main.d.ts`.
## Prerequisites
- Git
- Nixos/Nix (w/ or w/o direnv) OR nvm OR nodjs installed on system.
```
git clone https://github.com/rencire/ts-lib-starter
cd
rm -rf .git
```
Choose one of the following:
### Nixos/Nix + Direnv (preferred):
If you're using [nix](https://nixos.org/nix/), and have [direnv](https://direnv.net/) installed (e.g. `nix-env -i direnv`), simply
cd` into this repo and the correct nodejs version will be installed.
### Nixos/Nix
Simply run:
```
nix-shell
```
### NVM
If you have [nvm](https://github.com/nvm-sh/nvm), a `.nvmrc` file is provided.
# Notes
## TODO
- [ ] migrate scripts outside of package.json
- simple bash scripts?
- consider going old school and use `makefile` for more complicated build workflows: http://www.olioapps.com/blog/the-lost-art-of-the-makefile/
- If need more integration w/ js ecosystem, consider [jakefile](https://github.com/jakejs/jake)
- [] add semantic release:
- https://github.com/semantic-release/semantic-release
## Tools
- https://github.com/Microsoft/TypeScript
- https://github.com/palantir/tslint
- https://github.com/prettier/prettier
- https://github.com/okonet/lint-staged
- https://github.com/typicode/husky
- https://github.com/kulshekhar/ts-jest