Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libnpmpublish

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libnpmpublish - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="1.1.0"></a>
# [1.1.0](https://github.com/npm/libnpmpublish/compare/v1.0.1...v1.1.0) (2018-08-31)
### Features
* **publish:** add support for publishConfig on manifests ([161723b](https://github.com/npm/libnpmpublish/commit/161723b))
<a name="1.0.1"></a>

@@ -7,0 +17,0 @@ ## [1.0.1](https://github.com/npm/libnpmpublish/compare/v1.0.0...v1.0.1) (2018-08-31)

2

package.json
{
"name": "libnpmpublish",
"version": "1.0.1",
"version": "1.1.0",
"description": "Programmatic API for the bits behind npm publish and unpublish",

@@ -5,0 +5,0 @@ "author": {

@@ -36,3 +36,3 @@ 'use strict'

// NOTE: spec is used to pick the appropriate registry/auth combo.
opts = opts.concat({ spec })
opts = opts.concat(manifest.publishConfig, { spec })
const reg = npmFetch.pickRegistry(spec, opts)

@@ -39,0 +39,0 @@ const auth = npmAuth(reg, opts)

@@ -858,1 +858,63 @@ 'use strict'

})
test('publishConfig on manifest', t => {
const manifest = {
name: 'libnpmpublish',
version: '1.0.0',
description: 'some stuff',
publishConfig: {
registry: REG
}
}
return mockTar({
'package.json': JSON.stringify(manifest),
'index.js': 'console.log("hello world")'
}).then(tarData => {
const shasum = crypto.createHash('sha1').update(tarData).digest('hex')
const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] })
const packument = {
name: 'libnpmpublish',
description: 'some stuff',
readme: '',
_id: 'libnpmpublish',
'dist-tags': {
latest: '1.0.0'
},
versions: {
'1.0.0': {
_id: 'libnpmpublish@1.0.0',
_nodeVersion: process.versions.node,
name: 'libnpmpublish',
version: '1.0.0',
description: 'some stuff',
dist: {
shasum,
integrity: integrity.toString(),
tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz`
},
publishConfig: {
registry: REG
}
}
},
_attachments: {
'libnpmpublish-1.0.0.tgz': {
'content_type': 'application/octet-stream',
data: tarData.toString('base64'),
length: tarData.length
}
}
}
const srv = tnock(t, REG)
srv.put('/libnpmpublish', body => {
t.deepEqual(body, packument, 'posted packument matches expectations')
return true
}, {
authorization: 'Bearer deadbeef'
}).reply(201, {})
return publish(manifest, tarData, { token: 'deadbeef' }).then(ret => {
t.ok(ret, 'publish succeeded')
})
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc