Skip to content
View as Markdown

Update Packages ​

An ERP Kit release changes several parts of your project, and each part updates in a different way. This page takes them in order. Every command states the directory it runs in.

Replace these placeholders before running anything:

  • <app>: your app's folder under apps/, such as my-erp
  • <version>: the ERP Kit version you are upgrading to, such as 0.66.0

What an upgrade changes ​

PartUpdated byNotes
@tailor-erp/kitpnpm add in the root, the backend, and the frontendAll three versions must match. The ERP Kit skills refuse to run while they differ.
Skills, ERP Kit workflows and actionspnpm exec erp-kit updateThis is all that command touches.
Tailor SDK and SDK pluginspnpm add in the root and the backendUse the versions the new ERP Kit template pins.
Your app folder apps/<app>Nothing automaticThe folder is a copy of a template. Step 3 brings template changes in.
Database schema and dataA TailorDB migration, when a release needs oneSee Migrate data on upgrade.
CI workflows from erp-kit setup cipnpm exec erp-kit setup ciOnly if you use them.

Before you start ​

  • Commit or stash everything. git status should print nothing, so the upgrade's diff is clean.

  • Check your installed versions, from the repository root:

    bash
    pnpm ls -r --depth 0 @tailor-erp/kit @tailor-platform/sdk
  • Check the latest ERP Kit version. If this returns 401, see Registry access.

    bash
    npm view @tailor-erp/kit version

1. Get the change list ​

Run the update advisor before you change any version. It compares the installed version with the target, reads the release notes, and lists the files in your app that the changes touch. If a release has breaking database changes, it also generates a migration scaffold. In your coding agent, from the repository root:

/erp-kit-update-advisor

Keep the report; step 3 applies it. The advisor only reports and does not edit your files. After the upgrade it sees no difference and reports nothing, so run it first.

2. Upgrade the packages ​

Run these from the repository root.

  1. Upgrade ERP Kit at the root:

    bash
    pnpm add -D -w @tailor-erp/kit@<version>
  2. Read the SDK and plugin versions the new template pins:

    bash
    grep -h '"@tailor-platform/' \
      node_modules/@tailor-erp/kit/templates/scaffold/project/package.json \
      node_modules/@tailor-erp/kit/templates/scaffold/app/user-management/backend/package.json

    Use these versions in the next commands, not the latest from npm. ERP Kit is tested against the pinned versions.

  3. Upgrade the SDK and the setup plugin at the root:

    bash
    pnpm add -D -w @tailor-platform/sdk@<sdk-version> @tailor-platform/sdk-plugin-setup@<setup-plugin-version>
  4. Refresh skills, workflows, and actions:

    bash
    pnpm exec erp-kit update

    This also removes erp-kit-* skills that ERP Kit no longer ships. Your own skills are not touched. To refresh only some resources, name them: erp-kit update skills.

  5. Pin each app to the same versions. The backend uses ERP Kit at runtime, so it goes in dependencies. The frontend uses it only for lint, so it goes in devDependencies. If the template backend lists a plugin that yours lacks, add it with the version from step 2.

    bash
    pnpm --dir apps/<app>/backend add --save-prod @tailor-erp/kit@<version> @tailor-platform/sdk@<sdk-version>
    pnpm --dir apps/<app>/frontend add -D @tailor-erp/kit@<version> @tailor-platform/sdk@<sdk-version>
  6. Check that the versions match:

    bash
    pnpm exec erp-kit internal measure versions

    The output must show "status": "ok". A violation names the file whose version differs.

3. Update the app ​

Choose one option. Option A is the normal case once you have written code.

Option A: Apply the changes to your app ​

In your coding agent, with the advisor report from step 1 in the conversation:

Apply every change in the advisor report to apps/<app>, using
node_modules/@tailor-erp/kit/templates/scaffold/app/user-management/ as the reference copy.
Keep name, cors, and every file I added myself.

