Skip to content

Commit fa446dd

Browse files
committed
docs: explain that _auth only goes to npm registry
1 parent 61d12bd commit fa446dd

File tree

5 files changed

+261
-0
lines changed

5 files changed

+261
-0
lines changed

docs/content/using-npm/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ npm ls --global --parseable --long --loglevel info
138138
* Type: null or String
139139

140140
A basic-auth string to use when authenticating against the npm registry.
141+
This will ONLY be used to authenticate against the npm registry. For other
142+
registries you will need to scope it like "//other-registry.tld/:_auth"
141143

142144
Warning: This should generally not be set via a command-line option. It is
143145
safer to use a registry-provided authentication bearer token stored in the

lib/utils/config/definitions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ define('_auth', {
147147
type: [null, String],
148148
description: `
149149
A basic-auth string to use when authenticating against the npm registry.
150+
This will ONLY be used to authenticate against the npm registry. For other
151+
registries you will need to scope it like "//other-registry.tld/:_auth"
150152
151153
Warning: This should generally not be set via a command-line option. It
152154
is safer to use a registry-provided authentication bearer token stored in

tap-snapshots/test/lib/commands/publish.js.test.cjs

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,259 @@
55
* Make sure to inspect the output below. Do not ignore changes!
66
*/
77
'use strict'
8+
exports[`test/lib/commands/publish.js TAP _auth config default registry > new package version 1`] = `
9+
10+
`
11+
12+
exports[`test/lib/commands/publish.js TAP dry-run > must match snapshot 1`] = `
13+
Array [
14+
Array [
15+
"",
16+
],
17+
Array [
18+
"",
19+
"package: [email protected]",
20+
],
21+
Array [
22+
"=== Tarball Contents ===",
23+
],
24+
Array [
25+
"",
26+
"87B package.json",
27+
],
28+
Array [
29+
"=== Tarball Details ===",
30+
],
31+
Array [
32+
"",
33+
String(
34+
name: test-package
35+
version: 1.0.0
36+
filename: test-package-1.0.0.tgz
37+
package size: 160 B
38+
unpacked size: 87 B
39+
shasum:{sha}
40+
integrity:{sha}
41+
total files: 1
42+
),
43+
],
44+
Array [
45+
"",
46+
"",
47+
],
48+
Array [
49+
"",
50+
"Publishing to https://registry.npmjs.org/ (dry-run)",
51+
],
52+
]
53+
`
54+
55+
exports[`test/lib/commands/publish.js TAP has auth for scope configured registry > new package version 1`] = `
56+
57+
`
58+
59+
exports[`test/lib/commands/publish.js TAP ignore-scripts > new package version 1`] = `
60+
61+
`
62+
63+
exports[`test/lib/commands/publish.js TAP json > must match snapshot 1`] = `
64+
Array [
65+
Array [
66+
"",
67+
"Publishing to https://registry.npmjs.org/",
68+
],
69+
]
70+
`
71+
72+
exports[`test/lib/commands/publish.js TAP json > new package json 1`] = `
73+
{
74+
75+
"name": "test-package",
76+
"version": "1.0.0",
77+
"size": 160,
78+
"unpackedSize": 87,
79+
"shasum": "{sha}",
80+
"integrity": "{sha}",
81+
"filename": "test-package-1.0.0.tgz",
82+
"files": [
83+
{
84+
"path": "package.json",
85+
"size": 87,
86+
"mode": 420
87+
}
88+
],
89+
"entryCount": 1,
90+
"bundled": []
91+
}
92+
`
93+
94+
exports[`test/lib/commands/publish.js TAP no auth dry-run > must match snapshot 1`] = `
95+
96+
`
97+
98+
exports[`test/lib/commands/publish.js TAP no auth dry-run > warns about auth being needed 1`] = `
99+
Array [
100+
Array [
101+
"",
102+
"This command requires you to be logged in to https://registry.npmjs.org/ (dry-run)",
103+
],
104+
]
105+
`
106+
107+
exports[`test/lib/commands/publish.js TAP re-loads publishConfig.registry if added during script process > new package version 1`] = `
108+
109+
`
110+
111+
exports[`test/lib/commands/publish.js TAP respects publishConfig.registry, runs appropriate scripts > new package version 1`] = `
112+
113+
`
114+
8115
exports[`test/lib/commands/publish.js TAP scoped _auth config scoped registry > new package version 1`] = `
9116
10117
`
118+
119+
exports[`test/lib/commands/publish.js TAP tarball > must match snapshot 1`] = `
120+
Array [
121+
Array [
122+
"",
123+
],
124+
Array [
125+
"",
126+
"package: [email protected]",
127+
],
128+
Array [
129+
"=== Tarball Contents ===",
130+
],
131+
Array [
132+
"",
133+
String(
134+
26B index.js
135+
98B package.json
136+
),
137+
],
138+
Array [
139+
"=== Tarball Details ===",
140+
],
141+
Array [
142+
"",
143+
String(
144+
name: test-tar-package
145+
version: 1.0.0
146+
filename: test-tar-package-1.0.0.tgz
147+
package size: 218 B
148+
unpacked size: 124 B
149+
shasum:{sha}
150+
integrity:{sha}
151+
total files: 2
152+
),
153+
],
154+
Array [
155+
"",
156+
"",
157+
],
158+
Array [
159+
"",
160+
"Publishing to https://registry.npmjs.org/",
161+
],
162+
]
163+
`
164+
165+
exports[`test/lib/commands/publish.js TAP tarball > new package json 1`] = `
166+
167+
`
168+
169+
exports[`test/lib/commands/publish.js TAP workspaces all workspaces - color > all public workspaces 1`] = `
170+
171+
172+
173+
`
174+
175+
exports[`test/lib/commands/publish.js TAP workspaces all workspaces - color > warns about skipped private workspace in color 1`] = `
176+
Array [
177+
Array [
178+
"publish",
179+
"Skipping workspace \\u001b[32mworkspace-p\\u001b[39m, marked as \\u001b[1mprivate\\u001b[22m",
180+
],
181+
]
182+
`
183+
184+
exports[`test/lib/commands/publish.js TAP workspaces all workspaces - no color > all public workspaces 1`] = `
185+
186+
187+
188+
`
189+
190+
exports[`test/lib/commands/publish.js TAP workspaces all workspaces - no color > warns about skipped private workspace 1`] = `
191+
Array [
192+
Array [
193+
"publish",
194+
"Skipping workspace workspace-p, marked as private",
195+
],
196+
]
197+
`
198+
199+
exports[`test/lib/commands/publish.js TAP workspaces json > all workspaces in json 1`] = `
200+
{
201+
"workspace-a": {
202+
203+
"name": "workspace-a",
204+
"version": "1.2.3-a",
205+
"size": 162,
206+
"unpackedSize": 82,
207+
"shasum": "{sha}",
208+
"integrity": "{sha}",
209+
"filename": "workspace-a-1.2.3-a.tgz",
210+
"files": [
211+
{
212+
"path": "package.json",
213+
"size": 82,
214+
"mode": 420
215+
}
216+
],
217+
"entryCount": 1,
218+
"bundled": []
219+
},
220+
"workspace-b": {
221+
222+
"name": "workspace-b",
223+
"version": "1.2.3-n",
224+
"size": 171,
225+
"unpackedSize": 92,
226+
"shasum": "{sha}",
227+
"integrity": "{sha}",
228+
"filename": "workspace-b-1.2.3-n.tgz",
229+
"files": [
230+
{
231+
"path": "package.json",
232+
"size": 92,
233+
"mode": 420
234+
}
235+
],
236+
"entryCount": 1,
237+
"bundled": []
238+
},
239+
"workspace-n": {
240+
241+
"name": "workspace-n",
242+
"version": "1.2.3-n",
243+
"size": 140,
244+
"unpackedSize": 42,
245+
"shasum": "{sha}",
246+
"integrity": "{sha}",
247+
"filename": "workspace-n-1.2.3-n.tgz",
248+
"files": [
249+
{
250+
"path": "package.json",
251+
"size": 42,
252+
"mode": 420
253+
}
254+
],
255+
"entryCount": 1,
256+
"bundled": []
257+
}
258+
}
259+
`
260+
261+
exports[`test/lib/commands/publish.js TAP workspaces one workspace - success > single workspace 1`] = `
262+
263+
`

tap-snapshots/test/lib/utils/config/definitions.js.test.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for _auth
169169
* Type: null or String
170170
171171
A basic-auth string to use when authenticating against the npm registry.
172+
This will ONLY be used to authenticate against the npm registry. For other
173+
registries you will need to scope it like "//other-registry.tld/:_auth"
172174
173175
Warning: This should generally not be set via a command-line option. It is
174176
safer to use a registry-provided authentication bearer token stored in the

tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ exports[`test/lib/utils/config/describe-all.js TAP > must match snapshot 1`] = `
1212
* Type: null or String
1313
1414
A basic-auth string to use when authenticating against the npm registry.
15+
This will ONLY be used to authenticate against the npm registry. For other
16+
registries you will need to scope it like "//other-registry.tld/:_auth"
1517
1618
Warning: This should generally not be set via a command-line option. It is
1719
safer to use a registry-provided authentication bearer token stored in the

0 commit comments

Comments
 (0)