@pega/custom-dx-components 0.25.31 → 0.25.33

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.
Files changed (72) hide show
  1. package/README.md +3 -5
  2. package/eslint.config.mjs +227 -0
  3. package/package.json +3 -3
  4. package/src/constants.js +1 -1
  5. package/src/tasks/create/index.js +8 -2
  6. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +0 -1
  7. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -1
  8. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +2 -1
  9. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +2 -3
  10. package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.tsx → StatusWork.tsx.mustache} +0 -1
  11. package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +0 -1
  12. package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache +0 -1
  13. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +0 -1
  14. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +0 -1
  15. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/HighlightRender.tsx.mustache +0 -1
  16. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +0 -1
  17. package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +0 -1
  18. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +0 -1
  19. package/src/tasks/create-all/index.js +18 -2
  20. package/src/tasks/create-lib/helper.js +1 -2
  21. package/src/tasks/export-archive/helper.js +1 -1
  22. package/src/tasks/import-archive/index.js +2 -2
  23. package/src/tasks/init/index.js +1 -1
  24. package/src/tasks/init/template/.eslintignore +1 -0
  25. package/src/tasks/init/template/README.md +3 -5
  26. package/src/tasks/init/template/eslint.config.mjs +227 -0
  27. package/src/tasks/init/template/package.json.mustache +3 -2
  28. package/src/tasks/init/template/tasks.config.json +2 -2
  29. package/src/tasks/init/template/tsconfig.build.json +2 -1
  30. package/src/tasks/init/template/tsconfig.json +1 -0
  31. package/src/tasks/validator/index.js +5 -0
  32. package/src/util.js +30 -2
  33. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
  34. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
  35. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
  36. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
  37. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
  38. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +0 -1
  39. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
  40. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
  41. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
  42. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
  43. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
  44. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
  45. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
  46. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
  47. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
  48. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
  49. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
  50. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
  51. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +0 -1
  52. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
  53. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
  54. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
  55. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
  56. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
  57. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
  58. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
  59. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
  60. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
  61. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
  62. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
  63. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +0 -1
  64. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
  65. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -1
  66. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
  67. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
  68. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
  69. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
  70. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
  71. package/.eslintrc.json +0 -18
  72. package/src/tasks/init/template/.eslintrc.json +0 -240
package/README.md CHANGED
@@ -8,15 +8,13 @@ This project provides you with an environment to extend Constellation by giving
8
8
 
9
9
  Ensure you have access to the following in your system:
10
10
 
11
- - Pega Infinity Server version 24.2 or later
11
+ - Pega Infinity Server version 25.1 or later
12
12
 
13
13
  - Git version 2.30 or later
14
14
 
15
- - System node version 18, 20
15
+ - System node version >= 22.15.0
16
16
 
17
- - System npm version 8, 10 (9 is not supported)
18
-
19
- - Recommended (node 20, npm 10)
17
+ - System npm version 10
20
18
 
21
19
  ## Latest Documentation
22
20
 
