Test an integration in an app

Install your packed package in an app and run the commands its users will run.

Install the packed package in an app

Pack the package beside its folder, so the next pack does not ship it, then install it in an app together with Core and the CLI. The app loads your package because it is a dependency.

bash
# In the package
npm pack --pack-destination ..
​
# In an app folder beside it
npm install @astryxdesign/core @astryxdesign/cli ../acme-astryx-widgets-1.0.0.tgz
  • Install the CLI in the app too: npx astryx runs the CLI from the app's node_modules.
  • The app holds a copy, not a link. After each change, pack again and run the same npm install.
  • Reading your work inside the package shows your source. The app shows what npm would publish.

Check what the app sees

From the app folder, run the commands your users run. Each should show your contribution under your package name.

bash
npx astryx component AcmeCarousel
npx astryx template --list --package @acme/astryx-widgets
npx astryx theme list --package @acme/astryx-widgets
npx astryx docs acme
npx astryx search deploying --type doc
CommandLook for
component AcmeCarouselimport {AcmeCarousel} from '@acme/astryx-widgets/components/AcmeCarousel';
template --list --packageAn acme-dashboard entry with package: @acme/astryx-widgets
theme list --package- ocean (maintained, @acme/astryx-widgets)
docs acmeYour section, with guides such as deploying
search deploying --type docacme/deploying as the first result

--package narrows template --list and theme list to one package. component --list ignores it and lists Core too, so look a component up by name. Last, import AcmeCarousel in the app's code and build the app, as your users will.

Run doctor in the app

npx astryx doctor checks the whole app, including every package it loaded. doctor integration validate checks your package as the app installed it.

bash
npx astryx doctor
npx astryx doctor integration validate @acme/astryx-widgets
text
id: implicit-integrations
status: [info]
label: Implicitly linked integrations
message: 1 integration loaded from installed dependencies with no astryx.config entry: @acme/astryx-widgets@1.0.0 from dependencies, contributing components, templates, themes, docs, codemods.
  • The implicit-integrations row names each package the app loads with no config. [info] is expected.
  • The docs-progressive-disclosure row warns when one of your doc sections is over 32 KB. The doctor integration checks do not measure size.
  • doctor integration validate @acme/astryx-widgets prints [ok] No integration issues found. when the installed copy is sound.