@pega/custom-dx-components 0.25.43 → 0.25.44
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
CHANGED
|
@@ -119,7 +119,7 @@ const compileMustacheTemplates = async (
|
|
|
119
119
|
TYPE: type,
|
|
120
120
|
SUB_TYPE: JSON.stringify(mustacheSubType),
|
|
121
121
|
SUB_TYPE_LABEL: subTypeLabel,
|
|
122
|
-
DESCRIPTION: description,
|
|
122
|
+
DESCRIPTION: description || componentLabel,
|
|
123
123
|
IS_TEMPLATE: isTemplate,
|
|
124
124
|
IS_PICKLIST: isPicklist,
|
|
125
125
|
IS_BOOLEAN: isBool,
|
|
@@ -190,6 +190,8 @@ const validateCompile = async (
|
|
|
190
190
|
framework = "Constellation";
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
|
|
194
|
+
|
|
193
195
|
const orgLib = getConfigDefaults();
|
|
194
196
|
if (isLibraryBased) {
|
|
195
197
|
// library comes from config
|
|
@@ -440,6 +442,7 @@ addDebugLog("create", "", "+");
|
|
|
440
442
|
description,
|
|
441
443
|
allowedApplications
|
|
442
444
|
} = answers;
|
|
445
|
+
|
|
443
446
|
await validateCompile(
|
|
444
447
|
{
|
|
445
448
|
componentName,
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@babel/preset-react": "^7.27.1",
|
|
109
109
|
"@babel/preset-typescript": "^7.27.1",
|
|
110
110
|
"@pega/configs": "^0.16.3",
|
|
111
|
-
"@pega/custom-dx-components": "~0.25.
|
|
111
|
+
"@pega/custom-dx-components": "~0.25.44",
|
|
112
112
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
113
113
|
"@storybook/addon-actions": "^8.6.14",
|
|
114
114
|
"@storybook/addon-essentials": "^8.6.14",
|
|
@@ -370,10 +370,18 @@ export default async (option) => {
|
|
|
370
370
|
throw new Error(`Invalid schema json in config.json: ${er}`);
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
373
376
|
const valid = validateSchema(data);
|
|
374
377
|
|
|
375
378
|
if (valid) {
|
|
376
379
|
|
|
380
|
+
if (data.description === "") {
|
|
381
|
+
throw new Error(`Invalid schema json in config.json: 'description' cannot be blank.`);
|
|
382
|
+
process.exit(1);
|
|
383
|
+
}
|
|
384
|
+
|
|
377
385
|
if (
|
|
378
386
|
componentToValidate &&
|
|
379
387
|
!/^[A-Za-z0-9]+_[A-Za-z0-9]+_[A-Za-z0-9]+$/.test(componentToValidate)
|
package/src/util.js
CHANGED
|
@@ -760,6 +760,11 @@ if (showDebug) addDebugLog("restoreTopLevelConfigFiles", `directory: ${directory
|
|
|
760
760
|
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
761
761
|
const configFiles = await getTopLevelConfigFiles(tempDirectory);
|
|
762
762
|
|
|
763
|
+
// we force to get the tasks.config.json and store it locally
|
|
764
|
+
// when we call updateComponentTaskConfig we will use this stored version to bring back server-config (except ruleset/version)
|
|
765
|
+
// and component objects
|
|
766
|
+
await getPegaConfig(true);
|
|
767
|
+
|
|
763
768
|
if (configFiles && configFiles.length > 0) {
|
|
764
769
|
for (const configF of configFiles) {
|
|
765
770
|
if (configF !== "package-lock.json" && configF !== "package.json") {
|
|
@@ -936,9 +941,9 @@ if (showDebug) { addDebugLog("getPegaConfig", "END", "-"); }
|
|
|
936
941
|
return pegaData;
|
|
937
942
|
};
|
|
938
943
|
|
|
939
|
-
export const getPegaServerConfig = async () => {
|
|
944
|
+
export const getPegaServerConfig = async (force = false) => {
|
|
940
945
|
if (showDebug) addDebugLog("getPegaServerConfig", "", "+");
|
|
941
|
-
if (!pegaConfig) {
|
|
946
|
+
if (!pegaConfig || force) {
|
|
942
947
|
pegaConfig = await getPegaConfig();
|
|
943
948
|
|
|
944
949
|
if (getServerType() === "launchpad") {
|
|
@@ -2218,19 +2223,23 @@ if (showDebug) addDebugLog("updateComponentTaskConfig", "", "");
|
|
|
2218
2223
|
const currentDirectory = process.cwd();
|
|
2219
2224
|
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
2220
2225
|
|
|
2221
|
-
const tempConfigPath = join(tempDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
2222
2226
|
const currentConfigPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
2223
|
-
|
|
2224
|
-
const contents = fs.readFileSync(tempConfigPath);
|
|
2225
2227
|
const originalContents = fs.readFileSync(currentConfigPath);
|
|
2226
2228
|
|
|
2227
|
-
|
|
2229
|
+
// was previously stored in
|
|
2230
|
+
let contentsData = await getPegaConfig();
|
|
2231
|
+
|
|
2228
2232
|
let originalContentsData = JSON.parse(originalContents);
|
|
2233
|
+
const orgRuleset = originalContentsData["server-config"].rulesetName;
|
|
2234
|
+
const orgRulesetVersion = originalContentsData["server-config"].rulesetVersion;
|
|
2235
|
+
|
|
2236
|
+
// we keep server-config but we will restore from archive the
|
|
2237
|
+
// rulset/version. Other stuff in task.config will come from archive
|
|
2238
|
+
originalContentsData["server-config"] = contentsData["server-config"];
|
|
2239
|
+
// restore ruleset and verion
|
|
2240
|
+
originalContentsData["server-config"].rulesetName = orgRuleset;
|
|
2241
|
+
originalContentsData["server-config"].rulesetVersion = orgRulesetVersion;
|
|
2229
2242
|
|
|
2230
|
-
// only copy "components" from archived task.config and "devBuild"
|
|
2231
|
-
// that way, your current tasks.config isn't messed up
|
|
2232
|
-
originalContentsData["server-config"].devBuild = contentsData["server-config"].devBuild;
|
|
2233
|
-
originalContentsData["component"] = contentsData["component"];
|
|
2234
2243
|
|
|
2235
2244
|
// if we don't have a devServerPort, add the default
|
|
2236
2245
|
if (originalContentsData["server-config"].devServerPort === undefined) {
|
|
@@ -196,7 +196,7 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
196
196
|
const { stdout, stderr } = await exec(script);
|
|
197
197
|
|
|
198
198
|
expect(stdout).toContain('Pega_DXIL_0.0.1.arch.zip has been imported!');
|
|
199
|
-
expect(stdout).toContain('You can
|
|
199
|
+
expect(stdout).toContain('--> You can retrieve and replace current source via npm run restoreLibVersion.');
|
|
200
200
|
|
|
201
201
|
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1.arch.zip");
|
|
202
202
|
expect(fs.existsSync(zipFile)).toBeTruthy();
|