@pega/dx-component-builder-sdk 0.1.33 → 0.1.34
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
|
@@ -19,7 +19,7 @@ import { PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH, COMPONENT_SCHEMA,
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
export const cleanUp = async () => {
|
|
22
|
-
fs.rm('dist', { recursive: true }, err => {
|
|
22
|
+
fs.rm('dist/components', { recursive: true }, err => {
|
|
23
23
|
if (err) {
|
|
24
24
|
throw err;
|
|
25
25
|
}
|
|
@@ -92,10 +92,10 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
|
|
|
92
92
|
const zipContent = zip.toBuffer().toString('base64');
|
|
93
93
|
|
|
94
94
|
const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
|
|
95
|
-
fs.rmd('dist', { recursive: true }, err => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
95
|
+
// fs.rmd('dist/components', { recursive: true }, err => {
|
|
96
|
+
// if (err) {
|
|
97
|
+
// throw err;
|
|
98
|
+
// }
|
|
99
|
+
// });
|
|
100
100
|
return { zipContent, configContent };
|
|
101
101
|
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { COMPONENT_SCHEMA, CATEGORY_CUSTOM } from '../../constants.js';
|
|
14
14
|
|
|
15
15
|
export const cleanUp = async () => {
|
|
16
|
-
fs.rm('dist', { recursive: true }, err => {
|
|
16
|
+
fs.rm('dist/components', { recursive: true }, err => {
|
|
17
17
|
if (err) {
|
|
18
18
|
throw err;
|
|
19
19
|
}
|
|
@@ -75,10 +75,10 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
|
|
|
75
75
|
const zipContent = zip.toBuffer().toString('base64');
|
|
76
76
|
|
|
77
77
|
const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
|
|
78
|
-
fs.rmd('dist', { recursive: true }, err => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
78
|
+
// fs.rmd('dist/components', { recursive: true }, err => {
|
|
79
|
+
// if (err) {
|
|
80
|
+
// throw err;
|
|
81
|
+
// }
|
|
82
|
+
// });
|
|
83
83
|
return { zipContent, configContent };
|
|
84
84
|
};
|
|
@@ -11,27 +11,7 @@ import { getComponentDirectoryPath, showVersion, getOptionsCategory, getComponen
|
|
|
11
11
|
|
|
12
12
|
import { CATEGORY_CUSTOM } from '../../constants.js';
|
|
13
13
|
|
|
14
|
-
export
|
|
15
|
-
showVersion();
|
|
16
|
-
|
|
17
|
-
const catQuestion = await getBuildCategory(options);
|
|
18
|
-
const catAnwers = await inquirer.prompt(catQuestion);
|
|
19
|
-
|
|
20
|
-
let category = catAnwers.category;
|
|
21
|
-
if (category == null) {
|
|
22
|
-
category = getOptionsCategory(options);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const components = await getComponentsObj(false, category);
|
|
26
|
-
const questions = await getBuildComponentQuestions(category);
|
|
27
|
-
const answers = await inquirer.prompt(questions);
|
|
28
|
-
const { sourceMap, devBuild } = answers;
|
|
29
|
-
|
|
30
|
-
let content = {
|
|
31
|
-
...answers
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var componentKey;
|
|
14
|
+
export function getCustomTasks(componentKey, category, sourceMap, devBuild, content, options) {
|
|
35
15
|
|
|
36
16
|
const customTasks = new Listr(
|
|
37
17
|
[
|
|
@@ -71,6 +51,12 @@ export default async options => {
|
|
|
71
51
|
}
|
|
72
52
|
);
|
|
73
53
|
|
|
54
|
+
return customTasks;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
export function getOverrideTasks(componentKey, category, sourceMap, devBuild, content, options) {
|
|
59
|
+
|
|
74
60
|
const overrideTasks = new Listr(
|
|
75
61
|
[
|
|
76
62
|
{
|
|
@@ -97,12 +83,40 @@ export default async options => {
|
|
|
97
83
|
}
|
|
98
84
|
);
|
|
99
85
|
|
|
86
|
+
return overrideTasks;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export default async options => {
|
|
90
|
+
showVersion();
|
|
91
|
+
|
|
92
|
+
const catQuestion = await getBuildCategory(options);
|
|
93
|
+
const catAnwers = await inquirer.prompt(catQuestion);
|
|
94
|
+
|
|
95
|
+
let category = catAnwers.category;
|
|
96
|
+
if (category == null) {
|
|
97
|
+
category = getOptionsCategory(options);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const components = await getComponentsObj(false, category);
|
|
101
|
+
const questions = await getBuildComponentQuestions(category);
|
|
102
|
+
const answers = await inquirer.prompt(questions);
|
|
103
|
+
const { sourceMap, devBuild } = answers;
|
|
104
|
+
|
|
105
|
+
let content = {
|
|
106
|
+
...answers
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
var componentKey;
|
|
110
|
+
|
|
100
111
|
|
|
101
112
|
if (category === CATEGORY_CUSTOM) {
|
|
102
113
|
for (var index in components) {
|
|
103
114
|
componentKey = components[index].value;
|
|
104
115
|
console.log(chalk.bold.green("Building: " + components[index].name));
|
|
105
|
-
|
|
116
|
+
|
|
117
|
+
let myCustomTasks = getCustomTasks(componentKey, category, sourceMap, devBuild, content, options);
|
|
118
|
+
|
|
119
|
+
await myCustomTasks.run().catch(err => {
|
|
106
120
|
console.log(chalk.bold.red(err.toString()));
|
|
107
121
|
});
|
|
108
122
|
}
|
|
@@ -111,7 +125,10 @@ export default async options => {
|
|
|
111
125
|
for (var index in components) {
|
|
112
126
|
componentKey = components[index].value;
|
|
113
127
|
console.log(chalk.bold.green("Building: " + components[index].name));
|
|
114
|
-
|
|
128
|
+
|
|
129
|
+
let myOverrideTasks = getOverrideTasks(componentKey, category, sourceMap, devBuild, content, options);
|
|
130
|
+
|
|
131
|
+
await mOverrideTasks.run().catch(err => {
|
|
115
132
|
console.log(chalk.bold.red(err.toString()));
|
|
116
133
|
});
|
|
117
134
|
}
|
|
@@ -138,7 +138,7 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
|
|
|
138
138
|
let configContent = "{ }";
|
|
139
139
|
if (category === CATEGORY_CUSTOM || category === CATEGORY_CONSTELLATION) {
|
|
140
140
|
configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
|
|
141
|
-
fs.rmdir('dist', { recursive: true }, err => {
|
|
141
|
+
fs.rmdir('dist/components', { recursive: true }, err => {
|
|
142
142
|
if (err) {
|
|
143
143
|
throw err;
|
|
144
144
|
}
|
|
@@ -152,7 +152,7 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
|
|
|
152
152
|
else {
|
|
153
153
|
if (fs.existsSync(configExtJson)) {
|
|
154
154
|
configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config-ext.json`)).toString();
|
|
155
|
-
fs.rmdir('dist', { recursive: true }, err => {
|
|
155
|
+
fs.rmdir('dist/components', { recursive: true }, err => {
|
|
156
156
|
if (err) {
|
|
157
157
|
throw err;
|
|
158
158
|
}
|
|
@@ -162,7 +162,7 @@ export const zipComponent = async (componentKey, category = CATEGORY_CUSTOM) =>
|
|
|
162
162
|
};
|
|
163
163
|
|
|
164
164
|
export const cleanUp = async () => {
|
|
165
|
-
fs.rm('dist', { recursive: true }, err => {
|
|
165
|
+
fs.rm('dist/components', { recursive: true }, err => {
|
|
166
166
|
if (err) {
|
|
167
167
|
throw err;
|
|
168
168
|
}
|