bcoe / bcoe/optional-dev-dependency

optionalDevDependencies ingored

Open
#21 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.