@pega/custom-dx-components 0.242.52 → 0.242.53

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.52",
3
+ "version": "0.242.53",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -51,7 +51,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
51
51
  configData.version = version;
52
52
 
53
53
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
54
- fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
54
+ fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
55
55
 
56
56
  };
57
57
 
@@ -69,7 +69,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
69
69
  if (fileData.indexOf(oldComponentKeyPC) >= 0) {
70
70
  fileData = fileData.replaceAll(oldComponentKeyPC, newComponentKeyPC);
71
71
 
72
- fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8' });
72
+ fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8', flag:'w' });
73
73
  }
74
74
 
75
75
  };
@@ -139,6 +139,25 @@ addDebugLog("exportArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName},
139
139
  }
140
140
  }
141
141
 
142
+ if (fs.existsSync(exportFile)) {
143
+ console.log(`\nFile: ${chalk.yellow(`${fileName}`)} already exists in ${chalk.yellow(`${exportPath}`)}.`);
144
+ const overwriteQuestion = await inquirer.prompt([
145
+ {
146
+ name: 'overWriteFile',
147
+ type: 'confirm',
148
+ message: 'Overrwrite',
149
+ default: true
150
+ },
151
+ ]);
152
+
153
+ if (!overwriteQuestion.overWriteFile) {
154
+ console.log(chalk.green("Store not exported."));
155
+ process.exit();
156
+ }
157
+ }
158
+
159
+
160
+
142
161
  if (archiveBeforeStore) {
143
162
  // archive it
144
163
  output = await zipVersionAndArchive(configDef.currentOrgLib, configDef.buildVersion);
@@ -25,7 +25,7 @@ addDebugLog("setTasksConfig", `libraryName: ${libraryName}, version: ${version},
25
25
 
26
26
  // update file
27
27
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
28
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
28
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
29
29
  }
30
30
 
31
31
  export const setPackageOrg = async (organization, currDir) => {
@@ -38,7 +38,7 @@ addDebugLog("setPackageOrg", "", "");
38
38
 
39
39
  // update file
40
40
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
41
- fs.writeFileSync(packageJsonPath, JSON.stringify(packageData, null, 4), { encoding: 'utf8' });
41
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageData, null, 4), { encoding: 'utf8',flag:'w' });
42
42
 
43
43
  }
44
44
 
@@ -65,7 +65,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
65
65
  configData.version = version;
66
66
 
67
67
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
68
- fs.writeFileSync(join(currentDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
68
+ fs.writeFileSync(join(currentDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
69
69
 
70
70
  };
71
71
 
@@ -83,7 +83,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
83
83
  if (fileData.indexOf(oldComponentKeyPC) >= 0) {
84
84
  fileData = fileData.replaceAll(oldComponentKeyPC, newComponentKeyPC);
85
85
 
86
- fs.writeFileSync(join(currentDirectory, "/", fileName), fileData, { encoding: 'utf8' });
86
+ fs.writeFileSync(join(currentDirectory, "/", fileName), fileData, { encoding: 'utf8',flag:'w' });
87
87
  }
88
88
 
89
89
  };
@@ -65,7 +65,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
65
65
  configData.version = version;
66
66
 
67
67
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
68
- fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
68
+ fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
69
69
 
70
70
  };
71
71
 
@@ -83,7 +83,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
83
83
  if (fileData.indexOf(oldComponentKeyPC) >= 0) {
84
84
  fileData = fileData.replaceAll(oldComponentKeyPC, newComponentKeyPC);
85
85
 
86
- fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8' });
86
+ fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8',flag:'w' });
87
87
  }
88
88
 
89
89
  };
@@ -134,11 +134,19 @@ export default async options => {
134
134
  task: () => initGit(options),
135
135
  enabled: () => options.git
136
136
  },
137
+ /*
137
138
  {
138
139
  title: installDependenciesText,
139
140
  task: () =>
140
141
  execPromise('npm i --force --production=false', { cwd: options.targetDirectory })
141
142
  },
143
+ */
144
+ {
145
+ title: installDependenciesText,
146
+ task: () =>
147
+ execPromise('npm i --force --dev', { cwd: options.targetDirectory })
148
+ },
149
+ /*
142
150
  {
143
151
  title: 'Installing tasks dependencies',
144
152
  task: () =>
@@ -151,6 +159,7 @@ export default async options => {
151
159
  cwd: options.componentLibraryUtilsDirectory
152
160
  })
153
161
  },
162
+ */
154
163
  {
155
164
  title: 'Updating',
156
165
  task: () => execPromise('npm update --dev', { cwd: options.targetDirectory })
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "devDependencies": {
102
102
  "@pega/configs": "^0.15.1",
103
- "@pega/custom-dx-components": "~0.242.52",
103
+ "@pega/custom-dx-components": "~0.242.53",
104
104
  "@pega/pcore-pconnect-typedefs": "~3.2.0-alpha.1",
105
105
  "@storybook/addon-actions": "^7.6.19",
106
106
  "@storybook/addon-essentials": "^7.6.19",
@@ -69,7 +69,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
69
69
  }
70
70
 
71
71
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
72
- fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
72
+ fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8', flag:'w' });
73
73
 
74
74
  };
75
75
 
@@ -87,7 +87,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
87
87
  if (fileData.indexOf(oldComponentKeyPC) >= 0) {
88
88
  fileData = fileData.replaceAll(oldComponentKeyPC, newComponentKeyPC);
89
89
 
90
- fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8' });
90
+ fs.writeFileSync(join(targetDirectory, "/", fileName), fileData, { encoding: 'utf8',flag:'w' });
91
91
  }
92
92
 
93
93
  };
@@ -77,7 +77,7 @@ addDebugLog("updateConfig", "", "");
77
77
 
78
78
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
79
79
  fs.writeFileSync(join(targetDirectory, '/config.json'), JSON.stringify(configData, null, 4), {
80
- encoding: 'utf8'
80
+ encoding: 'utf8',flag:'w'
81
81
  });
82
82
  };
83
83
 
@@ -94,7 +94,7 @@ addDebugLog("updateFile", "", "");
94
94
  if (fileData.indexOf(oldComponentKeyPC) >= 0) {
95
95
  fileData = fileData.replaceAll(oldComponentKeyPC, newComponentKeyPC);
96
96
 
97
- fs.writeFileSync(join(targetDirectory, '/', fileName), fileData, { encoding: 'utf8' });
97
+ fs.writeFileSync(join(targetDirectory, '/', fileName), fileData, { encoding: 'utf8',flag:'w' });
98
98
  }
99
99
  };
100
100
 
package/src/util.js CHANGED
@@ -256,7 +256,7 @@ if (showDebug) addDebugLog("updateUseWebPackPromotion", "", "");
256
256
 
257
257
  data["usePromotedWebPack"] = useValue;
258
258
 
259
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8' });
259
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
260
260
 
261
261
  }
262
262
 
@@ -355,7 +355,7 @@ if (showDebug) addDebugLog("setLibraryBased", "", "");
355
355
  // update file
356
356
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
357
357
  try {
358
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8' });
358
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
359
359
  }
360
360
  catch (err) {
361
361
  console.error(err);
@@ -638,7 +638,7 @@ if (showDebug) addDebugLog("updateServerConfigRuleSetAndVersion", `rulesetName:
638
638
 
639
639
  // update file
640
640
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
641
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
641
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
642
642
 
643
643
  }
644
644
 
@@ -654,7 +654,7 @@ if (showDebug) addDebugLog("updateComponentDefaultLibrary", `library: ${library}
654
654
  componentsDefault.library = library;
655
655
 
656
656
 
657
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8' });
657
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8',flag:'w' });
658
658
 
659
659
  }
660
660
 
@@ -670,7 +670,7 @@ if (showDebug) addDebugLog("updateComponentDefaultVersion", `version: ${version}
670
670
  componentsDefault.version = version;
671
671
 
672
672
 
673
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8' });
673
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8',flag:'w' });
674
674
 
675
675
  }
676
676
 
@@ -693,7 +693,7 @@ if (showDebug) addDebugLog("setConfigDevBuild", `devBuild: ${devBuild}`, "");
693
693
 
694
694
  // update file
695
695
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
696
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
696
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
697
697
  }
