Skip to content

Commit e994073

Browse files
lwasserwillingcJimMadge
authored
enh(infra): move from yarn to npm and update docs (#841)
* enh: move from yarn to npm and update docs * enh(docs): linting and update docs to use npm Update docs/project/contribute.md Co-authored-by: Carol Willing <[email protected]> * Enh: edits from Carol Willing Apply suggestions from code review Co-authored-by: Carol Willing <[email protected]> Apply suggestions from code review Co-authored-by: Jim Madge <[email protected]> * docs: remove yarn from scripts too chore: remove yarn lockfile and references * fix: more yarn instances --------- Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Jim Madge <[email protected]>
1 parent 7e23595 commit e994073

File tree

10 files changed

+89
-8804
lines changed

10 files changed

+89
-8804
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ commands:
1212
path: ~/repo
1313
- restore_cache:
1414
name: Restore node_modules cache
15-
key: all-contributors-{{ checksum "yarn.lock" }}-{{ .Branch }}
15+
key: all-contributors-{{ checksum "package-lock.json" }}-{{ .Branch }}
1616
save_env_cache:
1717
description: Saves environment cache
1818
steps:
1919
- save_cache:
2020
name: Save node_modules cache
21-
key: all-contributors-{{ checksum "yarn.lock" }}-{{ .Branch }}
21+
key: all-contributors-{{ checksum "package-lock.json" }}-{{ .Branch }}
2222
paths:
2323
- node_modules/
2424

@@ -28,7 +28,7 @@ jobs:
2828
working_directory: ~/repo
2929
steps:
3030
- prep_env
31-
- run: yarn install --frozen-lockfile
31+
- run: npm ci
3232
- save_env_cache
3333
publish_release:
3434
<<: *docker_defaults
@@ -40,7 +40,7 @@ jobs:
4040
command: cat package.json | jq '.scripts.postinstall = "node index.js"' > package.json.tmp && mv package.json.tmp package.json
4141
- run:
4242
name: Semantic release to NPM and GitHub releases
43-
command: yarn run semantic-release
43+
command: npm run semantic-release
4444

4545
check_404s:
4646
<<: *docker_defaults
@@ -52,7 +52,7 @@ jobs:
5252
command: sleep 500
5353
- run:
5454
name: Check 404s production
55-
command: yarn blc https://allcontributors.org -ro || true
55+
command: npx blc https://allcontributors.org -ro || true
5656

5757
workflows:
5858
version: 2

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ node_modules
2424
logs
2525
*.log
2626
npm-debug.log*
27-
yarn-debug.log*
28-
yarn-error.log*
2927

3028
# Website
3129
website/build

docs/cli/installation.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: CLI Installation
44
sidebar_label: Installation
55
---
66

7-
87
## 1. Install the CLI tool
98

109
<a href="https://www.npmjs.com/package/all-contributors-cli">
@@ -18,7 +17,8 @@ This module is distributed via [npm](https://www.npmjs.com/) which is bundled wi
1817
should be installed as one of your project's `devDependencies`:
1918

2019
```console
21-
yarn add --dev all-contributors-cli # or npm i -D all-contributors-cli
20+
npm i -D all-contributors-cli
21+
# If you are a yarn user: yarn add --dev all-contributors-cli
2222
```
2323

2424
Alternatively, Arch Linux users can install the [`all-contributors-cli`](https://aur.archlinux.org/packages/all-contributors-cli) package from the AUR.
@@ -30,7 +30,8 @@ Alternatively, Arch Linux users can install the [`all-contributors-cli`](https:/
3030
Init the project using `init` and answer a few questions
3131

3232
```console
33-
yarn all-contributors init # or npx all-contributors init
33+
npx all-contributors init
34+
# Or with yarn: yarn all-contributors init
3435

3536
# Or directly execute the bin
3637
./node_modules/.bin/all-contributors init
@@ -39,8 +40,8 @@ yarn all-contributors init # or npx all-contributors init
3940
## 3. Add some contributors
4041

4142
```console
42-
yarn all-contributors add jfmengels doc
43-
yarn all-contributors generate
43+
npx all-contributors add jfmengels doc
44+
npx all-contributors generate
4445
```
4546

4647
For more on the commands see [CLI usage](usage)
@@ -64,10 +65,10 @@ For example:
6465
}
6566
```
6667

67-
To allow shortcuts such as
68+
To allow shortcuts such as:
6869

6970
```console
70-
yarn contributors:add jfmengels doc
71+
npx contributors:add jfmengels doc
7172
```
7273

7374
## What's next

docs/cli/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Usage
66

77
> This usage documentation assumes you have already followed the [cli installation steps](installation).
88
9-
A quick note: Below we'll just show `all-contributors` to keep things simple, but if you're having any difficulties, then give the `yarn all-contributors` route a try 😺
9+
A quick note: Below we'll just show `all-contributors` to keep things simple, but if you're having any difficulties, then give the `npx all-contributors-cli init` route a try 😺.
1010

1111
## Commands
1212

docs/emoji-key.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@ sidebar_label: Emoji Key ✨
88

99
> To have a contribution added when using the [Bot](bot/overview) or [CLI](cli/overview) use the keyword in the `Type` column. The bot will also use [basic Natural Language Parsing](https://github.com/all-contributors/app/blob/master/lib/parse-comment.js) to determine your contribution intent.
1010
11-
Emoji/Type | Represents | Comments
12-
:---: | :---: | :---:
13-
🔊 <br /> `audio` | Audio | Podcasts, background music or sound effects
14-
♿️ <br /> `a11y` | Accessibility | Reporting or working on accessibility issues
15-
🐛 <br /> `bug` | Bug reports | Links to issues reported by the user on this project
16-
📝 <br /> `blog` | Blogposts | Links to the blogpost
17-
💼 <br /> `business` | Business Development | People who execute on the business end
18-
💻 <br /> `code` | Code | Links to commits by the user on this project
19-
🖋 <br /> `content` | Content | e.g. website copy, blog posts are separate
20-
🔣 <br /> `data` | Data | Links to contributed data for the project (both tests and datasets)
21-
📖 <br /> `doc` | Documentation | Links to commits by the user on this project, Wiki, or other source of documentation
22-
🎨 <br /> `design` | Design | Links to the logo/iconography/visual design/etc.
23-
💡 <br /> `example` | Examples | Links to the examples
11+
Emoji/Type | Represents | Comments |
12+
:---: | :---: | :---: |
13+
🔊 <br /> `audio` | Audio | Podcasts, background music or sound effects |
14+
♿️ <br /> `a11y` | Accessibility | Reporting or working on accessibility issues |
15+
🐛 <br /> `bug` | Bug reports | Links to issues reported by the user on this project |
16+
📝 <br /> `blog` | Blogposts | Links to the blogpost |
17+
💼 <br /> `business` | Business Development | People who execute on the business end |
18+
💻 <br /> `code` | Code | Links to commits by the user on this project |
19+
🖋 <br /> `content` | Content | e.g. website copy, blog posts are separate |
20+
🔣 <br /> `data` | Data | Links to contributed data for the project (both tests and datasets) |
21+
📖 <br /> `doc` | Documentation | Links to commits by the user on this project, Wiki, or other source of documentation |
22+
🎨 <br /> `design` | Design | Links to the logo/iconography/visual design/etc. |
23+
💡 <br /> `example` | Examples | Links to the examples |
2424
📋 <br /> `eventOrganizing` | Event Organizers | Links to event page |
25-
💵 <br /> `financial` | Financial Support | People or orgs who provide financial support, links to relevant page
26-
🔍 <br /> `fundingFinding` | Funding/Grant Finders | People who help find financial support
25+
💵 <br /> `financial` | Financial Support | People or orgs who provide financial support, links to relevant page |
26+
🔍 <br /> `fundingFinding` | Funding/Grant Finders | People who help find financial support |
2727
🤔 <br /> `ideas` | Ideas & Planning | |
28-
🚇 <br /> `infra` | Infrastructure | Hosting, Build-Tools, etc. Links to source file (like `travis.yml`) in repo, if applicable
29-
🚧 <br /> `maintenance` | Maintenance | People who help in maintaining the repo, links to commits by the user on this project
30-
🧑‍🏫 <br /> `mentoring` | Mentoring | People who mentor new contributors, links to the repo home
28+
🚇 <br /> `infra` | Infrastructure | Hosting, Build-Tools, etc. Links to source file (like `travis.yml`) in repo, if applicable |
29+
🚧 <br /> `maintenance` | Maintenance | People who help in maintaining the repo, links to commits by the user on this project |
30+
🧑‍🏫 <br /> `mentoring` | Mentoring | People who mentor new contributors, links to the repo home |
3131
📦 <br /> `platform` | Packaging | Porting to support a new platform |
32-
🔌 <br /> `plugin` | Plugin/utility libraries | Links to the repo home
32+
🔌 <br /> `plugin` | Plugin/utility libraries | Links to the repo home |
3333
📆 <br /> `projectManagement` | Project Management | |
3434
📣 <br /> `promotion` | Promotion | |
35-
💬 <br /> `question` | Answering Questions | Answering Questions in Issues, Stack Overflow, Gitter, Slack, etc.
36-
🔬 <br /> `research` | Research | Literature review.
35+
💬 <br /> `question` | Answering Questions | Answering Questions in Issues, Stack Overflow, Gitter, Slack, etc. |
36+
🔬 <br /> `research` | Research | Literature review. |
3737
👀 <br /> `review` | Reviewed Pull Requests | |
38-
🛡️ <br /> `security` | Security | Identify and/or reduce security threats, GDPR, Privacy, etc
39-
🔧 <br /> `tool` | Tools | Links to the repo home
40-
🌍 <br /> `translation` | Translation | Links to the translated content
41-
⚠️ <br /> `test` | Tests | Links to commits by the user on this project
42-
✅ <br /> `tutorial` | Tutorials | Links to the tutorial
43-
📢 <br /> `talk` | Talks | Links to the slides/recording/repo/etc
44-
📓 <br /> `userTesting` | User Testing | Links to user test notes
45-
📹 <br /> `video` | Videos | Links to the video
38+
🛡️ <br /> `security` | Security | Identify and/or reduce security threats, GDPR, Privacy, etc |
39+
🔧 <br /> `tool` | Tools | Links to the repo home |
40+
🌍 <br /> `translation` | Translation | Links to the translated content |
41+
⚠️ <br /> `test` | Tests | Links to commits by the user on this project |
42+
✅ <br /> `tutorial` | Tutorials | Links to the tutorial |
43+
📢 <br /> `talk` | Talks | Links to the slides/recording/repo/etc |
44+
📓 <br /> `userTesting` | User Testing | Links to user test notes |
45+
📹 <br /> `video` | Videos | Links to the video |
4646

4747
## What's next
4848

docs/project/contribute.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,49 @@ Search is by algolia, the configuration is at <https://github.com/algolia/docsea
6464

6565
## Running the site locally:
6666

67-
All Contributors uses Docusaurus to maintain our documentation website. For more info visit the [Docusaurus Website](https://docusaurus.io)
67+
All Contributors currently uses [Docusaurus 1.x](https://docusaurus.io) for our documentation website.
6868

69-
To get started locally:
69+
To build the docs locally:
7070

71-
- `yarn install`
72-
- `yarn start`
73-
- go to `http://localhost:3000` (Refresh the page for your changes to be reflected)
71+
Make sure `npm` is installed on your machine. Use the [nodejs documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) if you aren't sure how to install `npm`.
72+
To check that npm is installed run the following in your favorite shell:
73+
74+
`npm -v`
75+
76+
Next, make sure you have at least node version 0.22 (LTS) or higher. To check the version,
77+
use:
78+
79+
`node -v`
80+
81+
If you don't have at least version `0.22` or higher, please install Node or upgrade your current version.
82+
83+
Install docusaurus v1 (1.14.7) and all of the project dependencies using `npm install`. *Note: This project does not yet support docusaurus v2 or v3; though, we hope to do so in the future.*
84+
85+
`npm install`
86+
87+
Once you have completed the above, you can launch a server locally that will build and run the docs locally. In your favorite shell run:
88+
89+
`npm run start`
90+
91+
* Then, go to `http://localhost:3000` and you will see the all contributors website there!
92+
* Refresh the browser page as needed when editing markdown pages.
93+
94+
### Make changes - linting your contribution
95+
96+
If you make changes to a markdown file in the site, then our linting action will
97+
check those changes. To run the linter yourself on a file locally:
98+
99+
First install markdownlint-cli:
100+
101+
`npm install -g markdownlint-cli`
102+
103+
Then run markdownlint on the file (or files) that you wish to check:
104+
105+
`markdownlint --fix "docs/project/contribute.md"`
106+
107+
Or you can run it on all files in the docs directory, like this:
108+
109+
`markdownlint --fix "docs/**.md"`
74110

75111
## Add yourself as a contributor
76112

index.js

100644100755
File mode changed.

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# HTML files and assets generated by the build. If a base directory has
44
# been specified, include it in the publish directory path.
55
publish = "website/build/all-contributors/"
6-
command = "yarn build-with-translations"
6+
command = "npm run build-with-translations"
77
# functions = "api/functions/"
88

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"build": "cd website && ../node_modules/.bin/docusaurus-build && cp _redirects build/all-contributors",
1414
"write-translations": "cd website && ../node_modules/.bin/docusaurus-write-translations",
1515
"crowdin": "java -jar website/crowdin/crowdin-cli.jar",
16-
"crowdin-upload": "yarn crowdin --config crowdin.yaml upload sources --auto-update -b $(git rev-parse --abbrev-ref HEAD)",
17-
"crowdin-download": "yarn crowdin --config crowdin.yaml download -b $(git rev-parse --abbrev-ref HEAD)",
18-
"build-with-translations": "yarn write-translations && yarn crowdin-upload && yarn crowdin-download && yarn build",
16+
"crowdin-upload": "npm run crowdin -- --config crowdin.yaml upload sources --auto-update -b $(git rev-parse --abbrev-ref HEAD)",
17+
"crowdin-download": "npm run crowdin -- --config crowdin.yaml download -b $(git rev-parse --abbrev-ref HEAD)",
18+
"build-with-translations": "npm run write-translations && npm run crowdin-upload && npm run crowdin-download && npm run build",
1919
"commit": "git-cz"
2020
},
2121
"devDependencies": {
2222
"broken-link-checker": "^0.7.8",
2323
"cz-conventional-changelog": "^2.1.0",
24-
"docusaurus": "^1.7.3",
24+
"docusaurus": "^1.7.4",
2525
"git-cz": "^4.1.0",
2626
"react": "^16.6.3",
2727
"semantic-release": "^19.0.3"

0 commit comments

Comments
 (0)