Skip to main content

Additional Constellation DX Component Builder commands

Manage your local DXCB project and components that have been published to your development server by using additional commands.

Commands for managing your components

Use the following commands to manage Constellation DX components:

Listing commands

Pega Community logo

Note: The following content, referenced from Pega Documentation, is included here to help you better achieve the module learning objectives.

Display the list of available commands that can be performed on Constellation DX components.

Introduced in Constellation DX Component Builder 24.2.10, use the npm run help command to display the list of commands that can be performed related to Constellation DX components.
NOTE: When in library mode, running this command will display the library mode commands. For more information, see Commands used in library mode.

Listing Constellation DX components

View the available components on your local machine or the Pega Platform™ Server. You can list the components to view what is already available to the authenticated operator and to verify if the publish or delete process completed successfully.

Before you begin:

Ensure that you have authentication to access the resources in the Pega Platform Server to list, publish, or delete components. For more information, see Authenticating Pega Platform Server user access for standalone Constellation DX components.

  1. Open your preferred terminal tool.
  2. Enter npm run list.
  3. Select the location of the components to be listed:
    • Server for components that are already published.
    • Local for components in your local project.

    The options that can be selected to view the available components on the local machine or the Pega Infinity Server

    Options for listing Constellation DX components

Result:

The Constellation DX components are displayed in the terminal.

The list of available components on the local machine

List of Constellation DX components

Deleting Constellation DX components

Pega Community logo

Note: The following content, referenced from Pega Documentation, is included here to help you better achieve the module learning objectives.

Free up space and make navigation easier by deleting unused or obsolete Constellation DX components either locally or on the Pega Platform™ Server. You can delete both published and unpublished components.

Before you begin:

  1. Open your preferred terminal tool.
  2. Enter npm run delete.
  3. Select the location from which you want to delete the components:
    • Local for components in your local project.
    • Server for components that are already published.

    The options that can be selected to delete the components from the local machine or the Pega Infinity Server

    Options for deleting Constellation DX components
  4. Choose the component you want to delete.
  5. Enter yes.

Result:

Components deleted from the local machine are not deleted from the server. Components deleted from the server are removed from the ruleset and are no longer available in App Studio.

The component deleted from the local machine

Deleted Constellation DX component
NOTE: Deleting all components (npm run deleteAll) follows the same procedure except that instead of selecting the components to be deleted, it deletes all components from the server or local machine.

Renaming Constellation DX components

Pega Community logo

Note: The following content, referenced from Pega Documentation, is included here to help you better achieve the module learning objectives.

Use the rename command to rename Constellation DX components in the local library.

The rename command automatically updates the component directory, storybook, and the component definition file (config.json).
NOTE:
  • The rename command does not impact the published version of the Constellation DX component. If you need to rename the component after it is published, use the rename command as mentioned in the procedure below, republish the component, replace the component in all views using the component, and then delete the original component from the server.

  1. Open your preferred terminal tool.
  2. Enter npm run rename.
  3. Select the component that you want to rename.
  4. Enter the new name of the component.
  5. Enter the new label of the component.
  6. Enter the new organization of the component.
  7. Enter the new version of the component.
  8. Enter the new name of the library.
  9. Provide a list of supported applications by entering the names of the supported applications, with each name separated by a comma.
    NOTE: If you do not provide any supported applications, the component will be available to all applications by default.
  10. Provide a new description of the component.

    The command line interface depicting the details to be entered for renaming a Constellation DX component through the rename command

    Command line interface - rename

Result:

The component, config, and styles are renamed along with the code references as per the specified details. Revalidate that the code works and make the necessary adjustments.

Importing a Constellation DX component

Pega Community logo

Note: The following content, referenced from Pega Documentation, is included here to help you better achieve the module learning objectives.

The importComponent command is used to import an existing standalone component into your project. In library mode, the importComponent command is used to import an existing standalone component into a library.

Before you begin:

In a specific location, create a copy of the folder of the component that must be imported. You must enter this location when importing the component to the project.

Introduced in Constellation DX Component Builder 24.2.10, you use the npm run importComponent command to import an existing standalone component into your project. The org and library names of the imported component are automatically renamed if they do not match the corresponding details of your components. The value of the version property is updated in the config.json file to match the version of the current library.

  1. In your terminal, navigate to your project and enter npm run importComponent.
  2. Enter the location containing the folder of the component that must be imported.
  3. Select the component to be imported.
    • If the imported component already exists in your project, choose whether you want to abort the import, overwrite the existing component, or rename the existing component.
    • If the imported component does not exist in your project, choose whether you want to validate the imported component.

Result:

The imported component is located in the src/components directory.

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice