@pega/custom-dx-components 0.25.30 → 0.25.32

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 (87) 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/delete-pub/index.js +1 -1
  22. package/src/tasks/export-archive/helper.js +1 -1
  23. package/src/tasks/import-archive/index.js +22 -11
  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/list-pub/index.js +4 -1
  32. package/src/tasks/promote-webpack/index.js +0 -3
  33. package/src/tasks/publish/index.js +2 -0
  34. package/src/tasks/publish-archive/index.js +2 -1
  35. package/src/tasks/show-help/index.js +9 -2
  36. package/src/tasks/show-status/index.js +7 -1
  37. package/src/tasks/validator/index.js +5 -0
  38. package/src/util.js +30 -2
  39. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
  40. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
  41. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
  42. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
  43. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
  44. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +0 -1
  45. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
  46. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
  47. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
  48. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
  49. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
  50. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
  51. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
  52. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
  53. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
  54. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
  55. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
  56. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
  57. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +0 -1
  58. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
  59. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
  60. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
  61. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
  62. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
  63. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
  64. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
  65. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
  66. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
  67. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
  68. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
  69. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +0 -1
  70. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
  71. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -1
  72. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
  73. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
  74. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
  75. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
  76. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
  77. package/tests/functional/localCreateAllListDeleteAll.test.js +4 -0
  78. package/tests/functional/localCreateBuildAllDeleteAll.test.js +4 -0
  79. package/tests/functional/localCreateBuildDelete.test.js +4 -0
  80. package/tests/functional/localCreateListDelete.test.js +11 -6
  81. package/tests/functional/localCreatePublishAllDeleteAll.test.js +4 -0
  82. package/tests/functional/localCreatePublishDelete.test.js +4 -0
  83. package/tests/functional/localCreateRenameDelete.test.js +4 -0
  84. package/tests/functional/localLibCreateLibValidateDeleteLib.test.js +3 -3
  85. package/tests/functional/localPromoteRevertWP.test.js +9 -8
  86. package/.eslintrc.json +0 -18
  87. package/src/tasks/init/template/.eslintrc.json +0 -240
@@ -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
@@ -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/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
 
