Contributions are subject to CARTO's community contributions policy.
- Yarn v4+
- Node.js v18+
To configure Node.js and Yarn versions, install nvm and run:
# set recommended Node.js version
nvm use
# enable Corepack, which will set recommended Yarn version
corepack enableTo install and build @carto/api-client locally from source:
# install dependencies
yarn
# build package once
yarn build
# build package and watch for changes
yarn build --watch
# build package, watch for changes, and start a local server for examples
yarn devAfter running yarn dev, a browser window will open with links each example. The local URL will generally be localhost:5173.
To run tests, coverage, or a linter:
# run tests once
yarn test
# run tests and watch for changes
yarn test:watch
# run tests and gather code coverage
yarn coverage
# lint for style and formatting errors
yarn lint
# fix style and formatting errors
yarn formatTests, coverage, and other development-related scripts are defined in package.json#scripts.
-
Update changelog
-
Create a new version:
yarn version [ major | minor | patch ] -
Commit, tag, and push to GitHub:
yarn postversion -
Publish
Open a pull request, get any required approvals, and merge. Merged pull requests with commit messages beginning
chore(release)will trigger a release automatically.
To publish a prerelease from any branch, manually run the “Release” workflow, selecting the target branch in the menu.
It will bump the patch version and add prerelease tags to make it unique:
Example: 0.5.26 → 0.5.27-alpha.482101a.112
The package is published to npm under the alpha dist tag. A dry_run option is available to test the workflow without publishing.