Skip to content

Boilerplate for npm modules based on TypeScript, bundled with Vite and tested with Vitest.

License

Notifications You must be signed in to change notification settings

ajaleksa/vite-ts-npm-module-boilerplate

Repository files navigation

Typescript NPM module boilerplate based on Vite

GitHub

This is a boilerplate for creating a roboust Typescript NPM modules. It uses:

Setup

  1. Fork or clone this repo
  2. Change the name of the module, author and version in package.json
  3. Set the license
  4. Set private to false if you want to publish the module to NPM, or delete it all together
  5. Change the name of the module in vite.config.ts
  6. Change main and module in package.json to point to the entry point of the module defined in vite.config.ts
  7. Setup prettier, xo and vscode to your liking
  8. Change README
  9. Upon adding js or ts files that you do not want to be linted by XO, add them to .eslintignore.
  10. Optionally, configure typedoc.
  11. Happy coding!

Usage

  1. Run npm ci
  2. Run npm run dev to start development server
  3. Run npm run build to build the module
  4. Run npm run test to run tests
  5. Run npm run lint to lint the code
  6. Run npm run lint:fix to fix linting errors
  7. Run npm run test:coverage to run tests with coverage
  8. Run npm run format to format the code
  9. Run npm run publish to publish the module to NPM
  10. Run npm run docgen to generate documentation

To be done

  • Define guidelines for browser testing

License

This project is licensed under the Unlicense.

About

Boilerplate for npm modules based on TypeScript, bundled with Vite and tested with Vitest.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published