From 9a96a4692d07a81cfec2f4def177f6fe3e5353a3 Mon Sep 17 00:00:00 2001 From: Valery Melou Date: Sat, 20 Jul 2024 19:58:43 +0100 Subject: [PATCH 1/3] feat: prerender articles --- .eslintrc.json | 5 + .github/workflows/cd.yml | 3 + .github/workflows/ci.yml | 8 + .gitignore | 1 + .vscode/settings.json | 3 + apps/website/project.json | 11 +- apps/website/public/robots.txt | 3 + apps/website/src/app/app.routes.ts | 10 + libs/blog/data-access/src/index.ts | 2 + .../src/lib/article.resolver.spec.ts | 18 + .../data-access/src/lib/article.resolver.ts | 12 + .../src/lib/articles.resolver.spec.ts | 23 ++ .../data-access/src/lib/articles.resolver.ts | 12 + .../src/lib/blog-article.component.html | 318 +++++++++--------- .../src/lib/blog-article.component.spec.ts | 10 +- .../src/lib/blog-article.component.ts | 56 +-- .../src/lib/blog-home.component.html | 105 +++--- .../src/lib/blog-home.component.spec.ts | 7 +- .../src/lib/blog-home.component.ts | 33 +- libs/blog/tasks/.eslintrc.json | 32 ++ libs/blog/tasks/README.md | 11 + libs/blog/tasks/executors.json | 9 + libs/blog/tasks/jest.config.ts | 11 + libs/blog/tasks/package.json | 13 + libs/blog/tasks/project.json | 19 ++ libs/blog/tasks/src/index.ts | 0 libs/blog/tasks/src/lib/executor.ts | 33 ++ libs/blog/tasks/src/lib/hasher.ts | 12 + libs/blog/tasks/src/lib/schema.d.ts | 5 + libs/blog/tasks/src/lib/schema.json | 9 + libs/blog/tasks/tsconfig.json | 22 ++ libs/blog/tasks/tsconfig.lib.json | 10 + libs/blog/tasks/tsconfig.spec.json | 14 + nx.json | 20 +- package.json | 5 + tsconfig.base.json | 1 + yarn.lock | 296 +++++++++++++++- 37 files changed, 860 insertions(+), 302 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 apps/website/public/robots.txt create mode 100644 libs/blog/data-access/src/lib/article.resolver.spec.ts create mode 100644 libs/blog/data-access/src/lib/article.resolver.ts create mode 100644 libs/blog/data-access/src/lib/articles.resolver.spec.ts create mode 100644 libs/blog/data-access/src/lib/articles.resolver.ts create mode 100644 libs/blog/tasks/.eslintrc.json create mode 100644 libs/blog/tasks/README.md create mode 100644 libs/blog/tasks/executors.json create mode 100644 libs/blog/tasks/jest.config.ts create mode 100644 libs/blog/tasks/package.json create mode 100644 libs/blog/tasks/project.json create mode 100644 libs/blog/tasks/src/index.ts create mode 100644 libs/blog/tasks/src/lib/executor.ts create mode 100644 libs/blog/tasks/src/lib/hasher.ts create mode 100644 libs/blog/tasks/src/lib/schema.d.ts create mode 100644 libs/blog/tasks/src/lib/schema.json create mode 100644 libs/blog/tasks/tsconfig.json create mode 100644 libs/blog/tasks/tsconfig.lib.json create mode 100644 libs/blog/tasks/tsconfig.spec.json diff --git a/.eslintrc.json b/.eslintrc.json index 0be733b7..3e22d2f2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,11 @@ "ignorePatterns": ["**/*"], "plugins": ["@nx"], "overrides": [ + { + "files": "*.json", + "parser": "jsonc-eslint-parser", + "rules": {} + }, { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e8d9bf7e..9d3a8b50 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -21,6 +21,9 @@ jobs: cache: 'yarn' - run: yarn install + # Generate the routes for prerendering. This is the only way I found to pass + # environment variables to the executor. + - run: VM_CONTENTFUL_SPACE=${{ env.VM_CONTENTFUL_SPACE }} VM_CONTENTFUL_ACCESS_TOKEN=${{ env.VM_CONTENTFUL_ACCESS_TOKEN }} VM_CONTENTFUL_ENVIRONMENT=${{ env.VM_CONTENTFUL_ENVIRONMENT }} yarn nx run website:build-routes - run: npx nx run website:prerender - name: Archive artifacts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5196d44..1459e353 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,14 @@ jobs: node-version: 20 cache: 'yarn' + - name: Restore NX Cache + id: nx-cache-restore + uses: actions/cache/restore@v4 + with: + path: | + .nx + key: ${{ runner.os }}-nx + - run: yarn install - run: npx nx affected --target=lint --parallel=3 - run: npx nx run-many --target=test --parallel=3 --code-coverage diff --git a/.gitignore b/.gitignore index 695b9837..a6597a66 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ Thumbs.db .angular .env .firebaserc +routes.txt diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1471fb96 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.validate": ["json"] +} diff --git a/apps/website/project.json b/apps/website/project.json index 21a4278f..935ae1d8 100644 --- a/apps/website/project.json +++ b/apps/website/project.json @@ -123,7 +123,8 @@ "prerender": { "executor": "@angular-devkit/build-angular:prerender", "options": { - "routes": ["/"] + "routes": ["/"], + "routesFile": "apps/website/src/routes.txt" }, "configurations": { "development": { @@ -136,6 +137,14 @@ } }, "defaultConfiguration": "production" + }, + "build-routes": { + "executor": "@valerymelou/blog-tasks:routes", + "options": { + "contentType": "article", + "outputPath": "apps/website/src/routes.txt", + "limit": "10" + } } } } diff --git a/apps/website/public/robots.txt b/apps/website/public/robots.txt new file mode 100644 index 00000000..1b2f0ba7 --- /dev/null +++ b/apps/website/public/robots.txt @@ -0,0 +1,3 @@ +# Allow URLs (see https://www.robotstxt.org/robotstxt.html) +User-agent: * +Disallow: diff --git a/apps/website/src/app/app.routes.ts b/apps/website/src/app/app.routes.ts index 9711b564..02ccf9c5 100644 --- a/apps/website/src/app/app.routes.ts +++ b/apps/website/src/app/app.routes.ts @@ -1,4 +1,8 @@ import { Route } from '@angular/router'; +import { + articleResolver, + articlesResolver, +} from '@valerymelou/blog/data-access'; import { BaseLayoutComponent } from '@valerymelou/shared/layout'; import { themeResolver } from '@valerymelou/shared/theming'; @@ -35,6 +39,9 @@ export const appRoutes: Route[] = [ loadComponent: () => import('@valerymelou/blog/home').then((c) => c.BlogHomeComponent), data: { animation: 'BlogHomePage' }, + resolve: { + articles: articlesResolver, + }, }, { path: 'blog/:slug', @@ -43,6 +50,9 @@ export const appRoutes: Route[] = [ (c) => c.BlogArticleComponent, ), data: { animation: 'BlogHomePage' }, + resolve: { + article: articleResolver, + }, }, ], }, diff --git a/libs/blog/data-access/src/index.ts b/libs/blog/data-access/src/index.ts index 151653d6..2b4da0db 100644 --- a/libs/blog/data-access/src/index.ts +++ b/libs/blog/data-access/src/index.ts @@ -1,3 +1,5 @@ export * from './lib/article'; +export * from './lib/article.resolver'; +export * from './lib/articles.resolver'; export * from './lib/article.service'; export * from './lib/results'; diff --git a/libs/blog/data-access/src/lib/article.resolver.spec.ts b/libs/blog/data-access/src/lib/article.resolver.spec.ts new file mode 100644 index 00000000..af62bf11 --- /dev/null +++ b/libs/blog/data-access/src/lib/article.resolver.spec.ts @@ -0,0 +1,18 @@ +import { TestBed } from '@angular/core/testing'; +import { ResolveFn } from '@angular/router'; + +import { articleResolver } from './article.resolver'; +import { Article } from './article'; + +describe('articleResolver', () => { + const executeResolver: ResolveFn
= (...resolverParameters) => + TestBed.runInInjectionContext(() => articleResolver(...resolverParameters)); + + beforeEach(() => { + TestBed.configureTestingModule({}); + }); + + it('should be created', () => { + expect(executeResolver).toBeTruthy(); + }); +}); diff --git a/libs/blog/data-access/src/lib/article.resolver.ts b/libs/blog/data-access/src/lib/article.resolver.ts new file mode 100644 index 00000000..16b7a160 --- /dev/null +++ b/libs/blog/data-access/src/lib/article.resolver.ts @@ -0,0 +1,12 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; + +import { Article } from './article'; +import { ArticleService } from './article.service'; + +export const articleResolver: ResolveFn
= (route) => { + const articleService = inject(ArticleService); + const slug = route.params['slug'].split('-').slice(3).join('-'); + + return articleService.getOne(slug); +}; diff --git a/libs/blog/data-access/src/lib/articles.resolver.spec.ts b/libs/blog/data-access/src/lib/articles.resolver.spec.ts new file mode 100644 index 00000000..32af216b --- /dev/null +++ b/libs/blog/data-access/src/lib/articles.resolver.spec.ts @@ -0,0 +1,23 @@ +import { TestBed } from '@angular/core/testing'; +import { ResolveFn } from '@angular/router'; + +import { articlesResolver } from './articles.resolver'; +import { Results } from './results'; +import { Article } from './article'; + +describe('articlesResolver', () => { + const executeResolver: ResolveFn> = ( + ...resolverParameters + ) => + TestBed.runInInjectionContext(() => + articlesResolver(...resolverParameters), + ); + + beforeEach(() => { + TestBed.configureTestingModule({}); + }); + + it('should be created', () => { + expect(executeResolver).toBeTruthy(); + }); +}); diff --git a/libs/blog/data-access/src/lib/articles.resolver.ts b/libs/blog/data-access/src/lib/articles.resolver.ts new file mode 100644 index 00000000..b1d3f4d7 --- /dev/null +++ b/libs/blog/data-access/src/lib/articles.resolver.ts @@ -0,0 +1,12 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; + +import { Article } from './article'; +import { Results } from './results'; +import { ArticleService } from './article.service'; + +export const articlesResolver: ResolveFn> = () => { + const articleService = inject(ArticleService); + + return articleService.get({}); +}; diff --git a/libs/blog/feature-article/src/lib/blog-article.component.html b/libs/blog/feature-article/src/lib/blog-article.component.html index 9b5f5341..f3be4fd8 100644 --- a/libs/blog/feature-article/src/lib/blog-article.component.html +++ b/libs/blog/feature-article/src/lib/blog-article.component.html @@ -1,169 +1,167 @@ -@if (article$ | async; as article) { -
- - - -
-
Date
-
- -
-
-

- {{ article.title }} -

+
+ + + +
+
Date
+
+ +
+
+

+ {{ article.title }} +

- @if (article.cover) { -
- -
- {{ article.cover.title }} -
-
- } + @if (article.cover) { +
+ +
+ {{ article.cover.title }} +
+
+ } -

- {{ article.abstract }} -

+

+ {{ article.abstract }} +

-
+
-
-
- -

- -

-
- -

- -

-
- -

- -

-
- -

- -

-
- -
- -
-
- -
- -
-
- -

- -

-
- -
    - -
-
- -
    - -
-
- -
  • - -
  • -
    - -
    - -
    -
    - -
    -
    - - - - - +
    +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    + +

    + +

    +
    + +
    + +
    +
    + +
    + +
    +
    + +

    + +

    +
    + +
      + +
    +
    + +
      + +
    +
    + +
  • + +
  • +
    + +
    + +
    +
    + +
    +
    + + + + + - -
    - - @if (node.data.target.fields.title) { -
    - {{ node.data.target.fields.title }} -
    - } -
    -
    + +
    + + @if (node.data.target.fields.title) { +
    + {{ node.data.target.fields.title }} +
    + } +
    +
    - - Embedded entry - + + Embedded entry + - {{ node.value }} + {{ node.value }} - - @if (node.value.split('\n').length > 1) { -
    - } @else { -
    - -
    - } -
    -
    + + @if (node.value.split('\n').length > 1) { +
    + } @else { +
    + +
    + } +
    -
    -} + +
    diff --git a/libs/blog/feature-article/src/lib/blog-article.component.spec.ts b/libs/blog/feature-article/src/lib/blog-article.component.spec.ts index 3a02dc7e..eabacd7a 100644 --- a/libs/blog/feature-article/src/lib/blog-article.component.spec.ts +++ b/libs/blog/feature-article/src/lib/blog-article.component.spec.ts @@ -3,7 +3,7 @@ import { ActivatedRoute, provideRouter } from '@angular/router'; import { of } from 'rxjs'; -import { ArticleService, Article } from '@valerymelou/blog/data-access'; +import { Article } from '@valerymelou/blog/data-access'; import { MetadataService } from '@valerymelou/shared/seo'; import { BlogArticleComponent } from './blog-article.component'; @@ -20,13 +20,7 @@ describe('BlogArticleComponent', () => { { provide: ActivatedRoute, useValue: { - params: of({ slug: 'test' }), - }, - }, - { - provide: ArticleService, - useValue: { - getOne: () => of(new Article()), + data: of({ article: new Article() }), }, }, { diff --git a/libs/blog/feature-article/src/lib/blog-article.component.ts b/libs/blog/feature-article/src/lib/blog-article.component.ts index 8405f5c8..bfcb74c8 100644 --- a/libs/blog/feature-article/src/lib/blog-article.component.ts +++ b/libs/blog/feature-article/src/lib/blog-article.component.ts @@ -1,18 +1,10 @@ -import { - AfterViewChecked, - Component, - Inject, - OnDestroy, - OnInit, - Renderer2, -} from '@angular/core'; +import { Component, Inject, OnDestroy, OnInit, Renderer2 } from '@angular/core'; import { CommonModule, DOCUMENT } from '@angular/common'; -import { ActivatedRoute, Params, RouterModule } from '@angular/router'; +import { ActivatedRoute, RouterModule } from '@angular/router'; -import { map, Observable } from 'rxjs'; import { BLOCKS, INLINES, MARKS } from '@contentful/rich-text-types'; -import { highlight, languages, highlightAll } from 'prismjs'; +import { highlight, languages } from 'prismjs'; import 'prismjs/components/prism-python'; import 'prismjs/components/prism-rust'; @@ -25,7 +17,7 @@ import { import { NgIconComponent, provideIcons } from '@ng-icons/core'; import { bootstrapArrowLeft } from '@ng-icons/bootstrap-icons'; -import { Article, ArticleService } from '@valerymelou/blog/data-access'; +import { Article } from '@valerymelou/blog/data-access'; import { MetadataService } from '@valerymelou/shared/seo'; import { ButtonComponent, LinkComponent } from '@valerymelou/shared/ui'; @@ -46,10 +38,8 @@ import { ButtonComponent, LinkComponent } from '@valerymelou/shared/ui'; templateUrl: './blog-article.component.html', viewProviders: [provideIcons({ bootstrapArrowLeft })], }) -export class BlogArticleComponent - implements AfterViewChecked, OnInit, OnDestroy -{ - article$!: Observable
    ; +export class BlogArticleComponent implements OnInit, OnDestroy { + article!: Article; loaded = false; ready = false; @@ -62,42 +52,26 @@ export class BlogArticleComponent constructor( private renderer: Renderer2, private route: ActivatedRoute, - private articleService: ArticleService, private metadataService: MetadataService, @Inject(DOCUMENT) private document: Document, ) { - this.route.params.subscribe({ - next: (params: Params) => { - if (params['slug']) this.getArticle(params['slug']); + this.route.data.subscribe({ + next: (data) => { + this.article = data['article']; + this.metadataService.updateMetadata({ + title: this.article.title, + description: this.article.abstract, + image: this.article.cover?.url ?? '', + }); + this.loaded = true; }, }); } - ngAfterViewChecked(): void { - if (this.loaded && !this.ready) { - highlightAll(); - } - } - ngOnInit(): void { this.loadCodeHighlightLib(); } - getArticle(slug: string): void { - slug = slug.split('-').slice(3).join('-'); - this.article$ = this.articleService.getOne(slug).pipe( - map((article: Article) => { - this.metadataService.updateMetadata({ - title: article.title, - description: article.abstract, - image: article.cover?.url ?? '', - }); - this.loaded = true; - return article; - }), - ); - } - highlightCode(code: string): string { let language = code.split('\n')[0].replace('```', ''); diff --git a/libs/blog/feature-home/src/lib/blog-home.component.html b/libs/blog/feature-home/src/lib/blog-home.component.html index 3a3ef019..0244e882 100644 --- a/libs/blog/feature-home/src/lib/blog-home.component.html +++ b/libs/blog/feature-home/src/lib/blog-home.component.html @@ -16,62 +16,61 @@

    class="bg-secondary-light dark:bg-secondary-dark absolute bottom-0 right-full top-3 mr-7 hidden w-px sm:block md:mr-[3.25rem]" >
    - @if (articles$ | async; as articles) { - @for (article of articles.items; track article.slug) { -
    -
    -
    + +
    +

    - - -
    -

    - {{ article.title }} -

    -
    -

    - {{ article.abstract }} -

    -
    -
    -
    Date
    -
    - -
    -
    + {{ article.title }} +

    +
    +

    + {{ article.abstract }} +

    - - - - Read more - -
    - } +
    Date
    +
    + +
    + +
    + + + + Read more + +

    } diff --git a/libs/blog/feature-home/src/lib/blog-home.component.spec.ts b/libs/blog/feature-home/src/lib/blog-home.component.spec.ts index 8808e87c..af6b34e4 100644 --- a/libs/blog/feature-home/src/lib/blog-home.component.spec.ts +++ b/libs/blog/feature-home/src/lib/blog-home.component.spec.ts @@ -1,8 +1,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; -import { Article, ArticleService } from '@valerymelou/blog/data-access'; +import { Article } from '@valerymelou/blog/data-access'; import { MetadataService } from '@valerymelou/shared/seo'; import { BlogHomeComponent } from './blog-home.component'; @@ -16,9 +17,9 @@ describe('BlogHomeComponent', () => { imports: [BlogHomeComponent], providers: [ { - provide: ArticleService, + provide: ActivatedRoute, useValue: { - get: () => of({ data: [new Article(), new Article()] }), + data: of({ articles: { items: [new Article(), new Article()] } }), }, }, { diff --git a/libs/blog/feature-home/src/lib/blog-home.component.ts b/libs/blog/feature-home/src/lib/blog-home.component.ts index 6b543036..1a559407 100644 --- a/libs/blog/feature-home/src/lib/blog-home.component.ts +++ b/libs/blog/feature-home/src/lib/blog-home.component.ts @@ -1,14 +1,9 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { Observable } from 'rxjs'; -import { - Article, - ArticleService, - Results, -} from '@valerymelou/blog/data-access'; +import { Article, Results } from '@valerymelou/blog/data-access'; import { LinkComponent } from '@valerymelou/shared/ui'; -import { RouterModule } from '@angular/router'; +import { ActivatedRoute, RouterModule } from '@angular/router'; import { MetadataService } from '@valerymelou/shared/seo'; @Component({ @@ -17,25 +12,19 @@ import { MetadataService } from '@valerymelou/shared/seo'; imports: [CommonModule, RouterModule, LinkComponent], templateUrl: './blog-home.component.html', }) -export class BlogHomeComponent implements OnInit { - articles$!: Observable>; +export class BlogHomeComponent { + articles!: Results
    ; - ngOnInit(): void { - this.loadArticles(); - } - - constructor( - private articleService: ArticleService, - metadataService: MetadataService, - ) { + constructor(route: ActivatedRoute, metadataService: MetadataService) { + route.data.subscribe({ + next: (data) => { + this.articles = data['articles']; + }, + }); metadataService.updateMetadata({ title: 'Inside my head | Valery Melou', description: 'I talk about Django, Angular... Web Development in general and many other topics. These are just a few of the things in my head.', }); } - - loadArticles(): void { - this.articles$ = this.articleService.get({}); - } } diff --git a/libs/blog/tasks/.eslintrc.json b/libs/blog/tasks/.eslintrc.json new file mode 100644 index 00000000..a8ec5934 --- /dev/null +++ b/libs/blog/tasks/.eslintrc.json @@ -0,0 +1,32 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + }, + { + "files": ["./package.json", "./executors.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/nx-plugin-checks": "error" + } + } + ] +} diff --git a/libs/blog/tasks/README.md b/libs/blog/tasks/README.md new file mode 100644 index 00000000..276b7f8f --- /dev/null +++ b/libs/blog/tasks/README.md @@ -0,0 +1,11 @@ +# blog-tasks + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build blog-tasks` to build the library. + +## Running unit tests + +Run `nx test blog-tasks` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/blog/tasks/executors.json b/libs/blog/tasks/executors.json new file mode 100644 index 00000000..2771e470 --- /dev/null +++ b/libs/blog/tasks/executors.json @@ -0,0 +1,9 @@ +{ + "executors": { + "routes": { + "implementation": "./src/lib/executor", + "schema": "./src/lib/schema.json", + "description": "Create a file of parameterized routes" + } + } +} diff --git a/libs/blog/tasks/jest.config.ts b/libs/blog/tasks/jest.config.ts new file mode 100644 index 00000000..4d9d1f55 --- /dev/null +++ b/libs/blog/tasks/jest.config.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ +export default { + displayName: 'blog-tasks', + preset: '../../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../../coverage/libs/blog/tasks', +}; diff --git a/libs/blog/tasks/package.json b/libs/blog/tasks/package.json new file mode 100644 index 00000000..3e441a69 --- /dev/null +++ b/libs/blog/tasks/package.json @@ -0,0 +1,13 @@ +{ + "name": "@valerymelou/blog-tasks", + "version": "0.0.1", + "dependencies": { + "@nx/devkit": "19.5.1", + "tslib": "^2.3.0" + }, + "type": "commonjs", + "main": "./src/index.js", + "typings": "./src/index.d.ts", + "private": true, + "executors": "./executors.json" +} diff --git a/libs/blog/tasks/project.json b/libs/blog/tasks/project.json new file mode 100644 index 00000000..ea7d0dc0 --- /dev/null +++ b/libs/blog/tasks/project.json @@ -0,0 +1,19 @@ +{ + "name": "blog-tasks", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/blog/tasks/src", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/blog/tasks", + "main": "libs/blog/tasks/src/index.ts", + "tsConfig": "libs/blog/tasks/tsconfig.lib.json", + "assets": ["libs/blog/tasks/*.md"] + } + } + } +} diff --git a/libs/blog/tasks/src/index.ts b/libs/blog/tasks/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/libs/blog/tasks/src/lib/executor.ts b/libs/blog/tasks/src/lib/executor.ts new file mode 100644 index 00000000..bd6cf5fb --- /dev/null +++ b/libs/blog/tasks/src/lib/executor.ts @@ -0,0 +1,33 @@ +import { PromiseExecutor } from '@nx/devkit'; +import { RoutesExecutorSchema } from './schema'; +import { createClient } from 'contentful'; +import { writeFileSync } from 'fs'; + +const runExecutor: PromiseExecutor = async (options) => { + const space = process.env['VM_CONTENTFUL_SPACE'] || ''; + const accessToken = process.env['VM_CONTENTFUL_ACCESS_TOKEN'] || ''; + const environment = process.env['VM_CONTENTFUL_ENVIRONMENT'] || ''; + const cdaClient = createClient({ space, accessToken, environment }); + const defaultQuery: { [key: string]: string } = { + content_type: 'article', + limit: options.limit?.toString() ?? '10', + order: options.order ?? '-sys.createdAt', + }; + const entries = await cdaClient.getEntries(defaultQuery); + const routes = entries.items.map( + (entry) => + `/blog/${entry.sys.createdAt.split('T')[0]}/${entry.fields['slug']}`, + ); + const routesString = routes.join('\n'); + + writeFileSync(options.outputPath, routesString); + console.log( + `Successfully wrote ${routes.length} routes to ${options.outputPath}`, + ); + + return { + success: true, + }; +}; + +export default runExecutor; diff --git a/libs/blog/tasks/src/lib/hasher.ts b/libs/blog/tasks/src/lib/hasher.ts new file mode 100644 index 00000000..ef216f9c --- /dev/null +++ b/libs/blog/tasks/src/lib/hasher.ts @@ -0,0 +1,12 @@ +import { CustomHasher } from '@nx/devkit'; + +/** + * This is a boilerplate custom hasher that matches + * the default Nx hasher. If you need to extend the behavior, + * you can consume workspace details from the context. + */ +export const routesHasher: CustomHasher = async (task, context) => { + return context.hasher.hashTask(task, context.taskGraph, process.env); +}; + +export default routesHasher; diff --git a/libs/blog/tasks/src/lib/schema.d.ts b/libs/blog/tasks/src/lib/schema.d.ts new file mode 100644 index 00000000..e94496bf --- /dev/null +++ b/libs/blog/tasks/src/lib/schema.d.ts @@ -0,0 +1,5 @@ +export interface RoutesExecutorSchema { + outputPath: string; + limit?: number; + order?: string; +} // eslint-disable-line diff --git a/libs/blog/tasks/src/lib/schema.json b/libs/blog/tasks/src/lib/schema.json new file mode 100644 index 00000000..44b590d4 --- /dev/null +++ b/libs/blog/tasks/src/lib/schema.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/schema", + "version": 2, + "title": "Routes executor", + "description": "", + "type": "object", + "properties": {}, + "required": [] +} diff --git a/libs/blog/tasks/tsconfig.json b/libs/blog/tasks/tsconfig.json new file mode 100644 index 00000000..8122543a --- /dev/null +++ b/libs/blog/tasks/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/blog/tasks/tsconfig.lib.json b/libs/blog/tasks/tsconfig.lib.json new file mode 100644 index 00000000..4befa7f0 --- /dev/null +++ b/libs/blog/tasks/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/libs/blog/tasks/tsconfig.spec.json b/libs/blog/tasks/tsconfig.spec.json new file mode 100644 index 00000000..69a251f3 --- /dev/null +++ b/libs/blog/tasks/tsconfig.spec.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/nx.json b/nx.json index 35feba44..0459cbd3 100644 --- a/nx.json +++ b/nx.json @@ -50,6 +50,16 @@ }, "server": { "cache": true + }, + "@nx/angular:ng-packagr-lite": { + "cache": true, + "dependsOn": ["^build"], + "inputs": ["production", "^production"] + }, + "@nx/js:tsc": { + "cache": true, + "dependsOn": ["^build"], + "inputs": ["production", "^production"] } }, "generators": { @@ -63,5 +73,13 @@ "linter": "eslint", "unitTestRunner": "jest" } - } + }, + "plugins": [ + { + "plugin": "@nx/eslint/plugin", + "options": { + "targetName": "eslint:lint" + } + } + ] } diff --git a/package.json b/package.json index 0705b70e..52e9fdaf 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@nx/eslint-plugin": "19.5.1", "@nx/jest": "19.5.1", "@nx/js": "19.5.1", + "@nx/plugin": "19.5.1", "@nx/workspace": "19.5.1", "@schematics/angular": "~18.1.0", "@swc-node/register": "~1.9.1", @@ -63,9 +64,13 @@ "eslint-config-prettier": "^9.0.0", "jest": "^29.4.1", "jest-environment-jsdom": "^29.4.1", + "jest-environment-node": "^29.4.1", "jest-preset-angular": "~14.1.0", + "jsonc-eslint-parser": "^2.1.0", + "ng-packagr": "~18.1.0", "nx": "19.5.1", "postcss": "^8.4.5", + "postcss-url": "~10.1.3", "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.6.5", "tailwindcss": "^3.4.4", diff --git a/tsconfig.base.json b/tsconfig.base.json index 4b549065..50346db7 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,6 +18,7 @@ "@valerymelou/blog/article": ["libs/blog/feature-article/src/index.ts"], "@valerymelou/blog/data-access": ["libs/blog/data-access/src/index.ts"], "@valerymelou/blog/home": ["libs/blog/feature-home/src/index.ts"], + "@valerymelou/blog-tasks": ["libs/blog/tasks/src/index.ts"], "@valerymelou/cms/contentful": ["libs/cms/contentful/src/index.ts"], "@valerymelou/common/browser": ["libs/common/browser/src/index.ts"], "@valerymelou/pages/about": ["libs/pages/about/src/index.ts"], diff --git a/yarn.lock b/yarn.lock index e9c846c3..e5084944 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2605,6 +2605,13 @@ dependencies: "@nx/js" "19.5.1" +"@nrwl/nx-plugin@19.5.1": + version "19.5.1" + resolved "https://registry.yarnpkg.com/@nrwl/nx-plugin/-/nx-plugin-19.5.1.tgz#b6ccd45a9a40b5f5b612985fe4dae964c3df2d74" + integrity sha512-Zg61xE5yX4nl0PheP1cUIgAcCpL3P2cLph5PxoIKEprqXRstChw9xTZnlE+kClXFxE+oQa9zIjXoGTHfmsh9Lg== + dependencies: + "@nx/plugin" "19.5.1" + "@nrwl/tao@19.5.1": version "19.5.1" resolved "https://registry.npmjs.org/@nrwl/tao/-/tao-19.5.1.tgz" @@ -2816,6 +2823,19 @@ resolved "https://registry.yarnpkg.com/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-19.5.1.tgz#2e1ee5f2aa1a360840150f061e68beb640c6d160" integrity sha512-bxj12iAuyEwBCV6A+C8nXQ55KNji4L0VrL3y2KeH0wOeBMgTeKQxoMNk0/Ty2O6354YkAgwaKRHJMnM/LfO+og== +"@nx/plugin@19.5.1": + version "19.5.1" + resolved "https://registry.yarnpkg.com/@nx/plugin/-/plugin-19.5.1.tgz#74925b28495908d5b67ab80f5f0695c550ca71fa" + integrity sha512-ZZzMJYM9mr+q4W57Zn8grDWdiLaN7HBlKD1CpSq2rnSQ/PsVf0P/leov6d0owT7Z3YvEFGU+4sgy15saxbFszA== + dependencies: + "@nrwl/nx-plugin" "19.5.1" + "@nx/devkit" "19.5.1" + "@nx/eslint" "19.5.1" + "@nx/jest" "19.5.1" + "@nx/js" "19.5.1" + fs-extra "^11.1.0" + tslib "^2.3.0" + "@nx/web@19.5.1": version "19.5.1" resolved "https://registry.npmjs.org/@nx/web/-/web-19.5.1.tgz" @@ -2900,6 +2920,34 @@ resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@rollup/plugin-json@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-6.1.0.tgz#fbe784e29682e9bb6dee28ea75a1a83702e7b805" + integrity sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA== + dependencies: + "@rollup/pluginutils" "^5.1.0" + +"@rollup/plugin-node-resolve@^15.2.3": + version "15.2.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9" + integrity sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ== + dependencies: + "@rollup/pluginutils" "^5.0.1" + "@types/resolve" "1.20.2" + deepmerge "^4.2.2" + is-builtin-module "^3.2.1" + is-module "^1.0.0" + resolve "^1.22.1" + +"@rollup/pluginutils@^5.0.1", "@rollup/pluginutils@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0" + integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^2.3.1" + "@rollup/rollup-android-arm-eabi@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz#bbd0e616b2078cd2d68afc9824d1fadb2f2ffd27" @@ -2910,6 +2958,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz#f0da481244b7d9ea15296b35f7fe39cd81157396" integrity sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA== +"@rollup/rollup-android-arm-eabi@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.0.tgz#3d9fd50164b94964f5de68c3c4ce61933b3a338d" + integrity sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w== + "@rollup/rollup-android-arm64@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz#97255ef6384c5f73f4800c0de91f5f6518e21203" @@ -2920,6 +2973,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz#82ab3c575f4235fb647abea5e08eec6cf325964e" integrity sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg== +"@rollup/rollup-android-arm64@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.0.tgz#e1a6d4bca2eb08c84fd996a4bf896ce4b6f4014c" + integrity sha512-RDxUSY8D1tWYfn00DDi5myxKgOk6RvWPxhmWexcICt/MEC6yEMr4HNCu1sXXYLw8iAsg0D44NuU+qNq7zVWCrw== + "@rollup/rollup-darwin-arm64@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz#b6dd74e117510dfe94541646067b0545b42ff096" @@ -2930,6 +2988,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.1.tgz#6a530452e68a9152809ce58de1f89597632a085b" integrity sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ== +"@rollup/rollup-darwin-arm64@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz#0a3fffea69489a24a96079af414b0be78df8abbc" + integrity sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA== + "@rollup/rollup-darwin-x64@4.18.0": version "4.18.0" resolved "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz" @@ -2940,6 +3003,11 @@ resolved "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.1.tgz" integrity sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA== +"@rollup/rollup-darwin-x64@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.0.tgz#13fbdb15f58f090871b0ffff047ece06ad6ad74c" + integrity sha512-fO28cWA1dC57qCd+D0rfLC4VPbh6EOJXrreBmFLWPGI9dpMlER2YwSPZzSGfq11XgcEpPukPTfEVFtw2q2nYJg== + "@rollup/rollup-linux-arm-gnueabihf@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz#9f1a6d218b560c9d75185af4b8bb42f9f24736b8" @@ -2950,6 +3018,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.1.tgz#46193c498aa7902a8db89ac00128060320e84fef" integrity sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g== +"@rollup/rollup-linux-arm-gnueabihf@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.0.tgz#e9d9219ddf6f6e946e2ee322198af12466d2c868" + integrity sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw== + "@rollup/rollup-linux-arm-musleabihf@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz#53618b92e6ffb642c7b620e6e528446511330549" @@ -2960,6 +3033,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.1.tgz#22d831fe239643c1d05c98906420325cee439d85" integrity sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ== +"@rollup/rollup-linux-arm-musleabihf@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.0.tgz#4ba804a00b5e793196a622f6977e05f23e01f59a" + integrity sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ== + "@rollup/rollup-linux-arm64-gnu@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz#99a7ba5e719d4f053761a698f7b52291cefba577" @@ -2970,6 +3048,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.1.tgz#19abd33695ec9d588b4a858d122631433084e4a3" integrity sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ== +"@rollup/rollup-linux-arm64-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.0.tgz#d871e3f41de759a6db27fc99235b782ba47c15cc" + integrity sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug== + "@rollup/rollup-linux-arm64-musl@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz#f53db99a45d9bc00ce94db8a35efa7c3c144a58c" @@ -2980,6 +3063,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.1.tgz#d60af8c0b9be424424ff96a0ba19fce65d26f6ab" integrity sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ== +"@rollup/rollup-linux-arm64-musl@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.0.tgz#6e63f7ad4cc51bd2c693a2826fd279de9eaa05b5" + integrity sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ== + "@rollup/rollup-linux-powerpc64le-gnu@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz#cbb0837408fe081ce3435cf3730e090febafc9bf" @@ -2990,6 +3078,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.1.tgz#b1194e5ed6d138fdde0842d126fccde74a90f457" integrity sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ== +"@rollup/rollup-linux-powerpc64le-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.0.tgz#1540b284d91c440bc9fa7a1714cfb71a5597e94d" + integrity sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ== + "@rollup/rollup-linux-riscv64-gnu@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz#8ed09c1d1262ada4c38d791a28ae0fea28b80cc9" @@ -3000,6 +3093,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.1.tgz#f5a635c017b9bff8b856b0221fbd5c0e3373b7ec" integrity sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg== +"@rollup/rollup-linux-riscv64-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.0.tgz#70ae58103b5bc7ba2e2235738b51d97022c8ef92" + integrity sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg== + "@rollup/rollup-linux-s390x-gnu@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz#938138d3c8e0c96f022252a28441dcfb17afd7ec" @@ -3010,6 +3108,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.1.tgz#f1043d9f4026bf6995863cb3f8dd4732606e4baa" integrity sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg== +"@rollup/rollup-linux-s390x-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.0.tgz#579ca5f271421a961d3c73d221202c79e02ff03a" + integrity sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA== + "@rollup/rollup-linux-x64-gnu@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz#1a7481137a54740bee1ded4ae5752450f155d942" @@ -3020,6 +3123,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.1.tgz#1e781730be445119f06c9df5f185e193bc82c610" integrity sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g== +"@rollup/rollup-linux-x64-gnu@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz#f0282d761b8b4e7b92b236813475248e37231849" + integrity sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA== + "@rollup/rollup-linux-x64-musl@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz#f1186afc601ac4f4fc25fac4ca15ecbee3a1874d" @@ -3030,6 +3138,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.1.tgz#08f12e1965d6f27d6898ff932592121cca6abc4b" integrity sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ== +"@rollup/rollup-linux-x64-musl@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz#65da807ac66c505ad14b76f1e5976006cb67dd5f" + integrity sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A== + "@rollup/rollup-win32-arm64-msvc@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz#ed6603e93636a96203c6915be4117245c1bd2daf" @@ -3040,6 +3153,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.1.tgz#4a5dcbbe7af7d41cac92b09798e7c1831da1f599" integrity sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g== +"@rollup/rollup-win32-arm64-msvc@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.0.tgz#1eed24b91f421c2eea8bb7ca8889ba0c867e1780" + integrity sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg== + "@rollup/rollup-win32-ia32-msvc@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz#14e0b404b1c25ebe6157a15edb9c46959ba74c54" @@ -3050,6 +3168,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.1.tgz#075b0713de627843a73b4cf0e087c56b53e9d780" integrity sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg== +"@rollup/rollup-win32-ia32-msvc@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.0.tgz#1ed93c9cdc84e185359797a686f4d1576afcea58" + integrity sha512-xItlIAZZaiG/u0wooGzRsx11rokP4qyc/79LkAOdznGRAbOFc+SfEdfUOszG1odsHNgwippUJavag/+W/Etc6Q== + "@rollup/rollup-win32-x64-msvc@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz#5d694d345ce36b6ecf657349e03eb87297e68da4" @@ -3060,6 +3183,20 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.1.tgz#0cb240c147c0dfd0e3eaff4cc060a772d39e155c" integrity sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw== +"@rollup/rollup-win32-x64-msvc@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.0.tgz#baf9b65023ea2ecc5e6ec68f787a0fecfd8ee84c" + integrity sha512-xNo5fV5ycvCCKqiZcpB65VMR11NJB+StnxHz20jdqRAktfdfzhgjTiJ2doTDQE/7dqGaV5I7ZGqKpgph6lCIag== + +"@rollup/wasm-node@^4.18.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@rollup/wasm-node/-/wasm-node-4.19.0.tgz#01f1e53b413c921ef9dcb31478bb41c49d3ec4d7" + integrity sha512-VrWeEGsuUzEfNPWKtSinPU59l2tfcQPm9eV5ngnM36X2l9JNCXtutzEEy8xtjMWXOXVe9IjE8037AmBJIuQA+w== + dependencies: + "@types/estree" "1.0.5" + optionalDependencies: + fsevents "~2.3.2" + "@schematics/angular@18.1.1", "@schematics/angular@~18.1.0": version "18.1.1" resolved "https://registry.npmjs.org/@schematics/angular/-/angular-18.1.1.tgz" @@ -3398,7 +3535,7 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.5": +"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0", "@types/estree@^1.0.5": version "1.0.5" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== @@ -3544,6 +3681,11 @@ resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== +"@types/resolve@1.20.2": + version "1.20.2" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" + integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== + "@types/retry@0.12.0": version "0.12.0" resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz" @@ -4459,7 +4601,7 @@ browser-sync@^3.0.0: ua-parser-js "^1.0.33" yargs "^17.3.1" -browserslist@^4.0.0, browserslist@^4.21.10, browserslist@^4.21.4, browserslist@^4.21.5, browserslist@^4.23.0, browserslist@^4.23.1: +browserslist@^4.0.0, browserslist@^4.21.10, browserslist@^4.21.4, browserslist@^4.21.5, browserslist@^4.22.1, browserslist@^4.23.0, browserslist@^4.23.1: version "4.23.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz" integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== @@ -4506,6 +4648,11 @@ buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + bundle-name@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz" @@ -4789,6 +4936,11 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" +commander@^12.0.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + commander@^2.2.0, commander@^2.20.0: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" @@ -5235,6 +5387,11 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" +cuint@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" + integrity sha512-d4ZVpCW31eWwCMe1YT3ur7mUDnTXbgwyzaL320DrcRT45rfjYxkt5QWLrmOJ+/UEAI2+fQgKe/fCjR8l4TpRgw== + data-urls@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz" @@ -5368,6 +5525,11 @@ depd@^1.1.2, depd@~1.1.2: resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +dependency-graph@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-1.0.0.tgz#bb5e85aec1310bc13b22dbd76e3196c4ee4c10d2" + integrity sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg== + dequal@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz" @@ -5723,7 +5885,7 @@ esbuild@0.21.5, esbuild@^0.21.3: "@esbuild/win32-ia32" "0.21.5" "@esbuild/win32-x64" "0.21.5" -esbuild@>=0.15.13: +esbuild@>=0.15.13, esbuild@^0.23.0: version "0.23.0" resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz" integrity sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA== @@ -5905,6 +6067,11 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" @@ -6077,7 +6244,7 @@ fast-glob@3.2.7: merge2 "^1.3.0" micromatch "^4.0.4" -fast-glob@3.3.2, fast-glob@^3.2.12, fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.2: +fast-glob@3.3.2, fast-glob@^3.2.12, fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.0, fast-glob@^3.3.1, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -6936,6 +7103,13 @@ ini@^1.3.4: resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +injection-js@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/injection-js/-/injection-js-2.4.0.tgz#ebe8871b1a349f23294eaa751bbd8209a636e754" + integrity sha512-6jiJt0tCAo9zjHbcwLiPL+IuNe9SQ6a9g0PEzafThW3fOQi0mrmiJGBJvDD6tmhPh8cQHIQtCOrJuBfQME4kPA== + dependencies: + tslib "^2.0.0" + ip-address@^9.0.5: version "9.0.5" resolved "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz" @@ -6966,6 +7140,13 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-builtin-module@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" + integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== + dependencies: + builtin-modules "^3.3.0" + is-core-module@^2.13.0: version "2.15.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz" @@ -7041,6 +7222,11 @@ is-lambda@^1.0.1: resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz" integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== + is-network-error@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/is-network-error/-/is-network-error-1.1.0.tgz" @@ -7349,7 +7535,7 @@ jest-environment-jsdom@^29.0.0, jest-environment-jsdom@^29.4.1: jest-util "^29.7.0" jsdom "^20.0.0" -jest-environment-node@^29.7.0: +jest-environment-node@^29.4.1, jest-environment-node@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz" integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== @@ -7756,7 +7942,7 @@ jsonc-parser@3.2.0: resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== -jsonc-parser@3.3.1: +jsonc-parser@3.3.1, jsonc-parser@^3.2.0: version "3.3.1" resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz" integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== @@ -7912,7 +8098,7 @@ less@4.1.3: needle "^3.1.0" source-map "~0.6.0" -less@4.2.0: +less@4.2.0, less@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/less/-/less-4.2.0.tgz" integrity sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA== @@ -8156,7 +8342,7 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-dir@^3.0.2: +make-dir@^3.0.2, make-dir@~3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== @@ -8287,6 +8473,11 @@ mime@1.6.0, mime@^1.4.1, mime@^1.6.0: resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mime@~2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" + integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" @@ -8340,6 +8531,13 @@ minimatch@^9.0.0, minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" +minimatch@~3.0.4: + version "3.0.8" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" + integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q== + dependencies: + brace-expansion "^1.1.7" + minimist@^1.2.0, minimist@^1.2.6: version "1.2.8" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" @@ -8517,6 +8715,36 @@ neo-async@^2.6.2: resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +ng-packagr@~18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/ng-packagr/-/ng-packagr-18.1.0.tgz#e36f5ce95fde9bcdc1b075cb41f010f4df460d88" + integrity sha512-QfqiCIuRX7VhdHqE1goZIuaFh0aMmFTF6r+gP+iq7YyIookXlZWswEZYcnpyRw52Q1RHFdUJRm7foBRFyEXTLA== + dependencies: + "@rollup/plugin-json" "^6.1.0" + "@rollup/plugin-node-resolve" "^15.2.3" + "@rollup/wasm-node" "^4.18.0" + ajv "^8.12.0" + ansi-colors "^4.1.3" + browserslist "^4.22.1" + cacache "^18.0.0" + chokidar "^3.5.3" + commander "^12.0.0" + convert-source-map "^2.0.0" + dependency-graph "^1.0.0" + esbuild "^0.23.0" + fast-glob "^3.3.1" + find-cache-dir "^3.3.2" + injection-js "^2.4.0" + jsonc-parser "^3.2.0" + less "^4.2.0" + ora "^5.1.0" + piscina "^4.4.0" + postcss "^8.4.31" + rxjs "^7.8.1" + sass "^1.69.5" + optionalDependencies: + rollup "^4.18.0" + nice-napi@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz" @@ -8889,7 +9117,7 @@ ora@5.3.0: strip-ansi "^6.0.0" wcwidth "^1.0.1" -ora@5.4.1: +ora@5.4.1, ora@^5.1.0: version "5.4.1" resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz" integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== @@ -9489,6 +9717,16 @@ postcss-unique-selectors@^6.0.4: dependencies: postcss-selector-parser "^6.0.16" +postcss-url@~10.1.3: + version "10.1.3" + resolved "https://registry.yarnpkg.com/postcss-url/-/postcss-url-10.1.3.tgz#54120cc910309e2475ec05c2cfa8f8a2deafdf1e" + integrity sha512-FUzyxfI5l2tKmXdYc6VTu3TWZsInayEKPbiyW+P6vmmIrrb4I6CGX0BFoewgYHLK+oIL5FECEK02REYRpBvUCw== + dependencies: + make-dir "~3.1.0" + mime "~2.5.2" + minimatch "~3.0.4" + xxhashjs "~0.2.2" + postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz" @@ -9503,7 +9741,7 @@ postcss@8.4.38: picocolors "^1.0.0" source-map-js "^1.2.0" -postcss@^8.2.14, postcss@^8.4.23, postcss@^8.4.24, postcss@^8.4.33, postcss@^8.4.38, postcss@^8.4.5: +postcss@^8.2.14, postcss@^8.4.23, postcss@^8.4.24, postcss@^8.4.31, postcss@^8.4.33, postcss@^8.4.38, postcss@^8.4.5: version "8.4.39" resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz" integrity sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw== @@ -9816,7 +10054,7 @@ resolve.exports@^2.0.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz" integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== -resolve@1.22.8, resolve@^1.1.7, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.2: +resolve@1.22.8, resolve@^1.1.7, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.22.2: version "1.22.8" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -9933,6 +10171,31 @@ rollup@^4.13.0: "@rollup/rollup-win32-x64-msvc" "4.18.1" fsevents "~2.3.2" +rollup@^4.18.0: + version "4.19.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.19.0.tgz#83b08cc0b2bc38c26c194cb7f2cdabd84a2a8c02" + integrity sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA== + dependencies: + "@types/estree" "1.0.5" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.19.0" + "@rollup/rollup-android-arm64" "4.19.0" + "@rollup/rollup-darwin-arm64" "4.19.0" + "@rollup/rollup-darwin-x64" "4.19.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.19.0" + "@rollup/rollup-linux-arm-musleabihf" "4.19.0" + "@rollup/rollup-linux-arm64-gnu" "4.19.0" + "@rollup/rollup-linux-arm64-musl" "4.19.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.19.0" + "@rollup/rollup-linux-riscv64-gnu" "4.19.0" + "@rollup/rollup-linux-s390x-gnu" "4.19.0" + "@rollup/rollup-linux-x64-gnu" "4.19.0" + "@rollup/rollup-linux-x64-musl" "4.19.0" + "@rollup/rollup-win32-arm64-msvc" "4.19.0" + "@rollup/rollup-win32-ia32-msvc" "4.19.0" + "@rollup/rollup-win32-x64-msvc" "4.19.0" + fsevents "~2.3.2" + run-applescript@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz" @@ -9950,7 +10213,7 @@ rx@4.1.0: resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" integrity sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug== -rxjs@7.8.1, rxjs@^7.8.0, rxjs@~7.8.0: +rxjs@7.8.1, rxjs@^7.8.0, rxjs@^7.8.1, rxjs@~7.8.0: version "7.8.1" resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== @@ -9996,7 +10259,7 @@ sass@1.77.6: immutable "^4.0.0" source-map-js ">=0.6.2 <2.0.0" -sass@^1.42.1: +sass@^1.42.1, sass@^1.69.5: version "1.77.8" resolved "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz" integrity sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ== @@ -11610,6 +11873,13 @@ xmlhttprequest-ssl@~2.0.0: resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== +xxhashjs@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/xxhashjs/-/xxhashjs-0.2.2.tgz#8a6251567621a1c46a5ae204da0249c7f8caa9d8" + integrity sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw== + dependencies: + cuint "^0.2.2" + y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" From f9beacd804d48150b6334b2e818b6da6cb71df26 Mon Sep 17 00:00:00 2001 From: Valery Melou Date: Sat, 20 Jul 2024 20:35:24 +0100 Subject: [PATCH 2/3] tests: fix tests for the blog-data-access --- apps/website/src/app/app.config.ts | 5 +++- .../src/lib/article.resolver.spec.ts | 29 +++++++++++++++---- .../src/lib/article.service.spec.ts | 13 +++++++++ .../src/lib/articles.resolver.spec.ts | 27 ++++++++++++++--- 4 files changed, 64 insertions(+), 10 deletions(-) diff --git a/apps/website/src/app/app.config.ts b/apps/website/src/app/app.config.ts index 15d9712f..9064e29d 100644 --- a/apps/website/src/app/app.config.ts +++ b/apps/website/src/app/app.config.ts @@ -33,7 +33,10 @@ export const appConfig: ApplicationConfig = { matches: true, }), location: { - origin: 'https://valerymelou.com', + origin: + process.env['VM_CONTENTFUL_ENVIRONMENT'] === 'master' + ? 'https://valerymelou.com' + : 'https://staging.valerymelou.com/', href: '', }, }; diff --git a/libs/blog/data-access/src/lib/article.resolver.spec.ts b/libs/blog/data-access/src/lib/article.resolver.spec.ts index af62bf11..cee046ff 100644 --- a/libs/blog/data-access/src/lib/article.resolver.spec.ts +++ b/libs/blog/data-access/src/lib/article.resolver.spec.ts @@ -1,18 +1,37 @@ import { TestBed } from '@angular/core/testing'; -import { ResolveFn } from '@angular/router'; +import { + ActivatedRouteSnapshot, + ResolveFn, + RouterStateSnapshot, +} from '@angular/router'; + +import { of } from 'rxjs'; -import { articleResolver } from './article.resolver'; import { Article } from './article'; +import { articleResolver } from './article.resolver'; +import { ArticleService } from './article.service'; describe('articleResolver', () => { const executeResolver: ResolveFn
    = (...resolverParameters) => TestBed.runInInjectionContext(() => articleResolver(...resolverParameters)); beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + providers: [ + { + provide: ArticleService, + useValue: { getOne: () => of(new Article()) }, + }, + ], + }); }); - it('should be created', () => { - expect(executeResolver).toBeTruthy(); + it('should get the article', () => { + const route: unknown = { params: { slug: '2024-07-20-test-article' } }; + const articleService = TestBed.inject(ArticleService); + const getOneSpy = jest.spyOn(articleService, 'getOne'); + + executeResolver(route as ActivatedRouteSnapshot, {} as RouterStateSnapshot); + expect(getOneSpy).toHaveBeenCalledWith('test-article'); }); }); diff --git a/libs/blog/data-access/src/lib/article.service.spec.ts b/libs/blog/data-access/src/lib/article.service.spec.ts index a5acc001..1ccf8a14 100644 --- a/libs/blog/data-access/src/lib/article.service.spec.ts +++ b/libs/blog/data-access/src/lib/article.service.spec.ts @@ -373,4 +373,17 @@ describe('ArticleService', () => { expect(articles.items.length === 1); }); }); + + it('should get one article entry', () => { + service + .getOne( + 'the-django-administration-site-one-of-the-reasons-why-i-love-django', + ) + .subscribe((article: Article) => { + expect( + article.title === + 'The Django administration site: One of the reasons why I love Django', + ); + }); + }); }); diff --git a/libs/blog/data-access/src/lib/articles.resolver.spec.ts b/libs/blog/data-access/src/lib/articles.resolver.spec.ts index 32af216b..1cbd8131 100644 --- a/libs/blog/data-access/src/lib/articles.resolver.spec.ts +++ b/libs/blog/data-access/src/lib/articles.resolver.spec.ts @@ -1,9 +1,15 @@ import { TestBed } from '@angular/core/testing'; -import { ResolveFn } from '@angular/router'; +import { + ActivatedRouteSnapshot, + ResolveFn, + RouterStateSnapshot, +} from '@angular/router'; import { articlesResolver } from './articles.resolver'; import { Results } from './results'; import { Article } from './article'; +import { ArticleService } from './article.service'; +import { of } from 'rxjs'; describe('articlesResolver', () => { const executeResolver: ResolveFn> = ( @@ -14,10 +20,23 @@ describe('articlesResolver', () => { ); beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + providers: [ + { + provide: ArticleService, + useValue: { + get: () => of({ items: [new Article(), new Article()] }), + }, + }, + ], + }); }); - it('should be created', () => { - expect(executeResolver).toBeTruthy(); + it('should get the articles', () => { + const articleService = TestBed.inject(ArticleService); + const getSpy = jest.spyOn(articleService, 'get'); + + executeResolver({} as ActivatedRouteSnapshot, {} as RouterStateSnapshot); + expect(getSpy).toHaveBeenCalled(); }); }); From fc44acf6183a90c2ec2201c2ca44f01da3ee0c14 Mon Sep 17 00:00:00 2001 From: Valery Melou Date: Sat, 20 Jul 2024 20:57:45 +0100 Subject: [PATCH 3/3] fix: links text --- libs/blog/feature-home/src/lib/blog-home.component.html | 3 +-- libs/pages/home/src/lib/home.component.html | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/blog/feature-home/src/lib/blog-home.component.html b/libs/blog/feature-home/src/lib/blog-home.component.html index 0244e882..3fe4e6a0 100644 --- a/libs/blog/feature-home/src/lib/blog-home.component.html +++ b/libs/blog/feature-home/src/lib/blog-home.component.html @@ -62,13 +62,12 @@

    '/blog', (article.createdAt | date: 'YYYY-MM-dd') + '-' + article.slug, ]" - aria-label="Read more" > - Read more + Read the article

    } diff --git a/libs/pages/home/src/lib/home.component.html b/libs/pages/home/src/lib/home.component.html index 06cdb877..4c1b58a7 100644 --- a/libs/pages/home/src/lib/home.component.html +++ b/libs/pages/home/src/lib/home.component.html @@ -11,7 +11,9 @@

    mobile.