@madgex/fert 4.2.5 → 4.2.6

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.
@@ -157,7 +157,8 @@ const updateProjectConfigs = async (
157
157
  const { toRemove, toSet } = collateConfigs(api, localConfigs);
158
158
 
159
159
  spinner.text = 'Updating configs…';
160
- await Promise.all([removeConfigs(api, toRemove), setConfigs(api, toSet)]);
160
+ await setConfigs(api, toSet, spinner);
161
+ await removeConfigs(api, toRemove, spinner);
161
162
 
162
163
  const { host } = new URL(api.options.apiUrl);
163
164
  spinner.succeed(`Project configs applied to ${chalk.bold(host)}`);
@@ -226,24 +227,28 @@ const getUnsetKeysWithDefaults = (defaults = {}, config = {}) => {
226
227
  return diff;
227
228
  };
228
229
 
229
- const removeConfigs = async (api, toRemove) => {
230
+ const removeConfigs = async (api, toRemove, spinner) => {
230
231
  const deletePromises = Object.entries(toRemove).flatMap(
231
232
  ([configName, keys]) =>
232
- keys.map((key) =>
233
- api.deleteConfig(configName, key).catch((error) => {
233
+ keys.map(async (key) => {
234
+ try {
235
+ await api.deleteConfig(configName, key);
236
+ spinner.text = `Removed key ${chalk.bold(key)} from config: ${chalk.bold(configName)}`;
237
+ } catch (error) {
234
238
  log.error('Failed to remove config', { configName, key, error });
235
- })
236
- )
239
+ }
240
+ })
237
241
  );
238
242
 
239
243
  await Promise.all(deletePromises);
240
244
  };
241
245
 
242
- const setConfigs = async (api, toSet) => {
246
+ const setConfigs = async (api, toSet, spinner) => {
243
247
  const setPromises = Object.entries(toSet).flatMap(([configName, config]) =>
244
248
  Object.entries(config).map(async ([key, value]) => {
245
249
  try {
246
250
  await api.setConfig(configName, key, value);
251
+ spinner.text = `Set key ${chalk.bold(key)} for config: ${chalk.bold(configName)}`;
247
252
  } catch (error) {
248
253
  log.error('Failed to set config', { configName, key, value, error });
249
254
  }
@@ -252,6 +257,7 @@ const setConfigs = async (api, toSet) => {
252
257
 
253
258
  await Promise.all(setPromises);
254
259
  };
260
+
255
261
  module.exports = {
256
262
  getConfigAPI,
257
263
  validateLocalConfigs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madgex/fert",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "description": "Tool to help build the V6 branding",
5
5
  "bin": {
6
6
  "fert": "./bin/cli.js"