bcoe / bcoe/optional-dev-dependency

optionalDevDependencies ingored

Aperta
#21 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
5
Fork
8
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi. I have three separate problems, it's hard to split this into individual issues.

1. In my `package.json` I have specified the exact version number:
```json
"optionalDevDependencies": {
"@vue/cli-plugin-e2e-cypress": "3.0.0-beta.6"
}
```

After running `optional-dev-dependency @vue/cli-plugin-e2e-cypress` I would expect `3.0.0-beta.6` version to be installed. The actual outcome is that the latest `3.0.5` installed.

2. `package.json` becomes changed because `@vue/cli-plugin-e2e-cypress` is injected to `dependencies`:
```diff
"dependencies": {
+ "@vue/cli-plugin-e2e-cypress": "^3.0.5",
...
```
I didn't use `--save` flag, `package.json` should not get changed.

3. Even if `--save` somehow broken and enabled by default, the dependency should be saved in `optionalDevDependencies`, in the worst case in `devDependencies`, and for sure not in `dependencies`.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with the reported package.json and reproduce `optional-dev-dependency @vue/cli-plugin-e2e-cypress` using the exact optionalDevDependencies version shown. Trace the command's install and save handling; done means it installs 3.0.0-beta.6, leaves package.json unchanged without `--save`, and saves to optionalDevDependencies rather than dependencies when requested.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli, developer-experience
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.