@unisphere/nx
v4.9.0
Published
Official Nx plugin for Unisphere workspace development. This plugin provides generators and executors for creating and managing Unisphere runtimes, visuals, applications, and packages.
Readme
Unisphere Workspace NX Plugin
Official Nx plugin for Unisphere workspace development. This plugin provides generators and executors for creating and managing Unisphere runtimes, visuals, applications, and packages.
Features
- Create and manage Unisphere runtimes
- Add visuals to existing runtimes
- Generate development applications
- Create shared packages
- Documentation site generation
- Package management utilities
Installation
This plugin is typically installed as part of a Unisphere workspace. If you need to install it manually:
npm install @unisphere/nx --save-devGenerators
All generators are non-interactive and require explicit flags. Run any generator without flags to see available options and examples.
add-runtime
Creates a new Unisphere runtime package.
Required flags:
--name: The name of the runtime to create--consumer: Runtime consumer type (externalorinternal)
Optional flags:
--dependencies: Packages to install (comma-separated:react,ds,mui)--analyticsAppId: Analytics app ID (number)
Example:
nx g @unisphere/nx:add-runtime \
--name=my-runtime \
--consumer=external \
--dependencies=react,dsadd-visual
Adds a visual component to an existing runtime.
Required flags:
--runtimeName: The name of the runtime to add the visual to--visualName: The name of the visual to create
Optional flags:
--isSingleOccurrence: Whether this visual is limited to single occurrence (default:false)
Example:
nx g @unisphere/nx:add-visual \
--runtimeName=my-runtime \
--visualName=my-visualadd-application
Creates a development application for testing runtimes.
Required flags:
--name: The name of the application to create--servingType: How the app should be servedlocal-dev-playground: Local development playground (default)self-hosted: Self-hosted applicationiframe-with-post-messages: iframe with post messagesassets-only: Assets only
Optional flags:
--runtimeName: Which runtime should the playground load--htmlPageTitle: The HTML page title for your app--dependencies: Packages to install (comma-separated:ds,mui,react-hook-form)
Example:
nx g @unisphere/nx:add-application \
--name=my-dev-app \
--servingType=local-dev-playground \
--runtimeName=my-runtimeadd-package
Creates a new shared package in the workspace.
Required flags:
--name: The name of the package to create--type: Package typelibrary: Shared librarytypes: TypeScript types packageconfiguration: Configuration package
Optional flags:
--dependencies: Packages to install (comma-separated:react,ds,mui)
Example:
nx g @unisphere/nx:add-package \
--name=shared-utils \
--type=library \
--dependencies=reactadd-documentation
Generates a documentation site for your workspace.
Required flags:
--title: The title for the documentation site
Example:
nx g @unisphere/nx:add-documentation \
--title="My Project Documentation"remove
Removes a package from the workspace and cleans up all references.
Required flags:
--name: The name of the package to remove
Example:
nx g @unisphere/nx:remove --name=my-packagerename-package
Renames an existing package and updates all references.
Required flags:
--currentName: Current package name--newName: New package name
Example:
nx g @unisphere/nx:rename-package \
--currentName=old-name \
--newName=new-namechange-package-scope
Changes the scope of a package (e.g., from @company to @newcompany).
Required flags:
--name: Package name to update--newScope: New scope (without@prefix)
Example:
nx g @unisphere/nx:change-package-scope \
--name=my-package \
--newScope=newcompanyGetting Help
Forgot what flags are required? Just run any generator without flags and you'll get a helpful error message with examples:
$ nx g @unisphere/nx:add-runtime
Error: Missing required option: 'name'
Description: The name of the runtime to create
Example: nx g @unisphere/nx:add-runtime --name=my-runtime --consumer=externalMigration from Interactive Generators
If you're upgrading from an older version that had interactive prompts, see the Migration Guide for details on the changes and how to update your workflows.
Development
Testing Generators
Run all generator tests:
npm test -- packages/nx/src/generators/Building the Plugin
nx build @unisphere/nxLicense
See the root LICENSE file for details.
