@barcidev/ngx-autogen 0.1.30 → 0.1.31

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.30",
3
+ "version": "0.1.31",
4
4
  "description": "A collection of Angular schematics for essential functionalities.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,6 +19,7 @@ const file_actions_1 = require("../common/file-actions");
19
19
  const pluralize_1 = require("../common/pluralize");
20
20
  function transloco(options) {
21
21
  return (tree) => __awaiter(this, void 0, void 0, function* () {
22
+ var _a;
22
23
  const workspace = yield (0, workspace_1.getWorkspace)(tree);
23
24
  // 1. Configuración de Proyecto y Roots
24
25
  const projectName = options.project ||
@@ -32,7 +33,13 @@ function transloco(options) {
32
33
  const { path, componentFile, componentName } = resolveComponentContext(tree, options);
33
34
  // Sincronizamos las opciones normalizadas
34
35
  const finalOptions = Object.assign(Object.assign({}, options), { name: componentName, path: path, project: projectName, projectRoot: projectRoot });
36
+ // 3. Verificación de Provider Existente
37
+ const appConfigPath = "src/app/app.config.ts";
38
+ const appConfigContent = ((_a = tree.read(appConfigPath)) === null || _a === void 0 ? void 0 : _a.toString()) || "";
35
39
  return (0, schematics_1.chain)([
40
+ !appConfigContent.includes("provideTransloco")
41
+ ? (0, schematics_1.externalSchematic)("@barcidev/typed-transloco", "ng-add", {})
42
+ : (tree) => tree,
36
43
  generateI18nFiles(finalOptions),
37
44
  updateAppI18nTypeRule(finalOptions),
38
45
  registerProviderInComponent(finalOptions, componentFile),