fix: prod deps should not be installed as dev deps

This commit is contained in:
Zoltan Kochan
2022-01-07 22:44:07 +02:00
parent a7ed822703
commit ea24c69fe4
15 changed files with 55 additions and 21 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/build-modules": patch
"@pnpm/default-reporter": patch
---
`@pnpm/logger` should be a peer dependency.

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-store": patch
---
`load-json-file` is a dev dependency.

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-installation": patch
---
`@pnpm/matcher` should be a prod dependency.

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-outdated": patch
---
`strip-ansi` should be a prod dependency.

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-script-runners": patch
---
`@zkochan/rimraf` should be a prod dependency.

View File

@@ -29,6 +29,9 @@
"url": "https://github.com/pnpm/pnpm/issues"
},
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/build-modules#readme",
"peerDependencies": {
"@pnpm/logger": "^4.0.0"
},
"dependencies": {
"@pnpm/constants": "workspace:5.0.0",
"@pnpm/core-loggers": "workspace:6.1.2",

View File

@@ -30,6 +30,9 @@
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"peerDependencies": {
"@pnpm/logger": "^4.0.0"
},
"dependencies": {
"@pnpm/config": "workspace:13.9.0",
"@pnpm/core-loggers": "workspace:6.1.2",

View File

@@ -47,6 +47,7 @@
"devDependencies": {
"@pnpm/logger": "^4.0.0",
"@types/rimraf": "^3.0.0",
"@zkochan/rimraf": "^2.1.1",
"json-append": "1.1.1",
"load-json-file": "^6.2.0"
},

View File

@@ -2,7 +2,7 @@
import path from 'path'
import runLifecycleHook, { runPostinstallHooks } from '@pnpm/lifecycle'
import loadJsonFile from 'load-json-file'
import rimraf from 'rimraf'
import rimraf from '@zkochan/rimraf'
const fixtures = path.join(__dirname, 'fixtures')
const rootModulesDir = path.join(__dirname, '..', 'node_modules')
@@ -39,7 +39,7 @@ test('runLifecycleHook() escapes the args passed to the script', async () => {
test('runPostinstallHooks()', async () => {
const pkgRoot = path.join(fixtures, 'with-many-scripts')
rimraf.sync(path.join(pkgRoot, 'output.json'))
await rimraf(path.join(pkgRoot, 'output.json'))
await runPostinstallHooks({
depPath: '/with-many-scripts/1.0.0',
optional: false,

View File

@@ -36,7 +36,6 @@
"@pnpm/assert-project": "workspace:*",
"@pnpm/lockfile-types": "workspace:3.1.4",
"@pnpm/logger": "^4.0.0",
"@pnpm/matcher": "workspace:2.0.0",
"@pnpm/modules-yaml": "workspace:9.0.10",
"@pnpm/prepare": "workspace:0.0.32",
"@pnpm/test-fixtures": "workspace:*",
@@ -69,6 +68,7 @@
"@pnpm/find-workspace-packages": "workspace:3.1.34",
"@pnpm/graceful-fs": "workspace:1.0.0",
"@pnpm/manifest-utils": "workspace:2.1.5",
"@pnpm/matcher": "workspace:2.0.0",
"@pnpm/outdated": "workspace:9.0.27",
"@pnpm/package-store": "workspace:12.1.7",
"@pnpm/parse-wanted-dependency": "workspace:2.0.0",

View File

@@ -1,9 +1,8 @@
import path from 'path'
import { promisify } from 'util'
import { install, fetch } from '@pnpm/plugin-commands-installation'
import prepare from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import rimraf from 'rimraf'
import rimraf from '@zkochan/rimraf'
const REGISTRY_URL = `http://localhost:${REGISTRY_MOCK_PORT}`
@@ -46,8 +45,8 @@ test('fetch dependencies', async () => {
storeDir,
})
await promisify(rimraf)(path.resolve(project.dir(), 'node_modules'))
await promisify(rimraf)(path.resolve(project.dir(), './package.json'))
await rimraf(path.resolve(project.dir(), 'node_modules'))
await rimraf(path.resolve(project.dir(), './package.json'))
await project.storeHasNot('is-negative')
await project.storeHasNot('is-positive')
@@ -77,8 +76,8 @@ test('fetch production dependencies', async () => {
storeDir,
})
await promisify(rimraf)(path.resolve(project.dir(), 'node_modules'))
await promisify(rimraf)(path.resolve(project.dir(), './package.json'))
await rimraf(path.resolve(project.dir(), 'node_modules'))
await rimraf(path.resolve(project.dir(), './package.json'))
await project.storeHasNot('is-negative')
await project.storeHasNot('is-positive')
@@ -109,8 +108,8 @@ test('fetch only dev dependencies', async () => {
storeDir,
})
await promisify(rimraf)(path.resolve(project.dir(), 'node_modules'))
await promisify(rimraf)(path.resolve(project.dir(), './package.json'))
await rimraf(path.resolve(project.dir(), 'node_modules'))
await rimraf(path.resolve(project.dir(), './package.json'))
await project.storeHasNot('is-negative')
await project.storeHasNot('is-positive')

View File

@@ -37,12 +37,10 @@
"@pnpm/filter-workspace-packages": "workspace:4.4.14",
"@pnpm/plugin-commands-installation": "workspace:8.1.5",
"@pnpm/prepare": "workspace:0.0.32",
"@pnpm/types": "workspace:7.8.0",
"@types/lru-cache": "^5.1.0",
"@types/ramda": "0.27.39",
"@types/wrap-ansi": "^3.0.0",
"@types/zkochan__table": "npm:@types/table@6.0.0",
"strip-ansi": "^6.0.0"
"@types/zkochan__table": "npm:@types/table@6.0.0"
},
"dependencies": {
"@pnpm/cli-utils": "workspace:0.6.42",
@@ -58,11 +56,13 @@
"@pnpm/outdated": "workspace:9.0.27",
"@pnpm/semver-diff": "^1.0.2",
"@pnpm/store-path": "^5.0.0",
"@pnpm/types": "workspace:7.8.0",
"@zkochan/table": "^1.0.0",
"chalk": "^4.1.0",
"lru-cache": "^6.0.0",
"ramda": "^0.27.1",
"render-help": "^1.0.1",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
},
"funding": "https://opencollective.com/pnpm"

View File

@@ -38,7 +38,6 @@
"@pnpm/logger": "^4.0.0",
"@pnpm/prepare": "workspace:0.0.32",
"@types/ramda": "0.27.39",
"@zkochan/rimraf": "^2.1.1",
"is-windows": "^1.0.2",
"write-yaml-file": "^4.2.0"
},
@@ -53,6 +52,7 @@
"@pnpm/sort-packages": "workspace:2.1.6",
"@pnpm/store-path": "^5.0.0",
"@pnpm/types": "workspace:7.8.0",
"@zkochan/rimraf": "^2.1.1",
"execa": "npm:safe-execa@^0.1.1",
"p-limit": "^3.1.0",
"path-exists": "^4.0.0",

View File

@@ -42,7 +42,6 @@
"@types/ssri": "^7.1.0",
"@zkochan/rimraf": "^2.1.1",
"execa": "npm:safe-execa@^0.1.1",
"load-json-file": "^6.2.0",
"path-exists": "^4.0.0",
"ssri": "^8.0.1",
"tempy": "^1.0.0"
@@ -64,6 +63,7 @@
"archy": "^1.0.0",
"dependency-path": "workspace:8.0.9",
"dint": "^5.1.0",
"load-json-file": "^6.2.0",
"p-filter": "^2.1.0",
"ramda": "^0.27.1",
"render-help": "^1.0.1"

12
pnpm-lock.yaml generated
View File

@@ -1174,6 +1174,7 @@ importers:
'@pnpm/store-controller-types': workspace:11.0.10
'@pnpm/types': workspace:7.8.0
'@types/rimraf': ^3.0.0
'@zkochan/rimraf': ^2.1.1
json-append: 1.1.1
load-json-file: ^6.2.0
path-exists: ^4.0.0
@@ -1191,6 +1192,7 @@ importers:
'@pnpm/lifecycle': 'link:'
'@pnpm/logger': 4.0.0
'@types/rimraf': 3.0.2
'@zkochan/rimraf': 2.1.1
json-append: 1.1.1
load-json-file: 6.2.0
@@ -2162,6 +2164,7 @@ importers:
'@pnpm/find-workspace-packages': link:../find-workspace-packages
'@pnpm/graceful-fs': link:../graceful-fs
'@pnpm/manifest-utils': link:../manifest-utils
'@pnpm/matcher': link:../matcher
'@pnpm/outdated': link:../outdated
'@pnpm/package-store': link:../package-store
'@pnpm/parse-wanted-dependency': link:../parse-wanted-dependency
@@ -2198,7 +2201,6 @@ importers:
'@pnpm/assert-project': link:../../privatePackages/assert-project
'@pnpm/lockfile-types': link:../lockfile-types
'@pnpm/logger': 4.0.0
'@pnpm/matcher': link:../matcher
'@pnpm/modules-yaml': link:../modules-yaml
'@pnpm/plugin-commands-installation': 'link:'
'@pnpm/prepare': link:../../privatePackages/prepare
@@ -2305,11 +2307,13 @@ importers:
'@pnpm/outdated': link:../outdated
'@pnpm/semver-diff': 1.1.0
'@pnpm/store-path': 5.0.0
'@pnpm/types': link:../types
'@zkochan/table': 1.0.0
chalk: 4.1.2
lru-cache: 6.0.0
ramda: 0.27.1
render-help: 1.0.2
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
devDependencies:
'@pnpm/constants': link:../constants
@@ -2317,12 +2321,10 @@ importers:
'@pnpm/plugin-commands-installation': link:../plugin-commands-installation
'@pnpm/plugin-commands-outdated': 'link:'
'@pnpm/prepare': link:../../privatePackages/prepare
'@pnpm/types': link:../types
'@types/lru-cache': 5.1.1
'@types/ramda': 0.27.39
'@types/wrap-ansi': 3.0.0
'@types/zkochan__table': /@types/table/6.0.0
strip-ansi: 6.0.1
packages/plugin-commands-publishing:
specifiers:
@@ -2536,6 +2538,7 @@ importers:
'@pnpm/sort-packages': link:../sort-packages
'@pnpm/store-path': 5.0.0
'@pnpm/types': link:../types
'@zkochan/rimraf': 2.1.1
execa: /safe-execa/0.1.1
p-limit: 3.1.0
path-exists: 4.0.0
@@ -2549,7 +2552,6 @@ importers:
'@pnpm/plugin-commands-script-runners': 'link:'
'@pnpm/prepare': link:../../privatePackages/prepare
'@types/ramda': 0.27.39
'@zkochan/rimraf': 2.1.1
is-windows: 1.0.2
write-yaml-file: 4.2.0
@@ -2671,6 +2673,7 @@ importers:
archy: 1.0.0
dependency-path: link:../dependency-path
dint: 5.1.0
load-json-file: 6.2.0
p-filter: 2.1.0
ramda: 0.27.1
render-help: 1.0.2
@@ -2685,7 +2688,6 @@ importers:
'@types/ssri': 7.1.1
'@zkochan/rimraf': 2.1.1
execa: /safe-execa/0.1.1
load-json-file: 6.2.0
path-exists: 4.0.0
ssri: 8.0.1
tempy: 1.0.1