Skip to content

Commit 2d2cb5b

Browse files
authored
fix(core): should be able to pass extra args to generated libraries (#788)
Fixes: #783
1 parent d9dfa7b commit 2d2cb5b

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

docs/core/generators/application.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,3 @@ Generate a dotnet project under the application directory.
5151
### args
5252

5353
- (array): Additional arguments to pass to the dotnet command. For example: "nx g @nx-dotnet/core:app myapp --args='--no-restore'" Arguments can also be appended to the end of the command using '--'. For example, 'nx g @nx-dotnet/core:app myapp -- --no-restore'.
54-
55-
### **unparsed**
56-
57-
- (array):

docs/core/generators/library.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ Generate a dotnet project under the library directory.
4343
### pathScheme
4444

4545
- (string): Determines if the project should follow NX or dotnet path naming conventions
46+
47+
### args
48+
49+
- (array): Additional arguments to pass to the dotnet command. For example: "nx g @nx-dotnet/core:app myapp --args='--no-restore'" Arguments can also be appended to the end of the command using '--'. For example, 'nx g @nx-dotnet/core:app myapp -- --no-restore'.

nx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"generators": {
2222
"@nx-dotnet/nxdoc:generate-docs": {
2323
"outputDirectory": "docs",
24-
"gettingStartedFile": "<src>/README.md"
24+
"gettingStartedFile": "<src>/README.md",
25+
"exclude": "workspace-plugin"
2526
}
2627
},
2728
"targetDefaults": {

packages/core/src/generators/lib/schema.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@
103103
}
104104
]
105105
}
106+
},
107+
"args": {
108+
"type": "array",
109+
"description": "Additional arguments to pass to the dotnet command. For example: \"nx g @nx-dotnet/core:app myapp --args='--no-restore'\" Arguments can also be appended to the end of the command using '--'. For example, 'nx g @nx-dotnet/core:app myapp -- --no-restore'.",
110+
"items": {
111+
"type": "string"
112+
},
113+
"default": []
114+
},
115+
"__unparsed__": {
116+
"hidden": true,
117+
"type": "array",
118+
"items": {
119+
"type": "string"
120+
},
121+
"$default": {
122+
"$source": "unparsed"
123+
},
124+
"x-priority": "internal"
106125
}
107126
},
108127
"required": ["name", "language", "testTemplate"]

packages/nxdoc/src/generators/generate-docs/templates/detail/__generatorFileName__.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
<% if(Object.values(schema.properties).length > 0) {%>
1010

11-
## Options <% Object.entries(schema.properties).forEach(([property, config]) => {%>
11+
## Options <% Object.entries(schema.properties).forEach(([property, config]) => {
12+
13+
if (config.hidden) return;
14+
%>
1215

1316
### <%- (schema.required?.includes?.(property)) ? `<span className="required">${property}</span>` : property %>
1417

0 commit comments

Comments
 (0)