diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index d40ce2c..6e639a4 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -5,21 +5,331 @@ import { defineConfig } from 'astro/config'; export default defineConfig({ integrations: [ starlight({ - title: 'My Docs', + title: 'Angular Challenges', + logo: { + src: './public/angular-challenge.webp', + alt: 'angular challenges logo', + }, + favicon: './public/angular-challenge.ico', social: { github: 'https://github.com/withastro/starlight', + linkedin: 'https://www.linkedin.com/in/thomas-laforge-2b05a945/', + twitter: 'https://twitter.com/laforge_toma', }, sidebar: [ { label: 'Guides', - items: [{ label: 'Example Guide', link: '/guides/example/' }], + autogenerate: { directory: 'guides' }, }, { - label: 'Reference', + label: 'Challenges', items: [ { - label: 'Example Guide', - items: [{ label: 'Example Guide', link: '/guides/example/' }], + label: 'Angular', + items: [ + { + label: 'Projection', + link: '/challenges/angular/projection', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Directive enhancement', + link: '/challenges/angular/directive-enhancement', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'ContextOutlet Typing', + link: '/challenges/angular/context-outlet-typing', + badge: { + text: 'H', + variant: 'danger', + }, + }, + { + label: 'CRUD', + link: '/challenges/angular/crud', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Permissions', + link: '/challenges/angular/permissions', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Simple Pure Pipe', + link: '/challenges/angular/pipe-pure', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'WrapFn Pipe', + link: '/challenges/angular/pipe-wrapFn', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Utility Pipe', + link: '/challenges/angular/pipe-utility', + badge: { + text: 'H', + variant: 'danger', + }, + }, + { + label: 'Change Dectection - scroll', + link: '/challenges/angular/scroll-cd', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Styling', + link: '/challenges/angular/styling', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Dependancy Injection', + link: '/challenges/angular/di', + badge: { + text: 'H', + variant: 'danger', + }, + }, + { + label: 'Anchor Scrolling', + link: '/challenges/angular/anchor-scrolling', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Router Input', + link: '/challenges/angular/router-input', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Interop Rxjs Signal', + link: '/challenges/angular/interop-rxjs-signal', + badge: { + text: 'H', + variant: 'danger', + }, + }, + { + label: 'Module to Standalone', + link: '/challenges/angular/modaule-to-standalone', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Bug - Change Detection', + link: '/challenges/angular/bug-cd', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: "Component's Decoupling", + link: '/challenges/angular/decoupling', + badge: { + text: 'M', + variant: 'caution', + }, + }, + ], + }, + { + label: 'Angular - Performance', + items: [ + { + label: 'Default vs OnPush', + link: '/challenges/angular-performance/default-onpush', + badge: { + text: 'E', + variant: 'success', + }, + }, + ], + }, + { + label: 'Testing', + items: [ + { + label: 'Router', + link: '/challenges/testing/router', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Nested Component', + link: '/challenges/testing/nested-comp', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Input Output', + link: '/challenges/testing/input-output', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Modal', + link: '/challenges/testing/modal', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'harness', + link: '/challenges/testing/harness', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Harness Creation', + link: '/challenges/testing/harness-creation', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Checkbox', + link: '/challenges/testing/checkbox', + badge: { + text: 'E', + variant: 'success', + }, + }, + { + label: 'Reallife Application', + link: '/challenges/testing/real-application', + badge: { + text: 'H', + variant: 'danger', + }, + }, + ], + }, + { + label: 'RxJs', + items: [ + { + label: 'Bug - Chaining Operators', + link: '/challenges/rxjs/bug-chaining-operator', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Race Condition', + link: '/challenges/rxjs/race-condition', + badge: { + text: 'E', + variant: 'success', + }, + }, + ], + }, + { + label: 'Nx', + items: [ + { + label: 'Extending Library Generator', + link: '/challenges/nx/generator-lib-ext', + badge: { + text: 'H', + variant: 'danger', + }, + }, + { + label: 'Component Generator', + link: '/challenges/nx/generator-comp', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Custom Eslint Rule', + link: '/challenges/nx/forbid-enum-rule', + badge: { + text: 'E', + variant: 'success', + }, + }, + ], + }, + { + label: 'NgRx', + items: [ + { + label: 'Effect vs Selector', + link: '/challenges/ngrx/effect-selector', + badge: { + text: 'M', + variant: 'caution', + }, + }, + { + label: 'Power of Effects', + link: '/challenges/ngrx/power-effect', + badge: { + text: 'H', + variant: 'danger', + }, + }, + ], + }, + { + label: 'Typescript', + items: [ + { + label: 'Function Overload', + link: '/challenges/typescript/overload-fn', + badge: { + text: 'M', + variant: 'caution', + }, + }, + ], }, ], }, diff --git a/docs/public/angular-challenge.ico b/docs/public/angular-challenge.ico new file mode 100644 index 0000000..29d85cd Binary files /dev/null and b/docs/public/angular-challenge.ico differ diff --git a/docs/public/angular-challenge.webp b/docs/public/angular-challenge.webp new file mode 100644 index 0000000..743d5aa Binary files /dev/null and b/docs/public/angular-challenge.webp differ diff --git a/docs/public/favicon.svg b/docs/public/favicon.svg deleted file mode 100644 index cba5ac1..0000000 --- a/docs/public/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/src/assets/angular-challenge.webp b/docs/src/assets/angular-challenge.webp new file mode 100644 index 0000000..743d5aa Binary files /dev/null and b/docs/src/assets/angular-challenge.webp differ diff --git a/docs/src/assets/houston.webp b/docs/src/assets/houston.webp deleted file mode 100644 index 930c164..0000000 Binary files a/docs/src/assets/houston.webp and /dev/null differ diff --git a/docs/src/content/docs/challenges/angular-performance/default-onpush.md b/docs/src/content/docs/challenges/angular-performance/default-onpush.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular-performance/default-onpush.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/achor-scrolling.md b/docs/src/content/docs/challenges/angular/achor-scrolling.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/achor-scrolling.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/bug-cd.md b/docs/src/content/docs/challenges/angular/bug-cd.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/bug-cd.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/context-outlet-typed.md b/docs/src/content/docs/challenges/angular/context-outlet-typed.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/context-outlet-typed.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/crud.md b/docs/src/content/docs/challenges/angular/crud.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/crud.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/decoupling.md b/docs/src/content/docs/challenges/angular/decoupling.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/decoupling.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/di.md b/docs/src/content/docs/challenges/angular/di.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/di.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/directive-enhancement.md b/docs/src/content/docs/challenges/angular/directive-enhancement.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/directive-enhancement.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/interop-rxjs-signal.md b/docs/src/content/docs/challenges/angular/interop-rxjs-signal.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/interop-rxjs-signal.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/module-to-standalone.md b/docs/src/content/docs/challenges/angular/module-to-standalone.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/module-to-standalone.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/permissions.md b/docs/src/content/docs/challenges/angular/permissions.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/permissions.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/pipe-pure.md b/docs/src/content/docs/challenges/angular/pipe-pure.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/pipe-pure.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/pipe-utility.md b/docs/src/content/docs/challenges/angular/pipe-utility.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/pipe-utility.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/pipe-wrapFn.md b/docs/src/content/docs/challenges/angular/pipe-wrapFn.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/pipe-wrapFn.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/projection.md b/docs/src/content/docs/challenges/angular/projection.md new file mode 100644 index 0000000..d54accf --- /dev/null +++ b/docs/src/content/docs/challenges/angular/projection.md @@ -0,0 +1,52 @@ +--- +title: Projection +description: angular-challenge-1/projection +--- + +#1 - Easy + +## Statement + +Refactor this working exemple of a dasboard containing multiple cards (teachers, students, ...) +Implement the City card. + +## Constraints: + +- You **must** keep **CardComponent** and **ListItemComponent** +- **NgFor** directive must be declare and stay inside **CardComponent** +- No **NgIf** or **NgSwitch** inside **CardComponent** +- CSS: prefer not to use **::ng-deep**, find a better way + +## Submitting your work + +1. Fork the project +2. clone it +3. npm ci +4. **nx serve projection** +5. _...work on it_ +6. Commit your work +7. Submit a PR with a title beginning with **Answer:1** that I will review and other dev can review. + + + Projection solution + + + Projection solution author + + + Projection blog article + + +_You can ask any question on_ twitter diff --git a/docs/src/content/docs/challenges/angular/router-input.md b/docs/src/content/docs/challenges/angular/router-input.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/router-input.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/scroll-cd.md b/docs/src/content/docs/challenges/angular/scroll-cd.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/scroll-cd.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/angular/styling.md b/docs/src/content/docs/challenges/angular/styling.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/angular/styling.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/ngrx/effect-selector.md b/docs/src/content/docs/challenges/ngrx/effect-selector.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/ngrx/effect-selector.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/ngrx/power-effect.md b/docs/src/content/docs/challenges/ngrx/power-effect.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/ngrx/power-effect.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/nx/forbid-enum-rule.md b/docs/src/content/docs/challenges/nx/forbid-enum-rule.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/nx/forbid-enum-rule.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/nx/generator-comp.md b/docs/src/content/docs/challenges/nx/generator-comp.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/nx/generator-comp.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/nx/generator-lib-ext.md b/docs/src/content/docs/challenges/nx/generator-lib-ext.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/nx/generator-lib-ext.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/rxjs/bug-chaining-operator.md b/docs/src/content/docs/challenges/rxjs/bug-chaining-operator.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/rxjs/bug-chaining-operator.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/rxjs/race-condition.md b/docs/src/content/docs/challenges/rxjs/race-condition.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/rxjs/race-condition.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/checkbox.md b/docs/src/content/docs/challenges/testing/checkbox.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/checkbox.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/harness-creation.md b/docs/src/content/docs/challenges/testing/harness-creation.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/harness-creation.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/harness.md b/docs/src/content/docs/challenges/testing/harness.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/harness.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/input-output.md b/docs/src/content/docs/challenges/testing/input-output.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/input-output.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/modal.md b/docs/src/content/docs/challenges/testing/modal.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/modal.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/nested-comp.md b/docs/src/content/docs/challenges/testing/nested-comp.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/nested-comp.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/real-application.md b/docs/src/content/docs/challenges/testing/real-application.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/real-application.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/testing/router.md b/docs/src/content/docs/challenges/testing/router.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/testing/router.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/challenges/typescript/overload-fn.md b/docs/src/content/docs/challenges/typescript/overload-fn.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/challenges/typescript/overload-fn.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/guides/example.md b/docs/src/content/docs/guides/getting-started.md similarity index 76% rename from docs/src/content/docs/guides/example.md rename to docs/src/content/docs/guides/getting-started.md index ebd0f3b..ece3d10 100644 --- a/docs/src/content/docs/guides/example.md +++ b/docs/src/content/docs/guides/getting-started.md @@ -1,6 +1,6 @@ --- -title: Example Guide -description: A guide in my new Starlight docs site. +title: Getting Started +description: A guide on how to get started with Angular Challenges. --- Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. diff --git a/docs/src/content/docs/guides/submit-answer.md b/docs/src/content/docs/guides/submit-answer.md new file mode 100644 index 0000000..741cbaa --- /dev/null +++ b/docs/src/content/docs/guides/submit-answer.md @@ -0,0 +1,4 @@ +--- +title: Submit your answer +description: Guide to submit an answer +--- diff --git a/docs/src/content/docs/guides/x-contribute.md b/docs/src/content/docs/guides/x-contribute.md new file mode 100644 index 0000000..4998f82 --- /dev/null +++ b/docs/src/content/docs/guides/x-contribute.md @@ -0,0 +1,4 @@ +--- +title: Contribute +description: Guide to contribute +--- diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index 117179d..a62f128 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -1,14 +1,14 @@ --- -title: Welcome to Starlight -description: Get started building your docs site with Starlight. +title: Welcome to Angular Challenges +description: Get started by resolving those challenges and becoming a better Angular FrontEnd engineer. template: splash hero: tagline: Congrats on setting up a new Starlight project! image: - file: ../../assets/houston.webp + file: ../../assets/angular-challenge.webp actions: - - text: Example Guide - link: /guides/example/ + - text: Get Started + link: /guides/getting-started/ icon: right-arrow variant: primary - text: Read the Starlight docs @@ -21,16 +21,16 @@ import { Card, CardGrid } from '@astrojs/starlight/components'; ## Next steps - - Edit `src/content/docs/index.mdx` to see this page change. - - - Add Markdown or MDX files to `src/content/docs` to create new pages. - - - Edit your `sidebar` and other config in `astro.config.mjs`. - - - Learn more in [the Starlight Docs](https://starlight.astro.build/). - + + Edit `src/content/docs/index.mdx` to see this page change. + + + Add Markdown or MDX files to `src/content/docs` to create new pages. + + + Edit your `sidebar` and other config in `astro.config.mjs`. + + + Learn more in [the Starlight Docs](https://starlight.astro.build/). + diff --git a/docs/src/content/docs/reference/example.md b/docs/src/content/docs/reference/example.md deleted file mode 100644 index ac8cfa8..0000000 --- a/docs/src/content/docs/reference/example.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Example Reference -description: A reference page in my new Starlight docs site. ---- - -Reference pages are ideal for outlining how things work in terse and clear terms. -Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting. - -## Further reading - -- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework