tsi-component-library
Merge guidelines
Main branch @beta
All pull requests merged into the main branch should be done so using a squash and merge commit. If you're the contributor who approves the squash and merge, be sure to author a commit message using these these guidelines. The merge message will be parsed in order to determine the next semantic version.
Each squash and merge commit message will represent one change in the release notes. <type>(optional scope): <description>
<type>
These types will bump the semantic version
fix:Patches a bug in your codebase (this correlates withPATCHin semantic versioning).feat:Introduces a new feature to the codebase (this correlates withMINORin semantic versioning).perf:: A code change that improves performance (this correlates withPATCHin semantic versioning).!: Appending an ! after the type/scope, introduces a breaking API change (correlating withMAJORin semantic versioning). A BREAKING CHANGE can be part of commits of any type.
Note: If the type is feat, fix or perf, the semantic version will change. BREAKING CHANGES denoted by any type followed by ! will result in a major version bump.
These types will not change the semantic version, but will be included in the release notes of the next semantic version change.
chore:Changes to the build process or auxiliary tools and libraries such as documentation generationdocs:Documentation only changesstyle:Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor:A code change that neither fixes a bug nor adds a featuretest:Adding missing or correcting existing tests
(optional scope)
A scope may be provided to a commit’s type, to provide additional contextual information and is contained within parenthesis, e.g., feat(parser): add ability to parse arrays. The scope could be anything specifying place of the commit change. For example tools,
adapters, Linechart, Models, etc...
<description>
Contains succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end
Release branch @latest
All releases should be triggered by opening a pull request from main into release. Releases should use traditional merge commits (not squash and merge). This will ensure the semantic version number for the release is automatically determined based on the previously squashed commits merged into main.
Recommended VS Code extensions
We recommend you install the following vs-code extensions to streamline the code quality and linting process.
| Name | Purpose |
|---|---|
| Prettier - Code formatter | Enforces a consistent style by parsing your code and re-printing it. To ensure that this extension is used over other extensions you may have installed, be sure to set it as the default formatter in your VS Code settings. This setting can be set for all languages or by a specific language. To allow for auto-linting on file save, you must have the default formatter set as prettier-vscode and have Editor: format on save checked. These settings can be changed in your VS Code preferences. A JavaScript comment of `// prettier-ignore |
| ESLint | Integrates ESLint into VS Code. If you are new to ESLint check the documentation. |
| stylelint | A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint |
Important NPM commands
Command (prefix with npm run) |
Effect |
|---|---|
build |
Bundles library with rollup.js |
storybook |
Starts Storybook UI component explorer |
test |
Run jest test suite |
test:watch |
Run tests in hot-reloading watch mode |
lint |
Formats code to conform to prettier and stylelint format |
lint:check |
Checks for eslint, prettier, and stylelint formatting errors/warnings. |
generate [componentName] |
Creates template files for new component named [componentName] |