@bigbinary/neeto-audit-frontend
v2.0.20
Published
Audits neeto frontend codebase for issues and suggests a fix.
Downloads
427
Readme
neeto-audit-frontend
A package that audits neeto frontend packages for neeto-specific configuration and guidelines and suggests a fix.
Getting Started
neeto-audit-frontend
has 5 checks to ensure neeto guidelines are being followed:
- Checks whether the package uses the common ESlint configuration from
neeto-commons-frontend
. - Checks whether the package uses the common prettier and tailwind configurations.
- Checks whether the package uses the same set of husky pre-commit and pre-push hooks.
- Checks whether the package uses the specified node version in
.node-version
and.nvmrc
files. - Checks whether the package uses the recommended versions of common npm packages including other neeto packages.
There are different types of frontend packages in neeto: nanos, widgets, extensions and frontend packages.neeto-audit-frontend
maintains a local copy of the common configuration and a different local copy if any type of package follows a different configuration. For example, ESlint configuration is different for nanos, widgets and extensions. A local copy is maintained for each of these. The files in a package are tested against these versions to see if they match. If any check fails, it will provide the command that the user can run to fix that specific check before committing.
Installation
yarn add -D "@bigbinary/neeto-audit-frontend@latest"
Run the audit
yarn neeto-audit-frontend
Add CI check
Add the following lines to the neetoCI YAML file.
setup:
- yarn install
jobs:
- name: CiChecks
commands:
- yarn neeto-audit-frontend
Making changes to the configuration
If any changes are made to the configuration files being checked by neeto-audit-frontend
, the audit check will fail. If this change is necessary, we should make the same changes in the local copy maintained in neeto-audit-frontend
to ensure the checks will pass.
Development instructions
neeto-audit-frontend
uses pnpm
as the package manager. To setup the development environment run pnpm install
after cloning the repository. After making changes to the verifiers, we can test the changes locally by using yalc
. Follow the steps mentioned in Testing frontend packages to test the changes.
If, for any reason, yarn neeto-audit-frontend
command fails after pushing the changes using yalc
, run yarn install --check-files
.
Building and Releasing
The @bigbinary/neeto-audit-frontend
gets published to NPM when we merge a PR with patch
, minor
or major
label to the main branch. The patch
label is used for bug fixes, minor
label is used for new features and major
label is used for breaking changes. You can checkout the Create and publish releases
workflow in GitHub Actions to get a live update. Please note that before publishing the package, you need to verify the functionality in some of the neeto web-apps locally using yalc
package manager.