Please ensure that you have the latest Node.js and Yarn.
This project follows GitHub's standard forking model. Please fork the project to submit pull requests.
Clone your fork:
git clone https://github.com/${username}/undercut.git
cd undercut
Undercut
is a monorepo based on Yarn Workspaces. Yarn is also used for managing dependencies, running scripts, etc.
Install Node modules before running any scripts:
yarn install
- Create a branch from the
master
with a meaningful name likefix-{something}
. - Make your changes.
- Make sure that tests pass:
yarn test
. - Check linting errors:
yarn lint
. - Check that build works:
yarn build
. - Make required documentation changes.
- Commit your changes and push the branch.
- Submit a pull request to the upstream repository.
- Make sure that CI build has no issues.
The project adheres to Semantic Versioning and Conventional Commits.
Commit types are similar to the Angular convention with slight modifications:
chore
type is used for most maintenance changes.build
andci
types are moved to scopes.style
type is renamed topolish
.
Types:
chore
-- build scripts, infrastructure, configuration, dependencies, and maintenance tasks (example scopes: ci, deps, release, website).docs
-- documentation only changes.feat
-- a new feature.fix
-- a bug fix.perf
-- code performance related changes (hopefully, an improvement).polish
-- changes that do not affect the meaning of the code code (typos, white-space, formatting, missing semi-colons, etc).refactor
-- code refactoring: big/structural changes without adding new features or fixing bugs.test
-- adding missing tests or correcting existing tests.
Additional scopes:
- Package related:
cli
,node
,pull
,push
,struct
,utils
. ci
-- continious integration and build servers related.deps
-- adding/updating/removing package dependencies.release
-- a commit related to a release, usually includes version bumps, changelog updates and has a version tag.website
-- changes related to the website.- any other that makes sense.
Linting is done by ESLint. Script's name is "lint"
, and it's available at both the root (lints the entire monorepo) and an individual package level (lints just that package):
yarn lint
No output means OK
. You can pass additional options to ESLint here.
Tests are done with Jest. Script's name is "test"
, and it's available at both the root (tests primary packages) and an individual package level (tests just that package):
yarn test
You can pass additional options (like "--watch"
) to Jest here.
Add "--coverage"
to see test coverage.
Build is done with the build
script at an individual package level. Some projects doesn't have a build
step right now, in this case there will be a message in terminal that build step is empty. If the build step isn't empty, built files go to the build
directory in the respective package.
The dist
script produces tarballs ready for distribution or publishing in the dist
folder.
Documentation is written in Markdown or MDX and is located in the docs
folder. The files will be used later to build and publish static pages on undercut.js.org.
If you're adding a new document, don't forget to reference it on the website's sidebar.
The website is built with Docusaurus and published to the gp-pages
branch and GitHub Pages service.
Algolia search configuration is located in their repo.
Custom domain is provided by JS.ORG and configured in their repo.