@pega/custom-dx-components 0.242.35 → 0.242.36
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 +1 -1
- package/src/cli.js +6 -0
- package/src/constants.js +1 -0
- package/src/tasks/build-lib/helper.js +0 -1
- package/src/tasks/create-lib/index.js +5 -3
- package/src/tasks/create-version/index.js +3 -1
- package/src/tasks/delete-lib/index.js +4 -1
- package/src/tasks/delete-version/index.js +3 -1
- package/src/tasks/export-archive/index.js +58 -41
- package/src/tasks/import-archive/index.js +5 -1
- package/src/tasks/import-comp/helper.js +2 -4
- package/src/tasks/import-comp/index.js +1 -2
- package/src/tasks/index.js +1 -0
- package/src/tasks/init/template/package.json.mustache +3 -2
- package/src/tasks/list-lib/index.js +3 -1
- package/src/tasks/list-pub/index.js +18 -14
- package/src/tasks/move/helper.js +6 -3
- package/src/tasks/move/index.js +86 -17
- package/src/tasks/publish/helper.js +8 -5
- package/src/tasks/publish/index.js +4 -4
- package/src/tasks/publish-all/helper.js +16 -10
- package/src/tasks/quarantine/index.js +84 -0
- package/src/tasks/rename-lib/index.js +0 -1
- package/src/tasks/revert-webpack/index.js +0 -2
- package/src/tasks/set-perm/index.js +18 -2
- package/src/tasks/store/index.js +4 -1
- package/src/tasks/switch-lib/index.js +3 -1
- package/src/tasks/switch-version/index.js +3 -1
- package/src/util.js +50 -6
- package/tests/functional/localCreateAllListDeleteAll.test.js +56 -10
- package/tests/functional/localCreateBuildAllDeleteAll.test.js +56 -48
- package/tests/functional/localCreateBuildDelete.test.js +57 -10
- package/tests/functional/localCreateListDelete.test.js +55 -102
- package/tests/functional/localCreatePublishAllDeleteAll.test.js +68 -61
- package/tests/functional/localCreatePublishDelete.test.js +62 -21
- package/tests/functional/localCreateRenameDelete.test.js +55 -140
- package/tests/functional/localLibCreateLibAlreadyDeleteLib.test.js +118 -0
- package/tests/functional/localLibCreateLibBuildLibDeleteLib.test.js +241 -0
- package/tests/functional/localLibCreateLibBuildLibListPubDeleteLib.test.js +246 -0
- package/tests/functional/localLibCreateLibDeleteLib.test.js +109 -0
- package/tests/functional/localLibCreateLibExportImportLib.test.js +242 -0
- package/tests/functional/localLibCreateLibExportLib.test.js +219 -0
- package/tests/functional/localLibCreateLibImportCompDeleteLib.test.js +131 -0
- package/tests/functional/localLibCreateLibListDeleteLib.test.js +261 -0
- package/tests/functional/localLibCreateLibListMoveDeleteLib.test.js +236 -0
- package/tests/functional/localLibCreateLibListSwitchDeleteLib.test.js +237 -0
- package/tests/functional/localLibCreateLibPermDeleteLib.test.js +144 -0
- package/tests/functional/localLibCreateLibStatusDeleteLib.test.js +194 -0
- package/tests/functional/localLibCreateLibVersionDeleteLib.test.js +453 -0
- package/tests/functional/localPromoteRevertWP.test.js +83 -38
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
publishComponent,
|
|
28
28
|
publishAllComponents,
|
|
29
29
|
publishLibrary,
|
|
30
|
+
quarantine,
|
|
30
31
|
renameComponent,
|
|
31
32
|
moveComponent,
|
|
32
33
|
renameLibrary,
|
|
@@ -60,6 +61,7 @@ const TASKS = {
|
|
|
60
61
|
PUBLISH_LIB: 'publishLibrary',
|
|
61
62
|
RENAME: 'rename',
|
|
62
63
|
RENAME_LIB: 'renameLibrary',
|
|
64
|
+
QUARANTINE: 'quarantine',
|
|
63
65
|
MOVE: 'moveComponent',
|
|
64
66
|
LIST: 'list',
|
|
65
67
|
LIST_LIB: 'listLibrary',
|
|
@@ -162,6 +164,10 @@ export default async (args = []) => {
|
|
|
162
164
|
renameLibrary(options);
|
|
163
165
|
break;
|
|
164
166
|
}
|
|
167
|
+
case TASKS.QUARANTINE: {
|
|
168
|
+
quarantine(options);
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
165
171
|
case TASKS.MOVE: {
|
|
166
172
|
moveComponent(options);
|
|
167
173
|
break;
|
package/src/constants.js
CHANGED
|
@@ -49,6 +49,7 @@ export const BOOTSTRAP_CONFIG = 'PRRestService/api/application/v2/data_views/D_p
|
|
|
49
49
|
|
|
50
50
|
export const JEST_ASSETS_ORIGINAL_PATH = 'node_modules/@pega/custom-dx-components/tests/assets/original/components/';
|
|
51
51
|
export const JEST_ASSETS_LIBRARY_PATH = 'node_modules/@pega/custom-dx-components/tests/assets/library/components/';
|
|
52
|
+
export const JEST_TESTS_FUNCTIONAL_PATH = 'node_modules/@pega/custom-dx-components/tests/functional/';
|
|
52
53
|
export const JEST_CREATE_PATH = 'create/';
|
|
53
54
|
export const JEST_CREATE_ALL_CONSTELLATION_PATH = 'createAll/Constellation/';
|
|
54
55
|
export const JEST_CREATE_ALL_LAUNCHPAD_PATH = 'createAll/Launchpad';
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
clearSrcComponentsDirectory,
|
|
15
15
|
hasLibraryAndVersion,
|
|
16
16
|
getConfigDefaults,
|
|
17
|
-
forceDefaultsUpdate
|
|
17
|
+
forceDefaultsUpdate,
|
|
18
|
+
cleanUpTemp
|
|
18
19
|
} from '../../util.js';
|
|
19
20
|
|
|
20
21
|
import { getCreateLibComponentQuestions, getOkToProceedQuestion } from './helper.js';
|
|
@@ -28,6 +29,7 @@ export default async options => {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
await showVersion();
|
|
32
|
+
await cleanUpTemp();
|
|
31
33
|
|
|
32
34
|
addDebugLog("createLibrary", "", "+");
|
|
33
35
|
let libraryName;
|
|
@@ -37,7 +39,7 @@ addDebugLog("createLibrary", "", "+");
|
|
|
37
39
|
const orgLib = getConfigDefaults();
|
|
38
40
|
const hasArch = await hasArchives();
|
|
39
41
|
|
|
40
|
-
if (hasArch) {
|
|
42
|
+
if (hasArch && options.params.length < 6) {
|
|
41
43
|
console.log(chalk.bold.yellow('\nBe sure to SAVE all changes before creating a new library, unsaved changes will be LOST.'))
|
|
42
44
|
console.log(chalk.bold.yellow('Current library/version will be stored and the newly created library/version will be your default.'))
|
|
43
45
|
|
|
@@ -70,7 +72,7 @@ addDebugLog("createLibrary", "", "+");
|
|
|
70
72
|
const hasLib = await hasLibraryAndVersion(libraryName, version, !permBuild);
|
|
71
73
|
if (hasLib) {
|
|
72
74
|
console.log(`${chalk.bold.red(`Library ${orgLib.organization}_${libraryName} already exists.`)}`);
|
|
73
|
-
console.log("You can switch to that
|
|
75
|
+
console.log("You can switch to that library by entering 'npm run switchLib'.\n")
|
|
74
76
|
process.exit();
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
checkLibraryAndArchives,
|
|
17
17
|
getConfigDefaults,
|
|
18
18
|
forceDefaultsUpdate,
|
|
19
|
-
modAddAboutData
|
|
19
|
+
modAddAboutData,
|
|
20
|
+
cleanUpTemp
|
|
20
21
|
} from '../../util.js';
|
|
21
22
|
|
|
22
23
|
import { getCreateVersionComponentQuestions, updateAllComponentsConfig } from './helper.js';
|
|
@@ -31,6 +32,7 @@ export default async options => {
|
|
|
31
32
|
|
|
32
33
|
await showVersion();
|
|
33
34
|
await checkLibraryAndArchives();
|
|
35
|
+
await cleanUpTemp();
|
|
34
36
|
|
|
35
37
|
addDebugLog("createVersion", "", "+");
|
|
36
38
|
let libraryName;
|
|
@@ -15,7 +15,9 @@ import {
|
|
|
15
15
|
getLibraryArchiveDirectories,
|
|
16
16
|
deleteArchives,
|
|
17
17
|
forceDefaultsUpdate,
|
|
18
|
-
restoreFromArchive
|
|
18
|
+
restoreFromArchive,
|
|
19
|
+
cleanUpTemp
|
|
20
|
+
} from '../../util.js';
|
|
19
21
|
|
|
20
22
|
import { getDeleteLibraryQuestions, getLibraryVersionQuestion } from './helper.js';
|
|
21
23
|
import { showCurrentStatus } from '../show-status/index.js';
|
|
@@ -157,6 +159,7 @@ export default async (options) => {
|
|
|
157
159
|
|
|
158
160
|
await showVersion();
|
|
159
161
|
await checkLibraryAndArchives();
|
|
162
|
+
await cleanUpTemp();
|
|
160
163
|
|
|
161
164
|
addDebugLog("deleteLibrary", "", "+");
|
|
162
165
|
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
getLibraryBased,
|
|
7
7
|
checkLibraryAndArchives,
|
|
8
8
|
getConfigDefaults,
|
|
9
|
-
addDebugLog
|
|
9
|
+
addDebugLog,
|
|
10
|
+
cleanUpTemp
|
|
10
11
|
} from '../../util.js';
|
|
11
12
|
|
|
12
13
|
import { deleteLibraryVersion } from '../delete-lib/index.js';
|
|
@@ -21,6 +22,7 @@ export default async (options) => {
|
|
|
21
22
|
|
|
22
23
|
await showVersion();
|
|
23
24
|
await checkLibraryAndArchives();
|
|
25
|
+
await cleanUpTemp();
|
|
24
26
|
|
|
25
27
|
addDebugLog("deleteVersion", "", "+");
|
|
26
28
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { promisify } from 'util';
|
|
3
3
|
import { join } from 'path';
|
|
4
|
+
import path from 'path';
|
|
4
5
|
|
|
5
6
|
import inquirer from 'inquirer';
|
|
6
7
|
import ncp from 'ncp';
|
|
@@ -13,10 +14,11 @@ import {
|
|
|
13
14
|
checkLibraryAndArchives,
|
|
14
15
|
getConfigDefaults,
|
|
15
16
|
getLibraryBased,
|
|
16
|
-
zipVersionAndArchive
|
|
17
|
+
zipVersionAndArchive,
|
|
18
|
+
cleanUpTemp
|
|
17
19
|
} from '../../util.js';
|
|
18
|
-
import { TASKS_CONFIG_JSON_FILENAME,
|
|
19
|
-
import { getFilePathQuestions,
|
|
20
|
+
import { TASKS_CONFIG_JSON_FILENAME, ARCHIVES_PATH } from '../../constants.js';
|
|
21
|
+
import { getFilePathQuestions, getLibraryQuestion, getLibraryVersionQuestion } from './helper.js';
|
|
20
22
|
|
|
21
23
|
export const DXCB_CONFIG_INTERNAL_JSON_FILENAME = 'src/dxcb.config.json';
|
|
22
24
|
const currentDirectory = process.cwd();
|
|
@@ -74,7 +76,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
|
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
|
|
77
|
-
export const exportArch = async(exportPath, orgLibName, selectedVersion) => {
|
|
79
|
+
export const exportArch = async(exportPath, orgLibName, selectedVersion, currentOrArchive = "") => {
|
|
78
80
|
addDebugLog("exportArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName}, selectedVersion: ${selectedVersion}`, "");
|
|
79
81
|
const currentDirectory = process.cwd();
|
|
80
82
|
const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${orgLibName}`, `${selectedVersion}`);
|
|
@@ -84,25 +86,33 @@ addDebugLog("exportArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName},
|
|
|
84
86
|
|
|
85
87
|
const exportFile = join(exportPath, fileName);
|
|
86
88
|
|
|
89
|
+
let output;
|
|
90
|
+
|
|
91
|
+
let archiveBeforeStore = false;
|
|
92
|
+
|
|
87
93
|
|
|
88
94
|
if (orgLibName === configDef.currentOrgLib && selectedVersion === configDef.buildVersion) {
|
|
89
95
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
let currentOrStore = currentOrArchive;
|
|
97
|
+
if (currentOrArchive === "") {
|
|
98
|
+
console.log("\nYou've selected the current working library/version.");
|
|
99
|
+
console.log("Export store or the current.");
|
|
100
|
+
const archAnswers = await inquirer.prompt([
|
|
101
|
+
{
|
|
102
|
+
name: 'currentOrStore',
|
|
103
|
+
type: 'rawlist',
|
|
104
|
+
message: 'Select current or store',
|
|
105
|
+
default: "Current",
|
|
106
|
+
choices: ["Current", "Store"]
|
|
107
|
+
},
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
currentOrStore = archAnswers.currentOrStore;
|
|
111
|
+
|
|
112
|
+
}
|
|
101
113
|
|
|
102
|
-
const currentOrStore = archAnswers.currentOrStore;
|
|
103
114
|
if (currentOrStore === "Current") {
|
|
104
|
-
|
|
105
|
-
await zipVersionAndArchive(configDef.currentOrgLib, configDef.buildVersion);
|
|
115
|
+
archiveBeforeStore = true;
|
|
106
116
|
}
|
|
107
117
|
}
|
|
108
118
|
|
|
@@ -126,28 +136,24 @@ addDebugLog("exportArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName},
|
|
|
126
136
|
}
|
|
127
137
|
}
|
|
128
138
|
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
name: 'overrideExisting',
|
|
134
|
-
type: 'confirm',
|
|
135
|
-
message: 'Override existing',
|
|
136
|
-
default: false
|
|
137
|
-
},
|
|
138
|
-
]);
|
|
139
|
+
if (archiveBeforeStore) {
|
|
140
|
+
// archive it
|
|
141
|
+
output = await zipVersionAndArchive(configDef.currentOrgLib, configDef.buildVersion);
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
process.exit();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
143
|
+
// if archiving, need to wait before copying
|
|
144
|
+
output.on('close', function() {
|
|
145
|
+
fs.copyFileSync(archFileName, exportFile );
|
|
146
146
|
|
|
147
|
+
console.log(`\n${chalk.green(`${fileName}`)} has been exported to ${chalk.green(`${exportPath}`)}`);
|
|
147
148
|
|
|
148
|
-
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
fs.copyFileSync(archFileName, exportFile );
|
|
153
|
+
|
|
154
|
+
console.log(`\n${chalk.green(`${fileName}`)} has been exported to ${chalk.green(`${exportPath}`)}`);
|
|
155
|
+
}
|
|
149
156
|
|
|
150
|
-
console.log(`\n${chalk.green(`${fileName}`)} has been exported to ${chalk.green(`${exportPath}`)}`);
|
|
151
157
|
|
|
152
158
|
}
|
|
153
159
|
|
|
@@ -177,14 +183,18 @@ export default async options => {
|
|
|
177
183
|
process.exit();
|
|
178
184
|
}
|
|
179
185
|
|
|
186
|
+
await cleanUpTemp();
|
|
187
|
+
|
|
180
188
|
addDebugLog("exportArchive", "", "+");
|
|
181
189
|
|
|
182
190
|
|
|
183
|
-
if (options.params.length >=
|
|
184
|
-
const libraryName = options.params[
|
|
185
|
-
const libraryVersion = options.params[
|
|
191
|
+
if (options.params.length >= 7) {
|
|
192
|
+
const libraryName = options.params[3];
|
|
193
|
+
const libraryVersion = options.params[4];
|
|
194
|
+
const filePath = options.params[5];
|
|
195
|
+
const currentOrArchive = options.params[6];
|
|
186
196
|
|
|
187
|
-
await exportArch(filePath, libraryName, libraryVersion );
|
|
197
|
+
await exportArch(filePath, libraryName, libraryVersion, currentOrArchive );
|
|
188
198
|
|
|
189
199
|
}
|
|
190
200
|
else {
|
|
@@ -199,7 +209,14 @@ export default async options => {
|
|
|
199
209
|
|
|
200
210
|
const filePathQuestions = await getFilePathQuestions();
|
|
201
211
|
const filePathAnswers = await inquirer.prompt(filePathQuestions);
|
|
202
|
-
|
|
212
|
+
let { filePath } = filePathAnswers;
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
// if (path.sep === "/") {
|
|
216
|
+
// if (filePath.lastIndexOf(path.sep) != filePath.length - 1) {
|
|
217
|
+
// filePath = filePath.concat(path.sep);
|
|
218
|
+
// }
|
|
219
|
+
// }
|
|
203
220
|
|
|
204
221
|
await exportArch( filePath, orgLibName, selectedVersion);
|
|
205
222
|
|
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
unZipFromArchive,
|
|
19
19
|
zipVersionAndArchive,
|
|
20
20
|
getLibraryArchiveDirectories,
|
|
21
|
-
hasLibraryAndVersion
|
|
21
|
+
hasLibraryAndVersion,
|
|
22
|
+
cleanUpTemp
|
|
22
23
|
} from '../../util.js';
|
|
23
24
|
import { TASKS_CONFIG_JSON_FILENAME, ARCHIVES_PATH, TEMP_PATH } from '../../constants.js';
|
|
24
25
|
import { getFilePathQuestions, getFileNameQuestions, updateTempArchive } from './helper.js';
|
|
@@ -357,10 +358,13 @@ export default async options => {
|
|
|
357
358
|
process.exit();
|
|
358
359
|
}
|
|
359
360
|
|
|
361
|
+
await cleanUpTemp();
|
|
362
|
+
|
|
360
363
|
addDebugLog("importArchive", "", "+");
|
|
361
364
|
|
|
362
365
|
|
|
363
366
|
if (options.params.length >= 5) {
|
|
367
|
+
const filePath = options.params[3];
|
|
364
368
|
const fileName = options.params[4];
|
|
365
369
|
await importArch( filePath, fileName);
|
|
366
370
|
|
|
@@ -2,9 +2,7 @@ import chalk from 'chalk';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { join } from 'path';
|
|
5
|
-
import {
|
|
6
|
-
import { addDebugLog, getConfigDefaults, convertIntoPascalCase, getComponents, getComponentDirectoryPath, getDirectoryFiles } from '../../util.js';
|
|
7
|
-
import { TASKS_CONFIG_JSON_FILENAME, TEMP_PATH, PACKAGE_JSON_FILENAME } from '../../constants.js';
|
|
5
|
+
import { addDebugLog } from '../../util.js';
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
export const getFilePathQuestions = async () => {
|
|
@@ -42,7 +40,7 @@ addDebugLog("getFileNameQuestions", "", "");
|
|
|
42
40
|
{
|
|
43
41
|
name: 'fileName',
|
|
44
42
|
type: 'rawlist',
|
|
45
|
-
message: `Select
|
|
43
|
+
message: `Select component`,
|
|
46
44
|
choices: zipFileList
|
|
47
45
|
},
|
|
48
46
|
];
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
convertIntoPascalCase,
|
|
28
28
|
getComponentDirectoryPath
|
|
29
29
|
} from '../../util.js';
|
|
30
|
-
import Choice from 'inquirer/lib/objects/choice.js';
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
const copy = promisify(ncp);
|
|
@@ -290,7 +289,7 @@ export default async options => {
|
|
|
290
289
|
addDebugLog("importComponent", "", "+");
|
|
291
290
|
|
|
292
291
|
if (options.params.length >= 5) {
|
|
293
|
-
const filePath = options.
|
|
292
|
+
const filePath = options.params[3];
|
|
294
293
|
const fileName = options.params[4];
|
|
295
294
|
await importComp( filePath, fileName);
|
|
296
295
|
|
package/src/tasks/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { default as moveComponent } from './move/index.js';
|
|
|
18
18
|
export { default as renameComponent } from './rename/index.js';
|
|
19
19
|
export { default as renameLibrary } from './rename-lib/index.js';
|
|
20
20
|
export { default as revertWebPack } from './revert-webpack/index.js';
|
|
21
|
+
export { default as quarantine } from './quarantine/index.js';
|
|
21
22
|
export { default as listComponents } from './list/index.js';
|
|
22
23
|
export { default as listLibrary } from './list-lib/index.js';
|
|
23
24
|
export { default as listPublished } from './list-pub/index.js';
|
|
@@ -48,11 +48,12 @@
|
|
|
48
48
|
"_internal-test-coverage": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand node_modules/@pega/custom-dx-component --ci --testResultsProcessor='jest-junit' --coverage",
|
|
49
49
|
"_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run _internal-test-full; fi ",
|
|
50
50
|
"_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
|
|
51
|
-
"_internal-test-functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
|
|
51
|
+
"_internal-test-functional": "echo '\nMake sure you authenticate!!\n' && npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
|
|
52
52
|
"_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components",
|
|
53
53
|
"_internal-build-jest-assets": "custom-dx-components buildJestAssets",
|
|
54
54
|
"_internal-buildLibrary": "custom-dx-components buildLibrary",
|
|
55
55
|
"_internal-publishLibrary": "custom-dx-components publishLibrary",
|
|
56
|
+
"_internal-test-quarantine": "custom-dx-components quarantine",
|
|
56
57
|
"_lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
57
58
|
"_lint:format": "prettier -c .",
|
|
58
59
|
"_lint:spelling": "cspell --no-progress **/*",
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"@pega/configs": "^0.6.0",
|
|
102
|
-
"@pega/custom-dx-components": "0.242.
|
|
103
|
+
"@pega/custom-dx-components": "0.242.36",
|
|
103
104
|
"@pega/pcore-pconnect-typedefs": "~3.0.0",
|
|
104
105
|
"@storybook/addon-actions": "^7.6.7",
|
|
105
106
|
"@storybook/addon-essentials": "^7.6.19",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
|
-
import {showVersion, getLibraryBased, addDebugLog, checkLibraryAndArchives, getLibraryArchivesVersions, getConfigDefaults, getLocalArchivedLibrraryVersionData, getComponentsConfigs } from '../../util.js';
|
|
4
|
+
import {showVersion, getLibraryBased, addDebugLog, checkLibraryAndArchives, getLibraryArchivesVersions, getConfigDefaults, getLocalArchivedLibrraryVersionData, getComponentsConfigs, cleanUpTemp } from '../../util.js';
|
|
5
5
|
import { getArchiveLibraryQuestions } from './helper.js';
|
|
6
6
|
|
|
7
7
|
export default async (options) => {
|
|
@@ -16,6 +16,8 @@ export default async (options) => {
|
|
|
16
16
|
await checkLibraryAndArchives();
|
|
17
17
|
addDebugLog("listLibrary", "", "+");
|
|
18
18
|
|
|
19
|
+
await cleanUpTemp();
|
|
20
|
+
|
|
19
21
|
let organization;
|
|
20
22
|
let library;
|
|
21
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
|
-
import {showVersion, getC11NB2STokenAndStaticServer, getLocalLibraries, getLocalLibraryVersions, getLocalLibraryVersionData, getLibraryBased, addDebugLog, checkLibraryAndArchives, getConfigDefaults } from '../../util.js';
|
|
4
|
+
import {showVersion, getC11NB2STokenAndStaticServer, getLocalLibraries, getLocalLibraryVersions, getLocalLibraryVersionData, getLibraryBased, addDebugLog, checkLibraryAndArchives, getConfigDefaults, cleanUpTemp } from '../../util.js';
|
|
5
5
|
|
|
6
6
|
import { listLibJSONResponse } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
7
7
|
|
|
@@ -43,6 +43,7 @@ export default async (options) => {
|
|
|
43
43
|
await showVersion();
|
|
44
44
|
await checkLibraryAndArchives();
|
|
45
45
|
addDebugLog("listPublished", "", "+");
|
|
46
|
+
await cleanUpTemp();
|
|
46
47
|
|
|
47
48
|
let sourceOfLibrary;
|
|
48
49
|
let organization;
|
|
@@ -51,13 +52,14 @@ addDebugLog("listPublished", "", "+");
|
|
|
51
52
|
const compDef = getConfigDefaults();
|
|
52
53
|
organization = compDef.organization;
|
|
53
54
|
library = compDef.library;
|
|
54
|
-
let libraryName;
|
|
55
|
-
let selectedVersion;
|
|
55
|
+
let libraryName = "";
|
|
56
|
+
let selectedVersion = "";
|
|
56
57
|
let libVersions = [];
|
|
57
58
|
|
|
58
59
|
if (options.params.length >= 5) {
|
|
59
60
|
sourceOfLibrary = options.params[3];
|
|
60
|
-
|
|
61
|
+
libraryName = options.params[4];
|
|
62
|
+
selectedVersion = options.params[5];
|
|
61
63
|
|
|
62
64
|
libVersions.push(selectedVersion);
|
|
63
65
|
|
|
@@ -74,16 +76,18 @@ addDebugLog("listPublished", "", "+");
|
|
|
74
76
|
// local
|
|
75
77
|
const arLibs = await getLocalLibraries();
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
if (libraryName === "") {
|
|
80
|
+
const libAnswers = await inquirer.prompt([
|
|
81
|
+
{
|
|
82
|
+
name: 'library',
|
|
83
|
+
type: 'rawlist',
|
|
84
|
+
message: 'Pick library',
|
|
85
|
+
choices: arLibs
|
|
86
|
+
}
|
|
87
|
+
]);
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
libraryName = libAnswers.library;
|
|
90
|
+
}
|
|
87
91
|
|
|
88
92
|
if (libVersions.length == 0) {
|
|
89
93
|
try {
|
|
@@ -96,7 +100,7 @@ addDebugLog("listPublished", "", "+");
|
|
|
96
100
|
|
|
97
101
|
if (libVersions.length > 0) {
|
|
98
102
|
|
|
99
|
-
if (selectedVersion ===
|
|
103
|
+
if (selectedVersion === "") {
|
|
100
104
|
const libAnswers = await inquirer.prompt([
|
|
101
105
|
{
|
|
102
106
|
name: 'libVersion',
|
package/src/tasks/move/helper.js
CHANGED
|
@@ -36,21 +36,24 @@ addDebugLog("getLibraryQuestions", "", "");
|
|
|
36
36
|
];
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
export const getLibraryVersionQuestion = async (libraryName, libVersions) => {
|
|
39
|
+
export const getLibraryVersionQuestion = async (libraryName, libVersions, copyOrMove) => {
|
|
40
40
|
addDebugLog("getLibraryVersionQuestion", `libraryName: ${libraryName}`, "");
|
|
41
|
+
const configDef = getConfigDefaults();
|
|
41
42
|
|
|
42
43
|
return [
|
|
43
44
|
{
|
|
44
45
|
name: 'version',
|
|
45
46
|
type: 'rawlist',
|
|
46
|
-
message: `Select ${chalk.green.bold(`${libraryName}`)} library version to
|
|
47
|
+
message: `Select ${chalk.green.bold(`${libraryName}`)} library version to ${copyOrMove} to`,
|
|
47
48
|
choices: libVersions
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
name: 'copyShared',
|
|
51
52
|
type: 'confirm',
|
|
52
53
|
message: `Copy ${chalk.yellow.bold("/shared")} directory (same named files will be overridden) ?`,
|
|
53
|
-
default: true
|
|
54
|
+
default: true,
|
|
55
|
+
when: (answers) => (answers.version != configDef.buildVersion && libraryName != configDef.library)
|
|
56
|
+
|
|
54
57
|
},
|
|
55
58
|
];
|
|
56
59
|
};
|