@pega/custom-dx-components 0.242.23 → 0.242.24
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/constants.js +1 -0
- package/src/tasks/authenticate/index.js +1 -1
- package/src/tasks/build-all/helper.js +5 -18
- package/src/tasks/build-all/index.js +43 -10
- package/src/tasks/build-comp/helper.js +6 -2
- package/src/tasks/build-comp/index.js +19 -3
- package/src/tasks/build-jest-assets/index.js +1 -1
- package/src/tasks/build-lib/helper.js +10 -2
- package/src/tasks/build-lib/index.js +15 -3
- package/src/tasks/bundle/builder/index.js +11 -3
- package/src/tasks/bundle/builder/webpack.config.js +3 -1
- package/src/tasks/bundle/index.js +3 -1
- package/src/tasks/create/index.js +11 -4
- package/src/tasks/create-all/index.js +10 -4
- package/src/tasks/delete/helper.js +7 -2
- package/src/tasks/delete/index.js +6 -2
- package/src/tasks/delete-all/helper.js +6 -2
- package/src/tasks/delete-all/index.js +7 -2
- package/src/tasks/delete-lib/helper.js +6 -1
- package/src/tasks/delete-lib/index.js +10 -4
- package/src/tasks/init/template/package.json.mustache +1 -2
- package/src/tasks/init/template/tasks.config.json +2 -1
- package/src/tasks/linter/index.js +4 -0
- package/src/tasks/list/helper.js +9 -2
- package/src/tasks/list/index.js +10 -2
- package/src/tasks/list-lib/helper.js +8 -2
- package/src/tasks/list-lib/index.js +12 -3
- package/src/tasks/promote-webpack/index.js +7 -2
- package/src/tasks/promote-webpack/webpack.config.js +3 -1
- package/src/tasks/publish/helper.js +5 -1
- package/src/tasks/publish/index.js +6 -2
- package/src/tasks/publish-all/helper.js +8 -1
- package/src/tasks/publish-all/index.js +8 -2
- package/src/tasks/publish-lib/helper.js +4 -2
- package/src/tasks/publish-lib/index.js +17 -7
- package/src/tasks/rename/index.js +10 -3
- package/src/tasks/rename-lib/index.js +23 -5
- package/src/tasks/revert-webpack/index.js +5 -2
- package/src/tasks/validator/index.js +4 -1
- package/src/util.js +135 -5
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
|
|
3
|
-
import { showVersion, getLibraryBased } from '../../util.js';
|
|
3
|
+
import { showVersion, getLibraryBased, addDebugLog } from '../../util.js';
|
|
4
4
|
|
|
5
5
|
import { deleteLocalComponents, SOURCE_OF_COMPONENT_TYPES, deleteServerComponents, getDeleteComponentsQuestions } from './helper.js';
|
|
6
6
|
|
|
7
7
|
const isLibraryBased = await getLibraryBased();
|
|
8
8
|
|
|
9
9
|
const deleteComponentsFn = async (sourceOfComponents, answers, options) => {
|
|
10
|
+
addDebugLog("deleteComponentsFn", `sourceOfComponents: ${sourceOfComponents}`, "");
|
|
10
11
|
switch (sourceOfComponents) {
|
|
11
12
|
case SOURCE_OF_COMPONENT_TYPES.LOCAL: {
|
|
12
13
|
await deleteLocalComponents(sourceOfComponents, options);
|
|
@@ -24,7 +25,9 @@ const deleteComponentsFn = async (sourceOfComponents, answers, options) => {
|
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export default async (options) => {
|
|
27
|
-
showVersion();
|
|
28
|
+
await showVersion();
|
|
29
|
+
|
|
30
|
+
addDebugLog("deleteAll", "", "+");
|
|
28
31
|
|
|
29
32
|
let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
|
|
30
33
|
if (isLibraryBased) {
|
|
@@ -45,4 +48,6 @@ export default async (options) => {
|
|
|
45
48
|
const { sourceOfComponents } = answers;
|
|
46
49
|
await deleteComponentsFn(sourceOfComponents, answers, options);
|
|
47
50
|
}
|
|
51
|
+
|
|
52
|
+
addDebugLog("deleteAll", "END", "-");
|
|
48
53
|
};
|
|
@@ -3,7 +3,7 @@ import path from 'path';
|
|
|
3
3
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
|
|
6
|
-
import { getPegaServerConfig, checkPathAccess, getComponentDefaults } from '../../util.js';
|
|
6
|
+
import { getPegaServerConfig, checkPathAccess, getComponentDefaults, addDebugLog } from '../../util.js';
|
|
7
7
|
import {
|
|
8
8
|
TASKS_CONFIG_JSON_FILENAME,
|
|
9
9
|
COMPONENTS_DIRECTORY_PATH,
|
|
@@ -18,6 +18,7 @@ export const SOURCE_OF_COMPONENT_TYPES = {
|
|
|
18
18
|
const pegaConfigJsonPath = path.join(path.resolve(), TASKS_CONFIG_JSON_FILENAME);
|
|
19
19
|
|
|
20
20
|
export const getOrgLib = async () => {
|
|
21
|
+
addDebugLog("getOrgLib", "", "+");
|
|
21
22
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
22
23
|
|
|
23
24
|
await checkPathAccess(pegaConfigJsonPath);
|
|
@@ -42,10 +43,13 @@ export const getOrgLib = async () => {
|
|
|
42
43
|
componentDefaults.library = library;
|
|
43
44
|
componentDefaults.organization = organization;
|
|
44
45
|
|
|
46
|
+
addDebugLog("getOrgLib", `componentsDefaults: ${JSON.stringify(componentDefaults)}`, "");
|
|
47
|
+
addDebugLog("getOrgLib", "END", "-");
|
|
45
48
|
return componentDefaults;
|
|
46
49
|
};
|
|
47
50
|
|
|
48
51
|
export const getDeleteLibraryQuestions = async () => {
|
|
52
|
+
addDebugLog("getDeleteLibraryQuestions", "", "");
|
|
49
53
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
50
54
|
|
|
51
55
|
return [
|
|
@@ -60,6 +64,7 @@ export const getDeleteLibraryQuestions = async () => {
|
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
export const getLibraryVersionQuestion = async (libraryName, libVersions) => {
|
|
67
|
+
addDebugLog("getLibraryVersionQuestion", `libraryName: ${libraryName}`, "");
|
|
63
68
|
return [
|
|
64
69
|
{
|
|
65
70
|
name: 'version',
|
|
@@ -2,7 +2,7 @@ import inquirer from 'inquirer';
|
|
|
2
2
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
|
|
5
|
-
import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion } from '../../util.js';
|
|
5
|
+
import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog } from '../../util.js';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import { deleteLib } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
@@ -17,7 +17,9 @@ export default async (options) => {
|
|
|
17
17
|
process.exit();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
showVersion();
|
|
20
|
+
await showVersion();
|
|
21
|
+
|
|
22
|
+
addDebugLog("deleteLibrary", "", "+");
|
|
21
23
|
|
|
22
24
|
let sourceOfLibrary;
|
|
23
25
|
let organization;
|
|
@@ -64,6 +66,7 @@ export default async (options) => {
|
|
|
64
66
|
else {
|
|
65
67
|
// No library with that name
|
|
66
68
|
console.log(chalk.redBright(`No local library named: ${libraryName} exists.`));
|
|
69
|
+
addDebugLog("deleteLibrary", "END", "-");
|
|
67
70
|
process.exit(1);
|
|
68
71
|
|
|
69
72
|
}
|
|
@@ -88,15 +91,18 @@ export default async (options) => {
|
|
|
88
91
|
|
|
89
92
|
if (tokenAndStaticServer.C11NB2S === undefined) {
|
|
90
93
|
console.log(chalk.redBright("Need to authenticate, missing services token.\nDeleting a library requires authentication to acquire a token to delete."));
|
|
94
|
+
addDebugLog("deleteLibrary", "END", "-");
|
|
91
95
|
process.exit(1);
|
|
92
96
|
}
|
|
93
|
-
await deleteLib(tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
94
97
|
|
|
98
|
+
addDebugLog("deleteLib", "services call", "");
|
|
99
|
+
await deleteLib(tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
100
|
+
addDebugLog("deleteLib", "services end", "");
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
addDebugLog("deleteLibrary", "END", "-");
|
|
100
106
|
|
|
101
107
|
return true;
|
|
102
108
|
};
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"@pega/cosmos-react-work": "7.0.0-build.6.0",
|
|
61
61
|
"@pega/eslint-config": "^0.10.2",
|
|
62
62
|
"@pega/tsconfig": "^0.10.2",
|
|
63
|
-
"@storybook/theming": "^8.1.11",
|
|
64
63
|
"babel-loader": "^9.1.3",
|
|
65
64
|
"dayjs": "^1.11.11",
|
|
66
65
|
"fast-deep-equal": "3.1.3",
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
82
|
"@pega/configs": "^0.6.0",
|
|
84
|
-
"@pega/custom-dx-components": "0.242.
|
|
83
|
+
"@pega/custom-dx-components": "0.242.24",
|
|
85
84
|
"@pega/pcore-pconnect-typedefs": "~3.0.0",
|
|
86
85
|
"@storybook/addon-actions": "^7.6.7",
|
|
87
86
|
"@storybook/addon-essentials": "^7.6.19",
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ESLint } from 'eslint';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
+
// import { addDebugLog } from '../../util.js';
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
export const lintComponent = async (dirToLint) => {
|
|
7
|
+
// addDebugLog("lintComponent", `dirToLint: ${dirToLint}`);
|
|
8
|
+
|
|
5
9
|
// console.log("in dx-component-builder-sdk: lintComponent - dirToLint: " + dirToLint);
|
|
6
10
|
console.log(chalk.green(` linting ${dirToLint}`));
|
|
7
11
|
|
package/src/tasks/list/helper.js
CHANGED
|
@@ -8,7 +8,8 @@ import ora from 'ora';
|
|
|
8
8
|
import inquirer from 'inquirer';
|
|
9
9
|
|
|
10
10
|
import { LIST_COMPONENT_SERVICE_REST_ENDPOINT, LP_LIST_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH, COMPONENT_SCHEMA, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, COMPONENTS_PATH } from '../../constants.js';
|
|
11
|
-
import { constructCompleteUrl, getComponents, getPegaServerConfig, getHttpsAgent, sanitize } from '../../util.js';
|
|
11
|
+
import { constructCompleteUrl, getComponents, getPegaServerConfig, getHttpsAgent, sanitize, addDebugLog } from '../../util.js';
|
|
12
|
+
import lib from 'webpack-bundle-analyzer';
|
|
12
13
|
|
|
13
14
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
14
15
|
SERVER: 'Server',
|
|
@@ -18,6 +19,7 @@ export const SOURCE_OF_COMPONENT_TYPES = {
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
export const getListComponentsQuestions = async (options) => {
|
|
22
|
+
addDebugLog("getListComponentsQuestions", "", "");
|
|
21
23
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
22
24
|
|
|
23
25
|
return [
|
|
@@ -35,6 +37,7 @@ export const getListComponentsQuestions = async (options) => {
|
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
export const getLaunchPadFilterQuestions = async () => {
|
|
40
|
+
addDebugLog("getLaunchPadFilterQuestions", "", "");
|
|
38
41
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
39
42
|
const currentDirectory = process.cwd();
|
|
40
43
|
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
@@ -81,6 +84,7 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
export const listLocalComponents = async (sourceOfComponents) => {
|
|
87
|
+
addDebugLog("listLocalComponents", `sourceOfComponents: ${sourceOfComponents}`, "");
|
|
84
88
|
let localComponents = await getComponents();
|
|
85
89
|
localComponents = localComponents.map((name) => ({ 'Rule name': name }));
|
|
86
90
|
if (localComponents.length > 0) {
|
|
@@ -92,6 +96,7 @@ export const listLocalComponents = async (sourceOfComponents) => {
|
|
|
92
96
|
};
|
|
93
97
|
|
|
94
98
|
async function fetchComponentsFromInfinity(apiUrl, headers) {
|
|
99
|
+
addDebugLog("fetchComponentsFromInfinity", `apiUrl: ${apiUrl}`, "");
|
|
95
100
|
const serverConfig = await getPegaServerConfig();
|
|
96
101
|
return new Promise((resolve, reject) => {
|
|
97
102
|
let status = 500;
|
|
@@ -134,7 +139,7 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
|
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
async function fetchComponentsFromLaunchpad(apiUrl, headers) {
|
|
137
|
-
|
|
142
|
+
addDebugLog("fetchComponentsFromLaunchpad", `apiUrl: ${apiUrl}`, "");
|
|
138
143
|
const serverConfig = await getPegaServerConfig();
|
|
139
144
|
// constructing urls for all type of components
|
|
140
145
|
const urls = COMPONENT_SCHEMA.type.map((type) => apiUrl.replace('{type}', type.value));
|
|
@@ -175,6 +180,7 @@ async function fetchComponentsFromLaunchpad(apiUrl, headers) {
|
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
export const getComponentsFromServer = async (library, organization) => {
|
|
183
|
+
addDebugLog("getComponentsFromServer", `library: ${library}, organization: ${organization}`, "");
|
|
178
184
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
179
185
|
const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
|
|
180
186
|
const url = constructCompleteUrl(
|
|
@@ -223,6 +229,7 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
223
229
|
};
|
|
224
230
|
|
|
225
231
|
export const displayServerComponents = async (data) => {
|
|
232
|
+
addDebugLog("displayServerComponents", "", "");
|
|
226
233
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
227
234
|
const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
|
|
228
235
|
let list;
|
package/src/tasks/list/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import inquirer from 'inquirer';
|
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
|
|
5
|
-
import { showVersion, getPegaServerConfig, getLibraryBased } from '../../util.js';
|
|
5
|
+
import { showVersion, getPegaServerConfig, getLibraryBased, addDebugLog } from '../../util.js';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
listLocalComponents,
|
|
@@ -17,6 +17,7 @@ const isLibraryBased = await getLibraryBased();
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
const getList = async (sourceOfComponents, answers) => {
|
|
20
|
+
addDebugLog("getList", `sourceOfComponents: ${sourceOfComponents}`, "");
|
|
20
21
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
21
22
|
const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
|
|
22
23
|
|
|
@@ -69,7 +70,9 @@ const getList = async (sourceOfComponents, answers) => {
|
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
export default async (options) => {
|
|
72
|
-
showVersion();
|
|
73
|
+
await showVersion();
|
|
74
|
+
|
|
75
|
+
addDebugLog("list", "", "+");
|
|
73
76
|
|
|
74
77
|
let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
|
|
75
78
|
if (isLibraryBased) {
|
|
@@ -90,4 +93,9 @@ export default async (options) => {
|
|
|
90
93
|
const { sourceOfComponents } = answers;
|
|
91
94
|
await getList(sourceOfComponents, answers);
|
|
92
95
|
}
|
|
96
|
+
addDebugLog("list", "END", "-");
|
|
93
97
|
};
|
|
98
|
+
`
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
+`
|
|
@@ -5,7 +5,8 @@ import chalk from 'chalk';
|
|
|
5
5
|
import {
|
|
6
6
|
getPegaServerConfig,
|
|
7
7
|
checkPathAccess,
|
|
8
|
-
getComponentDefaults
|
|
8
|
+
getComponentDefaults,
|
|
9
|
+
addDebugLog
|
|
9
10
|
} from '../../util.js';
|
|
10
11
|
import { TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, COMPONENTS_PATH } from '../../constants.js';
|
|
11
12
|
|
|
@@ -17,6 +18,7 @@ export const SOURCE_OF_COMPONENT_TYPES = {
|
|
|
17
18
|
const pegaConfigJsonPath = path.join(path.resolve(), TASKS_CONFIG_JSON_FILENAME);
|
|
18
19
|
|
|
19
20
|
export const getOrgLib = async () => {
|
|
21
|
+
addDebugLog("getOrgLib", "", "+");
|
|
20
22
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
21
23
|
|
|
22
24
|
await checkPathAccess(pegaConfigJsonPath);
|
|
@@ -39,10 +41,14 @@ export const getOrgLib = async () => {
|
|
|
39
41
|
componentDefaults.library = library;
|
|
40
42
|
componentDefaults.organization = organization;
|
|
41
43
|
|
|
44
|
+
addDebugLog("getOrgLib", `componentsDefaults: ${JSON.stringify(componentDefaults)}`, "");
|
|
45
|
+
addDebugLog("getOrgLib", "END", "-");
|
|
46
|
+
|
|
42
47
|
return componentDefaults;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
export const getListLibraryQuestions = async (libraryName) => {
|
|
51
|
+
addDebugLog("getListLibraryQuestions", `libraryName: ${libraryName}`, "");
|
|
46
52
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
47
53
|
|
|
48
54
|
|
|
@@ -59,7 +65,7 @@ export const getListLibraryQuestions = async (libraryName) => {
|
|
|
59
65
|
|
|
60
66
|
|
|
61
67
|
export const getLibraryVersionQuestion = async(libraryName, libVersions) => {
|
|
62
|
-
|
|
68
|
+
addDebugLog("getLibraryVersionQuestion", `libraryName: ${libraryName}, libVersions: ${libVersions}`, "");
|
|
63
69
|
return [
|
|
64
70
|
{
|
|
65
71
|
name: 'version',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
|
-
import {showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLocalLibraryVersionData, getLibraryBased } from '../../util.js';
|
|
4
|
+
import {showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLocalLibraryVersionData, getLibraryBased, addDebugLog } from '../../util.js';
|
|
5
5
|
|
|
6
6
|
import { listLibJSONResponse } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
7
7
|
|
|
@@ -10,6 +10,8 @@ import { getListLibraryQuestions, getLibraryVersionQuestion, getOrgLib, SOURCE_O
|
|
|
10
10
|
const isLibraryBased = await getLibraryBased();
|
|
11
11
|
|
|
12
12
|
export const getServerLibraryVersions = async(libraryName) => {
|
|
13
|
+
addDebugLog("getServerLibraryVersions", `libraryName: ${libraryName}`, "");
|
|
14
|
+
|
|
13
15
|
// server
|
|
14
16
|
const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
|
|
15
17
|
|
|
@@ -18,8 +20,9 @@ export const getServerLibraryVersions = async(libraryName) => {
|
|
|
18
20
|
process.exit(1);
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
addDebugLog("listLibJSONResponse", "services call", "");
|
|
22
24
|
const oLibList = await listLibJSONResponse(tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
25
|
+
addDebugLog("listLibJSONResponse", "services end", "");
|
|
23
26
|
|
|
24
27
|
let versionList = null;
|
|
25
28
|
if (oLibList && oLibList[libraryName]) {
|
|
@@ -31,12 +34,14 @@ export const getServerLibraryVersions = async(libraryName) => {
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export default async (options) => {
|
|
37
|
+
|
|
34
38
|
if (!isLibraryBased) {
|
|
35
39
|
console.log(`Command only supported for ${chalk.bold.green('library based')} components.`)
|
|
36
40
|
process.exit();
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
showVersion();
|
|
43
|
+
await showVersion();
|
|
44
|
+
addDebugLog("listLibrary", "", "+");
|
|
40
45
|
|
|
41
46
|
let sourceOfLibrary;
|
|
42
47
|
let organization;
|
|
@@ -110,6 +115,7 @@ export default async (options) => {
|
|
|
110
115
|
// No library with that name
|
|
111
116
|
console.log(chalk.redBright(`No local library named: ${libraryName} exists.`));
|
|
112
117
|
console.log(chalk.redBright(`You need to build library: ${libraryName} first.`));
|
|
118
|
+
addDebugLog("listLibrary", "END", "-");
|
|
113
119
|
process.exit(1);
|
|
114
120
|
|
|
115
121
|
}
|
|
@@ -150,11 +156,14 @@ export default async (options) => {
|
|
|
150
156
|
// No library with that name
|
|
151
157
|
console.log(chalk.redBright(`No server library named: ${libraryName} exists.`));
|
|
152
158
|
console.log(chalk.redBright(`You need to build library: ${libraryName} and publish this library.`));
|
|
159
|
+
addDebugLog("listLibrary", "END", "-");
|
|
153
160
|
process.exit(1);
|
|
154
161
|
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
}
|
|
158
165
|
|
|
166
|
+
addDebugLog("listLibrary", "END", "-");
|
|
167
|
+
|
|
159
168
|
return true;
|
|
160
169
|
};
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
checkPathAccess,
|
|
11
11
|
showVersion,
|
|
12
12
|
updateUseWebPackPromotion,
|
|
13
|
-
getLibraryBased
|
|
13
|
+
getLibraryBased,
|
|
14
|
+
addDebugLog
|
|
14
15
|
} from '../../util.js';
|
|
15
16
|
|
|
16
17
|
import {
|
|
@@ -24,6 +25,7 @@ const isLibraryBased = await getLibraryBased();
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
export const copyWebPack = async () => {
|
|
28
|
+
addDebugLog("copyWebPack","", "");
|
|
27
29
|
|
|
28
30
|
// first check to see if already have the file
|
|
29
31
|
const newWebPackConfigDir = path.resolve(WEBPACK_CONFIG_JS_FILENAME);
|
|
@@ -97,9 +99,12 @@ export default async options => {
|
|
|
97
99
|
process.exit();
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
showVersion();
|
|
102
|
+
await showVersion();
|
|
103
|
+
addDebugLog("promoteWebPack","", "+");
|
|
101
104
|
|
|
102
105
|
await copyWebPack();
|
|
103
106
|
await updateUseWebPackPromotion(true);
|
|
104
107
|
|
|
108
|
+
addDebugLog("promoteWebPack","END", "-");
|
|
109
|
+
|
|
105
110
|
};
|
|
@@ -395,7 +395,9 @@ module.exports = (
|
|
|
395
395
|
/* isEnvProduction && new CompressionPlugin(compressionGZConfObj) */
|
|
396
396
|
].filter(Boolean),
|
|
397
397
|
performance: {
|
|
398
|
-
hints:
|
|
398
|
+
hints: false,
|
|
399
|
+
maxEntrypointSize: 512000,
|
|
400
|
+
maxAssetSize: 512000
|
|
399
401
|
},
|
|
400
402
|
externals
|
|
401
403
|
};
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
getComponents,
|
|
12
12
|
getPegaServerConfig,
|
|
13
13
|
validateRulesetVersion,
|
|
14
|
-
getHttpsAgent
|
|
14
|
+
getHttpsAgent,
|
|
15
|
+
addDebugLog
|
|
15
16
|
} from '../../util.js';
|
|
16
17
|
import {
|
|
17
18
|
PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
} from '../../constants.js';
|
|
21
22
|
|
|
22
23
|
export const getPublishComponentQuestions = async componentKey => {
|
|
24
|
+
addDebugLog("getPublishComponentQuestions", `componentKey: ${componentKey}`, "");
|
|
23
25
|
const components = await getComponents();
|
|
24
26
|
|
|
25
27
|
if (components.length === 0) {
|
|
@@ -83,6 +85,7 @@ export const getPublishComponentQuestions = async componentKey => {
|
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
export const zipComponent = async componentKey => {
|
|
88
|
+
addDebugLog("zipComponent", `componentKey: ${componentKey}`, "");
|
|
86
89
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
87
90
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
88
91
|
const configJson = `${srcDirectory}/config.json`;
|
|
@@ -126,6 +129,7 @@ export const zipComponent = async componentKey => {
|
|
|
126
129
|
};
|
|
127
130
|
|
|
128
131
|
export const publishComponentToServer = async (data, doFetch) => {
|
|
132
|
+
addDebugLog("publishComponentToServer", `data: ${data}`, "");
|
|
129
133
|
const { configContent, zipContent, rulesetName, rulesetVersion } = data;
|
|
130
134
|
|
|
131
135
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import validate from '../validator/index.js';
|
|
6
6
|
import bundleComponent from '../bundle/index.js';
|
|
7
7
|
import { lintComponent } from '../linter/index.js';
|
|
8
|
-
import { getComponentDirectoryPath, showVersion, getLibraryBased } from '../../util.js';
|
|
8
|
+
import { getComponentDirectoryPath, showVersion, getLibraryBased, addDebugLog } from '../../util.js';
|
|
9
9
|
|
|
10
10
|
import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
|
|
11
11
|
|
|
@@ -17,7 +17,9 @@ export default async options => {
|
|
|
17
17
|
process.exit();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
showVersion();
|
|
20
|
+
await showVersion();
|
|
21
|
+
|
|
22
|
+
addDebugLog("publish", "", "+");
|
|
21
23
|
|
|
22
24
|
let componentKey;
|
|
23
25
|
let sourceMap;
|
|
@@ -97,5 +99,7 @@ export default async options => {
|
|
|
97
99
|
await tasks.run().catch(err => {
|
|
98
100
|
console.log(chalk.bold.red(err.toString()));
|
|
99
101
|
});
|
|
102
|
+
|
|
103
|
+
addDebugLog("publish", "END", "-");
|
|
100
104
|
return true;
|
|
101
105
|
};
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
getComponentDirectoryPath,
|
|
11
11
|
getPegaServerConfig,
|
|
12
12
|
validateRulesetVersion,
|
|
13
|
-
getHttpsAgent
|
|
13
|
+
getHttpsAgent,
|
|
14
|
+
addDebugLog
|
|
14
15
|
} from '../../util.js';
|
|
15
16
|
import {
|
|
16
17
|
PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT,
|
|
@@ -19,6 +20,8 @@ import {
|
|
|
19
20
|
} from '../../constants.js';
|
|
20
21
|
|
|
21
22
|
export const getPublishComponentQuestions = async () => {
|
|
23
|
+
addDebugLog("getPublishComponentQuestions", "", "");
|
|
24
|
+
|
|
22
25
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
23
26
|
|
|
24
27
|
return [
|
|
@@ -67,6 +70,7 @@ export const getPublishComponentQuestions = async () => {
|
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
export const zipComponent = async componentKey => {
|
|
73
|
+
addDebugLog("zipComponent", `componentKey: ${componentKey}`, "");
|
|
70
74
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
71
75
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
72
76
|
const configJson = `${srcDirectory}/config.json`;
|
|
@@ -104,6 +108,7 @@ export const zipComponent = async componentKey => {
|
|
|
104
108
|
};
|
|
105
109
|
|
|
106
110
|
export const cleanUp = async () => {
|
|
111
|
+
addDebugLog("cleanUp", "", "");
|
|
107
112
|
fs.rm('dist/components', { recursive: true }, err => {
|
|
108
113
|
if (err) {
|
|
109
114
|
throw err;
|
|
@@ -118,6 +123,8 @@ export const cleanUp = async () => {
|
|
|
118
123
|
};
|
|
119
124
|
|
|
120
125
|
export const publishComponentToServer = async (data, doFetch) => {
|
|
126
|
+
addDebugLog("publishComponentToServer", "", "");
|
|
127
|
+
|
|
121
128
|
const { configContent, zipContent, rulesetName, rulesetVersion } = data;
|
|
122
129
|
|
|
123
130
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
@@ -5,7 +5,7 @@ import chalk from 'chalk';
|
|
|
5
5
|
import validate from '../validator/index.js';
|
|
6
6
|
import bundleComponent from '../bundle/index.js';
|
|
7
7
|
import { lintComponent } from '../linter/index.js';
|
|
8
|
-
import { getComponents, getComponentDirectoryPath, showVersion, getLibraryBased } from '../../util.js';
|
|
8
|
+
import { getComponents, getComponentDirectoryPath, showVersion, getLibraryBased, addDebugLog } from '../../util.js';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
getPublishComponentQuestions,
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
const isLibraryBased = await getLibraryBased();
|
|
18
18
|
|
|
19
19
|
export function getCustomTasks(componentKey, sourceMap, devBuild, content, options) {
|
|
20
|
+
addDebugLog("getCustomTasks", `componentKey: ${componentKey}, sourceMap: ${sourceMap}, devBuild: ${devBuild}`, "");
|
|
21
|
+
|
|
20
22
|
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
21
23
|
// eslint-disable no-unneeded-ternary,no-nested-ternary
|
|
22
24
|
const doFetch = options.params.length >= 7 ? (options.params[6] === 'noFetch' ? false : true) : true;
|
|
@@ -67,7 +69,9 @@ export default async options => {
|
|
|
67
69
|
process.exit();
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
showVersion();
|
|
72
|
+
await showVersion();
|
|
73
|
+
|
|
74
|
+
addDebugLog("publishAll", "", "+");
|
|
71
75
|
|
|
72
76
|
const components = await getComponents();
|
|
73
77
|
|
|
@@ -115,5 +119,7 @@ export default async options => {
|
|
|
115
119
|
// once done, remove leftover directories
|
|
116
120
|
await cleanUp();
|
|
117
121
|
|
|
122
|
+
addDebugLog("publishAll", "END", "-");
|
|
123
|
+
|
|
118
124
|
return true;
|
|
119
125
|
};
|
|
@@ -5,13 +5,15 @@ import chalk from 'chalk';
|
|
|
5
5
|
import {
|
|
6
6
|
getPegaServerConfig,
|
|
7
7
|
checkPathAccess,
|
|
8
|
-
getComponentDefaults
|
|
8
|
+
getComponentDefaults,
|
|
9
|
+
addDebugLog
|
|
9
10
|
} from '../../util.js';
|
|
10
11
|
import { TASKS_CONFIG_JSON_FILENAME, COMPONENTS_DIRECTORY_PATH, COMPONENTS_PATH } from '../../constants.js';
|
|
11
12
|
|
|
12
13
|
const pegaConfigJsonPath = path.join(path.resolve(), TASKS_CONFIG_JSON_FILENAME);
|
|
13
14
|
|
|
14
15
|
export const getOrgLib = async () => {
|
|
16
|
+
addDebugLog("getOrgLib", "", "");
|
|
15
17
|
const defaultPegaConfig = await getPegaServerConfig();
|
|
16
18
|
|
|
17
19
|
await checkPathAccess(pegaConfigJsonPath);
|
|
@@ -40,7 +42,7 @@ export const getOrgLib = async () => {
|
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
export const getLibraryVersionQuestion = async(libVersions) => {
|
|
43
|
-
|
|
45
|
+
addDebugLog("getLibraryVersionQuestion", `libVersions: ${libVersions}`, "");
|
|
44
46
|
return [
|
|
45
47
|
{
|
|
46
48
|
name: 'version',
|
|
@@ -4,16 +4,18 @@ import chalk from 'chalk';
|
|
|
4
4
|
|
|
5
5
|
import validate from '../validator/index.js';
|
|
6
6
|
import { lintComponent } from '../linter/index.js';
|
|
7
|
-
import { getComponentDirectoryPath, showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deletePublishExtras } from '../../util.js';
|
|
7
|
+
import { getComponentDirectoryPath, showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deletePublishExtras, addDebugLog } from '../../util.js';
|
|
8
8
|
|
|
9
9
|
import { publishLib, listLibJSONResponse, deleteLibVersion } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
10
10
|
|
|
11
11
|
import { getLibraryVersionQuestion, getOrgLib } from './helper.js';
|
|
12
|
+
import lib from 'webpack-bundle-analyzer';
|
|
12
13
|
;
|
|
13
14
|
|
|
14
15
|
const isLibraryBased = await getLibraryBased();
|
|
15
16
|
|
|
16
17
|
export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
|
|
18
|
+
addDebugLog("getCustomTasks", `componentKey: ${componentKey}, sourceMap: ${sourceMap}, devBuild: ${devBuild}`, "");
|
|
17
19
|
|
|
18
20
|
const sDevBuild = devBuild ? '(dev build)' : '';
|
|
19
21
|
return new Listr(
|
|
@@ -41,6 +43,7 @@ export function getCustomTasks(componentKey, sourceMap, devBuild, options) {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export const doesLibraryExist = async (libraryName, libraryVersion) => {
|
|
46
|
+
addDebugLog("doesLibraryExist", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
|
|
44
47
|
|
|
45
48
|
const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
|
|
46
49
|
const libList = await listLibJSONResponse(tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
@@ -56,6 +59,7 @@ export const doesLibraryExist = async (libraryName, libraryVersion) => {
|
|
|
56
59
|
|
|
57
60
|
|
|
58
61
|
export const publishNewLibraryAsync = async (libraryName, version, checkDeleted = false) => {
|
|
62
|
+
addDebugLog("publishNewLibraryAsync", `libraryName: ${libraryName}, version: ${version}, checkDeleted: ${checkDeleted} `, "");
|
|
59
63
|
|
|
60
64
|
const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
|
|
61
65
|
|
|
@@ -78,7 +82,9 @@ export const publishNewLibraryAsync = async (libraryName, version, checkDeleted
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
console.log("\nPublishing Library " + chalk.bold.green(`${libraryName}:${version}`) + " to " + chalk.bold.green(`${tokenAndStaticServer.appStaticContentServer}`));
|
|
81
|
-
|
|
85
|
+
addDebugLog("publishLib", "services call", "");
|
|
86
|
+
await publishLib(libraryName, version, tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
87
|
+
addDebugLog("deleteLib", "services end", "");
|
|
82
88
|
|
|
83
89
|
}
|
|
84
90
|
|
|
@@ -89,7 +95,9 @@ export default async (options) => {
|
|
|
89
95
|
process.exit();
|
|
90
96
|
}
|
|
91
97
|
|
|
92
|
-
showVersion();
|
|
98
|
+
await showVersion();
|
|
99
|
+
|
|
100
|
+
addDebugLog("publishLibrary", "", "+");
|
|
93
101
|
|
|
94
102
|
let organization;
|
|
95
103
|
let library;
|
|
@@ -203,20 +211,22 @@ export default async (options) => {
|
|
|
203
211
|
if (libVersionExists) {
|
|
204
212
|
if (overrideExisting) {
|
|
205
213
|
console.log("\nDeleting existing library " + chalk.bold.yellow(`${libraryName}:${version}`) + " ...");
|
|
214
|
+
addDebugLog("deleteLibVersion", `services call: libraryName: ${libraryName}, version: ${version}`, "");
|
|
206
215
|
await deleteLibVersion(libraryName, version, tokenAndStaticServer.C11NB2S, tokenAndStaticServer.appStaticContentServer);
|
|
207
|
-
|
|
216
|
+
addDebugLog("deleteLibVersion", "services end", "");
|
|
208
217
|
checkDeleted = true;
|
|
209
218
|
}
|
|
210
219
|
else {
|
|
211
220
|
// don't override, so end
|
|
212
221
|
console.log(chalk.yellow(`You will need to increment your library version to publish`));
|
|
222
|
+
addDebugLog("publishLibrary", "END", "-");
|
|
213
223
|
return;
|
|
214
224
|
}
|
|
215
225
|
}
|
|
216
226
|
|
|
217
227
|
// need a timeout to give services time to delete the library
|
|
218
|
-
setTimeout( function(){ publishNewLibraryAsync(libraryName, version, checkDeleted)}, 700 );
|
|
219
|
-
|
|
228
|
+
// setTimeout( function(){ await publishNewLibraryAsync(libraryName, version, checkDeleted)}, 700 );
|
|
229
|
+
await publishNewLibraryAsync(libraryName, version, checkDeleted);
|
|
220
230
|
}
|
|
221
231
|
|
|
222
232
|
}
|
|
@@ -225,7 +235,7 @@ export default async (options) => {
|
|
|
225
235
|
console.log(chalk.bold.redBright(`You need to build library ${libraryName} first.`));
|
|
226
236
|
}
|
|
227
237
|
|
|
228
|
-
|
|
238
|
+
addDebugLog("publishLibrary", "END", "-");
|
|
229
239
|
|
|
230
240
|
return true;
|
|
231
241
|
};
|