@barcidev/ngx-autogen 0.1.45 → 0.1.47

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.45",
3
+ "version": "0.1.47",
4
4
  "description": "A collection of Angular schematics for essential functionalities.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -23,7 +23,10 @@ function component(options) {
23
23
  return (0, schematics_1.chain)([
24
24
  generateComponentFiles(context),
25
25
  options.i18n.toLowerCase() === "yes"
26
- ? (0, schematics_1.schematic)("app-i18n", { name: context.options.name })
26
+ ? (0, schematics_1.schematic)("app-i18n", {
27
+ name: context.options.name,
28
+ path: (0, path_1.join)(context.movePath, context.nameDash),
29
+ })
27
30
  : (0, schematics_1.noop)(),
28
31
  options.store.toLowerCase() === "yes"
29
32
  ? (0, schematics_1.schematic)("app-store", { name: context.options.name })
@@ -138,9 +138,10 @@ function registerProviderInComponent(options, componentFile) {
138
138
  function resolveComponentContext(tree, options) {
139
139
  const fullPath = process.cwd();
140
140
  const srcIndex = fullPath.lastIndexOf("src");
141
- const path = (0, path_1.normalize)(srcIndex !== -1
142
- ? fullPath.substring(srcIndex)
143
- : (0, path_1.join)((0, path_1.normalize)("src"), "app"));
141
+ const path = options.path ||
142
+ (0, path_1.normalize)(srcIndex !== -1
143
+ ? fullPath.substring(srcIndex)
144
+ : (0, path_1.join)((0, path_1.normalize)("src"), "app"));
144
145
  const directory = tree.getDir(path);
145
146
  const componentFile = directory.subfiles.find((f) => f.endsWith(".component.ts")) ||
146
147
  directory.subfiles.find((f) => f.endsWith(".ts"));