Chapter 14
Cheat sheet
Everything in this guide on one page. Keep it open next to your terminal, or print it. It is the same story, with the story taken out.
Pega 24 – 26
Words you will meet
- Commands
- Glossary
The whole thing
The journey, in ten lines.
- 01Install the toolsNode 24 or newer, npm, Git. node -v to check.
- 02Get the projectgit clone, then npm ci.
- 03Sign inFill tasks.config.json, then npm run authenticate.
- 04Scaffoldnpm run create. Answer six questions.
- 05Describe itEdit config.json: name, kind, settings.
- 06Build itWrite index.tsx and styles.ts.
- 07See itnpm run startStorybook, at localhost:6040.
- 08Test itnpm test -- <path>, then npm run verify.
- 09Publish itnpm run publish, or npm run hub.
- 10Use itPlace it on a view in Pega and configure it.
Reference
Every command.
Sign in
- npm run authenticate
- Sign in to a server. Needed for every server command.
Components
- npm run create
- Create a component.
- npm run createAll
- Create one component of every kind (for exploring).
- npm run rename
- Rename a component.
- npm run importComponent
- Import a component from a path.
- npm run validate-schema
- Check a component’s config.json against the schema.
Build and check
- npm run buildComponent -- --name=<Name>
- Validate and build one component, checking for errors.
- npm run buildAllComponents
- Validate and build every component.
- npm run typecheck
- Check types. Must report 0 errors.
- npm run lint / lint:fix
- Check style and common mistakes, or repair what it can.
- npm test / npm test -- <path>
- Run all tests, or one component’s.
- npm run verify
- Typecheck, lint, tests and hub tests. What CI runs.
- npm run coverage
- Run tests and report what they touched.
Showroom
- npm run startStorybook (or npm start)
- Start Storybook at :6040 (next free port if busy).
- npm run buildStorybook
- Build a static Storybook.
Server (needs sign-in)
- npm run publish [-- <name> <ruleset> <version> <Y|N>]
- Publish one component. Y is a development build.
- npm run publishAll
- Publish every component.
- npm run list
- List components, locally and on the server.
- npm run delete / deleteAll
- Delete one or all components. Production versions cannot be deleted.
Deployment Hub
- npm run hub (or npm run dashboard)
- Start the hub at localhost:3050/hub.
- npm run test:hub
- Run the hub’s own tests.
Quick card
The rules that bite.
- Server address
- https://…/prweb/ (starts with https, ends with /prweb/)
- Ruleset name
- Letters, numbers, underscores. Starts with a letter. No hyphens or spaces. Up to 64.
- Ruleset version
- Digits and dashes as 00-00-00, like 01-01-01
- Component name
- Letters and numbers only, starts with a letter, no spaces
- Component version
- Three numbers with dots, like 1.0.0
- Production build
- Cannot be deleted once published
- Secrets
- Never commit tasks.config.json or hub.config.json. Use env:NAME in the hub.
Where things live
Which file for what.
- config.json
- What the component is, and which settings a designer can change.
- index.tsx
- What the component does and draws.
- styles.ts
- How it looks.
- mock.ts
- Pretend Pega data for Storybook and tests.
- demo.stories.tsx
- The Storybook examples.
- demo.test.tsx
- The automated checks.
- tasks.config.json
- Your private server and sign-in settings. Git ignores it.
- hub.config.json
- Servers, rulesets and versions for the Deployment Hub. Git ignores it.
Match the builder
Versions.
| Pega | DX builder tag | Builder version | cosmos-react | typedefs |
|---|---|---|---|---|
| 26.1tested on 26.1.2 | release-26.1 | 26.1.11 | 9.29.0 | 5.1.1 |
| 25.1tested on 25.1.4 | release-25.1 | 25.1.26 | 8.34.4 | 4.1.4 |
| 24.2tested on 24.2.5 | release-24.2 | 24.2.21 | 7.17.3 | 3.2.5 |
Use the builder that matches the server. From Pega 25 on, the ruleset version you publish to must be in the application. On 24.2 and earlier, publish to the highest ruleset version of the application. With builder 25.1.10, avoid branch rulesets.
Words
Glossary.
- Action button
- A repo grouping for buttons that do something. In the builder, a button is a Field component.
- Application
- The list of rulesets (and versions) that make up one piece of Pega software.
- Bundle
- Your component’s code and styles packed into one file, ready to upload.
- Case
- One piece of work, followed from start to finish. The order ticket.
- Client ID / secret
- The identity (and password) of the OAuth client your tool signs in as. The secret is never shared.
- config.json
- The component’s identity card: its name, kind, version and the settings a designer can change.
- Constellation
- Pega’s modern UI. The server sends a description; the browser draws it.
- Cosmos
- Pega’s design system: the ready-made React pieces (buttons, inputs) Constellation is drawn with.
- DX API
- The doorway the browser uses to ask Pega for cases, screens and data.
- DX Component Builder
- Pega’s command-line tool for creating, building and publishing custom components.
- Field
- One control on a screen: a text box, a date, a button.
- getPConnect
- The function through which a component talks to Pega. Storybook supplies a pretend one.
- Grant type
- The way your tool proves who it is: authCode, clientCreds or passwordCreds.
- JSON
- A plain-text way of writing structured data. Pega describes screens in it.
- Layout template
- Decides how a view arranges what is inside it: columns, tabs, panels.
- Node.js / npm
- The runtime that runs the tools, and the package manager that installs libraries and runs commands.
- OAuth
- A standard way to grant limited access with a temporary token instead of a shared password.
- PConnect
- The object Pega hands every component so it can read data and trigger actions.
- Presentation
- A component kind that replaces how a whole case view is presented.
- Prop
- A value given to a React component from outside. Each config.json property arrives as one.
- React
- The JavaScript library Constellation components are written in.
- Ruleset / version
- A named folder of Pega rules, and one numbered release of it. Components are saved inside one.
- Stage / step
- A phase of a case, and one small job within it.
- Storybook
- A showroom that runs a component on its own, with no Pega server.
- Story
- One saved example of a component in a particular state.
- View
- The screen shown for a step: a container of fields and layout.
- Widget
- A self-contained mini-feature on a screen, such as a map or chart.
Your turn
Questions and comments
Stuck on something, or have a thought? Write it here. To talk about one part, use the Comment button under that section's heading.