698
698
 
699
699
  export const setConfigImportRelativePath = async (importRelativePath) => {
@@ -705,7 +705,7 @@ if (showDebug) addDebugLog("setConfigImportRelativePath", `importRelativePath: $
705
705
 
706
706
  // update file
707
707
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
708
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
708
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
709
709
  }
710
710
 
711
711
  export const setConfigExportRelativePath = async (exportRelativePath) => {
@@ -717,7 +717,7 @@ if (showDebug) addDebugLog("setConfigImportRelativePath", `exportRelativePath: $
717
717
 
718
718
  // update file
719
719
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
720
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
720
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
721
721
  }
722
722
 
723
723
  export const updateDefaultOrganization = async (organization) => {
@@ -726,7 +726,7 @@ if (showDebug) addDebugLog("updateDefaultOrganization", `organization: ${organiz
726
726
 
727
727
  packageData.organization = organization;
728
728
 
729
- fs.writeFileSync(path.resolve('package.json'), JSON.stringify(packageData, null, 4), { encoding: 'utf8' });
729
+ fs.writeFileSync(path.resolve('package.json'), JSON.stringify(packageData, null, 4), { encoding: 'utf8',flag:'w' });
730
730
 
731
731
  }
732
732
 
@@ -805,7 +805,7 @@ if (showDebug) addDebugLog("updateConfigVersion", `componentKey: ${componentKey}
805
805
 
806
806
 
807
807
  // write back file
808
- fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8' });
808
+ fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
809
809
  };
810
810
 
811
811
  export const getServerType = () => {
@@ -827,7 +827,7 @@ if (showDebug) addDebugLog("setServerType", `serverType: ${serverType}`, "");
827
827
 
828
828
  // update file
829
829
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
830
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8' });
830
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
831
831
 
832
832
  // reset
833
833
  pegaData = null;
@@ -1206,7 +1206,7 @@ if (showDebug) addDebugLog("updateC11NB2SForInfinity", "", "");
1206
1206
  objOauthData["appStaticContentServer"] = bootstrap.serviceConfig.appStaticContentServer;
1207
1207
 
1208
1208
  // write out file
1209
- fs.writeFileSync(TOKEN_PATH, JSON.stringify(objOauthData), { encoding: 'utf8' });
1209
+ fs.writeFileSync(TOKEN_PATH, JSON.stringify(objOauthData), { encoding: 'utf8',flag:'w' });
1210
1210
  }
1211
1211
 
1212
1212
  }
@@ -1423,7 +1423,7 @@ if (showDebug) addDebugLog("createComponentsConfigFile", `filePath: ${filePath}`
1423
1423
  const compConfgFile = join(filePath, COMPONENTS_CONFIG_FILE_NAME);
1424
1424
 
1425
1425
  // write out file
1426
- fs.writeFileSync(compConfgFile, JSON.stringify(componentsConfigJSON), { encoding: 'utf8' });
1426
+ fs.writeFileSync(compConfgFile, JSON.stringify(componentsConfigJSON), { encoding: 'utf8',flag:'w' });
1427
1427
 
1428
1428
  };
1429
1429
 
@@ -1536,7 +1536,7 @@ if (showDebug) addDebugLog("updateComponentTaskConfig", "", "");
1536
1536
  originalContentsData["server-config"].devBuild = contentsData["server-config"].devBuild;
1537
1537
  originalContentsData["component"] = contentsData["component"];
1538
1538
 
1539
- fs.writeFileSync(currentConfigPath, JSON.stringify(originalContentsData, null, 4), { encoding: 'utf8' });
1539
+ fs.writeFileSync(currentConfigPath, JSON.stringify(originalContentsData, null, 4), { encoding: 'utf8',flag:'w' });
1540
1540
 
1541
1541
  }
1542
1542
 
@@ -1614,7 +1614,7 @@ if (showDebug) addDebugLog("restoreDependenciesFromPackage", "", "");
1614
1614
 
1615
1615
 
1616
1616
  // update current package json file
1617
- fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8' });
1617
+ fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8',flag:'w' });
1618
1618
 
1619
1619
 
1620
1620
  }