fix(generator): update generator

This commit is contained in:
thomas
2023-10-14 21:07:15 +02:00
parent e8bf7cbe43
commit 33a718307c
4 changed files with 19 additions and 26 deletions

View File

@@ -1,6 +1,9 @@
--- ---
title: <%= difficulty %> <%= title %> title: <%= difficulty %> <%= title %>
description: Challenge <%= challengeNumber %> is about ... description: Challenge <%= challengeNumber %> is about ...
author: <%= author %>
challengeNumber: <%= challengeNumber %>
command: <%= appProjectName %>
sidebar: sidebar:
order: <%= order %> order: <%= order %>
badge: New badge: New
@@ -10,33 +13,9 @@ sidebar:
WIP: The following documentation need to be written. WIP: The following documentation need to be written.
::: :::
<div class="chip">Challenge #<%= challengeNumber %></div>
## Information ## Information
## Statement ## Statement
## Constraints ## Constraints
---
:::note
Start the project by running: `npx nx serve <%= appProjectName %>`.
:::
:::tip[Reminder]
Your PR title must start with <b>Answer:<%= challengeNumber %></b>.
:::
<div class="article-footer">
<a
href="https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A<%= challengeNumber %>+label%3Aanswer"
alt="<%= title %> community solutions">
❖ Community Answers
</a>
<a
href='https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A<%= challengeNumber %>+label%3A"answer+author"'
alt="<%= title %> solution author">
▶︎ Author Answer
</a>
</div>

View File

@@ -91,6 +91,7 @@ export async function challengeGenerator(tree: Tree, options: Schema) {
tmpl: '', tmpl: '',
projectName: names(options.name).name, projectName: names(options.name).name,
appProjectName, appProjectName,
author: options.author,
title: options.title, title: options.title,
challengeNumber, challengeNumber,
difficulty, difficulty,

View File

@@ -1,5 +1,6 @@
export interface Schema { export interface Schema {
title: string; title: string;
author: string;
challengeDifficulty: string; challengeDifficulty: string;
docRepository: string; docRepository: string;
name: string; name: string;

View File

@@ -17,7 +17,7 @@
"pattern": "^[a-zA-Z].*$" "pattern": "^[a-zA-Z].*$"
}, },
"title": { "title": {
"description": "Title of your challenge. (use quote to add spaces)", "description": "Title of your challenge.",
"type": "string", "type": "string",
"maxLength": "25", "maxLength": "25",
"$default": { "$default": {
@@ -26,6 +26,12 @@
}, },
"x-priority": "important" "x-priority": "important"
}, },
"author": {
"description": "Your full name",
"type": "string",
"maxLength": "25",
"x-priority": "important"
},
"challengeDifficulty": { "challengeDifficulty": {
"description": "The difficulty of the challenge.", "description": "The difficulty of the challenge.",
"type": "string", "type": "string",
@@ -114,5 +120,11 @@
} }
}, },
"additionalProperties": false, "additionalProperties": false,
"required": ["name", "title", "challengeDifficulty", "docRepository"] "required": [
"name",
"title",
"author",
"challengeDifficulty",
"docRepository"
]
} }