Welcome to the package development guide for NOBEARS frontend packages. This documentation covers our standardized approach to developing, maintaining, and releasing frontend packages.
At NOBEARS, we maintain several types of packages:
@nobears-front-end/nuxt-ui)@nobears-front-end/nuxt-statamic)This guide will walk you through:
Whether you're building a new package or maintaining an existing one, this guide ensures you follow our best practices and workflows.
Before we get started, let's take a look at the different types of packages we maintain.
@nobears-front-end/nuxt-ui is a great example of this.@nobears-front-end/nuxt-statamic is a module for the Statamic CMS integration.Before you start creating a new package, you should first check with other developers if the package is not already created or if it's not already in the process of being created. If you can't find a package that fits your needs, you can create a new one (if you have permission to do so of course).
We use a Jira board to keep track of all the packages we maintain, if you need to create a new package, please create a new ticket in Jira in order to get the process started. From there you should start by describing the package you want to create, what it will be used for and what it will contain.
Once you have the green light from the team, you can start by creating a new package.
@nobears-front-end/<tech-stack>-<package-name>@nobears-front-end/nuxt-ui@nobears-front-end/nuxt-statamic@nobears-front-end/statamic-templateIf we take a look at the nuxt-statamic package, you'll notice that it has 2 frameworks/ tech stacks in the name.
This is because it's a package that is used to integrate Statamic with Nuxt, in these cases it's best to use the naming convention <tech-stack-of-the-project>-<tool-or-integration-name>.
MAJOR.MINOR.PATCH1.0.0-beta.1package.json: Package configurationREADME.md: Package documentationCHANGELOG.md: Version historytsconfig.json: TypeScript configurationtypes/: TypeScript types (we prefer to use .ts files instead of .d.ts files)test/: Test files (if applicable)Adding documentation to your package is done by adding a docs folder to the root of your package.
This folder will be read by our frontend doc, thus automatically adding your package to the general documentation site.
docs/ directoryIf you want to get started with working on a new feature, the first thing you should do is create a new ticket in the Jira board. Before you start working on a new feature, it must first be approved by the team. When you have the green light, you can start by creating a new branch.
If you are working on a Jira ticket, you should create a new branch based on the preview branch, using the following naming convention: story/FE-{ticket-id}.
In order to correctly manage the changelog, we have a set of commitlint rules that are used to ensure the commit messages are correct for the changelog.
To create a commit, use the following command:
pnpm commit
Or you can use the following command to commit all changes:
pnpm commit:all
This will open a prompt to help you write a commit message that adhears to the commitlint rules.
The following commit types will not be automatically added to the changelog in order to keep the changelog clean and readable:
We follow a structured release process to ensure quality and stability across both beta and stable releases. Specifically, we use release-it to release new versions of our packages.
It is a requirement that you use the correct commit message syntax. If you skip this step, we can't properly update the changelog.
pnpm commit command to create a commit with the correct commit message syntax.You will most likely never be in a situation where you need to release a beta version, since small changes are mostly released as a patch version.
Skip to 'releasing a stable version' if you don't need to release a beta version.
But since there are some cases where it is needed, we have the following process for it:
preview branch.Creating a new branch is done by using the following naming convention: story/FE-{ticket-id}.
Be sure to create the new branch from the preview branch.
pnpm commit
For more information on how to write a commit, please refer to the commit syntax section.
Share the MR with the team for review. Be sure to include a short description, MR link and link to the Jira ticket if you have one.
previewpnpm release-beta
This process will create a new beta version of the package and update the CHANGELOG.md file.
Create a new merge request for merging the preview branch into the main branch. After which you can share the MR with the team for review. Be sure to include a short description, MR link and link to the Jira ticket if you have one.
mainpnpm release
This process will create a new stable version of the package and update the CHANGELOG.md file.