Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaforbes/superlib
A simple template for simple typescript libraries
https://github.com/jaforbes/superlib
Last synced: about 1 month ago
JSON representation
A simple template for simple typescript libraries
- Host: GitHub
- URL: https://github.com/jaforbes/superlib
- Owner: JAForbes
- Created: 2024-02-14T08:56:01.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-03-05T22:54:12.000Z (8 months ago)
- Last Synced: 2024-04-16T09:06:37.604Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# superlib
⛅ A little template for writing simple libraries with typescript.
## Quick Start
```bash
# Clone's the repo without initializing a repository
npx degit JAForbes/superlib your-package-name# Jump in the directory
cd your-package-name# Install the deps
npm install
```## Remame your package:
Do a global search and replace for PACKAGE_NAME with your desired package name.
## Test
Tests use `node:test`, the new built in test runner in node.
To run tests in --watch mode use:
```
npm run dev
```## CI
Github actions are preconfigured so your tests and your type build will run on every push
## Build
To build run `npm run build`, your library will have type definitions generated by tsc, and an esm bundly generated by esbuild.
## Publish
To publish run `npm run publish` (make sure you've changed the package name from the default!)
By default the package.json is configured to generate a new prerelease version and publish to `next` instead of `latest`.
Somewhat confusingly, the incrementing of the version occurs after the version config is retrieved by `publish`, but its fine, its incremented for next time.
As your library matures you'll likely remove the auto versioning and the defaulted `publishConfig`.