| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -770,3 +770,5 @@ Yash Singh <saiansh2525@gmail.com> | |||
| 770 | 770 | Danielle Church <dani.church@gmail.com> | |
| 771 | 771 | Seth Thomas <seth@emailseth.com> | |
| 772 | 772 | Andreas <andreas@bielk.se> | |
| 773 | + Felipe Santos <felipecassiors@gmail.com> | ||
| 774 | + Luigi Pinca <luigipinca@gmail.com> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,125 @@ | |||
| 1 | + ## v7.11.2 (2021-04-29) | ||
| 2 | + | ||
| 3 | + ### BUG FIXES | ||
| 4 | + | ||
| 5 | + * [`c371f183e`](https://github.com/npm/cli/commit/c371f183ebe833c2439e98b679f14e7a59f22c34) | ||
| 6 | + [#3137](https://github.com/npm/cli/issues/3137) | ||
| 7 | + [#3140](https://github.com/npm/cli/issues/3140) | ||
| 8 | + fix(ls): do not warn on missing optional deps | ||
| 9 | + ([@isaacs](https://github.com/isaacs)) | ||
| 10 | + * [`861f606c7`](https://github.com/npm/cli/commit/861f606c7609d177c644814a171581afbb72f6db) | ||
| 11 | + [#3156](https://github.com/npm/cli/issues/3156) | ||
| 12 | + fix(build): make prune rule work on case-sensitive file systems | ||
| 13 | + ([@lpinca](https://github.com/lpinca)) | ||
| 14 | + | ||
| 15 | + ### DEPENDENCIES | ||
| 16 | + | ||
| 17 | + * [`fb79d89a0`](https://github.com/npm/cli/commit/fb79d89a07ef03e76633db275463f701d3dae42f) | ||
| 18 | + `tap@15.0.6` | ||
| 19 | + * [`ce3820043`](https://github.com/npm/cli/commit/ce38200437e9ed527df973794909b2699909bc9b) | ||
| 20 | + `@npmcli/arborist@2.4.1` | ||
| 21 | + * fix: prevent and eliminate unnecessary duplicates | ||
| 22 | + * fix: support resolvable partial intersecting peerSets | ||
| 23 | + | ||
| 24 | + ### DOCUMENTATION | ||
| 25 | + | ||
| 26 | + * [`e479f1dac`](https://github.com/npm/cli/commit/e479f1dac9a7639304d20116583034861635b2b1) | ||
| 27 | + [#3146](https://github.com/npm/cli/issues/3146) | ||
| 28 | + mention `directories.bin` in `bin` | ||
| 29 | + ([@felipecrs](https://github.com/felipecrs)) | ||
| 30 | + | ||
| 31 | + ## v7.11.1 (2021-04-23) | ||
| 32 | + | ||
| 33 | + ### DEPENDENCIES | ||
| 34 | + | ||
| 35 | + * [`7925cca24`](https://github.com/npm/cli/commit/7925cca24543d9e1a8297844b3e53e11057643ef) | ||
| 36 | + `pacote@11.3.3`: | ||
| 37 | + * fix(registry): normalize manfest | ||
| 38 | + * [`b61eac693`](https://github.com/npm/cli/commit/b61eac693df82c52b955e6c18ec4dcf4cedea8a3) | ||
| 39 | + [#3130](https://github.com/npm/cli/issues/3130) | ||
| 40 | + `@npmcli/config@2.2.0` | ||
| 41 | + * [`c74e67fc6`](https://github.com/npm/cli/commit/c74e67fc6572bb001d74c7486c05d211a0e03de8) | ||
| 42 | + [#3130](https://github.com/npm/cli/issues/3130) | ||
| 43 | + `npm-registry-fetch@10.1.1` | ||
| 44 | + | ||
| 45 | + ### DOCUMENTATION | ||
| 46 | + | ||
| 47 | + * [`efdd7dd44`](https://github.com/npm/cli/commit/efdd7dd4427a0ee856c18aab1df2d3d30a307997) | ||
| 48 | + Remove unused and incorrectly documented `--always-auth` config definition | ||
| 49 | + ([@isaacs](https://github.com/isaacs)) | ||
| 50 | + | ||
| 51 | + ## v7.11.0 (2021-04-22) | ||
| 52 | + | ||
| 53 | + ### FEATURES | ||
| 54 | + | ||
| 55 | + * [`4c1f16d2c`](https://github.com/npm/cli/commit/4c1f16d2c29a7a56c19b97f2820e6305a6075083) | ||
| 56 | + [#3095](https://github.com/npm/cli/issues/3095) | ||
| 57 | + feat(init): add workspaces support | ||
| 58 | + ([@ruyadorno](https://github.com/ruyadorno)) | ||
| 59 | + | ||
| 60 | + ### BUG FIXES | ||
| 61 | + | ||
| 62 | + * [`42ca59eee`](https://github.com/npm/cli/commit/42ca59eeedd3e402aa1c606941f7f52864e6039b) | ||
| 63 | + [#3086](https://github.com/npm/cli/issues/3086) | ||
| 64 | + fix(ls): do not exit with error when all problems are extraneous deps | ||
| 65 | + ([@nlf](https://github.com/nlf)) | ||
| 66 | + * [`2aecec591`](https://github.com/npm/cli/commit/2aecec591df6866e27d0b17dc49cef8f7d738d77) | ||
| 67 | + [#2724](https://github.com/npm/cli/issues/2724) | ||
| 68 | + [#3119](https://github.com/npm/cli/issues/3119) | ||
| 69 | + fix(ls): make --long work when missing deps | ||
| 70 | + ([@ruyadorno](https://github.com/ruyadorno)) | ||
| 71 | + * [`42e0587a9`](https://github.com/npm/cli/commit/42e0587a9ea6940a5d5be5903370ad1113feef21) | ||
| 72 | + [#3115](https://github.com/npm/cli/issues/3115) | ||
| 73 | + fix(pack): refuse to pack invalid packument | ||
| 74 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 75 | + * [`1c4eff7b5`](https://github.com/npm/cli/commit/1c4eff7b513b8e84876818ede014d3ab19d203c6) | ||
| 76 | + [#3126](https://github.com/npm/cli/issues/3126) | ||
| 77 | + fix(logout): use isBasicAuth attribute | ||
| 78 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 79 | + ### DOCUMENTATION | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + * [`c93f1c39e`](https://github.com/npm/cli/commit/c93f1c39e326feff0857712a10ef6183fbafe1ab) | ||
| 83 | + [#3101](https://github.com/npm/cli/issues/3101) | ||
| 84 | + chore(docs): update view docs | ||
| 85 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 86 | + * [`c4ff4bc11`](https://github.com/npm/cli/commit/c4ff4bc113c3a5b6ee5d74ab0b1adee95169ed32) | ||
| 87 | + [npm/statusboard#313](https://github.com/npm/statusboard/issues/313) | ||
| 88 | + [#3109](https://github.com/npm/cli/issues/3109) | ||
| 89 | + fix(usage): fix refs to ws shorthand | ||
| 90 | + ([@ruyadorno](https://github.com/ruyadorno)) | ||
| 91 | + | ||
| 92 | + | ||
| 93 | + ### DEPENDENCIES | ||
| 94 | + | ||
| 95 | + * [`83166ebcc`](https://github.com/npm/cli/commit/83166ebcc4ba5e3bf215f08151437d96637f4f33) | ||
| 96 | + `npm-registry-fetch@10.1.0` | ||
| 97 | + * feat(auth): set isBasicAuth | ||
| 98 | + * [`e02bda6da`](https://github.com/npm/cli/commit/e02bda6da68b8e8f490bf270cb5d6adec81685ea) | ||
| 99 | + `npm-registry-fetch@10.0.0` | ||
| 100 | + * feat(auth) load/send based on URI, not registry | ||
| 101 | + * [`a0382deba`](https://github.com/npm/cli/commit/a0382deba346b09834e75db89e1fd4527f1f07dd) | ||
| 102 | + `@npmcli/run-script@1.8.5` | ||
| 103 | + * fix: windows ComSpec env variable name | ||
| 104 | + * [`7f82ef5a8`](https://github.com/npm/cli/commit/7f82ef5a84d70e28983ed43ba1d8aced0fb4ba45) | ||
| 105 | + `pacote@11.3.2` | ||
| 106 | + * [`35e49b94f`](https://github.com/npm/cli/commit/35e49b94fba478a63df6cc9b62816eafe5f1fbdd) | ||
| 107 | + `@npmcli/arborist@2.4.0` | ||
| 108 | + * [`95faf8ce6`](https://github.com/npm/cli/commit/95faf8ce6c007082a02c160977da194c08ee9d82) | ||
| 109 | + `libnpmaccess@4.0.2` | ||
| 110 | + * [`17fffc0e4`](https://github.com/npm/cli/commit/17fffc0e42b2a9e7b84691093e45ba511906cbfa) | ||
| 111 | + `libnpmhook@6.0.2` | ||
| 112 | + * [`1b5a213aa`](https://github.com/npm/cli/commit/1b5a213aaf39652661ba72ba2e8751f049b170fb) | ||
| 113 | + `libnpmorg@2.0.2` | ||
| 114 | + * [`9f83e6484`](https://github.com/npm/cli/commit/9f83e6484aa163d066f318df42ec89c8234b614e) | ||
| 115 | + `libnpmpublish@4.0.1` | ||
| 116 | + * [`251f788c5`](https://github.com/npm/cli/commit/251f788c554a198ab42682453fa5504f8abe93fe) | ||
| 117 | + `libnpmsearch@3.1.1` | ||
| 118 | + * [`35873a989`](https://github.com/npm/cli/commit/35873a989fe67041ddcf30a0a278ed77ace5ee3c) | ||
| 119 | + `libnpmteam@2.0.3` | ||
| 120 | + * [`23e12b4d8`](https://github.com/npm/cli/commit/23e12b4d8f63d765a48036e7bb08f53319c73304) | ||
| 121 | + `npm-profile@5.0.3` | ||
| 122 | + | ||
| 1 | 123 | ## v7.10.0 (2021-04-15) | |
| 2 | 124 | ||
| 3 | 125 | ### FEATURES | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ description: Add a registry user account | |||
| 7 | 7 | ### Synopsis | |
| 8 | 8 | ||
| 9 | 9 | ```bash | |
| 10 | - npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy] | ||
| 10 | + npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] | ||
| 11 | 11 | ||
| 12 | 12 | aliases: login, add-user | |
| 13 | 13 | ``` | |
@@ -58,23 +58,6 @@ npm adduser --registry=http://myregistry.example.com --scope=@myco | |||
| 58 | 58 | This will set a registry for the given scope and login or create a user for | |
| 59 | 59 | that registry at the same time. | |
| 60 | 60 | ||
| 61 | - #### always-auth | ||
| 62 | - | ||
| 63 | - Default: false | ||
| 64 | - | ||
| 65 | - If specified, save configuration indicating that all requests to the given | ||
| 66 | - registry should include authorization information. Useful for private | ||
| 67 | - registries. Can be used with `--registry` and / or `--scope`, e.g. | ||
| 68 | - | ||
| 69 | - ```bash | ||
| 70 | - npm adduser --registry=http://private-registry.example.com --always-auth | ||
| 71 | - ``` | ||
| 72 | - | ||
| 73 | - This will ensure that all requests to that registry (including for tarballs) | ||
| 74 | - include an authorization header. This setting may be necessary for use with | ||
| 75 | - private registries where metadata and package tarballs are stored on hosts with | ||
| 76 | - different hostnames. See `always-auth` in [`config`](/using-npm/config) for more details on always-auth. Registry-specific configuration of `always-auth` takes precedence over any global configuration. | ||
| 77 | - | ||
| 78 | 61 | #### auth-type | |
| 79 | 62 | ||
| 80 | 63 | * Default: `'legacy'` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ npm exec -- <pkg>[@<version>] [args...] | |||
| 11 | 11 | npm exec --package=<pkg>[@<version>] -- <cmd> [args...] | |
| 12 | 12 | npm exec -c '<cmd> [args...]' | |
| 13 | 13 | npm exec --package=foo -c '<cmd> [args...]' | |
| 14 | - npm exec [-ws] [-w <workspace-name] [args...] | ||
| 14 | + npm exec [--ws] [-w <workspace-name] [args...] | ||
| 15 | 15 | ||
| 16 | 16 | npx <pkg>[@<specifier>] [args...] | |
| 17 | 17 | npx -p <pkg>[@<specifier>] <cmd> [args...] | |
@@ -184,7 +184,7 @@ in this example we're using **eslint** to lint any js file found within each | |||
| 184 | 184 | workspace folder: | |
| 185 | 185 | ||
| 186 | 186 | ``` | |
| 187 | - npm exec -ws -- eslint ./*.js | ||
| 187 | + npm exec --ws -- eslint ./*.js | ||
| 188 | 188 | ``` | |
| 189 | 189 | ||
| 190 | 190 | #### Filtering workspaces | |
@@ -275,7 +275,7 @@ children workspaces) | |||
| 275 | 275 | ||
| 276 | 276 | #### workspaces | |
| 277 | 277 | ||
| 278 | - * Alias: `-ws` | ||
| 278 | + * Alias: `--ws` | ||
| 279 | 279 | * Type: Boolean | |
| 280 | 280 | * Default: `false` | |
| 281 | 281 | ||
@@ -291,3 +291,4 @@ project. | |||
| 291 | 291 | * [npm restart](/commands/npm-restart) | |
| 292 | 292 | * [npm stop](/commands/npm-stop) | |
| 293 | 293 | * [npm config](/commands/npm-config) | |
| 294 | + * [npm workspaces](/using-npm/workspaces) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,8 +8,9 @@ description: Create a package.json file | |||
| 8 | 8 | ||
| 9 | 9 | ```bash | |
| 10 | 10 | npm init [--force|-f|--yes|-y|--scope] | |
| 11 | - npm init <@scope> (same as `npx <@scope>/create`) | ||
| 12 | - npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`) | ||
| 11 | + npm init <@scope> (same as `npm exec <@scope>/create`) | ||
| 12 | + npm init [<@scope>/]<name> (same as `npm exec [<@scope>/]create-<name>`) | ||
| 13 | + npm init [-w <dir>] [args...] | ||
| 13 | 14 | ``` | |
| 14 | 15 | ||
| 15 | 16 | ### Description | |
@@ -18,19 +19,16 @@ npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`) | |||
| 18 | 19 | package. | |
| 19 | 20 | ||
| 20 | 21 | `initializer` in this case is an npm package named `create-<initializer>`, | |
| 21 | - which will be installed by [`npx`](https://npm.im/npx), and then have its | ||
| 22 | + which will be installed by [`npm-exec`](/commands/npm-exec), and then have its | ||
| 22 | 23 | main bin executed -- presumably creating or updating `package.json` and | |
| 23 | 24 | running any other initialization-related operations. | |
| 24 | 25 | ||
| 25 | - The init command is transformed to a corresponding `npx` operation as | ||
| 26 | + The init command is transformed to a corresponding `npm exec` operation as | ||
| 26 | 27 | follows: | |
| 27 | 28 | ||
| 28 | - * `npm init foo` -> `npx create-foo` | ||
| 29 | - * `npm init @usr/foo` -> `npx @usr/create-foo` | ||
| 30 | - * `npm init @usr` -> `npx @usr/create` | ||
| 31 | - | ||
| 32 | - Any additional options will be passed directly to the command, so `npm init | ||
| 33 | - foo -- --hello` will map to `npx create-foo --hello`. | ||
| 29 | + * `npm init foo` -> `npm exec create-foo` | ||
| 30 | + * `npm init @usr/foo` -> `npm exec @usr/create-foo` | ||
| 31 | + * `npm init @usr` -> `npm exec @usr/create` | ||
| 34 | 32 | ||
| 35 | 33 | If the initializer is omitted (by just calling `npm init`), init will fall | |
| 36 | 34 | back to legacy init behavior. It will ask you a bunch of questions, and | |
@@ -40,6 +38,18 @@ strictly additive, so it will keep any fields and values that were already | |||
| 40 | 38 | set. You can also use `-y`/`--yes` to skip the questionnaire altogether. If | |
| 41 | 39 | you pass `--scope`, it will create a scoped package. | |
| 42 | 40 | ||
| 41 | + #### Forwarding additional options | ||
| 42 | + | ||
| 43 | + Any additional options will be passed directly to the command, so `npm init | ||
| 44 | + foo -- --hello` will map to `npm exec -- create-foo --hello`. | ||
| 45 | + | ||
| 46 | + To better illustrate how options are forwarded, here's a more evolved | ||
| 47 | + example showing options passed to both the **npm cli** and a create package, | ||
| 48 | + both following commands are equivalent: | ||
| 49 | + | ||
| 50 | + - `npm init foo -y --registry=<url> -- --hello -a` | ||
| 51 | + - `npm exec -y --registry=<url> -- create-foo --hello -a` | ||
| 52 | + | ||
| 43 | 53 | ### Examples | |
| 44 | 54 | ||
| 45 | 55 | Create a new React-based project using | |
@@ -71,6 +81,68 @@ Generate it without having it ask any questions: | |||
| 71 | 81 | $ npm init -y | |
| 72 | 82 | ``` | |
| 73 | 83 | ||
| 84 | + ### Workspaces support | ||
| 85 | + | ||
| 86 | + It's possible to create a new workspace within your project by using the | ||
| 87 | + `workspace` config option. When using `npm init -w <dir>` the cli will | ||
| 88 | + create the folders and boilerplate expected while also adding a reference | ||
| 89 | + to your project `package.json` `"workspaces": []` property in order to make | ||
| 90 | + sure that new generated **workspace** is properly set up as such. | ||
| 91 | + | ||
| 92 | + Given a project with no workspaces, e.g: | ||
| 93 | + | ||
| 94 | + ``` | ||
| 95 | + . | ||
| 96 | + +-- package.json | ||
| 97 | + ``` | ||
| 98 | + | ||
| 99 | + You may generate a new workspace using the legacy init: | ||
| 100 | + | ||
| 101 | + ```bash | ||
| 102 | + $ npm init -w packages/a | ||
| 103 | + ``` | ||
| 104 | + | ||
| 105 | + That will generate a new folder and `package.json` file, while also updating | ||
| 106 | + your top-level `package.json` to add the reference to this new workspace: | ||
| 107 | + | ||
| 108 | + ``` | ||
| 109 | + . | ||
| 110 | + +-- package.json | ||
| 111 | + `-- packages | ||
| 112 | + `-- a | ||
| 113 | + `-- package.json | ||
| 114 | + ``` | ||
| 115 | + | ||
| 116 | + The workspaces init also supports the `npm init <initializer> -w <dir>` | ||
| 117 | + syntax, following the same set of rules explained earlier in the initial | ||
| 118 | + **Description** section of this page. Similar to the previous example of | ||
| 119 | + creating a new React-based project using | ||
| 120 | + [`create-react-app`](https://npm.im/create-react-app), the following syntax | ||
| 121 | + will make sure to create the new react app as a nested **workspace** within your | ||
| 122 | + project and configure your `package.json` to recognize it as such: | ||
| 123 | + | ||
| 124 | + ```bash | ||
| 125 | + npm init -w packages/my-react-app react-app . | ||
| 126 | + ``` | ||
| 127 | + | ||
| 128 | + This will make sure to generate your react app as expected, one important | ||
| 129 | + consideration to have in mind is that `npm exec` is going to be run in the | ||
| 130 | + context of the newly created folder for that workspace, and that's the reason | ||
| 131 | + why in this example the initializer uses the initializer name followed with a | ||
| 132 | + dot to represent the current directory in that context, e.g: `react-app .`: | ||
| 133 | + | ||
| 134 | + ``` | ||
| 135 | + . | ||
| 136 | + +-- package.json | ||
| 137 | + `-- packages | ||
| 138 | + +-- a | ||
| 139 | + | `-- package.json | ||
| 140 | + `-- my-react-app | ||
| 141 | + +-- README | ||
| 142 | + +-- package.json | ||
| 143 | + `-- ... | ||
| 144 | + ``` | ||
| 145 | + | ||
| 74 | 146 | ### A note on caching | |
| 75 | 147 | ||
| 76 | 148 | The npm cli utilizes its internal package cache when using the package | |
@@ -93,10 +165,38 @@ requested from the server. To force full offline mode, use `offline`. | |||
| 93 | 165 | Forces full offline mode. Any packages not locally cached will result in | |
| 94 | 166 | an error. | |
| 95 | 167 | ||
| 168 | + #### workspace | ||
| 169 | + | ||
| 170 | + * Alias: `-w` | ||
| 171 | + * Type: Array | ||
| 172 | + * Default: `[]` | ||
| 173 | + | ||
| 174 | + Enable running `npm init` in the context of workspaces, creating any missing | ||
| 175 | + folders, generating files and adding/updating the `"workspaces"` property of | ||
| 176 | + the project `package.json`. | ||
| 177 | + | ||
| 178 | + the provided names or paths provided. | ||
| 179 | + | ||
| 180 | + Valid values for the `workspace` config are either: | ||
| 181 | + - Workspace names | ||
| 182 | + - Path to a workspace directory | ||
| 183 | + - Path to a parent workspace directory (will result to selecting all of the | ||
| 184 | + children workspaces) | ||
| 185 | + | ||
| 186 | + #### workspaces | ||
| 187 | + | ||
| 188 | + * Alias: `-ws` | ||
| 189 | + * Type: Boolean | ||
| 190 | + * Default: `false` | ||
| 191 | + | ||
| 192 | + Run `npm init` in the context of all configured workspaces for the | ||
| 193 | + current project. | ||
| 194 | + | ||
| 96 | 195 | ### See Also | |
| 97 | 196 | ||
| 98 | 197 | * [init-package-json module](http://npm.im/init-package-json) | |
| 99 | 198 | * [package.json](/configuring-npm/package-json) | |
| 100 | 199 | * [npm version](/commands/npm-version) | |
| 101 | 200 | * [npm scope](/using-npm/scope) | |
| 102 | 201 | * [npm exec](/commands/npm-exec) | |
| 202 | + * [npm workspaces](/using-npm/workspaces) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -189,7 +189,7 @@ children workspaces) | |||
| 189 | 189 | ||
| 190 | 190 | #### workspaces | |
| 191 | 191 | ||
| 192 | - * Alias: `-ws` | ||
| 192 | + * Alias: `--ws` | ||
| 193 | 193 | * Type: Boolean | |
| 194 | 194 | * Default: `false` | |
| 195 | 195 | ||
@@ -204,3 +204,4 @@ project. | |||
| 204 | 204 | * [npm restart](/commands/npm-restart) | |
| 205 | 205 | * [npm stop](/commands/npm-stop) | |
| 206 | 206 | * [npm config](/commands/npm-config) | |
| 207 | + * [npm workspaces](/using-npm/workspaces) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments