1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(install): duplicate dependencies in package.json (#26128)

Fixes https://github.com/denoland/deno/issues/26120
This commit is contained in:
Marvin Hagemeister 2024-10-10 21:31:45 +02:00 committed by GitHub
parent 66929de3ba
commit ccdbeb433b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 58 additions and 0 deletions

View file

@ -130,8 +130,10 @@ impl NpmConfig {
fn add(&mut self, selected: SelectedPackage, dev: bool) {
let (name, version) = package_json_dependency_entry(selected);
if dev {
self.dependencies.swap_remove(&name);
self.dev_dependencies.insert(name, version);
} else {
self.dev_dependencies.swap_remove(&name);
self.dependencies.insert(name, version);
}
}

View file

@ -0,0 +1,16 @@
{
"tempDir": true,
"steps": [
{
"args": "install npm:@denotest/esm-basic",
"output": "install.out"
},
{
"args": [
"eval",
"console.log(Deno.readTextFileSync('package.json').trim())"
],
"output": "package.json.out"
}
]
}

View file

@ -0,0 +1,4 @@
Add npm:@denotest/esm-basic@1.0.0
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/esm-basic@1.0.0

View file

@ -0,0 +1,3 @@
{
"devDependencies": { "@denotest/esm-basic": "^1.0.0" }
}

View file

@ -0,0 +1,5 @@
{
"dependencies": {
"@denotest/esm-basic": "^1.0.0"
}
}

View file

@ -0,0 +1,16 @@
{
"tempDir": true,
"steps": [
{
"args": "install --dev npm:@denotest/esm-basic",
"output": "install.out"
},
{
"args": [
"eval",
"console.log(Deno.readTextFileSync('package.json').trim())"
],
"output": "package.json.out"
}
]
}

View file

@ -0,0 +1,4 @@
Add npm:@denotest/esm-basic@1.0.0
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/esm-basic@1.0.0

View file

@ -0,0 +1,3 @@
{
"dependencies": { "@denotest/esm-basic": "^1.0.0" }
}

View file

@ -0,0 +1,5 @@
{
"devDependencies": {
"@denotest/esm-basic": "^1.0.0"
}
}