You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ It's not uncommon that people discover incorrect implementations of certain test
6
6
7
7
We welcome contributions of all sorts and sizes, from reporting issues to submitting patches, as well as joining the current [discussions 💬][issue-discussion].
8
8
9
-
> [!WARNING]
9
+
> [!WARNING]
10
10
> This guide is slightly outdated and doesn't hold the V3 changes yet.
11
11
12
12
---
@@ -168,7 +168,7 @@ You may improve these files by making the required changes and opening a new Pul
168
168
## Tools
169
169
170
170
You'll need LTS or higher Node.js to contribute to the _code_ in this repository.
171
-
Run `npm install` in the root to be able to run the scripts as listed below.
171
+
Run `corepack pnpm install` in the root to be able to run the scripts as listed below.
172
172
We use the following dependencies:
173
173
174
174
-`shelljs` to provide shell interface to scripts
@@ -177,9 +177,9 @@ We use the following dependencies:
177
177
-`babel` to transpile everything so it works _regardless of your version of Node.js_.
178
178
179
179
We also use `prettier` to format the files.
180
-
**Prettier is installed when using `npm install`**.
181
-
You may use `npx babel-node scripts/format` to run prettier.
182
-
If you want to auto-format using your editor, install via `npm install` and it will Just Work™.
180
+
**Prettier is installed when using `corepack pnpm install`**.
181
+
You may use `corepack pnpm node scripts/format.mjs` to run prettier.
182
+
If you want to auto-format using your editor, install via `corepack pnpm install` and it will Just Work™.
183
183
184
184
### Fetch configlet
185
185
@@ -210,7 +210,7 @@ It then interactively gives the maintainer the option to include or exclude test
210
210
211
211
We have various `scripts` to aid with maintaining and contributing to this repository.
212
212
213
-
> [!IMPORTANT]
213
+
> [!IMPORTANT]
214
214
> If you encounter the following error:
215
215
>
216
216
> ```text
@@ -243,7 +243,7 @@ We have various `scripts` to aid with maintaining and contributing to this repos
243
243
```
244
244
245
245
Use this action to format all the files using the correct version of prettier.
246
-
If you want your editor to do this automatically, install the project development dependencies (`npm i`), which includes `prettier`.
246
+
If you want your editor to do this automatically, install the project development dependencies (`corepack pnpm install`), which includes `prettier`.
247
247
The correct version will be extracted when running `.github/workflows/verify-code-formatting.yml`.
Copy file name to clipboardExpand all lines: docs/INSTALLATION.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,14 @@ The version should match the one on the website.
70
70
>
71
71
> Close any open terminals and open a new one.
72
72
73
+
## Enabling corepack
74
+
75
+
In order to use a versioned package manager compatible with this track, `corepack` needs to be enabled once:
76
+
77
+
```shell
78
+
corepack enable pnpm
79
+
```
80
+
73
81
## Assignment Requirements
74
82
75
83
Please follow [these instructions][cli-walkthrough] to download the Exercism CLI for your OS.
@@ -84,26 +92,23 @@ Each assignment then needs some tools to run the tests.
84
92
They can be installed running this command within each assignment directory:
85
93
86
94
```shell
87
-
npm install
95
+
corepack pnpm install
88
96
```
89
97
90
-
> [!IMPORTANT] > _**Help**_: `'<package>' is missing / cannot be found`
91
-
>
92
-
> If you see this after _upgrading_ your exercise, welcome to npm 7.
93
-
> Delete `node_modules` and `package-lock.json` and re-run the command to resolve this.
94
-
95
-
If you're concerned about disk space and are okay installing another tool, take a look at [pnpm](https://pnpm.io/), which ensure only one copy of each package-version is ever installed on disk.
96
-
In this case, run `pnpm install` instead of `npm install`, and everything should work as expected.
98
+
As this track has switched to pnpm, you should not be concerned about disk space.
99
+
Take a look at [pnpm](https://pnpm.io/), which ensures only one copy of each package-version is ever installed on disk.
97
100
98
-
>**But what is npm and why does this work?**
101
+
> **But what is corepack and why does this work?**
99
102
>
100
103
> You don't need this information to complete the JavaScript track, but if you're eager to understand what just happened, the following paragraphs are for you:
101
104
>
102
-
> This works because `npm` is a package manager that comes bundled with Node.js, which has been installed per the steps above.
103
-
> The `npm`command looks fora `package.json` file, which is presentin _each_ assignment folder.
104
-
> This file lists the `"dependencies"` above, which are then downloaded by `npm` and placed into the `node_modules` folder.
105
+
> This works because `corepack` is a tool that comes bundled with Node.js, which has been installed per the steps above.
106
+
> It can install the package manager `pnpm`. It configures the system
107
+
> The `corepack` command looks for a `package.json` file, which is present in _each_ assignment folder.
108
+
> It then checks `packageManager` which matches `pnpm`, so it may continue. If necessary it will upgrade `pnpm` first.
109
+
> This file also lists the `"dependencies"` above, which are then downloaded by `pnpm` and placed into a local cache.
105
110
>
106
-
> The scripts in the `package.json` use the binaries from the local`node_modules` folder, and it's these scripts that are used to run the tests, as listed in the `exercise` description.
111
+
> The scripts in the `package.json` use the binaries from the local cache, and it's these scripts that are used to run the tests, as listed in the `exercise` description.
0 commit comments