A Svelte seed project for creating components.
> npm i
> npx husky install
> chmod +x .husky/post-merge && chmod +x .husky/pre-commit && cp .husky/post-merge .git/hooks
> npm start
-
Install dependencies
> npm i
-
Install
husky
hooks> npx husky install
-
Make sure husky scripts are executable and copied to .git/hooks
> chmod +x .husky/post-merge && chmod +x .husky/pre-commit && cp .husky/post-merge .git/hooks
-
Start the component dev server and the document server
> npm start
-
Happy coding! You're changes will be automatically rebuilt and reflected immediately on the docs.
Running either of these commands will execute all unit tests.
Command | Notes |
---|---|
npm test |
Single run with no coverage report |
npm test:watch |
Watches for changes |
npm test:coverage |
Executes tests and launches a coverage report |
Run all tests
> npm test
Run a specific test
> npm test [path-to-test-file]
Run all tests and generate a code coverage report
> npm test:coverage
Building
Run the build:docs
command to generate a dist bundle for GitHub pages.
> npm run build:docs
Deploying
Run the deploy:docs
command to automaically build the docs source and push it to gh-pages
.
> npm run deploy:docs
You can publish your package via NPM
:
- Adjust the major, minor or patch version in the
version
property of yourpackage.json
. - Login or create an
NPM
account. - Run
npm run publish
If you are looking for a private publish or other types, follow the guide here.
- Svelte - Blazing fast frontend framework that enhances HTML, CSS & JS
- Vitest - Next Generation Testing Framework
- GitHub Actions - Automate, customize, and execute workflows in your repository with GitHub Actions.
- Vite - Next Generation Frontend Tooling
- Babel - JavaScript compiler that allows next generation JS, today
- Prettier - An opinionated code formatter
- Publint - Lint packaging errors. Ensure compatibility across environments.
- ESLint - A static code analysis tool for finding issues in your code
- Husky - Hooks for running linting, formatting, etc when you push or commit
- Lint-staged - Run linters on git staged files
- NPM - Run linters on git staged files
- Svelte Package - The fastest way to build Svelte packages