primors v0.9.2
Primors
Package library for common React functionalities.
Live documentation
Storybook docs deployed on GH Pages: https://dagerikhl.github.io/primors
CI/CD
This project is set up with GitHub actions to trigger these actions on push to main with a new version tag.
Note: Every new version should be created using yarn version, see Release a new version.
Actions:
release: Triggers on push to the main branch with a new version tag.- Creates a new GitHub release with release notes taken from
CHANGELOG.mdfor the current version.
- Creates a new GitHub release with release notes taken from
publish-package-and-deploy-docs: Triggers on each new release.- Builds and publishes the library to the npm package registry.
- Builds and deploys the Storybook live documentation app to GH Pages.
To run these processes manually, please see Release below.
Development
Quick-start (/TL;DR)
Assumes owner of original repo or set up with similar repo structure.
- Install:
yarn install. - Develop and release:
- Make changes.
- Commit.
yarn version. (Creates a new release commit and CHANGELOG.)git push --follow-tags. (Starts GH action to publish npm packages.)yarn deploy-storybook. (Deploys SB to GH pages.)- DONE
Getting started
To install all dependencies, run:
yarn installLocal development
To build the functionalities locally, run:
yarn buildTo run the Storybook app locally, which listens for changes and hotreloads, run:
yarn storybookYou can also build a production build of the Storybook app locally by running:
yarn build-storybookRelease
Release a new version
To create a new version ready for publish and deploy, run:
yarn versionAfter creating a new version, there are two choices:
- If repo is set up with GH actions and able to publish to npm, simply push the changes, with tags:
git push --follow-tags - If not, follow Publishing npm package locally.
Publishing npm package locally
Note: Because GH actions is set up, only yarn version is necessary if pushing to a GH repo set up with this action. The action will take care of publishing the package.
That being said, to build and publish a new version of the package locally, run:
yarn version
yarn publishyarn version automatically generates a new changelog in CHANGELOG.md based on all commits since last release, and bumps the version of the package in package.json and tags the release.
yarn publish deploys a new version to the NPM package registry.
Deploying Storybook app
To build and deploy the Storybook live documentation app, run:
yarn deploy-storybookCommit format
This project uses auto-changelog to automatically generate a changelog. You can use several prefixes matching the regex specified here in your commit messages to categorize commits in your changelog:
Feat(ure)?:: New features, for the library. Changes to the Storybook app should be categorized under "Performance".Fix:: Bug fixes, for the library.Impr?(ovement)?:: General improvements, for the library.Perf(ormance)?:: Performance improvements.Doc(umentation|s)?:: Changes to documentation, e.g.README.mdor the Storybook app.Build:: Changes to the build or deploy environments.Conf(ig(uration)?)?:: Changes to project configuration.Test(s|ing)?:: Changes to test setup, test files, or new tests.- Any commits not matching one of these patterns will not be categorized.
Breaking changes
You can mark any commit as a breaking change by writing "BREAKING CHANGE" anywhere in your commit message.
Testing
This project tests its functionality with frontend unit tests, using Jest.
To run tests for the project, run:
yarn testTest coverage
Testing the library also produces a test coverage report. To view this report, run the test and open /coverage/lcov-report/index.html in your browser.
Linting
To lint the project, I suggest installing the ESLint plugin in your editor, but to run it from terminal, run:
yarn lintTechnology
This library is built using:
For testing and linting, these packages are used:
For development, these comfort-packages are used:
And for creating a view of the components for development:
Author
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago