refactor: remove common-tags from dependencies

This commit is contained in:
Zoltan Kochan
2020-06-21 16:13:18 +03:00
parent c85768310e
commit 220896511a
50 changed files with 849 additions and 1127 deletions

View File

@@ -0,0 +1,16 @@
---
"@pnpm/default-reporter": patch
"@pnpm/list": patch
"@pnpm/outdated": patch
"@pnpm/plugin-commands-installation": patch
"@pnpm/plugin-commands-listing": patch
"@pnpm/plugin-commands-outdated": patch
"@pnpm/plugin-commands-rebuild": patch
"@pnpm/plugin-commands-script-runners": patch
"@pnpm/plugin-commands-server": patch
"@pnpm/plugin-commands-store": patch
"pnpm": patch
"supi": patch
---
Remove common-tags from dependencies.

View File

@@ -36,6 +36,6 @@
"verdaccio": "^4.6.2"
},
"engines": {
"pnpm": ">=5"
"pnpm": ">=5 || ^0.0.0-x"
}
}

View File

@@ -37,7 +37,6 @@
"@zkochan/zen-push": "1.0.0",
"ansi-diff": "^1.1.1",
"chalk": "^4.1.0",
"common-tags": "^1.8.0",
"most": "^1.8.1",
"normalize-path": "^3.0.0",
"pretty-bytes": "^5.3.0",
@@ -53,7 +52,6 @@
"devDependencies": {
"@pnpm/default-reporter": "link:",
"@pnpm/logger": "3.2.2",
"@types/common-tags": "^1.8.0",
"@types/normalize-path": "^3.0.0",
"@types/pretty-time": "^1.1.0",
"@types/ramda": "^0.27.6",

View File

@@ -1,7 +1,6 @@
import { Log } from '@pnpm/core-loggers'
import PnpmError from '@pnpm/error'
import chalk = require('chalk')
import commonTags = require('common-tags')
import R = require('ramda')
import StackTracey = require('stacktracey')
import { EOL } from './constants'
@@ -12,8 +11,6 @@ StackTracey.maxColumnWidths = {
sourceLine: 25,
}
const stripIndent = commonTags.stripIndent
const stripIndents = commonTags.stripIndents
const highlight = chalk.yellow
const colorPath = chalk.gray
@@ -72,11 +69,10 @@ function formatPkgsStack (pkgsStack: Array<{ id: string, name: string, version:
function formatNoMatchingVersion (err: Error, msg: object) {
const meta = msg['packageMeta']
let output = stripIndent`
${formatErrorSummary(err.message)}
let output = `\
${formatErrorSummary(err.message)}
The latest release of ${meta.name} is "${meta['dist-tags'].latest}".
` + EOL
The latest release of ${meta.name} is "${meta['dist-tags'].latest}".${EOL}`
if (!R.equals(R.keys(meta['dist-tags']), ['latest'])) {
output += EOL + 'Other releases are:' + EOL
@@ -93,41 +89,36 @@ function formatNoMatchingVersion (err: Error, msg: object) {
}
function reportUnexpectedStore (err: Error, msg: object) {
return stripIndent`
${formatErrorSummary(err.message)}
return `${formatErrorSummary(err.message)}
The dependencies at "${msg['modulesDir']}" are currently linked from the store at "${msg['expectedStorePath']}".
The dependencies at "${msg['modulesDir']}" are currently linked from the store at "${msg['expectedStorePath']}".
pnpm now wants to use the store at "${msg['actualStorePath']}" to link dependencies.
pnpm now wants to use the store at "${msg['actualStorePath']}" to link dependencies.
If you want to use the new store location, reinstall your dependencies with "pnpm install".
If you want to use the new store location, reinstall your dependencies with "pnpm install".
You may change the global store location by running "pnpm config set store-dir <dir>".
(This error may happen if the node_modules was installed with a different major version of pnpm)
`
You may change the global store location by running "pnpm config set store-dir <dir>".
(This error may happen if the node_modules was installed with a different major version of pnpm)`
}
function reportUnexpectedVirtualStoreDir (err: Error, msg: object) {
return stripIndent`
${formatErrorSummary(err.message)}
return `${formatErrorSummary(err.message)}
The dependencies at "${msg['modulesDir']}" are currently symlinked from the virtual store directory at "${msg['expected']}".
The dependencies at "${msg['modulesDir']}" are currently symlinked from the virtual store directory at "${msg['expected']}".
pnpm now wants to use the virtual store at "${msg['actual']}" to link dependencies from the store.
pnpm now wants to use the virtual store at "${msg['actual']}" to link dependencies from the store.
If you want to use the new virtual store location, reinstall your dependencies with "pnpm install".
If you want to use the new virtual store location, reinstall your dependencies with "pnpm install".
You may change the virtual store location by changing the value of the virtual-store-dir config.
`
You may change the virtual store location by changing the value of the virtual-store-dir config.`
}
function reportStoreBreakingChange (msg: object) {
let output = stripIndent`
${formatErrorSummary(`The store used for the current node_modules is incomatible with the current version of pnpm`)}
Store path: ${colorPath(msg['storePath'])}
let output = `\
${formatErrorSummary(`The store used for the current node_modules is incomatible with the current version of pnpm`)}
Store path: ${colorPath(msg['storePath'])}
Run "pnpm install" to recreate node_modules.
`
Run "pnpm install" to recreate node_modules.`
if (msg['additionalInformation']) {
output += EOL + EOL + msg['additionalInformation']
@@ -138,12 +129,11 @@ function reportStoreBreakingChange (msg: object) {
}
function reportModulesBreakingChange (msg: object) {
let output = stripIndent`
${formatErrorSummary(`The current version of pnpm is not compatible with the available node_modules structure`)}
node_modules path: ${colorPath(msg['modulesPath'])}
let output = `\
${formatErrorSummary(`The current version of pnpm is not compatible with the available node_modules structure`)}
node_modules path: ${colorPath(msg['modulesPath'])}
Run ${highlight('pnpm install')} to recreate node_modules.
`
Run ${highlight('pnpm install')} to recreate node_modules.`
if (msg['additionalInformation']) {
output += EOL + EOL + msg['additionalInformation']
@@ -180,10 +170,7 @@ function formatGenericError (errorMessage: string, stack: object) {
prettyStack = undefined
}
if (prettyStack) {
return stripIndents`
${formatErrorSummary(errorMessage)}
${prettyStack}
`
return `${formatErrorSummary(errorMessage)}${EOL}${prettyStack}`
}
}
return formatErrorSummary(errorMessage)
@@ -194,22 +181,20 @@ function formatErrorSummary (message: string) {
}
function reportModifiedDependency (msg: object) {
return stripIndent`
${formatErrorSummary('Packages in the store have been mutated')}
return `\
${formatErrorSummary('Packages in the store have been mutated')}
These packages are modified:
${msg['modified'].map((pkgPath: string) => colorPath(pkgPath)).join(EOL)}
These packages are modified:
${msg['modified'].map((pkgPath: string) => colorPath(pkgPath)).join(EOL)}
You can run ${highlight('pnpm install')} to refetch the modified packages
`
You can run ${highlight('pnpm install')} to refetch the modified packages`
}
function reportLockfileBreakingChange (err: Error, msg: object) {
return stripIndent`
${formatErrorSummary(err.message)}
return `\
${formatErrorSummary(err.message)}
Run with the ${highlight('--force')} parameter to recreate the lockfile.
`
Run with the ${highlight('--force')} parameter to recreate the lockfile.`
}
function formatRecursiveCommandSummary (msg: { fails: Array<Error & {prefix: string}>, passes: number }) {
@@ -221,24 +206,23 @@ function formatRecursiveCommandSummary (msg: { fails: Array<Error & {prefix: str
}
function reportBadTarballSize (err: Error, msg: object) {
return stripIndent`
${formatErrorSummary(err.message)}
return `\
${formatErrorSummary(err.message)}
Seems like you have internet connection issues.
Try running the same command again.
If that doesn't help, try one of the following:
Seems like you have internet connection issues.
Try running the same command again.
If that doesn't help, try one of the following:
- Set a bigger value for the \`fetch-retries\` config.
To check the current value of \`fetch-retries\`, run \`pnpm get fetch-retries\`.
To set a new value, run \`pnpm set fetch-retries <number>\`.
- Set a bigger value for the \`fetch-retries\` config.
To check the current value of \`fetch-retries\`, run \`pnpm get fetch-retries\`.
To set a new value, run \`pnpm set fetch-retries <number>\`.
- Set \`network-concurrency\` to 1.
This change will slow down installation times, so it is recommended to
delete the config once the internet connection is good again: \`pnpm config delete network-concurrency\`
- Set \`network-concurrency\` to 1.
This change will slow down installation times, so it is recommended to
delete the config once the internet connection is good again: \`pnpm config delete network-concurrency\`
NOTE: You may also override configs via flags.
For instance, \`pnpm install --fetch-retries 5 --network-concurrency 1\`
`
NOTE: You may also override configs via flags.
For instance, \`pnpm install --fetch-retries 5 --network-concurrency 1\``
}
function reportLifecycleError (
@@ -273,30 +257,28 @@ function reportEngineError (
) {
let output = ''
if (msg.wanted.pnpm) {
output += stripIndent`
${formatErrorSummary(`Your pnpm version is incompatible with "${msg.packageId}".`)}
output += `\
${formatErrorSummary(`Your pnpm version is incompatible with "${msg.packageId}".`)}
Expected version: ${msg.wanted.pnpm}
Got: ${msg.current.pnpm}
Expected version: ${msg.wanted.pnpm}
Got: ${msg.current.pnpm}
This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.
This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.
To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".
`
To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".`
}
if (msg.wanted.node) {
if (output) output += EOL + EOL
output += stripIndent`
${formatErrorSummary(`Your Node version is incompatible with "${msg.packageId}".`)}
output += `\
${formatErrorSummary(`Your Node version is incompatible with "${msg.packageId}".`)}
Expected version: ${msg.wanted.node}
Got: ${msg.current.node}
Expected version: ${msg.wanted.node}
Got: ${msg.current.node}
This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.
`
This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.`
}
return output || formatErrorSummary(err.message)
}

View File

@@ -1,5 +1,4 @@
import { RequestRetryLog } from '@pnpm/core-loggers'
import { oneLine } from 'common-tags'
import most = require('most')
import prettyMilliseconds = require('pretty-ms')
import formatWarn from './utils/formatWarn'
@@ -11,9 +10,9 @@ export default (
.map((log) => {
const retriesLeft = log.maxRetries - log.attempt + 1
const errorCode = log.error['httpStatusCode'] || log.error['status'] || log.error['errno'] || log.error['code']
const msg = oneLine`${log.method} ${log.url} error (${errorCode}).
Will retry in ${prettyMilliseconds(log.timeout, { verbose: true })}.
${retriesLeft} retries left.`
const msg = `${log.method} ${log.url} error (${errorCode}). \
Will retry in ${prettyMilliseconds(log.timeout, { verbose: true })}. \
${retriesLeft} retries left.`
return most.of({ msg: formatWarn(msg) })
})
}

View File

@@ -15,7 +15,6 @@ import logger, {
createStreamParser,
} from '@pnpm/logger'
import chalk = require('chalk')
import { stripIndent, stripIndents } from 'common-tags'
import normalizeNewline = require('normalize-newline')
import path = require('path')
import R = require('ramda')
@@ -189,28 +188,28 @@ test('prints summary (of current package only)', t => {
t.equal(output,
`packages/foo | ${chalk.green('+5')} ${chalk.red('-1')} ${ADD + SUB}${EOL}` +
`${WARN} ${DEPRECATED} bar@2.0.0: This package was deprecated because bla bla bla${EOL}${EOL}` +
stripIndents`
${h1('dependencies:')}
${ADD} bar ${versionColor('2.0.0')} ${DEPRECATED}
${SUB} foo ${versionColor('0.1.0')}
${ADD} foo ${versionColor('1.0.0')} ${versionColor('(2.0.0 is available)')}
${SUB} is-13 ${versionColor('^1.0.0')}
${ADD} is-negative ${versionColor('^1.0.0')}
${ADD} winston <- winst0n ${versionColor('1.0.0')}
`\
${h1('dependencies:')}
${ADD} bar ${versionColor('2.0.0')} ${DEPRECATED}
${SUB} foo ${versionColor('0.1.0')}
${ADD} foo ${versionColor('1.0.0')} ${versionColor('(2.0.0 is available)')}
${SUB} is-13 ${versionColor('^1.0.0')}
${ADD} is-negative ${versionColor('^1.0.0')}
${ADD} winston <- winst0n ${versionColor('1.0.0')}
${h1('optionalDependencies:')}
${ADD} is-linked ${chalk.grey(`<- ${path.relative(prefix, '/src/is-linked')}`)}
${SUB} is-positive
${ADD} lala ${versionColor('1.1.0')}
${h1('optionalDependencies:')}
${ADD} is-linked ${chalk.grey(`<- ${path.relative(prefix, '/src/is-linked')}`)}
${SUB} is-positive
${ADD} lala ${versionColor('1.1.0')}
${h1('devDependencies:')}
${ADD} is-13 ${versionColor('^1.0.0')}
${SUB} is-negative ${versionColor('^1.0.0')}
${ADD} qar ${versionColor('2.0.0')}
${h1('devDependencies:')}
${ADD} is-13 ${versionColor('^1.0.0')}
${SUB} is-negative ${versionColor('^1.0.0')}
${ADD} qar ${versionColor('2.0.0')}
${h1('node_modules:')}
${ADD} is-linked2 ${chalk.grey(`<- ${path.relative(prefix, '/src/is-linked2')}`)}
` + '\n')
${h1('node_modules:')}
${ADD} is-linked2 ${chalk.grey(`<- ${path.relative(prefix, '/src/is-linked2')}`)}
`)
},
})
})
@@ -269,11 +268,11 @@ test('prints summary for global installation', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, EOL + stripIndents`
${h1(`${prefix}:`)}
${ADD} bar ${versionColor('2.0.0')}
${ADD} foo ${versionColor('1.0.0')} ${versionColor('(2.0.0 is available)')}
` + '\n')
t.equal(output, EOL + `\
${h1(`${prefix}:`)}
${ADD} bar ${versionColor('2.0.0')}
${ADD} foo ${versionColor('1.0.0')} ${versionColor('(2.0.0 is available)')}
`)
},
})
})
@@ -313,13 +312,13 @@ test('prints added peer dependency', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, EOL + stripIndents`
${h1('peerDependencies:')}
${ADD} is-negative ${versionColor('^1.0.0')}
t.equal(output, EOL + `\
${h1('peerDependencies:')}
${ADD} is-negative ${versionColor('^1.0.0')}
${h1('devDependencies:')}
${ADD} is-negative ${versionColor('^1.0.0')}
` + '\n')
${h1('devDependencies:')}
${ADD} is-negative ${versionColor('^1.0.0')}
`)
},
})
})
@@ -380,10 +379,10 @@ test('prints summary correctly when the same package is specified both in option
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, EOL + stripIndents`
${h1('dependencies:')}
${ADD} bar ${versionColor('2.0.0')}
` + '\n')
t.equal(output, EOL + `\
${h1('dependencies:')}
${ADD} bar ${versionColor('2.0.0')}
`)
},
})
})
@@ -400,27 +399,25 @@ test('prints summary when some packages fail', async (t) => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, EOL + stripIndent`
Summary: ${chalk.red('6 fails')}, 7 passes
t.equal(output, EOL + `Summary: ${chalk.red('6 fails')}, 7 passes
/a:
${ERROR} ${chalk.red('a failed')}
/a:
${ERROR} ${chalk.red('a failed')}
/b:
${ERROR} ${chalk.red('b failed')}
/b:
${ERROR} ${chalk.red('b failed')}
/c:
${ERROR} ${chalk.red('c failed')}
/c:
${ERROR} ${chalk.red('c failed')}
/d:
${ERROR} ${chalk.red('d failed')}
/d:
${ERROR} ${chalk.red('d failed')}
/e:
${ERROR} ${chalk.red('e failed')}
/e:
${ERROR} ${chalk.red('e failed')}
/f:
${ERROR} ${chalk.red('f failed')}
`)
/f:
${ERROR} ${chalk.red('f failed')}`)
},
})
@@ -490,9 +487,8 @@ test('prints added/removed stats during installation', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.green('+5')} ${chalk.red('-1')}
${ADD + ADD + ADD + ADD + ADD + SUB}`
t.equal(output, `Packages: ${chalk.green('+5')} ${chalk.red('-1')}
${ADD + ADD + ADD + ADD + ADD + SUB}`
)
},
})
@@ -514,9 +510,8 @@ test('prints added/removed stats during installation when 0 removed', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.green('+2')}
${ADD + ADD}`
t.equal(output, `Packages: ${chalk.green('+2')}
${ADD + ADD}`
)
},
})
@@ -538,10 +533,8 @@ test('prints only the added stats if nothing was removed', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.green('+1')}
${ADD}`
)
t.equal(output, `Packages: ${chalk.green('+1')}
${ADD}`)
},
})
})
@@ -562,10 +555,8 @@ test('prints only the removed stats if nothing was added', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.red('-1')}
${SUB}`
)
t.equal(output, `Packages: ${chalk.red('-1')}
${SUB}`)
},
})
})
@@ -587,10 +578,8 @@ test('prints only the added stats if nothing was removed and a lot added', t =>
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.green('+100')}
${R.repeat(ADD, 20).join('')}`
)
t.equal(output, `Packages: ${chalk.green('+100')}
${R.repeat(ADD, 20).join('')}`)
},
})
})
@@ -612,10 +601,8 @@ test('prints only the removed stats if nothing was added and a lot removed', t =
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.red('-100')}
${R.repeat(SUB, 20).join('')}`
)
t.equal(output, `Packages: ${chalk.red('-100')}
${R.repeat(SUB, 20).join('')}`)
},
})
})
@@ -637,9 +624,8 @@ test('prints at least one remove sign when removed !== 0', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.green('+100')} ${chalk.red('-1')}
${R.repeat(ADD, 19).join('') + SUB}`
t.equal(output, `Packages: ${chalk.green('+100')} ${chalk.red('-1')}
${R.repeat(ADD, 19).join('') + SUB}`
)
},
})
@@ -662,10 +648,8 @@ test('prints at least one add sign when added !== 0', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.green('+1')} ${chalk.red('-100')}
${ADD + R.repeat(SUB, 19).join('')}`
)
t.equal(output, `Packages: ${chalk.green('+1')} ${chalk.red('-100')}
${ADD + R.repeat(SUB, 19).join('')}`)
},
})
})
@@ -685,10 +669,8 @@ test('prints just removed during uninstallation', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Packages: ${chalk.red('-4')}
${SUB + SUB + SUB + SUB}`
)
t.equal(output, `Packages: ${chalk.red('-4')}
${SUB + SUB + SUB + SUB}`)
},
})
})
@@ -740,17 +722,16 @@ test('prints added/removed stats and warnings during recursive installation', t
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-5 | ${WARN} Some issue
. | ${WARN} Some other issue
. | ${chalk.red('-1')} ${SUB}
pkg-1 | ${chalk.green('+5')} ${chalk.red('-1')} ${ADD + SUB}
dir/pkg-2 | ${WARN} ${DEPRECATED} bar@2.0.0
dir/pkg-2 | ${chalk.green('+2')} ${ADD}
.../pkg-3 | ${chalk.green('+1')} ${ADD}
...ooooooooooooooooooooooooooooong-pkg-4 | ${chalk.red('-1')} ${SUB}
. | ${WARN} ${DEPRECATED} foo@1.0.0`
)
t.equal(output, `\
pkg-5 | ${WARN} Some issue
. | ${WARN} Some other issue
. | ${chalk.red('-1')} ${SUB}
pkg-1 | ${chalk.green('+5')} ${chalk.red('-1')} ${ADD + SUB}
dir/pkg-2 | ${WARN} ${DEPRECATED} bar@2.0.0
dir/pkg-2 | ${chalk.green('+2')} ${ADD}
.../pkg-3 | ${chalk.green('+1')} ${ADD}
...ooooooooooooooooooooooooooooong-pkg-4 | ${chalk.red('-1')} ${SUB}
. | ${WARN} ${DEPRECATED} foo@1.0.0`)
},
})
})
@@ -774,9 +755,7 @@ test('recursive installation: prints only the added stats if nothing was removed
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-1 | ${chalk.green('+190')} ${R.repeat(ADD, 12).join('')}`
)
t.equal(output, `pkg-1 | ${chalk.green('+190')} ${R.repeat(ADD, 12).join('')}`)
},
})
})
@@ -800,9 +779,7 @@ test('recursive installation: prints only the removed stats if nothing was added
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-1 | ${chalk.red('-190')} ${R.repeat(SUB, 12).join('')}`
)
t.equal(output, `pkg-1 | ${chalk.red('-190')} ${R.repeat(SUB, 12).join('')}`)
},
})
})
@@ -826,9 +803,7 @@ test('recursive installation: prints at least one remove sign when removed !== 0
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-1 | ${chalk.green('+100')} ${chalk.red('-1')} ${R.repeat(ADD, 8).join('') + SUB}`
)
t.equal(output, `pkg-1 | ${chalk.green('+100')} ${chalk.red('-1')} ${R.repeat(ADD, 8).join('') + SUB}`)
},
})
})
@@ -852,9 +827,7 @@ test('recursive installation: prints at least one add sign when added !== 0', t
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-1 | ${chalk.green('+1')} ${chalk.red('-100')} ${ADD + R.repeat(SUB, 8).join('')}`
)
t.equal(output, `pkg-1 | ${chalk.green('+1')} ${chalk.red('-100')} ${ADD + R.repeat(SUB, 8).join('')}`)
},
})
})
@@ -877,9 +850,7 @@ test('recursive uninstall: prints removed packages number', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-1 | ${chalk.red('-1')} ${SUB}`
)
t.equal(output, `pkg-1 | ${chalk.red('-1')} ${SUB}`)
},
})
})
@@ -906,9 +877,7 @@ test('install: print hook message', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
${chalk.magentaBright('readPackage')}: foo`
)
t.equal(output, `${chalk.magentaBright('readPackage')}: foo`)
},
})
})
@@ -935,9 +904,7 @@ test('recursive: print hook message', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
pkg-1 | ${chalk.magentaBright('readPackage')}: foo`
)
t.equal(output, `pkg-1 | ${chalk.magentaBright('readPackage')}: foo`)
},
})
})

View File

@@ -4,7 +4,6 @@ import logger, {
createStreamParser,
} from '@pnpm/logger'
import chalk = require('chalk')
import { stripIndent, stripIndents } from 'common-tags'
import loadJsonFile = require('load-json-file')
import normalizeNewline = require('normalize-newline')
import path = require('path')
@@ -28,10 +27,8 @@ test('prints generic error', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
${ERROR} ${chalk.red('some error')}
${new StackTracey(err.stack).pretty}
`)
t.equal(output, `${ERROR} ${chalk.red('some error')}
${new StackTracey(err.stack).pretty}`)
},
})
})
@@ -52,11 +49,9 @@ test('prints generic error when recursive install fails', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
/home/src/:
${ERROR} ${chalk.red('some error')}
${new StackTracey(err.stack).pretty}
`)
t.equal(output, `/home/src/:
${ERROR} ${chalk.red('some error')}
${new StackTracey(err.stack).pretty}`)
},
})
})
@@ -73,18 +68,16 @@ test('prints no matching version error when many dist-tags exist', async (t) =>
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndent`
${ERROR} ${chalk.red('No matching version found for pnpm@1000.0.0')}
t.equal(output, `${ERROR} ${chalk.red('No matching version found for pnpm@1000.0.0')}
The latest release of pnpm is "2.4.0".
The latest release of pnpm is "2.4.0".
Other releases are:
* stable: 2.2.2
* next: 2.4.0
* latest-1: 1.43.1
Other releases are:
* stable: 2.2.2
* next: 2.4.0
* latest-1: 1.43.1
If you need the full list of all 281 published versions run "$ pnpm view pnpm versions".
`)
If you need the full list of all 281 published versions run "$ pnpm view pnpm versions".`)
},
})
@@ -105,13 +98,11 @@ test('prints no matching version error when only the latest dist-tag exists', as
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndent`
${ERROR} ${chalk.red('No matching version found for is-positive@1000.0.0')}
t.equal(output, `${ERROR} ${chalk.red('No matching version found for is-positive@1000.0.0')}
The latest release of is-positive is "3.1.0".
The latest release of is-positive is "3.1.0".
If you need the full list of all 4 published versions run "$ pnpm view is-positive versions".
`)
If you need the full list of all 4 published versions run "$ pnpm view is-positive versions".`)
},
})
@@ -132,24 +123,22 @@ test('prints suggestions when an internet-connection related error happens', asy
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndent`
${ERROR} ${chalk.red('Actual size (99) of tarball (https://foo) did not match the one specified in \'Content-Length\' header (100)')}
t.equal(output, `${ERROR} ${chalk.red('Actual size (99) of tarball (https://foo) did not match the one specified in \'Content-Length\' header (100)')}
Seems like you have internet connection issues.
Try running the same command again.
If that doesn't help, try one of the following:
Seems like you have internet connection issues.
Try running the same command again.
If that doesn't help, try one of the following:
- Set a bigger value for the \`fetch-retries\` config.
To check the current value of \`fetch-retries\`, run \`pnpm get fetch-retries\`.
To set a new value, run \`pnpm set fetch-retries <number>\`.
- Set a bigger value for the \`fetch-retries\` config.
To check the current value of \`fetch-retries\`, run \`pnpm get fetch-retries\`.
To set a new value, run \`pnpm set fetch-retries <number>\`.
- Set \`network-concurrency\` to 1.
This change will slow down installation times, so it is recommended to
delete the config once the internet connection is good again: \`pnpm config delete network-concurrency\`
- Set \`network-concurrency\` to 1.
This change will slow down installation times, so it is recommended to
delete the config once the internet connection is good again: \`pnpm config delete network-concurrency\`
NOTE: You may also override configs via flags.
For instance, \`pnpm install --fetch-retries 5 --network-concurrency 1\`
`)
NOTE: You may also override configs via flags.
For instance, \`pnpm install --fetch-retries 5 --network-concurrency 1\``)
},
})
@@ -238,18 +227,16 @@ test('prints unsupported pnpm version error', async (t) => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndent`
${ERROR} ${chalk.red('Your pnpm version is incompatible with "/home/zoltan/project".')}
t.equal(output, `${ERROR} ${chalk.red('Your pnpm version is incompatible with "/home/zoltan/project".')}
Expected version: 2
Got: 3.0.0
Expected version: 2
Got: 3.0.0
This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.
This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.
To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".
`)
To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".`)
},
})
@@ -272,15 +259,13 @@ test('prints unsupported Node version error', async (t) => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndent`
${ERROR} ${chalk.red('Your Node version is incompatible with "/home/zoltan/project".')}
t.equal(output, `${ERROR} ${chalk.red('Your Node version is incompatible with "/home/zoltan/project".')}
Expected version: >=12
Got: 10.0.0
Expected version: >=12
Got: 10.0.0
This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.
`)
This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.`)
},
})
@@ -303,25 +288,23 @@ test('prints unsupported pnpm and Node versions error', async (t) => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndent`
${ERROR} ${chalk.red('Your pnpm version is incompatible with "/home/zoltan/project".')}
t.equal(output, `${ERROR} ${chalk.red('Your pnpm version is incompatible with "/home/zoltan/project".')}
Expected version: 2
Got: 3.0.0
Expected version: 2
Got: 3.0.0
This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.
This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.
To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".` + '\n\n' + stripIndent`
${ERROR} ${chalk.red('Your Node version is incompatible with "/home/zoltan/project".')}
To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".` + '\n\n' + `\
${ERROR} ${chalk.red('Your Node version is incompatible with "/home/zoltan/project".')}
Expected version: >=12
Got: 10.0.0
Expected version: >=12
Got: 10.0.0
This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.
`)
This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.`)
},
})
@@ -347,9 +330,7 @@ test('prints error even if the error object not passed in through the message ob
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, ERROR + ' ' + stripIndents`
${chalk.red('some error')}
`)
t.equal(output, ERROR + ' ' + `${chalk.red('some error')}`)
},
})
})
@@ -370,9 +351,7 @@ test('prints error without packages stacktrace when pkgsStack is empty', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, ERROR + ' ' + stripIndents`
${chalk.red('some error')}
`)
t.equal(output, ERROR + ' ' + `${chalk.red('some error')}`)
},
})
})
@@ -399,11 +378,9 @@ test('prints error with packages stacktrace - depth 1 and hint', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, ERROR + ' ' + stripIndents`
${chalk.red('some error')}
This error happened while installing the dependencies of foo@1.0.0
hint
`)
t.equal(output, ERROR + ' ' + `${chalk.red('some error')}
This error happened while installing the dependencies of foo@1.0.0
hint`)
},
})
})
@@ -435,11 +412,9 @@ test('prints error with packages stacktrace - depth 2', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, ERROR + ' ' + stripIndent`
${chalk.red('some error')}
This error happened while installing the dependencies of foo@1.0.0
at bar@1.0.0
`)
t.equal(output, ERROR + ' ' + `${chalk.red('some error')}
This error happened while installing the dependencies of foo@1.0.0
at bar@1.0.0`)
},
})
})
@@ -459,10 +434,8 @@ test('prints error and hint', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, ERROR + ' ' + stripIndents`
${chalk.red('some error')}
some hint
`)
t.equal(output, ERROR + ' ' + `${chalk.red('some error')}
some hint`)
},
})
})

