@cdx-extensions/extension-generator-mobile
v1.1.1
Published
Nx plugin for CDX mobile extension widgets and features from catalog npm overlays. Separate from @cdx-extensions/widget-template-mobile.
Readme
@cdx-extensions/extension-generator-mobile
Nx plugin for generating catalog-driven mobile extension widgets and features from published template overlays.
Part of extensibility-sdk-extension-generator. Shared catalog/cache/EJS logic lives in ../common/.
Catalog (metadata)
The generator fetches template metadata from a remote URL (not the local workspace file). FIs with a frozen repo copy still receive the latest catalog when they generate.
| Source | Default |
|--------|---------|
| Remote URL | https://raw.githubusercontent.com/candescent-dev/cdx-extensibility-apps/main/catalog/extension-templates.json |
Override priority: --catalogUrl → CDX_EXTENSION_CATALOG_URL env → built-in default.
Cached under ~/.cdx/cache/catalog/ for 5 minutes by default. Use --noCache to refresh immediately after remote catalog changes.
If the remote URL is unreachable, the generator falls back to stale cache, then catalog/extension-templates.json in the workspace.
The local catalog/extension-templates.json in the apps repo is for platform authoring only (ship/convert/sync).
Template overlays (download)
Template source files are not in the repo. Each catalog entry points at a registry package (@cdx-extensions/extension-template-mobile-<id>). At generate time the generator downloads the package tarball from the configured registry (via workspace .npmrc) and caches under ~/.cdx/cache/.
Configure registry and auth in workspace .npmrc (same as npm install for @cdx-extensions/*):
Public npm (FI / external devs):
@cdx-extensions:registry=https://registry.npmjs.org/JFrog Artifactory (internal Candescent devs):
@cdx-extensions:registry=https://candescent.jfrog.io/artifactory/api/npm/digitalbanking-npm-group/
//candescent.jfrog.io/artifactory/api/npm/digitalbanking-npm-group/:_authToken=${JFROG_NPM_AUTH_TOKEN}The generator reads @cdx-extensions:registry for the registry URL and the matching //{host}{path}/:_authToken line for auth (with ${ENV} expansion). Do not commit secrets to the repo — use env substitution or ~/.npmrc.
Install
pnpm add @cdx-extensions/extension-generator-mobileGenerate
FI apps repo (recommended)
npx nx generate-mobile-extensions from-template
npx nx generate-mobile-widget from-template
npx nx generate-mobile-feature from-templateInteractive (nx g)
npx nx g @cdx-extensions/extension-generator-mobile:generatePrompts: widget or feature → category → template → FI Id → name.
Direct commands (skip type picker)
npx nx g @cdx-extensions/extension-generator-mobile:widget
npx nx g @cdx-extensions/extension-generator-mobile:featureNon-interactive (CI / scripting)
npx nx g @cdx-extensions/extension-generator-mobile:widget \
--template=investment-portfolio \
--fiId=0123 \
--name=acme-portfolio| Option | Description |
|--------|-------------|
| fiId | Numeric FI id (required) |
| name | Kebab-case slug (required) |
| template | Catalog template id (required when non-interactive) |
| catalogUrl | Remote catalog JSON URL (optional override) |
| noCache | Re-download catalog and overlays (skip ~/.cdx/cache) |
| directory | Output parent (widgets/mobile or features/mobile) |
| sandboxPath | Sandbox auto-wiring (default playground/mobile-sandbox) |
Refresh after platform publishes a new template version
Re-run generate with --noCache — the remote catalog and registry overlays are fetched fresh:
npx nx g @cdx-extensions/extension-generator-mobile:widget \
--template=account-summary --fiId=0123 --name=my-widget --noCache