@pega/custom-dx-components 0.25.16 → 0.25.18
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/tasks/build-lib/index.js +22 -5
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/localizations.json.mustache +10 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/localizations.json.mustache +5 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/localizations.json.mustache +8 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/localizations.json.mustache +10 -0
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/tasks/publish-lib/index.js +16 -4
package/package.json
CHANGED
|
@@ -20,7 +20,8 @@ import {
|
|
|
20
20
|
getConfigDevBuild,
|
|
21
21
|
checkJWTExpiration,
|
|
22
22
|
getConfigDefaults,
|
|
23
|
-
getLibraryBased
|
|
23
|
+
getLibraryBased,
|
|
24
|
+
getLibraryBasedCL
|
|
24
25
|
} from '../../util.js';
|
|
25
26
|
import bundleComponent from '../bundle/index.js';
|
|
26
27
|
|
|
@@ -56,6 +57,7 @@ addDebugLog("localBuildLibrary", `organization: ${organization}, library: ${libr
|
|
|
56
57
|
const components = await getComponents();
|
|
57
58
|
const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
|
|
58
59
|
const currentOrgLib = organization.concat('_').concat(library);
|
|
60
|
+
const isLibraryBasedCL = getLibraryBasedCL();
|
|
59
61
|
|
|
60
62
|
if (tokenAndStaticServer.C11NB2S === undefined) {
|
|
61
63
|
console.log(
|
|
@@ -102,6 +104,8 @@ addDebugLog("localBuildLibrary", `organization: ${organization}, library: ${libr
|
|
|
102
104
|
// compile to see if any errors, as buildLib doesn't catch all errors.
|
|
103
105
|
// Turning off stats (last param), so won't show warnings, as
|
|
104
106
|
// warnings are part of buildLib
|
|
107
|
+
|
|
108
|
+
// for now
|
|
105
109
|
console.log(chalk.green.bold('Compile check...'));
|
|
106
110
|
await bundleComponent(components[0], null, devBuild, false);
|
|
107
111
|
console.log('');
|
|
@@ -122,10 +126,23 @@ addDebugLog("buildLib", "services call", "");
|
|
|
122
126
|
// tokenAndStaticServer.appStaticContentServer
|
|
123
127
|
// );
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
if (isLibraryBasedCL) {
|
|
130
|
+
buildLibV3(
|
|
131
|
+
buildLibName,
|
|
132
|
+
buildVersion
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
buildLib(
|
|
137
|
+
buildLibName,
|
|
138
|
+
buildVersion,
|
|
139
|
+
tokenAndStaticServer.C11NB2S,
|
|
140
|
+
tokenAndStaticServer.appStaticContentServer
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
129
146
|
addDebugLog("buildLib", "services end", "");
|
|
130
147
|
|
|
131
148
|
}
|
package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/localizations.json.mustache
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fields": {
|
|
3
|
+
"State name" : "State name",
|
|
4
|
+
"State code" : "State code",
|
|
5
|
+
"State list for": "State list for",
|
|
6
|
+
"Click to show/hide state list": "Click to show/hide state list",
|
|
7
|
+
"State list": "State list",
|
|
8
|
+
"Loading state list": "Loading state list"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@babel/preset-react": "^7.26.3",
|
|
107
107
|
"@babel/preset-typescript": "^7.26.0",
|
|
108
108
|
"@pega/configs": "^0.16.2",
|
|
109
|
-
"@pega/custom-dx-components": "~0.25.
|
|
109
|
+
"@pega/custom-dx-components": "~0.25.18",
|
|
110
110
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
111
111
|
"@storybook/addon-actions": "^7.6.19",
|
|
112
112
|
"@storybook/addon-essentials": "^7.6.19",
|
|
@@ -70,7 +70,9 @@ export const zipLibraryComponent = async (libraryName, version) => {
|
|
|
70
70
|
const currentDirectory = process.cwd();
|
|
71
71
|
const libraryDirName = `${libraryName}/${version}`;
|
|
72
72
|
const libraryDirectory = path.join(currentDirectory, libraryDirName);
|
|
73
|
-
const componentsConfigJson =
|
|
73
|
+
const componentsConfigJson = path.join(libraryDirectory, "componentsconfig.json");
|
|
74
|
+
// const componentsConfigJson = `${libraryDirectory}/componentsconfig.json`;
|
|
75
|
+
const localizationsJson = path.join(libraryDirectory, "componentslocalization.json");
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
@@ -85,6 +87,11 @@ export const zipLibraryComponent = async (libraryName, version) => {
|
|
|
85
87
|
archive.file(componentsConfigJson, { name: path.basename(componentsConfigJson) });
|
|
86
88
|
}
|
|
87
89
|
|
|
90
|
+
// Add localizations file
|
|
91
|
+
if (fs.existsSync(localizationsJson)) {
|
|
92
|
+
archive.file(localizationsJson, { name: path.basename(localizationsJson) });
|
|
93
|
+
}
|
|
94
|
+
|
|
88
95
|
|
|
89
96
|
await archive.finalize();
|
|
90
97
|
|
|
@@ -93,6 +100,10 @@ export const zipLibraryComponent = async (libraryName, version) => {
|
|
|
93
100
|
const zipContent = zipBuffer.toString('base64');
|
|
94
101
|
|
|
95
102
|
const configContent = Buffer.from(fs.readFileSync(componentsConfigJson)).toString();
|
|
103
|
+
let localizationsContent = "[]";
|
|
104
|
+
if (fs.existsSync(localizationsJson)) {
|
|
105
|
+
localizationsContent = Buffer.from(fs.readFileSync(localizationsJson)).toString();
|
|
106
|
+
}
|
|
96
107
|
|
|
97
108
|
// if (fs.existsSync(libraryDirectory)) {
|
|
98
109
|
// fs.rm(libraryDirectory, { recursive: true }, err => {
|
|
@@ -102,13 +113,13 @@ export const zipLibraryComponent = async (libraryName, version) => {
|
|
|
102
113
|
// });
|
|
103
114
|
// }
|
|
104
115
|
|
|
105
|
-
return { zipContent, configContent };
|
|
116
|
+
return { zipContent, configContent, localizationsContent};
|
|
106
117
|
};
|
|
107
118
|
|
|
108
119
|
|
|
109
120
|
export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
110
121
|
addDebugLog("publishComponentToServer", `data: ${data}`, "");
|
|
111
|
-
const { configContent, zipContent, rulesetName, rulesetVersion, libraryName, version } = data;
|
|
122
|
+
const { configContent, zipContent, localizationsContent, rulesetName, rulesetVersion, libraryName, version } = data;
|
|
112
123
|
|
|
113
124
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
114
125
|
const { serverType, isolationId } = defaultPegaServerConfig;
|
|
@@ -138,7 +149,8 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
|
|
|
138
149
|
rulesetVersion,
|
|
139
150
|
libraryName,
|
|
140
151
|
version,
|
|
141
|
-
category: ''
|
|
152
|
+
category: '',
|
|
153
|
+
localizationsContent
|
|
142
154
|
};
|
|
143
155
|
}
|
|
144
156
|
|