@pega/custom-dx-components 0.25.33 → 0.25.34

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/eslint.config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineConfig, globalIgnores } from 'eslint/config';
1
+ import { globalIgnores } from 'eslint/config';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import js from '@eslint/js';
@@ -45,6 +45,7 @@ export default tseslint.config(
45
45
  '**/*.d.ts',
46
46
  '*.storybook/*',
47
47
  '**/*.cjs',
48
+ '**/*.mjs',
48
49
  '**/paths.js',
49
50
  'dist/*',
50
51
  'lib/*'
@@ -63,14 +64,19 @@ export default tseslint.config(
63
64
  sourceType: 'script',
64
65
 
65
66
  parserOptions: {
66
- project: 'tsconfig.json'
67
+ project: 'tsconfig.json',
68
+ ecmaFeatures: {
69
+ jsx: true
70
+ }
67
71
  }
68
72
  },
69
73
 
70
74
  settings: {
71
75
  'import/resolver': {
72
76
  typescript: {},
73
-
77
+ react: {
78
+ version: 'detect'
79
+ },
74
80
  node: {
75
81
  extensions: ['.js', '.jsx', '.ts', '.tsx']
76
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.25.33",
3
+ "version": "0.25.34",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -183,16 +183,25 @@ export default async options => {
183
183
  '\n',
184
184
  `Inside that directory, you can run several commands:`,
185
185
  '\n\n',
186
- `${chalk.blueBright('npm run startStorybook')}`,
187
- `\n Start Storybook in development mode`,
186
+ `Get a list of commands\n`,
187
+ ` ${chalk.blueBright('npm run help')}`,
188
188
  '\n\n',
189
- `${chalk.blueBright('npm run create')}`,
190
- '\n',
191
- `${chalk.blueBright('npm run list')}`,
192
- `\n Try out custom-component actions like create, list, publish, etc`,
189
+ `Create or import a library first\n`,
190
+ ` ${chalk.blueBright('npm run createLib')}\n`,
191
+ ` ${chalk.blueBright('npm run importLibVersion')}`,
192
+ '\n\n',
193
+ `Try out custom-component actions like create, list, etc. \n`,
194
+ ` ${chalk.blueBright('npm run create')}\n`,
195
+ ` ${chalk.blueBright('npm run list')}`,
196
+ '\n\n',
197
+ `Start Storybook in development mode\n`,
198
+ ` ${chalk.blueBright('npm run startStorybook')}`,
199
+ '\n\n',
200
+ `Validate components (schema, lint, test build of a library)\n`,
201
+ ` ${chalk.blueBright('npm run validateAll')}`,
193
202
  '\n\n',
194
- `${chalk.blueBright('npm run lint')}`,
195
- `\n Run eslint for component source files`,
203
+ `Publish component library\n`,
204
+ ` ${chalk.blueBright('npm run publish')}`,
196
205
  '\n'
197
206
  );
198
207
 
@@ -201,7 +210,7 @@ export default async options => {
201
210
  '\n\n',
202
211
  `${chalk.blueBright('cd')} ${chalk.bold(projectName)}`,
203
212
  '\n',
204
- `${chalk.blueBright('npm run startStorybook')}`,
213
+ `${chalk.blueBright('npm run createLib')} or ${chalk.blueBright('npm run importLibVersion')}`,
205
214
  '\n'
206
215
  );
207
216
  return true;
@@ -1,4 +1,4 @@
1
- import { defineConfig, globalIgnores } from 'eslint/config';
1
+ import { globalIgnores } from 'eslint/config';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import js from '@eslint/js';
@@ -45,6 +45,7 @@ export default tseslint.config(
45
45
  '**/*.d.ts',
46
46
  '*.storybook/*',
47
47
  '**/*.cjs',
48
+ '**/*.mjs',
48
49
  '**/paths.js',
49
50
  'dist/*',
50
51
  'lib/*'
@@ -63,14 +64,19 @@ export default tseslint.config(
63
64
  sourceType: 'script',
64
65
 
65
66
  parserOptions: {
66
- project: 'tsconfig.json'
67
+ project: 'tsconfig.json',
68
+ ecmaFeatures: {
69
+ jsx: true
70
+ }
67
71
  }
68
72
  },
69
73
 
70
74
  settings: {
71
75
  'import/resolver': {
72
76
  typescript: {},
73
-
77
+ react: {
78
+ version: 'detect'
79
+ },
74
80
  node: {
75
81
  extensions: ['.js', '.jsx', '.ts', '.tsx']
76
82
  }
@@ -107,7 +107,7 @@
107
107
  "@babel/preset-react": "^7.27.1",
108
108
  "@babel/preset-typescript": "^7.27.1",
109
109
  "@pega/configs": "^0.16.3",
110
- "@pega/custom-dx-components": "~0.25.33",
110
+ "@pega/custom-dx-components": "~0.25.34",
111
111
  "@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
112
112
  "@storybook/addon-actions": "^8.6.12",
113
113
  "@storybook/addon-essentials": "^8.6.12",
@@ -32,12 +32,12 @@
32
32
  "component": {
33
33
  "library": "YourLibrary",
34
34
  "type": "",
35
- "version": "0.0.1",
35
+ "version": "1.0.0",
36
36
  "subtype": "",
37
37
  "description": "",
38
38
  "icon": ""
39
39
  },
40
40
  "usePromotedWebPack": false,
41
- "libraryModeCL": false,
41
+ "libraryModeCL": true,
42
42
  "showDebug": false
43
43
  }
@@ -254,7 +254,11 @@ addDebugLog("getComponentsFromServer", `library: ${library}, organization: ${org
254
254
  headers.Authorization = `${tokenType} ${accessToken}`;
255
255
 
256
256
  fetchComponentsFromInfinity(url, headers)
257
- .then((response) => resolve(response))
257
+ .then((response) => {
258
+ // filter and only return non managed rules
259
+ response.pxResults = response.pxResults.filter(component => (component.pyManagedRule === false || component.pyManagedRule === undefined));
260
+ resolve(response);
261
+ })
258
262
  .catch((e) => reject(e));
259
263
  }
260
264
  }
@@ -247,8 +247,9 @@ addDebugLog("publishComponentToServer", `data: ${data}`, "");
247
247
 
248
248
  export const publishUILibraryComponentToInfinity = async (content) => {
249
249
  addDebugLog("publishUILibraryComponentToInfinity", `content: ${content}`, "");
250
+ const defaultPegaServerConfig = await getPegaServerConfig();
250
251
 
251
- console.log(chalk.green(`Publishing ${content.libraryName}/${content.version} to server...`));
252
+ console.log(chalk.green(`Publishing ${content.libraryName}/${content.version} to server ${chalk.green.bold(`${defaultPegaServerConfig.server}`)}.`));
252
253
 
253
254
  const fromZip = await zipLibraryComponent(content.libraryName, content.version);
254
255
 
@@ -63,7 +63,7 @@ export const showHelpV2 = (isCL) => {
63
63
  if (!isCL) {
64
64
  console.log(chalk.yellow("**** Beta capability and subject to change. Developer experimental. Do not use in a Production Deployment. ***\n"));
65
65
  }
66
- console.log(`--> All commands will not work until a library is created via ${chalk.cyan(`npm run createLib`)}.`);
66
+ console.log(`--> All commands will NOT work until a library is created via ${chalk.cyan(`npm run createLib`)} or ${chalk.cyan(`npm run importLibVersion`)}.`);
67
67
  console.log(`\nnpm run <command>`);
68
68
  console.log(`\nUsage:`);
69
69
 
@@ -129,6 +129,7 @@ export const showHelpV2 = (isCL) => {
129
129
  else {
130
130
  console.log(`for backup storage.`);
131
131
  }
132
+ console.log(`\nIn tasks.config.json, set ${chalk.yellow("libraryModeCL")} to ${chalk.yellow("false")} for original single components or for ${chalk.yellow("Launchpad")} components.`);
132
133
  console.log("");
133
134
  }
134
135
 
package/src/util.js CHANGED
@@ -1273,10 +1273,11 @@ export const showVersion = async () => {
1273
1273
  // get package version, so can display at start
1274
1274
  // const require = createRequire(import.meta.url);
1275
1275
  const require = createRequire(currentPath.default);
1276
+ const sLibMode = getLibraryBased() ? "(library mode)" : "";
1276
1277
 
1277
1278
  const pData = require('@pega/custom-dx-components/package.json');
1278
1279
 
1279
- console.log(chalk.green(`DX Component Builder v${pData.version}`));
1280
+ console.log(chalk.green(`DX Component Builder${sLibMode} v${pData.version}`));
1280
1281
  showDebug = getShowDebug();
1281
1282
 
1282
1283
  if (getLibraryBased() && getServerType() === "launchpad") {
@@ -2558,7 +2559,8 @@ if (showDebug) addDebugLog("checkLibraryAndArchives", ``, "");
2558
2559
  const hasArch = await hasArchives();
2559
2560
 
2560
2561
  if (isLibraryBased && !hasArch) {
2561
- console.log(chalk.yellow('\nPlease create a library before proceeding.\n'));
2562
+ console.log(chalk.yellow('\nPlease create/import a library before proceeding.'));
2563
+ console.log(`\tMore info... ${chalk.cyan('npm run help')}\n`);
2562
2564
  process.exit();
2563
2565
  }
2564
2566
  };
@@ -87,7 +87,7 @@ describe(`createLib deleteLib: ${serverDir} - ${compType}` , () => {
87
87
 
88
88
  // console.log(stdout);
89
89
  expect(stdout).not.toBeNull();
90
- expect(stdout).toContain('Please create a library before proceeding.');
90
+ expect(stdout).toContain('Please create/import a library before proceeding.');
91
91
 
92
92
  // done();
93
93
  }, 10000);