Review git diff before going on. Without an advisor report, list the files that differ between the template and your app, and compare them by hand or hand them to your agent:

bash
diff -rq node_modules/@tailor-erp/kit/templates/scaffold/app/user-management/backend apps/<app>/backend | grep -v 'Only in apps'
diff -rq node_modules/@tailor-erp/kit/templates/scaffold/app/user-management/frontend apps/<app>/frontend | grep -v 'Only in apps'

Use the template your app was created from in place of user-management.

Option B: Re-create the app from the template ​

Only if apps/<app> has no code of yours. First save apps/<app>/backend/.env and the application ID: the id in apps/<app>/backend/tailor.config.ts, or the app's entry in .github/tailor.lock if you have run erp-kit setup ci. Then, from the repository root:

bash
rm -rf apps/<app>
pnpm exec erp-kit app init <app> apps -t user-management

Restore .env and the ID. With the ID restored, the next deploy updates your existing application instead of creating a second one.

After either option ​

From the repository root:

bash
pnpm install
pnpm --dir apps/<app>/backend run typecheck
pnpm --dir apps/<app>/frontend run typecheck

4. Deploy to your development workspace ​

Run from apps/<app>/backend. Confirm that .env points to your own development workspace first:

bash
pnpm exec tailor workspace get --env-file .env
pnpm run deploy

Success ends with Successfully applied changes. If the frontend build fails, the backend is already applied: fix the error and run pnpm run deploy again. Run pnpm run seed only if the release notes say the seed files changed.

If the advisor reported a database migration, apply it as described in Migrate data on upgrade before deploying to a workspace with data you need to keep.

5. Regenerate CI ​

Skip this if you have not run erp-kit setup ci. Otherwise run it again, in your own terminal, with the same options:

bash
pnpm exec erp-kit setup ci --region <region>
node_modules/.bin/tailor setup check

The check must end with No drift detected. See Set up CI for which edits survive a re-run.

6. Commit ​

Expect changes in these places. Anything else is worth a second look.

  • package.json at the root and in apps/<app>/backend and frontend, plus pnpm-lock.yaml
  • .agents/skills/ and .claude/skills/
  • .github/workflows/ and .github/actions/
  • The app files from step 3, including the regenerated tailor.d.ts and src/graphql/generated/
  • .github/tailor.lock, if you ran step 5
bash
git add -A
git commit -m "chore: upgrade erp-kit to <version>"

Automate update checks with Renovate ​

erp-kit init adds a renovate.json that already points @tailor-erp/* packages at the Tailor registry. Renovate also needs a credential for that registry, which the file cannot hold:

  • Add a host rule for registry.tailor.tech in your organization's Renovate settings in the Mend developer portal (developer.mend.io).
  • Without it, Renovate gets a 401 from the registry and reports no updates for @tailor-erp/*, without an error. If Renovate never proposes an ERP Kit upgrade, check this first.

A Renovate pull request changes only version numbers. Use it as the signal to follow this page: run the advisor from the default branch, where the old version is still installed, then apply the template changes and regenerate CI on the Renovate branch.

Troubleshooting ​

SymptomCauseFix
measure versions reports violationsAn app pins a different ERP Kit version than the root.Run the commands in step 2.5 for the app it names.
The advisor says you are up to date, but the app has the old templateIt ran after the upgrade. It compares only the installed and latest versions.Use the diff -rq commands in option A.
setup ci prints "re-run in an interactive terminal"It ran from a coding agent or a script, so its question could not be shown.Run it in your own terminal.
ERP Kit ends up in the backend's devDependenciespnpm add keeps a package in the section it is already in.pnpm --dir apps/<app>/backend remove @tailor-erp/kit, then add it again with --save-prod.
pnpm run deploy fails while building the frontendUsually a type error from a template change not yet applied, or a stale generated schema.Fix the error, then run pnpm run deploy again. The backend is already applied.
A pnpm command fails with Could not obtain a Tailor registry tokenYour Tailor login has expired.See Registry access.