@@ -0,0 +1,227 @@
1
+ import { defineConfig, globalIgnores } from 'eslint/config';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import js from '@eslint/js';
5
+ import { FlatCompat } from '@eslint/eslintrc';
6
+ import tseslint from 'typescript-eslint';
7
+ import sonarjs from 'eslint-plugin-sonarjs';
8
+ import importPlugin from 'eslint-plugin-import';
9
+ import react from 'eslint-plugin-react';
10
+ import reactHooks from 'eslint-plugin-react-hooks';
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+ const compat = new FlatCompat({
15
+ baseDirectory: __dirname,
16
+ recommendedConfig: js.configs.recommended,
17
+ sonarjs: sonarjs.configs.recommended,
18
+ importPlugin: importPlugin.configs.recommended,
19
+ react: react.configs.recommended,
20
+ reactHooks: reactHooks.configs.recommended,
21
+ allConfig: js.configs.all
22
+ });
23
+
24
+ export default tseslint.config(
25
+ tseslint.configs.recommended,
26
+ globalIgnores([
27
+ '**/node_modules',
28
+ 'packages/*/lib',
29
+ '!**/.storybook',
30
+ '.storybook/public',
31
+ '**/demo.stories.jsx',
32
+ '**/mock.stories.js',
33
+ '**/demo.stories.tsx',
34
+ '**/demo.test.tsx',
35
+ '**/mock.stories.ts',
36
+ '**/*.mdx',
37
+ '**/webpack.config.js',
38
+ 'src/helpers/config_access.js',
39
+ '**/*.html',
40
+ '**/*.css',
41
+ '**/*.json',
42
+ '**/*.md',
43
+ '**/*.svg',
44
+ '**/*.zip',
45
+ '**/*.d.ts',
46
+ '*.storybook/*',
47
+ '**/*.cjs',
48
+ '**/paths.js',
49
+ 'dist/*',
50
+ 'lib/*'
51
+ ]),
52
+ {
53
+ languageOptions: {
54
+ globals: {
55
+ PCore: 'readonly',
56
+ window: true,
57
+ console: true,
58
+ document: true,
59
+ fetch: true
60
+ },
61
+
62
+ ecmaVersion: 13,
63
+ sourceType: 'script',
64
+
65
+ parserOptions: {
66
+ project: 'tsconfig.json'
67
+ }
68
+ },
69
+
70
+ settings: {
71
+ 'import/resolver': {
72
+ typescript: {},
73
+
74
+ node: {
75
+ extensions: ['.js', '.jsx', '.ts', '.tsx']
76
+ }
77
+ },
78
+
79
+ react: {
80
+ version: 'detect'
81
+ }
82
+ },
83
+
84
+ plugins: { sonarjs, import: importPlugin, react, 'react-hooks': reactHooks },
85
+ rules: {
86
+ 'prettier/prettier': 'off',
87
+ 'sonarjs/cognitive-complexity': 'off',
88
+ 'sonarjs/no-identical-functions': 'off',
89
+ 'sonarjs/no-duplicate-string': 'off',
90
+ 'sonarjs/no-nested-template-literals': 'off',
91
+ '@typescript-eslint/array-type': 'off',
92
+ '@typescript-eslint/no-wrapper-object-types': 'off',
93
+ '@typescript-eslint/no-explicit-any': 'off',
94
+ '@typescript-eslint/no-empty-object-type': 'off',
95
+ '@typescript-eslint/ban-ts-comment': 'off',
96
+ '@typescript-eslint/no-unsafe-function-type': 'off',
97
+ '@typescript-eslint/no-inferrable-types': 'off',
98
+ 'import/extensions': ['off', 'never'],
99
+ 'import/named': 'off',
100
+ 'import/no-cycle': 'off',
101
+ 'import/no-duplicates': 'off',
102
+ 'import/no-extraneous-dependencies': 'off',
103
+ 'import/no-named-as-default': 'off',
104
+ 'import/no-named-as-default-member': 'off',
105
+ 'import/no-self-import': 'off',
106
+ 'import/no-unresolved': 'off',
107
+ 'import/no-useless-path-segments': 'off',
108
+ 'import/order': 'off',
109
+ 'no-else-return': 'off',
110
+ 'no-restricted-syntax': 'off',
111
+ 'no-underscore-dangle': 'off',
112
+ 'jsx-a11y/alt-text': 'off',
113
+ 'jsx-a11y/anchor-is-valid': 'off',
114
+ 'jsx-a11y/click-events-have-key-events': 'off',
115
+ 'jsx-a11y/label-has-associated-control': 'off',
116
+ 'jsx-a11y/no-static-element-interactions': 'off',
117
+ 'react/jsx-fragments': 'off',
118
+ 'react/jsx-no-bind': 'off',
119
+ 'react/self-closing-comp': 'off',
120
+ 'sonarjs/prefer-immediate-return': 'off',
121
+ '@typescript-eslint/dot-notation': 'off',
122
+ '@typescript-eslint/naming-convention': 'off',
123
+ '@typescript-eslint/ban-types': 'off',
124
+ eqeqeq: 'off',
125
+ 'no-alert': 'off',
126
+ 'no-console': 'error',
127
+ 'no-fallthrough': 'error',
128
+ 'no-undef': 'error',
129
+ 'no-unused-vars': 'off',
130
+ 'no-var': 'off',
131
+ yoda: 'error',
132
+ 'no-irregular-whitespace': 'off',
133
+ 'no-empty': 'off',
134
+ 'no-new-object': 'off',
135
+ 'import/no-relative-packages': 'off',
136
+ 'import/no-mutable-exports': 'error',
137
+ 'sonarjs/max-switch-cases': 'error',
138
+ 'sonarjs/no-collapsible-if': 'error',
139
+ 'sonarjs/no-all-duplicated-branches': 'error',
140
+ 'sonarjs/no-duplicated-branches': 'error',
141
+ 'sonarjs/no-gratuitous-expressions': 'off',
142
+ 'sonarjs/no-ignored-return': 'error',
143
+ 'sonarjs/no-small-switch': 'error',
144
+ 'sonarjs/prefer-object-literal': 'error',
145
+ 'sonarjs/prefer-single-boolean-return': 'error',
146
+ '@typescript-eslint/no-shadow': 'error',
147
+ 'react/default-props-match-prop-types': 'error',
148
+ 'react/no-unescaped-entities': 'error',
149
+ 'react/no-unused-prop-types': 'error',
150
+ 'react/static-property-placement': 'error',
151
+ 'array-callback-return': 'error',
152
+ camelcase: 'error',
153
+ 'func-names': 'error',
154
+ 'no-case-declarations': 'error',
155
+ 'no-lonely-if': 'error',
156
+ 'no-nested-ternary': 'error',
157
+ 'no-plusplus': 'error',
158
+ 'no-restricted-globals': 'error',
159
+ 'no-restricted-properties': 'error',
160
+ 'no-shadow': 'error',
161
+ radix: 'error',
162
+ 'spaced-comment': 'error',
163
+ 'import/newline-after-import': 'error',
164
+ 'sonarjs/no-nested-switch': 'error',
165
+ '@typescript-eslint/no-array-constructor': 'error',
166
+ '@typescript-eslint/no-unused-vars': 'error',
167
+ '@typescript-eslint/no-useless-constructor': 'error',
168
+ 'react/button-has-type': 'error',
169
+ 'react/jsx-curly-brace-presence': 'error',
170
+ 'react/jsx-boolean-value': 'error',
171
+ 'react/no-array-index-key': 'error',
172
+ 'class-methods-use-this': 'error',
173
+ 'guard-for-in': 'error',
174
+ 'no-unneeded-ternary': 'error',
175
+ 'no-unused-expressions': 'error',
176
+ 'operator-assignment': 'error',
177
+ 'prefer-template': 'error',
178
+ 'vars-on-top': 'error',
179
+ 'prefer-regex-literals': 'off',
180
+ 'no-use-before-define': 'off',
181
+ '@typescript-eslint/no-use-before-define': 'error'
182
+ }
183
+ },
184
+ {
185
+ files: ['**/*.@(ts|tsx)'],
186
+
187
+ rules: {
188
+ '@typescript-eslint/method-signature-style': ['error', 'property'],
189
+ quotes: 'off',
190
+ '@typescript-eslint/quotes': 'off'
191
+ }
192
+ },
193
+ {
194
+ files: ['**/*.@(jsx|tsx|mdx)'],
195
+
196
+ rules: {
197
+ 'react/react-in-jsx-scope': 'off',
198
+ 'react-hooks/rules-of-hooks': 'off',
199
+ 'react-hooks/exhaustive-deps': 'off'
200
+ }
201
+ },
202
+ {
203
+ files: ['**/*.@(ts|tsx)'],
204
+ rules: {
205
+ 'no-undef': 'error',
206
+ 'no-console': 'off',
207
+ 'import/prefer-default-export': 'off',
208
+ 'import/no-relative-packages': 'off',
209
+ 'react/jsx-fragments': 'off',
210
+ 'react/react-in-jsx-scope': 'off',
211
+ 'react-hooks/exhaustive-deps': 'off',
212
+ 'sonarjs/cognitive-complexity': ['warn', 45]
213
+ }
214
+ },
215
+ {
216
+ files: ['**/*.@(js|jsx|ts|tsx|mdx)'],
217
+ rules: {}
218
+ },
219
+
220
+ {
221
+ files: ['*/**/mocks/**.@(mocks|styles).@(tsx|ts)'],
222
+
223
+ rules: {
224
+ 'import/prefer-default-export': ['off']
225
+ }
226
+ }
227
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.25.31",
3
+ "version": "0.25.33",
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.3-dev",
22
+ "@pega/constellation-dx-components-build-utils": "^2.0.4",
23
23
  "@pega/inquirer-fuzzy-path": "^3.0.0",
24
24
  "ajv": "^8.17.1",
25
25
  "ajv-keywords": "^5.1.0",
@@ -31,7 +31,7 @@
31
31
  "compression-webpack-plugin": "^11.1.0",
32
32
  "css-loader": "7.1.2",
33
33
  "css-minimizer-webpack-plugin": "^7.0.2",
34
- "eslint": "^8.56.0",
34
+ "eslint": "^9.27.0",
35
35
  "execa": "^9.5.2",
36
36
  "file-loader": "6.2.0",
37
37
  "fs-extra": "^11.3.0",
package/src/constants.js CHANGED
@@ -22,7 +22,7 @@ export const ARCHIVES_PATH = 'store';
22
22
  export const BIN_ARCHIVES_PATH = 'bin-arch';
23
23
  export const TEMP_PATH = 'store/temp';
24
24
  export const COMPONENTS_CONFIG_FILE_NAME = 'componentsconfig.json';
25
-
25
+ export const MAX_RFT_CHARS = 64;
26
26
 
27
27
 
28
28
  /* REST end points */
@@ -23,7 +23,8 @@ import {
23
23
  addDebugLog,
24
24
  checkLibraryAndArchives,
25
25
  getConfigDefaults,
26
- getSubTypeLabel
26
+ getSubTypeLabel,
27
+ getMaxComponentNameCount
27
28
  } from '../../util.js';
28
29
  import { COMPONENT_SCHEMA, SHARED_FILE_NAMES } from '../../constants.js';
29
30
 
@@ -309,6 +310,7 @@ addDebugLog("create", "", "+");
309
310
  );
