Skip to content
/ starter-ts Public template
forked from antfu/starter-ts

Starter template for TypeScript library

License

Notifications You must be signed in to change notification settings

thomaschampagne/starter-ts

 
 

Repository files navigation

starter-ts

npm version npm downloads bundle JSDocs License

Introduction

Looking to create a TypeScript library? You can use this repository as a starter kit which comes with all the necessary setup. It based on antfu/starter-ts with few improvements:

  • Enforced ESLint rules.
  • TypeDoc documentation generator.
  • Auto update of the README.md table of content.
  • Auto update of library dependencies.
  • Husky in place of simple-git-hooks as pre-commit linting validator

For demonstration purposes, I included a password generator called Sesame in this starter library.

To get started, simply replace the content in these 2 files with your own code:

  • src/index.ts
  • test/index.test.ts

Happy coding 🙂 !

Package description

_description_

Install

npm install your-package-name

Replace your-package-name, thomaschampagne, starter-ts, thomaschampagne/starter-ts and _description_ globally to use this template.

Usage

This below usage is for demonstration purposes.

const passwordLength = 24;
const password = Sesame.create(passwordLength);

Replace this usage with yours.

Development

Setup

  • Install the latest version of pnpm globally
npm uninstall -g pnpm
npm install -g pnpm@latest

Note: If you never installed pnpm before, you may need to reload your shell to access pnpm CLI.

  • Then install the lib dependencies
pnpm install

Build library

pnpm run build

Run tests

pnpm run test

Run linting check

pnpm run lint

Fix errors with:

pnpm run lint:fix

Generate library documentation

pnpm run docs

Documentation is generated using TypeDoc.

Update library dependencies

pnpm run upgrade:libs

Integrate library

Run common tasks all-in-once:

  • Update to latest dependencies and install them
  • TypeScript check
  • Lint fixes
  • Tests
  • Build
  • Update README.md table of content
  • Generate documentation
pnpm run integrate

Appendix

Update the table of content of this readme

pnpm run readme:toc

License

MIT License © 2023-PRESENT Thomas Champagne

About

Starter template for TypeScript library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 49.5%
  • Shell 34.2%
  • JavaScript 16.3%