This is a monorepo, made with lerna and yarn workspaces. We recommend node version >=18
Clone and execute
yarn
From now on, use one of the root level commands, that lerna will execute for all internal packages, like for example:
yarn build
yarn test
If you have issues, you can always run yarn build:clean
. It will perform a full clean and then ensure that install, build and test work fine
If you want to link these packages to the templates repo, build & then execute here
yarn link-all
Then, inside the proper template folder in carto-react-template, link packages with:
yarn link-carto-react
As an alternative to yarn link
, copy-packages.sh
could be used for copying the content of every package to the target directory, e.g:
./copy-packages.sh ~/workspace/repositories/cloud-native/workspace-www/node_modules/@carto
Thus, combined with the execution of yarn build
in the root of this repository, will copy every package into the target directory:
yarn build && ./copy-packages.sh ~/workspace/repositories/cloud-native/workspace-www/node_modules/@carto
You will need npm credentials under @carto organization.
- Create a new branch from master, named after the new version (eg, if current version is v1.0.0-rc.2,
git checkout -b release-1.0.0-rc.3
) - Modify the changelog, creating a new entry with current contents from
Not released
for the new release; eg:## 1.0.0-rc.3 (2021-03-22)
. Keep 'Not released' header for the future work, and commit it to the new branch - Push that branch upstream, with something like
git push --set-upstream origin v1.0.0-rc.3
- Open a PR, with for eg.:
https://github.com/CartoDB/carto-react/pull/new/v1.0.0-rc.3
- Ask your peers for revision
- Ensure current versions in package.json files are ok (eg. not 1 package with rc.2 and another one with rc.3, also in internal dependencies & peerdependencies among packages). The effective bump will be done with lerna in a step later (so we're talking just about dependencies, not the main 'version' field in packages).
- Once it's ok execute locally
yarn publish:prerelease
- Choose
Custom prerelease
and ensure the packages version proposed is correct (eg. change suffix to 'alpha' or 'beta', instead of 'rc' if required) - Adjust manually peer deps to latest published version
- Once the npm package has been published,
Merge the PR
to master from github - Update the storybook (if required, just official not prerelease versions are published). See next section below
- Coordinate with the design team on minor and major bump versions. C4R and Design system library must have the same paired version.
- Repeat the same steps as in a prerelease, but executing
yarn publish:release
- If change also applies to current master, it's recommended to start by creating a PR applying the fix it (to avoid forgetting it).
- Then create a branch for the patch release, but this time start with the desired (usually stable) branch. For example, to create a patch 1.4.8, while not affecting current master, do
git checkout -b release-v1.4.8 release-v1.4.7
. Then apply there, locally, all changes as needed. If you created a first PR for master, you can use cherry-pick to share changes among master & patch. - After having everything ready, go as usual, with changelog entry +
yarn publish:release
(Restricted to CARTO developers)
@carto/react-ui package includes a storybook with UI components, which latest version is deployed at https://storybook-react.carto.com/
To deploy there a new update:
-
Go to CI: https://github.com/CartoDB/carto-react/actions/workflows/ci.yml
-
Run workflow, choosing the correct branch