@pega/custom-dx-components 0.25.17 → 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/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
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
|
|