mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-19 06:07:59 -04:00
8
.changeset/small-jokes-sing.md
Normal file
8
.changeset/small-jokes-sing.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/config": major
|
||||||
|
"@pnpm/plugin-commands-installation": major
|
||||||
|
"@pnpm/store-connection-manager": minor
|
||||||
|
"supi": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Locking is removed.
|
||||||
@@ -91,8 +91,6 @@ export interface Config {
|
|||||||
verifyStoreIntegrity?: boolean,
|
verifyStoreIntegrity?: boolean,
|
||||||
networkConcurrency?: number,
|
networkConcurrency?: number,
|
||||||
fetchingConcurrency?: number,
|
fetchingConcurrency?: number,
|
||||||
lockStaleDuration?: number,
|
|
||||||
lock: boolean,
|
|
||||||
lockfileOnly?: boolean, // like npm's --package-lock-only
|
lockfileOnly?: boolean, // like npm's --package-lock-only
|
||||||
childConcurrency?: number,
|
childConcurrency?: number,
|
||||||
repeatInstallDepth?: number,
|
repeatInstallDepth?: number,
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ export const types = Object.assign({
|
|||||||
'ignore-workspace-root-check': Boolean,
|
'ignore-workspace-root-check': Boolean,
|
||||||
'independent-leaves': Boolean,
|
'independent-leaves': Boolean,
|
||||||
'link-workspace-packages': Boolean,
|
'link-workspace-packages': Boolean,
|
||||||
'lock': Boolean,
|
|
||||||
'lock-stale-duration': Number,
|
|
||||||
'lockfile': Boolean,
|
'lockfile': Boolean,
|
||||||
'lockfile-dir': String,
|
'lockfile-dir': String,
|
||||||
'lockfile-directory': String, // TODO: deprecate
|
'lockfile-directory': String, // TODO: deprecate
|
||||||
@@ -147,7 +145,6 @@ export default async (
|
|||||||
'hoist-pattern': ['*'],
|
'hoist-pattern': ['*'],
|
||||||
'ignore-workspace-root-check': false,
|
'ignore-workspace-root-check': false,
|
||||||
'link-workspace-packages': true,
|
'link-workspace-packages': true,
|
||||||
'lock': true,
|
|
||||||
'package-lock': npmDefaults['package-lock'],
|
'package-lock': npmDefaults['package-lock'],
|
||||||
'pending': false,
|
'pending': false,
|
||||||
'registry': npmDefaults.registry,
|
'registry': npmDefaults.registry,
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ export default async function testDefaults (
|
|||||||
...fetchOpts,
|
...fetchOpts,
|
||||||
}) as {},
|
}) as {},
|
||||||
{
|
{
|
||||||
locks: path.join(storeDir, '_locks'),
|
|
||||||
storeDir,
|
storeDir,
|
||||||
...storeOpts,
|
...storeOpts,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ export function rcOptionsTypes () {
|
|||||||
'ignore-workspace-root-check',
|
'ignore-workspace-root-check',
|
||||||
'independent-leaves',
|
'independent-leaves',
|
||||||
'link-workspace-packages',
|
'link-workspace-packages',
|
||||||
'lock',
|
|
||||||
'lockfile-dir',
|
'lockfile-dir',
|
||||||
'lockfile-directory',
|
'lockfile-directory',
|
||||||
'lockfile-only',
|
'lockfile-only',
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export function rcOptionsTypes () {
|
|||||||
'ignore-scripts',
|
'ignore-scripts',
|
||||||
'independent-leaves',
|
'independent-leaves',
|
||||||
'link-workspace-packages',
|
'link-workspace-packages',
|
||||||
'lock',
|
|
||||||
'lockfile-dir',
|
'lockfile-dir',
|
||||||
'lockfile-directory',
|
'lockfile-directory',
|
||||||
'lockfile-only',
|
'lockfile-only',
|
||||||
@@ -166,9 +165,6 @@ export function help () {
|
|||||||
description: "If false, doesn't check whether packages in the store were mutated",
|
description: "If false, doesn't check whether packages in the store were mutated",
|
||||||
name: '--[no-]verify-store-integrity',
|
name: '--[no-]verify-store-integrity',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: '--[no-]lock',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
description: 'Fail on missing or invalid peer dependencies',
|
description: 'Fail on missing or invalid peer dependencies',
|
||||||
name: '--strict-peer-dependencies',
|
name: '--strict-peer-dependencies',
|
||||||
|
|||||||
@@ -197,27 +197,6 @@ test('lockfile compatibility', async (t: tape.Test) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('support installing and uninstalling from the same store simultaneously', async (t: tape.Test) => {
|
|
||||||
const project = prepare(t, {
|
|
||||||
dependencies: {
|
|
||||||
rimraf: '2.5.1',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
await Promise.all([
|
|
||||||
execPnpm(['install', 'pkg-that-installs-slowly']),
|
|
||||||
(async () => {
|
|
||||||
await delay(500) // to be sure that lock was created
|
|
||||||
|
|
||||||
await project.storeHasNot('pkg-that-installs-slowly')
|
|
||||||
await execPnpm(['uninstall', 'rimraf'])
|
|
||||||
|
|
||||||
await project.hasNot('rimraf')
|
|
||||||
})(),
|
|
||||||
])
|
|
||||||
await project.has('pkg-that-installs-slowly')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('top-level packages should find the plugins they use', async (t: tape.Test) => {
|
test('top-level packages should find the plugins they use', async (t: tape.Test) => {
|
||||||
prepare(t, {
|
prepare(t, {
|
||||||
scripts: {
|
scripts: {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export type CreateNewStoreControllerOptions = CreateResolverOptions & Pick<Confi
|
|||||||
export default async (
|
export default async (
|
||||||
opts: CreateNewStoreControllerOptions
|
opts: CreateNewStoreControllerOptions
|
||||||
) => {
|
) => {
|
||||||
// TODO: either print a warning or just log if --no-lock is used
|
|
||||||
const sopts = Object.assign(opts, {
|
const sopts = Object.assign(opts, {
|
||||||
registry: opts.registry || 'https://registry.npmjs.org/',
|
registry: opts.registry || 'https://registry.npmjs.org/',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ export type CreateResolverOptions = Pick<Config,
|
|||||||
'httpsProxy' |
|
'httpsProxy' |
|
||||||
'key' |
|
'key' |
|
||||||
'localAddress' |
|
'localAddress' |
|
||||||
'lockStaleDuration' |
|
|
||||||
'offline' |
|
'offline' |
|
||||||
'proxy' |
|
'proxy' |
|
||||||
'rawConfig' |
|
'rawConfig' |
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
"@pnpm/core-loggers": "workspace:4.0.2-alpha.0",
|
"@pnpm/core-loggers": "workspace:4.0.2-alpha.0",
|
||||||
"@pnpm/error": "workspace:1.2.0",
|
"@pnpm/error": "workspace:1.2.0",
|
||||||
"@pnpm/filter-lockfile": "workspace:3.2.3-alpha.1",
|
"@pnpm/filter-lockfile": "workspace:3.2.3-alpha.1",
|
||||||
"@pnpm/fs-locker": "3.0.1",
|
|
||||||
"@pnpm/get-context": "workspace:2.0.0-alpha.1",
|
"@pnpm/get-context": "workspace:2.0.0-alpha.1",
|
||||||
"@pnpm/headless": "workspace:13.0.0-alpha.4",
|
"@pnpm/headless": "workspace:13.0.0-alpha.4",
|
||||||
"@pnpm/hoist": "workspace:3.0.0-alpha.1",
|
"@pnpm/hoist": "workspace:3.0.0-alpha.1",
|
||||||
|
|||||||
@@ -58,10 +58,7 @@ export interface StrictInstallOptions {
|
|||||||
userAgent: string,
|
userAgent: string,
|
||||||
unsafePerm: boolean,
|
unsafePerm: boolean,
|
||||||
registries: Registries,
|
registries: Registries,
|
||||||
lock: boolean,
|
|
||||||
lockStaleDuration: number,
|
|
||||||
tag: string,
|
tag: string,
|
||||||
locks: string,
|
|
||||||
ownLifecycleHooksStdio: 'inherit' | 'pipe',
|
ownLifecycleHooksStdio: 'inherit' | 'pipe',
|
||||||
workspacePackages: WorkspacePackages,
|
workspacePackages: WorkspacePackages,
|
||||||
pruneStore: boolean,
|
pruneStore: boolean,
|
||||||
@@ -110,11 +107,8 @@ const defaults = async (opts: InstallOptions) => {
|
|||||||
optionalDependencies: true,
|
optionalDependencies: true,
|
||||||
},
|
},
|
||||||
independentLeaves: false,
|
independentLeaves: false,
|
||||||
lock: true,
|
|
||||||
lockfileDir: opts.lockfileDir || opts.dir || process.cwd(),
|
lockfileDir: opts.lockfileDir || opts.dir || process.cwd(),
|
||||||
lockfileOnly: false,
|
lockfileOnly: false,
|
||||||
locks: path.join(opts.storeDir, '_locks'),
|
|
||||||
lockStaleDuration: 5 * 60 * 1000, // 5 minutes
|
|
||||||
nodeVersion: process.version,
|
nodeVersion: process.version,
|
||||||
ownLifecycleHooksStdio: 'inherit',
|
ownLifecycleHooksStdio: 'inherit',
|
||||||
packageManager,
|
packageManager,
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ import pLimit from 'p-limit'
|
|||||||
import path = require('path')
|
import path = require('path')
|
||||||
import R = require('ramda')
|
import R = require('ramda')
|
||||||
import getSpecFromPackageManifest from '../getSpecFromPackageManifest'
|
import getSpecFromPackageManifest from '../getSpecFromPackageManifest'
|
||||||
import lock from '../lock'
|
|
||||||
import parseWantedDependencies from '../parseWantedDependencies'
|
import parseWantedDependencies from '../parseWantedDependencies'
|
||||||
import safeIsInnerLink from '../safeIsInnerLink'
|
import safeIsInnerLink from '../safeIsInnerLink'
|
||||||
import removeDeps from '../uninstall/removeDeps'
|
import removeDeps from '../uninstall/removeDeps'
|
||||||
@@ -151,17 +150,7 @@ export async function mutateModules (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let result!: Array<{ rootDir: string, manifest: ProjectManifest }>
|
const result = await _install()
|
||||||
if (opts.lock) {
|
|
||||||
result = await lock(ctx.lockfileDir, _install, {
|
|
||||||
locks: opts.locks,
|
|
||||||
prefix: ctx.lockfileDir,
|
|
||||||
stale: opts.lockStaleDuration,
|
|
||||||
storeController: opts.storeController,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
result = await _install()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reporter) {
|
if (reporter) {
|
||||||
streamParser.removeListener('data', reporter)
|
streamParser.removeListener('data', reporter)
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
import lock from '@pnpm/fs-locker'
|
|
||||||
import logger from '@pnpm/logger'
|
|
||||||
import { StoreController } from '@pnpm/store-controller-types'
|
|
||||||
|
|
||||||
export default async function withLock<T> (
|
|
||||||
dir: string,
|
|
||||||
fn: () => Promise<T>,
|
|
||||||
opts: {
|
|
||||||
stale: number,
|
|
||||||
storeController: StoreController,
|
|
||||||
locks: string,
|
|
||||||
prefix: string,
|
|
||||||
}
|
|
||||||
): Promise<T> {
|
|
||||||
const unlock = await lock(dir, {
|
|
||||||
locks: opts.locks,
|
|
||||||
stale: opts.stale,
|
|
||||||
whenLocked () {
|
|
||||||
logger.warn({
|
|
||||||
message: 'waiting for another installation to complete...',
|
|
||||||
prefix: opts.prefix,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
|
||||||
try {
|
|
||||||
const result = await fn()
|
|
||||||
await unlock()
|
|
||||||
return result
|
|
||||||
} catch (err) {
|
|
||||||
await unlock()
|
|
||||||
// TODO: revise how store locking works
|
|
||||||
// maybe it needs to happen outside of supi
|
|
||||||
await opts.storeController.close()
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -43,7 +43,6 @@ test('--independent-leaves throws exception when executed on node_modules instal
|
|||||||
...opts,
|
...opts,
|
||||||
forceIndependentLeaves: false,
|
forceIndependentLeaves: false,
|
||||||
independentLeaves: true,
|
independentLeaves: true,
|
||||||
lock: false,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await project.has('is-negative')
|
await project.has('is-negative')
|
||||||
|
|||||||
@@ -529,23 +529,6 @@ test('compiled modules (ursa@0.9.1)', async (t) => {
|
|||||||
|
|
||||||
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
|
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
|
||||||
|
|
||||||
test('support installing into the same store simultaneously', async (t) => {
|
|
||||||
const project = prepareEmpty(t)
|
|
||||||
await Promise.all([
|
|
||||||
addDependenciesToPackage({}, ['pkg-that-installs-slowly'], await testDefaults({ fastUnpack: false })),
|
|
||||||
wait(500) // to be sure that lock was created
|
|
||||||
.then(async () => {
|
|
||||||
await project.storeHasNot('pkg-that-installs-slowly')
|
|
||||||
await addDependenciesToPackage({ dependencies: { 'pkg-that-installs-slowly': '*' } }, ['rimraf@2.5.1'], await testDefaults({ fastUnpack: false }))
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
await project.has('pkg-that-installs-slowly')
|
|
||||||
await project.has('rimraf')
|
|
||||||
})
|
|
||||||
.catch((err) => t.notOk(err)),
|
|
||||||
])
|
|
||||||
})
|
|
||||||
|
|
||||||
test('bin specified in the directories property linked to .bin folder', async (t) => {
|
test('bin specified in the directories property linked to .bin folder', async (t) => {
|
||||||
const project = prepareEmpty(t)
|
const project = prepareEmpty(t)
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ export default async function testDefaults<T> (
|
|||||||
}) as {},
|
}) as {},
|
||||||
{
|
{
|
||||||
ignoreFile: opts?.fastUnpack === false ? undefined : (filename) => filename !== 'package.json',
|
ignoreFile: opts?.fastUnpack === false ? undefined : (filename) => filename !== 'package.json',
|
||||||
locks: path.join(storeDir, '_locks'),
|
|
||||||
storeDir,
|
storeDir,
|
||||||
verifyStoreIntegrity: true,
|
verifyStoreIntegrity: true,
|
||||||
...storeOpts,
|
...storeOpts,
|
||||||
|
|||||||
19
pnpm-lock.yaml
generated
19
pnpm-lock.yaml
generated
@@ -2558,7 +2558,6 @@ importers:
|
|||||||
'@pnpm/core-loggers': 'link:../core-loggers'
|
'@pnpm/core-loggers': 'link:../core-loggers'
|
||||||
'@pnpm/error': 'link:../error'
|
'@pnpm/error': 'link:../error'
|
||||||
'@pnpm/filter-lockfile': 'link:../filter-lockfile'
|
'@pnpm/filter-lockfile': 'link:../filter-lockfile'
|
||||||
'@pnpm/fs-locker': 3.0.1
|
|
||||||
'@pnpm/get-context': 'link:../get-context'
|
'@pnpm/get-context': 'link:../get-context'
|
||||||
'@pnpm/headless': 'link:../headless'
|
'@pnpm/headless': 'link:../headless'
|
||||||
'@pnpm/hoist': 'link:../hoist'
|
'@pnpm/hoist': 'link:../hoist'
|
||||||
@@ -2661,7 +2660,6 @@ importers:
|
|||||||
'@pnpm/default-resolver': 'workspace:*'
|
'@pnpm/default-resolver': 'workspace:*'
|
||||||
'@pnpm/error': 'workspace:1.2.0'
|
'@pnpm/error': 'workspace:1.2.0'
|
||||||
'@pnpm/filter-lockfile': 'workspace:3.2.3-alpha.1'
|
'@pnpm/filter-lockfile': 'workspace:3.2.3-alpha.1'
|
||||||
'@pnpm/fs-locker': 3.0.1
|
|
||||||
'@pnpm/get-context': 'workspace:2.0.0-alpha.1'
|
'@pnpm/get-context': 'workspace:2.0.0-alpha.1'
|
||||||
'@pnpm/headless': 'workspace:13.0.0-alpha.4'
|
'@pnpm/headless': 'workspace:13.0.0-alpha.4'
|
||||||
'@pnpm/hoist': 'workspace:3.0.0-alpha.1'
|
'@pnpm/hoist': 'workspace:3.0.0-alpha.1'
|
||||||
@@ -3421,15 +3419,6 @@ packages:
|
|||||||
node: '>=8.15'
|
node: '>=8.15'
|
||||||
resolution:
|
resolution:
|
||||||
integrity: sha512-CMPclTpDRqgT241w6yKt/e3Mer/L5wFCAKTG5rGlhRz7f3BGhbuj4nblIVB/BTXhJty34Y57gKg4gbu3FVeQIA==
|
integrity: sha512-CMPclTpDRqgT241w6yKt/e3Mer/L5wFCAKTG5rGlhRz7f3BGhbuj4nblIVB/BTXhJty34Y57gKg4gbu3FVeQIA==
|
||||||
/@pnpm/fs-locker/3.0.1:
|
|
||||||
dependencies:
|
|
||||||
make-dir: 3.1.0
|
|
||||||
proper-lockfile: 3.2.0
|
|
||||||
dev: false
|
|
||||||
engines:
|
|
||||||
node: '>=8.15'
|
|
||||||
resolution:
|
|
||||||
integrity: sha512-o9d47i3E6XtVDIjxPjl9mg+phHnjScYtjhx5KiAZEcgV4nEjXCtnrQ8MjH8yjN8JVeCQH3FiioR1i+iD9DzkRw==
|
|
||||||
/@pnpm/logger/3.2.2:
|
/@pnpm/logger/3.2.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
bole: 3.0.2
|
bole: 3.0.2
|
||||||
@@ -10112,14 +10101,6 @@ packages:
|
|||||||
node: '>= 8'
|
node: '>= 8'
|
||||||
resolution:
|
resolution:
|
||||||
integrity: sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==
|
integrity: sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==
|
||||||
/proper-lockfile/3.2.0:
|
|
||||||
dependencies:
|
|
||||||
graceful-fs: 4.2.1
|
|
||||||
retry: 0.12.0
|
|
||||||
signal-exit: 3.0.3
|
|
||||||
dev: false
|
|
||||||
resolution:
|
|
||||||
integrity: sha512-iMghHHXv2bsxl6NchhEaFck8tvX3F9cknEEh1SUpguUOBjN7PAAW9BLzmbc1g/mCD1gY3EE2EABBHPJfFdHFmA==
|
|
||||||
/proto-list/1.2.4:
|
/proto-list/1.2.4:
|
||||||
dev: false
|
dev: false
|
||||||
resolution:
|
resolution:
|
||||||
|
|||||||
Reference in New Issue
Block a user