Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.8.0 #150

Merged
merged 26 commits into from
Feb 14, 2019
Merged

6.8.0 #150

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
671cad1
npm-registry-fetch@3.9.0
zkat Jan 24, 2019
89b23a5
doc: use const in lib/fetch-package-metadata.md (#120)
watilde Jan 29, 2019
4970d55
misc: replace ronn with marked-man (#126)
watilde Jan 29, 2019
d9b6090
Reduce work to test if executable ends with a 'g'. (#138)
elidoran Jan 29, 2019
cdb0592
test(maketest): Fix common.npm callback arguments (#144)
larsgw Jan 29, 2019
91314e7
install/dedupe: fix hoisting of packages with peerDeps (#147)
sokra Jan 29, 2019
25573e9
ls: show installed but unmet peer deps (#145)
larsgw Jan 29, 2019
3663cde
doc: update package.json docs to include repository.directory details…
greysteil Jan 29, 2019
ce2c4bd
token: use figgy-config to make sure extra opts are there (#149)
zkat Jan 30, 2019
95ca1ae
pacote@9.4.1
Jan 30, 2019
dacc47d
chore: add changelog for v6.8.0
Jan 30, 2019
f28a94c
update AUTHORS
Jan 31, 2019
309260d
6.8.0-next.0
Jan 31, 2019
3c22d1a
access: ls-collaborators is ok with non-scoped (#151)
zkat Feb 4, 2019
322fef4
normalize-package-data@2.5.0
Feb 6, 2019
32d34c0
npm-packlist@1.3.0
Feb 6, 2019
f54bf9e
chore: update changelog for 6.8.0
Feb 6, 2019
7c62cde
6.8.0-next.1
Feb 6, 2019
d513709
Fix issue with sub folder local references (#86)
jtwebman Feb 7, 2019
7b87710
chore: update changelog for 6.8.0
Feb 7, 2019
b436cb0
update AUTHORS
Feb 7, 2019
26b768d
6.8.0-next.2
Feb 7, 2019
0c97036
Revert "install/dedupe: fix hoisting of packages with peerDeps (#147)…
zkat Feb 12, 2019
338571c
read-package-tree@5.2.2
zkat Feb 12, 2019
c7da272
chore: update changelog for final 6.8.0 release
Feb 13, 2019
67142b3
6.8.0
Feb 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ npm-debug.log
/.github
/test
node_modules/marked
node_modules/ronn
node_modules/marked-man
node_modules/tap
node_modules/.bin
node_modules/npm-registry-mock
Expand Down
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -619,3 +619,7 @@ Beni von Cheni <benjaminlchen@gmail.com>
Frédéric Harper <fharper@npmjs.com>
Johannes Würbach <johannes.wuerbach@googlemail.com>
ƇʘƁ̆ąƇ́ <anchnk@users.noreply.github.com>
Eli Doran <eli@elidoran.com>
Tobias Koppers <tobias.koppers@googlemail.com>
Grey Baker <greysteil@gmail.com>
JT Turner <jtwebman@gmail.com>
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
## v6.8.0 (2019-02-07):

This release includes an implementation of [RFC #10](https://github.com/npm/rfcs/blob/latest/accepted/0010-monorepo-subdirectory-declaration.md), documenting an optional field that can be used to specify
the directory path for a package within a monorepo.

### NEW FEATURES

* [`3663cdef2`](https://github.com/npm/cli/commit/3663cdef205fa9ba2c2830e5ef7ceeb31c30298c)
[#140](https://github.com/npm/cli/pull/140)
Update package.json docs to include repository.directory details.
([@greysteil](https://github.com/greysteil))

### BUGFIXES

* [`550bf703a`](https://github.com/npm/cli/commit/550bf703ae3e31ba6a300658ae95b6937f67b68f)
Add @types to ignore list to fix git clean -fd.
([@zkat](https://github.com/zkat))
* [`cdb059293`](https://github.com/npm/cli/commit/cdb0592939d6256c80f7ec5a2b6251131a512a2a)
[#144](https://github.com/npm/cli/pull/144)
Fix common.npm callback arguments.
([@larsgw](https://github.com/larsgw))
* [`25573e9b9`](https://github.com/npm/cli/commit/25573e9b9d5d26261c68d453f06db5b3b1cd6789)
[npm.community#4770](https://npm.community/t/https://npm.community/t/4770)
Show installed but unmet peer deps.
([@larsgw](https://github.com/larsgw))
* [`ce2c4bd1a`](https://github.com/npm/cli/commit/ce2c4bd1a2ce7ac1727a4ca9a350b743a2e27b2a)
[#149](https://github.com/npm/cli/pull/149)
Use figgy-config to make sure extra opts are there.
([@zkat](https://github.com/zkat))
* [`3c22d1a35`](https://github.com/npm/cli/commit/3c22d1a35878f73c0af8ea5968b962a85a1a9b84)
[npm.community#5101](https://npm.community/t/npm-6-6-0-breaks-access-to-ls-collaborators/5101)
Fix `ls-collaborators` access error for non-scoped case.
([@zkat](https://github.com/zkat))
* [`d5137091d`](https://github.com/npm/cli/commit/d5137091dd695a2980f7ade85fdc56b2421ff677)
[npm.community#754](https://npm.community/t/npm-install-for-package-with-local-dependency-fails/754)
Fix issue with sub-folder local references.
([@iarna](https://github.com/iarna))
([@jhecking](https://github.com/jhecking))

### DEPENDENCY BUMPS

* [`d72141080`](https://github.com/npm/cli/commit/d72141080ec8fcf35bcc5650245efbe649de053e)
`npm-registry-couchapp@2.7.1`
([@zkat](https://github.com/zkat))
* [`671cad1b1`](https://github.com/npm/cli/commit/671cad1b18239d540da246d6f78de45d9f784396)
`npm-registry-fetch@3.9.0`:
Make sure publishing with legacy username:password `_auth` works again.
([@zkat](https://github.com/zkat))
* [`95ca1aef4`](https://github.com/npm/cli/commit/95ca1aef4077c8e68d9f4dce37f6ba49b591c4ca)
`pacote@9.4.1`
([@aeschright](https://github.com/aeschright))
* [`322fef403`](https://github.com/npm/cli/commit/322fef40376e71cd100159dc914e7ca89faae327)
`normalize-package-data@2.5.0`
([@aeschright](https://github.com/aeschright))
* [`32d34c0da`](https://github.com/npm/cli/commit/32d34c0da4f393a74697297667eb9226155ecc6b)
`npm-packlist@1.3.0`
([@aeschright](https://github.com/aeschright))
* [`338571cf0`](https://github.com/npm/cli/commit/338571cf0bd3a1e2ea800464d57581932ff0fb11)
`read-package-tree@5.2.2`
([@zkat](https://github.com/zkat))

### MISC

* [`89b23a5f7`](https://github.com/npm/cli/commit/89b23a5f7b0ccdcdda1d7d4d3eafb6903156d186)
[#120](https://github.com/npm/cli/pull/120)
Use `const` in lib/fetch-package-metadata.md.
([@watilde](https://github.com/watilde))
* [`4970d553c`](https://github.com/npm/cli/commit/4970d553c0ea66128931d118469fd31c87cc7986)
[#126](https://github.com/npm/cli/pull/126)
Replace ronn with marked-man in `.npmignore`.
([@watilde](https://github.com/watilde))
* [`d9b6090dc`](https://github.com/npm/cli/commit/d9b6090dc26cd0fded18b4f80248cff3e51bb185)
[#138](https://github.com/npm/cli/pull/138)
Reduce work to test if executable ends with a 'g'.
([@elidoran](https://github.com/elidoran))
([@larsgw](https://github.com/larsgw))

## v6.7.0 (2019-01-23):

Hey y'all! This is a quick hotfix release that includes some important fixes to
Expand Down
3 changes: 1 addition & 2 deletions bin/npm-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

unsupported.checkForUnsupportedNode()

var path = require('path')
var npm = require('../lib/npm.js')
var npmconf = require('../lib/config/core.js')
var errorHandler = require('../lib/utils/error-handler.js')
Expand All @@ -37,7 +36,7 @@

// if npm is called as "npmg" or "npm_g", then
// run in global mode.
if (path.basename(process.argv[1]).slice(-1) === 'g') {
if (process.argv[1][process.argv[1].length - 1] === 'g') {
process.argv.splice(1, 1, 'npm', '-g')
}

Expand Down
9 changes: 9 additions & 0 deletions doc/files/package.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,15 @@ shortcut syntax you use for `npm install`:

"repository": "gitlab:user/repo"

If the `package.json` for your package is not in the root directory (for example
if it is part of a monorepo), you can specify the directory in which it lives:

"repository": {
"type" : "git",
"url" : "https://github.com/facebook/react.git",
"directory": "packages/react-dom"
}

## scripts

The "scripts" property is a dictionary containing script commands that are run
Expand Down
2 changes: 1 addition & 1 deletion lib/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ access['ls-packages'] = access.lsPackages = ([owner], opts) => {
}

access['ls-collaborators'] = access.lsCollaborators = ([pkg, usr], opts) => {
return getPackage(pkg).then(pkgName =>
return getPackage(pkg, false).then(pkgName =>
libaccess.lsCollaborators(pkgName, usr, opts)
).then(collabs => {
// TODO - print these out nicely (breaking change)
Expand Down
2 changes: 1 addition & 1 deletion lib/fetch-package-metadata.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fetch-package-metadata
----------------------

var fetchPackageMetadata = require("npm/lib/fetch-package-metadata")
const fetchPackageMetadata = require("npm/lib/fetch-package-metadata")
fetchPackageMetadata(spec, contextdir, callback)

This will get package metadata (and if possible, ONLY package metadata) for
Expand Down
2 changes: 1 addition & 1 deletion lib/install/inflate-shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function makeFakeChild (name, topPath, tree, sw, requested) {
realpath: requested.type === 'directory' ? requested.fetchSpec : childPath(tree.realpath, pkg),
location: (tree.location === '/' ? '' : tree.location + '/') + pkg.name,
isLink: requested.type === 'directory',
isInLink: tree.isLink,
isInLink: tree.isLink || tree.isInLink,
swRequires: sw.requires
})
tree.children.push(child)
Expand Down
2 changes: 1 addition & 1 deletion lib/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function filterFound (root, args) {
if (!markDeps) continue
Object.keys(markDeps).forEach(function (depName) {
var dep = markDeps[depName]
if (dep.peerMissing) return
if (dep.peerMissing && !dep._from) return
dep._parent = markPkg
for (var ii = 0; ii < args.length; ii++) {
var argName = args[ii][0]
Expand Down
7 changes: 5 additions & 2 deletions lib/shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ function shrinkwrapDeps (deps, top, tree, seen) {
var childIsOnlyDev = isOnlyDev(child)
var pkginfo = deps[moduleName(child)] = {}
var requested = getRequested(child) || child.package._requested || {}
var linked = child.isLink || child.isInLink
var linkedFromHere = linked && path.relative(top.realpath, child.realpath)[0] !== '.'
pkginfo.version = childVersion(top, child, requested)
if (requested.type === 'git' && child.package._from) {
pkginfo.from = child.package._from
}
if (child.fromBundle || child.isInLink) {
if (child.fromBundle && !linked) {
pkginfo.bundled = true
} else {
if (isRegistry(requested)) {
Expand All @@ -139,7 +141,8 @@ function shrinkwrapDeps (deps, top, tree, seen) {
pkginfo.requires[moduleName(required)] = childRequested(top, required, requested)
})
}
if (child.children.length) {
// iterate into children on non-links and links contained within the top level package
if (child.children.length && (!child.isLink || linkedFromHere)) {
pkginfo.dependencies = {}
shrinkwrapDeps(pkginfo.dependencies, top, child, seen)
}
Expand Down
46 changes: 35 additions & 11 deletions lib/token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use strict'

const profile = require('libnpm/profile')
const npm = require('./npm.js')
const figgyPudding = require('figgy-pudding')
const npmConfig = require('./config/figgy-config.js')
const output = require('./utils/output.js')
const Table = require('cli-table3')
const Bluebird = require('bluebird')
Expand Down Expand Up @@ -76,22 +79,43 @@ function generateTokenIds (tokens, minLength) {
return byId
}

const TokenConfig = figgyPudding({
registry: {},
otp: {},
cidr: {},
'read-only': {},
json: {},
parseable: {}
})

function config () {
const conf = {
json: npm.config.get('json'),
parseable: npm.config.get('parseable'),
registry: npm.config.get('registry'),
otp: npm.config.get('otp')
}
let conf = TokenConfig(npmConfig())
const creds = npm.config.getCredentialsByURI(conf.registry)
if (creds.token) {
conf.auth = {token: creds.token}
conf = conf.concat({
auth: { token: creds.token }
})
} else if (creds.username) {
conf.auth = {basic: {username: creds.username, password: creds.password}}
conf = conf.concat({
auth: {
basic: {
username: creds.username,
password: creds.password
}
}
})
} else if (creds.auth) {
const auth = Buffer.from(creds.auth, 'base64').toString().split(':', 2)
conf.auth = {basic: {username: auth[0], password: auth[1]}}
conf = conf.concat({
auth: {
basic: {
username: auth[0],
password: auth[1]
}
}
})
} else {
conf = conf.concat({ auth: {} })
conf.auth = {}
}
if (conf.otp) conf.auth.otp = conf.otp
Expand Down Expand Up @@ -183,8 +207,8 @@ function rm (args) {

function create (args) {
const conf = config()
const cidr = npm.config.get('cidr')
const readonly = npm.config.get('read-only')
const cidr = conf.cidr
const readonly = conf['read-only']

const validCIDR = validateCIDRList(cidr)
return readUserInfo.password().then((password) => {
Expand Down
3 changes: 1 addition & 2 deletions node_modules/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions node_modules/is-builtin-module/index.js

This file was deleted.

75 changes: 0 additions & 75 deletions node_modules/is-builtin-module/package.json

This file was deleted.

Loading