Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDylan Greene <dylang@gmail.com>2014-07-04 21:08:12 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-09-05 05:41:33 +0400
commit874bbac515db4508a4a6c69af93bac35c4ee9ef7 (patch)
tree7ceda50c09744f31dfd0568f6bd6a807e45ccdb3 /lib
parent991484adb4ef34d3dcb342ccdba9070965275c87 (diff)
remove pre-publish check for a future PR
Diffstat (limited to 'lib')
-rw-r--r--lib/publish.js23
-rw-r--r--lib/utils/local-check.js16
2 files changed, 6 insertions, 33 deletions
diff --git a/lib/publish.js b/lib/publish.js
index fcc1455ac..833cab5de 100644
--- a/lib/publish.js
+++ b/lib/publish.js
@@ -11,7 +11,6 @@ var url = require("url")
, Conf = require("npmconf").Conf
, RegClient = require("npm-registry-client")
, mapToRegistry = require("./utils/map-to-registry.js")
- , localCheck = require("./utils/local-check.js")
publish.usage = "npm publish <tarball>"
+ "\nnpm publish <folder>"
@@ -74,22 +73,6 @@ function publish_ (arg, data, isRetry, cachedir, cb) {
var registry = npm.registry
var config = npm.config
- var localPackages = localCheck(data);
-
- if (localPackages.length) return cb(
- new Error(
- "This package contains dependencies targeted at the local file system.\n" +
- "Remove these dependencies or use a semver or tarball url to publish it.\n" +
- "Preventing publishing: " + localPackages.join(', ')
- )
- )
-
- if (data.private) return cb(
- new Error(
- "This package has been marked as private\n" +
- "Remove the 'private' field from the package.json to publish it."
- )
- )
// check for publishConfig hash
if (data.publishConfig) {
@@ -108,6 +91,12 @@ function publish_ (arg, data, isRetry, cachedir, cb) {
data._npmVersion = npm.version
delete data.modules
+ if (data.private) return cb(
+ new Error(
+ "This package has been marked as private\n" +
+ "Remove the 'private' field from the package.json to publish it."
+ )
+ )
mapToRegistry(data.name, config, function (er, registryURI) {
if (er) return cb(er)
diff --git a/lib/utils/local-check.js b/lib/utils/local-check.js
deleted file mode 100644
index b077e80ef..000000000
--- a/lib/utils/local-check.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var npa = require("npm-package-arg")
-
-module.exports = function checkForLocalDependencies(pkgData) {
- return filterDepByType(pkgData.dependencies, "local")
- .concat(filterDepByType(pkgData.devDependencies, "local"));
-}
-
-function filterDepByType(deps, type) {
- return Object.keys(deps || {}).reduce(function (acc, name) {
- var spec = name + "@" + deps[name];
- if (npa(spec).type === type) {
- return acc.concat(spec)
- }
- return acc
- }, [])
-}