Skip to content

Start writing stuff in TypeScript without bothered by configurations

Notifications You must be signed in to change notification settings

jokester/typescript-boilerplate

Repository files navigation

typescript-boilerplate

TypeScript templates I use to immediately start doing something, with opinionated configuration.

How To Use

Download zip / tar.xz files from Github releases. Each file contains 1 variant.

Variants

nextjs, for a frontend + server monolith

Based on create-next-app template.

Plugins:

Libraries:

Not configured for serverless or SSG, I don't use Next.js for them.

preact-spa, for frontend-only SPA

based on create-vite template

Libraries:

If you need to host built assets with path rewriting, I recommend hono-worker variant, or serve-handler (example).

hono-worker, for edge-worker like environments

  • based on hono
  • Capable of hosting SPA created by vite-preact

empty, an empty npm package

  • Can be used for any purpose, a new library or CLI or else.

Conventions shared by all variants

All the variants contains a similar set of configurations and npm scripts:

  • tsconfig.json
  • jest / ts-jest for testing
  • gts prettier eslint for linting and formatting
  • npm dev
  • npm typecheck / npm typecheck:watch
  • npm lint / npm lint:fix
  • npm test / npm test:watch / npm test:coverage
  • npm build / npm analyze

The principles behind current (opinionated) settings are:

  • Be strict as possible in TypeScript.
  • Be close to upstream defaults, but with some opinionated changes

Obsolete Variants

  • obsolete/web-gatsby
  • obsolete/craco-react
  • obsolete/aws-api-gateway
  • obsolete/mobile-react-native
  • obsolete/web-tsup

LICENSE

  • work from upstream repositories follows their licenses
  • other contents are MIT licensed
  • other contents are WTFPL licensed too