310
311
  } else {
311
312
  const componentDefaults = getConfigDefaults();
313
+ const maxChars = getMaxComponentNameCount();
312
314
  const questions = [
313
315
  {
314
316
  name: 'type',
@@ -356,7 +358,7 @@ addDebugLog("create", "", "+");
356
358
  },
357
359
  {
358
360
  name: 'componentName',
359
- message: 'Enter component name (required)',
361
+ message: `Enter component name (required) (${maxChars} max chars)`,
360
362
  validate: value => {
361
363
  /* value should not be empty
362
364
  It should not have spaces
@@ -364,8 +366,12 @@ addDebugLog("create", "", "+");
364
366
  Only case-insensitive alphanumeric values are allowed
365
367
  */
366
368
  if (value && !/^\d/.test(value) && value === sanitize(value)) {
369
+ if (value.length > maxChars) {
370
+ return `${value.length - maxChars} too many characters.`
371
+ }
367
372
  return true;
368
373
  }
374
+
369
375
  return 'Only alphanumeric values are allowed, starting with alphabets, no spaces.';
370
376
  }
371
377
  },
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */
2
1
  import { useState, useEffect, useRef, type Key } from 'react';
3
2
  import { Select, Option, FieldValueList, Text, withConfiguration } from '@pega/cosmos-react-core';
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */
2
1
  /* eslint-disable sonarjs/cognitive-complexity */
3
2
  import { useEffect, useRef, useState, useMemo, type MutableRefObject, type SetStateAction } from 'react';
4
3
  import { ComboBox, menuHelpers, debounce, throttle, Button, Icon, withConfiguration, type MenuGroupProps, type MenuItemProps } from '@pega/cosmos-react-core';
@@ -414,6 +413,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
414
413
  const { isSearchableOnKey } = props;
415
414
 
416
415
  const [items, setItems] = useState(() => []);
416
+ // eslint-disable-next-line prefer-const
417
417
  let selectItem: ((id: string, ev?: any) => void) | ((arg0: never) => void);
418
418
 
419
419
  // convert associated to datapage listtype and transform props
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable sonarjs/no-collapsible-if */
2
+ /* eslint-disable sonarjs/cognitive-complexity */
2
3
  /* eslint-disable func-names */
3
4
  // @ts-nocheck
4
5
  import { splitConditionTree } from '@pega/cosmos-react-condition-builder';
@@ -267,7 +268,7 @@ export function getDescriptorsFieldName(property, pageClass) {
267
268
  return property;
268
269
  }
269
270
 
270
- // eslint-disable-next-line @typescript-eslint/default-param-last, sonarjs/cognitive-complexity
271
+ // eslint-disable-next-line, sonarjs/cognitive-complexity
271
272
  export function preparePatchQueryFields(fields, isDataObject = false, classID = '', getPConnect) {
272
273
  const queryFields = [];
273
274
  // Descriptors can be configured only for single selectionMode properties
@@ -77,7 +77,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
77
77
  const propName: string = stateProps.value;
78
78
  const configProps = pConn.getConfigProps();
79
79
  const className = pConn.getCaseInfo().getClassName();
80
- const { getLocaleRuleNameFromKeys, getLocalizedValue } = pConn;
81
80
 
82
81
  // @ts-ignore
83
82
  let configProperty = pConn.getRawMetadata()?.config?.value || '';
@@ -139,10 +138,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
139
138
  id={`${fullReference}.${item.key}`}
140
139
  value={item.key}
141
140
  key={`${fullReference}.${item.key}`}
142
- label={getLocalizedValue(
141
+ label={pConn.getLocalizedValue(
143
142
  isDatapage ? item.text : item.value,
144
143
  localePath,
145
- getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
144
+ pConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
146
145
  )}
147
146
  name={fullReference}
148
147
  />
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
1
  import React from 'react';
3
2
  import { Status } from '@pega/cosmos-react-core';
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/rules-of-hooks */
2
1
  import React from 'react';
3
2
  import { useEffect, useState } from 'react';
4
3
  import { Avatar as CosmosAvatar, withConfiguration } from '@pega/cosmos-react-core';
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
1
  import React from 'react';
3
2
  import { FieldValueList, Text } from '@pega/cosmos-react-core';
4
3
  import type { PConnProps } from './PConnProps';
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
1
  import React from 'react';
3
2
  import { Status } from '@pega/cosmos-react-core';
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/rules-of-hooks */
2
1
  import React from 'react';
3
2
  import { useEffect, useState } from 'react';
4
3
  import { Avatar as CosmosAvatar, withConfiguration } from '@pega/cosmos-react-core';
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
1
  import React from 'react';
3
2
  import { FieldValueList, Text } from '@pega/cosmos-react-core';
4
3
  import type { PConnProps } from './PConnProps';
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
1
  import React from 'react';
3
2
  import { Status } from '@pega/cosmos-react-core';
4
3
 
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
1
  import React from 'react';
3
2
  import { Button, useToaster } from '@pega/cosmos-react-core';
4
3
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/rules-of-hooks */
2
1
  import React from 'react';
3
2
  import { useEffect, useState } from 'react';
4
3
  import { Avatar as CosmosAvatar, withConfiguration } from '@pega/cosmos-react-core';
@@ -24,7 +24,8 @@ import { checkPathAccess, showVersion ,
24
24
  addDebugLog,
25
25
  checkLibraryAndArchives,
26
26
  getConfigDefaults,
27
- getSubTypeLabel
27
+ getSubTypeLabel,
28
+ getMaxPrefixCount
28
29
  } from '../../util.js';
29
30
 
30
31
  import { COMPONENT_SCHEMA, COMPONENTS_DIRECTORY_PATH, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_PATH, CATEGORY_CONSTELLATION, SHARED_FILE_NAMES } from '../../constants.js';
@@ -409,10 +410,25 @@ addDebugLog("createAll", "", "+");
409
410
  options
410
411
  );
411
412
  } else {
413
+ const maxPrefixCount = getMaxPrefixCount();
412
414
  const questions = [
413
415
  {
414
416
  name: 'prefix',
415
- message: 'Enter prefix label'
417
+ message: `Enter prefix label (${maxPrefixCount} max chars)`,
418
+ validate: value => {
419
+ /* value should not be empty
420
+ It should not start with a number
421
+ Only case-insensitive alphanumeric values are allowed
422
+ */
423
+ if (value && !/^\d/.test(value) ) {
424
+ if (value.length > maxPrefixCount) {
425
+ return `${value.length - maxPrefixCount} too many characters.`
426
+ }
427
+ return true;
428
+ }
429
+
430
+ return 'Only alphanumeric values are allowed, starting with alphabets';
431
+ }
416
432
  },
417
433
  {
418
434
  name: 'version',
@@ -62,11 +62,10 @@ addDebugLog("getCreateLibComponentQuestions", "", "");
62
62
 
63
63
  const isLibraryBasedCL = getLibraryBasedCL();
64
64
 
65
-
66
65
  return [
67
66
  {
68
67
  name: 'libraryName',
69
- message: 'Enter libray name',
68
+ message: 'Enter library name',
70
69
  default: libraryName,
71
70
  validate: value => {
72
71
  /* value should not be empty
@@ -58,7 +58,7 @@ addDebugLog("getFilePathQuestions", "", "");
58
58
  rootPath: startDirectory,
59
59
  // rootPath :: String
60
60
  // Root search directory
61
- suggestOnly: false,
61
+ suggestOnly: true,
62
62
  // suggestOnly :: Bool
63
63
  // Restrict prompt answer to available choices or use them as suggestions
64
64
  depthLimit: 2,
@@ -326,7 +326,7 @@ export const importArch = async(filePath, fileName, hadArchive) => {
326
326
  const newLibNameAnswers = await inquirer.prompt([
327
327
  {
328
328
  name: 'libraryName',
329
- message: 'Enter new libray name',
329
+ message: 'Enter new library name',
330
330
  validate: value => {
331
331
  /* value should not be empty
332
332
  It should not have spaces
@@ -524,7 +524,7 @@ addDebugLog("importArch", `filePath: ${filePath}, fileName: ${fileName}`, "");
524
524
  const newLibNameAnswers = await inquirer.prompt([
525
525
  {
526
526
  name: 'libraryName',
527
- message: 'Enter new libray name',
527
+ message: 'Enter new library name',
528
528
  validate: value => {
529
529
  /* value should not be empty
530
530
  It should not have spaces
@@ -144,7 +144,7 @@ export default async options => {
144
144
  {
145
145
  title: installDependenciesText,
146
146
  task: () =>
147
- execPromise('npm i --force --dev', { cwd: options.targetDirectory })
147
+ execPromise('npm i --force --include=dev', { cwd: options.targetDirectory })
148
148
  },
149
149
  /*
150
150
  {
@@ -10,5 +10,6 @@ src/helpers/config_access.js
10
10
  *.storybook/*
11
11
  *.cjs
12
12
  paths.js
13
+ *.config.mjs
13
14
  dist/*
14
15
  lib/*
@@ -8,15 +8,13 @@ This project provides you with an environment to extend Constellation by giving
8
8
 
9
9
  Ensure you have access to the following in your system:
10
10
 
11
- - Pega Infinity Server version 24.2 or later
11
+ - Pega Infinity Server version 25.1 or later
12
12
 
13
13
  - Git version 2.30 or later
14
14
 
15
- - System node version 18, 20
15
+ - System node version >= 22.15.0
16
16
 
17
- - System npm version 8, 10 (9 is not supported)
18
-
19
- - Recommended (node 20, npm 10)
17
+ - System npm version 10
20
18
 
21
19
  ## Latest Documentation
22
20