Hello, and welcome! Whether you are looking for help, trying to report a bug, thinking about getting involved in the project or about to submit a patch, this document is for you! Its intent is to be both an entry point for newcomers to the community (with various technical backgrounds), and a guide/reference for contributors and maintainers.
Consult the Table of Contents below, and jump to the desired section.
This project uses the vue-cli for linting, testing, and building. See package.json for all currently used plugins.
If it passes linting, YOLO. Improvements to ASCII art encouraged.
# Autofixes any linting issues
yarn lint
# Outputs linting issues that need to be fixed without fixing
yarn lint --no-fix
Swrv has a suite of unit tests that are meant to be as comprehensive as possible. They run in CI and are required to pass in order to merge.
# Run all tests
yarn test
# Run all tests and watch file changes to trigger a rerun (also enters jest mode to filter tests)
yarn test --watchAll
# Run just a single test file
yarn test use-swrv
Tests can get you most of the way there when developing a new feature. However, you will want to test it in a real app eventually.
This could be better experience. If you want to develop swrv and test that the esm/dist bundles are working correctly, you can run the build command and copy the bundle to your project.
yarn build
Output inside esm
, and dist
will contain output from tsc
build. Move this
into your project and change import statements. Using yarn link
is an exercise
left to the reader. Contributions to this doc are welcome if you get it working!
Note: this is for maintainers of the repo, with access to publish to NPM
After merging a PR, you will want to get it up on the registry for everyone to use.
- bump the version according to semver in the
package.json of the repo with the appropriate new version
x.x.x
git commit
with the messagechore(release) x.x.x
directly to your local master.- Build the library artifacts
yarn build
- Login as an authorized npm user (has access to swrv npm package)
npm publish
- Once published, git push to origin/master
- draft a github release following the naming conventions of the other releases.