@pega/custom-dx-components 0.25.33 → 0.25.35
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 +9 -3
- package/package.json +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +0 -1
- package/src/tasks/init/index.js +18 -9
- package/src/tasks/init/template/eslint.config.mjs +9 -3
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/tasks/init/template/tasks.config.json +2 -2
- package/src/tasks/list/helper.js +5 -1
- package/src/tasks/publish-lib/index.js +2 -1
- package/src/tasks/show-help/index.js +2 -1
- package/src/util.js +5 -5
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
- package/tests/functional/localLibCreateLibDeleteLib.test.js +1 -1
package/eslint.config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
package/src/tasks/init/index.js
CHANGED
|
@@ -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
|
-
|
|
187
|
-
|
|
186
|
+
`Get a list of commands\n`,
|
|
187
|
+
` ${chalk.blueBright('npm run help')}`,
|
|
188
188
|
'\n\n',
|
|
189
|
-
|
|
190
|
-
'\n
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
195
|
-
|
|
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
|
|
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 {
|
|
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.
|
|
110
|
+
"@pega/custom-dx-components": "~0.25.35",
|
|
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
|
|
35
|
+
"version": "1.0.0",
|
|
36
36
|
"subtype": "",
|
|
37
37
|
"description": "",
|
|
38
38
|
"icon": ""
|
|
39
39
|
},
|
|
40
40
|
"usePromotedWebPack": false,
|
|
41
|
-
"libraryModeCL":
|
|
41
|
+
"libraryModeCL": true,
|
|
42
42
|
"showDebug": false
|
|
43
43
|
}
|
package/src/tasks/list/helper.js
CHANGED
|
@@ -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) =>
|
|
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
|
|
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") {
|
|
@@ -1676,9 +1677,7 @@ if (showDebug) addDebugLog("getC11NB2STokenAndStaticServer", "", "");
|
|
|
1676
1677
|
if (OAuthData) {
|
|
1677
1678
|
const { C11NB2S, appStaticContentServer, access_token } = JSON.parse(OAuthData)
|
|
1678
1679
|
|
|
1679
|
-
|
|
1680
|
-
return ({ C11NB2S, appStaticContentServer, access_token});
|
|
1681
|
-
}
|
|
1680
|
+
return ({ C11NB2S, appStaticContentServer, access_token});
|
|
1682
1681
|
|
|
1683
1682
|
}
|
|
1684
1683
|
return ({});
|
|
@@ -2558,7 +2557,8 @@ if (showDebug) addDebugLog("checkLibraryAndArchives", ``, "");
|
|
|
2558
2557
|
const hasArch = await hasArchives();
|
|
2559
2558
|
|
|
2560
2559
|
if (isLibraryBased && !hasArch) {
|
|
2561
|
-
console.log(chalk.yellow('\nPlease create a library before proceeding
|
|
2560
|
+
console.log(chalk.yellow('\nPlease create/import a library before proceeding.'));
|
|
2561
|
+
console.log(`\tMore info... ${chalk.cyan('npm run help')}\n`);
|
|
2562
2562
|
process.exit();
|
|
2563
2563
|
}
|
|
2564
2564
|
};
|
|
@@ -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);
|