awc-zns-mtd 2.6.1 → 2.6.2

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,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "awc-zns-mtd",
4
- "version": "2.6.1",
4
+ "version": "2.6.2",
5
5
  "description": "AWC ZNS-MTD Method - Metodología de Transformación Digital Zen, Neutro y Sistemático",
6
6
  "keywords": [
7
7
  "awc",
@@ -4,7 +4,7 @@
4
4
 
5
5
  module_name: "AWC ZNS-MTD Method"
6
6
  module_code: "awc-zns-mtd"
7
- version: "2.6.1"
7
+ version: "2.6.2"
8
8
  author: "AWC Team"
9
9
  description: "Metodología de Transformación Digital - Zen, Neutro, Sistemático"
10
10
 
@@ -44,29 +44,39 @@ async function createConfigFile(awcDir, config) {
44
44
  }
45
45
 
46
46
  /**
47
- * Carga configuración desde archivo YAML
47
+ * Carga configuración desde archivo JSON o YAML
48
48
  */
49
49
  async function loadConfig(awcDir) {
50
- const configPath = path.join(awcDir, 'config.yaml');
51
-
52
- if (!(await fs.pathExists(configPath))) {
53
- return null;
50
+ // Intentar primero JSON (usado por awc new)
51
+ const configJsonPath = path.join(awcDir, 'config.json');
52
+ if (await fs.pathExists(configJsonPath)) {
53
+ try {
54
+ return await fs.readJson(configJsonPath);
55
+ } catch (error) {
56
+ console.error('Error al cargar config.json:', error.message);
57
+ }
54
58
  }
55
59
 
56
- try {
57
- const content = await fs.readFile(configPath, 'utf8');
58
- return yaml.load(content);
59
- } catch (error) {
60
- console.error('Error al cargar configuración:', error.message);
61
- return null;
60
+ // Fallback a YAML (compatibilidad)
61
+ const configYamlPath = path.join(awcDir, 'config.yaml');
62
+ if (await fs.pathExists(configYamlPath)) {
63
+ try {
64
+ const content = await fs.readFile(configYamlPath, 'utf8');
65
+ return yaml.load(content);
66
+ } catch (error) {
67
+ console.error('Error al cargar config.yaml:', error.message);
68
+ }
62
69
  }
70
+
71
+ return null;
63
72
  }
64
73
 
65
74
  /**
66
- * Actualiza configuración existente
75
+ * Actualiza configuración existente (JSON)
67
76
  */
68
77
  async function updateConfig(awcDir, newConfig) {
69
- await createConfigFile(awcDir, newConfig);
78
+ const configPath = path.join(awcDir, 'config.json');
79
+ await fs.writeJson(configPath, newConfig, { spaces: 2 });
70
80
  }
71
81
 
72
82
  /**