@pega/custom-dx-components 0.242.59 → 0.242.60

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": "0.242.59",
3
+ "version": "0.242.60",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -101,8 +101,11 @@ export const updateSavedExportFilePath = async(filePath) => {
101
101
  }
102
102
 
103
103
  if (filePath.indexOf(defaultPath) === 0) {
104
- // same starting path, so we can save the relative
105
- const relativePath = filePath.replace(defaultPath.concat(path.sep), "");
104
+ let relativePath = "";
105
+ if (filePath !== defaultPath) {
106
+ // same starting path, so we can save the relative
107
+ relativePath = filePath.replace(defaultPath.concat("/"), "");
108
+ }
106
109
 
107
110
  await setConfigExportRelativePath(relativePath);
108
111
  await forceDefaultsUpdate();
@@ -112,8 +115,13 @@ export const updateSavedExportFilePath = async(filePath) => {
112
115
  else {
113
116
  // mac
114
117
  if (filePath.indexOf(defaultPath) === 0) {
115
- // same starting path, so we can save the relative
116
- const relativePath = filePath.replace(defaultPath.concat("/"), "");
118
+
119
+ let relativePath = "";
120
+ if (filePath !== defaultPath) {
121
+ // same starting path, so we can save the relative
122
+ relativePath = filePath.replace(defaultPath.concat("/"), "");
123
+ }
124
+
117
125
 
118
126
  await setConfigExportRelativePath(relativePath);
119
127
  await forceDefaultsUpdate();
@@ -287,8 +287,12 @@ export const updateSavedFilePath = async(filePath) => {
287
287
  }
288
288
 
289
289
  if (filePath.indexOf(defaultPath) === 0) {
290
- // same starting path, so we can save the relative
291
- const relativePath = filePath.replace(defaultPath.concat(path.sep), "");
290
+
291
+ let relativePath = "";
292
+ if (filePath !== defaultPath) {
293
+ // same starting path, so we can save the relative
294
+ relativePath = filePath.replace(defaultPath.concat("/"), "");
295
+ }
292
296
 
293
297
  await setConfigImportRelativePath(relativePath);
294
298
  await forceDefaultsUpdate();
@@ -298,8 +302,12 @@ export const updateSavedFilePath = async(filePath) => {
298
302
  else {
299
303
  // mac
300
304
  if (filePath.indexOf(defaultPath) === 0) {
301
- // same starting path, so we can save the relative
302
- const relativePath = filePath.replace(defaultPath.concat("/"), "");
305
+
306
+ let relativePath = "";
307
+ if (filePath !== defaultPath) {
308
+ // same starting path, so we can save the relative
309
+ relativePath = filePath.replace(defaultPath.concat("/"), "");
310
+ }
303
311
 
304
312
  await setConfigImportRelativePath(relativePath);
305
313
  await forceDefaultsUpdate();
@@ -54,15 +54,40 @@ export const updateSavedFilePath = async(filePath) => {
54
54
 
55
55
  let defaultPath = join(path.sep, arPathParts[0], arPathParts[1], arPathParts[2]);
56
56
 
57
- if (filePath.indexOf(defaultPath) === 0) {
58
- // same starting path, so we can save the relative
59
- const relativePath = filePath.replace(defaultPath.concat("/"), "");
57
+ if (path.sep != "/") {
58
+ // windows
59
+ if (defaultPath.indexOf(path.sep) === 0) {
60
+ // if start with \\, then remove
61
+ defaultPath = defaultPath.substring(1);
62
+ }
63
+
64
+ if (filePath.indexOf(defaultPath) === 0) {
65
+
66
+ let relativePath = "";
67
+ if (filePath !== defaultPath) {
68
+ // same starting path, so we can save the relative
69
+ relativePath = filePath.replace(defaultPath.concat("/"), "");
70
+ }
60
71
 
61
- if (relativePath != configDef.importRelativePath) {
62
72
  await setConfigImportRelativePath(relativePath);
63
73
  await forceDefaultsUpdate();
74
+
64
75
  }
76
+ }
77
+ else {
78
+ // mac
79
+ if (filePath.indexOf(defaultPath) === 0) {
65
80
 
81
+ let relativePath = "";
82
+ if (filePath !== defaultPath) {
83
+ // same starting path, so we can save the relative
84
+ relativePath = filePath.replace(defaultPath.concat("/"), "");
85
+ }
66
86
 
87
+ await setConfigImportRelativePath(relativePath);
88
+ await forceDefaultsUpdate();
89
+
90
+ }
67
91
  }
92
+
68
93
  }
@@ -284,7 +284,7 @@ addDebugLog("getFolderList", `filePath: ${filePath}`, "");
284
284
  if (fs.existsSync(filePath)) {
285
285
  return fs
286
286
  .readdirSync(filePath, { withFileTypes: true })
287
- .filter(dirent => dirent.isDirectory())
287
+ .filter(dirent => dirent.isDirectory() && !dirent.name.startsWith("."))
288
288
  .map(dirent => dirent.name);
289
289
  }
290
290
  else {
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "devDependencies": {
103
103
  "@pega/configs": "^0.15.1",
104
- "@pega/custom-dx-components": "~0.242.59",
104
+ "@pega/custom-dx-components": "~0.242.60",
105
105
  "@pega/pcore-pconnect-typedefs": "3.2.1",
106
106
  "@storybook/addon-actions": "^7.6.19",
107
107
  "@storybook/addon-essentials": "^7.6.19",
package/src/util.js CHANGED
@@ -861,7 +861,7 @@ if (showDebug) addDebugLog("setConfigImportRelativePath", `importRelativePath: $
861
861
  }
862
862
 
863
863
  export const setConfigExportRelativePath = async (exportRelativePath) => {
864
- if (showDebug) addDebugLog("setConfigImportRelativePath", `exportRelativePath: ${exportRelativePath}`, "");
864
+ if (showDebug) addDebugLog("setConfigExportRelativePath", `exportRelativePath: ${exportRelativePath}`, "");
865
865
  const currentDirectory = process.cwd();
866
866
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
867
867
  let configData = await getPegaConfig(true);