We could publish packages with the following options:
latest- stable versionbeta- for beta testers. This version is available for the public
To switch between release modes, you could use the following commands:
latest- our default, but if we're inbetamode, you could switch tostableby running:yarn changeset pre exit- For the
betareleases run:yarn changeset pre enter beta
Ensure you have a NPM account and this account is added to the @openapi-qraft organization.
- Login to NPM:
yarn npm login --scope openapi-qraft - Create new branch
packages-version-update(-<version>)from themainbranch. - Run
yarn install --immutable - Run
yarn build:publishableto validate that publishable packages are building correctly. - Run Changesets versioning:
.changeset/version.sh
- Push your
packages-version-update(-<version>)branch that were created on step 2 to theorigin, and create a new Merge Request intomain. Review it and merge. - Checkout
mainbranch - Run
yarn build:publishableto rebuild publishable packages with the updated versions. - Run command below and answer Y:
.changeset/publish.sh
- Create the Git tags and push them to the
origin:yarn changeset tag
- Profit! 🎉
🚫 We don't use
changeset publish. Instead, we utilize Yarn for publishing. This allows us to replace theworkspace:~with a standard version syntax in our dependencies.
Add NPM Auth Token into ~/.yarnrc.yml:
yarn config set 'npmScopes["openapi-qraft"]' --home \
--json '{"npmAuthToken":"npm_YOUR_TOKEN", "npmAlwaysAuth":true}'
yarn config set 'npmScopes["qraft"]' --home \
--json '{"npmAuthToken":"npm_YOUR_TOKEN", "npmAlwaysAuth":true}'📍 Place
.yarnrc.ymlfile in the directory above the application directory or in the user's $HOME directory. In this case,npmScopeswill be inherited by the Yarn.
Please read the documentation carefully before using pre-releases: 🔗 Changesets pre-releases
Manually publishing pre-releases is done in the same way as for regular releases. 🔄
The only difference is that you will need to manually commit the pre.json file (created on yarn changeset pre enter <tag>).
⚠️ Warning! Pre-releases are very complicated! Using them requires a thorough understanding of all parts of npm publishes. Mistakes can lead to repository and publish states that are very difficult to fix.