Upgrading
Update your package for each Astryx release, and help apps upgrade with it.Update for a new Astryx release
When Astryx ships a release, bump your devDependencies, rerun the checks, widen your peer ranges, and ship a codemod for each change that breaks apps.
bash# 1. Build and test against the new releasenpm install -D @astryxdesign/cli@latest @astryxdesign/core@latest# 2. Rerun the checksnpx astryx doctor integration validatenpx astryx doctor integration docsnpx astryx integration verify# 3. Admit the new Core once the checks passnpm pkg set 'peerDependencies.@astryxdesign/core=^0.6.0 || ^0.7.0'# 4. Migrate apps across a change that breaks themnpx astryx integration add codemod rename-delay --to 0.7.0
- Run every check in
astryx docs cli/integrations/ship/checks, not only the ones shown. - Name each codemod folder after the Core version whose upgrade should run it; see
astryx docs cli/integrations/building-blocks/codemods. - Release the result as a new version of your package; see
astryx docs cli/integrations/ship/publishing.
Upgrade an app
After an app installs a new Core, astryx upgrade runs the codemods for the versions it crossed. It is a dry run by default; --apply writes the changes.
bash# Preview what would change; nothing is writtennpx astryx upgrade --from 0.6.3 --integration @acme/astryx-widgets# Write the changesnpx astryx upgrade --from 0.6.3 --integration @acme/astryx-widgets --apply
textIntegrations: @acme/astryx-widgets1 codemod to runApplying integration codemods...Rename AcmeCarousel delay to interval (v0.7.0, @acme/astryx-widgets)[ok] [ok] src/Hero.tsx
--fromis the@astryxdesign/coreversion the app had before, and the target is the installed Core.--integrationnames your package. Without it, or anintegrationsentry inastryx.config, the upgrade skips your codemods, even when the app has your package installed.- The count includes Core's codemods for the same versions, which run first.
- Put this command in your release notes.
Know which files upgrades skip
Upgrades never write files that the app marks as generated, vendored, or ignored. When such a file still needs a codemod change, the upgrade stops with ERR_CODEMOD_PROTECTED and exit code 1.
- Generated: an
@generatedcomment at the top of the file, orlinguist-generatedin.gitattributes. - Vendored:
linguist-vendoredin.gitattributes. - Ignored: a match in
.gitignoreor.hgignore.
text! ! src/gen/Gen.tsx - protected by @generated in the leading comment blockERR_CODEMOD_PROTECTED: 1 protected file still requires a codemod change:src/gen/Gen.tsx — @generated in the leading comment blockUpgrade incomplete: protected changes remain
The upgrade still writes every other file. Its options and exit codes are in astryx docs cli/commands/upgrade.