@barcidev/ngx-autogen 0.1.13 → 0.1.14

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": "@barcidev/ngx-autogen",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "A collection of Angular schematics for essential functionalities.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -32,13 +32,15 @@ function transloco(options) {
32
32
  if (!project) {
33
33
  throw new schematics_1.SchematicsException(`El proyecto "${options.project}" no existe.`);
34
34
  }
35
- // 2. Detección automática del componente en la ruta actual
35
+ // 3. Determinación de rutas para generación de archivos
36
36
  const fullPath = process.cwd();
37
- const relativeExecutionPath = fullPath
38
- .replace(process.cwd(), "")
39
- .replace(/\\/g, "/");
40
- const directory = tree.getDir((0, path_1.normalize)(relativeExecutionPath));
41
- console.log(`🔍 Buscando componente en: ${relativeExecutionPath}`);
37
+ const srcIndex = fullPath.lastIndexOf("src");
38
+ const relativePath = srcIndex !== -1
39
+ ? fullPath.substring(srcIndex)
40
+ : (0, path_1.join)((0, path_1.normalize)("src"), "app");
41
+ options.path = (0, path_1.normalize)(relativePath);
42
+ const directory = tree.getDir((0, path_1.normalize)(options.path));
43
+ console.log(`🔍 Buscando componente en: ${options.path}`);
42
44
  const componentFile = directory.subfiles.find((file) => file.endsWith(".component.ts"));
43
45
  console.log(`📄 Componente detectado: ${componentFile || "Ninguno"}`);
44
46
  if (!componentFile && !options.name) {
@@ -49,12 +51,6 @@ function transloco(options) {
49
51
  : options.name;
50
52
  options.name = componentFileName;
51
53
  console.log(`✅ Nombre del componente para i18n: ${options.name}`);
52
- // 3. Determinación de rutas para generación de archivos
53
- const srcIndex = fullPath.lastIndexOf("src");
54
- const relativePath = srcIndex !== -1
55
- ? fullPath.substring(srcIndex)
56
- : (0, path_1.join)((0, path_1.normalize)("src"), "app");
57
- options.path = (0, path_1.normalize)(relativePath);
58
54
  console.log(`📂 Ruta de generación de archivos i18n: ${options.path}`);
59
55
  const namePath = options.path; // Generamos archivos en la misma carpeta del componente detectado
60
56
  const rules = [];