The Node.js® Website

Document inclusion of `.vscode` files (#5947)

* fix: resolve typos

* docs(COLLABORATOR_GUIDE): define our .vscode stance

* Update COLLABORATOR_GUIDE.md

Co-authored-by: Claudio W <cwunder@gnome.org>
Signed-off-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>

* add npmrc documentation

* Update COLLABORATOR_GUIDE.md

Co-authored-by: Claudio W <cwunder@gnome.org>
Signed-off-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>

* mention css parser

* Update COLLABORATOR_GUIDE.md

Co-authored-by: Claudio W <cwunder@gnome.org>
Signed-off-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>

---------

Signed-off-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com>
Co-authored-by: Claudio W <cwunder@gnome.org>

authored by Brian Muenzenmeyer Claudio W and committed by GitHub 20aaab8a 7076c742

+16 -2
COLLABORATOR_GUIDE.md
··· 17 17 - [General Guidelines for Unit Tests](#general-guidelines-for-unit-tests) 18 18 - [General Guidelines for Storybooks](#general-guidelines-for-storybooks) 19 19 - [Remarks on Technologies used](#remarks-on-technologies-used) 20 + - [Seeking additional clarification](#seeking-additional-clarification) 20 21 21 22 This document contains information for Collaborators of the Node.js website project regarding maintaining the code, documentation, and issues. 22 23 ··· 244 245 - When importing types, use `import type { NameOfImport } from 'module'` 245 246 - When defining a Component, use the `FC` type from React to define the type of the Component 246 247 - When using `children` as a prop, use the `FC<PropsWithChildren<MyComponentProps>>` type instead 247 - - Alterenatively you can define your type as `type MyComponentProps = PropsWithChildren<{ my other props}>` 248 + - Alternatively you can define your type as `type MyComponentProps = PropsWithChildren<{ my other props }>` 248 249 - Each Props type should be prefixed by the name of the Component 249 250 - Components should always be the `default` export of a React Component file 250 251 - Avoid using DOM/Web APIs/`document`/`window` API access within a React Component. ··· 461 462 - Hence if Builds fail unexpectedly, make sure that your dependency that is being used during build-time is on `dependencies` and not `devDependencies`. Checkout out [DEPENDENCY_PINNING.md](./DEPENDENCY_PINNING.md) for more information. 462 463 - Our sponsorship with Vercel is maintained by the OpenJS Foundation 463 464 464 - ### Seeking additional clarification 465 + ### Why we have a `.vscode` folder 466 + 467 + The repository defines an optimized configuration for code editing. This is optional and is not required to contribute to the project. However, the settings and extensions specified help create a uniform and more efficient developer experience. This configuration is found in the `.vscode` directory: 468 + 469 + - `extensions.json` suggests VSCode extensions that make the editor more compatible with the code. For example, a Tailwind extension creates auto-complete intellisense for tailwind styles within our components. Eslint, prettier, and editorconfig extensions read their respective config files and automatically format or lint code as written. This helps save CI feedback loops when a contribution does not meet our standards. 470 + - `settings.json` contains some common sense defaults that aide development and enforce consistency across the codebase. For example, we want files formatted on save and we want prettier to be used as the formatter. Without these settings, new contributors may have different authoring experiences when contributing, leading to inconsistent code and CI failures. We also disable VSCode's default CSS parser so PostCSS and Tailwind syntax are respected. 471 + 472 + Defining a `.vscode` configuration like this also aides browser-only development using [GitHub's Codespaces feature](https://github.com/features/codespaces). The web-based GUI will read these same configuration files and setup the remote development environment the same way every time. 473 + 474 + ### Why we have an `.npmrc` file 475 + 476 + The npm ecosystem resolution and installation of `peerDependencies` installation [changed in recent versions](https://nodejs.org/en/blog/npm/peer-dependencies#using-peer-dependencies). The project documents what version of `Node.js` and `npm` to use via the [`.nvmrc` file](https://github.com/nodejs/nodejs.org/blob/main/.nvmrc). Not all contributors have tooling to automatically read this file and adhere to the correct version, however. To ensure all contributors install dependencies the same way, a local `.npmrc` file directly configures peerDependency installation behavior. 477 + 478 + ## Seeking additional clarification 465 479 466 480 A lot of the current structure is due to retro-compatibility, keeping a simple and familiar file structure and keeping files that have historical reasons or needs. 467 481
+4 -4
CONTRIBUTING.md
··· 47 47 - The nomination must have at least three existing members of the Website Team agree with the nomination. 48 48 - This can be done through commenting with "agreement" (showing support) or reacting to the Issue with a :+1: (Thumbs-up Emoji) 49 49 - The Issue must be open for at least 72 hours without an objection from an existing member of the Website Team 50 - - The nomination cannot pass until all open discordances/objections are resolved. 50 + - The nomination cannot pass until all open objections are resolved. 51 51 - Objections from the TSC or Core Collaborators are also counted as valid objections. 52 52 53 53 </details> ··· 122 122 > By default if you run the Website (either via `npm run serve` or `npm run build`) two files on the `public` folder will be generated. 123 123 > 124 124 > You don't need to reset/discard these files, as by default we use Git Hooks that simply ignore these files during commit. 125 - > Note that these files are generated and should **not** be commited. (`public/node-release-data.json` and `public/blog-posts-data.json`) 125 + > Note that these files are generated and should **not** be committed. (`public/node-release-data.json` and `public/blog-posts-data.json`) 126 126 127 127 > [!IMPORTANT]\ 128 128 > Before committing and opening a Pull Request, please go first through our [Commit](#commit-guidelines) and [Pull Request](#pull-request-policy) guidelines outlined below. ··· 134 134 > We use [GitHub Merge Queues](https://github.blog/2023-07-12-github-merge-queue-is-generally-available/) 135 135 > which means that before merge the PRs get automatically updated and checked against the latest changes on the base branch. 136 136 > 137 - > This also reduces the amount of times we need to run our CI checks, as every new push requires frehsly new CI-checks. 137 + > This also reduces the amount of times we need to run our CI checks, as every new push requires freshly new CI-checks. 138 138 139 139 ### CLI Commands 140 140 ··· 207 207 - Fast-tracking is only allowed for small bug fixes, small feature changes, localization changes, or other non-critical/highly-impacting changes not covered by the previous rule that allows PRs to be merged immediately. 208 208 - Fast-tracking cannot be used for updates on the `COLLABORATOR_GUIDE.md`, `CONTRIBUTING.md` guide, `CODEOWNERS`, GitHub Actions, or any security-impacting file or document that changes the governing policies of this repository. 209 209 - There must be no objections after forty-eight (48) hours (Or seventy-two (72) hours if the PR was authored on the weekend). 210 - - If there are disagrements consensus should be sought. Lack of consensus might require escalation to the Website Team Maintainers. 210 + - If there are disagreements consensus should be sought. Lack of consensus might require escalation to the Website Team Maintainers. 211 211 - At least one approval is required for any PR to be merged. 212 212 - Tests must be included in Pull Requests for new features or bug fixes. You are responsible for fixing any test(s) that fail. 213 213