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 packagenpm pack --pack-destination ..# In an app folder beside itnpm install @astryxdesign/core @astryxdesign/cli ../acme-astryx-widgets-1.0.0.tgz
- Install the CLI in the app too:
npx astryxruns the CLI from the app'snode_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.
bashnpx astryx component AcmeCarouselnpx astryx template --list --package @acme/astryx-widgetsnpx astryx theme list --package @acme/astryx-widgetsnpx astryx docs acmenpx astryx search deploying --type doc
| Command | Look for |
|---|---|
component AcmeCarousel | import {AcmeCarousel} from '@acme/astryx-widgets/components/AcmeCarousel'; |
template --list --package | An acme-dashboard entry with package: @acme/astryx-widgets |
theme list --package | - ocean (maintained, @acme/astryx-widgets) |
docs acme | Your section, with guides such as deploying |
search deploying --type doc | acme/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.
bashnpx astryx doctornpx astryx doctor integration validate @acme/astryx-widgets
textid: implicit-integrationsstatus: [info]label: Implicitly linked integrationsmessage: 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-integrationsrow names each package the app loads with no config.[info]is expected. - The
docs-progressive-disclosurerow warns when one of your doc sections is over 32 KB. Thedoctor integrationchecks do not measure size. doctor integration validate @acme/astryx-widgetsprints[ok] No integration issues found.when the installed copy is sound.