@barcidev/ngx-autogen 0.1.2 → 0.1.3

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.2",
3
+ "version": "0.1.3",
4
4
  "description": "A collection of Angular schematics for essential functionalities.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -71,6 +71,7 @@ function updateAngularJson(tree, options) {
71
71
  workspace.schematics = {};
72
72
  workspace.schematics["@barcidev/ngx-autogen:all"] = {
73
73
  pk: options.pk,
74
+ path: options.path,
74
75
  };
75
76
  tree.overwrite(path, JSON.stringify(workspace, null, 2));
76
77
  }
@@ -1,3 +1,4 @@
1
1
  export interface NgAddSchemaOptions {
2
2
  pk: string;
3
+ path: string;
3
4
  }
@@ -8,7 +8,13 @@
8
8
  "description": "The name of the default Primary Key (e.g., id, cod, uuid); default is 'id'.",
9
9
  "x-prompt": "What is the name of the default Primary Key (e.g., id, cod, uuid)?",
10
10
  "default": "id"
11
+ },
12
+ "path": {
13
+ "type": "string",
14
+ "description": "The path where the state management files will be created.",
15
+ "x-prompt": "Where do you want to create the state management files?",
16
+ "default": "src/app/core"
11
17
  }
12
18
  },
13
- "required": ["pk"]
19
+ "required": ["pk", "path"]
14
20
  }
@@ -64,9 +64,14 @@ function signalStore(options) {
64
64
  return (tree) => __awaiter(this, void 0, void 0, function* () {
65
65
  var _a;
66
66
  const workspace = yield (0, workspace_1.getWorkspace)(tree);
67
- const globalConfig = (_a = workspace.extensions.schematics) === null || _a === void 0 ? void 0 : _a["ngx-autogen:all"];
68
- if (globalConfig && globalConfig.pk && !options.pk) {
69
- options.pk = globalConfig.pk;
67
+ const globalConfig = (_a = workspace.extensions.schematics) === null || _a === void 0 ? void 0 : _a["@barcidev/ngx-autogen:all"];
68
+ if (globalConfig) {
69
+ if (globalConfig.pk && !options.pk) {
70
+ options.pk = globalConfig.pk;
71
+ }
72
+ if (globalConfig.path && !options.path) {
73
+ options.path = globalConfig.path;
74
+ }
70
75
  }
71
76
  treeRef = tree;
72
77
  const movePath = (0, core_1.normalize)(options.path);