Export the template and assets

Make sure the published package contains and exposes everything the copied template imports.

Keep the generated template export

integration verify resolves each template through a public package path without a file extension, such as ./templates/acme-dashboard, and fails when that path is missing.

package.json
json
{
"exports": {
"./templates/acme-dashboard": "./templates/acme-dashboard.tsx"
}
}
  • integration add writes this entry when package.json has an exports map (astryx docs cli/integrations/building-blocks/templates/start-a-template). Without a map it writes nothing, because creating one would make existing deep imports private. Add the map yourself, then the entry.
  • Keep the public path without .tsx. Only the target file ends in .tsx.
  • Do not point the entry at a barrel file that loses the template default export.

Export package-owned support files

Add a public path for every package-owned component, helper, icon, or stylesheet that the copied source imports. Keep implementation-only files private.

Relevant package.json entries
json
{
"exports": {
"./templates/acme-dashboard": "./templates/acme-dashboard.tsx",
"./components/AcmeStatusCard": "./components/AcmeStatusCard.tsx",
"./icons/AcmePulseIcon": "./icons/AcmePulseIcon.tsx",
"./styles/acme-dashboard.css": "./styles/acme-dashboard.css"
}
}

If a block is also loaded directly as a live .tsx preview, add a pattern that keeps the extension, such as "./templates/*.tsx": "./templates/*.tsx". Keep the generated entry too; integration verify resolves the template through it.

Include every file

An export can point to a file that npm leaves out. When package.json#files exists, list the integration manifest, the templates directory, and every directory the copied file depends on.

package.json
json
{
"files": [
"astryx.integration.mjs",
"templates",
"components",
"icons",
"styles",
"assets/fonts"
],
"sideEffects": ["**/*.css"]
}
  • integration add appends the manifest and templates directory when a files list already exists. Add the other directories yourself.
  • If package.json sets sideEffects, include CSS in it, as above, so bundlers keep side-effect stylesheet imports.
  • Run npm pack --dry-run and read the real file list instead of reasoning from the workspace.

Declare what the copied file imports

A copied file imports from the app, so the app must install every package it imports. Declare the Astryx peers as described in astryx docs cli/integrations/ship/versioning. For other packages:

FieldUse it for
peerDependenciesLibraries the copied source imports, such as an icon library. List them in devDependencies too, so the package itself builds.
dependenciesRuntime packages used only by package-owned modules, which should travel with the integration
devDependenciesEverything needed to build and test the integration itself

Use only ranges you test. A package that resolves only because a workspace hoisted it is not declared.