View File

@@ -2,7 +2,6 @@ import { lifecycleLogger } from '@pnpm/core-loggers'
import { toOutput$ } from '@pnpm/default-reporter'
import { createStreamParser } from '@pnpm/logger'
import chalk = require('chalk')
import { stripIndents } from 'common-tags'
import normalizeNewline = require('normalize-newline')
import path = require('path')
import test = require('tape')
@@ -119,21 +118,20 @@ test('groups lifecycle output', t => {
complete: () => t.end(),
error: t.end,
next: (output: string) => {
t.equal(replaceTimeWith1Sec(output), stripIndents`
packages/foo ${PREINSTALL}$ node foo
${OUTPUT_INDENTATION} foo 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
${STATUS_INDENTATION} ${STATUS_RUNNING}
packages/foo ${POSTINSTALL}$ node foo
${OUTPUT_INDENTATION} foo I
${OUTPUT_INDENTATION} foo II
${OUTPUT_INDENTATION} foo III
${STATUS_INDENTATION} ${STATUS_RUNNING}
packages/bar ${POSTINSTALL}$ node bar
${OUTPUT_INDENTATION} bar I
${STATUS_INDENTATION} ${STATUS_RUNNING}
packages/qar ${INSTALL}$ node qar
${STATUS_INDENTATION} ${STATUS_DONE}
`)
t.equal(replaceTimeWith1Sec(output), `\
packages/foo ${PREINSTALL}$ node foo
${OUTPUT_INDENTATION} foo 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
${STATUS_INDENTATION} ${STATUS_RUNNING}
packages/foo ${POSTINSTALL}$ node foo
${OUTPUT_INDENTATION} foo I
${OUTPUT_INDENTATION} foo II
${OUTPUT_INDENTATION} foo III
${STATUS_INDENTATION} ${STATUS_RUNNING}
packages/bar ${POSTINSTALL}$ node bar
${OUTPUT_INDENTATION} bar I
${STATUS_INDENTATION} ${STATUS_RUNNING}
packages/qar ${INSTALL}$ node qar
${STATUS_INDENTATION} ${STATUS_DONE}`)
},
})
})
@@ -239,19 +237,18 @@ test('groups lifecycle output when append-only is used', t => {
output$.take(11).map(normalizeNewline).subscribe({
complete: () => {
t.equal(allOutputs.join(EOL), stripIndents`
${chalk.cyan('packages/foo')} ${PREINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${PREINSTALL}: foo 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
${chalk.cyan('packages/foo')} ${PREINSTALL}: Failed
${chalk.cyan('packages/foo')} ${POSTINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo I
${chalk.magenta('packages/bar')} ${POSTINSTALL}$ node bar
${chalk.magenta('packages/bar')} ${POSTINSTALL}: bar I
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo II
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo III
${chalk.blue('packages/qar')} ${INSTALL}$ node qar
${chalk.blue('packages/qar')} ${INSTALL}: Done
`)
t.equal(allOutputs.join(EOL), `\
${chalk.cyan('packages/foo')} ${PREINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${PREINSTALL}: foo 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
${chalk.cyan('packages/foo')} ${PREINSTALL}: Failed
${chalk.cyan('packages/foo')} ${POSTINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo I
${chalk.magenta('packages/bar')} ${POSTINSTALL}$ node bar
${chalk.magenta('packages/bar')} ${POSTINSTALL}: bar I
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo II
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo III
${chalk.blue('packages/qar')} ${INSTALL}$ node qar
${chalk.blue('packages/qar')} ${INSTALL}: Done`)
t.end()
},
error: t.end,
@@ -360,20 +357,19 @@ test('groups lifecycle output when streamLifecycleOutput is used', t => {
complete: () => t.end(),
error: t.end,
next: (output: string) => {
t.equal(output, stripIndents`
${chalk.cyan('packages/foo')} ${PREINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${PREINSTALL}: foo 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
${chalk.cyan('packages/foo')} ${PREINSTALL}: Failed
${chalk.cyan('packages/foo')} ${POSTINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo I
${chalk.magenta('packages/bar')} ${POSTINSTALL}$ node bar
${chalk.magenta('packages/bar')} ${POSTINSTALL}: bar I
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo II
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo III
${chalk.blue('packages/qar')} ${INSTALL}$ node qar
${chalk.blue('packages/qar')} ${INSTALL}: Done
${chalk.cyan('packages/foo')} ${POSTINSTALL}: Done
`)
t.equal(output, `\
${chalk.cyan('packages/foo')} ${PREINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${PREINSTALL}: foo 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
${chalk.cyan('packages/foo')} ${PREINSTALL}: Failed
${chalk.cyan('packages/foo')} ${POSTINSTALL}$ node foo
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo I
${chalk.magenta('packages/bar')} ${POSTINSTALL}$ node bar
${chalk.magenta('packages/bar')} ${POSTINSTALL}: bar I
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo II
${chalk.cyan('packages/foo')} ${POSTINSTALL}: foo III
${chalk.blue('packages/qar')} ${INSTALL}$ node qar
${chalk.blue('packages/qar')} ${INSTALL}: Done
${chalk.cyan('packages/foo')} ${POSTINSTALL}: Done`)
},
})
})
@@ -415,21 +411,20 @@ test('collapse lifecycle output when it has too many lines', t => {
complete: () => t.end(),
error: t.end,
next: (output: string) => {
t.equal(replaceTimeWith1Sec(output), stripIndents`
packages/foo ${POSTINSTALL}$ node foo
[90 lines collapsed]
${OUTPUT_INDENTATION} foo 90
${OUTPUT_INDENTATION} foo 91
${OUTPUT_INDENTATION} foo 92
${OUTPUT_INDENTATION} foo 93
${OUTPUT_INDENTATION} foo 94
${OUTPUT_INDENTATION} foo 95
${OUTPUT_INDENTATION} foo 96
${OUTPUT_INDENTATION} foo 97
${OUTPUT_INDENTATION} foo 98
${OUTPUT_INDENTATION} foo 99
${STATUS_INDENTATION} ${STATUS_DONE}
`)
t.equal(replaceTimeWith1Sec(output), `\
packages/foo ${POSTINSTALL}$ node foo
[90 lines collapsed]
${OUTPUT_INDENTATION} foo 90
${OUTPUT_INDENTATION} foo 91
${OUTPUT_INDENTATION} foo 92
${OUTPUT_INDENTATION} foo 93
${OUTPUT_INDENTATION} foo 94
${OUTPUT_INDENTATION} foo 95
${OUTPUT_INDENTATION} foo 96
${OUTPUT_INDENTATION} foo 97
${OUTPUT_INDENTATION} foo 98
${OUTPUT_INDENTATION} foo 99
${STATUS_INDENTATION} ${STATUS_DONE}`)
},
})
})
@@ -530,12 +525,11 @@ test('collapses lifecycle output of packages from node_modules', t => {
complete: () => t.end(),
error: t.end,
next: (output: string) => {
t.equal(replaceTimeWith1Sec(output), stripIndents`
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running preinstall script...
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running postinstall script, done in 1s
${chalk.gray('node_modules/.registry.npmjs.org/bar/1.0.0/node_modules/')}bar: Running postinstall script...
${chalk.gray('node_modules/.registry.npmjs.org/qar/1.0.0/node_modules/')}qar: Running install script, done in 1s
`)
t.equal(replaceTimeWith1Sec(output), `\
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running preinstall script...
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running postinstall script, done in 1s
${chalk.gray('node_modules/.registry.npmjs.org/bar/1.0.0/node_modules/')}bar: Running postinstall script...
${chalk.gray('node_modules/.registry.npmjs.org/qar/1.0.0/node_modules/')}qar: Running install script, done in 1s`)
},
})
})
@@ -577,9 +571,7 @@ test('output of failed optional dependency is not shown', t => {
complete: () => t.end(),
error: t.end,
next: (output: string) => {
t.equal(replaceTimeWith1Sec(output), stripIndents`
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running install script, failed in 1s (skipped as optional)
`)
t.equal(replaceTimeWith1Sec(output), `${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running install script, failed in 1s (skipped as optional)`)
},
})
})
@@ -621,12 +613,11 @@ test('output of failed non-optional dependency is printed', t => {
complete: () => t.end(),
error: t.end,
next: (output: string) => {
t.equal(replaceTimeWith1Sec(output), stripIndents`
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running install script, failed in 1s
.../foo/1.0.0/node_modules/foo ${INSTALL}$ node foo
${OUTPUT_INDENTATION} foo 0 1 2 3 4 5 6 7 8 9
${STATUS_INDENTATION} ${STATUS_FAILED}
`)
t.equal(replaceTimeWith1Sec(output), `\
${chalk.gray('node_modules/.registry.npmjs.org/foo/1.0.0/node_modules/')}foo: Running install script, failed in 1s
.../foo/1.0.0/node_modules/foo ${INSTALL}$ node foo
${OUTPUT_INDENTATION} foo 0 1 2 3 4 5 6 7 8 9
${STATUS_INDENTATION} ${STATUS_FAILED}`)
},
})
})
@@ -682,12 +673,11 @@ test['skip']('prints lifecycle progress', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/foo/1.0.0')}: ${childOutputColor('foo I')}
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/foo/1.0.0')}! ${childOutputError('foo II')}
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/foo/1.0.0')}: ${childOutputColor('foo III')}
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/bar/1.0.0')}: ${childOutputColor('bar I')}
`)
t.equal(output, `\
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/foo/1.0.0')}: ${childOutputColor('foo I')}
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/foo/1.0.0')}! ${childOutputError('foo II')}
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/foo/1.0.0')}: ${childOutputColor('foo III')}
Running ${POSTINSTALL} for ${hlPkgId('registry.npmjs.org/bar/1.0.0')}: ${childOutputColor('bar I')}`)
},
})
})

View File

@@ -10,7 +10,6 @@ import logger, {
createStreamParser,
} from '@pnpm/logger'
import chalk = require('chalk')
import { stripIndents } from 'common-tags'
import delay from 'delay'
import most = require('most')
import normalizeNewline = require('normalize-newline')
@@ -260,9 +259,7 @@ test('prints "Already up-to-date"', t => {
complete: () => t.end(),
error: t.end,
next: output => {
t.equal(output, stripIndents`
Already up-to-date
`)
t.equal(output, `Already up-to-date`)
},
})
})
@@ -294,52 +291,47 @@ test('prints progress of big files download', async t => {
stream$.push(
output$.take(1)
.tap(output => t.equal(output, stripIndents`
Resolving: total ${hlValue('1')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('0 B')}/${hlValue('10.5 MB')}
`))
.tap(output => t.equal(output, `\
Resolving: total ${hlValue('1')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('0 B')}/${hlValue('10.5 MB')}`))
)
output$ = output$.skip(1)
stream$.push(
output$.take(1)
.tap(output => t.equal(output, stripIndents`
Resolving: total ${hlValue('1')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('5.77 MB')}/${hlValue('10.5 MB')}
`))
.tap(output => t.equal(output, `\
Resolving: total ${hlValue('1')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('5.77 MB')}/${hlValue('10.5 MB')}`))
)
output$ = output$.skip(2)
stream$.push(
output$.take(1)
.tap(output => t.equal(output, stripIndents`
Resolving: total ${hlValue('2')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('7.34 MB')}/${hlValue('10.5 MB')}
`, 'downloading of small package not reported'))
.tap(output => t.equal(output, `\
Resolving: total ${hlValue('2')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('7.34 MB')}/${hlValue('10.5 MB')}`, 'downloading of small package not reported'))
)
output$ = output$.skip(3)
stream$.push(
output$.take(1)
.tap(output => t.equal(output, stripIndents`
Resolving: total ${hlValue('3')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('7.34 MB')}/${hlValue('10.5 MB')}
Downloading ${hlPkgId(pkgId3)}: ${hlValue('19.9 MB')}/${hlValue('21 MB')}
`))
.tap(output => t.equal(output, `\
Resolving: total ${hlValue('3')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId1)}: ${hlValue('7.34 MB')}/${hlValue('10.5 MB')}
Downloading ${hlPkgId(pkgId3)}: ${hlValue('19.9 MB')}/${hlValue('21 MB')}`))
)
output$ = output$.skip(1)
stream$.push(
output$.take(1)
.tap(output => t.equal(output, stripIndents`
Downloading ${hlPkgId(pkgId1)}: ${hlValue('10.5 MB')}/${hlValue('10.5 MB')}, done
Resolving: total ${hlValue('3')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId3)}: ${hlValue('19.9 MB')}/${hlValue('21 MB')}
`))
.tap(output => t.equal(output, `\
Downloading ${hlPkgId(pkgId1)}: ${hlValue('10.5 MB')}/${hlValue('10.5 MB')}, done
Resolving: total ${hlValue('3')}, reused ${hlValue('0')}, downloaded ${hlValue('0')}
Downloading ${hlPkgId(pkgId3)}: ${hlValue('19.9 MB')}/${hlValue('21 MB')}`))
)
most.mergeArray(stream$)

View File

@@ -51,10 +51,8 @@
"@pnpm/list": "link:",
"@pnpm/logger": "3.2.2",
"@types/archy": "0.0.31",
"@types/common-tags": "^1.8.0",
"@types/ramda": "^0.27.6",
"@types/semver": "^7.2.0",
"common-tags": "1.8.0"
"@types/semver": "^7.2.0"
},
"funding": "https://opencollective.com/pnpm"
}

View File

@@ -3,7 +3,6 @@ import list, { forPackages as listForPackages } from '@pnpm/list'
import renderTree from '@pnpm/list/lib/renderTree'
import chalk = require('chalk')
import cliColumns = require('cli-columns')
import { stripIndent } from 'common-tags'
import path = require('path')
import test = require('tape')
import './createPackagesSearcher.spec.ts'
@@ -32,71 +31,63 @@ const fixtureWithAliasedDep = path.join(__dirname, 'with-aliased-dep')
test('list all deps of a package that has an external lockfile', async (t) => {
t.equal(await list([fixtureWithExternalLockfile], {
lockfileDir: path.join(fixtureWithExternalLockfile, '..'),
}), stripIndent`
${LEGEND}
}), `${LEGEND}
pkg@1.0.0 ${fixtureWithExternalLockfile}
pkg@1.0.0 ${fixtureWithExternalLockfile}
${DEPENDENCIES}
is-positive ${VERSION_CLR('1.0.0')}
`)
${DEPENDENCIES}
is-positive ${VERSION_CLR('1.0.0')}`)
t.end()
})
test('list with default parameters', async t => {
t.equal(await list([fixture], { lockfileDir: fixture }), stripIndent`
${LEGEND}
t.equal(await list([fixture], { lockfileDir: fixture }), `${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}
`)
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}`)
t.end()
})
test('list with default parameters in pkg that has no name and version', async t => {
t.equal(await list([fixtureWithNoPkgNameAndNoVersion], { lockfileDir: fixtureWithNoPkgNameAndNoVersion }), stripIndent`
${LEGEND}
t.equal(await list([fixtureWithNoPkgNameAndNoVersion], { lockfileDir: fixtureWithNoPkgNameAndNoVersion }), `${LEGEND}
${fixtureWithNoPkgNameAndNoVersion}
${fixtureWithNoPkgNameAndNoVersion}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}
`)
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}`)
t.end()
})
test('list with default parameters in pkg that has no version', async t => {
t.equal(await list([fixtureWithNoPkgVersion], { lockfileDir: fixtureWithNoPkgVersion }), stripIndent`
${LEGEND}
t.equal(await list([fixtureWithNoPkgVersion], { lockfileDir: fixtureWithNoPkgVersion }), `${LEGEND}
fixture ${fixtureWithNoPkgVersion}
fixture ${fixtureWithNoPkgVersion}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}
`)
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}`)
t.end()
})
@@ -107,14 +98,12 @@ test('list dev only', async t => {
include: { dependencies: false, devDependencies: true, optionalDependencies: false },
lockfileDir: fixture,
}),
stripIndent`
${LEGEND}
`${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
`
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}`
)
t.end()
@@ -126,14 +115,12 @@ test('list prod only', async t => {
include: { dependencies: true, devDependencies: false, optionalDependencies: false },
lockfileDir: fixture,
}),
stripIndent`
${LEGEND}
`${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
`
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}`
)
t.end()
@@ -146,51 +133,47 @@ test('list prod only with depth 2', async t => {
include: { dependencies: true, devDependencies: false, optionalDependencies: false },
lockfileDir: fixture,
}),
stripIndent`
${LEGEND}
`${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
├── detect-indent ${VERSION_CLR('5.0.0')}
├── graceful-fs ${VERSION_CLR('4.2.2')}
├─┬ make-dir ${VERSION_CLR('1.3.0')}
│ └── pify ${VERSION_CLR('3.0.0')}
├── pify ${VERSION_CLR('3.0.0')}
├─┬ sort-keys ${VERSION_CLR('2.0.0')}
│ └── is-plain-obj ${VERSION_CLR('1.1.0')}
└─┬ write-file-atomic ${VERSION_CLR('2.4.3')}
├── graceful-fs ${VERSION_CLR('4.2.2')}
├── imurmurhash ${VERSION_CLR('0.1.4')}
└── signal-exit ${VERSION_CLR('3.0.2')}
`
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
├── detect-indent ${VERSION_CLR('5.0.0')}
├── graceful-fs ${VERSION_CLR('4.2.2')}
├─┬ make-dir ${VERSION_CLR('1.3.0')}
│ └── pify ${VERSION_CLR('3.0.0')}
├── pify ${VERSION_CLR('3.0.0')}
├─┬ sort-keys ${VERSION_CLR('2.0.0')}
│ └── is-plain-obj ${VERSION_CLR('1.1.0')}
└─┬ write-file-atomic ${VERSION_CLR('2.4.3')}
├── graceful-fs ${VERSION_CLR('4.2.2')}
├── imurmurhash ${VERSION_CLR('0.1.4')}
└── signal-exit ${VERSION_CLR('3.0.2')}`
)
t.end()
})
test('list with depth 1', async t => {
t.equal(await list([fixture], { depth: 1, lockfileDir: fixture }), stripIndent`
${LEGEND}
t.equal(await list([fixture], { depth: 1, lockfileDir: fixture }), `${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
├── detect-indent ${VERSION_CLR('5.0.0')}
├── graceful-fs ${VERSION_CLR('4.2.2')}
├── make-dir ${VERSION_CLR('1.3.0')}
├── pify ${VERSION_CLR('3.0.0')}
├── sort-keys ${VERSION_CLR('2.0.0')}
└── write-file-atomic ${VERSION_CLR('2.4.3')}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
├── detect-indent ${VERSION_CLR('5.0.0')}
├── graceful-fs ${VERSION_CLR('4.2.2')}
├── make-dir ${VERSION_CLR('1.3.0')}
├── pify ${VERSION_CLR('3.0.0')}
├── sort-keys ${VERSION_CLR('2.0.0')}
└── write-file-atomic ${VERSION_CLR('2.4.3')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}
`)
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}`)
t.end()
})
@@ -204,19 +187,17 @@ test('list with depth -1', async t => {
test('list with depth 1 and selected packages', async t => {
t.equal(
await listForPackages(['make-dir', 'pify@2', 'sort-keys@2', 'is-negative'], [fixture], { depth: 1, lockfileDir: fixture }),
stripIndent`
${LEGEND}
`${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
├── ${highlighted('make-dir ' + VERSION_CLR('1.3.0'))}
└── ${highlighted('sort-keys ' + VERSION_CLR('2.0.0'))}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
├── ${highlighted('make-dir ' + VERSION_CLR('1.3.0'))}
└── ${highlighted('sort-keys ' + VERSION_CLR('2.0.0'))}
${OPTIONAL_DEPENDENCIES}
${highlighted(OPTIONAL_DEP_CLR('is-negative') + ' ' + VERSION_CLR('2.1.0'))}
`
${OPTIONAL_DEPENDENCIES}
${highlighted(OPTIONAL_DEP_CLR('is-negative') + ' ' + VERSION_CLR('2.1.0'))}`
)
t.end()
@@ -233,41 +214,38 @@ function compareOutputs (t: test.Test, actual: string, expected: string) {
}
test('list in long format', async t => {
compareOutputs(t, await list([fixture], { long: true, lockfileDir: fixture }), stripIndent`
${LEGEND}
compareOutputs(t, await list([fixture], { long: true, lockfileDir: fixture }), `${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
Stringify and write JSON to a file atomically
git+https://github.com/sindresorhus/write-json-file.git
https://github.com/sindresorhus/write-json-file#readme
${DEPENDENCIES}
write-json-file ${VERSION_CLR('2.3.0')}
Stringify and write JSON to a file atomically
git+https://github.com/sindresorhus/write-json-file.git
https://github.com/sindresorhus/write-json-file#readme
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
[Could not find additional info about this dependency]
${DEV_DEPENDENCIES}
${DEV_DEP_ONLY_CLR('is-positive')} ${VERSION_CLR('3.1.0')}
[Could not find additional info about this dependency]
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}
[Could not find additional info about this dependency]`)
${OPTIONAL_DEPENDENCIES}
${OPTIONAL_DEP_CLR('is-negative')} ${VERSION_CLR('2.1.0')}
[Could not find additional info about this dependency]`)
t.end()
})
test('parseable list with depth 1', async t => {
t.equal(await list([fixture], { reportAs: 'parseable', depth: 1, lockfileDir: fixture }), stripIndent`
${fixture}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}
`)
t.equal(await list([fixture], { reportAs: 'parseable', depth: 1, lockfileDir: fixture }), `${fixture}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}`)
t.end()
})
@@ -395,45 +373,40 @@ test('parseable list with depth 1 and dev only', async t => {
lockfileDir: fixture,
reportAs: 'parseable',
}),
stripIndent`
${fixture}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}
`
`${fixture}
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}`
)
t.end()
})
test('long parseable list with depth 1', async t => {
t.equal(await list([fixture], { reportAs: 'parseable', depth: 1, lockfileDir: fixture, long: true }), stripIndent`
${fixture}:fixture@1.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0
`)
t.equal(await list([fixture], { reportAs: 'parseable', depth: 1, lockfileDir: fixture, long: true }), `${fixture}:fixture@1.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3
${path.join(fixture, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0`)
t.end()
})
test('long parseable list with depth 1 when package has no version', async t => {
t.equal(await list([fixtureWithNoPkgVersion], { reportAs: 'parseable', depth: 1, lockfileDir: fixtureWithNoPkgVersion, long: true }), stripIndent`
${fixtureWithNoPkgVersion}:fixture
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0
`)
t.equal(await list([fixtureWithNoPkgVersion], { reportAs: 'parseable', depth: 1, lockfileDir: fixtureWithNoPkgVersion, long: true }), `\
${fixtureWithNoPkgVersion}:fixture
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3
${path.join(fixtureWithNoPkgVersion, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0`)
t.end()
})
@@ -444,18 +417,16 @@ test('long parseable list with depth 1 when package has no name and no version',
[fixtureWithNoPkgNameAndNoVersion],
{ reportAs: 'parseable', depth: 1, lockfileDir: fixtureWithNoPkgNameAndNoVersion, long: true }
),
stripIndent`
${fixtureWithNoPkgNameAndNoVersion}
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0
`
`${fixtureWithNoPkgNameAndNoVersion}
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/detect-indent/5.0.0')}:detect-indent@5.0.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/graceful-fs/4.2.2')}:graceful-fs@4.2.2
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/is-negative/2.1.0')}:is-negative@2.1.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/is-positive/3.1.0')}:is-positive@3.1.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/make-dir/1.3.0')}:make-dir@1.3.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/pify/3.0.0')}:pify@3.0.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/sort-keys/2.0.0')}:sort-keys@2.0.0
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/write-file-atomic/2.4.3')}:write-file-atomic@2.4.3
${path.join(fixtureWithNoPkgNameAndNoVersion, 'node_modules/.pnpm/registry.npmjs.org/write-json-file/2.3.0')}:write-json-file@2.3.0`
)
t.end()
@@ -498,14 +469,12 @@ test('unsaved dependencies are marked', async (t) => {
long: false,
search: true,
}
), stripIndent`
${LEGEND}
), `${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${UNSAVED_DEPENDENCIES}
${NOT_SAVED_DEP_CLR('foo')} ${VERSION_CLR('1.0.0')}
`)
${UNSAVED_DEPENDENCIES}
${NOT_SAVED_DEP_CLR('foo')} ${VERSION_CLR('1.0.0')}`)
t.end()
})
@@ -626,12 +595,11 @@ test('write long lists in columns', async (t) => {
long: false,
search: false,
}
), stripIndent`
${LEGEND}
), `${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}` + '\n' +
${DEPENDENCIES}` + '\n' +
cliColumns([
`a ${VERSION_CLR('1.0.0')}`,
`b ${VERSION_CLR('1.0.0')}`,
@@ -696,51 +664,45 @@ test('sort list items', async (t) => {
long: false,
search: false,
}
), stripIndent`
${LEGEND}
), `${LEGEND}
fixture@1.0.0 ${fixture}
fixture@1.0.0 ${fixture}
${DEPENDENCIES}
foo ${VERSION_CLR('1.0.0')}
├── bar ${VERSION_CLR('1.0.0')}
└── qar ${VERSION_CLR('1.0.0')}
`)
${DEPENDENCIES}
foo ${VERSION_CLR('1.0.0')}
├── bar ${VERSION_CLR('1.0.0')}
└── qar ${VERSION_CLR('1.0.0')}`)
t.end()
})
test('peer dependencies are marked', async (t) => {
const fixture = path.join(__dirname, '../../dependencies-hierarchy/fixtures/with-peer')
const output = await list([fixture], { depth: 1, lockfileDir: fixture })
compareOutputs(t, output, stripIndent`
${LEGEND}
compareOutputs(t, output, `${LEGEND}
with-peer@1.0.0 ${fixture}
with-peer@1.0.0 ${fixture}
${DEPENDENCIES}
ajv ${VERSION_CLR('6.10.2')}
├── fast-deep-equal ${VERSION_CLR('2.0.1')}
├── fast-json-stable-stringify ${VERSION_CLR('2.0.0')}
├── json-schema-traverse ${VERSION_CLR('0.4.1')}
└── uri-js ${VERSION_CLR('4.2.2')}
ajv-keywords ${VERSION_CLR('3.4.1')}
└── ajv ${VERSION_CLR('6.10.2')} peer
`)
${DEPENDENCIES}
ajv ${VERSION_CLR('6.10.2')}
├── fast-deep-equal ${VERSION_CLR('2.0.1')}
├── fast-json-stable-stringify ${VERSION_CLR('2.0.0')}
├── json-schema-traverse ${VERSION_CLR('0.4.1')}
└── uri-js ${VERSION_CLR('4.2.2')}
ajv-keywords ${VERSION_CLR('3.4.1')}
└── ajv ${VERSION_CLR('6.10.2')} peer`)
t.end()
})
test('peer dependencies are marked when searching', async (t) => {
const fixture = path.join(__dirname, '../../dependencies-hierarchy/fixtures/with-peer')
const output = await listForPackages(['ajv'], [fixture], { depth: 1, lockfileDir: fixture })
compareOutputs(t, output, stripIndent`
${LEGEND}
compareOutputs(t, output, `${LEGEND}
with-peer@1.0.0 ${fixture}
with-peer@1.0.0 ${fixture}
${DEPENDENCIES}
${highlighted(`ajv ${VERSION_CLR('6.10.2')}`)}
ajv-keywords ${VERSION_CLR('3.4.1')}
└── ${highlighted(`ajv ${VERSION_CLR('6.10.2')} peer`)}
`)
${DEPENDENCIES}
${highlighted(`ajv ${VERSION_CLR('6.10.2')}`)}
ajv-keywords ${VERSION_CLR('3.4.1')}
└── ${highlighted(`ajv ${VERSION_CLR('6.10.2')} peer`)}`)
t.end()
})

View File

@@ -9,9 +9,6 @@
"../../typings/**/*.d.ts"
],
"references": [
{
"path": "../config"
},
{
"path": "../constants"
},

View File

@@ -38,7 +38,6 @@
"@pnpm/plugin-commands-installation": "link:",
"@pnpm/prepare": "workspace:0.0.6",
"@pnpm/test-fixtures": "workspace:*",
"@types/common-tags": "^1.8.0",
"@types/is-ci": "^2.0.0",
"@types/mz": "^2.7.1",
"@types/proxyquire": "^1.3.28",
@@ -77,7 +76,6 @@
"@pnpm/types": "workspace:6.1.0",
"camelcase-keys": "^6.2.2",
"chalk": "^4.1.0",
"common-tags": "^1.8.0",
"enquirer": "^2.3.5",
"is-ci": "^2.0.0",
"is-subdir": "^1.1.1",

View File

@@ -2,7 +2,6 @@ import { docsUrl } from '@pnpm/cli-utils'
import { FILTERING, OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help'
import { types as allTypes } from '@pnpm/config'
import PnpmError from '@pnpm/error'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import { InstallCommandOptions } from './install'
@@ -114,9 +113,9 @@ export function help () {
shortAlias: '-g',
},
{
description: oneLine`Run installation recursively in every package found in subdirectories
or in every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Run installation recursively in every package found in subdirectories \
or in every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -3,7 +3,6 @@ import { FILTERING, OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-
import { Config, types as allTypes } from '@pnpm/config'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import { oneLine } from 'common-tags'
import isCI = require('is-ci')
import R = require('ramda')
import renderHelp = require('render-help')
@@ -72,17 +71,16 @@ export const commandNames = ['install', 'i']
export function help () {
return renderHelp({
aliases: ['i'],
description: oneLine`Installs all dependencies of the project in the current working directory.
When executed inside a workspace, installs all dependencies of all projects.`,
description: `Installs all dependencies of the project in the current working directory. \
When executed inside a workspace, installs all dependencies of all projects.`,
descriptionLists: [
{
title: 'Options',
list: [
{
description: oneLine`
Run installation recursively in every package found in subdirectories.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Run installation recursively in every package found in subdirectories. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},
@@ -137,10 +135,9 @@ export function help () {
name: '--shamefully-hoist',
},
{
description: oneLine`
Hoist all dependencies matching the pattern to \`node_modules/.pnpm/node_modules\`.
The default pattern is * and matches everything. Hoisted packages can be required
by any dependencies, so it is an emulation of a flat node_modules`,
description: `Hoist all dependencies matching the pattern to \`node_modules/.pnpm/node_modules\`. \
The default pattern is * and matches everything. Hoisted packages can be required \
by any dependencies, so it is an emulation of a flat node_modules`,
name: '--hoist-pattern <pattern>',
},
{

View File

@@ -10,7 +10,6 @@ import { rebuild } from '@pnpm/plugin-commands-rebuild/lib/implementation'
import { requireHooks } from '@pnpm/pnpmfile'
import { createOrConnectStoreController, CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import { IncludedDependencies } from '@pnpm/types'
import { oneLine } from 'common-tags'
import R = require('ramda')
import {
install,
@@ -91,10 +90,10 @@ export default async function handler (
}
if (!opts.linkWorkspacePackages && !opts.saveWorkspaceProtocol) {
if (opts.rawLocalConfig['save-workspace-protocol'] === false) {
throw new PnpmError('BAD_OPTIONS', oneLine`This workspace has link-workspace-packages turned off,
so dependencies are linked from the workspace only when the workspace protocol is used.
Either set link-workspace-packages to true or don't use the --no-save-workspace-protocol option
when running add/update with the --workspace option`)
throw new PnpmError('BAD_OPTIONS', `This workspace has link-workspace-packages turned off, \
so dependencies are linked from the workspace only when the workspace protocol is used. \
Either set link-workspace-packages to true or don't use the --no-save-workspace-protocol option \
when running add/update with the --workspace option`)
} else {
opts.saveWorkspaceProtocol = true
}

View File

@@ -12,7 +12,6 @@ import { getAllDependenciesFromManifest } from '@pnpm/manifest-utils'
import { requireHooks } from '@pnpm/pnpmfile'
import { createOrConnectStoreController, CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import { DependenciesField } from '@pnpm/types'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import {
@@ -83,11 +82,9 @@ export function help () {
list: [
{
description: oneLine`
Remove from every package found in subdirectories
or from every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"
`,
description: `Remove from every package found in subdirectories \
or from every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -2,7 +2,6 @@ import { docsUrl, readProjectManifestOnly } from '@pnpm/cli-utils'
import { UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help'
import { Config } from '@pnpm/config'
import { createOrConnectStoreController, CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import { oneLine } from 'common-tags'
import renderHelp = require('render-help')
import { mutateModules } from 'supi'
import { cliOptionsTypes, rcOptionsTypes } from './install'
@@ -22,10 +21,9 @@ export function help () {
list: [
{
description: oneLine`
Unlink in every package found in subdirectories
or in every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Unlink in every package found in subdirectories \
or in every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -8,7 +8,6 @@ import { FILTERING, OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-
import { types as allTypes } from '@pnpm/config'
import { outdatedDepsOfProjects } from '@pnpm/outdated'
import chalk = require('chalk')
import { oneLine } from 'common-tags'
import { prompt } from 'enquirer'
import R = require('ramda')
import renderHelp = require('render-help')
@@ -87,9 +86,9 @@ export function help () {
list: [
{
description: oneLine`Update in every package found in subdirectories
or every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Update in every package found in subdirectories \
or every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},
@@ -122,10 +121,10 @@ export function help () {
name: '--no-optional',
},
{
description: oneLine`Tries to link all packages from the workspace.
Versions are updated to match the versions of packages inside the workspace.
If specific packages are updated, the command will fail if any of the updated
dependencies is not found inside the workspace`,
description: `Tries to link all packages from the workspace. \
Versions are updated to match the versions of packages inside the workspace. \
If specific packages are updated, the command will fail if any of the updated \
dependencies is not found inside the workspace`,
name: '--workspace',
},
{

View File

@@ -1,7 +1,6 @@
import PnpmError from '@pnpm/error'
import { remove } from '@pnpm/plugin-commands-installation'
import prepare, { preparePackages } from '@pnpm/prepare'
import { oneLine } from 'common-tags'
import test = require('tape')
import { DEFAULT_OPTS } from '../utils'
@@ -111,8 +110,8 @@ test('remove should fail if the project does not have one of the removed depende
err = _err
}
t.equal(err.code, 'ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS')
t.equal(err.message, oneLine`Cannot remove 'dev-dep-1', 'optional-dep-1':
no such dependencies found in 'dependencies'`)
t.equal(err.message, `Cannot remove 'dev-dep-1', 'optional-dep-1': \
no such dependencies found in 'dependencies'`)
t.equal(err.hint, 'Available dependencies: prod-dep-1, prod-dep-2')
}
{
@@ -127,8 +126,8 @@ test('remove should fail if the project does not have one of the removed depende
err = _err
}
t.equal(err.code, 'ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS')
t.equal(err.message, oneLine`Cannot remove 'prod-dep-1', 'optional-dep-1':
no such dependencies found in 'devDependencies'`)
t.equal(err.message, `Cannot remove 'prod-dep-1', 'optional-dep-1': \
no such dependencies found in 'devDependencies'`)
t.equal(err.hint, 'Available dependencies: dev-dep-1, dev-dep-2')
}
{
@@ -143,8 +142,8 @@ test('remove should fail if the project does not have one of the removed depende
err = _err
}
t.equal(err.code, 'ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS')
t.equal(err.message, oneLine`Cannot remove 'prod-dep-1', 'dev-dep-1':
no such dependencies found in 'optionalDependencies'`)
t.equal(err.message, `Cannot remove 'prod-dep-1', 'dev-dep-1': \
no such dependencies found in 'optionalDependencies'`)
t.equal(err.hint, 'Available dependencies: optional-dep-1, optional-dep-2')
}
{
@@ -159,8 +158,8 @@ test('remove should fail if the project does not have one of the removed depende
}
t.equal(err.code, 'ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS')
t.equal(err.message, "Cannot remove 'express': no such dependency found")
t.equal(err.hint, oneLine`Available dependencies: dev-dep-1, dev-dep-2,
prod-dep-1, prod-dep-2, optional-dep-1, optional-dep-2`)
t.equal(err.hint, `Available dependencies: dev-dep-1, dev-dep-2, \
prod-dep-1, prod-dep-2, optional-dep-1, optional-dep-2`)
}
t.end()
})

View File

@@ -38,7 +38,6 @@
"@pnpm/plugin-commands-installation": "workspace:*",
"@pnpm/plugin-commands-listing": "link:",
"@pnpm/prepare": "workspace:0.0.6",
"@types/common-tags": "^1.8.0",
"@types/mz": "^2.7.1",
"@types/ramda": "^0.27.6",
"execa": "^4.0.2",
@@ -53,7 +52,6 @@
"@pnpm/error": "workspace:1.2.0",
"@pnpm/list": "workspace:4.0.30",
"@pnpm/types": "workspace:6.1.0",
"common-tags": "1.8.0",
"ramda": "0.27.0",
"render-help": "1.0.0"
},

View File

@@ -3,7 +3,6 @@ import { FILTERING, OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-
import { Config, types as allTypes } from '@pnpm/config'
import list, { forPackages as listForPackages } from '@pnpm/list'
import { IncludedDependencies } from '@pnpm/types'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import listRecursive from './recursive'
@@ -38,18 +37,18 @@ export const commandNames = ['list', 'ls']
export function help () {
return renderHelp({
aliases: ['list', 'ls', 'la', 'll'],
description: oneLine`When run as ll or la, it shows extended information by default.
All dependencies are printed by default. Search by patterns is supported.
For example: pnpm ls babel-* eslint-*`,
description: `When run as ll or la, it shows extended information by default. \
All dependencies are printed by default. Search by patterns is supported. \
For example: pnpm ls babel-* eslint-*`,
descriptionLists: [
{
title: 'Options',
list: [
{
description: oneLine`Perform command on every package in subdirectories
or on every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Perform command on every package in subdirectories \
or on every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -2,7 +2,6 @@ import { docsUrl } from '@pnpm/cli-utils'
import { FILTERING, OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help'
import { types as allTypes } from '@pnpm/config'
import PnpmError from '@pnpm/error'
import { oneLine, stripIndent } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import { handler as list, ListCommandOptions } from './list'
@@ -30,18 +29,17 @@ export const commandNames = ['why']
export function help () {
return renderHelp({
description: stripIndent`
Shows the packages that depend on <pkg>
For example: pnpm why babel-* eslint-*`,
description: `Shows the packages that depend on <pkg>
For example: pnpm why babel-* eslint-*`,
descriptionLists: [
{
title: 'Options',
list: [
{
description: oneLine`Perform command on every package in subdirectories
or on every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Perform command on every package in subdirectories \
or on every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -2,7 +2,6 @@
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { list, why } from '@pnpm/plugin-commands-listing'
import prepare, { preparePackages } from '@pnpm/prepare'
import { stripIndent } from 'common-tags'
import execa = require('execa')
import fs = require('mz/fs')
import path = require('path')
@@ -34,14 +33,12 @@ test('listing packages', async (t) => {
optional: false,
}, [])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
dependencies:
is-positive 1.0.0
`, 'prints prod deps only')
dependencies:
is-positive 1.0.0`, 'prints prod deps only')
}
{
@@ -51,14 +48,12 @@ test('listing packages', async (t) => {
production: false,
}, [])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
devDependencies:
is-negative 1.0.0
`, 'prints dev deps only')
devDependencies:
is-negative 1.0.0`, 'prints dev deps only')
}
{
@@ -66,17 +61,15 @@ test('listing packages', async (t) => {
dir: process.cwd(),
}, [])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
dependencies:
is-positive 1.0.0
dependencies:
is-positive 1.0.0
devDependencies:
is-negative 1.0.0
`, 'prints all deps')
devDependencies:
is-negative 1.0.0`, 'prints all deps')
}
t.end()
})
@@ -105,14 +98,12 @@ test(`listing packages of a project that has an external ${WANTED_LOCKFILE}`, as
lockfileDir: path.resolve('..'),
}, [])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
pkg@1.0.0 ${process.cwd()}
pkg@1.0.0 ${process.cwd()}
dependencies:
is-positive 1.0.0
`, 'prints all deps')
dependencies:
is-positive 1.0.0`, 'prints all deps')
t.end()
})
@@ -129,16 +120,14 @@ test.skip('list on a project with skipped optional dependencies', async (t) => {
dir: process.cwd(),
}, [])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
dependencies:
is-positive 1.0.0
pkg-with-optional 1.0.0
└── not-compatible-with-any-os 1.0.0 skipped
`)
dependencies:
is-positive 1.0.0
pkg-with-optional 1.0.0
└── not-compatible-with-any-os 1.0.0 skipped`)
}
{
@@ -147,15 +136,13 @@ test.skip('list on a project with skipped optional dependencies', async (t) => {
dir: process.cwd(),
}, ['not-compatible-with-any-os'])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
dependencies:
pkg-with-optional 1.0.0
└── not-compatible-with-any-os 1.0.0 skipped
`)
dependencies:
pkg-with-optional 1.0.0
└── not-compatible-with-any-os 1.0.0 skipped`)
}
{
@@ -163,15 +150,13 @@ test.skip('list on a project with skipped optional dependencies', async (t) => {
dir: process.cwd(),
}, ['not-compatible-with-any-os'])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
dependencies:
pkg-with-optional 1.0.0
└── not-compatible-with-any-os 1.0.0 skipped
`)
dependencies:
pkg-with-optional 1.0.0
└── not-compatible-with-any-os 1.0.0 skipped`)
}
t.end()
})

View File

@@ -4,7 +4,6 @@ import { install } from '@pnpm/plugin-commands-installation'
import { list, why } from '@pnpm/plugin-commands-listing'
import prepare, { preparePackages } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
import { stripIndent } from 'common-tags'
import fs = require('mz/fs')
import path = require('path')
import stripAnsi = require('strip-ansi')
@@ -54,21 +53,19 @@ test('recursive list', async (t) => {
selectedProjectsGraph,
}, [])
t.equal(stripAnsi(output as unknown as string), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output as unknown as string), `Legend: production dependency, optional only, dev only
project-1@1.0.0 ${path.resolve('project-1')}
project-1@1.0.0 ${path.resolve('project-1')}
dependencies:
is-positive 1.0.0
dependencies:
is-positive 1.0.0
Legend: production dependency, optional only, dev only
Legend: production dependency, optional only, dev only
project-2@1.0.0 ${path.resolve('project-2')}
project-2@1.0.0 ${path.resolve('project-2')}
dependencies:
is-negative 1.0.0
`)
dependencies:
is-negative 1.0.0`)
t.end()
})
@@ -120,22 +117,20 @@ test('recursive list with shared-workspace-lockfile', async (t) => {
selectedProjectsGraph,
}, [])
t.equal(stripAnsi(output as unknown as string), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output as unknown as string), `Legend: production dependency, optional only, dev only
project-1@1.0.0 ${path.resolve('project-1')}
project-1@1.0.0 ${path.resolve('project-1')}
dependencies:
pkg-with-1-dep 100.0.0
└── dep-of-pkg-with-1-dep 100.1.0
dependencies:
pkg-with-1-dep 100.0.0
└── dep-of-pkg-with-1-dep 100.1.0
Legend: production dependency, optional only, dev only
Legend: production dependency, optional only, dev only
project-2@1.0.0 ${path.resolve('project-2')}
project-2@1.0.0 ${path.resolve('project-2')}
dependencies:
is-negative 1.0.0
`)
dependencies:
is-negative 1.0.0`)
t.end()
})
@@ -224,35 +219,30 @@ test('recursive list --filter', async (t) => {
], { linkWorkspacePackages: false }),
}, [])
t.equal(stripAnsi(output as unknown as string), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output as unknown as string), `Legend: production dependency, optional only, dev only
project-1@1.0.0 ${path.resolve('project-1')}
project-1@1.0.0 ${path.resolve('project-1')}
dependencies:
is-positive 1.0.0
project-2 link:../project-2
`)
dependencies:
is-positive 1.0.0
project-2 link:../project-2`)
t.end()
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output as unknown as string), `Legend: production dependency, optional only, dev only
project-1@1.0.0 ${path.resolve('project-1')}
project-1@1.0.0 ${path.resolve('project-1')}
dependencies:
is-positive 1.0.0
project-2 link:../project-2
dependencies:
is-positive 1.0.0
project-2 link:../project-2
Legend: production dependency, optional only, dev only
Legend: production dependency, optional only, dev only
project-2@1.0.0 ${path.resolve('project-2')}
project-2@1.0.0 ${path.resolve('project-2')}
dependencies:
is-negative 1.0.0
`)
dependencies:
is-negative 1.0.0`)
t.end()
})

View File

@@ -2,7 +2,6 @@ import PnpmError from '@pnpm/error'
import { why } from '@pnpm/plugin-commands-listing'
import prepare from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { stripIndent } from 'common-tags'
import execa = require('execa')
import stripAnsi = require('strip-ansi')
import test = require('tape')
@@ -40,16 +39,14 @@ test('"why" should find non-direct dependency', async (t) => {
optional: false,
}, ['dep-of-pkg-with-1-dep'])
t.equal(stripAnsi(output), stripIndent`
Legend: production dependency, optional only, dev only
t.equal(stripAnsi(output), `Legend: production dependency, optional only, dev only
project@0.0.0 ${process.cwd()}
project@0.0.0 ${process.cwd()}
dependencies:
dep-of-pkg-with-1-dep 100.0.0
pkg-with-1-dep 100.0.0
└── dep-of-pkg-with-1-dep 100.0.0
`, 'prints prod deps only')
dependencies:
dep-of-pkg-with-1-dep 100.0.0
pkg-with-1-dep 100.0.0
└── dep-of-pkg-with-1-dep 100.0.0`, 'prints prod deps only')
t.end()
})

View File

@@ -39,7 +39,6 @@
"@pnpm/plugin-commands-outdated": "link:",
"@pnpm/prepare": "workspace:0.0.6",
"@pnpm/types": "workspace:6.1.0",
"@types/common-tags": "^1.8.0",
"@types/lru-cache": "^5.1.0",
"@types/mz": "^2.7.1",
"@types/ramda": "^0.27.6",
@@ -63,7 +62,6 @@
"@pnpm/semver-diff": "1.0.2",
"@pnpm/store-path": "^4.0.0",
"chalk": "^4.1.0",
"common-tags": "1.8.0",
"lru-cache": "5.1.1",
"ramda": "0.27.0",
"render-help": "1.0.0",

View File

@@ -14,7 +14,6 @@ import {
} from '@pnpm/outdated'
import semverDiff from '@pnpm/semver-diff'
import chalk = require('chalk')
import { oneLine, stripIndent } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import stripAnsi = require('strip-ansi')
@@ -56,13 +55,12 @@ export const commandNames = ['outdated']
export function help () {
return renderHelp({
description: stripIndent`
Check for outdated packages. The check can be limited to a subset of the installed packages by providing arguments (patterns are supported).
description: `Check for outdated packages. The check can be limited to a subset of the installed packages by providing arguments (patterns are supported).
Examples:
pnpm outdated
pnpm outdated --long
pnpm outdated gulp-* @babel/core`,
Examples:
pnpm outdated
pnpm outdated --long
pnpm outdated gulp-* @babel/core`,
descriptionLists: [
{
title: 'Options',
@@ -73,16 +71,14 @@ export function help () {
name: '--compatible',
},
{
description: oneLine`
By default, details about the outdated packages (such as a link to the repo) are not displayed.
To display the details, pass this option.`,
description: `By default, details about the outdated packages (such as a link to the repo) are not displayed. \
To display the details, pass this option.`,
name: '--long',
},
{
description: oneLine`
Check for outdated dependencies in every package found in subdirectories
or in every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Check for outdated dependencies in every package found in subdirectories \
or in every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},
@@ -217,9 +213,8 @@ function renderOutdatedTable (outdatedPackages: ReadonlyArray<OutdatedPackage>,
function renderOutdatedList (outdatedPackages: ReadonlyArray<OutdatedPackage>, opts: { long?: boolean }) {
return sortOutdatedPackages(outdatedPackages)
.map((outdatedPkg) => {
let info = stripIndent`
${chalk.bold(renderPackageName(outdatedPkg))}
${renderCurrent(outdatedPkg)} ${chalk.grey('=>')} ${renderLatest(outdatedPkg)}`
let info = `${chalk.bold(renderPackageName(outdatedPkg))}
${renderCurrent(outdatedPkg)} ${chalk.grey('=>')} ${renderLatest(outdatedPkg)}`
if (opts.long) {
const details = renderDetails(outdatedPkg)

View File

@@ -10,7 +10,6 @@ import {
ProjectManifest,
} from '@pnpm/types'
import chalk = require('chalk')
import { stripIndent } from 'common-tags'
import R = require('ramda')
import { table } from 'table'
import {
@@ -116,9 +115,8 @@ function renderOutdatedTable (outdatedMap: Record<string, OutdatedInWorkspace>,
function renderOutdatedList (outdatedMap: Record<string, OutdatedInWorkspace>, opts: { long?: boolean }) {
return sortOutdatedPackages(Object.values(outdatedMap))
.map((outdatedPkg) => {
let info = stripIndent`
${chalk.bold(renderPackageName(outdatedPkg))}
${renderCurrent(outdatedPkg)} ${chalk.grey('=>')} ${renderLatest(outdatedPkg)}`
let info = `${chalk.bold(renderPackageName(outdatedPkg))}
${renderCurrent(outdatedPkg)} ${chalk.grey('=>')} ${renderLatest(outdatedPkg)}`
const dependents = dependentPackages(outdatedPkg)

View File

@@ -4,7 +4,6 @@ import PnpmError from '@pnpm/error'
import { outdated } from '@pnpm/plugin-commands-outdated'
import prepare, { tempDir } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { stripIndent } from 'common-tags'
import fs = require('mz/fs')
import path = require('path')
import stripAnsi = require('strip-ansi')
@@ -49,20 +48,20 @@ test('pnpm outdated: show details', async (t) => {
long: true,
})
t.equal(stripAnsi(output), stripIndent`
┌───────────────────┬─────────┬────────────┬─────────────────────────────────────────────┐
│ Package │ Current │ Latest │ Details │
├───────────────────┼─────────┼────────────┼─────────────────────────────────────────────┤
│ deprecated │ 1.0.0 │ Deprecated │ This package is deprecated. Lorem ipsum │
│ │ │ │ dolor sit amet, consectetur adipiscing │
│ │ │ │ elit. │
│ │ │ │ https://foo.bar/qar │
├───────────────────┼─────────┼────────────┼─────────────────────────────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ https://github.com/kevva/is-negative#readme │
├───────────────────┼─────────┼────────────┼─────────────────────────────────────────────┤
│ is-positive (dev) │ 1.0.0 │ 3.1.0 │ https://github.com/kevva/is-positive#readme │
└───────────────────┴─────────┴────────────┴─────────────────────────────────────────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌───────────────────┬─────────┬────────────┬─────────────────────────────────────────────┐
│ Package │ Current │ Latest │ Details │
├───────────────────┼─────────┼────────────┼─────────────────────────────────────────────┤
│ deprecated │ 1.0.0 │ Deprecated │ This package is deprecated. Lorem ipsum │
│ │ │ │ dolor sit amet, consectetur adipiscing │
│ │ │ │ elit. │
│ │ │ │ https://foo.bar/qar │
├───────────────────┼─────────┼────────────┼─────────────────────────────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ https://github.com/kevva/is-negative#readme │
├───────────────────┼─────────┼────────────┼─────────────────────────────────────────────┤
│ is-positive (dev) │ 1.0.0 │ 3.1.0 │ https://github.com/kevva/is-positive#readme │
└───────────────────┴─────────┴────────────┴─────────────────────────────────────────────┘
`)
t.end()
})
@@ -80,13 +79,13 @@ test('pnpm outdated: showing only prod or dev dependencies', async (t) => {
production: false,
})
t.equal(stripAnsi(output), stripIndent`
┌───────────────────┬─────────┬────────┐
│ Package │ Current │ Latest │
├───────────────────┼─────────┼────────┤
│ is-positive (dev) │ 1.0.0 │ 3.1.0 │
└───────────────────┴─────────┴────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌───────────────────┬─────────┬────────┐
│ Package │ Current │ Latest │
├───────────────────┼─────────┼────────┤
│ is-positive (dev) │ 1.0.0 │ 3.1.0 │
└───────────────────┴─────────┴────────┘
`)
}
{
@@ -96,15 +95,15 @@ test('pnpm outdated: showing only prod or dev dependencies', async (t) => {
dir: process.cwd(),
})
t.equal(stripAnsi(output), stripIndent`
┌─────────────┬─────────┬────────────┐
│ Package │ Current │ Latest │
├─────────────┼─────────┼────────────┤
│ deprecated │ 1.0.0 │ Deprecated │
├─────────────┼─────────┼────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │
└─────────────┴─────────┴────────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌─────────────┬─────────┬────────────┐
│ Package │ Current │ Latest │
├─────────────┼─────────┼────────────┤
│ deprecated │ 1.0.0 │ Deprecated │
├─────────────┼─────────┼────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │
└─────────────┴─────────┴────────────┘
`)
}
t.end()
@@ -124,16 +123,15 @@ test('pnpm outdated: no table', async (t) => {
table: false,
})
t.equal(stripAnsi(output), stripIndent`
deprecated
1.0.0 => Deprecated
t.equal(stripAnsi(output), `deprecated
1.0.0 => Deprecated
is-negative
1.0.0 => 2.1.0
is-negative
1.0.0 => 2.1.0
is-positive (dev)
1.0.0 => 3.1.0
` + '\n')
is-positive (dev)
1.0.0 => 3.1.0
`)
}
{
@@ -144,22 +142,21 @@ test('pnpm outdated: no table', async (t) => {
table: false,
})
t.equal(stripAnsi(output), stripIndent`
deprecated
1.0.0 => Deprecated
This package is deprecated. Lorem ipsum
dolor sit amet, consectetur adipiscing
elit.
https://foo.bar/qar
t.equal(stripAnsi(output), `deprecated
1.0.0 => Deprecated
This package is deprecated. Lorem ipsum
dolor sit amet, consectetur adipiscing
elit.
https://foo.bar/qar
is-negative
1.0.0 => 2.1.0
https://github.com/kevva/is-negative#readme
is-negative
1.0.0 => 2.1.0
https://github.com/kevva/is-negative#readme
is-positive (dev)
1.0.0 => 3.1.0
https://github.com/kevva/is-positive#readme
` + '\n')
is-positive (dev)
1.0.0 => 3.1.0
https://github.com/kevva/is-positive#readme
`)
}
t.end()
})
@@ -176,17 +173,17 @@ test('pnpm outdated: only current lockfile is available', async (t) => {
dir: process.cwd(),
})
t.equal(stripAnsi(output), stripIndent`
┌───────────────────┬─────────┬────────────┐
│ Package │ Current │ Latest │
├───────────────────┼─────────┼────────────┤
│ deprecated │ 1.0.0 │ Deprecated │
├───────────────────┼─────────┼────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │
├───────────────────┼─────────┼────────────┤
│ is-positive (dev) │ 1.0.0 │ 3.1.0 │
└───────────────────┴─────────┴────────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌───────────────────┬─────────┬────────────┐
│ Package │ Current │ Latest │
├───────────────────┼─────────┼────────────┤
│ deprecated │ 1.0.0 │ Deprecated │
├───────────────────┼─────────┼────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │
├───────────────────┼─────────┼────────────┤
│ is-positive (dev) │ 1.0.0 │ 3.1.0 │
└───────────────────┴─────────┴────────────┘
`)
t.end()
})
@@ -201,17 +198,17 @@ test('pnpm outdated: only wanted lockfile is available', async (t) => {
dir: process.cwd(),
})
t.equal(stripAnsi(output), stripIndent`
┌───────────────────┬────────────────────────┬────────────┐
│ Package │ Current │ Latest │
├───────────────────┼────────────────────────┼────────────┤
│ deprecated │ missing (wanted 1.0.0) │ Deprecated │
├───────────────────┼────────────────────────┼────────────┤
│ is-positive (dev) │ missing (wanted 3.1.0) │ 3.1.0 │
├───────────────────┼────────────────────────┼────────────┤
│ is-negative │ missing (wanted 1.1.0) │ 2.1.0 │
└───────────────────┴────────────────────────┴────────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌───────────────────┬────────────────────────┬────────────┐
│ Package │ Current │ Latest │
├───────────────────┼────────────────────────┼────────────┤
│ deprecated │ missing (wanted 1.0.0) │ Deprecated │
├───────────────────┼────────────────────────┼────────────┤
│ is-positive (dev) │ missing (wanted 3.1.0) │ 3.1.0 │
├───────────────────┼────────────────────────┼────────────┤
│ is-negative │ missing (wanted 1.1.0) │ 2.1.0 │
└───────────────────┴────────────────────────┴────────────┘
`)
t.end()
})
@@ -236,15 +233,15 @@ test('pnpm outdated with external lockfile', async (t) => {
lockfileDir: path.resolve('..'),
})
t.equal(stripAnsi(output), stripIndent`
┌─────────────┬──────────────────────┬────────┐
│ Package │ Current │ Latest │
├─────────────┼──────────────────────┼────────┤
│ is-positive │ 1.0.0 (wanted 3.1.0) │ 3.1.0 │
├─────────────┼──────────────────────┼────────┤
│ is-negative │ 1.0.0 (wanted 1.1.0) │ 2.1.0 │
└─────────────┴──────────────────────┴────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌─────────────┬──────────────────────┬────────┐
│ Package │ Current │ Latest │
├─────────────┼──────────────────────┼────────┤
│ is-positive │ 1.0.0 (wanted 3.1.0) │ 3.1.0 │
├─────────────┼──────────────────────┼────────┤
│ is-negative │ 1.0.0 (wanted 1.1.0) │ 2.1.0 │
└─────────────┴──────────────────────┴────────┘
`)
t.end()
})
@@ -283,12 +280,12 @@ test('pnpm outdated: print only compatible versions', async (t) => {
dir: hasMajorOutdatedDepsFixture,
})
t.equal(stripAnsi(output), stripIndent`
┌─────────────┬─────────┬────────┐
│ Package │ Current │ Latest │
├─────────────┼─────────┼────────┤
│ is-negative │ 1.0.0 │ 1.0.1 │
└─────────────┴─────────┴────────┘
` + '\n')
t.equal(stripAnsi(output), `\
┌─────────────┬─────────┬────────┐
│ Package │ Current │ Latest │
├─────────────┼─────────┼────────┤
│ is-negative │ 1.0.0 │ 1.0.1 │
└─────────────┴─────────┴────────┘
`)
t.end()
})

View File

@@ -2,7 +2,6 @@ import { readProjects } from '@pnpm/filter-workspace-packages'
import { install } from '@pnpm/plugin-commands-installation'
import { outdated } from '@pnpm/plugin-commands-outdated'
import { preparePackages } from '@pnpm/prepare'
import { stripIndent } from 'common-tags'
import stripAnsi = require('strip-ansi')
import test = require('tape')
import { DEFAULT_OPTS } from './utils'
@@ -58,19 +57,19 @@ test('pnpm recursive outdated', async (t) => {
selectedProjectsGraph,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌───────────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ project-2 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 2.0.0 │ 3.1.0 │ project-2 │
└───────────────────┴─────────┴────────┴──────────────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌───────────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ project-2 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 2.0.0 │ 3.1.0 │ project-2 │
└───────────────────┴─────────┴────────┴──────────────────────┘
`)
}
{
@@ -83,13 +82,13 @@ test('pnpm recursive outdated', async (t) => {
selectedProjectsGraph,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌───────────────────┬─────────┬────────┬────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
└───────────────────┴─────────┴────────┴────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌───────────────────┬─────────┬────────┬────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
└───────────────────┴─────────┴────────┴────────────┘
`)
}
{
@@ -102,19 +101,19 @@ test('pnpm recursive outdated', async (t) => {
selectedProjectsGraph,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌───────────────────┬─────────┬────────┬──────────────────────┬─────────────────────────────────────────────┐
│ Package │ Current │ Latest │ Dependents │ Details │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ project-2 │ https://github.com/kevva/is-negative#readme │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │ https://github.com/kevva/is-negative#readme │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │ https://github.com/kevva/is-positive#readme │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-positive │ 2.0.0 │ 3.1.0 │ project-2 │ https://github.com/kevva/is-positive#readme │
└───────────────────┴─────────┴────────┴──────────────────────┴─────────────────────────────────────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌───────────────────┬─────────┬────────┬──────────────────────┬─────────────────────────────────────────────┐
│ Package │ Current │ Latest │ Dependents │ Details │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ project-2 │ https://github.com/kevva/is-negative#readme │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │ https://github.com/kevva/is-negative#readme │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │ https://github.com/kevva/is-positive#readme │
├───────────────────┼─────────┼────────┼──────────────────────┼─────────────────────────────────────────────┤
│ is-positive │ 2.0.0 │ 3.1.0 │ project-2 │ https://github.com/kevva/is-positive#readme │
└───────────────────┴─────────┴────────┴──────────────────────┴─────────────────────────────────────────────┘
`)
}
{
@@ -127,23 +126,23 @@ test('pnpm recursive outdated', async (t) => {
table: false,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
is-negative
1.0.0 => 2.1.0
Dependent: project-2
t.equal(stripAnsi(output as unknown as string), `\
is-negative
1.0.0 => 2.1.0
Dependent: project-2
is-negative (dev)
1.0.0 => 2.1.0
Dependent: project-3
is-negative (dev)
1.0.0 => 2.1.0
Dependent: project-3
is-positive
1.0.0 => 3.1.0
Dependents: project-1, project-3
is-positive
1.0.0 => 3.1.0
Dependents: project-1, project-3
is-positive
2.0.0 => 3.1.0
Dependent: project-2
` + '\n')
is-positive
2.0.0 => 3.1.0
Dependent: project-2
`)
}
{
@@ -157,27 +156,27 @@ test('pnpm recursive outdated', async (t) => {
table: false,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
is-negative
1.0.0 => 2.1.0
Dependent: project-2
https://github.com/kevva/is-negative#readme
t.equal(stripAnsi(output as unknown as string), `\
is-negative
1.0.0 => 2.1.0
Dependent: project-2
https://github.com/kevva/is-negative#readme
is-negative (dev)
1.0.0 => 2.1.0
Dependent: project-3
https://github.com/kevva/is-negative#readme
is-negative (dev)
1.0.0 => 2.1.0
Dependent: project-3
https://github.com/kevva/is-negative#readme
is-positive
1.0.0 => 3.1.0
Dependents: project-1, project-3
https://github.com/kevva/is-positive#readme
is-positive
1.0.0 => 3.1.0
Dependents: project-1, project-3
https://github.com/kevva/is-positive#readme
is-positive
2.0.0 => 3.1.0
Dependent: project-2
https://github.com/kevva/is-positive#readme
` + '\n')
is-positive
2.0.0 => 3.1.0
Dependent: project-2
https://github.com/kevva/is-positive#readme
`)
}
{
@@ -189,15 +188,15 @@ test('pnpm recursive outdated', async (t) => {
selectedProjectsGraph,
}, ['is-positive'])
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌─────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├─────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
├─────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 2.0.0 │ 3.1.0 │ project-2 │
└─────────────┴─────────┴────────┴──────────────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌─────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├─────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
├─────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 2.0.0 │ 3.1.0 │ project-2 │
└─────────────┴─────────┴────────┴──────────────────────┘
`)
}
t.end()
})
@@ -252,17 +251,17 @@ test('pnpm recursive outdated in workspace with shared lockfile', async (t) => {
selectedProjectsGraph,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌───────────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ project-2 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
└───────────────────┴─────────┴────────┴──────────────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌───────────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative │ 1.0.0 │ 2.1.0 │ project-2 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
├───────────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
└───────────────────┴─────────┴────────┴──────────────────────┘
`)
}
{
@@ -275,13 +274,13 @@ test('pnpm recursive outdated in workspace with shared lockfile', async (t) => {
selectedProjectsGraph,
})
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌───────────────────┬─────────┬────────┬────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
└───────────────────┴─────────┴────────┴────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌───────────────────┬─────────┬────────┬────────────┐
│ Package │ Current │ Latest │ Dependents │
├───────────────────┼─────────┼────────┼────────────┤
│ is-negative (dev) │ 1.0.0 │ 2.1.0 │ project-3 │
└───────────────────┴─────────┴────────┴────────────┘
`)
}
{
@@ -293,13 +292,13 @@ test('pnpm recursive outdated in workspace with shared lockfile', async (t) => {
selectedProjectsGraph,
}, ['is-positive'])
t.equal(stripAnsi(output as unknown as string), stripIndent`
┌─────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├─────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
└─────────────┴─────────┴────────┴──────────────────────┘
` + '\n')
t.equal(stripAnsi(output as unknown as string), `\
┌─────────────┬─────────┬────────┬──────────────────────┐
│ Package │ Current │ Latest │ Dependents │
├─────────────┼─────────┼────────┼──────────────────────┤
│ is-positive │ 1.0.0 │ 3.1.0 │ project-1, project-3 │
└─────────────┴─────────┴────────┴──────────────────────┘
`)
}
t.end()
})

View File

@@ -38,7 +38,6 @@
"@pnpm/plugin-commands-rebuild": "link:",
"@pnpm/prepare": "workspace:0.0.6",
"@pnpm/test-fixtures": "workspace:*",
"@types/common-tags": "^1.8.0",
"@types/ramda": "^0.27.6",
"@types/semver": "^7.2.0",
"@types/sinon": "^9.0.4",
@@ -68,7 +67,6 @@
"@pnpm/types": "workspace:6.1.0",
"@zkochan/npm-package-arg": "1.0.2",
"camelcase-keys": "6.2.2",
"common-tags": "1.8.0",
"dependency-path": "workspace:5.0.1",
"graph-sequencer": "2.0.0",
"load-json-file": "6.2.0",

View File

@@ -6,7 +6,6 @@ import {
createOrConnectStoreController,
CreateStoreControllerOptions,
} from '@pnpm/store-connection-manager'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import {
@@ -45,9 +44,9 @@ export function help () {
list: [
{
description: oneLine`Rebuild every package found in subdirectories
or every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Rebuild every package found in subdirectories \
or every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -37,7 +37,6 @@
"@pnpm/logger": "^3.2.2",
"@pnpm/plugin-commands-script-runners": "link:",
"@pnpm/prepare": "workspace:0.0.6",
"@types/common-tags": "^1.8.0",
"@types/mz": "^2.7.1",
"@types/ramda": "^0.27.6",
"@zkochan/rimraf": "1.0.0",
@@ -54,7 +53,6 @@
"@pnpm/lifecycle": "workspace:9.1.2",
"@pnpm/sort-packages": "workspace:1.0.12",
"@pnpm/types": "workspace:6.1.0",
"common-tags": "1.8.0",
"p-limit": "^3.0.1",
"ramda": "0.27.0",
"realpath-missing": "1.0.0",

View File

@@ -5,7 +5,6 @@ import { Config, types as allTypes } from '@pnpm/config'
import PnpmError from '@pnpm/error'
import runLifecycleHooks from '@pnpm/lifecycle'
import { ProjectManifest } from '@pnpm/types'
import { oneLine } from 'common-tags'
import path = require('path')
import R = require('ramda')
import realpathMissing = require('realpath-missing')
@@ -22,10 +21,10 @@ export const IF_PRESENT_OPTION_HELP = {
}
export const PARALLEL_OPTION_HELP = {
description: oneLine`Completely disregard concurrency and topological sorting,
running a given script immediately in all matching packages
with prefixed streaming output. This is the preferred flag
for long-running processes such as watch run over many packages.`,
description: `Completely disregard concurrency and topological sorting, \
running a given script immediately in all matching packages \
with prefixed streaming output. This is the preferred flag \
for long-running processes such as watch run over many packages.`,
name: '--parallel',
}
@@ -79,9 +78,9 @@ export function help () {
list: [
{
description: oneLine`Run the defined package script in every package found in subdirectories
or every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `Run the defined package script in every package found in subdirectories \
or every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -1,6 +1,5 @@
import { docsUrl } from '@pnpm/cli-utils'
import { types as allTypes } from '@pnpm/config'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import {
@@ -26,9 +25,9 @@ export const commandNames = ['start']
export function help () {
return renderHelp({
description: oneLine`
Runs an arbitrary command specified in the package's "start" property of its "scripts" object.
If no "start" property is specified on the "scripts" object, it will run node server.js.`,
description: `\
Runs an arbitrary command specified in the package's "start" property of its "scripts" object. \
If no "start" property is specified on the "scripts" object, it will run node server.js.`,
descriptionLists: [
{
title: 'Options',

View File

@@ -1,7 +1,6 @@
import { docsUrl } from '@pnpm/cli-utils'
import { FILTERING } from '@pnpm/common-cli-options-help'
import { types as allTypes } from '@pnpm/config'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import { handler as run, RunOpts } from './run'
@@ -37,10 +36,10 @@ export function help () {
list: [
{
description: oneLine`
Run the tests in every package found in subdirectories
or every workspace package, when executed inside a workspace.
For options that may be used with \`-r\`, see "pnpm help recursive"`,
description: `\
Run the tests in every package found in subdirectories \
or every workspace package, when executed inside a workspace. \
For options that may be used with \`-r\`, see "pnpm help recursive"`,
name: '--recursive',
shortAlias: '-r',
},

View File

@@ -7,7 +7,6 @@ import {
test as testCommand,
} from '@pnpm/plugin-commands-script-runners'
import prepare from '@pnpm/prepare'
import { stripIndent } from 'common-tags'
import execa = require('execa')
import fs = require('mz/fs')
import path = require('path')
@@ -236,15 +235,14 @@ test('"pnpm run" prints the list of available commands', async (t) => {
rawConfig: {},
}, [])
t.equal(output, stripIndent`
Lifecycle scripts:
test
ts-node test
t.equal(output, `\
Lifecycle scripts:
test
ts-node test
Commands available via "pnpm run":
foo
echo hi`
)
Commands available via "pnpm run":
foo
echo hi`)
t.end()
})

View File

@@ -3,7 +3,6 @@ import { filterPkgsBySelectorObjects, readProjects } from '@pnpm/filter-workspac
import { run } from '@pnpm/plugin-commands-script-runners'
import { preparePackages } from '@pnpm/prepare'
import rimraf = require('@zkochan/rimraf')
import { stripIndent } from 'common-tags'
import execa = require('execa')
import fs = require('mz/fs')
import path = require('path')
@@ -369,15 +368,14 @@ test('"pnpm run --filter <pkg>" without specifying the script name', async (t) =
workspaceDir: process.cwd(),
}, [])
t.equal(output, stripIndent`
Lifecycle scripts:
test
ts-node test
t.equal(output, `\
Lifecycle scripts:
test
ts-node test
Commands available via "pnpm run":
foo
echo hi`
)
Commands available via "pnpm run":
foo
echo hi`)
}
t.comment('throws an error if several projects are selected')
{

View File

@@ -31,7 +31,6 @@
"devDependencies": {
"@pnpm/logger": "^3.2.2",
"@pnpm/plugin-commands-server": "link:",
"@types/common-tags": "^1.8.0",
"@types/is-windows": "^1.0.0",
"@types/mz": "^2.7.1",
"@types/ramda": "^0.27.6",
@@ -46,7 +45,6 @@
"@pnpm/server": "workspace:8.0.3",
"@pnpm/store-connection-manager": "workspace:0.3.11",
"@pnpm/store-path": "^4.0.0",
"common-tags": "^1.8.0",
"delay": "^4.3.0",
"diable": "^4.0.2",
"get-port": "^5.1.1",

View File

@@ -3,7 +3,6 @@ import { OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help'
import { types as allTypes } from '@pnpm/config'
import PnpmError from '@pnpm/error'
import { CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import start from './start'
@@ -37,9 +36,9 @@ export function help () {
list: [
{
description: oneLine`
Starts a service that does all interactions with the store.
Other commands will delegate any store-related tasks to this service`,
description: `\
Starts a service that does all interactions with the store. \
Other commands will delegate any store-related tasks to this service`,
name: 'start',
},
{

View File

@@ -2,7 +2,6 @@ import { Config } from '@pnpm/config'
import { globalInfo } from '@pnpm/logger'
import { serverConnectionInfoDir, tryLoadServerJson } from '@pnpm/store-connection-manager'
import storePath from '@pnpm/store-path'
import { stripIndents } from 'common-tags'
import path = require('path')
export default async (
@@ -18,9 +17,7 @@ export default async (
globalInfo(`No server is running for the store at ${storeDir}`)
return
}
console.log(stripIndents`
store: ${storeDir}
process id: ${serverJson.pid}
remote prefix: ${serverJson.connectionOptions.remotePrefix}
`)
console.log(`store: ${storeDir}
process id: ${serverJson.pid}
remote prefix: ${serverJson.connectionOptions.remotePrefix}`)
}

View File

@@ -39,7 +39,6 @@
"@pnpm/plugin-commands-store": "link:",
"@pnpm/prepare": "workspace:0.0.6",
"@types/archy": "0.0.31",
"@types/common-tags": "^1.8.0",
"@types/ramda": "^0.27.6",
"@types/sinon": "^9.0.4",
"@types/ssri": "^6.0.3",
@@ -67,7 +66,6 @@
"@pnpm/store-path": "^4.0.0",
"@pnpm/types": "workspace:6.1.0",
"archy": "1.0.0",
"common-tags": "1.8.0",
"dependency-path": "workspace:5.0.1",
"dint": "^5.0.0",
"p-filter": "2.1.0",

View File

@@ -5,7 +5,6 @@ import logger, { globalInfo, LogBase } from '@pnpm/logger'
import { createOrConnectStoreController, CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import storePath from '@pnpm/store-path'
import archy = require('archy')
import { oneLine } from 'common-tags'
import R = require('ramda')
import renderHelp = require('render-help')
import storeAdd from './storeAdd'
@@ -33,10 +32,9 @@ export function help () {
list: [
{
description: oneLine`
Checks for modified packages in the store.
Returns exit code 0 if the content of the package is the same as it was at the time of unpacking
`,
description: `\
Checks for modified packages in the store. \
Returns exit code 0 if the content of the package is the same as it was at the time of unpacking`,
name: 'status',
},
{
@@ -44,11 +42,10 @@ export function help () {
name: 'add <pkg>...',
},
{
description: oneLine`
Removes unreferenced (extraneous, orphan) packages from the store.
Pruning the store is not harmful, but might slow down future installations.
Visit the documentation for more information on unreferenced packages and why they occur
`,
description: `\
Removes unreferenced (extraneous, orphan) packages from the store. \
Pruning the store is not harmful, but might slow down future installations. \
Visit the documentation for more information on unreferenced packages and why they occur`,
name: 'prune',
},
],

View File

@@ -45,7 +45,6 @@
"@types/nopt": "^3.0.29",
"@zkochan/libnpx": "11.0.3",
"chalk": "^4.1.0",
"common-tags": "^1.8.0",
"graceful-fs": "^4.2.4",
"is-ci": "^2.0.0",
"loud-rejection": "^2.2.0",
@@ -69,7 +68,6 @@
"@pnpm/read-project-manifest": "workspace:*",
"@pnpm/write-project-manifest": "workspace:*",
"@types/byline": "^4.2.32",
"@types/common-tags": "^1.8.0",
"@types/cross-spawn": "^6.0.2",
"@types/graceful-fs": "^4.1.3",
"@types/is-ci": "^2.0.0",

View File

@@ -1,6 +1,5 @@
import packageManager from '@pnpm/cli-meta'
import chalk = require('chalk')
import { stripIndents } from 'common-tags'
import updateNotifier = require('update-notifier')
export default function () {
@@ -14,13 +13,11 @@ export default function () {
// Although, "pnpm i -g pnpm" works in most cases, we have a big amount of users
// experiencing issues with it: https://github.com/pnpm/pnpm/issues/1203
// So until the issues are not fixed, we are recommending to update pnpm using npm.
const message = stripIndents`
Update available! ${chalk.red(update.current)}${chalk.green(update.latest)}
${chalk.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${update.latest}
Run ${chalk.magenta('npm i -g pnpm')} to update!
const message = `Update available! ${chalk.red(update.current)}${chalk.green(update.latest)}
${chalk.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${update.latest}
Run ${chalk.magenta('npm i -g pnpm')} to update!
Follow ${chalk.magenta('@pnpmjs')} for updates: https://twitter.com/pnpmjs
`
Follow ${chalk.magenta('@pnpmjs')} for updates: https://twitter.com/pnpmjs`
notifier.notify({ message })
}

View File

@@ -1,7 +1,6 @@
import { docsUrl } from '@pnpm/cli-utils'
import { FILTERING } from '@pnpm/common-cli-options-help'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { oneLine } from 'common-tags'
import renderHelp = require('render-help')
export const rcOptionsTypes = () => ({})
@@ -11,9 +10,8 @@ export const commandNames = ['recursive', 'multi', 'm']
export function help () {
return renderHelp({
description: oneLine`
Concurrently performs some actions in all subdirectories with a \`package.json\` (excluding node_modules).
A \`pnpm-workspace.yaml\` file may be used to control what directories are searched for packages.`,
description: `Concurrently performs some actions in all subdirectories with a \`package.json\` (excluding node_modules). \
A \`pnpm-workspace.yaml\` file may be used to control what directories are searched for packages.`,
descriptionLists: [
{
title: 'Commands',
@@ -49,10 +47,9 @@ export function help () {
name: 'outdated [<pkg>...]',
},
{
description: oneLine`
This runs an arbitrary command from each package's "scripts" object.
If a package doesn't have the command, it is skipped.
If none of the packages have the command, the command fails.`,
description: `This runs an arbitrary command from each package's "scripts" object. \
If a package doesn't have the command, it is skipped. \
If none of the packages have the command, the command fails.`,
name: 'run <command> [-- <args>...]',
},
{
@@ -60,10 +57,9 @@ export function help () {
name: 'test [-- <args>...]',
},
{
description: oneLine`
This command runs the "npm build" command on each package.
This is useful when you install a new version of node,
and must recompile all your C++ addons with the new binary.`,
description: `This command runs the "npm build" command on each package. \
This is useful when you install a new version of node, \
and must recompile all your C++ addons with the new binary.`,
name: 'rebuild [[<@scope>/<name>]...]',
},
{
@@ -89,9 +85,8 @@ export function help () {
name: '--workspace-concurrency <number>',
},
{
description: oneLine`
Locally available packages are linked to node_modules instead of being downloaded from the registry.
Convenient to use in a multi-package repository.`,
description: `Locally available packages are linked to node_modules instead of being downloaded from the registry. \
Convenient to use in a multi-package repository.`,
name: '--link-workspace-packages',
},
{
@@ -99,9 +94,8 @@ export function help () {
name: '--sort',
},
{
description: oneLine`
Creates a single ${WANTED_LOCKFILE} file in the root of the workspace.
A shared lockfile also means that all dependencies of all projects will be in a single node_modules.`,
description: `Creates a single ${WANTED_LOCKFILE} file in the root of the workspace. \
A shared lockfile also means that all dependencies of all projects will be in a single node_modules.`,
name: '--shared-workspace-lockfile',
},
],

View File

@@ -48,7 +48,6 @@
"@pnpm/types": "workspace:6.1.0",
"@zkochan/npm-package-arg": "1.0.2",
"@zkochan/rimraf": "1.0.0",
"common-tags": "^1.8.0",
"dependency-path": "workspace:5.0.1",
"encode-registry": "^2.0.2",
"get-npm-tarball-url": "^2.0.1",
@@ -80,7 +79,6 @@
"@pnpm/prepare": "workspace:0.0.6",
"@pnpm/store-path": "^4.0.0",
"@pnpm/test-fixtures": "workspace:*",
"@types/common-tags": "^1.8.0",
"@types/fs-extra": "^9.0.1",
"@types/graceful-fs": "^4.1.3",
"@types/is-ci": "^2.0.0",

View File

@@ -11,7 +11,6 @@ import {
import { Resolution } from '@pnpm/resolver-base'
import { PackageFilesResponse } from '@pnpm/store-controller-types'
import { Dependencies, DependencyManifest } from '@pnpm/types'
import { oneLine } from 'common-tags'
import crypto = require('crypto')
import importFrom = require('import-from')
import path = require('path')
@@ -317,9 +316,8 @@ function resolvePeers (
continue
}
const friendlyPath = nodeIdToFriendlyPath(ctx.nodeId, ctx.dependenciesTree)
const message = oneLine`
${friendlyPath ? `${friendlyPath}: ` : ''}${packageFriendlyId(ctx.resolvedPackage)}
requires a peer of ${peerName}@${peerVersionRange} but none was installed.`
const message = `${friendlyPath ? `${friendlyPath}: ` : ''}${packageFriendlyId(ctx.resolvedPackage)} \
requires a peer of ${peerName}@${peerVersionRange} but none was installed.`
if (ctx.strictPeerDependencies) {
throw new PnpmError('MISSING_PEER_DEPENDENCY', message)
}
@@ -333,9 +331,8 @@ function resolvePeers (
if (!semver.satisfies(resolved.version, peerVersionRange)) {
const friendlyPath = nodeIdToFriendlyPath(ctx.nodeId, ctx.dependenciesTree)
const message = oneLine`
${friendlyPath ? `${friendlyPath}: ` : ''}${packageFriendlyId(ctx.resolvedPackage)}
requires a peer of ${peerName}@${peerVersionRange} but version ${resolved.version} was installed.`
const message = `${friendlyPath ? `${friendlyPath}: ` : ''}${packageFriendlyId(ctx.resolvedPackage)} \
requires a peer of ${peerName}@${peerVersionRange} but version ${resolved.version} was installed.`
if (ctx.strictPeerDependencies) {
throw new PnpmError('INVALID_PEER_DEPENDENCY', message)
}

53
pnpm-lock.yaml generated
View File

@@ -245,7 +245,6 @@ importers:
'@zkochan/zen-push': 1.0.0
ansi-diff: 1.1.1
chalk: 4.1.0
common-tags: 1.8.0
most: 1.8.1_most@1.8.1
normalize-path: 3.0.0
pretty-bytes: 5.3.0
@@ -260,7 +259,6 @@ importers:
devDependencies:
'@pnpm/default-reporter': 'link:'
'@pnpm/logger': 3.2.2
'@types/common-tags': 1.8.0
'@types/normalize-path': 3.0.0
'@types/pretty-time': 1.1.0
'@types/ramda': 0.27.6
@@ -276,7 +274,6 @@ importers:
'@pnpm/error': 'workspace:1.2.0'
'@pnpm/logger': 3.2.2
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/normalize-path': ^3.0.0
'@types/pretty-time': ^1.1.0
'@types/ramda': ^0.27.6
@@ -284,7 +281,6 @@ importers:
'@zkochan/zen-push': 1.0.0
ansi-diff: ^1.1.1
chalk: ^4.1.0
common-tags: ^1.8.0
delay: 4.3.0
ghooks: 2.0.4
load-json-file: 6.2.0
@@ -832,10 +828,8 @@ importers:
'@pnpm/list': 'link:'
'@pnpm/logger': 3.2.2
'@types/archy': 0.0.31
'@types/common-tags': 1.8.0
'@types/ramda': 0.27.6
'@types/semver': 7.2.0
common-tags: 1.8.0
specifiers:
'@pnpm/list': 'link:'
'@pnpm/logger': 3.2.2
@@ -844,14 +838,12 @@ importers:
'@pnpm/read-project-manifest': 'workspace:1.0.8'
'@pnpm/types': 'workspace:6.1.0'
'@types/archy': 0.0.31
'@types/common-tags': ^1.8.0
'@types/ramda': ^0.27.6
'@types/semver': ^7.2.0
'@zkochan/npm-package-arg': 1.0.2
archy: ^1.0.0
chalk: ^4.1.0
cli-columns: ^3.1.2
common-tags: 1.8.0
dependencies-hierarchy: 'workspace:8.0.23'
p-limit: ^3.0.1
ramda: ^0.27.0
@@ -1501,7 +1493,6 @@ importers:
'@pnpm/types': 'link:../types'
camelcase-keys: 6.2.2
chalk: 4.1.0
common-tags: 1.8.0
enquirer: 2.3.5
is-ci: 2.0.0
is-subdir: 1.1.1
@@ -1524,7 +1515,6 @@ importers:
'@pnpm/plugin-commands-installation': 'link:'
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@pnpm/test-fixtures': 'link:../../privatePackages/test-fixtures'
'@types/common-tags': 1.8.0
'@types/is-ci': 2.0.0
'@types/mz': 2.7.1
'@types/proxyquire': 1.3.28
@@ -1566,7 +1556,6 @@ importers:
'@pnpm/store-connection-manager': 'workspace:0.3.11'
'@pnpm/test-fixtures': 'workspace:*'
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/is-ci': ^2.0.0
'@types/mz': ^2.7.1
'@types/proxyquire': ^1.3.28
@@ -1575,7 +1564,6 @@ importers:
'@types/table': ^5.0.0
camelcase-keys: ^6.2.2
chalk: ^4.1.0
common-tags: ^1.8.0
enquirer: ^2.3.5
is-ci: ^2.0.0
is-subdir: ^1.1.1
@@ -1606,7 +1594,6 @@ importers:
'@pnpm/error': 'link:../error'
'@pnpm/list': 'link:../list'
'@pnpm/types': 'link:../types'
common-tags: 1.8.0
ramda: 0.27.0
render-help: 1.0.0
devDependencies:
@@ -1616,7 +1603,6 @@ importers:
'@pnpm/plugin-commands-installation': 'link:../plugin-commands-installation'
'@pnpm/plugin-commands-listing': 'link:'
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@types/common-tags': 1.8.0
'@types/mz': 2.7.1
'@types/ramda': 0.27.6
execa: 4.0.2
@@ -1636,10 +1622,8 @@ importers:
'@pnpm/plugin-commands-listing': 'link:'
'@pnpm/prepare': 'workspace:0.0.6'
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/mz': ^2.7.1
'@types/ramda': ^0.27.6
common-tags: 1.8.0
execa: ^4.0.2
mz: 2.7.0
ramda: 0.27.0
@@ -1662,7 +1646,6 @@ importers:
'@pnpm/semver-diff': 1.0.2
'@pnpm/store-path': 4.0.0
chalk: 4.1.0
common-tags: 1.8.0
lru-cache: 5.1.1
ramda: 0.27.0
render-help: 1.0.0
@@ -1675,7 +1658,6 @@ importers:
'@pnpm/plugin-commands-outdated': 'link:'
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@pnpm/types': 'link:../types'
'@types/common-tags': 1.8.0
'@types/lru-cache': 5.1.0
'@types/mz': 2.7.1
'@types/ramda': 0.27.6
@@ -1703,14 +1685,12 @@ importers:
'@pnpm/semver-diff': 1.0.2
'@pnpm/store-path': ^4.0.0
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/lru-cache': ^5.1.0
'@types/mz': ^2.7.1
'@types/ramda': ^0.27.6
'@types/table': ^5.0.0
'@types/wrap-ansi': ^3.0.0
chalk: ^4.1.0
common-tags: 1.8.0
lru-cache: 5.1.1
mz: 2.7.0
ramda: 0.27.0
@@ -1822,7 +1802,6 @@ importers:
'@pnpm/types': 'link:../types'
'@zkochan/npm-package-arg': 1.0.2
camelcase-keys: 6.2.2
common-tags: 1.8.0
dependency-path: 'link:../dependency-path'
graph-sequencer: 2.0.0
load-json-file: 6.2.0
@@ -1839,7 +1818,6 @@ importers:
'@pnpm/plugin-commands-rebuild': 'link:'
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@pnpm/test-fixtures': 'link:../../privatePackages/test-fixtures'
'@types/common-tags': 1.8.0
'@types/ramda': 0.27.6
'@types/semver': 7.2.0
'@types/sinon': 9.0.4
@@ -1871,13 +1849,11 @@ importers:
'@pnpm/store-controller-types': 'workspace:8.0.1'
'@pnpm/test-fixtures': 'workspace:*'
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/ramda': ^0.27.6
'@types/semver': ^7.2.0
'@types/sinon': ^9.0.4
'@zkochan/npm-package-arg': 1.0.2
camelcase-keys: 6.2.2
common-tags: 1.8.0
dependency-path: 'workspace:5.0.1'
execa: ^4.0.2
graph-sequencer: 2.0.0
@@ -1902,7 +1878,6 @@ importers:
'@pnpm/lifecycle': 'link:../lifecycle'
'@pnpm/sort-packages': 'link:../sort-packages'
'@pnpm/types': 'link:../types'
common-tags: 1.8.0
p-limit: 3.0.1
ramda: 0.27.0
realpath-missing: 1.0.0
@@ -1912,7 +1887,6 @@ importers:
'@pnpm/logger': 3.2.2
'@pnpm/plugin-commands-script-runners': 'link:'
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@types/common-tags': 1.8.0
'@types/mz': 2.7.1
'@types/ramda': 0.27.6
'@zkochan/rimraf': 1.0.0
@@ -1932,11 +1906,9 @@ importers:
'@pnpm/prepare': 'workspace:0.0.6'
'@pnpm/sort-packages': 'workspace:1.0.12'
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/mz': ^2.7.1
'@types/ramda': ^0.27.6
'@zkochan/rimraf': 1.0.0
common-tags: 1.8.0
execa: ^4.0.2
mz: 2.7.0
p-limit: ^3.0.1
@@ -1954,7 +1926,6 @@ importers:
'@pnpm/server': 'link:../server'
'@pnpm/store-connection-manager': 'link:../store-connection-manager'
'@pnpm/store-path': 4.0.0
common-tags: 1.8.0
delay: 4.3.0
diable: 4.0.2
get-port: 5.1.1
@@ -1968,7 +1939,6 @@ importers:
devDependencies:
'@pnpm/logger': 3.2.2
'@pnpm/plugin-commands-server': 'link:'
'@types/common-tags': 1.8.0
'@types/is-windows': 1.0.0
'@types/mz': 2.7.1
'@types/ramda': 0.27.6
@@ -1984,12 +1954,10 @@ importers:
'@pnpm/server': 'workspace:8.0.3'
'@pnpm/store-connection-manager': 'workspace:0.3.11'
'@pnpm/store-path': ^4.0.0
'@types/common-tags': ^1.8.0
'@types/is-windows': ^1.0.0
'@types/mz': ^2.7.1
'@types/ramda': ^0.27.6
'@types/signal-exit': ^3.0.0
common-tags: ^1.8.0
delay: ^4.3.0
diable: ^4.0.2
get-port: ^5.1.1
@@ -2017,7 +1985,6 @@ importers:
'@pnpm/store-path': 4.0.0
'@pnpm/types': 'link:../types'
archy: 1.0.0
common-tags: 1.8.0
dependency-path: 'link:../dependency-path'
dint: 5.0.0
p-filter: 2.1.0
@@ -2030,7 +1997,6 @@ importers:
'@pnpm/plugin-commands-store': 'link:'
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@types/archy': 0.0.31
'@types/common-tags': 1.8.0
'@types/ramda': 0.27.6
'@types/sinon': 9.0.4
'@types/ssri': 6.0.3
@@ -2062,13 +2028,11 @@ importers:
'@pnpm/store-path': ^4.0.0
'@pnpm/types': 'workspace:6.1.0'
'@types/archy': 0.0.31
'@types/common-tags': ^1.8.0
'@types/ramda': ^0.27.6
'@types/sinon': ^9.0.4
'@types/ssri': ^6.0.3
'@zkochan/rimraf': 1.0.0
archy: 1.0.0
common-tags: 1.8.0
dependency-path: 'workspace:5.0.1'
dint: ^5.0.0
execa: ^4.0.2
@@ -2110,7 +2074,6 @@ importers:
'@types/nopt': 3.0.29
'@zkochan/libnpx': 11.0.3
chalk: 4.1.0
common-tags: 1.8.0
graceful-fs: 4.2.4
is-ci: 2.0.0
loud-rejection: 2.2.0
@@ -2133,7 +2096,6 @@ importers:
'@pnpm/read-project-manifest': 'link:../read-project-manifest'
'@pnpm/write-project-manifest': 'link:../write-project-manifest'
'@types/byline': 4.2.32
'@types/common-tags': 1.8.0
'@types/cross-spawn': 6.0.2
'@types/graceful-fs': 4.1.3
'@types/is-ci': 2.0.0
@@ -2209,7 +2171,6 @@ importers:
'@pnpm/types': 'workspace:6.1.0'
'@pnpm/write-project-manifest': 'workspace:*'
'@types/byline': ^4.2.32
'@types/common-tags': ^1.8.0
'@types/cross-spawn': ^6.0.2
'@types/graceful-fs': ^4.1.3
'@types/is-ci': ^2.0.0
@@ -2229,7 +2190,6 @@ importers:
anonymous-npm-registry-client: 0.1.2
byline: 5.0.0
chalk: ^4.1.0
common-tags: ^1.8.0
cross-spawn: ^7.0.3
deep-require-cwd: 1.0.0
delay: 4.3.0
@@ -2608,7 +2568,6 @@ importers:
'@pnpm/types': 'link:../types'
'@zkochan/npm-package-arg': 1.0.2
'@zkochan/rimraf': 1.0.0
common-tags: 1.8.0
dependency-path: 'link:../dependency-path'
encode-registry: 2.0.2
get-npm-tarball-url: 2.0.1
@@ -2639,7 +2598,6 @@ importers:
'@pnpm/prepare': 'link:../../privatePackages/prepare'
'@pnpm/store-path': 4.0.0
'@pnpm/test-fixtures': 'link:../../privatePackages/test-fixtures'
'@types/common-tags': 1.8.0
'@types/fs-extra': 9.0.1
'@types/graceful-fs': 4.1.3
'@types/is-ci': 2.0.0
@@ -2712,7 +2670,6 @@ importers:
'@pnpm/symlink-dependency': 'workspace:3.0.7'
'@pnpm/test-fixtures': 'workspace:*'
'@pnpm/types': 'workspace:6.1.0'
'@types/common-tags': ^1.8.0
'@types/fs-extra': ^9.0.1
'@types/graceful-fs': ^4.1.3
'@types/is-ci': ^2.0.0
@@ -2727,7 +2684,6 @@ importers:
'@zkochan/npm-package-arg': 1.0.2
'@zkochan/rimraf': 1.0.0
anonymous-npm-registry-client: 0.1.2
common-tags: ^1.8.0
cross-spawn: ^7.0.3
deep-require-cwd: 1.0.0
dependency-path: 'workspace:5.0.1'
@@ -3564,10 +3520,6 @@ packages:
/@types/color-name/1.1.1:
resolution:
integrity: sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
/@types/common-tags/1.8.0:
dev: true
resolution:
integrity: sha512-htRqZr5qn8EzMelhX/Xmx142z218lLyGaeZ3YR8jlze4TATRU9huKKvuBmAJEW4LCC4pnY1N6JAm6p85fMHjhg==
/@types/concat-stream/1.6.0:
dependencies:
'@types/node': 13.13.12
@@ -5291,11 +5243,6 @@ packages:
dev: true
resolution:
integrity: sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==
/common-tags/1.8.0:
engines:
node: '>=4.0.0'
resolution:
integrity: sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==
/compare-func/1.3.4:
dependencies:
array-ify: 1.0.0