From b6495d5b6c028fc7184912deaa1e7848846241a5 Mon Sep 17 00:00:00 2001 From: Peter Sergeant Date: Thu, 12 Aug 2021 19:05:27 +0100 Subject: [PATCH] Try and make the formatting and English a little more consistent (#2321) * Try and make the formatting and English a little more consistent * Wrap specifically at 80 rather than a more random approach * Little English language fixups, including making it more * fix: format Co-authored-by: Peter Sergeant Co-authored-by: Juan Picado --- CONTRIBUTING.md | 173 +++++++++++++++++++++++++++++------------------- 1 file changed, 104 insertions(+), 69 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11379c46e..ffb7744d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,8 @@ > Any change matters, whatever the size, just do it. -We are happy that you are willing to contribute. For that reason, we -have prepared these guidelines for you: +We're happy that you're considering contributing! To help, we've prepared these +guidelines for you: **Table of Contents** @@ -32,28 +32,30 @@ have prepared these guidelines for you: ## How Do I Contribute? -There are different ways to contribute, each comes with a different levels -of tasks, such as: +There are many ways to contribute: -- Report a bug. -- Request a feature you think would be great for verdaccio. -- Fix bugs. -- Test and triage reported bugs by others. -- Work on requested/approved features. -- Improve the codebase (lint, naming, comments, test descriptions, etc...) +- Report a bug +- Request a feature you think would be great for Verdaccio +- Fix bugs +- Test and triage bugs reported by others +- Work on requested/approved features +- Improve the codebase (linting, naming, comments, test descriptions, etc...) -Verdaccio has several areas of involvement, which might fit you better, eg: +The Verdaccio project is split into several areas: - **Core**: The [core](https://github.com/verdaccio/verdaccio) is the main repository, built with **Node.js**. -- **Website**: we uses [**Docusaurus**](https://docusaurus.io/) for the **website** and if you are familiar with this technology, you might become the official webmaster. +- **Website**: we use [**Docusaurus**](https://docusaurus.io/) for the **website** and if you are familiar with this technology, you might become the official webmaster. - **User Interface**: The [user Interface](https://github.com/verdaccio/ui) is based in **react** and **material-ui** and looking for front-end contributors. - **Kubernetes and Helm**: Ts the official repository for the [**Helm chart**](https://github.com/verdaccio/charts). -> There are other areas to contribute, like documentation, translation which are not hosted on this repo but check the last section of this notes for further information. +> There are other areas to contribute, like documentation, translation which are +> not hosted on this repo but check the last section of this notes for further +> information. ## Development Setup -Verdaccio uses [_pnpm_](https://pnpm.js.org/) as package manager for development in this repository. Please install the latest one: +Verdaccio uses [_pnpm_](https://pnpm.js.org/) as package manager for development +in this repository. Please install the latest one: ``` npm i -g pnpm @@ -79,62 +81,69 @@ pnpm build pnpm test ``` -Verdaccio is a mono repository, for running an specific test or package go the specific package eg: +Verdaccio is a mono repository. To run the tests for for a specific package: ``` cd packages/store pnpm test ``` -or an specific test in that package +or an specific test in that package: ``` pnpm test test/merge.dist.tags.spec.ts ``` -or a single test unit +or a single test unit: ``` pnpm test test/merge.dist.tags.spec.ts -- -t 'simple' ``` -The coverage is enabled by default, to speed up test running +Coverage reporting is enabled by default, but you can turn it off to speed up +test runs: ``` pnpm test test/merge.dist.tags.spec.ts -- -t 'simple' --coverage=false ``` -To increase debug output, we use `debug`, to enable it in your test just add +You can enable increased [`debug`](https://www.npmjs.com/package/debug) output: ``` -DEBUG=verdaccio* pnpm test +DEBUG=verdaccio:* pnpm test ``` More details in the debug section ### Running and debugging -We uses [`debug`](https://www.npmjs.com/package/debug) for debug outcome. Each package has it owns namespace. +We use [`debug`](https://www.npmjs.com/package/debug) to add helpful debugging +output to the code. Each package has it owns namespace. -### Debugging compiled code +#### Debugging compiled code -Currently you can only run in debug mode pre-compiled packages, to enable debug while running add the `verdaccio` namespace using the `DEBUG` environment variable, like this: +Currently you can only run pre-compiled packages in debug mode. To enable debug +while running add the `verdaccio` namespace using the `DEBUG` environment +variable, like this: ``` DEBUG=verdaccio:* node packages/verdaccio/debug/bootstrap.js ``` -On this way can be reviewed every package, but if you need to filter out and display more specific output, increase the name space filter. +You can filter this output to just the packages you're interested in using +namespaces: ``` DEBUG=verdaccio:plugin:* node packages/verdaccio/debug/bootstrap.js ``` -The debug code is intended to analyze what is happening under the hood and none of the output is gathered with the logger module. +The debug code is intended to analyze what is happening under the hood and none +of the output is sent to the logger module. ## Reporting Bugs -**Bugs are considered features that are not working as described in documentation.** +**Bugs are considered features that are not working as described in +documentation.** If you've found a bug in Verdaccio **that isn't a security risk**, please file a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues). @@ -142,28 +151,31 @@ a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues). > **NOTE: Verdaccio still does not support all npm commands. Some were not > considered important and others have not been requested yet.** -### Read the documentation - -Check whether you are using the software in the way is documented [documentation](http://www.verdaccio.org/docs/en/installation.html). - ### What's is not considered a bug? -- _Third party integrations_: proxies integrations, external plugins. -- _Package managers_: If a package manager does not support a specific command or cannot be reproduced with another package manager. -- _Features clearly flagged as not supported_. -- _Node.js issues installation in any platform_: If you cannot install the global package ( this is considered external issue) -- Any ticket which has the flagged as [external issue](https://github.com/verdaccio/verdaccio/labels/external-issue). +- _Third party integrations_: proxies integrations, external plugins +- _Package managers_: If a package manager does not support a specific command + or cannot be reproduced with another package manager +- _Features clearly flagged as not supported_ +- _Node.js issues installation in any platform_: If you cannot install the + global package (this is considered external issue) +- Any ticket which has beed flagged as an [external issue + ](https://github.com/verdaccio/verdaccio/labels/external-issue) -If you intent to report a **security** issue, please follow our [Security policy guidelines](https://github.com/verdaccio/verdaccio/security/policy). +If you intend to report a **security** issue, please follow our [Security policy +guidelines](https://github.com/verdaccio/verdaccio/security/policy). ### Issue Search -Before consider report a bug, please follow this steps before: +Before reporting a bug please: -- Search if has already been reported via the issue search. -- Look for the **question** label: we have labelled questions for easy follow-up as [questions](https://github.com/verdaccio/verdaccio/labels/question). +- Search for existing issues to see if it has already been reported +- Look for the **question** label: we have labelled questions for easy follow-up + as [questions](https://github.com/verdaccio/verdaccio/labels/question) -In case any of those match with your search, up-vote it (using GitHub reactions) or add additional helpful details to the existing issue to show that it's affecting multiple people. +In case any of those match with your search, up-vote it (using GitHub reactions) +or add additional helpful details to the existing issue to show that it's +affecting multiple people. ### Chat @@ -174,20 +186,24 @@ Questions can be asked via [Discord](http://chat.verdaccio.org/) ## Request Features New feature requests are welcome. Analyse whether the idea fits within scope of -the project. Then, detail your request, ensuring context and use case is provided. +the project. Adding in context and the use-case will really help! **Please provide:** - A detailed description the advantages of your request -- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_](https://github.com/yarnpkg/yarn) or [_yarn berry_](https://github.com/yarnpkg/berry). +- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_ + ](https://github.com/yarnpkg/yarn) or [_yarn berry_ + ](https://github.com/yarnpkg/berry). - A potential implementation or design -- Whatever else you have in your mind ๐Ÿค“ +- Whatever else is on your mind! ๐Ÿค“ ## Contributing Guidelines -This is the most exciting part, when you became a Verdaccio contributor ๐Ÿ™Œ๐Ÿผ, to ensure a fast code review and merge, please follow the next guidelines: +It's very exciting to become a Verdaccio contributor ๐Ÿ™Œ๐Ÿผ. To ensure a fast code +review and merge, please follow the next guidelines: -> Any contribution gives you the right to be part of this organization as _collaborator_. +> Any contribution gives you the right to be part of this organization as +> _collaborator_. ### Submitting a Pull Request @@ -213,14 +229,14 @@ information on [rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) #### Caveats -Feel free to commit as much times you want in your branch, but keep on mind on this repository we `git squash` on merge by default, any other way is forbidden since we intent to have a clean git history. +Feel free to commit as much times you want in your branch, but keep on mind on +this repository we `git squash` on merge by default, as we like to maintain a +clean git history. #### Before Commit Before committing, **you must ensure there are no linting errors and -all tests pass.** - -To do this, run these commands before create the PR: +all tests pass.** To do this, run these commands before create the PR: ```bash pnpm lint @@ -229,9 +245,10 @@ pnpm build pnpm test ``` -> note: eslint and formatting are running separately, keep code formatting before push. +> note: eslint and formatting are run separately, keep code formatting +> before push. -All good? perfect, then you should create the pull request. +All good? Perfect! You should create the pull request. #### Commit Guidelines @@ -240,8 +257,8 @@ For example: - `feat: A new feature` - `fix: A bug fix` -A commit of the type feat introduces a new feature to the codebase -(this correlates with MINOR in semantic versioning). +A commit of the type feat introduces a new feature to the codebase (this +correlates with MINOR in semantic versioning). e.g.: @@ -249,7 +266,8 @@ e.g.: feat: xxxxxxxxxx ``` -A commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning). +A commit of the type fix patches a bug in your codebase (this correlates with +PATCH in semantic versioning). e.g.: @@ -257,24 +275,31 @@ e.g.: fix: xxxxxxxxxxx ``` -Commits types such as as `docs:`,`style:`,`refactor:`,`perf:`,`test:` -and `chore:` are valid but have no effect on versioning. **It would be great if you use them.** +Commits types such as as `docs:`,`style:`,`refactor:`,`perf:`,`test:` and +`chore:` are valid but have no effect on versioning: **please use them!** -All commits message are going to be validated when they are created using husky hooks. +All commits message are going to be validated when they are created using +_husky_ hooks. -> Please, try to provide one single commit to help a clean and easy merge process. +> Please try to provide one single commit to help a clean and easy merge process ### Adding a changeset -We use [changesets](https://github.com/atlassian/changesets) in order to generate a detailed Changelog as possible. +We use [changesets](https://github.com/atlassian/changesets) in order to +generate a detailed Changelog as possible. -Add a changeset with your Pull Request is essential if you want your contribution get merged (unless is a change that does not affect library functionality, eg: typo, docs, readme, add additional test or linting code). To create a changeset please run: +Adding a changeset with your Pull Request is essential if you want your +contribution to get merged (unless is a change that does not affect library +functionality, eg: typo, docs, readme, add additional test or linting code). To +create a changeset please run: ``` pnpm changeset ``` -Then select the packages you want to include in your changeset navigating through them and press the spacebar to check it, on finish press enter to move to the next step. +Then select the packages you want to include in your changeset navigating +through them and press the spacebar to check it, on finish press enter to move +to the next step. ``` ๐Ÿฆ‹ Which packages would you like to include? โ€ฆ @@ -287,7 +312,9 @@ Then select the packages you want to include in your changeset navigating throug โœ” @verdaccio/commons-api ``` -The next question would be if you want a _major bump_, this is not the usual scenario, most likely would be a patch, in that case press enter 2 times (to skip minor) +The next question would be if you want a _major bump_. This is not the usual +scenario, most likely you want a patch, and in that case press enter 2 times +(to skip minor) ``` ๐Ÿฆ‹ Which packages should have a major bump? โ€ฆ @@ -295,7 +322,8 @@ The next question would be if you want a _major bump_, this is not the usual sce โœ” @verdaccio/config@5.0.0-alpha.0 ``` -Once the desired bump you need, the CLI will ask for a summary, here you have fully freedom what to include. +Once you have the desired bump you need, the CLI will ask for a summary. Here +you have full freedom on what to include: ``` ๐Ÿฆ‹ Which packages would you like to include? ยท @verdaccio/config @@ -307,7 +335,7 @@ Once the desired bump you need, the CLI will ask for a summary, here you have fu ๐Ÿฆ‹ Summary โ€บ ``` -The last step is confirm your changeset or abort the operation. +The last step is to confirm your changeset or abort the operation: ``` ๐Ÿฆ‹ Is this your desired changeset? (Y/n) ยท true @@ -317,9 +345,13 @@ The last step is confirm your changeset or abort the operation. ๐Ÿฆ‹ info /Users/user/verdaccio.clone/.changeset/light-scissors-smell.md ``` -Once the changeset is added (all will have an unique name) you can freely edit using markdown, adding additional information, code snippets or what you consider is relevant. +Once the changeset is added (all will have an unique name) you can freely edit +using markdown, adding additional information, code snippets or whatever else +you consider to be relevant. -All that information will be part of the **changelog**, be concise but informative. It is considered a good option to add your nickname and GitHub link to your profile. +All that information will be part of the **changelog**. Be concise but +informative! It's recommended to add your nickname and GitHub link to your +profile. **PRs that do not follow the commit message guidelines will not be merged.** @@ -327,7 +359,8 @@ All that information will be part of the **changelog**, be concise but informati **Any change in source code must include test updates**. -If you need help with how testing works, please [refer to the following guide](https://github.com/verdaccio/verdaccio/wiki/Running-and-Debugging-tests). +If you need help with how testing works, please [refer to the following guide +](https://github.com/verdaccio/verdaccio/wiki/Running-and-Debugging-tests). **If you are introducing new features, you MUST include new tests. PRs for features without tests will not be merged.** @@ -340,6 +373,8 @@ If you want to develop your own plugin: 1. Check whether there is a legacy Sinopia plugin for the feature that you need via [npmjs](https://www.npmjs.com/search?q=sinopia) -2. Keep in mind the [life-cycle to load a plugin](https://verdaccio.org/docs/en/dev-plugins) +2. Keep in mind the [life-cycle to load a plugin + ](https://verdaccio.org/docs/en/dev-plugins) 3. You are free to host your plugin in your repository -4. Provide a detailed description of your plugin to help users understand how to use it. +4. Provide a detailed description of your plugin to help users understand how to + use it