Skip to content

Commit 794c10e

Browse files
committedMay 26, 2017
pkglock: remove packageIntegrity field of doom
1 parent 674004c commit 794c10e

5 files changed

+0
-85
lines changed
 

‎lib/install/read-shrinkwrap.js

-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const log = require('npmlog')
99
const parseJSON = require('../utils/parse-json.js')
1010
const path = require('path')
1111
const PKGLOCK_VERSION = require('../npm.js').lockfileVersion
12-
const pkgSri = require('../utils/package-integrity.js')
1312

1413
const readFileAsync = BB.promisify(fs.readFile)
1514

@@ -34,14 +33,6 @@ function readShrinkwrap (child, next) {
3433
throw ex
3534
}
3635
}
37-
if (
38-
pkgJson &&
39-
parsed &&
40-
parsed.packageIntegrity &&
41-
!pkgSri.check(JSON.parse(pkgJson), parsed.packageIntegrity)
42-
) {
43-
log.info('read-shrinkwrap', `${name} will be updated because package.json does not match what it was generated against.`)
44-
}
4536
if (parsed && parsed.lockfileVersion !== PKGLOCK_VERSION) {
4637
log.warn('read-shrinkwrap', `This version of npm is compatible with lockfileVersion@${PKGLOCK_VERSION}, but ${name} was generated for lockfileVersion@${parsed.lockfileVersion || 0}. I'll try to do my best with it!`)
4738
}

‎lib/shrinkwrap.js

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const moduleName = require('./utils/module-name.js')
1717
const move = require('move-concurrently')
1818
const npm = require('./npm.js')
1919
const path = require('path')
20-
const pkgSri = require('./utils/package-integrity.js')
2120
const readPackageTree = BB.promisify(require('read-package-tree'))
2221
const ssri = require('ssri')
2322
const validate = require('aproba')
@@ -184,7 +183,6 @@ function updateLockfileMetadata (pkginfo, pkgJson) {
184183
let metainfoWritten = false
185184
const metainfo = new Set([
186185
'lockfileVersion',
187-
'packageIntegrity',
188186
'preserveSymlinks'
189187
])
190188
Object.keys(pkginfo).forEach((k) => {
@@ -203,7 +201,6 @@ function updateLockfileMetadata (pkginfo, pkgJson) {
203201
}
204202
function writeMetainfo (pkginfo) {
205203
pkginfo.lockfileVersion = PKGLOCK_VERSION
206-
pkginfo.packageIntegrity = pkgJson && pkgSri.hash(pkgJson)
207204
if (process.env.NODE_PRESERVE_SYMLINKS) {
208205
pkginfo.preserveSymlinks = process.env.NODE_PRESERVE_SYMLINKS
209206
}

‎lib/utils/package-integrity.js

-21
This file was deleted.

‎test/tap/shrinkwrap-extra-metadata.js

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const mr = require('npm-registry-mock')
77
const npm = require('../../lib/npm.js')
88
const osenv = require('osenv')
99
const path = require('path')
10-
const pkgSri = require('../../lib/utils/package-integrity.js')
1110
const rimraf = require('rimraf')
1211
const test = require('tap').test
1312

@@ -51,7 +50,6 @@ test('adds additional metadata fields from the pkglock spec', function (t) {
5150
'name': 'shrinkwrap-extra-metadata',
5251
'version': '0.0.0',
5352
'lockfileVersion': npm.lockfileVersion,
54-
'packageIntegrity': pkgSri.hash(json),
5553
'preserveSymlinks': 'foo'
5654
},
5755
JSON.parse(desired),

‎test/tap/shrinkwrap-package-integrity.js

-50
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.