mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 03:51:40 -04:00
feat: use shrinkwrap version 3.1
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
"path-exists": "^3.0.0",
|
||||
"path-name": "^1.0.0",
|
||||
"pnpm-install-checks": "^1.1.0",
|
||||
"pnpm-shrinkwrap": "^3.1.0",
|
||||
"pnpm-shrinkwrap": "^3.2.0",
|
||||
"proper-lockfile": "^2.0.0",
|
||||
"ramda": "^0.24.1",
|
||||
"read-package-json": "^2.0.5",
|
||||
|
||||
@@ -45,7 +45,7 @@ dependencies:
|
||||
path-exists: 3.0.0
|
||||
path-name: 1.0.0
|
||||
pnpm-install-checks: 1.1.0
|
||||
pnpm-shrinkwrap: 3.1.0
|
||||
pnpm-shrinkwrap: 3.2.0
|
||||
proper-lockfile: 2.0.1
|
||||
ramda: 0.24.1
|
||||
read-package-json: 2.0.12
|
||||
@@ -1624,10 +1624,11 @@ packages:
|
||||
dev: true
|
||||
resolution:
|
||||
integrity: sha512-VLlRExib18bl5lSFp74vFHeZV0iWuxTkdOvI7BIhfWpiP9EdrkAq/GnjE5pxjXmsvXyZlaBDwoEQygU8kbVr8g==
|
||||
/pnpm-shrinkwrap/3.1.0:
|
||||
/pnpm-shrinkwrap/3.2.0:
|
||||
dependencies:
|
||||
'@types/node': 7.0.43
|
||||
'@types/ramda': 0.0.11
|
||||
dependency-path: 1.1.0
|
||||
js-yaml: 3.10.0
|
||||
load-yaml-file: 0.1.0
|
||||
mkdirp-promise: 5.0.1
|
||||
@@ -1637,7 +1638,7 @@ packages:
|
||||
thenify: 3.3.0
|
||||
write-file-atomic: 2.3.0
|
||||
resolution:
|
||||
integrity: sha512-mFMdm0fCmh+kwxmGVD8Bl5QO4E7h/SCWdayKRtdzexHon0nN7YNkEz/llj1lHrb99pzQmE4NCI6BEvTYP/XeIg==
|
||||
integrity: sha512-VKWUDXH9XWWDN7ufz6Zex/mdcs7muukdFolkqpY/175EvV0SluPWJsh8qNqVXTbCXbMxl383UUXDXOZtMBxW+g==
|
||||
/pos/0.4.2:
|
||||
dev: true
|
||||
resolution:
|
||||
@@ -2390,7 +2391,7 @@ specifiers:
|
||||
path-name: ^1.0.0
|
||||
pnpm-install-checks: ^1.1.0
|
||||
pnpm-logger: ^0.6.2
|
||||
pnpm-shrinkwrap: ^3.1.0
|
||||
pnpm-shrinkwrap: ^3.2.0
|
||||
proper-lockfile: ^2.0.0
|
||||
ramda: ^0.24.1
|
||||
read-package-json: ^2.0.5
|
||||
|
||||
@@ -26,6 +26,7 @@ export default function (
|
||||
)
|
||||
shrinkwrap.packages[dependencyPath] = toShrDependency({
|
||||
dependencyAbsolutePath,
|
||||
name: pkgsToLink[dependencyAbsolutePath].name,
|
||||
id: pkgsToLink[dependencyAbsolutePath].id,
|
||||
dependencyPath,
|
||||
resolution: pkgsToLink[dependencyAbsolutePath].resolution,
|
||||
@@ -45,6 +46,7 @@ export default function (
|
||||
function toShrDependency (
|
||||
opts: {
|
||||
dependencyAbsolutePath: string,
|
||||
name: string,
|
||||
id: string,
|
||||
dependencyPath: string,
|
||||
resolution: Resolution,
|
||||
@@ -64,6 +66,9 @@ function toShrDependency (
|
||||
const result = {
|
||||
resolution: shrResolution
|
||||
}
|
||||
if (dp.isAbsolute(opts.dependencyPath)) {
|
||||
result['name'] = opts.name
|
||||
}
|
||||
if (!R.isEmpty(newResolvedDeps)) {
|
||||
result['dependencies'] = newResolvedDeps
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ test('local file', async function (t: tape.Test) {
|
||||
'local-pkg': 'file:../local-pkg',
|
||||
},
|
||||
registry: 'http://localhost:4873/',
|
||||
shrinkwrapVersion: 3,
|
||||
shrinkwrapVersion: 3.1,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -13,15 +13,15 @@ import {RootLog} from 'pnpm-logger'
|
||||
|
||||
const test = promisifyTape(tape)
|
||||
|
||||
test('shrinkwrap file has correct format', async t => {
|
||||
test('shrinkwrap file has correct format', async (t: tape.Test) => {
|
||||
const project = prepare(t)
|
||||
|
||||
await installPkgs(['pkg-with-1-dep', '@rstacruz/tap-spec@4.1.1', 'kevva/is-negative'], testDefaults({save: true}))
|
||||
await installPkgs(['pkg-with-1-dep', '@rstacruz/tap-spec@4.1.1', 'kevva/is-negative#1d7e288222b53a0cab90a331f1865220ec29560c'], testDefaults({save: true}))
|
||||
|
||||
const shr = await project.loadShrinkwrap()
|
||||
const id = '/pkg-with-1-dep/100.0.0'
|
||||
|
||||
t.equal(shr.shrinkwrapVersion, 3, 'correct shrinkwrap version')
|
||||
t.equal(shr.shrinkwrapVersion, 3.1, 'correct shrinkwrap version')
|
||||
|
||||
t.ok(shr.registry, 'has registry field')
|
||||
|
||||
@@ -38,6 +38,10 @@ test('shrinkwrap file has correct format', async t => {
|
||||
t.ok(shr.packages[id].resolution, `has resolution for ${id}`)
|
||||
t.ok(shr.packages[id].resolution.integrity, `has integrity for package in the default registry`)
|
||||
t.notOk(shr.packages[id].resolution.tarball, `has no tarball for package in the default registry`)
|
||||
|
||||
const absDepPath = 'github.com/kevva/is-negative/1d7e288222b53a0cab90a331f1865220ec29560c'
|
||||
t.ok(shr.packages[absDepPath])
|
||||
t.ok(shr.packages[absDepPath].name, 'github-hosted package has name specified')
|
||||
})
|
||||
|
||||
test('shrinkwrap file has dev deps even when installing for prod only', async (t: tape.Test) => {
|
||||
@@ -462,6 +466,7 @@ test('scoped module from different registry', async function (t: tape.Test) {
|
||||
}
|
||||
},
|
||||
'registry.npmjs.org/@zkochan/foo/1.0.0': {
|
||||
name: '@zkochan/foo',
|
||||
resolution: {
|
||||
integrity: 'sha512-IFvrYpq7E6BqKex7A7czIFnFncPiUVdhSzGhAOWpp8RlkXns4y/9ZdynxaA/e0VkihRxQkihE2pTyvxjfe/wBg==',
|
||||
registry: 'https://registry.npmjs.org/',
|
||||
@@ -474,7 +479,7 @@ test('scoped module from different registry', async function (t: tape.Test) {
|
||||
'@zkochan/foo': '^1.0.0',
|
||||
'is-positive': '^3.1.0',
|
||||
},
|
||||
shrinkwrapVersion: 3
|
||||
shrinkwrapVersion: 3.1,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -516,7 +521,7 @@ test('installing from shrinkwrap when using npm enterprise', async (t: tape.Test
|
||||
specifiers: {
|
||||
'is-positive': '^3.1.0',
|
||||
},
|
||||
shrinkwrapVersion: 3
|
||||
shrinkwrapVersion: 3.1,
|
||||
})
|
||||
|
||||
await rimraf(opts.store)
|
||||
|
||||
Reference in New Issue
Block a user