@@ -77,7 +77,6 @@ function PegaDxilMyRadiobuttons(props: PegaDxilMyRadiobuttonsProps) {
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 PegaDxilMyRadiobuttons(props: PegaDxilMyRadiobuttonsProps) {
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 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 PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
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
@@ -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
 
@@ -28,6 +28,10 @@ describe(`createAll list deleteAll local: ${serverDir} - ${compType}` , () => {
28
28
  // make non libraryBased
29
29
  isLibraryBasedCL = false;
30
30
  tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
31
+
32
+ // delete if exists
33
+ delete tasksConfigJSON['libraryMode'];
34
+
31
35
  compType = isLibraryBasedCL ? "library" : "original";
32
36
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
33
37
 
@@ -27,6 +27,10 @@ describe(`create buildAll deleteAll local: ${serverDir} - ${compType}`, () => {
27
27
  // make non libraryBased
28
28
  isLibraryBasedCL = false;
29
29
  tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
30
+
31
+ // delete if exists
32
+ delete tasksConfigJSON['libraryMode'];
33
+
30
34
  compType = isLibraryBasedCL ? "library" : "original";
31
35
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
32
36
 
@@ -29,6 +29,10 @@ describe(`create library delete Library: ${serverDir} - ${compType}`, () => {
29
29
  // make non libraryBased
30
30
  isLibraryBasedCL = false;
31
31
  tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
32
+
33
+ // delete if exists
34
+ delete tasksConfigJSON['libraryMode'];
35
+
32
36
  compType = isLibraryBasedCL ? "library" : "original";
33
37
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
34
38
 
@@ -12,21 +12,26 @@ const packageJSONDir = path.resolve('../../..', 'package.json');
12
12
  const packageJSONData = fs.readFileSync(packageJSONDir, { encoding: 'utf8'});
13
13
  let packageJSON = JSON.parse(packageJSONData);
14
14
 
15
- let isLibraryBasedCL = tasksConfigJSON['librayModeCL'];
16
- const savedLibraryBased = isLibraryBasedCL;
15
+
16
+ let isLibraryBasedCL = tasksConfigJSON['libraryModeCL'];
17
+ const savedLibraryBasedCL = isLibraryBasedCL;
17
18
  const savedOrganization = packageJSON.organization;
18
19
 
19
20
  const serverType = tasksConfigJSON['server-config'].serverType;
20
21
  const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
21
22
  let compType = isLibraryBasedCL ? "library" : "original";
22
23
 
23
- describe(`createLib createAll list deleteLib: ${serverDir} - ${compType}`, () => {
24
+ describe(`create list delete: ${serverDir} - ${compType}`, () => {
24
25
 
25
26
  beforeAll( async() => {
26
27
 
27
28
  // make non libraryBased
28
29
  isLibraryBasedCL = false;
29
- tasksConfigJSON['librayModeCL'] = isLibraryBasedCL;
30
+ tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
31
+
32
+ // delete if exists
33
+ delete tasksConfigJSON['libraryMode'];
34
+
30
35
  compType = isLibraryBasedCL ? "library" : "original";
31
36
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
32
37
 
@@ -48,8 +53,8 @@ describe(`createLib createAll list deleteLib: ${serverDir} - ${compType}`, () =>
48
53
  afterAll( async() => {
49
54
 
50
55
  //restore
51
- isLibraryBasedCL = savedLibraryBased
52
- tasksConfigJSON['librayModeCL'] = isLibraryBasedCL;
56
+ isLibraryBasedCL = savedLibraryBasedCL;
57
+ tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
53
58
 
54
59
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
55
60
 
@@ -27,6 +27,10 @@ describe(`create publish deleteAll local: ${serverDir} - ${compType}`, () => {
27
27
  // make non libraryBased
28
28
  isLibraryBasedCL = false;
29
29
  tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
30
+
31
+ // delete if exists
32
+ delete tasksConfigJSON['libraryMode'];
33
+
30
34
  compType = isLibraryBasedCL ? "library" : "original";
31
35
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
32
36
 
@@ -27,6 +27,10 @@ describe(`create publish delete local: ${serverDir} - ${compType}`, () => {
27
27
  // make non libraryBased
28
28
  isLibraryBasedCL = false;
29
29
  tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
30
+
31
+ // delete if exists
32
+ delete tasksConfigJSON['libraryMode'];
33
+
30
34
  compType = isLibraryBasedCL ? "library" : "original";
31
35
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
32
36
 
@@ -27,6 +27,10 @@ describe(`create rename delete local: ${serverDir} - ${compType}`, () => {
27
27
  // make non libraryBased
28
28
  isLibraryBasedCL = false;
29
29
  tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
30
+
31
+ // delete if exists
32
+ delete tasksConfigJSON['libraryMode'];
33
+
30
34
  compType = isLibraryBasedCL ? "library" : "original";
31
35
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
32
36
 
@@ -152,7 +152,7 @@ describe(`createLib create validate deleteLib: ${serverDir} - ${compType}` , ()
152
152
  // // remove it
153
153
  // fs.rmdirSync(fileDir, { recursive: true });
154
154
  // }
155
- }, 10000);
155
+ }, 30000);
156
156
 
157
157
  it('npm run create Local details', async () => {
158
158
  const fileName = 'MyTestDetails';
@@ -184,7 +184,7 @@ describe(`createLib create validate deleteLib: ${serverDir} - ${compType}` , ()
184
184
  // // remove it
185
185
  // fs.rmdirSync(fileDir, { recursive: true });
186
186
  // }
187
- }, 10000);
187
+ }, 30000);
188
188
 
189
189
  it(`npm run validate Pega_DXIL_MyTestText - ${isLibraryBasedCL}`, async() => {
190
190
 
@@ -205,7 +205,7 @@ describe(`createLib create validate deleteLib: ${serverDir} - ${compType}` , ()
205
205
  expect(stdout).toContain('Pega_DXIL_MyTestPage schema is valid');
206
206
  expect(stdout).toContain('Pega_DXIL_MyTestDetails schema is valid');
207
207
 
208
- expect(stdout).toContain('Validation compile...');
208
+ expect(stdout).toContain('Validation via build library...');
209
209
  expect(stdout).toContain('Done.');
210
210
 
211
211
  }, 200000);
@@ -12,22 +12,23 @@ const packageJSONDir = path.resolve('../../..', 'package.json');
12
12
  const packageJSONData = fs.readFileSync(packageJSONDir, { encoding: 'utf8'});
13
13
  let packageJSON = JSON.parse(packageJSONData);
14
14
 
15
- let isLibraryBased = tasksConfigJSON['libraryMode'];
16
- const savedLibraryBased = isLibraryBased;
15
+ let isLibraryBasedCL = tasksConfigJSON['libraryModeCL'];
16
+ const savedLibraryBasedCL = isLibraryBasedCL;
17
+
17
18
  const savedOrganization = packageJSON.organization;
18
19
 
19
20
  const serverType = tasksConfigJSON['server-config'].serverType;
20
21
  const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
21
- let compType = isLibraryBased ? "library" : "original";
22
+ let compType = isLibraryBasedCL ? "library" : "original";
22
23
 
23
24
  describe(`promote revert webpack: ${serverDir} - ${compType}`, () => {
24
25
 
25
26
  beforeAll( async() => {
26
27
 
27
28
  // make non libraryBased
28
- isLibraryBased = false;
29
- tasksConfigJSON['libraryMode'] = isLibraryBased;
30
- compType = isLibraryBased ? "library" : "original";
29
+ isLibraryBasedCL = false;
30
+ tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
31
+ compType = isLibraryBasedCL ? "library" : "original";
31
32
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
32
33
 
33
34
  // make organzation Pega
@@ -48,8 +49,8 @@ describe(`promote revert webpack: ${serverDir} - ${compType}`, () => {
48
49
  afterAll( async() => {
49
50
 
50
51
  //restore
51
- isLibraryBased = savedLibraryBased
52
- tasksConfigJSON['libraryMode'] = isLibraryBased;
52
+ isLibraryBasedCL = savedLibraryBasedCL
53
+ tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
53
54
 
54
55
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
55
56
 
package/.eslintrc.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": ["@pega"],
4
- "ignorePatterns": ["node_modules", "**/template/**"],
5
- "env": {
6
- "browser": false,
7
- "node": true
8
- },
9
- "rules": {
10
- "prettier/prettier": "off",
11
- "sonarjs/cognitive-complexity": "off",
12
- "sonarjs/no-identical-functions": "off",
13
- "sonarjs/no-duplicate-string": "off",
14
- "sonarjs/no-nested-template-literals": "off",
15
- "no-console": "off",
16
- "import/extensions": ["error", "ignorePackages"]
17
- }
18
- }
@@ -1,240 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": ["@pega"],
4
- "parserOptions": {
5
- "project": "tsconfig.json",
6
- "ecmaVersion": 13
7
- },
8
- "globals": {
9
- "PCore": "readonly"
10
- },
11
- "settings": {
12
- "import/resolver": {
13
- "typescript": {},
14
- "node": {
15
- "extensions": [".js", ".jsx", ".ts", ".tsx"]
16
- }
17
- },
18
- "react": {
19
- "version": "detect"
20
- }
21
- },
22
- "ignorePatterns": [
23
- "node_modules",
24
- "packages/*/lib",
25
- "!.storybook",
26
- ".storybook/public",
27
- "**/demo.stories.jsx",
28
- "**/mock.stories.js",
29
- "**/demo.stories.tsx",
30
- "**/mock.stories.ts",
31
- "**/*.mdx"
32
- ],
33
- "rules": {
34
- // Prettier recommends running separately from a linter.
35
- // https://prettier.io/docs/en/integrating-with-linters.html#notes
36
- "prettier/prettier": "off",
37
-
38
- // Disable rules from shared configs we're not ready for yet.
39
- "sonarjs/cognitive-complexity": "off",
40
- "sonarjs/no-identical-functions": "off",
41
- "sonarjs/no-duplicate-string": "off",
42
- "sonarjs/no-nested-template-literals": "off",
43
-
44
- //
45
- // JA - Override some default lint handling here
46
- "@typescript-eslint/array-type": "off",
47
- // "import/extensions": ["warn", "never"], // Turning off for now (see below)
48
-
49
- //
50
- // Initial release: turning these off; phase in to "warn" or "error" over time
51
- // For "quotes" and "@typescript-eslint/quotes", see override below for .ts/.tsx files
52
- "import/extensions": ["off", "never"],
53
- "import/named": "off",
54
- "import/no-cycle": "off",
55
- "import/no-duplicates": "off",
56
- "import/no-extraneous-dependencies": "off",
57
- "import/no-named-as-default": "off",
58
- "import/no-named-as-default-member": "off",
59
- "import/no-self-import": "off",
60
- "import/no-unresolved": "off",
61
- "import/no-useless-path-segments": "off",
62
- "import/order": "off",
63
-
64
- "no-else-return": "off",
65
- "no-restricted-syntax": "off",
66
- "no-underscore-dangle": "off",
67
-
68
- "jsx-a11y/alt-text": "off",
69
- "jsx-a11y/anchor-is-valid": "off",
70
- "jsx-a11y/click-events-have-key-events": "off",
71
- "jsx-a11y/label-has-associated-control": "off",
72
- "jsx-a11y/no-static-element-interactions": "off",
73
-
74
- "react/jsx-fragments": "off",
75
- "react/jsx-no-bind": "off",
76
- "react/self-closing-comp": "off",
77
-
78
- "sonarjs/prefer-immediate-return": "off",
79
-
80
- "@typescript-eslint/dot-notation": "off", // prefer warn but needs different parserOptions
81
- "@typescript-eslint/naming-convention": "off", // prefer warn but needs different parserOptions
82
- "@typescript-eslint/ban-types": "off", // also, see override below
83
-
84
- //
85
- // Initial release: set to error
86
- "@typescript-eslint/no-inferrable-types": "error",
87
- "eqeqeq": "off",
88
- "no-alert": "off",
89
- "no-console": "error",
90
- "no-fallthrough": "error",
91
- "no-undef": "error",
92
- "no-unused-vars": "off",
93
- "no-var": "off",
94
- "yoda": "error",
95
- "no-irregular-whitespace": "off",
96
- "no-empty": "off",
97
- "no-new-object": "off",
98
- "import/no-relative-packages": "off",
99
-
100
- "import/no-mutable-exports": "error",
101
- "sonarjs/max-switch-cases": "error",
102
- "sonarjs/no-collapsible-if": "error",
103
- "sonarjs/no-all-duplicated-branches": "error",
104
- "sonarjs/no-duplicated-branches": "error",
105
- "sonarjs/no-gratuitous-expressions": "error",
106
- "sonarjs/no-ignored-return": "error",
107
- "sonarjs/no-small-switch": "error",
108
- "sonarjs/prefer-object-literal": "error",
109
- "sonarjs/prefer-single-boolean-return": "error",
110
- "@typescript-eslint/no-shadow": "error",
111
- "react/default-props-match-prop-types": "error",
112
- "react/no-unescaped-entities": "error",
113
- "react/no-unused-prop-types": "error",
114
- "react/static-property-placement": "error",
115
- "array-callback-return": "error",
116
- "camelcase": "error",
117
- "func-names": "error",
118
- "no-case-declarations": "error",
119
- "no-lonely-if": "error",
120
- "no-nested-ternary": "error",
121
- "no-plusplus": "error",
122
- "no-restricted-globals": "error",
123
- "no-restricted-properties": "error",
124
- "no-shadow": "error",
125
- "radix": "error",
126
- "spaced-comment": "error",
127
-
128
- "import/newline-after-import": "error",
129
- "sonarjs/no-nested-switch": "error",
130
- "@typescript-eslint/no-array-constructor": "error",
131
- "@typescript-eslint/no-empty-function": "error",
132
- "@typescript-eslint/no-unused-vars": "error",
133
- "@typescript-eslint/no-useless-constructor": "error",
134
- "react/button-has-type": "error",
135
- "react/jsx-curly-brace-presence": "error",
136
- "react/jsx-boolean-value": "error",
137
- "react/no-array-index-key": "error",
138
- "class-methods-use-this": "error",
139
- "guard-for-in": "error",
140
- "no-unneeded-ternary": "error",
141
- "no-unused-expressions": "error",
142
- "operator-assignment": "error",
143
- "prefer-template": "error",
144
- "vars-on-top": "error",
145
- "prefer-regex-literals": "off",
146
-
147
- "no-use-before-define": "off", // doc for @typescript-eslint/no-use-before-define says to turn off the base implementation
148
- "@typescript-eslint/no-use-before-define": "error"
149
- },
150
- "overrides": [
151
- {
152
- "files": "*.@(ts|tsx)",
153
- "rules": {
154
- "@typescript-eslint/method-signature-style": ["error", "property"],
155
- // "@typescript-eslint/ban-types": [
156
- // "warn",
157
- // {
158
- // "types": {
159
- // "Omit": "Please use the 'OmitStrict' type from 'src/types/' instead.",
160
- // "object": false,
161
- // "Function": false
162
- // },
163
- // "extendDefaults": true
164
- // }
165
- // ],
166
-
167
- "quotes": "off",
168
- "@typescript-eslint/quotes": "off"
169
- // [
170
- // "error",
171
- // "single",
172
- // {
173
- // "avoidEscape": true,
174
- // "allowTemplateLiterals": false
175
- // }
176
- // ]
177
- }
178
- },
179
- {
180
- "files": "*.@(jsx|tsx|mdx)",
181
- "rules": {
182
- "react/react-in-jsx-scope": "off",
183
- // Set up configuration for future sweep
184
- "react-hooks/exhaustive-deps": [
185
- "off",
186
- {
187
- "additionalHooks": "useAfterInitialEffect"
188
- }
189
- ]
190
- }
191
- },
192
- {
193
- // rules for typescript (keeping old rules for js)
194
- "files": "*.@(ts|tsx)",
195
- "rules": {
196
- "no-undef": "error",
197
- "no-console": "off",
198
- "import/prefer-default-export": "off",
199
- "import/no-relative-packages": "off",
200
- "react/jsx-fragments": "off",
201
- "react/react-in-jsx-scope": "off",
202
- // Set up configuration for future sweep
203
- "react-hooks/exhaustive-deps": [
204
- "error",
205
- {
206
- "additionalHooks": "useAfterInitialEffect"
207
- }
208
- ],
209
- "sonarjs/cognitive-complexity": ["warn", 45]
210
- }
211
- },
212
- // {
213
- // "files": "*.@(tsx)",
214
- // "rules": {
215
- // "react/react-in-jsx-scope": "off",
216
- // // Set up configuration for future sweep
217
- // "react-hooks/exhaustive-deps": [
218
- // "error",
219
- // {
220
- // "additionalHooks": "useAfterInitialEffect"
221
- // }
222
- // ]
223
- // }
224
- // },
225
- {
226
- "files": "*.@(js|jsx|ts|tsx|mdx)",
227
- "rules": {}
228
- },
229
- {
230
- "files": ".storybook/*.js",
231
- "extends": ["@pega/eslint-config/script"]
232
- },
233
- {
234
- "files": "*/**/mocks/**.@(mocks|styles).@(tsx|ts)",
235
- "rules": {
236
- "import/prefer-default-export": ["off"]
237
- }
238
- }
239
- ]
240
- }