@pega/custom-dx-components 0.25.54 → 0.25.56
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 +2 -2
- package/src/tasks/build-comp/index.js +1 -1
- package/src/tasks/build-jest-assets/index.js +1 -1
- package/src/tasks/build-lib/helper.js +1 -1
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/config.json.mustache +146 -0
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/demo.stories.tsx.mustache +61 -0
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/demo.test.tsx.mustache +23 -0
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/event-utils.ts.mustache +18 -0
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +246 -0
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/mock.ts.mustache +40 -0
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/styles.ts.mustache +8 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/DetailsRender.tsx.mustache +59 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +255 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/demo.test.tsx.mustache +40 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/index.tsx.mustache +75 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/mock.ts.mustache +135 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM/styles.ts.mustache +8 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/DetailsRender.tsx.mustache +59 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +272 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.test.tsx.mustache +56 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/index.tsx.mustache +80 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/mock.ts.mustache +141 -0
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/styles.ts.mustache +8 -0
- package/src/tasks/create-lib/index.js +3 -3
- package/src/tasks/create-version/index.js +1 -1
- package/src/tasks/delete/helper.js +1 -1
- package/src/tasks/delete-all/helper.js +2 -2
- package/src/tasks/delete-pub/helper.js +3 -3
- package/src/tasks/delete-pub/index.js +3 -3
- package/src/tasks/export-archive/index.js +7 -7
- package/src/tasks/import-archive/helper.js +6 -6
- package/src/tasks/import-archive/index.js +8 -8
- package/src/tasks/import-comp/index.js +1 -1
- package/src/tasks/init/template/package.json.mustache +2 -2
- package/src/tasks/linter/index.js +1 -1
- package/src/tasks/list-lib/index.js +4 -4
- package/src/tasks/move/index.js +7 -7
- package/src/tasks/publish/index.js +6 -6
- package/src/tasks/publish-lib/index.js +2 -2
- package/src/tasks/rename/index.js +2 -2
- package/src/tasks/rename-lib/index.js +1 -1
- package/src/tasks/restore-config/index.js +1 -1
- package/src/tasks/show-help/index.js +1 -1
- package/src/tasks/switch-lib/index.js +2 -2
- package/src/tasks/switch-version/index.js +1 -1
- package/src/tasks/validator/index.js +2 -2
- package/src/util.js +18 -18
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/mock.ts +0 -4
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +1 -6
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -6
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/mock.ts +0 -4
- package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +0 -9
- package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +0 -9
- /package/{tests/assets/original/components/create/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/PConnProps.d.ts.mustache} +0 -0
- /package/{tests/assets/original/components/create/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/create-nonce.ts.mustache} +0 -0
- /package/{tests/assets/original/components/create/shared/suggestions-handler.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/suggestions-handler.ts.mustache} +0 -0
- /package/{tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Template/FORM/PConnProps.d.ts.mustache} +0 -0
- /package/{tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Template/FORM/create-nonce.ts.mustache} +0 -0
- /package/{tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Template/FORM-region/PConnProps.d.ts.mustache} +0 -0
- /package/{tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Template/FORM-region/create-nonce.ts.mustache} +0 -0
|
@@ -56,7 +56,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
|
|
|
56
56
|
configData.library = library;
|
|
57
57
|
configData.version = version;
|
|
58
58
|
|
|
59
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
59
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
60
60
|
fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
61
61
|
|
|
62
62
|
};
|
|
@@ -92,7 +92,7 @@ addDebugLog("exportCLArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName
|
|
|
92
92
|
const exportFile = join(exportPath, fileName);
|
|
93
93
|
let output;
|
|
94
94
|
|
|
95
|
-
// need to build the
|
|
95
|
+
// need to build the library
|
|
96
96
|
console.log(chalk.green(`\nBuilding binaries...\n`));
|
|
97
97
|
const arOrgLib = orgLibName.split("_")
|
|
98
98
|
const arVersion = selectedVersion.split("-");
|
|
@@ -132,7 +132,7 @@ addDebugLog("exportCLArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName
|
|
|
132
132
|
{
|
|
133
133
|
name: 'overWriteFile',
|
|
134
134
|
type: 'confirm',
|
|
135
|
-
message: '
|
|
135
|
+
message: 'Overwrite',
|
|
136
136
|
default: true
|
|
137
137
|
},
|
|
138
138
|
]);
|
|
@@ -219,7 +219,7 @@ addDebugLog("exportArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName},
|
|
|
219
219
|
{
|
|
220
220
|
name: 'overWriteFile',
|
|
221
221
|
type: 'confirm',
|
|
222
|
-
message: '
|
|
222
|
+
message: 'Overwrite',
|
|
223
223
|
default: true
|
|
224
224
|
},
|
|
225
225
|
]);
|
|
@@ -319,7 +319,7 @@ export default async options => {
|
|
|
319
319
|
// }
|
|
320
320
|
// }
|
|
321
321
|
|
|
322
|
-
//
|
|
322
|
+
// disable question to build "CL"
|
|
323
323
|
// if (fullArchive === "" ) {
|
|
324
324
|
// const fullArchiveQuestions = await getFullArchiveQuestions();
|
|
325
325
|
// const fullArchiveAnswers = await inquirer.prompt(fullArchiveQuestions);
|
|
@@ -335,7 +335,7 @@ export default async options => {
|
|
|
335
335
|
|
|
336
336
|
// if Binary, then we need to just build the current library, get the results and
|
|
337
337
|
// and export an archive as zip
|
|
338
|
-
// currently this is
|
|
338
|
+
// currently this is deprecated, we are not going to export a CL as of yet.
|
|
339
339
|
if (fullArchive === "Binary") {
|
|
340
340
|
|
|
341
341
|
inquirer.registerPrompt('fuzzypath', inquirerFuzzyPath);
|
|
@@ -360,7 +360,7 @@ export default async options => {
|
|
|
360
360
|
|
|
361
361
|
console.log(`\nExporting library ${chalk.bold.green(`${orgLibName}/${selectedVersion}`)}\n`);
|
|
362
362
|
|
|
363
|
-
// deprecating this code, only export current
|
|
363
|
+
// deprecating this code, only export current library, don't ask for others
|
|
364
364
|
// need to switchLib/Version to that library to export it
|
|
365
365
|
|
|
366
366
|
// await zipVersionAndArchive(configDef.currentOrgLib, configDef.buildVersion);
|
|
@@ -43,7 +43,7 @@ addDebugLog("setTasksConfig", `libraryName: ${libraryName}, version: ${version},
|
|
|
43
43
|
compConfig.version = version;
|
|
44
44
|
|
|
45
45
|
// update file
|
|
46
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
46
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
47
47
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -56,7 +56,7 @@ addDebugLog("setPackageOrg", "", "");
|
|
|
56
56
|
packageData.organization = organization;
|
|
57
57
|
|
|
58
58
|
// update file
|
|
59
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
59
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
60
60
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
61
61
|
|
|
62
62
|
}
|
|
@@ -83,7 +83,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
|
|
|
83
83
|
configData.library = library;
|
|
84
84
|
configData.version = version;
|
|
85
85
|
|
|
86
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
86
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
87
87
|
fs.writeFileSync(join(currentDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
88
88
|
|
|
89
89
|
};
|
|
@@ -107,7 +107,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
|
|
|
107
107
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
export const
|
|
110
|
+
export const renameDirectory = async(currentDirectory, targetDirectory) => {
|
|
111
111
|
if (!fs.existsSync(targetDirectory)) {
|
|
112
112
|
fs.mkdirSync(targetDirectory, { recursive: true });
|
|
113
113
|
}
|
|
@@ -187,7 +187,7 @@ addDebugLog("renameComponent", `library: ${library}, componentKey: ${componentKe
|
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
// rename the directory
|
|
190
|
-
await
|
|
190
|
+
await renameDirectory(currentDirectory, targetDirectory);
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
return newComponentKey;
|
|
@@ -255,7 +255,7 @@ addDebugLog("getLibraryVersionQuestion", "", "");
|
|
|
255
255
|
type: 'rawlist',
|
|
256
256
|
message: `Import from`,
|
|
257
257
|
choices: [{name: 'Local directory', value: 'Directory'}, {name: 'Server', value: 'Server'}],
|
|
258
|
-
|
|
258
|
+
default: 'Directory'
|
|
259
259
|
}
|
|
260
260
|
];
|
|
261
261
|
};
|
|
@@ -73,7 +73,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
|
|
|
73
73
|
configData.library = library;
|
|
74
74
|
configData.version = version;
|
|
75
75
|
|
|
76
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
76
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
77
77
|
fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
78
78
|
|
|
79
79
|
};
|
|
@@ -163,7 +163,7 @@ addDebugLog("renameComponent", `library: ${library}, componentKey: ${componentKe
|
|
|
163
163
|
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
-
export const
|
|
166
|
+
export const getPackageOrg = async(packagePath) => {
|
|
167
167
|
const sPackData = fs.readFileSync(packagePath, { encoding: 'utf8' });
|
|
168
168
|
const packData = sPackData && JSON.parse(sPackData);
|
|
169
169
|
|
|
@@ -213,7 +213,7 @@ export const moveComp = async(componentKey, orgLibName, version, copyShared, opt
|
|
|
213
213
|
const tempDirectoryComponents = join(tempCompPath, `${newComponentKey}`);
|
|
214
214
|
|
|
215
215
|
const currentSharedPath = join(currentCompPath, "shared");
|
|
216
|
-
const
|
|
216
|
+
const targetSharedPath = join(tempCompPath, "shared");
|
|
217
217
|
|
|
218
218
|
// copy component into temp directory
|
|
219
219
|
fs.cpSync(currentComponentsPath, tempDirectoryComponents, { recursive: true, force: true });
|
|
@@ -223,7 +223,7 @@ export const moveComp = async(componentKey, orgLibName, version, copyShared, opt
|
|
|
223
223
|
|
|
224
224
|
// copy shared
|
|
225
225
|
if (copyShared) {
|
|
226
|
-
fs.cpSync(currentSharedPath,
|
|
226
|
+
fs.cpSync(currentSharedPath, targetSharedPath, { recursive: true, force: true });
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
console.log(`\nCopied ${chalk.green(`${componentKey}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}\n`);
|
|
@@ -290,7 +290,7 @@ export const importArch = async(filePath, fileName, hadArchive) => {
|
|
|
290
290
|
// need to get info from tasks.config and package.json
|
|
291
291
|
// we won't rely on name of file, as owner can change it
|
|
292
292
|
|
|
293
|
-
let organization = await
|
|
293
|
+
let organization = await getPackageOrg(tempPackage);
|
|
294
294
|
let localConfig = await getLocalConfigData(tempTasksConfig);
|
|
295
295
|
|
|
296
296
|
let libName = localConfig.library;
|
|
@@ -504,7 +504,7 @@ addDebugLog("importArch", `filePath: ${filePath}, fileName: ${fileName}`, "");
|
|
|
504
504
|
// need to get info from tasks.config and package.json
|
|
505
505
|
// we won't rely on name of file, as owner can change it
|
|
506
506
|
|
|
507
|
-
let organization = await
|
|
507
|
+
let organization = await getPackageOrg(tempPackage);
|
|
508
508
|
let localConfig = await getLocalConfigData(tempTasksConfig);
|
|
509
509
|
|
|
510
510
|
let libName = localConfig.library;
|
|
@@ -817,7 +817,7 @@ export default async options => {
|
|
|
817
817
|
|
|
818
818
|
console.log("");
|
|
819
819
|
|
|
820
|
-
// reapply to save if changed, because imported task.config may have
|
|
820
|
+
// reapply to save if changed, because imported task.config may have overridden and we want
|
|
821
821
|
// to keep what was entered as the latest
|
|
822
822
|
await updateSavedFilePath(filePath);
|
|
823
823
|
}
|
|
@@ -973,7 +973,7 @@ export default async options => {
|
|
|
973
973
|
console.log("");
|
|
974
974
|
|
|
975
975
|
|
|
976
|
-
// reapply to save if changed, because imported task.config may have
|
|
976
|
+
// reapply to save if changed, because imported task.config may have overridden and we want
|
|
977
977
|
// to keep what was entered as the latest
|
|
978
978
|
await updateSavedFilePath(filePath);
|
|
979
979
|
}
|
|
@@ -69,7 +69,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
|
|
|
69
69
|
configData.description = newLabel;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
72
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
73
73
|
fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
|
|
74
74
|
|
|
75
75
|
};
|
|
@@ -107,8 +107,8 @@
|
|
|
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.
|
|
111
|
-
"@pega/pcore-pconnect-typedefs": "^4.
|
|
110
|
+
"@pega/custom-dx-components": "~0.25.56",
|
|
111
|
+
"@pega/pcore-pconnect-typedefs": "^4.0.0-alpha.0",
|
|
112
112
|
"@storybook/addon-actions": "^8.6.14",
|
|
113
113
|
"@storybook/addon-essentials": "^8.6.14",
|
|
114
114
|
"@storybook/addon-links": "^8.6.14",
|
|
@@ -30,7 +30,7 @@ export const lintComponent = async (dirToLint) => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// inspired by https://eslint.org/docs/latest/developer-guide/nodejs-api
|
|
34
34
|
|
|
35
35
|
// (async function main() {
|
|
36
36
|
// // 1. Create an instance.
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
checkLibraryAndArchives,
|
|
9
9
|
getLibraryArchivesVersions,
|
|
10
10
|
getConfigDefaults,
|
|
11
|
-
|
|
11
|
+
getLocalArchivedLibraryVersionData,
|
|
12
12
|
getComponentsConfigs,
|
|
13
13
|
cleanUpTemp } from '../../util.js';
|
|
14
14
|
import { getArchiveLibraryQuestions } from './helper.js';
|
|
@@ -34,7 +34,7 @@ addDebugLog("listLibrary", "", "+");
|
|
|
34
34
|
organization = compDef.organization;
|
|
35
35
|
library = compDef.library;
|
|
36
36
|
let libraryName;
|
|
37
|
-
const
|
|
37
|
+
const currentVersion = compDef.buildVersion;
|
|
38
38
|
let selectedVersion;
|
|
39
39
|
let libVersions = [];
|
|
40
40
|
let currentOrStore = "";
|
|
@@ -114,7 +114,7 @@ addDebugLog("listLibrary", "", "+");
|
|
|
114
114
|
builtOn = "(no date - current)";
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
117
|
-
data = await
|
|
117
|
+
data = await getLocalArchivedLibraryVersionData(libraryName, selectedVersion);
|
|
118
118
|
data = JSON.parse(data);
|
|
119
119
|
|
|
120
120
|
if (data[0] && data[0].buildDate) {
|
|
@@ -124,7 +124,7 @@ addDebugLog("listLibrary", "", "+");
|
|
|
124
124
|
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
|
-
data = await
|
|
127
|
+
data = await getLocalArchivedLibraryVersionData(libraryName, selectedVersion);
|
|
128
128
|
data = JSON.parse(data);
|
|
129
129
|
|
|
130
130
|
if (data[0] && data[0].buildDate) {
|
package/src/tasks/move/index.js
CHANGED
|
@@ -68,7 +68,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
|
|
|
68
68
|
configData.description = compLabel;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
71
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
72
72
|
fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8', flag:'w' });
|
|
73
73
|
|
|
74
74
|
};
|
|
@@ -205,11 +205,11 @@ export const moveComp = async(componentKey, copyMove, orgLibName, version, copyS
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
const currentSharedPath = join(currentCompPath, "shared");
|
|
208
|
-
const
|
|
208
|
+
const targetSharedPath = join(tempCompPath, "shared");
|
|
209
209
|
|
|
210
210
|
// copy shared
|
|
211
211
|
if (copyShared) {
|
|
212
|
-
fs.cpSync(currentSharedPath,
|
|
212
|
+
fs.cpSync(currentSharedPath, targetSharedPath, { recursive: true, force: true });
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// rearchive temp directory
|
|
@@ -225,11 +225,11 @@ export const moveComp = async(componentKey, copyMove, orgLibName, version, copyS
|
|
|
225
225
|
|
|
226
226
|
if (newComponentKey) {
|
|
227
227
|
const currentSharedPath = join(currentCompPath, "shared");
|
|
228
|
-
const
|
|
228
|
+
const targetSharedPath = join(tempCompPath, "shared");
|
|
229
229
|
|
|
230
230
|
// copy shared
|
|
231
231
|
if (copyShared) {
|
|
232
|
-
fs.cpSync(currentSharedPath,
|
|
232
|
+
fs.cpSync(currentSharedPath, targetSharedPath, { recursive: true, force: true });
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
console.log(`\n${copiedOrMoved} ${chalk.green(`${componentKey}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}\n`);
|
|
@@ -387,7 +387,7 @@ addDebugLog("move", "", "+");
|
|
|
387
387
|
}
|
|
388
388
|
else {
|
|
389
389
|
|
|
390
|
-
// VS Code
|
|
390
|
+
// VS Code plugin would send in the component
|
|
391
391
|
let paramComponentKey;
|
|
392
392
|
if (options.params.length == 4) {
|
|
393
393
|
paramComponentKey = options.params[3];
|
|
@@ -396,7 +396,7 @@ addDebugLog("move", "", "+");
|
|
|
396
396
|
const configDef = getConfigDefaults();
|
|
397
397
|
console.log(`Current library: ${chalk.green(`${configDef.displayLibVersion}`)}`);
|
|
398
398
|
|
|
399
|
-
// test to see if
|
|
399
|
+
// test to see if current library has more than one version
|
|
400
400
|
// if no available versions can not move/copy to it, so send in current lib
|
|
401
401
|
// as library to be removed from the list
|
|
402
402
|
let removeOrgLib = "";
|
|
@@ -62,13 +62,13 @@ addDebugLog("publish", "", "+");
|
|
|
62
62
|
const currentOrgLib = orgLib.currentOrgLib;
|
|
63
63
|
// const currentVersion = devBuild ? `${orgLib.version}-dev`: orgLib.version;
|
|
64
64
|
const currentVersion = orgLib.buildVersion;
|
|
65
|
-
const
|
|
65
|
+
const serverConfig = await getPegaServerConfig();
|
|
66
66
|
let configJson = {};
|
|
67
67
|
await applyPegaData(configJson);
|
|
68
68
|
const {app_name, app_version, sub } = await getApplicationAndVersionFromToken();
|
|
69
69
|
|
|
70
70
|
console.log();
|
|
71
|
-
console.log(`Publishing to server: ${chalk.green.bold(`${
|
|
71
|
+
console.log(`Publishing to server: ${chalk.green.bold(`${serverConfig.server}`)}`);
|
|
72
72
|
console.log(`Cosmos version: ${chalk.green.bold(`${configJson.packageCosmosVersion}`)}`);
|
|
73
73
|
console.log(`Application: ${chalk.green.bold(`${app_name} - ${app_version}`)} for ${chalk.magentaBright.bold(`${sub}`)}`);
|
|
74
74
|
console.log();
|
|
@@ -122,7 +122,7 @@ addDebugLog("publish", "", "+");
|
|
|
122
122
|
|
|
123
123
|
// content = { rulesetName, rulesetVersion };
|
|
124
124
|
} else {
|
|
125
|
-
// VS Code
|
|
125
|
+
// VS Code plugin would send in the component
|
|
126
126
|
let paramComponentKey;
|
|
127
127
|
if (options.params.length == 4) {
|
|
128
128
|
paramComponentKey = options.params[3];
|
|
@@ -179,10 +179,10 @@ addDebugLog("publish", "", "+");
|
|
|
179
179
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
// otherwise continue with original V1
|
|
182
|
+
// otherwise continue with original V1 publishing of individual components
|
|
183
183
|
|
|
184
184
|
//
|
|
185
|
-
//
|
|
185
|
+
// original V1 publish
|
|
186
186
|
//
|
|
187
187
|
|
|
188
188
|
let OauthData;
|
|
@@ -222,7 +222,7 @@ addDebugLog("publish", "", "+");
|
|
|
222
222
|
|
|
223
223
|
content = { componentKey, rulesetName, rulesetVersion, devBuild };
|
|
224
224
|
} else {
|
|
225
|
-
// VS Code
|
|
225
|
+
// VS Code plugin would send in the component
|
|
226
226
|
let paramComponentKey;
|
|
227
227
|
if (options.params.length == 4) {
|
|
228
228
|
paramComponentKey = options.params[3];
|
|
@@ -93,7 +93,7 @@ addDebugLog("zipLibraryComponent", `libraryName: ${libraryName}, libraryVersion:
|
|
|
93
93
|
archive.file(componentsConfigJson, { name: path.basename(componentsConfigJson) });
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// Add componentslocalization.
|
|
96
|
+
// Add componentslocalization.json (array of component localizations) file
|
|
97
97
|
if (fs.existsSync(localizationsJson)) {
|
|
98
98
|
archive.file(localizationsJson, { name: path.basename(localizationsJson) });
|
|
99
99
|
}
|
|
@@ -444,7 +444,7 @@ addDebugLog("publishLibrary", "", "+");
|
|
|
444
444
|
{
|
|
445
445
|
name: 'override',
|
|
446
446
|
type: 'confirm',
|
|
447
|
-
message: `Do you wish to
|
|
447
|
+
message: `Do you wish to overwrite it`,
|
|
448
448
|
default: false
|
|
449
449
|
}
|
|
450
450
|
];
|
|
@@ -80,7 +80,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
|
|
|
80
80
|
|
|
81
81
|
// configData.allowedApplications = allowedApplications;
|
|
82
82
|
|
|
83
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
83
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
84
84
|
fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
|
|
85
85
|
|
|
86
86
|
};
|
|
@@ -242,7 +242,7 @@ addDebugLog("rename", "", "+");
|
|
|
242
242
|
}
|
|
243
243
|
else {
|
|
244
244
|
|
|
245
|
-
// VS Code
|
|
245
|
+
// VS Code plugin would send in the component
|
|
246
246
|
let paramComponentKey;
|
|
247
247
|
if (options.params.length == 4) {
|
|
248
248
|
paramComponentKey = options.params[3];
|
|
@@ -76,7 +76,7 @@ addDebugLog("updateConfig", "", "");
|
|
|
76
76
|
|
|
77
77
|
configData.allowedApplications = allowedApplications;
|
|
78
78
|
|
|
79
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
79
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
80
80
|
fs.writeFileSync(join(targetDirectory, '/config.json'), JSON.stringify(configData, null, 4), {
|
|
81
81
|
encoding: 'utf8',flag:'w'
|
|
82
82
|
});
|
|
@@ -98,7 +98,7 @@ export const showHelpV2 = (isCL) => {
|
|
|
98
98
|
console.log(`\n${chalk.underline(`Published Versions (needs authentication)`)}`);
|
|
99
99
|
console.log(`${chalk.cyan('npm run publish ')}\tpublish current library/version to server (creates a local published library as well)`);
|
|
100
100
|
console.log(`${chalk.cyan('npm run listPublishedLib ')}\tget contents of published library/version (local or server)`);
|
|
101
|
-
console.log(`${chalk.cyan('npm run deletePublishedLib')}\tdelete ALL contents of published
|
|
101
|
+
console.log(`${chalk.cyan('npm run deletePublishedLib')}\tdelete ALL contents of published library/version (local or server)`);
|
|
102
102
|
|
|
103
103
|
console.log(`\n${chalk.underline(`Components (in current library/version context)`)}`);
|
|
104
104
|
console.log(`${chalk.cyan('npm run create ')}\t\tcreate a component`);
|
|
@@ -58,7 +58,7 @@ addDebugLog("switchLibrary", "", "+");
|
|
|
58
58
|
const componentDirectory = join (currentDirectory, "src", "components");
|
|
59
59
|
const orgLib = getConfigDefaults();
|
|
60
60
|
|
|
61
|
-
// if we have
|
|
61
|
+
// if we have chosen to use INPUT CONFIG FILE
|
|
62
62
|
// process and no inputs
|
|
63
63
|
if (useInputConfig) {
|
|
64
64
|
const inputConfig = await getInputConfigForCommand("switchLib");
|
|
@@ -104,7 +104,7 @@ addDebugLog("switchLibrary", "", "+");
|
|
|
104
104
|
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
|
-
// params are in different order then questions, because want of VS Code
|
|
107
|
+
// params are in different order then questions, because want of VS Code plugin
|
|
108
108
|
if (options.params.length >= 6) {
|
|
109
109
|
newOrgLib = options.params[3];
|
|
110
110
|
version = options.params[4];
|
|
@@ -58,7 +58,7 @@ addDebugLog("switchVersion", "", "+");
|
|
|
58
58
|
const orgLib = getConfigDefaults();
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
// if we have
|
|
61
|
+
// if we have chosen to use INPUT CONFIG FILE
|
|
62
62
|
// process and no inputs
|
|
63
63
|
if (useInputConfig) {
|
|
64
64
|
const inputConfig = await getInputConfigForCommand("switchLibVersion");
|
|
@@ -309,7 +309,7 @@ const overrideSchema = {
|
|
|
309
309
|
};
|
|
310
310
|
|
|
311
311
|
const validateSchema = ajv.compile(schema);
|
|
312
|
-
const
|
|
312
|
+
const validateOverrideSchema = ajv.compile(overrideSchema);
|
|
313
313
|
|
|
314
314
|
|
|
315
315
|
|
|
@@ -354,7 +354,7 @@ export default async (option) => {
|
|
|
354
354
|
catch (err) {
|
|
355
355
|
|
|
356
356
|
// for now, if now file just end
|
|
357
|
-
console.log(`${chalk.bold.yellow('Config file not
|
|
357
|
+
console.log(`${chalk.bold.yellow('Config file not available for: ' + componentToValidate)}`);
|
|
358
358
|
return;
|
|
359
359
|
|
|
360
360
|
}
|
package/src/util.js
CHANGED
|
@@ -114,7 +114,7 @@ export const addDebugLog = (sFunctionName, sLogData, sIncDec) => {
|
|
|
114
114
|
export const setUpDefaults = async () => {
|
|
115
115
|
|
|
116
116
|
// defaults, start up function will set these up
|
|
117
|
-
// so that won't have to
|
|
117
|
+
// so that won't have to continuously hit files to get data
|
|
118
118
|
// thus saving time.
|
|
119
119
|
let retrievedConfigData = {
|
|
120
120
|
serverType: "",
|
|
@@ -167,7 +167,7 @@ export const setUpDefaults = async () => {
|
|
|
167
167
|
if (data[LIBRARY_BASED_CL]) {
|
|
168
168
|
retrievedConfigData.isLibraryBasedCL = data[LIBRARY_BASED_CL];
|
|
169
169
|
|
|
170
|
-
// if this is true, then force
|
|
170
|
+
// if this is true, then force library based to true, so it doesn't have to be set
|
|
171
171
|
if (retrievedConfigData.isLibraryBasedCL) {
|
|
172
172
|
retrievedConfigData.isLibraryBased = retrievedConfigData.isLibraryBasedCL;
|
|
173
173
|
}
|
|
@@ -524,7 +524,7 @@ if (showDebug) addDebugLog("setLibraryBased", "", "");
|
|
|
524
524
|
data[LIBRARY_BASED] = isLibraryBased;
|
|
525
525
|
|
|
526
526
|
// update file
|
|
527
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
527
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
528
528
|
try {
|
|
529
529
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
|
|
530
530
|
}
|
|
@@ -569,7 +569,7 @@ export const setLibraryBasedCL = async (isLibraryBasedCL) => {
|
|
|
569
569
|
}
|
|
570
570
|
|
|
571
571
|
// update file
|
|
572
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
572
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
573
573
|
try {
|
|
574
574
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
|
|
575
575
|
}
|
|
@@ -845,7 +845,7 @@ if (showDebug) addDebugLog("restoreTopLevelConfigFilesFromTemplate", ``, "");
|
|
|
845
845
|
process.exit(1);
|
|
846
846
|
}
|
|
847
847
|
|
|
848
|
-
// copy template
|
|
848
|
+
// copy template dependencies and devDependencies
|
|
849
849
|
const tData = JSON.parse(retrievedTemplateData);
|
|
850
850
|
|
|
851
851
|
|
|
@@ -1019,7 +1019,7 @@ if (showDebug) addDebugLog("updateServerConfigRuleSetAndVersion", `rulesetName:
|
|
|
1019
1019
|
serverConfig.rulesetVersion = rulesetVersion;
|
|
1020
1020
|
|
|
1021
1021
|
// update file
|
|
1022
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
1022
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
1023
1023
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
1024
1024
|
|
|
1025
1025
|
}
|
|
@@ -1035,7 +1035,7 @@ if (showDebug) addDebugLog("updateServerConfigArchiveRuleSetAndVersion", `rulese
|
|
|
1035
1035
|
serverConfig.archiveRulesetVersion = rulesetVersion;
|
|
1036
1036
|
|
|
1037
1037
|
// update file
|
|
1038
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
1038
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
1039
1039
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
1040
1040
|
|
|
1041
1041
|
}
|
|
@@ -1095,7 +1095,7 @@ if (showDebug) addDebugLog("setConfigDevBuild", `devBuild: ${devBuild}`, "");
|
|
|
1095
1095
|
serverConfig.devBuild = devBuild;
|
|
1096
1096
|
|
|
1097
1097
|
// update file
|
|
1098
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
1098
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
1099
1099
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
1100
1100
|
}
|
|
1101
1101
|
|
|
@@ -1115,7 +1115,7 @@ if (showDebug) addDebugLog("setConfigImportRelativePath", `importRelativePath: $
|
|
|
1115
1115
|
configData[IMPORT_RELATIVE_PATH] = importRelativePath;
|
|
1116
1116
|
|
|
1117
1117
|
// update file
|
|
1118
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
1118
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
1119
1119
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
@@ -1127,7 +1127,7 @@ if (showDebug) addDebugLog("setConfigExportRelativePath", `exportRelativePath: $
|
|
|
1127
1127
|
configData[EXPORT_RELATIVE_PATH] = exportRelativePath;
|
|
1128
1128
|
|
|
1129
1129
|
// update file
|
|
1130
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
1130
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
1131
1131
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
@@ -1170,7 +1170,7 @@ if (showDebug) addDebugLog("updateConfigVersion", `componentKey: ${componentKey}
|
|
|
1170
1170
|
|
|
1171
1171
|
// check to see if PegaAboutData exists. If customer decides to put
|
|
1172
1172
|
// data under PegaAboutData, we won't change the order
|
|
1173
|
-
//
|
|
1173
|
+
// otherwise, will put at bottom
|
|
1174
1174
|
for (let i in properties) {
|
|
1175
1175
|
if (properties[i].name && properties[i].name === "PegaAboutData") {
|
|
1176
1176
|
foundProp = properties[i];
|
|
@@ -1238,7 +1238,7 @@ if (showDebug) addDebugLog("setServerType", `serverType: ${serverType}`, "");
|
|
|
1238
1238
|
serverConfig.serverType = serverType;
|
|
1239
1239
|
|
|
1240
1240
|
// update file
|
|
1241
|
-
// stringify "4", makes the json string look like JSON in the file,
|
|
1241
|
+
// stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
|
|
1242
1242
|
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
|
|
1243
1243
|
|
|
1244
1244
|
// reset
|
|
@@ -1795,8 +1795,8 @@ if (showDebug) addDebugLog("getLocalArchivedLibraryVersions", `libraryName: ${li
|
|
|
1795
1795
|
.map(dirent => dirent.name);
|
|
1796
1796
|
};
|
|
1797
1797
|
|
|
1798
|
-
export const
|
|
1799
|
-
if (showDebug) addDebugLog("
|
|
1798
|
+
export const getLocalArchivedLibraryVersionData = async(libraryName, libraryVersion) => {
|
|
1799
|
+
if (showDebug) addDebugLog("getLocalArchivedLibraryVersionData", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
|
|
1800
1800
|
const currentDirectory = process.cwd();
|
|
1801
1801
|
const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${libraryName}`, `${libraryVersion}`);
|
|
1802
1802
|
|
|
@@ -1943,10 +1943,10 @@ if (showDebug) addDebugLog("getComponentsConfigs", "", "");
|
|
|
1943
1943
|
export const createComponentsConfigFile = async (filePath, compDir) => {
|
|
1944
1944
|
if (showDebug) addDebugLog("createComponentsConfigFile", `filePath: ${filePath}`, "");
|
|
1945
1945
|
const componentsConfigJSON = await getComponentsConfigs(compDir);
|
|
1946
|
-
const
|
|
1946
|
+
const compConfigFile = join(filePath, COMPONENTS_CONFIG_FILE_NAME);
|
|
1947
1947
|
|
|
1948
1948
|
// write out file
|
|
1949
|
-
fs.writeFileSync(
|
|
1949
|
+
fs.writeFileSync(compConfigFile, JSON.stringify(componentsConfigJSON), { encoding: 'utf8',flag:'w' });
|
|
1950
1950
|
|
|
1951
1951
|
};
|
|
1952
1952
|
|
|
@@ -2279,9 +2279,9 @@ if (showDebug) addDebugLog("updateComponentTaskConfig", "", "");
|
|
|
2279
2279
|
const orgArchiveRulesetVersion = originalContentsData["server-config"].archiveRulesetVersion;
|
|
2280
2280
|
|
|
2281
2281
|
// we keep server-config but we will restore from archive the
|
|
2282
|
-
//
|
|
2282
|
+
// ruleset/version. Other stuff in task.config will come from archive
|
|
2283
2283
|
originalContentsData["server-config"] = contentsData["server-config"];
|
|
2284
|
-
// restore ruleset and
|
|
2284
|
+
// restore ruleset and version
|
|
2285
2285
|
originalContentsData["server-config"].rulesetName = orgRuleset;
|
|
2286
2286
|
originalContentsData["server-config"].rulesetVersion = orgRulesetVersion;
|
|
2287
2287
|
|
|
@@ -138,12 +138,7 @@
|
|
|
138
138
|
],
|
|
139
139
|
"defaultConfig": {
|
|
140
140
|
"label": "@L $this.label",
|
|
141
|
-
"datasource": {
|
|
142
|
-
"source": "@DATASOURCE D_pyCountryCallingCodeList.pxResults",
|
|
143
|
-
"fields": {
|
|
144
|
-
"value": "@P .pyCallingCode"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
141
|
+
"datasource": {},
|
|
147
142
|
"detailFVLItem": true,
|
|
148
143
|
"isFormWidth" : false,
|
|
149
144
|
"isContainerWidth" : false
|