https://github.com/timobechtel/template-ts-lib
Typescript project template for library authors.
https://github.com/timobechtel/template-ts-lib
Last synced: 6 months ago
JSON representation
Typescript project template for library authors.
- Host: GitHub
- URL: https://github.com/timobechtel/template-ts-lib
- Owner: TimoBechtel
- License: mit
- Created: 2022-02-25T17:37:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-27T14:59:16.000Z (almost 3 years ago)
- Last Synced: 2024-12-29T06:10:52.180Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 235 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🧩
v__PROJECT_NAME
v__PROJECT_DESCRIPTION
·
Report Bug / Request Feature
·
## Table of Contents
- [About](#about)
- [Installation](#install)
- [Usage](#usage)
- [Development / Contributing](#Development-Contributing)
## About
This template is an opinionated boilerplate for typescript libraries.
## TL;DR
```sh
pnpm dlx degit TimoBechtel/template-js-lib && pnpm i && ./init-scripts/init.sh
```
## Install
There are multiple ways to use this template:
- use the Github template feature
- use [degit](https://github.com/Rich-Harris/degit)
```sh
pnpm dlx degit TimoBechtel/template-js-lib
```
## Usage
1. Search for variables starting with `v__` to edit the most important variables. (e.g. `v__PROJECT_NAME`) or simply run `./init-scripts/init.sh` for an interactive setup.
2. Enable github workflows, if needed, by renaming the `disabled.github/workflows/` folder to `.github/workflows/`
3. Create an npm token and add it to the github project settings, if you want to publish to npm.
## Package format / Browser support
### Format
This package is compiled to support both CommonJS and ES modules.
### Transpilation / Browser support
This package is not transpiled to support older browsers. This reduces the package size and performance and allows the consumer to choose the transpilation target.
If you need to support older browsers, you can configure your bundler to transpile this package.
Example when using Next.js ([docs](https://nextjs.org/docs/advanced-features/compiler#module-transpilation))
```js
module.exports = {
transpilePackages: ['v__PROJECT_NAME'],
};
```
## Development / Contributing
### Run tests
```sh
pnpm test
```
### Commit messages
This project uses semantic-release for automated release versions. So commits in this project follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) guidelines. I recommend using [commitizen](https://github.com/commitizen/cz-cli) for automated commit messages.