0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-11 02:15:57 -05:00

docs: improve docs for package manager usage (#3504)

* docs: npm9 login support

* Update setup-yarn.md

* chore: pnpm docs

* chore: add more yarn docs

* chore: fix preview
This commit is contained in:
Juan Picado 2022-11-19 08:33:58 +01:00 committed by GitHub
parent 5d0a6295da
commit e73656f144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 992 additions and 675 deletions

View file

@ -5,8 +5,12 @@
"main": "./build/index.js",
"types": "build/index.d.ts",
"dependencies": {
"@docusaurus/types": "2.1.0",
"@docusaurus/utils": "2.1.0"
"@docusaurus/types": "2.2.0",
"@docusaurus/utils": "2.2.0"
},
"devDependencies": {
"react": "17.0.2",
"react-dom": "17.0.2"
},
"scripts": {
"clean": "rimraf ./build",

1582
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -95,7 +95,7 @@ module.exports = {
],
plugins: [
'docusaurus-plugin-sass',
"docusaurus-plugin-contributors",
'docusaurus-plugin-contributors',
isProductionDeployment && typeof process.env.SENTRY_KEY === 'string' && ['docusaurus-plugin-sentry', { DSN: process.env.SENTRY_KEY }],
[
'docusaurus-plugin-typedoc',

View file

@ -21,13 +21,13 @@
"node": ">=16"
},
"dependencies": {
"@docusaurus/core": "2.1.0",
"@docusaurus/plugin-content-docs": "2.1.0",
"@docusaurus/plugin-google-analytics": "2.1.0",
"@docusaurus/preset-classic": "2.1.0",
"@docusaurus/remark-plugin-npm2yarn": "2.1.0",
"@docusaurus/theme-common": "2.1.0",
"@docusaurus/theme-search-algolia": "2.1.0",
"@docusaurus/core": "2.2.0",
"@docusaurus/plugin-content-docs": "2.2.0",
"@docusaurus/plugin-google-analytics": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/remark-plugin-npm2yarn": "2.2.0",
"@docusaurus/theme-common": "2.2.0",
"@docusaurus/theme-search-algolia": "2.2.0",
"@mdx-js/react": "^1.6.22",
"@mui/icons-material": "5.10.9",
"@mui/material": "5.10.9",
@ -62,7 +62,7 @@
]
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.1.0",
"@docusaurus/module-type-aliases": "2.2.0",
"@tsconfig/docusaurus": "^1.0.2",
"@verdaccio/crowdin-translations": "workspace:*",
"docusaurus-plugin-sass": "^0.2.1",

View file

@ -1,7 +1,6 @@
import Translate from '@docusaurus/Translate';
import Tooltip from '@mui/material/Tooltip';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import Avatar from '@mui/material/Avatar';
import Badge from '@mui/material/Badge';
import Chip from '@mui/material/Chip';
import Dialog from '@mui/material/Dialog';
@ -14,11 +13,8 @@ import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import Typography from '@mui/material/Typography';
import { green, yellow } from '@mui/material/colors';
import { createStyles } from '@mui/material/styles';
import { makeStyles, withStyles } from '@mui/styles';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import styled from '@emotion/styled';
import EmojiEventsIcon from '@mui/icons-material/EmojiEvents';
import MergeTypeIcon from '@mui/icons-material/MergeType';
import StarIcon from '@mui/icons-material/Star';
@ -160,9 +156,11 @@ const Contributors: React.FC<ContributorsProps> = ({ data }): React.ReactElement
onKeyDown={(event) => handleKeyDown(event, userItem)}
onClick={() => handleClickOpen(userItem)}
>
<Avatar
<img
src={generateImage(userItem.node.userId)}
alt={userItem.node.url}
width="40px"
style={{borderRadius: '10px'}}
/>
</div>
);
@ -178,10 +176,12 @@ const Contributors: React.FC<ContributorsProps> = ({ data }): React.ReactElement
target="_blank"
rel="noreferrer"
>
<Avatar
<img
src={generateImage(user.node.userId)}
alt={user.node.url}
className={classes.medium}
width="40px"
style={{borderRadius: '10px'}}
/>
</a>
</Grid>

View file

@ -47,7 +47,17 @@ If you only want to publish your package to Verdaccio but keep installing from o
}
```
## Troubleshooting
## Troubleshooting {#troubleshooting}
### `npm login` with npm@9 or higher
If you are running into issues login with `npm@9.x` or higher you could try use the legacy mode.
```bash
npm login --auth-type=legacy
```
For progress on the native support on future you can track the following [issue#3413](https://github.com/verdaccio/verdaccio/issues/3413).
### npm does not save authToken when authenticating to Verdaccio

View file

@ -5,7 +5,11 @@ title: "pnpm"
### pnpm {#pnpm}
> This includes 4.x and 5.x series.
> This includes 6.x or higher series.
`pnpm` recognize by default the configuration at `.npmrc` and also the `--registry` value.
This means that you can follow the same commands described in [npm](setup-npm.md) replacing `npm` by `pnpm`.
## Troubleshooting
The most of problems might be resolved with the [npm troubleshooting list](setup-npm.md##troubleshooting) since are highly compatible in most of the commands.

View file

@ -5,11 +5,11 @@ title: "yarn"
# yarn {#yarn}
#### Yarn (1.x) {#yarn-1x}
#### `yarn` classic (1.x) {#yarn-classic-1x}
> Be aware npm configurations are valid on the classic version
> Be aware `.npmrc` file configuration is recognized by yarn classic.
The classic version is able to regonize the `.npmrc` file, but also provides their own configuration file named `.yarnrc`.
The classic version is able to regonise the `.npmrc` file, but also provides their own configuration file named `.yarnrc`.
To set up a registry, create a file and define a registry.
@ -18,17 +18,23 @@ To set up a registry, create a file and define a registry.
registry "http://localhost:4873"
```
By using this version you should enable `always-auth` in your configuration running:
`yarn@1.x` by default does not send the token on every request unless is being opt-in manually, this might causes `403 error` if you have protected the access of your packages.
To change this behaviour enable `always-auth` in your configuration :
```
always-auth=true
```
or running
```
npm config set always-auth true
```
`yarn@1.x` does not send the authorization header on `yarn install` if your packages requires authentication, by enabling `always-auth` will force yarn do it on each request.
#### `yarn` modern (>=2.x) {#yarn-modern-2x}
#### Yarn Berry (>=2.x) {#yarn-berry-2x}
> Yarn berry does not recognize `--registry` or `.npmrc` file anymore.
> Yarn modern does not recognize `--registry` or `.npmrc` file anymore.
For defining a registry you must use the `.yarnrc.yml` located in the root of your project or global configuration.
@ -62,3 +68,10 @@ for logging via CLi use:
```
yarn npm login --scope my-company
```
## Troubleshooting {#troubleshooting}
### Known issues
- `yarn npm login` issues, read [verdaccio#1737](https://github.com/verdaccio/verdaccio/issues/1737) or [yarn-berry#1848](https://github.com/yarnpkg/berry/pull/1848).
- `yarn npm publish` does not send README, read [verdaccio#1905](https://github.com/verdaccio/verdaccio/issues/1905) or [yarn-berry#1702](https://github.com/yarnpkg/berry/issues/1702).