@pega/custom-dx-components 0.25.51 → 0.25.52
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
|
@@ -5,6 +5,7 @@ import { join } from 'path';
|
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import ncp from 'ncp';
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
+
import { Listr } from 'listr2';
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
checkPathAccess,
|
|
@@ -145,6 +146,7 @@ addDebugLog("exportCLArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName
|
|
|
145
146
|
// archive it
|
|
146
147
|
output = await zipVersionAndArchiveCL(configDef.currentOrgLib, configDef.buildVersion);
|
|
147
148
|
|
|
149
|
+
|
|
148
150
|
// if archiving, need to wait before copying
|
|
149
151
|
output.on('close', function() {
|
|
150
152
|
fs.copyFileSync(archFileName, exportFile );
|
|
@@ -402,7 +404,26 @@ export default async options => {
|
|
|
402
404
|
else {
|
|
403
405
|
await checkAccessTokenExpiration();
|
|
404
406
|
|
|
405
|
-
|
|
407
|
+
|
|
408
|
+
const tasks = new Listr(
|
|
409
|
+
[
|
|
410
|
+
{
|
|
411
|
+
title: 'Saving local archive',
|
|
412
|
+
task: async () => {
|
|
413
|
+
|
|
414
|
+
// local archive so it will get stored
|
|
415
|
+
await zipVersionAndArchive(orgLibName, selectedVersion);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
{ concurrent: false, exitOnError: true }
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
await tasks.run().catch(err => {
|
|
423
|
+
console.log(chalk.bold.red(err.toString()));
|
|
424
|
+
process.exit(1);
|
|
425
|
+
});
|
|
426
|
+
|
|
406
427
|
await publishArchive(orgLibName, selectedVersion);
|
|
407
428
|
|
|
408
429
|
}
|
|
@@ -726,35 +726,98 @@ export default async options => {
|
|
|
726
726
|
|
|
727
727
|
if (useInputConfig) {
|
|
728
728
|
const inputConfig = await getInputConfigForCommand("importLibVersion");
|
|
729
|
+
const serverOrDirectory = inputConfig.serverOrDirectory;
|
|
729
730
|
const filePath = inputConfig.fileLocation;
|
|
730
731
|
const fileName = inputConfig.fileName;
|
|
732
|
+
const serverAppName = "ComponentLibraryArchive";
|
|
733
|
+
const serverArchiveName = inputConfig.serverArchiveName;
|
|
734
|
+
const serverArchiveType = "zip";
|
|
735
|
+
const serverRulesetName = inputConfig.serverRulesetName;
|
|
736
|
+
const serverRulesetVersion = inputConfig.serverRulesetVersion;
|
|
731
737
|
|
|
732
738
|
|
|
733
739
|
console.log("");
|
|
734
740
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
+
if (serverOrDirectory.toLowerCase() === "server") {
|
|
742
|
+
await checkAccessTokenExpiration();
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
if (serverArchiveName) {
|
|
746
|
+
// ALL option
|
|
747
|
+
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
748
|
+
|
|
749
|
+
let fileName = `${serverArchiveName}.${serverArchiveType}`;
|
|
750
|
+
let fileData;
|
|
751
|
+
|
|
752
|
+
console.log("");
|
|
753
|
+
|
|
754
|
+
const tasks = new Listr(
|
|
755
|
+
[
|
|
756
|
+
{
|
|
757
|
+
title: 'Fetching archive from server',
|
|
758
|
+
task: async () => {
|
|
759
|
+
// get archive
|
|
760
|
+
fileData = await getServerLibraryArchive(serverAppName, serverArchiveName, serverArchiveType, serverRulesetName, serverRulesetVersion);
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
title: 'Saving archive in store',
|
|
765
|
+
task: async () => {
|
|
766
|
+
await writeZipBuffer(fileName, fileData.pyFileSource);
|
|
767
|
+
|
|
768
|
+
// import archive
|
|
769
|
+
const currentDirectory = process.cwd();
|
|
770
|
+
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
771
|
+
|
|
772
|
+
await importArchServer( tempDirectory, fileName, hasArch);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
],
|
|
776
|
+
{ concurrent: false, exitOnError: true }
|
|
777
|
+
);
|
|
778
|
+
|
|
779
|
+
await tasks.run().catch(err => {
|
|
780
|
+
console.log(chalk.bold.red(err.toString()));
|
|
781
|
+
process.exit(1);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
// No library with that name
|
|
789
|
+
console.log(chalk.redBright(`No library archives exist on server.`));
|
|
790
|
+
process.exit();
|
|
791
|
+
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
const tasks = new Listr(
|
|
796
|
+
[
|
|
797
|
+
{
|
|
798
|
+
title: `Importing archive`,
|
|
799
|
+
task: async () => {
|
|
800
|
+
await importArch( filePath, fileName, hasArch);
|
|
801
|
+
}
|
|
741
802
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
);
|
|
803
|
+
],
|
|
804
|
+
{ concurrent: false, exitOnError: true }
|
|
805
|
+
);
|
|
746
806
|
|
|
747
807
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
808
|
+
await tasks.run().catch(err => {
|
|
809
|
+
console.log(chalk.bold.red(err.toString()));
|
|
810
|
+
process.exit(1);
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
console.log("");
|
|
814
|
+
|
|
815
|
+
// reapply to save if changed, because imported task.config may have overriden and we want
|
|
816
|
+
// to keep what was entered as the latest
|
|
817
|
+
await updateSavedFilePath(filePath);
|
|
818
|
+
}
|
|
752
819
|
|
|
753
|
-
console.log("");
|
|
754
820
|
|
|
755
|
-
// reapply to save if changed, because imported task.config may have overriden and we want
|
|
756
|
-
// to keep what was entered as the latest
|
|
757
|
-
await updateSavedFilePath(filePath);
|
|
758
821
|
|
|
759
822
|
}
|
|
760
823
|
else {
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"author": "",
|
|
83
83
|
"license": "Enter License",
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@pega/cosmos-react-condition-builder": "^8.
|
|
86
|
-
"@pega/cosmos-react-core": "^8.
|
|
87
|
-
"@pega/cosmos-react-work": "^8.
|
|
85
|
+
"@pega/cosmos-react-condition-builder": "^8.1.0",
|
|
86
|
+
"@pega/cosmos-react-core": "^8.1.0",
|
|
87
|
+
"@pega/cosmos-react-work": "^8.1.0",
|
|
88
88
|
"@pega/eslint-config": "^0.16.3",
|
|
89
89
|
"@pega/tsconfig": "^0.16.3",
|
|
90
90
|
"babel-loader": "^10.0.0",
|
|
@@ -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.52",
|
|
111
111
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
112
112
|
"@storybook/addon-actions": "^8.6.14",
|
|
113
113
|
"@storybook/addon-essentials": "^8.6.14",
|
package/src/util.js
CHANGED
|
@@ -184,7 +184,12 @@ export const setUpDefaults = async () => {
|
|
|
184
184
|
|
|
185
185
|
retrievedConfigData.serverType = data["server-config"].serverType;
|
|
186
186
|
retrievedConfigData.devBuild = data["server-config"].devBuild;
|
|
187
|
-
|
|
187
|
+
|
|
188
|
+
// override devBuild for libraryBasedCL, always false.
|
|
189
|
+
if (retrievedConfigData.isLibraryBasedCL) {
|
|
190
|
+
retrievedConfigData.devBuild = false;
|
|
191
|
+
}
|
|
192
|
+
retrievedConfigData.devServerPort = data["server-config"].devServerPort;
|
|
188
193
|
|
|
189
194
|
retrievedConfigData.buildVersion = retrievedConfigData.devBuild ? `${retrievedConfigData.version}-dev` : retrievedConfigData.version;
|
|
190
195
|
retrievedConfigData.currentOrgLib = `${retrievedConfigData.organization}_${retrievedConfigData.library}`;
|
|
@@ -1072,6 +1077,10 @@ export const getConfigDevBuild = async() => {
|
|
|
1072
1077
|
if (showDebug) addDebugLog("getConfigDevBuild", "", "");
|
|
1073
1078
|
// const serverConfig = await getPegaServerConfig();
|
|
1074
1079
|
|
|
1080
|
+
if (getLibraryBasedCL()) {
|
|
1081
|
+
return false;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1075
1084
|
// return serverConfig.devBuild;
|
|
1076
1085
|
return defaultConfigs.devBuild;
|
|
1077
1086
|
|
|
@@ -1363,7 +1372,7 @@ export const checkForBranch = async(rulesetName) => {
|
|
|
1363
1372
|
if (rulesetName.toLowerCase().indexOf("_branch") >= 0) {
|
|
1364
1373
|
console.log(
|
|
1365
1374
|
chalk.redBright(
|
|
1366
|
-
`Ruleset ${chalk.bold(`${rulesetName}`)} is a branch ruleset.\
|
|
1375
|
+
`Ruleset ${chalk.bold(`${rulesetName}`)} is a branch ruleset.\nPublishing to branch rulesets are not supported.`
|
|
1367
1376
|
)
|
|
1368
1377
|
);
|
|
1369
1378
|
process.exit(1);
|