@pega/custom-dx-components 26.1.10-alpha-0.3 → 26.1.10-alpha-0.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "26.1.10-alpha-0.3",
3
+ "version": "26.1.10-alpha-0.4",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "keywords": [
package/src/constants.js CHANGED
@@ -22,7 +22,7 @@ export const ARCHIVES_PATH = 'store';
22
22
  export const BIN_ARCHIVES_PATH = 'bin-arch';
23
23
  export const TEMP_PATH = 'store/temp';
24
24
  export const COMPONENTS_CONFIG_FILE_NAME = 'componentsconfig.json';
25
- export const MAX_RFT_CHARS = 64;
25
+ export const MAX_RFT_CHARS = 256;
26
26
 
27
27
  /* REST end points */
28
28
  export const PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT = 'PRRestService/dev/v1/publish_component';
@@ -81,6 +81,7 @@ export const zipLibraryComponent = async (libraryName, version) => {
81
81
  const componentsConfigJson = path.join(libraryDirectory, 'componentsconfig.json');
82
82
  // const componentsConfigJson = `${libraryDirectory}/componentsconfig.json`;
83
83
  const localizationsJson = path.join(libraryDirectory, 'componentslocalization.json');
84
+ const manifestJson = path.join(libraryDirectory, 'manifest.json');
84
85
 
85
86
  const archive = archiver('zip', { zlib: { level: 9 } });
86
87
  const zipChunks = [];
@@ -104,6 +105,11 @@ export const zipLibraryComponent = async (libraryName, version) => {
104
105
  archive.file(localizationsJson, { name: path.basename(localizationsJson) });
105
106
  }
106
107
 
108
+ // Add manifest file
109
+ if (fs.existsSync(manifestJson)) {
110
+ archive.file(manifestJson, { name: path.basename(manifestJson) });
111
+ }
112
+
107
113
  await archive.finalize();
108
114
 
109
115
  const zipBuffer = Buffer.concat(zipChunks);
@@ -116,16 +122,21 @@ export const zipLibraryComponent = async (libraryName, version) => {
116
122
  localizationsContent = Buffer.from(fs.readFileSync(localizationsJson)).toString();
117
123
  }
118
124
 
125
+ let manifestContent = '';
126
+ if (fs.existsSync(manifestJson)) {
127
+ manifestContent = Buffer.from(fs.readFileSync(manifestJson)).toString();
128
+ }
129
+
119
130
  // Collect SVG files from all components in the source directory
120
131
  const srcComponentsDir = path.join(currentDirectory, 'src', 'components');
121
132
  const svgContent = await collectAllComponentSvgFiles(srcComponentsDir);
122
133
 
123
- return { zipContent, configContent, localizationsContent, svgContent };
134
+ return { zipContent, configContent, localizationsContent, svgContent, manifestContent };
124
135
  };
125
136
 
126
137
  export const publishComponentLibraryToServer = async (data, doFetch) => {
127
138
  addDebugLog('publishComponentToServer', `data: ${data}`, '');
128
- const { configContent, zipContent, localizationsContent, svgContent, rulesetName, rulesetVersion, libraryName, version } = data;
139
+ const { configContent, zipContent, localizationsContent, svgContent, rulesetName, rulesetVersion, libraryName, version, manifestContent } = data;
129
140
 
130
141
  const defaultPegaServerConfig = await getPegaServerConfig();
131
142
  const { serverType, isolationId } = defaultPegaServerConfig;
@@ -146,7 +157,8 @@ export const publishComponentLibraryToServer = async (data, doFetch) => {
146
157
  version,
147
158
  category: '',
148
159
  localizationsContent,
149
- svgContent: svgContent || []
160
+ svgContent: svgContent || [],
161
+ manifestContent
150
162
  };
151
163
  }
152
164