@ngflow/ng-architect 1.2.0 → 1.2.1

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": "@ngflow/ng-architect",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Angular schematics to generate files and maintain clean architecture",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ComponentSchema",
3
+ "$id": "NgArchitectComponentSchema",
4
4
  "title": "Angular Component Generator",
5
5
  "description": "Generates a reusable Angular component",
6
- "type": "object",
6
+ "type": "object",
7
7
  "properties": {
8
- "name": {
8
+ "name": { "type": "string", "description": "Component name" },
9
+ "structure": {
9
10
  "type": "string",
10
- "description": "The name of the component (e.g., navbar, footer)",
11
- "minLength": 1
11
+ "enum": ["flat", "domain-driven", "module-driven", "monorepo"],
12
+ "default": "domain-driven"
12
13
  },
13
- "module": {
14
- "type": "string",
15
- "description": "Optional: The Angular module to declare this component in"
16
- }
14
+ "module": { "type": "string", "description": "Module name (for module-driven structure)" },
15
+ "app": { "type": "string", "description": "App name (for monorepo)" },
16
+ "lib": { "type": "string", "description": "Lib name (for monorepo)" }
17
17
  },
18
18
  "required": ["name"]
19
19
  }
@@ -1,14 +1,36 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ngArchitectSchema",
3
+ "$id": "NgArchitectFeatureSchema",
4
4
  "title": "Angular Feature Generator",
5
5
  "description": "Generates a complete Angular feature with pages, services, store, models and routes",
6
- "type": "object",
6
+ "type": "object",
7
7
  "properties": {
8
8
  "name": {
9
9
  "type": "string",
10
- "description": "The name of the feature (e.g., user-profile, product-list)",
11
- "minLength": 1
10
+ "description": "Feature name"
11
+ },
12
+ "structure": {
13
+ "type": "string",
14
+ "enum": ["flat", "domain-driven", "module-driven", "monorepo"],
15
+ "default": "domain-driven",
16
+ "description": "Project structure for feature"
17
+ },
18
+ "module": {
19
+ "type": "string",
20
+ "description": "Module name (required for module-driven structure)"
21
+ },
22
+ "app": {
23
+ "type": "string",
24
+ "description": "App name (required for monorepo app structure)"
25
+ },
26
+ "lib": {
27
+ "type": "string",
28
+ "description": "Lib name (required for monorepo lib structure)"
29
+ },
30
+ "store": {
31
+ "type": "boolean",
32
+ "description": "Generate store for feature",
33
+ "default": false
12
34
  }
13
35
  },
14
36
  "required": ["name"]
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "ServiceSchema",
3
+ "$id": "NgArchitectServiceSchema",
4
4
  "title": "Angular Service Generator",
5
5
  "description": "Generates an Angular service with optional store and tests",
6
6
  "type": "object",
7
7
  "properties": {
8
- "name": {
8
+ "name": { "type": "string", "description": "Service name" },
9
+ "structure": {
9
10
  "type": "string",
10
- "description": "The name of the service (e.g., user, auth)",
11
- "minLength": 1
11
+ "enum": ["flat", "domain-driven", "module-driven", "monorepo"],
12
+ "default": "domain-driven"
12
13
  },
13
- "store": {
14
- "type": "boolean",
15
- "description": "Whether to generate a store alongside the service",
16
- "default": false
17
- }
14
+ "module": { "type": "string", "description": "Module name (for module-driven structure)" },
15
+ "app": { "type": "string", "description": "App name (for monorepo)" },
16
+ "lib": { "type": "string", "description": "Lib name (for monorepo)" },
17
+ "store": { "type": "boolean", "description": "Generate store for service", "default": false }
18
18
  },
19
19
  "required": ["name"]
20
20
  }
@@ -54,7 +54,7 @@ function updateAppRoutes(tree, featureKebab, featurePascal, structure, options)
54
54
  content = importStatement + content;
55
55
  }
56
56
  if (!content.includes(routeEntry)) {
57
- content = content.replace(/export const routes: Routes = \[/, match => match + '\n' + routeEntry);
57
+ content = content.replace(/export const routes: Routes = \[/, (match) => match + '\n' + routeEntry);
58
58
  }
59
59
  tree.overwrite(routesFilePath, content);
60
60
  }
@@ -1 +1 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I,YAAY,UAAU,YAAY,OAAO,CAAC;YAC1E,KAAK,UAAU;gBACb,OAAO,KAAK,YAAY,UAAU,YAAY,OAAO,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,eAAe,GAAG,YAAY,aAAa,gBAAgB,UAAU,MAAM,CAAC;IAElF,wDAAwD;IACxD,MAAM,UAAU,GACd,SAAS,KAAK,eAAe,IAAI,SAAS,KAAK,eAAe;QAC5D,CAAC,CAAC,cAAc,YAAY,kCAAkC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,kBAAkB,aAAa,YAAY;QAC/I,CAAC,CAAC,cAAc,YAAY,iBAAiB,aAAa,SAAS,CAAC;IAExE,oBAAoB;IACpB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,eAAe,GAAG,OAAO,CAAC;IACtC,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,kCAAkC,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC;IAC7G,CAAC;IAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC"}
@@ -67,7 +67,7 @@ export function updateAppRoutes(
67
67
  content = importStatement + content;
68
68
  }
69
69
  if (!content.includes(routeEntry)) {
70
- content = content.replace(/export const routes: Routes = \[/, match => match + '\n' + routeEntry);
70
+ content = content.replace(/export const routes: Routes = \[/, (match:string) => match + '\n' + routeEntry);
71
71
  }
72
72
 
73
73
  tree.overwrite(routesFilePath, content);