@pega/custom-dx-components 0.25.38 → 0.25.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.25.38",
3
+ "version": "0.25.40",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "@babel/plugin-transform-class-properties": "^7.27.1",
20
20
  "@babel/preset-react": "^7.27.1",
21
21
  "@pega/auth": "^0.2.24",
22
- "@pega/constellation-dx-components-build-utils": "^2.0.4",
22
+ "@pega/constellation-dx-components-build-utils": "^2.0.5",
23
23
  "@pega/inquirer-fuzzy-path": "^3.0.0",
24
24
  "ajv": "^8.17.1",
25
25
  "ajv-keywords": "^5.1.0",
package/src/cli.js CHANGED
@@ -42,7 +42,8 @@ import {
42
42
  updateComponent,
43
43
  validate,
44
44
  upgrade,
45
- buildJestAssets
45
+ buildJestAssets,
46
+ startDevServer
46
47
  } from './tasks/index.js';
47
48
 
48
49
  const TASKS = {
@@ -86,7 +87,8 @@ const TASKS = {
86
87
  IMPORT_COMP: 'importComponent',
87
88
  AUTHENTICATE: 'authenticate',
88
89
  UPGRADE: 'upgrade',
89
- BUILD_JEST_ASSETS: 'buildJestAssets'
90
+ BUILD_JEST_ASSETS: 'buildJestAssets',
91
+ START_DEV_SERVER: 'startDevServer'
90
92
  };
91
93
 
92
94
  const parseArgumentsIntoOptions = rawArgs => {
@@ -276,6 +278,10 @@ export default async (args = []) => {
276
278
  buildJestAssets(options);
277
279
  break;
278
280
  }
281
+ case TASKS.START_DEV_SERVER: {
282
+ startDevServer(options);
283
+ break;
284
+ }
279
285
  default: {
280
286
  console.log(chalk.red(`No task matched with ${task}`));
281
287
  break;
@@ -0,0 +1,31 @@
1
+ import { join } from 'path';
2
+ import chalk from 'chalk';
3
+
4
+ import {
5
+ showVersion,
6
+ getConfigDefaults,
7
+ getConfigDevServerPort
8
+ } from '../../util.js';
9
+
10
+ import { devServerStart } from '@pega/constellation-dx-components-build-utils/index.js';
11
+
12
+
13
+
14
+ export default async options => {
15
+
16
+
17
+ await showVersion();
18
+ const devPort = await getConfigDevServerPort();
19
+ const confDef = getConfigDefaults();
20
+
21
+ console.log("");
22
+ console.log(`Debugging Library: ${chalk.bold.green(`${confDef.currentOrgLib}/${confDef.version}`)}`);
23
+ console.log(`Starting dev server: ${chalk.bold.green(`http://localhost:${confDef.devServerPort}`)}\n`);
24
+ console.log(chalk.yellow(`Be sure you have your PegaInfinity Operator using the above URL.`));
25
+ console.log("");
26
+
27
+
28
+ // call dev server start
29
+ devServerStart(confDef.currentOrgLib, confDef.version, confDef.devServerPort);
30
+
31
+ };
@@ -39,3 +39,4 @@ export { default as buildLibrary } from './build-lib/index.js';
39
39
  export { default as buildJestAssets } from './build-jest-assets/index.js';
40
40
  export { default as restoreConfig } from './restore-config/index.js';
41
41
  export { default as restore } from './restore/index.js';
42
+ export { default as startDevServer } from './dev-server/index.js';
@@ -42,6 +42,7 @@
42
42
  "move": "custom-dx-components moveComponent",
43
43
  "publishLibVersion": "custom-dx-components publish",
44
44
  "restoreLibVersion": "custom-dx-components restore",
45
+ "startDevServer": "custom-dx-components startDevServer",
45
46
  "storeLibVersion": "custom-dx-components storeComponents",
46
47
  "showStatus": "custom-dx-components showStatus",
47
48
  "setPermanent": "custom-dx-components setPermanent",
@@ -107,7 +108,7 @@
107
108
  "@babel/preset-react": "^7.27.1",
108
109
  "@babel/preset-typescript": "^7.27.1",
109
110
  "@pega/configs": "^0.16.3",
110
- "@pega/custom-dx-components": "~0.25.38",
111
+ "@pega/custom-dx-components": "~0.25.40",
111
112
  "@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
112
113
  "@storybook/addon-actions": "^8.6.14",
113
114
  "@storybook/addon-essentials": "^8.6.14",
@@ -115,6 +115,10 @@ export const showHelpV2 = (isCL) => {
115
115
  console.log("");
116
116
  console.log(`${chalk.cyan('npm run startStorybook')}\t\tstorybook components for testing`);
117
117
  console.log(`${chalk.cyan('npm run test')}\t\t\trun component unit tests`);
118
+ if (isCL) {
119
+ console.log(`${chalk.cyan('npm run startDevServer')}\t\tdebug runtime with VS Code break points using a local component server`);
120
+ }
121
+
118
122
  console.log("");
119
123
 
120
124
  console.log(`\n${chalk.underline(`Notes`)}`);
package/src/util.js CHANGED
@@ -36,8 +36,6 @@ import {
36
36
  LIBRARY_BASED_CL,
37
37
  USE_INPUT_CONFIG,
38
38
  SHARED_DIRECTORY,
39
- SHOW_DEBUG,
40
- COMPONENTS_PATH,
41
39
  COMPONENT_SCHEMA,
42
40
  ARCHIVES_PATH,
43
41
  BIN_ARCHIVES_PATH,
@@ -64,6 +62,7 @@ let defaultConfigs = {
64
62
  isLibraryBased: false,
65
63
  isLibraryBasedCL: false,
66
64
  devBuild: true,
65
+ devServerPort: "",
67
66
  library: "",
68
67
  organization: "",
69
68
  currentOrgLib: "",
@@ -121,6 +120,7 @@ export const setUpDefaults = async () => {
121
120
  isLibraryBased: false,
122
121
  isLibraryBasedCL: false,
123
122
  devBuild: true,
123
+ devServerPort: "",
124
124
  library: "",
125
125
  organization: "",
126
126
  currentOrgLib: "",
@@ -183,6 +183,7 @@ export const setUpDefaults = async () => {
183
183
 
184
184
  retrievedConfigData.serverType = data["server-config"].serverType;
185
185
  retrievedConfigData.devBuild = data["server-config"].devBuild;
186
+ retrievedConfigData.devServerPort = data["server-config"].devServerPort;
186
187
 
187
188
  retrievedConfigData.buildVersion = retrievedConfigData.devBuild ? `${retrievedConfigData.version}-dev` : retrievedConfigData.version;
188
189
  retrievedConfigData.currentOrgLib = `${retrievedConfigData.organization}_${retrievedConfigData.library}`;
@@ -1053,6 +1054,14 @@ if (showDebug) addDebugLog("setConfigDevBuild", `devBuild: ${devBuild}`, "");
1053
1054
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
1054
1055
  }
1055
1056
 
1057
+ export const getConfigDevServerPort = async() => {
1058
+ if (showDebug) addDebugLog("getConfigDevServerPort", "", "");
1059
+ // const serverConfig = await getPegaServerConfig();
1060
+
1061
+ return defaultConfigs.devServerPort;
1062
+
1063
+ }
1064
+
1056
1065
  export const setConfigImportRelativePath = async (importRelativePath) => {
1057
1066
  if (showDebug) addDebugLog("setConfigImportRelativePath", `importRelativePath: ${importRelativePath}`, "");
1058
1067
  const currentDirectory = process.cwd();