@pega/custom-dx-components 0.25.27 → 0.25.29
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 +27 -27
- package/src/tasks/build-all/index.js +20 -1
- package/src/tasks/init/template/.storybook/{main.js → main.ts} +4 -3
- package/src/tasks/init/template/.storybook/manager.ts +6 -0
- package/src/tasks/init/template/.storybook/preview.tsx +4 -1
- package/src/tasks/init/template/.storybook/theme.js +1 -1
- package/src/tasks/init/template/package.json.mustache +40 -38
- package/src/tasks/publish/helper.js +7 -6
- package/src/util.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/custom-dx-components",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.29",
|
|
4
4
|
"description": "Utility for building custom UI components",
|
|
5
5
|
"bin": "./bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,53 +15,53 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@babel/core": "^7.
|
|
19
|
-
"@babel/plugin-transform-class-properties": "^7.
|
|
20
|
-
"@babel/preset-react": "^7.
|
|
21
|
-
"@pega/auth": "^0.2.
|
|
18
|
+
"@babel/core": "^7.27.1",
|
|
19
|
+
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
20
|
+
"@babel/preset-react": "^7.27.1",
|
|
21
|
+
"@pega/auth": "^0.2.24",
|
|
22
22
|
"@pega/constellation-dx-components-build-utils": "^2.0.3-dev",
|
|
23
23
|
"@pega/inquirer-fuzzy-path": "^3.0.0",
|
|
24
24
|
"ajv": "^8.17.1",
|
|
25
25
|
"ajv-keywords": "^5.1.0",
|
|
26
26
|
"archiver": "^7.0.1",
|
|
27
27
|
"arg": "^5.0.2",
|
|
28
|
-
"babel-loader": "^
|
|
28
|
+
"babel-loader": "^10.0.0",
|
|
29
29
|
"chalk": "^5.4.1",
|
|
30
30
|
"check-git": "^2.0.2",
|
|
31
|
-
"compression-webpack-plugin": "^
|
|
32
|
-
"css-loader": "
|
|
33
|
-
"css-minimizer-webpack-plugin": "^
|
|
31
|
+
"compression-webpack-plugin": "^11.1.0",
|
|
32
|
+
"css-loader": "7.1.2",
|
|
33
|
+
"css-minimizer-webpack-plugin": "^7.0.2",
|
|
34
34
|
"eslint": "^8.56.0",
|
|
35
|
-
"execa": "^
|
|
35
|
+
"execa": "^9.5.2",
|
|
36
36
|
"file-loader": "6.2.0",
|
|
37
37
|
"fs-extra": "^11.3.0",
|
|
38
38
|
"gitignore": "^0.7.0",
|
|
39
39
|
"inquirer": "^9.3.7",
|
|
40
40
|
"jwt-decode": "^4.0.0",
|
|
41
|
-
"listr2": "^8.
|
|
42
|
-
"mini-css-extract-plugin": "2.
|
|
41
|
+
"listr2": "^8.3.3",
|
|
42
|
+
"mini-css-extract-plugin": "2.9.2",
|
|
43
43
|
"mustache": "^4.2.0",
|
|
44
44
|
"ncp": "^2.0.0",
|
|
45
45
|
"node-fetch": "^3.3.2",
|
|
46
46
|
"node-stream-zip": "^1.15.0",
|
|
47
|
-
"ora": "^8.
|
|
47
|
+
"ora": "^8.2.0",
|
|
48
48
|
"pascalcase": "^2.0.0",
|
|
49
|
-
"postcss": "^8.5.
|
|
50
|
-
"postcss-loader": "
|
|
51
|
-
"postcss-preset-env": "
|
|
49
|
+
"postcss": "^8.5.3",
|
|
50
|
+
"postcss-loader": "8.1.1",
|
|
51
|
+
"postcss-preset-env": "10.1.6",
|
|
52
52
|
"prop-types": "^15.8.1",
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-dev-utils": "^12.0.1",
|
|
55
55
|
"resolve": "1.22.10",
|
|
56
56
|
"resolve-url-loader": "^5.0.0",
|
|
57
|
-
"sass-loader": "^
|
|
58
|
-
"terser-webpack-plugin": "5.3.
|
|
57
|
+
"sass-loader": "^16.0.5",
|
|
58
|
+
"terser-webpack-plugin": "5.3.14",
|
|
59
59
|
"ts-loader": "^9.5.2",
|
|
60
|
-
"typescript": "~5.
|
|
60
|
+
"typescript": "~5.8.3",
|
|
61
61
|
"unarchive": "^1.1.3",
|
|
62
62
|
"url-loader": "4.1.1",
|
|
63
|
-
"webpack": "5.
|
|
64
|
-
"webpack-cli": "^
|
|
63
|
+
"webpack": "5.99.8",
|
|
64
|
+
"webpack-cli": "^6.0.1"
|
|
65
65
|
},
|
|
66
66
|
"author": "Custom component dev",
|
|
67
67
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
"custom-components"
|
|
71
71
|
],
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@babel/preset-env": "^7.
|
|
74
|
-
"@pega/configs": "^0.16.
|
|
75
|
-
"@pega/prettier-config": "^0.16.
|
|
73
|
+
"@babel/preset-env": "^7.27.2",
|
|
74
|
+
"@pega/configs": "^0.16.3",
|
|
75
|
+
"@pega/prettier-config": "^0.16.3",
|
|
76
76
|
"@types/jest": "^29.5.14",
|
|
77
77
|
"babel-jest": "^29.7.0",
|
|
78
|
-
"cspell": "^8.
|
|
78
|
+
"cspell": "^8.19.4",
|
|
79
79
|
"jest": "^29.7.0",
|
|
80
80
|
"jest-environment-jsdom": "^29.7.0",
|
|
81
81
|
"jest-junit": "^16.0.0",
|
|
82
|
-
"prettier": "3.
|
|
83
|
-
"ts-jest": "^29.2
|
|
82
|
+
"prettier": "3.5.3",
|
|
83
|
+
"ts-jest": "^29.3.2"
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -12,12 +12,15 @@ import {
|
|
|
12
12
|
addDebugLog,
|
|
13
13
|
cleanUp,
|
|
14
14
|
getLibraryBased,
|
|
15
|
+
getLibraryBasedCL,
|
|
15
16
|
checkLibraryAndArchives,
|
|
16
17
|
getConfigDefaults,
|
|
17
18
|
zipVersionAndArchive } from '../../util.js';
|
|
18
19
|
|
|
19
20
|
import { getBuildComponentQuestions } from './helper.js';
|
|
20
21
|
|
|
22
|
+
import { buildLibV3 } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
23
|
+
|
|
21
24
|
|
|
22
25
|
export function getCustomTasks(componentKey, sourceMap, devBuild, options, showStats, skipBuild) {
|
|
23
26
|
addDebugLog("getCustomTasks", `componentKey: ${componentKey}, sourceMap: ${sourceMap}, devBuild: ${devBuild}, skipBuild: ${skipBuild}`, "");
|
|
@@ -54,6 +57,7 @@ export default async options => {
|
|
|
54
57
|
await checkLibraryAndArchives();
|
|
55
58
|
|
|
56
59
|
const isLibraryBased = getLibraryBased();
|
|
60
|
+
const isLibraryBasedCL = getLibraryBasedCL();
|
|
57
61
|
|
|
58
62
|
addDebugLog("buildAllComponents", "", "+");
|
|
59
63
|
const components = await getComponents();
|
|
@@ -99,7 +103,7 @@ addDebugLog("buildAllComponents", "", "+");
|
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
// if skipBuild, then do a build here as opposed to every step (v1 is every step, v2, just once)
|
|
102
|
-
if (skipBuild && firstComponent) {
|
|
106
|
+
if (skipBuild && firstComponent && !isLibraryBasedCL) {
|
|
103
107
|
console.log();
|
|
104
108
|
console.log(chalk.bold.green("Validation compile..."));
|
|
105
109
|
await bundleComponent(firstComponent, sourceMap, devBuild, showStats);
|
|
@@ -107,6 +111,21 @@ addDebugLog("buildAllComponents", "", "+");
|
|
|
107
111
|
await zipVersionAndArchive(confDef.currentOrgLib, confDef.buildVersion);
|
|
108
112
|
}
|
|
109
113
|
|
|
114
|
+
if (isLibraryBasedCL) {
|
|
115
|
+
console.log();
|
|
116
|
+
console.log(chalk.bold.green("Validation via build library..."));
|
|
117
|
+
const confDef = getConfigDefaults();
|
|
118
|
+
const organization = confDef.organization;
|
|
119
|
+
const library = confDef.library;
|
|
120
|
+
|
|
121
|
+
const buildLibName = organization.concat('_').concat(library);
|
|
122
|
+
|
|
123
|
+
buildLibV3(
|
|
124
|
+
buildLibName,
|
|
125
|
+
confDef.buildVersion
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
110
129
|
|
|
111
130
|
|
|
112
131
|
// once done, remove leftover directories
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
const config = {
|
|
1
|
+
import type { StorybookConfig } from '@storybook/react-vite';
|
|
2
|
+
const config: StorybookConfig = {
|
|
3
3
|
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
|
4
4
|
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
5
5
|
framework: {
|
|
6
|
-
name: '@storybook/react-
|
|
6
|
+
name: '@storybook/react-vite',
|
|
7
|
+
options: {}
|
|
7
8
|
},
|
|
8
9
|
docs: {
|
|
9
10
|
autodocs: 'tag'
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Preview } from '@storybook/react';
|
|
2
|
+
import Theme from './theme';
|
|
3
|
+
|
|
2
4
|
import {
|
|
3
5
|
Configuration,
|
|
4
6
|
LiveLog,
|
|
@@ -18,7 +20,8 @@ const preview: Preview = {
|
|
|
18
20
|
}
|
|
19
21
|
},
|
|
20
22
|
docs: {
|
|
21
|
-
source: { type: 'code' }
|
|
23
|
+
source: { type: 'code' },
|
|
24
|
+
theme: Theme
|
|
22
25
|
}
|
|
23
26
|
},
|
|
24
27
|
|
|
@@ -81,63 +81,64 @@
|
|
|
81
81
|
"author": "",
|
|
82
82
|
"license": "Enter License",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@pega/cosmos-react-condition-builder": "^8.0.0-build.
|
|
85
|
-
"@pega/cosmos-react-core": "^8.0.0-build.
|
|
86
|
-
"@pega/cosmos-react-work": "^8.0.0-build.
|
|
87
|
-
"@pega/eslint-config": "^0.16.
|
|
88
|
-
"@pega/tsconfig": "^0.16.
|
|
89
|
-
"babel-loader": "^
|
|
90
|
-
"dayjs": "^1.11.
|
|
84
|
+
"@pega/cosmos-react-condition-builder": "^8.0.0-build.39.7",
|
|
85
|
+
"@pega/cosmos-react-core": "^8.0.0-build.39.7",
|
|
86
|
+
"@pega/cosmos-react-work": "^8.0.0-build.39.7",
|
|
87
|
+
"@pega/eslint-config": "^0.16.3",
|
|
88
|
+
"@pega/tsconfig": "^0.16.3",
|
|
89
|
+
"babel-loader": "^10.0.0",
|
|
90
|
+
"dayjs": "^1.11.13",
|
|
91
91
|
"fast-deep-equal": "3.1.3",
|
|
92
92
|
"lodash": "^4.17.21",
|
|
93
93
|
"lodash.get": "^4.4.2",
|
|
94
94
|
"npm": "^10.8.1",
|
|
95
|
-
"react": "^
|
|
95
|
+
"react": "^18.3.1",
|
|
96
96
|
"react-autosuggest": "^10.1.0",
|
|
97
|
-
"react-dom": "^
|
|
97
|
+
"react-dom": "^18.3.1",
|
|
98
98
|
"react-is": "^18.3.1",
|
|
99
99
|
"react-redux": "^7.2.9",
|
|
100
|
-
"serve": "^14.2.
|
|
100
|
+
"serve": "^14.2.4",
|
|
101
101
|
"shelljs": "^0.8.5",
|
|
102
102
|
"styled-components": "^5.3.11",
|
|
103
103
|
"ts-loader": "^9.5.2"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@babel/preset-env": "^7.
|
|
107
|
-
"@babel/preset-react": "^7.
|
|
108
|
-
"@babel/preset-typescript": "^7.
|
|
109
|
-
"@pega/configs": "^0.16.
|
|
110
|
-
"@pega/custom-dx-components": "~0.25.
|
|
106
|
+
"@babel/preset-env": "^7.27.2",
|
|
107
|
+
"@babel/preset-react": "^7.27.1",
|
|
108
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
109
|
+
"@pega/configs": "^0.16.3",
|
|
110
|
+
"@pega/custom-dx-components": "~0.25.29",
|
|
111
111
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
112
|
-
"@storybook/addon-actions": "^
|
|
113
|
-
"@storybook/addon-essentials": "^
|
|
114
|
-
"@storybook/addon-links": "^
|
|
115
|
-
"@storybook/addon-storysource": "^
|
|
116
|
-
"@storybook/manager-api": "^
|
|
117
|
-
"@storybook/react": "^
|
|
118
|
-
"@storybook/react-
|
|
119
|
-
"@storybook/
|
|
120
|
-
"@storybook/
|
|
112
|
+
"@storybook/addon-actions": "^8.6.12",
|
|
113
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
114
|
+
"@storybook/addon-links": "^8.6.12",
|
|
115
|
+
"@storybook/addon-storysource": "^8.6.12",
|
|
116
|
+
"@storybook/manager-api": "^8.6.12",
|
|
117
|
+
"@storybook/react": "^8.6.12",
|
|
118
|
+
"@storybook/react-vite": "^8.6.12",
|
|
119
|
+
"@storybook/react-webpack5": "^8.6.12",
|
|
120
|
+
"@storybook/test": "^8.6.12",
|
|
121
|
+
"@storybook/test-runner": "^0.22.0",
|
|
122
|
+
"@storybook/theming": "^8.6.12",
|
|
121
123
|
"@testing-library/dom": "^10.4.0",
|
|
122
124
|
"@testing-library/jest-dom": "^6.6.3",
|
|
123
125
|
"@testing-library/react": "^12.1.5",
|
|
124
126
|
"@types/emoji-mart": "^3.0.14",
|
|
125
127
|
"@types/jest": "^29.5.14",
|
|
126
128
|
"@types/lodash.get": "^4.4.9",
|
|
127
|
-
"@types/react": "^
|
|
129
|
+
"@types/react": "^18.3.21",
|
|
128
130
|
"@types/react-color": "^3.0.13",
|
|
129
|
-
"@types/react-dom": "^
|
|
131
|
+
"@types/react-dom": "^18.3.7",
|
|
130
132
|
"@types/styled-components": "^5.1.34",
|
|
131
133
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
132
|
-
"
|
|
133
|
-
"core-js": "^3.40.0",
|
|
134
|
+
"core-js": "^3.42.0",
|
|
134
135
|
"eslint": "^8.57.0",
|
|
135
136
|
"eslint-plugin-import": "^2.31.0",
|
|
136
|
-
"eslint-plugin-jest": "^28.
|
|
137
|
-
"eslint-plugin-jsx-a11y": "^6.10.
|
|
138
|
-
"eslint-plugin-mdx": "^3.1
|
|
139
|
-
"eslint-plugin-prettier": "^5.
|
|
140
|
-
"eslint-plugin-react": "^7.37.
|
|
137
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
138
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
139
|
+
"eslint-plugin-mdx": "^3.4.1",
|
|
140
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
141
|
+
"eslint-plugin-react": "^7.37.5",
|
|
141
142
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
142
143
|
"eslint-plugin-sonarjs": "^0.23.0",
|
|
143
144
|
"eslint-plugin-storybook": "^0.6.15",
|
|
@@ -149,10 +150,11 @@
|
|
|
149
150
|
"jwt-decode": "^4.0.0",
|
|
150
151
|
"node-stream-zip": "^1.15.0",
|
|
151
152
|
"npm-run-all": "^4.1.5",
|
|
152
|
-
"prettier": "3.
|
|
153
|
-
"storybook": "^
|
|
154
|
-
"stylelint": "^16.
|
|
155
|
-
"ts-jest": "^29.2
|
|
156
|
-
"typescript": "~5.5.4"
|
|
153
|
+
"prettier": "3.5.3",
|
|
154
|
+
"storybook": "^8.6.12",
|
|
155
|
+
"stylelint": "^16.19.1",
|
|
156
|
+
"ts-jest": "^29.3.2",
|
|
157
|
+
"typescript": "~5.5.4",
|
|
158
|
+
"vite": "^6.3.5"
|
|
157
159
|
}
|
|
158
160
|
}
|
|
@@ -218,27 +218,28 @@ addDebugLog("publishComponentToServer", `data: ${data}`, "");
|
|
|
218
218
|
|
|
219
219
|
try {
|
|
220
220
|
const respData = isLaunchpad ? await response.text() : await response.json();
|
|
221
|
-
console.log(chalk.bold.green(`Success : ${isLaunchpad ? respData : respData.message}`));
|
|
222
|
-
|
|
223
221
|
if (status === 500) {
|
|
224
222
|
status = 999;
|
|
225
|
-
throw
|
|
223
|
+
throw Error( "\n" + respData.message);
|
|
226
224
|
}
|
|
225
|
+
|
|
226
|
+
console.log(chalk.bold.green(`Success : ${isLaunchpad ? respData : respData.message}`));
|
|
227
|
+
|
|
227
228
|
} catch (err) {
|
|
228
229
|
if (status === 500) {
|
|
229
230
|
throw new Error(
|
|
230
231
|
`Error occurred in authentication. Please regenerate using authenticate`
|
|
231
232
|
);
|
|
232
233
|
} else if (status === 999) {
|
|
233
|
-
throw
|
|
234
|
+
throw Error(err);
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
} else {
|
|
237
|
-
throw new
|
|
238
|
+
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
238
239
|
}
|
|
239
240
|
} catch (err) {
|
|
240
241
|
// throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
241
|
-
throw
|
|
242
|
+
throw Error(err);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
};
|
package/src/util.js
CHANGED
|
@@ -2444,8 +2444,12 @@ if (showDebug) addDebugLog("restoreFromArchive", `fileName: ${fileName}, orgLibN
|
|
|
2444
2444
|
const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
|
|
2445
2445
|
const archFileName = join(archiveDirectory, fileName);
|
|
2446
2446
|
|
|
2447
|
-
await unZipFromArchive(archFileName);
|
|
2448
2447
|
|
|
2448
|
+
if (!fs.existsSync(archiveDirectory)) {
|
|
2449
|
+
throw new Error (`Archive ${orgLibName}/${version} does NOT exist.`);
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
await unZipFromArchive(archFileName);
|
|
2449
2453
|
|
|
2450
2454
|
const tempPackagePath = join (tempDirectory, PACKAGE_JSON_FILENAME);
|
|
2451
2455
|
const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
|