diff --git a/README.md b/README.md
index 4a47b97..0797696 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ If you would like to propose a challenge, this project is open source, so feel f
## Challenges
-Check [all 35 challenges](https://angular-challenges.vercel.app/)
+Check [all 36 challenges](https://angular-challenges.vercel.app/)
## Contributors ✨
diff --git a/docs/src/content/docs/challenges/angular-performance/12-scroll-cd.md b/docs/src/content/docs/challenges/angular-performance/12-scroll-cd.md
index 63f49fb..ed67c0b 100644
--- a/docs/src/content/docs/challenges/angular-performance/12-scroll-cd.md
+++ b/docs/src/content/docs/challenges/angular-performance/12-scroll-cd.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #12
diff --git a/docs/src/content/docs/challenges/angular-performance/32-bug-cd.md b/docs/src/content/docs/challenges/angular-performance/32-bug-cd.md
index 980d1a1..dadf4d0 100644
--- a/docs/src/content/docs/challenges/angular-performance/32-bug-cd.md
+++ b/docs/src/content/docs/challenges/angular-performance/32-bug-cd.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #32
diff --git a/docs/src/content/docs/challenges/angular-performance/34-default-onpush.md b/docs/src/content/docs/challenges/angular-performance/34-default-onpush.md
index 4768b65..6ea3f97 100644
--- a/docs/src/content/docs/challenges/angular-performance/34-default-onpush.md
+++ b/docs/src/content/docs/challenges/angular-performance/34-default-onpush.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #34
diff --git a/docs/src/content/docs/challenges/angular/10-pipe-utility.md b/docs/src/content/docs/challenges/angular/10-pipe-utility.md
index 262093d..567915e 100644
--- a/docs/src/content/docs/challenges/angular/10-pipe-utility.md
+++ b/docs/src/content/docs/challenges/angular/10-pipe-utility.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #10
diff --git a/docs/src/content/docs/challenges/angular/13-styling.md b/docs/src/content/docs/challenges/angular/13-styling.md
index 81c663c..d751036 100644
--- a/docs/src/content/docs/challenges/angular/13-styling.md
+++ b/docs/src/content/docs/challenges/angular/13-styling.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #13
diff --git a/docs/src/content/docs/challenges/angular/16-di.md b/docs/src/content/docs/challenges/angular/16-di.md
index 4e682ca..e90410d 100644
--- a/docs/src/content/docs/challenges/angular/16-di.md
+++ b/docs/src/content/docs/challenges/angular/16-di.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #16
diff --git a/docs/src/content/docs/challenges/angular/21-achor-scrolling.md b/docs/src/content/docs/challenges/angular/21-achor-scrolling.md
index 554e52d..7c1ace1 100644
--- a/docs/src/content/docs/challenges/angular/21-achor-scrolling.md
+++ b/docs/src/content/docs/challenges/angular/21-achor-scrolling.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #21
diff --git a/docs/src/content/docs/challenges/angular/22-router-input.md b/docs/src/content/docs/challenges/angular/22-router-input.md
index 2313a0d..9b4b72c 100644
--- a/docs/src/content/docs/challenges/angular/22-router-input.md
+++ b/docs/src/content/docs/challenges/angular/22-router-input.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #22
diff --git a/docs/src/content/docs/challenges/angular/3-directive-enhancement.md b/docs/src/content/docs/challenges/angular/3-directive-enhancement.md
index 2750ca1..7581ef5 100644
--- a/docs/src/content/docs/challenges/angular/3-directive-enhancement.md
+++ b/docs/src/content/docs/challenges/angular/3-directive-enhancement.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #3
diff --git a/docs/src/content/docs/challenges/angular/30-interop-rxjs-signal.md b/docs/src/content/docs/challenges/angular/30-interop-rxjs-signal.md
index 9ca0a01..3229bc9 100644
--- a/docs/src/content/docs/challenges/angular/30-interop-rxjs-signal.md
+++ b/docs/src/content/docs/challenges/angular/30-interop-rxjs-signal.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #30
diff --git a/docs/src/content/docs/challenges/angular/31-module-to-standalone.md b/docs/src/content/docs/challenges/angular/31-module-to-standalone.md
index 825bc59..e356ec7 100644
--- a/docs/src/content/docs/challenges/angular/31-module-to-standalone.md
+++ b/docs/src/content/docs/challenges/angular/31-module-to-standalone.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #31
diff --git a/docs/src/content/docs/challenges/angular/33-decoupling.md b/docs/src/content/docs/challenges/angular/33-decoupling.md
index 2baf1d6..e7eba9f 100644
--- a/docs/src/content/docs/challenges/angular/33-decoupling.md
+++ b/docs/src/content/docs/challenges/angular/33-decoupling.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #33
diff --git a/docs/src/content/docs/challenges/angular/4-context-outlet-typed.md b/docs/src/content/docs/challenges/angular/4-context-outlet-typed.md
index 2eb0c2c..9eb5c60 100644
--- a/docs/src/content/docs/challenges/angular/4-context-outlet-typed.md
+++ b/docs/src/content/docs/challenges/angular/4-context-outlet-typed.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #4
diff --git a/docs/src/content/docs/challenges/angular/5-crud.md b/docs/src/content/docs/challenges/angular/5-crud.md
index 6d35332..a41f8b3 100644
--- a/docs/src/content/docs/challenges/angular/5-crud.md
+++ b/docs/src/content/docs/challenges/angular/5-crud.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #5
diff --git a/docs/src/content/docs/challenges/angular/6-permissions.md b/docs/src/content/docs/challenges/angular/6-permissions.md
index 8c68c9b..633c722 100644
--- a/docs/src/content/docs/challenges/angular/6-permissions.md
+++ b/docs/src/content/docs/challenges/angular/6-permissions.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #6
diff --git a/docs/src/content/docs/challenges/angular/8-pipe-pure.md b/docs/src/content/docs/challenges/angular/8-pipe-pure.md
index e15224e..540f385 100644
--- a/docs/src/content/docs/challenges/angular/8-pipe-pure.md
+++ b/docs/src/content/docs/challenges/angular/8-pipe-pure.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #8
diff --git a/docs/src/content/docs/challenges/angular/9-pipe-wrapFn.md b/docs/src/content/docs/challenges/angular/9-pipe-wrapFn.md
index e1d3f79..0893b53 100644
--- a/docs/src/content/docs/challenges/angular/9-pipe-wrapFn.md
+++ b/docs/src/content/docs/challenges/angular/9-pipe-wrapFn.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #9
diff --git a/docs/src/content/docs/challenges/ngrx/2-effect-selector.md b/docs/src/content/docs/challenges/ngrx/2-effect-selector.md
index b308293..bf0210b 100644
--- a/docs/src/content/docs/challenges/ngrx/2-effect-selector.md
+++ b/docs/src/content/docs/challenges/ngrx/2-effect-selector.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #2
diff --git a/docs/src/content/docs/challenges/ngrx/7-power-effect.md b/docs/src/content/docs/challenges/ngrx/7-power-effect.md
index 3afab3f..2081d02 100644
--- a/docs/src/content/docs/challenges/ngrx/7-power-effect.md
+++ b/docs/src/content/docs/challenges/ngrx/7-power-effect.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #7
diff --git a/docs/src/content/docs/challenges/nx/25-generator-lib-ext.md b/docs/src/content/docs/challenges/nx/25-generator-lib-ext.md
index 842ba1f..d1416ae 100644
--- a/docs/src/content/docs/challenges/nx/25-generator-lib-ext.md
+++ b/docs/src/content/docs/challenges/nx/25-generator-lib-ext.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
## Information
diff --git a/docs/src/content/docs/challenges/nx/26-generator-comp.md b/docs/src/content/docs/challenges/nx/26-generator-comp.md
index 30e737e..42bf032 100644
--- a/docs/src/content/docs/challenges/nx/26-generator-comp.md
+++ b/docs/src/content/docs/challenges/nx/26-generator-comp.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
## Information
diff --git a/docs/src/content/docs/challenges/nx/27-forbid-enum-rule.md b/docs/src/content/docs/challenges/nx/27-forbid-enum-rule.md
index 54bcd04..8b4df42 100644
--- a/docs/src/content/docs/challenges/nx/27-forbid-enum-rule.md
+++ b/docs/src/content/docs/challenges/nx/27-forbid-enum-rule.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
## Information
diff --git a/docs/src/content/docs/challenges/rxjs/11-bug-chaining-operator.md b/docs/src/content/docs/challenges/rxjs/11-bug-chaining-operator.md
index 6caf29b..5529c31 100644
--- a/docs/src/content/docs/challenges/rxjs/11-bug-chaining-operator.md
+++ b/docs/src/content/docs/challenges/rxjs/11-bug-chaining-operator.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #11
diff --git a/docs/src/content/docs/challenges/rxjs/14-race-condition.md b/docs/src/content/docs/challenges/rxjs/14-race-condition.md
index 0b40d51..40b2243 100644
--- a/docs/src/content/docs/challenges/rxjs/14-race-condition.md
+++ b/docs/src/content/docs/challenges/rxjs/14-race-condition.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #14
diff --git a/docs/src/content/docs/challenges/testing/17-router.md b/docs/src/content/docs/challenges/testing/17-router.md
index 7c04b78..4694d0f 100644
--- a/docs/src/content/docs/challenges/testing/17-router.md
+++ b/docs/src/content/docs/challenges/testing/17-router.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #17
diff --git a/docs/src/content/docs/challenges/testing/18-nested-comp.md b/docs/src/content/docs/challenges/testing/18-nested-comp.md
index d85f11b..6d41598 100644
--- a/docs/src/content/docs/challenges/testing/18-nested-comp.md
+++ b/docs/src/content/docs/challenges/testing/18-nested-comp.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #18
diff --git a/docs/src/content/docs/challenges/testing/19-input-output.md b/docs/src/content/docs/challenges/testing/19-input-output.md
index e9bef43..ac64921 100644
--- a/docs/src/content/docs/challenges/testing/19-input-output.md
+++ b/docs/src/content/docs/challenges/testing/19-input-output.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #19
diff --git a/docs/src/content/docs/challenges/testing/20-modal.md b/docs/src/content/docs/challenges/testing/20-modal.md
index 8486b76..20a67ef 100644
--- a/docs/src/content/docs/challenges/testing/20-modal.md
+++ b/docs/src/content/docs/challenges/testing/20-modal.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #20
diff --git a/docs/src/content/docs/challenges/testing/23-harness.md b/docs/src/content/docs/challenges/testing/23-harness.md
index e05b921..2e9165b 100644
--- a/docs/src/content/docs/challenges/testing/23-harness.md
+++ b/docs/src/content/docs/challenges/testing/23-harness.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #23
diff --git a/docs/src/content/docs/challenges/testing/24-harness-creation.md b/docs/src/content/docs/challenges/testing/24-harness-creation.md
index 5cab7ad..74df507 100644
--- a/docs/src/content/docs/challenges/testing/24-harness-creation.md
+++ b/docs/src/content/docs/challenges/testing/24-harness-creation.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #24
diff --git a/docs/src/content/docs/challenges/testing/28-checkbox.md b/docs/src/content/docs/challenges/testing/28-checkbox.md
index 17f3b9d..730b503 100644
--- a/docs/src/content/docs/challenges/testing/28-checkbox.md
+++ b/docs/src/content/docs/challenges/testing/28-checkbox.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #28
diff --git a/docs/src/content/docs/challenges/testing/29-real-application.md b/docs/src/content/docs/challenges/testing/29-real-application.md
index 57b63d7..e521732 100644
--- a/docs/src/content/docs/challenges/testing/29-real-application.md
+++ b/docs/src/content/docs/challenges/testing/29-real-application.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #29
diff --git a/docs/src/content/docs/challenges/typescript/15-overload-fn.md b/docs/src/content/docs/challenges/typescript/15-overload-fn.md
index 1726c05..9258b62 100644
--- a/docs/src/content/docs/challenges/typescript/15-overload-fn.md
+++ b/docs/src/content/docs/challenges/typescript/15-overload-fn.md
@@ -6,7 +6,7 @@ sidebar:
---
:::note
-WIP
+WIP: The following documentation will be reviewed and improved. However, you can still take on the challenge. If you don't understand a certain part, please feel free to reach out or create an issue.
:::
Challenge #15
diff --git a/docs/src/content/docs/guides/create-challenge.md b/docs/src/content/docs/guides/create-challenge.md
index 261fbf5..e6447ad 100644
--- a/docs/src/content/docs/guides/create-challenge.md
+++ b/docs/src/content/docs/guides/create-challenge.md
@@ -6,5 +6,24 @@ sidebar:
---
:::note
-WIP:
+WIP: doc in writting
:::
+
+You have an idea you want to share, an interesting bug you struggling on in your private organization or in your side project, an Angular trick you discovered,... All those possibilities are a good start to create a challenge and share the solution with others.
+
+But how to start creating that challenges ?
+
+## Boilerplate Setup
+
+To ease the process, I created a Nx generator that will create all the boilerplate for you and get you ready faster. The easiest way to run it is by using the Nx console > generate > @angular-challenges/cli - challenge
+
+### Parameters
+
+title: string;
+challengeDifficulty: string;
+docRepository: string;
+name: string;
+directory?: string;
+addTest?: boolean;
+
+This generator will create a new application inside the `apps` directory and a Markdown file inside the `docs` folder.
diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx
index 514afef..cafefc9 100644
--- a/docs/src/content/docs/index.mdx
+++ b/docs/src/content/docs/index.mdx
@@ -23,8 +23,8 @@ hero:
import { Card, CardGrid } from '@astrojs/starlight/components';
-
- This repository gathers 35 Challenges related to Angular, Nx, Ngrx, RxJS, and Ngrx.
+
+ This repository gathers 36 Challenges related to Angular, Nx, Ngrx, RxJS, and Ngrx.
These challenges resolve around real-life issues or specific features to elevate your skills.
diff --git a/docs/src/styles/custom-css.css b/docs/src/styles/custom-css.css
index 39e6ae8..06a5bdb 100644
--- a/docs/src/styles/custom-css.css
+++ b/docs/src/styles/custom-css.css
@@ -92,3 +92,7 @@ b {
font-size: var(--sl-text-xs);
}
}
+
+starlight-menu-button svg {
+ color: #1c1a1d;
+}
diff --git a/libs/cli/generators.json b/libs/cli/generators.json
index a6b249b..b85faa8 100644
--- a/libs/cli/generators.json
+++ b/libs/cli/generators.json
@@ -1,9 +1,9 @@
{
"generators": {
- "app": {
- "factory": "./src/generators/app/generator",
- "schema": "./src/generators/app/schema.json",
- "description": "app generator"
+ "challenge": {
+ "factory": "./src/generators/challenge/generator",
+ "schema": "./src/generators/challenge/schema.json",
+ "description": "challenge generator"
},
"readme": {
"factory": "./src/generators/readme/generator",
diff --git a/libs/cli/src/generators/app/files/app/src/app/app.component.ts__tmpl__ b/libs/cli/src/generators/challenge/files/app/src/app/app.component.ts__tmpl__
similarity index 100%
rename from libs/cli/src/generators/app/files/app/src/app/app.component.ts__tmpl__
rename to libs/cli/src/generators/challenge/files/app/src/app/app.component.ts__tmpl__
diff --git a/libs/cli/src/generators/app/files/docs/__challengeNumber__-__projectName__.md__tmpl__ b/libs/cli/src/generators/challenge/files/docs/__challengeNumber__-__projectName__.md__tmpl__
similarity index 89%
rename from libs/cli/src/generators/app/files/docs/__challengeNumber__-__projectName__.md__tmpl__
rename to libs/cli/src/generators/challenge/files/docs/__challengeNumber__-__projectName__.md__tmpl__
index 9f6069f..1bd1882 100644
--- a/libs/cli/src/generators/app/files/docs/__challengeNumber__-__projectName__.md__tmpl__
+++ b/libs/cli/src/generators/challenge/files/docs/__challengeNumber__-__projectName__.md__tmpl__
@@ -1,10 +1,12 @@
---
title: <%= difficulty %> <%= title %>
description: Challenge <%= challengeNumber %> is about ...
+sidebar:
+ order: <%= challengeNumber %>
---
:::note
-WIP
+WIP: The following documentation need to be written.
:::
Challenge #<%= challengeNumber %>
diff --git a/libs/cli/src/generators/app/files/readme/README.md__tmpl__ b/libs/cli/src/generators/challenge/files/readme/README.md__tmpl__
similarity index 100%
rename from libs/cli/src/generators/app/files/readme/README.md__tmpl__
rename to libs/cli/src/generators/challenge/files/readme/README.md__tmpl__
diff --git a/libs/cli/src/generators/app/files/test/src/app/app.component.spec.ts__tmpl__ b/libs/cli/src/generators/challenge/files/test/src/app/app.component.spec.ts__tmpl__
similarity index 100%
rename from libs/cli/src/generators/app/files/test/src/app/app.component.spec.ts__tmpl__
rename to libs/cli/src/generators/challenge/files/test/src/app/app.component.spec.ts__tmpl__
diff --git a/libs/cli/src/generators/app/files/test/src/test-setup.ts__tmpl__ b/libs/cli/src/generators/challenge/files/test/src/test-setup.ts__tmpl__
similarity index 100%
rename from libs/cli/src/generators/app/files/test/src/test-setup.ts__tmpl__
rename to libs/cli/src/generators/challenge/files/test/src/test-setup.ts__tmpl__
diff --git a/libs/cli/src/generators/app/files/test/tsconfig.spec.json__tmpl__ b/libs/cli/src/generators/challenge/files/test/tsconfig.spec.json__tmpl__
similarity index 100%
rename from libs/cli/src/generators/app/files/test/tsconfig.spec.json__tmpl__
rename to libs/cli/src/generators/challenge/files/test/tsconfig.spec.json__tmpl__
diff --git a/libs/cli/src/generators/app/generator.ts b/libs/cli/src/generators/challenge/generator.ts
similarity index 67%
rename from libs/cli/src/generators/app/generator.ts
rename to libs/cli/src/generators/challenge/generator.ts
index 476307b..f5c939f 100644
--- a/libs/cli/src/generators/app/generator.ts
+++ b/libs/cli/src/generators/challenge/generator.ts
@@ -12,12 +12,12 @@ import {
updateJson,
} from '@nx/devkit';
import { Linter } from '@nx/linter';
-import { readFile, writeFile } from 'fs';
+import { readFile, writeFile } from 'fs/promises';
import { join } from 'path';
import { getProjectDir } from '../../utils/normalize';
import { Schema } from './schema';
-export async function appGenerator(tree: Tree, options: Schema) {
+export async function challengeGenerator(tree: Tree, options: Schema) {
const { appDirectory } = getProjectDir(options.name, options.directory);
const challengeNumberPath = 'challenge-number.json';
@@ -70,38 +70,24 @@ export async function appGenerator(tree: Tree, options: Schema) {
});
}
- readFile('./README.md', 'utf-8', function (err, contents) {
- const regex = new RegExp(`all ${challengeNumber} challenges`);
- const replaced = contents.replace(
- regex,
- `all ${challengeNumber + 1} challenges`
- );
+ const readme = await readFile('./README.md', { encoding: 'utf-8' });
- writeFile('./README.md', replaced, 'utf-8', function (err) {
- console.log(err);
- });
+ const readmeRegex = new RegExp(`all ${challengeNumber} challenges`);
+ const readmeReplace = readme.replace(
+ readmeRegex,
+ `all ${challengeNumber + 1} challenges`
+ );
+
+ await writeFile('./README.md', readmeReplace, 'utf-8');
+
+ const docs = await readFile('./docs/src/content/docs/index.mdx', {
+ encoding: 'utf-8',
});
- readFile(
- './docs/src/content/docs/index.mdx',
- 'utf-8',
- function (err, contents) {
- const regex = new RegExp(`${challengeNumber} Challenges`, 'gi');
- const replaced = contents.replace(
- regex,
- `${challengeNumber + 1} Challenges`
- );
+ const regex = new RegExp(`${challengeNumber} Challenges`, 'gi');
+ const replaced = docs.replace(regex, `${challengeNumber + 1} Challenges`);
- writeFile(
- './docs/src/content/docs/index.mdx',
- replaced,
- 'utf-8',
- function (err) {
- console.log(err);
- }
- );
- }
- );
+ await writeFile('./docs/src/content/docs/index.mdx', replaced, 'utf-8');
updateJson(tree, challengeNumberPath, (json) => {
json.total = json.total + 1;
@@ -111,4 +97,4 @@ export async function appGenerator(tree: Tree, options: Schema) {
await formatFiles(tree);
}
-export default appGenerator;
+export default challengeGenerator;
diff --git a/libs/cli/src/generators/app/schema.d.ts b/libs/cli/src/generators/challenge/schema.d.ts
similarity index 100%
rename from libs/cli/src/generators/app/schema.d.ts
rename to libs/cli/src/generators/challenge/schema.d.ts
diff --git a/libs/cli/src/generators/app/schema.json b/libs/cli/src/generators/challenge/schema.json
similarity index 93%
rename from libs/cli/src/generators/app/schema.json
rename to libs/cli/src/generators/challenge/schema.json
index 91b60ef..7b68cd3 100644
--- a/libs/cli/src/generators/app/schema.json
+++ b/libs/cli/src/generators/challenge/schema.json
@@ -1,13 +1,13 @@
{
"$schema": "http://json-schema.org/schema",
- "$id": "GeneratorNxApp",
- "title": "Creates an Angular application.",
- "description": "Creates an Angular application.",
+ "$id": "GeneratorNxChallenge",
+ "title": "Creates the setup for a new Angular Challenge.",
+ "description": "Creates the boilerplate for an Angular Challenge.",
"type": "object",
"cli": "nx",
"properties": {
"name": {
- "description": "The name of the application. (should be in camel case)",
+ "description": "The name of the application. (should be in kebab case)",
"type": "string",
"$default": {
"$source": "argv",
@@ -19,6 +19,7 @@
"title": {
"description": "Title of your challenge. (use quote to add spaces)",
"type": "string",
+ "maxLength": "25",
"$default": {
"$source": "argv",
"index": 1