@barcidev/ngx-autogen 0.1.34 → 0.1.35

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.34",
3
+ "version": "0.1.35",
4
4
  "description": "A collection of Angular schematics for essential functionalities.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@angular-devkit/core": "^21.2.0",
52
52
  "@angular-devkit/schematics": "^21.2.0",
53
- "@barcidev/typed-transloco": "^0.0.11",
53
+ "@barcidev/typed-transloco": "^0.0.12",
54
54
  "@schematics/angular": "^21.2.0",
55
55
  "typescript": "~5.9.2"
56
56
  },
@@ -34,13 +34,9 @@ function transloco(options) {
34
34
  const finalOptions = Object.assign(Object.assign({}, options), { name: componentName, path: path, project: projectName, projectRoot: projectRoot });
35
35
  return (0, schematics_1.chain)([
36
36
  ensureExternalConfig(),
37
- () => {
38
- return (0, schematics_1.chain)([
39
- generateI18nFiles(finalOptions),
40
- updateAppI18nTypeRule(finalOptions),
41
- registerProviderInComponent(finalOptions, componentFile),
42
- ]);
43
- },
37
+ generateI18nFiles(finalOptions),
38
+ updateAppI18nTypeRule(finalOptions),
39
+ registerProviderInComponent(finalOptions, componentFile),
44
40
  ]);
45
41
  });
46
42
  }
@@ -86,7 +82,7 @@ function updateAppI18nTypeRule(options) {
86
82
  const camelName = schematics_1.strings.camelize(options.name);
87
83
  const i18nConstantName = `${camelName}I18n`;
88
84
  // Inyección de Import
89
- const importStatement = `import { ${i18nConstantName} } from '${options.path.replace("src/app/", "./")}/${schematics_1.strings.dasherize(options.name)}.i18n';\n`;
85
+ const importStatement = `import { ${i18nConstantName} } from '${options.path}/${schematics_1.strings.dasherize(options.name)}.i18n';\n`;
90
86
  if (!content.includes(i18nConstantName)) {
91
87
  content = importStatement + content;
92
88
  }
@@ -117,15 +113,23 @@ function registerProviderInComponent(options, componentFile) {
117
113
  return (tree) => tree;
118
114
  const componentPath = (0, path_1.join)(options.path, componentFile);
119
115
  const i18nConstantName = `${schematics_1.strings.camelize(options.name)}I18n`;
120
- return (0, file_actions_1.addProviderToStandaloneComponent)(componentPath, `provideTranslocoScopeWrapper(${i18nConstantName})`, [
121
- {
122
- symbol: "provideTranslocoScopeWrapper",
123
- path: "@barcidev/typed-transloco",
124
- },
125
- {
126
- symbol: i18nConstantName,
127
- path: `./${schematics_1.strings.dasherize(options.name)}.i18n`,
128
- },
116
+ return (0, schematics_1.chain)([
117
+ (0, file_actions_1.addProviderToStandaloneComponent)(componentPath, `provideTranslocoScopeWrapper(${i18nConstantName})`, [
118
+ {
119
+ symbol: "provideTranslocoScopeWrapper",
120
+ path: "@barcidev/typed-transloco",
121
+ },
122
+ {
123
+ symbol: i18nConstantName,
124
+ path: `./${schematics_1.strings.dasherize(options.name)}.i18n`,
125
+ },
126
+ ]),
127
+ (0, file_actions_1.addProviderToStandaloneComponent)(componentPath, "AppTypedTranslocoDirective", [
128
+ {
129
+ symbol: "AppTypedTranslocoDirective",
130
+ path: "@i18n/app-typed-transloco.directive",
131
+ },
132
+ ]),
129
133
  ]);
130
134
  }
131
135
  /**