Skip to content

Commit 8e30cd9

Browse files
authored
Merge pull request #290 from NullVoxPopuli/mention-pnpm
Add things about pnpm
2 parents 1ab4cdc + fd2a067 commit 8e30cd9

File tree

9 files changed

+41
-27
lines changed

9 files changed

+41
-27
lines changed

.local.dic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ nginx
7575
NiM
7676
NTFS
7777
PowerShell
78+
pnpm
7879
pre-made
7980
Pre-Octane
8081
preloading

guides/advanced-use/cli-commands-reference.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ ember addon <addon-name> <options...>
8888
--skip-git (Boolean) (Default: false)
8989
aliases: -sg
9090
--yarn (Boolean)
91+
--pnpm (Boolean)
9192
--directory (String)
9293
aliases: -dir <value>
9394
--lang (String) Sets the base human language of the addon's own test application via index.html
@@ -645,6 +646,7 @@ ember init <glob-pattern> <options...>
645646
uses {{ember-welcome-page}}. Use --no-welcome to
646647
skip it.
647648
--yarn (Boolean)
649+
--pnpm (Boolean)
648650
--name (String) (Default: "")
649651
aliases: -n <value>
650652
--lang (String) Sets the base human language of the application via index.html
@@ -666,6 +668,8 @@ ember install <addon-name> <options...>
666668
aliases: -E, --exact
667669
--yarn (Boolean) Use --yarn to enforce yarn
668670
usage, or --no-yarn to enforce npm
671+
--pnpm (Boolean) Use --pnpm to enforce pnpm
672+
usage, or --no-pnpm to enforce npm
669673
```
670674
671675
### `ember new`
@@ -691,6 +695,7 @@ ember new <app-name> <options...>
691695
uses {{ember-welcome-page}}. Use --no-welcome to
692696
skip it.
693697
--yarn (Boolean)
698+
--pnpm (Boolean)
694699
--directory (String)
695700
aliases: -dir <value>
696701
--lang (String) Sets the base human language of the application via index.html

guides/advanced-use/debugging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ the all-purpose technique of "turning it on and off" can apply to Ember CLI as w
8585

8686
Some common steps are to stop the server, try one or more of these steps, and start the server again:
8787

88-
- Run `npm install` or `yarn install`
89-
- Delete the `node_modules` directory and run `npm install` or `yarn install`
90-
- Delete the `dist` directory (found in apps with versions < 3.4), delete `node_modules`, and `npm install` or `yarn install`
88+
- Run `npm install`, `yarn install`, or `pnpm install`
89+
- Delete the `node_modules` directory and run `npm install`, `yarn install`, or `pnpm install`
90+
- Delete the `dist` directory (found in apps with versions < 3.4), delete `node_modules`, and `npm install`, `yarn install`, or `pnpm install`
9191

9292
[1]: https://nodejs.org/api/debugger.html
9393
[2]: https://docs.npmjs.com/cli/link

guides/appendix/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For a complete list of command line options run `ember help`.
3131

3232
Some configuration is exposed through your `package.json` file.
3333

34-
If you have a nested repo structure (e.g., a monorepo using yarn workspaces) and want to allow `ember s` from the root of the repo, you can configure your `package.json` to look like:
34+
If you have a nested repo structure (e.g., a monorepo using pnpm or yarn workspaces) and want to allow `ember s` from the root of the repo, you can configure your `package.json` to look like:
3535

3636
```json {data-filename=package.json}
3737
{

guides/basic-use/assets-and-dependencies.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ The code itself goes in `node_modules` during `npm install`, just like in many n
1717
plus folders like `vendor` and `public` that can hold many other files of the developer's choice
1818

1919
<!--
20-
If addons are installed accidentally with `npm install` or `yarn install`,
20+
If addons are installed accidentally with `npm install`, `yarn install`, or `pnpm install`,
2121
the blueprints can be run with .... what?
2222
2323
Added by @maxwondercorn:
2424
What is now below - were should it go in the guide
2525
26-
If you accidentally install an Ember addon using either npm or Yarn, the default blueprint will not run. To run the blueprint use:
26+
If you accidentally install an Ember addon using either npm, Yarn, or pnpm, the default blueprint will not run. To run the blueprint use:
2727
2828
```shell
2929
ember generate <addon-name>
3030
```
3131
-->
3232

33-
## npm and Yarn
33+
## Package Managers
3434

35-
Ember CLI supports both [npm](https://www.npmjs.com) and [Yarn](https://yarnpkg.com/)
35+
Ember CLI supports [npm](https://www.npmjs.com), [Yarn](https://yarnpkg.com/), and [pnpm](https://pnpm.io)
3636
for node modules management.
3737

3838
By default, new apps use `npm`.
3939
Both tools offer similar functionality, and which one to choose is up to
4040
the developer's preference.
41-
Dependencies listed in `package.json` can be installed with either `npm install` or `yarn install`. The files for those packages are added to the `node_modules` folder of the app.
41+
Dependencies listed in `package.json` can be installed with `npm install`, `yarn install`, or `pnpm install`. The files for those packages are added to the `node_modules` folder of the app.
4242

43-
There are two ways to switch from `npm` to `yarn`.
44-
Either include an option when the app is created, like `ember new --yarn`,
45-
or run `yarn install` to generate a `yarn.lock` file.
46-
Ember will detect the `yarn.lock` file and start using it instead
43+
There are two ways to switch from the default package manager, `npm`.
44+
Either include an option when the app is created, like `ember new --yarn` or `ember new --pnpm`,
45+
or run `yarn install` or `pnpm install` to generate the package manager's associated lockfile file.
46+
Ember will detect the lockfile and start using it instead
4747
for any `ember install some-addon-name` commands.
4848
Don't forget to delete the `package-lock.json` file if the app
4949
already has one.
@@ -52,21 +52,29 @@ file are present, Ember CLI will default to using Yarn.
5252
However, having both files causes confusion for collaborators and
5353
is incompatible with some CI systems.
5454

55-
To switch from `yarn` to `npm`, delete the `yarn.lock`
55+
To switch back to `npm`, delete the lockfile from your package manager
5656
and run `npm install` to generate a `package-lock.json`.
5757

58-
To have Ember CLI use `yarn` by default for all new projects, create a `.ember-cli` file in your home directory with:
58+
To have Ember CLI use `yarn` or `pnpm` by default for all new projects, create a `.ember-cli` file in your home directory with:
5959

6060
```json
6161
{
6262
"yarn": true
6363
}
6464
```
6565

66+
or
67+
```json
68+
{
69+
"pnpm": true
70+
}
71+
```
72+
6673
Further documentation about npm and Yarn is available at their official
6774
documentation pages:
6875

6976
* [npm](https://www.npmjs.com)
77+
* [pnpm](https://pnpm.io)
7078
* [Yarn](https://yarnpkg.com)
7179

7280
### The `node_modules` directory

guides/basic-use/cli-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ember new camping-trip-tracker --yarn
6161
### Learn more
6262

6363
- [Ember Quickstart Guide](https://guides.emberjs.com/release/getting-started/quick-start/) for creating a first app
64-
- [npm and Yarn](../assets-and-dependencies/#npmandyarn) for more on using package managers with Ember CLI
64+
- [npm, Yarn, and pnpm](../assets-and-dependencies/#package-managers) for more on using package managers with Ember CLI
6565

6666
## Serve the app locally
6767

guides/basic-use/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ Learn how to install the Ember CLI on Linux, Mac, and Windows.
22

33
## Prerequisites
44

5-
* [npm](https://www.npmjs.com/get-npm) or [yarn](https://yarnpkg.com/en/docs/install)
5+
* [npm](https://www.npmjs.com/get-npm), [yarn](https://yarnpkg.com/en/docs/install), or [pnpm](https://pnpm.io/installation)
66
* [git](https://git-scm.com/) is recommended, but not required
77
* Recent version of [node](https://nodejs.org/en/download/), which comes included in `yarn` or `npm`
88
* Mac and Linux users may need [Watchman](https://facebook.github.io/watchman/) (not the npm version!)
99

1010
First, we need to have a package manager installed. A package manager installs new dependencies from the command line, whether they are used as commands or in the app itself.
11-
Follow these installation instructions for [npm](https://www.npmjs.com/get-npm) or [yarn](https://yarnpkg.com/en/docs/install).
12-
While these two tools have somewhat different features, both are compatible with Ember app development.
11+
Follow these installation instructions for [npm](https://www.npmjs.com/get-npm), [yarn](https://yarnpkg.com/en/docs/install), or [pnpm](https://pnpm.io/installation).
12+
While these tools have somewhat different features, both are compatible with Ember app development.
1313

14-
We'll know installation is successful when `npm --version` or `yarn --version` returns the version number.
14+
We'll know installation is successful when `npm --version`, `yarn --version`, or `pnpm --version` returns the version number.
1515

1616
It is recommended to install the most recent LTS (long-term support) version of `node`.
1717
Restart the console after installing your package manager.

guides/writing-addons/addon-blueprints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The default blueprint is recognized because it normally has the same name as the
6767

6868
### Blueprints in development
6969

70-
When developing and testing your addon using either `npm link` or `yarn link` your addon's blueprint will not automatically run. To manually run and test the blue print you would use the following command:
70+
When developing and testing your addon using `npm link`, `yarn link`, or `pnpm link` your addon's blueprint will not automatically run. To manually run and test the blue print you would use the following command:
7171

7272
```shell
7373
ember generate <your-blueprint-name>

guides/writing-addons/intro-tutorial.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ Our goal is to be able to pass the `buttonLabel` value to the addon, just like w
5050

5151
### Trying out the addon template in an app
5252

53-
There are several options to see the addon in action. We could use `npm link` or `yarn link` to try it out locally or publish the addon online. We'll use `link` while we are still developing and testing.
53+
There are several options to see the addon in action. We could use `npm link`, `yarn link`, or `pnpm link` to try it out locally or publish the addon online. We'll use `link` while we are still developing and testing.
5454

5555
**From the addon project directory:**
5656
1. Since our addon uses a template, we need the template precompiler to be a `dependency` and not a `devDependency`. In the addon's `package.json`, move the entry for `ember-cli-htmlbars` into the `dependencies` listing. If this step is missed, there is a clear error message when we try to start the app that uses our addon.
57-
2. `yarn install` or `npm install`
58-
3. Run the command `yarn link` or `npm link`
57+
2. `pnpm install`, `yarn install`, or `npm install`
58+
3. Run the command `yarn link` or `npm link`. This step may be skipped if using `pnpm`.
5959

6060
**From the directory of the app using the addon:**
61-
1. `yarn link <addon-name>` or `npm link <addon-name>`.
61+
1. `pnpm link ../path/to-/the-addon`, `yarn link <addon-name>` or `npm link <addon-name>`.
6262
2. In the Ember app's `package.json`, add a `devDependencies` entry for your addon, like `"addon-name": "*"`. The `*` means that it will include all version numbers of our addon.
63-
3. Run `yarn install` or `npm install` in the app. (If you are using the app for the first time, you can use `npm install --prefer-offline` or `npm install --offline` instead. These alternative commands can speed up installation, because `npm install` checks the online npm registry for your addon instead of your local storage.)
63+
3. Run `pnpm install`, `yarn install`, or `npm install` in the app. (If you are using the app for the first time, you can use `npm install --prefer-offline` or `npm install --offline` instead. These alternative commands can speed up installation, because `npm install` checks the online npm registry for your addon instead of your local storage.)
6464
4. Add a reference to your addon's component somewhere in an app template, like `<ComponentName @buttonLabel="Register" />`
6565
5. Run a local server with `ember serve` and visit [http://localhost:4200](http://localhost:4200)
6666

@@ -69,7 +69,7 @@ We should now see our addon in action!
6969
**Having problems?**
7070
- Check to make sure that your `package.json` is valid, looking for missing commas or trailing commas.
7171
- "Template precompiler" errors mean that you skipped Step 1 and 2 above.
72-
- `404 not found` means we forgot to `yarn` or `npm install`
72+
- `404 not found` means we forgot to `pnpm install`, `yarn install` or `npm install`
7373
- Make sure all the files have been saved.
7474
- Did you rename or relocate any files after they were created? This is prone to mistakes, and the resulting errors can be really strange. It is best to create files using the CLI.
7575

0 commit comments

Comments
 (0)