Skip to content

jasonkuhrt/template-typescript-lib

 
 

Repository files navigation

template-typescript-lib

trunk

Project template for TypeScript libraries

Features

  1. TypeScript
    1. Strict mode
    2. All strict flags not included in strict mode
    3. Target ES 2018 which Node as low as version 10 has good support for (kangax compat table)
    4. .tsbuildinfo cache setup, output discretely into node_modules/.cache
    5. Separate tsconfig.json for tests and src respectively
  2. jest for testing
    1. Setup with ts-jest
    2. Handy watch mode plugin jest-watch-typeahead
    3. jest.config.ts for type safe & intellisense configuration!
  3. dripip for release management
  4. Simple succinct friendly low-barrier issue templates
    1. Emojis ✈️
    2. Feature / bug / docs / something-else
    3. Config to display discussions link right in new issue type listing UI
  5. Prettier for code formating
    1. Prisma Labs config preset, 110 line width
  6. npm scripts for development lifecycle
    1. clean to remove cache files and dist
    2. build that runs clean beforehand
    3. prepublishOnly that runs build beforehand
    4. format to quickly run prttier over whole codebase
  7. CI with GitHub Actions
    1. Separate trunk and pull-request workflows.
    2. Automated trunk and PR testing across matrix of mac/linux/windows OSes and Node 12/14
    3. Automated preview releases on trunk commits
    4. OS Matrix
  8. Renovate configuration
    1. JSON Schema setup for optimal intellisense

After starting a new project with this template

  1. Setup a repo secret called NPM_TOKEN containing an npm token for CI package publishing.
  2. Adjust .github/ISSUE_TEMPLATE/config.yml to point to your repo discussions URL (or whever else you want!)
  3. Uncomment the trunk publishing in .github/workflows/trunk.yml
  4. Search-replace all instances of jasonkuhrt/project-lib-typescript to <your org>/<your repo>

Tips

  1. Update your GitHub org's label-sync repo to include config for your new repo, assuming your org has such a thing. For example for Prisma Labs: prisma-labs/label-sync.