This applies to forks with custom pieces created before pieces moved to self-contained bundles. Pieces created with
npm run cli pieces create already use the bundle model — nothing to do.What changed
| Before | Now | |
|---|---|---|
| Piece dependencies | @activepieces/shared + framework + common | framework + common only |
| Imports in piece code | @activepieces/shared and @activepieces/pieces-framework | @activepieces/pieces-framework only |
| Build output | compiled files + dependency tree | one self-contained bundle |
@activepieces/shared location | packages/shared | packages/core/shared (same package name) |
@activepieces/pieces-framework and @activepieces/pieces-common. The framework re-exports the foundation symbols (isNil, SeekPage, PieceCategory, AppConnectionType, and so on) that used to come from @activepieces/shared.
Migrate with the CLI
Thepieces migrate command applies every change below for you:
- Pass
--allto migrate every piece underpackages/pieces. - It is idempotent — re-running it on an already-migrated piece makes no changes.
What it changes (or migrate by hand)
Repoint imports to the framework
Replace any If a symbol isn’t re-exported by the framework, it was server-only and shouldn’t be imported into a piece.
@activepieces/shared (or @activepieces/core-*) import with @activepieces/pieces-framework:Update package.json dependencies and scripts
Remove
@activepieces/shared and move tslib to devDependencies. Add @activepieces/core-piece-types and @activepieces/core-utils — these are build-time only (they let tsc emit portable type declarations; your source never imports them directly). Add the bundle script.Add the import-boundary lint rule
Add a
no-restricted-imports rule to the *.ts/*.tsx override in the piece’s .eslintrc.json so it can’t regress to importing packages that defeat bundling: