Git Product home page Git Product logo

website's Introduction

@davidlj95/website

This project was generated with Angular CLI version 16.2.0.

To start

First, run the prebuild command, to generate files that are required for the app to work

pnpm run prebuild

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Commit message guidelines

Commit messages follow the conventional commits guidelines. This allows for automating the semantic versioning release process using semantic release

Commit message lint

To enforce that, commitlint is used. It reads the commit messages on a PR and ensures they follow conventional commits convention.

You can use the following run script to ensure the last commit follows the guidelines:

pnpm run commitlint:last

Release

Semantic Release is used to automate the release process. Based on commit messages, a new major, minor or patch release is generated for every push to main branch. For every release, a Git tag will be created, a GitHub release will be created and a new version of the app will be published to npm public registry. All of this is managed automatically by Semantic Release and CI/CD pipelines.

Config has been tweaked so all commits appear in the release notes. To do so, types of commits included are all of those defined in Conventional Changelog type defaults. But none is hidden. That list comprehends all commit types that commitlint will lint.

Getting release info

In order to embed release information in the app, a script was created to export that kind of information using Semantic Release's JavaScript API.

To generate the release info, run

pnpm run prebuild:generate-release-file

It will generate a release.json file in the root of the repository containing all info about releases that Semantic Release provides.

⚠️ Next release can be fake

The API only outputs information when a new release has to be generated. As a workaround, a fake patch release is generated in case no release was needed to get access to all that info.

To distinguish a real run from a faked run, a fake property exists in that JSON with value set to true. The only faked properties are about next release (nextRelease and releases at the moment of writing this). Info about last release remains correct even when faking the release to generate the output (lastRelease at the moment of writing this)

⚠️ Next release can be a preview

If running the script from a branch that's not configured to trigger releases, the default API behaviour is to output no data. As a workaround, we simulate being on the main branch and see what would happen in that scenario when including commits from the current branch.

To distinguish a real run from a faked run, a preview property exists in that JSON with value set to true. This is because it's a simulation of this branch being merged into main branch. But you could want to merge that against another (the script could be smarter and simulate that too, but not yet :P).

⚠️ Next release can be fake and preview If both of previous situations happen at same time (commits of branch are not enough to trigger a release and branch is not one configured for releases)

Git hooks

Not a fan of, but it's useful to enforce conventional commits & format your code before submitting it

To use it, run

pnpm run git-hooks

It will install Git hooks via husky. Now everytime you commit, you'll be sure commit message guidelines are enforced.

This is very useful if you can push to main directly. Because there's no way to reject commits that don't follow the commit message guidelines. And once you push to main, you cannot amend that commit as per branch protection rules.

Autogenerated files from templates

Some metadata about the app (like title, author, theme color...) was repeated across files. So used LiquidJS to create template files (.liquid extension). Then, created a small script to render templates into generated files using metadata defined in metadata.ts file (and some hardcoded constants in the generation script)

If you update some metadata in that file, run the script to update files generated from templates. Otherwise, they won't be in sync.

Automatically updating generated files is not straightforward. Doing something before/after an Angular app build runs is not an option right now. Adding a bunch of pre npm run scripts left the package.json file quite cluttered. Also, won't work if issuing ng commands. So decided to leave the task to update generated files to the developer. At some point a CI check could be introduced to ensure generated files are up-to-date. Generated files are left in the repo because of that reason (and also so you can clone & run without issues). That metadata won't change often anyway.

Quirks

Preview deployments

Can only be triggered by users with write access to the repo (to prevent secrets from being leaked). Same secret is used for production access, so better keep that one safe.

Also, branch names should be short. Otherwise, the canonicalUrl may be incorrect, given we try to generate the URL following docs about it in Cloudflare Pages docs. But the exact algorithm to generate the preview URL from branch name is not published. Empirically, it is known that branch names get shorten if they exceed a certain length.

See #289 for more info.

Rendering font subsets

Some fonts included are a subset of a big font file. Before doing anything, please run

pnpm run prebuild:font-subsets

To generate them. Otherwise, those fonts won't be found and you may get some errors. Also, remember to run it if changing the glyphs included in each font. Or to add the new glyphs if you want to use more glyphs of a font.

CI/CD

GitHub Actions are used

Commands ran by CI/CD

In order to ease running CI/CD commands locally, the .ci directory contains a Makefile intended to contain all commands that will be run in CI/CD pipelines. So you can test those locally easily

Just:

cd .ci && make test # for instance

And see how a command run in the CI/CD behaves locally. Notice your machine's state may differ from the CI/CD machine one.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

website's People

Contributors

davidlj95 avatar dependabot[bot] avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar

website's Issues

refactor: abstract cards grid layout

Discussed in #315

Originally posted by davidlj95 March 20, 2024

The SCSS code to include the cards layout is repeated across experience, education and projects components. This part could be DRYed.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • build(deps): update angular monorepo to v18.0.4 (@angular/animations, @angular/common, @angular/compiler, @angular/compiler-cli, @angular/core, @angular/forms, @angular/platform-browser, @angular/platform-browser-dynamic, @angular/platform-server, @angular/router)
  • build(deps-dev): update angular-cli monorepo to v18.0.5 (@angular-devkit/build-angular, @angular/cli, @angular/ssr)
  • build(deps-dev): update dependency glob to v10.4.2
  • build(deps-dev): update dependency tsx to v4.15.7
  • build(deps): update dependency simple-icons to v12.4.0
  • build(deps-dev): update dependency eslint to v9

Detected dependencies

github-actions
.github/actions/setup/action.yml
  • pnpm/action-setup v4.0.0@fe02b34f77f8bc703788d5817da081398fad5dd2
  • actions/setup-node v4@60edb5dd545a775178f52524783378180af0d1f8
.github/workflows/reusable-build.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/cache v4@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
  • actions/upload-artifact v4@65462800fd760344b1a7b4382951275a0abb4808
.github/workflows/reusable-deploy-cloudflare-pages.yml
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
  • actions/github-script v7@60a0d83039c74a4aee543508d2ffcb1c3799cdea
  • cloudflare/pages-action 1@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca
.github/workflows/reusable-deploy-github-pages.yml
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
  • actions/configure-pages v5@983d7736d9b0ae728b81ab479565c72886d7745b
  • actions/upload-pages-artifact v3@56afc609e74202658d3ffba0e8f6dda462b719fa
  • actions/deploy-pages v4@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
.github/workflows/reusable-lint.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
.github/workflows/reusable-performance.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
  • manrueda/lighthouse-report-action v1.1.2@731523717dc2a4a92b3c1f67e2710a8261f3ccbb
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
.github/workflows/reusable-release.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
.github/workflows/reusable-style.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
.github/workflows/reusable-test.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • livewing/lcov-job-summary v1.1.0@0a9952db27f98def2ba2de3189c6b24acc4c5501
nodenv
.node-version
  • node 20.15.0
npm
package.json
  • @angular/animations 18.0.2
  • @angular/common 18.0.2
  • @angular/compiler 18.0.2
  • @angular/core 18.0.2
  • @angular/forms 18.0.2
  • @angular/platform-browser 18.0.2
  • @angular/platform-browser-dynamic 18.0.2
  • @angular/platform-server 18.0.2
  • @angular/router 18.0.2
  • @angular/ssr 18.0.3
  • @davidlj95/ngx-meta 1.0.0-beta.4
  • @fontsource/roboto 5.0.13
  • @fontsource/roboto-mono 5.0.18
  • @ng-icons/core 27.5.2
  • @ng-icons/font-awesome 27.5.2
  • compression 1.7.4
  • express 4.19.2
  • gardevoir 1.0.0
  • rxjs 7.8.1
  • simple-icons 12.3.0
  • tslib 2.6.3
  • zone.js 0.14.7
  • @angular-devkit/build-angular 18.0.3
  • @angular-eslint/builder 18.0.1
  • @angular-eslint/eslint-plugin 18.0.1
  • @angular-eslint/eslint-plugin-template 18.0.1
  • @angular-eslint/schematics 18.0.1
  • @angular-eslint/template-parser 18.0.1
  • @angular/cli 18.0.3
  • @angular/compiler-cli 18.0.2
  • @commitlint/cli 19.3.0
  • @commitlint/config-conventional 19.2.2
  • @commitlint/types 19.0.3
  • @lhci/cli 0.14.0
  • @types/compression 1.7.5
  • @types/express 4.17.21
  • @types/jasmine 5.1.4
  • @types/node 20.14.8
  • @types/signale 1.4.7
  • @types/subset-font 1.4.3
  • @typescript-eslint/eslint-plugin 7.13.1
  • @typescript-eslint/parser 7.13.1
  • browser-sync 3.0.2
  • bundlewatch 0.3.3
  • conventional-changelog-conventionalcommits 8.0.0
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-formatter-multiple 2.0.0
  • execa 9.3.0
  • glob 10.4.1
  • husky 9.0.11
  • jasmine-core 5.1.2
  • karma 6.4.3
  • karma-chrome-launcher 3.2.0
  • karma-coverage 2.2.1
  • karma-jasmine 5.1.0
  • karma-jasmine-html-reporter 2.1.0
  • karma-junit-reporter 2.0.1
  • lint-staged 15.2.7
  • liquidjs 10.14.0
  • ng-mocks 14.13.0
  • prettier 3.3.2
  • semantic-release 24.0.0
  • subset-font 2.3.0
  • tsm 2.3.0
  • tsx 4.15.5
  • typescript 5.4.5
  • pnpm 9.4.0

  • Check this box to trigger a request for Renovate to run again on this repository

chipped-content: better accessible UX

When using VoiceOver + Chrome and tapping on a chip that toggles content, focus is lost. Therefore you end up again in the main group. And have to navigate again all the way down to the same place to be able to read the recently appeared content.

Maybe using ARIA APG's disclosure pattern here would help. Instead of a button role.

attribute: better accessible UX

When activating VoiceOver, an attribute is read as "Empty group". Given the icon is not readable. When using tab sequence, you get the instruction that more content is available. And then, a "description" appears indicating the attribute tooltip content.

Maybe a better experience would be to use aria-describedby on the host element. Given tooltip pattern is in progress in ARIA

ci: dependabot PRs fail commit lint CI step

Discussed in #326

Originally posted by davidlj95 March 23, 2024
Example:
https://github.com/davidlj95/website/actions/runs/8381697338/job/22953838634?pr=322

Log

Run pnpm commitlint \
  pnpm commitlint \
    --from 4c648b47aa61ccc[2](https://github.com/davidlj95/website/actions/runs/8381697338/job/22953838634?pr=322#step:5:2)b9bf601e0517206c4fca0918~1 \
    --to 4c648b47aa61ccc2b9bf601e0517206c4fca0918 \
    --verbose
  shell: /usr/bin/bash -e {0}
  env:
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
⧗   input: build(deps-dev): bump webpack-dev-middleware from 5.[3](https://github.com/davidlj95/website/actions/runs/8381697338/job/22953838634?pr=322#step:5:3).3 to 5.3.[4](https://github.com/davidlj95/website/actions/runs/8381697338/job/22953838634?pr=322#step:5:4)

Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from [5](https://github.com/davidlj95/website/actions/runs/8381697338/job/22953838634?pr=322#step:5:5).3.3 to 5.3.4.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
✖   body's lines must not be longer than [10](https://github.com/davidlj95/website/actions/runs/8381697338/job/22953838634?pr=322#step:5:11)0 characters [body-max-line-length]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

Error: Process completed with exit code 1.

chip: transitions do not work

When toggling between light and dark color schemes, the background-color property transition does not trigger. However, the transition is set in the element as inspected in DevTools. Also, the background color is explicitly set on the element.

Can be easily seen by pausing animations in Animation DevTools. Everything doesn't change (as animations are stopped), except chips :S

Maybe because the .selected class?

refactor: abstract content component common features

Content components (experience item summary, highlights and education item score, courses) all expose an API to wait for animation end. To then generate the content and fill the waitForAnimationEnd. Maybe all of that could be abstracted in something like abstract class ContentComponent

it would reduce tests implementation size too

description: avoid layout shift when hydrating in client's browser

In order to allow the description component to display all content if JavaScript is not enabled in the browser, all description content was displayed at first. Then, when rendering on the client, if JavaScript is enabled, contents would be collapsed. But that generated a huge layout shift. So as workaround, all description content is hidden until made visible later by JS. But that generates also a layout shift: from nothing to the collapsed content.

To avoid this shift, we could do something like in chipped content. Display expanded when rendering on server, but with items that would be hidden in browser hidden by CSS. Then, when hydrating on the client, there would be no shift.

docs: add them :P

There are some things documented in README.md and some favicon quirks in docs/favicon.md.

But there are many things going on here that would be worth explaining + structuring everything all together.

Something like:

  • README.md: short version of current. mainly description, cool badges, instructions of how to setup the project, run it locally and links to rest of docs.
  • CONTRIBUTING.md: PR flow, code of conduct?, conventional commits
  • docs
    Index with all contents:
    • How it is build
      • Favicons (already exists)
      • Templated files
      • Server side rendering
      • Animations: based on Material 3 guidelines
      • Design: Chrome DevTools using DevTools inspector
    • Tooling
      • CI/CD with GitHub Actions
      • Conventional Commits
      • (Semantic) Releases
      • Deployments: GitHub Pages, GitLab Pages (deploy previews)
    • Features
      • ARIA support
      • Color scheme toggler
      • Non JS support
      • Cool files: security.txt and humans.txt
      • JSON Resume: explain custom fields too. Maybe schema extending official with custom fields + use this schema with IDE
      • Easter eggs list?

Could be nice to have some tool to publish docs somewhere in a nice format. Though maybe it's unneeded overhead. Markdown should be enough.

refactor: local images mapper

In experience and education items, the method to generate image sources is the same. It is also the same one in incoming projects feature #118

We could add a service or something to abstract this common logic

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • build(deps-dev): update dependency @types/node to v20.13.0
  • build(deps-dev): update dependency eslint to v9
  • build(deps-dev): update dependency semantic-release to v24

Detected dependencies

github-actions
.github/actions/setup/action.yml
  • pnpm/action-setup v4.0.0@fe02b34f77f8bc703788d5817da081398fad5dd2
  • actions/setup-node v4@60edb5dd545a775178f52524783378180af0d1f8
.github/workflows/reusable-build.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/cache v4@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
  • actions/upload-artifact v4@65462800fd760344b1a7b4382951275a0abb4808
.github/workflows/reusable-deploy-cloudflare-pages.yml
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
  • actions/github-script v7@60a0d83039c74a4aee543508d2ffcb1c3799cdea
  • cloudflare/pages-action 1@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca
.github/workflows/reusable-deploy-github-pages.yml
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
  • actions/configure-pages v5@983d7736d9b0ae728b81ab479565c72886d7745b
  • actions/upload-pages-artifact v3@56afc609e74202658d3ffba0e8f6dda462b719fa
  • actions/deploy-pages v4@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
.github/workflows/reusable-lint.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
.github/workflows/reusable-performance.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
  • manrueda/lighthouse-report-action v1.1.2@731523717dc2a4a92b3c1f67e2710a8261f3ccbb
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/download-artifact v4@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
.github/workflows/reusable-release.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
.github/workflows/reusable-style.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
.github/workflows/reusable-test.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • livewing/lcov-job-summary v1.1.0@0a9952db27f98def2ba2de3189c6b24acc4c5501
nodenv
.node-version
  • node 20.14.0
npm
package.json
  • @angular/animations 18.0.1
  • @angular/common 18.0.1
  • @angular/compiler 18.0.1
  • @angular/core 18.0.1
  • @angular/forms 18.0.1
  • @angular/platform-browser 18.0.1
  • @angular/platform-browser-dynamic 18.0.1
  • @angular/platform-server 18.0.1
  • @angular/router 18.0.1
  • @angular/ssr 18.0.2
  • @davidlj95/ngx-meta 1.0.0-beta.4
  • @fontsource/roboto 5.0.13
  • @fontsource/roboto-mono 5.0.18
  • @ng-icons/core 27.5.2
  • @ng-icons/font-awesome 27.5.2
  • compression 1.7.4
  • express 4.19.2
  • gardevoir 1.0.0
  • rxjs 7.8.1
  • simple-icons 12.0.0
  • tslib 2.6.2
  • zone.js 0.14.6
  • @angular-devkit/build-angular 18.0.2
  • @angular-eslint/builder 18.0.1
  • @angular-eslint/eslint-plugin 18.0.1
  • @angular-eslint/eslint-plugin-template 18.0.1
  • @angular-eslint/schematics 18.0.1
  • @angular-eslint/template-parser 18.0.1
  • @angular/cli 18.0.2
  • @angular/compiler-cli 18.0.1
  • @commitlint/cli 19.3.0
  • @commitlint/config-conventional 19.2.2
  • @commitlint/types 19.0.3
  • @lhci/cli 0.13.0
  • @types/compression 1.7.5
  • @types/express 4.17.21
  • @types/jasmine 5.1.4
  • @types/node 20.12.13
  • @types/signale 1.4.7
  • @types/subset-font 1.4.3
  • @typescript-eslint/eslint-plugin 7.11.0
  • @typescript-eslint/parser 7.11.0
  • browser-sync 3.0.2
  • bundlewatch 0.3.3
  • conventional-changelog-conventionalcommits 7.0.2
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-formatter-multiple 2.0.0
  • execa 9.1.0
  • glob 10.4.1
  • husky 9.0.11
  • jasmine-core 5.1.2
  • karma 6.4.3
  • karma-chrome-launcher 3.2.0
  • karma-coverage 2.2.1
  • karma-jasmine 5.1.0
  • karma-jasmine-html-reporter 2.1.0
  • karma-junit-reporter 2.0.1
  • lint-staged 15.2.5
  • liquidjs 10.13.1
  • ng-mocks 14.12.2
  • prettier 3.2.5
  • semantic-release 23.1.1
  • subset-font 2.3.0
  • tsm 2.3.0
  • tsx 4.11.0
  • typescript 5.4.5
  • pnpm 9.1.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.