Skip to content

Commit

Permalink
fix(core): should be able to pass extra args to generated libraries (#…
Browse files Browse the repository at this point in the history
…788)

Fixes: #783
  • Loading branch information
AgentEnder authored Oct 25, 2023
1 parent d9dfa7b commit 2d2cb5b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
4 changes: 0 additions & 4 deletions docs/core/generators/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,3 @@ Generate a dotnet project under the application directory.
### args

- (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'.

### **unparsed**

- (array):
4 changes: 4 additions & 0 deletions docs/core/generators/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ Generate a dotnet project under the library directory.
### pathScheme

- (string): Determines if the project should follow NX or dotnet path naming conventions

### args

- (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'.
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"generators": {
"@nx-dotnet/nxdoc:generate-docs": {
"outputDirectory": "docs",
"gettingStartedFile": "<src>/README.md"
"gettingStartedFile": "<src>/README.md",
"exclude": "workspace-plugin"
}
},
"targetDefaults": {
Expand Down
19 changes: 19 additions & 0 deletions packages/core/src/generators/lib/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,25 @@
}
]
}
},
"args": {
"type": "array",
"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'.",
"items": {
"type": "string"
},
"default": []
},
"__unparsed__": {
"hidden": true,
"type": "array",
"items": {
"type": "string"
},
"$default": {
"$source": "unparsed"
},
"x-priority": "internal"
}
},
"required": ["name", "language", "testTemplate"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

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

## Options <% Object.entries(schema.properties).forEach(([property, config]) => {%>
## Options <% Object.entries(schema.properties).forEach(([property, config]) => {

if (config.hidden) return;
%>

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

Expand Down

0 comments on commit 2d2cb5b

Please sign in to comment.