summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/init-package-json
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/npm/node_modules/init-package-json')
-rw-r--r--deps/node/deps/npm/node_modules/init-package-json/CHANGELOG.md17
-rw-r--r--deps/node/deps/npm/node_modules/init-package-json/LICENSE15
-rw-r--r--deps/node/deps/npm/node_modules/init-package-json/README.md45
-rw-r--r--deps/node/deps/npm/node_modules/init-package-json/default-input.js244
-rw-r--r--deps/node/deps/npm/node_modules/init-package-json/init-package-json.js154
-rw-r--r--deps/node/deps/npm/node_modules/init-package-json/package.json85
6 files changed, 0 insertions, 560 deletions
diff --git a/deps/node/deps/npm/node_modules/init-package-json/CHANGELOG.md b/deps/node/deps/npm/node_modules/init-package-json/CHANGELOG.md
deleted file mode 100644
index 35096f4a..00000000
--- a/deps/node/deps/npm/node_modules/init-package-json/CHANGELOG.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Change Log
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-<a name="1.10.3"></a>
-## [1.10.3](https://github.com/npm/init-package-json/compare/v1.10.2...v1.10.3) (2018-03-07)
-
-
-
-<a name="1.10.2"></a>
-## [1.10.2](https://github.com/npm/init-package-json/compare/v1.10.1...v1.10.2) (2018-03-07)
-
-
-### Bug Fixes
-
-* **default-input:** Catch errors from npa ([#71](https://github.com/npm/init-package-json/issues/71)) ([11aee1e](https://github.com/npm/init-package-json/commit/11aee1e))
-* **grammar:** Fix minor style issue in final prompt ([#76](https://github.com/npm/init-package-json/issues/76)) ([ba259ce](https://github.com/npm/init-package-json/commit/ba259ce))
diff --git a/deps/node/deps/npm/node_modules/init-package-json/LICENSE b/deps/node/deps/npm/node_modules/init-package-json/LICENSE
deleted file mode 100644
index 05eeeb88..00000000
--- a/deps/node/deps/npm/node_modules/init-package-json/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/node/deps/npm/node_modules/init-package-json/README.md b/deps/node/deps/npm/node_modules/init-package-json/README.md
deleted file mode 100644
index bd64c123..00000000
--- a/deps/node/deps/npm/node_modules/init-package-json/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# init-package-json
-
-A node module to get your node module started.
-
-[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json)
-
-## Usage
-
-```javascript
-var init = require('init-package-json')
-var path = require('path')
-
-// a path to a promzard module. In the event that this file is
-// not found, one will be provided for you.
-var initFile = path.resolve(process.env.HOME, '.npm-init')
-
-// the dir where we're doin stuff.
-var dir = process.cwd()
-
-// extra stuff that gets put into the PromZard module's context.
-// In npm, this is the resolved config object. Exposed as 'config'
-// Optional.
-var configData = { some: 'extra stuff' }
-
-// Any existing stuff from the package.json file is also exposed in the
-// PromZard module as the `package` object. There will also be free
-// vars for:
-// * `filename` path to the package.json file
-// * `basename` the tip of the package dir
-// * `dirname` the parent of the package dir
-
-init(dir, initFile, configData, function (er, data) {
- // the data's already been written to {dir}/package.json
- // now you can do stuff with it
-})
-```
-
-Or from the command line:
-
-```
-$ npm-init
-```
-
-See [PromZard](https://github.com/npm/promzard) for details about
-what can go in the config file.
diff --git a/deps/node/deps/npm/node_modules/init-package-json/default-input.js b/deps/node/deps/npm/node_modules/init-package-json/default-input.js
deleted file mode 100644
index 7d859a0d..00000000
--- a/deps/node/deps/npm/node_modules/init-package-json/default-input.js
+++ /dev/null
@@ -1,244 +0,0 @@
-var fs = require('fs')
-var glob = require('glob')
-var path = require('path')
-var validateLicense = require('validate-npm-package-license')
-var validateName = require('validate-npm-package-name')
-var npa = require('npm-package-arg')
-var semver = require('semver')
-
-// more popular packages should go here, maybe?
-function isTestPkg (p) {
- return !!p.match(/^(expresso|mocha|tap|coffee-script|coco|streamline)$/)
-}
-
-function niceName (n) {
- return n.replace(/^node-|[.-]js$/g, '').replace(' ', '-').toLowerCase()
-}
-
-function readDeps (test, excluded) { return function (cb) {
- fs.readdir('node_modules', function (er, dir) {
- if (er) return cb()
- var deps = {}
- var n = dir.length
- if (n === 0) return cb(null, deps)
- dir.forEach(function (d) {
- if (d.match(/^\./)) return next()
- if (test !== isTestPkg(d) || excluded[d])
- return next()
-
- var dp = path.join(dirname, 'node_modules', d, 'package.json')
- fs.readFile(dp, 'utf8', function (er, p) {
- if (er) return next()
- try { p = JSON.parse(p) }
- catch (e) { return next() }
- if (!p.version) return next()
- if (p._requiredBy) {
- if (!p._requiredBy.some(function (req) { return req === '#USER' })) return next()
- }
- deps[d] = config.get('save-exact') ? p.version : config.get('save-prefix') + p.version
- return next()
- })
- })
- function next () {
- if (--n === 0) return cb(null, deps)
- }
- })
-}}
-
-var name = package.name || basename
-var spec
-try {
- spec = npa(name)
-} catch (e) {
- spec = {}
-}
-var scope = config.get('scope')
-if (scope) {
- if (scope.charAt(0) !== '@') scope = '@' + scope
- if (spec.scope) {
- name = scope + '/' + spec.name.split('/')[1]
- } else {
- name = scope + '/' + name
- }
-}
-exports.name = yes ? name : prompt('package name', niceName(name), function (data) {
- var its = validateName(data)
- if (its.validForNewPackages) return data
- var errors = (its.errors || []).concat(its.warnings || [])
- var er = new Error('Sorry, ' + errors.join(' and ') + '.')
- er.notValid = true
- return er
-})
-
-var version = package.version ||
- config.get('init.version') ||
- config.get('init-version') ||
- '1.0.0'
-exports.version = yes ?
- version :
- prompt('version', version, function (version) {
- if (semver.valid(version)) return version
- var er = new Error('Invalid version: "' + version + '"')
- er.notValid = true
- return er
- })
-
-if (!package.description) {
- exports.description = yes ? '' : prompt('description')
-}
-
-if (!package.main) {
- exports.main = function (cb) {
- fs.readdir(dirname, function (er, f) {
- if (er) f = []
-
- f = f.filter(function (f) {
- return f.match(/\.js$/)
- })
-
- if (f.indexOf('index.js') !== -1)
- f = 'index.js'
- else if (f.indexOf('main.js') !== -1)
- f = 'main.js'
- else if (f.indexOf(basename + '.js') !== -1)
- f = basename + '.js'
- else
- f = f[0]
-
- var index = f || 'index.js'
- return cb(null, yes ? index : prompt('entry point', index))
- })
- }
-}
-
-if (!package.bin) {
- exports.bin = function (cb) {
- fs.readdir(path.resolve(dirname, 'bin'), function (er, d) {
- // no bins
- if (er) return cb()
- // just take the first js file we find there, or nada
- return cb(null, d.filter(function (f) {
- return f.match(/\.js$/)
- })[0])
- })
- }
-}
-
-exports.directories = function (cb) {
- fs.readdir(dirname, function (er, dirs) {
- if (er) return cb(er)
- var res = {}
- dirs.forEach(function (d) {
- switch (d) {
- case 'example': case 'examples': return res.example = d
- case 'test': case 'tests': return res.test = d
- case 'doc': case 'docs': return res.doc = d
- case 'man': return res.man = d
- case 'lib': return res.lib = d
- }
- })
- if (Object.keys(res).length === 0) res = undefined
- return cb(null, res)
- })
-}
-
-if (!package.dependencies) {
- exports.dependencies = readDeps(false, package.devDependencies || {})
-}
-
-if (!package.devDependencies) {
- exports.devDependencies = readDeps(true, package.dependencies || {})
-}
-
-// MUST have a test script!
-var s = package.scripts || {}
-var notest = 'echo "Error: no test specified" && exit 1'
-if (!package.scripts) {
- exports.scripts = function (cb) {
- fs.readdir(path.join(dirname, 'node_modules'), function (er, d) {
- setupScripts(d || [], cb)
- })
- }
-}
-function setupScripts (d, cb) {
- // check to see what framework is in use, if any
- function tx (test) {
- return test || notest
- }
- if (!s.test || s.test === notest) {
- var commands = {
- 'tap':'tap test/*.js'
- , 'expresso':'expresso test'
- , 'mocha':'mocha'
- }
- var command
- Object.keys(commands).forEach(function (k) {
- if (d.indexOf(k) !== -1) command = commands[k]
- })
- var ps = 'test command'
- if (yes) {
- s.test = command || notest
- } else {
- s.test = command ? prompt(ps, command, tx) : prompt(ps, tx)
- }
- }
- return cb(null, s)
-}
-
-if (!package.repository) {
- exports.repository = function (cb) {
- fs.readFile('.git/config', 'utf8', function (er, gconf) {
- if (er || !gconf) {
- return cb(null, yes ? '' : prompt('git repository'))
- }
- gconf = gconf.split(/\r?\n/)
- var i = gconf.indexOf('[remote "origin"]')
- if (i !== -1) {
- var u = gconf[i + 1]
- if (!u.match(/^\s*url =/)) u = gconf[i + 2]
- if (!u.match(/^\s*url =/)) u = null
- else u = u.replace(/^\s*url = /, '')
- }
- if (u && u.match(/^git@github.com:/))
- u = u.replace(/^git@github.com:/, 'https://github.com/')
-
- return cb(null, yes ? u : prompt('git repository', u))
- })
- }
-}
-
-if (!package.keywords) {
- exports.keywords = yes ? '' : prompt('keywords', function (s) {
- if (!s) return undefined
- if (Array.isArray(s)) s = s.join(' ')
- if (typeof s !== 'string') return s
- return s.split(/[\s,]+/)
- })
-}
-
-if (!package.author) {
- exports.author = config.get('init.author.name') ||
- config.get('init-author-name')
- ? {
- "name" : config.get('init.author.name') ||
- config.get('init-author-name'),
- "email" : config.get('init.author.email') ||
- config.get('init-author-email'),
- "url" : config.get('init.author.url') ||
- config.get('init-author-url')
- }
- : yes ? '' : prompt('author')
-}
-
-var license = package.license ||
- config.get('init.license') ||
- config.get('init-license') ||
- 'ISC'
-exports.license = yes ? license : prompt('license', license, function (data) {
- var its = validateLicense(data)
- if (its.validForNewPackages) return data
- var errors = (its.errors || []).concat(its.warnings || [])
- var er = new Error('Sorry, ' + errors.join(' and ') + '.')
- er.notValid = true
- return er
-})
diff --git a/deps/node/deps/npm/node_modules/init-package-json/init-package-json.js b/deps/node/deps/npm/node_modules/init-package-json/init-package-json.js
deleted file mode 100644
index 5b2889e5..00000000
--- a/deps/node/deps/npm/node_modules/init-package-json/init-package-json.js
+++ /dev/null
@@ -1,154 +0,0 @@
-
-module.exports = init
-module.exports.yes = yes
-
-var PZ = require('promzard').PromZard
-var path = require('path')
-var def = require.resolve('./default-input.js')
-
-var fs = require('fs')
-var semver = require('semver')
-var read = require('read')
-
-// to validate the data object at the end as a worthwhile package
-// and assign default values for things.
-// readJson.extras(file, data, cb)
-var readJson = require('read-package-json')
-
-function yes (conf) {
- return !!(
- conf.get('yes') || conf.get('y') ||
- conf.get('force') || conf.get('f')
- )
-}
-
-function init (dir, input, config, cb) {
- if (typeof config === 'function')
- cb = config, config = {}
-
- // accept either a plain-jane object, or a config object
- // with a "get" method.
- if (typeof config.get !== 'function') {
- var data = config
- config = {
- get: function (k) {
- return data[k]
- },
- toJSON: function () {
- return data
- }
- }
- }
-
- var packageFile = path.resolve(dir, 'package.json')
- input = path.resolve(input)
- var pkg
- var ctx = { yes: yes(config) }
-
- var es = readJson.extraSet
- readJson.extraSet = es.filter(function (fn) {
- return fn.name !== 'authors' && fn.name !== 'mans'
- })
- readJson(packageFile, function (er, d) {
- readJson.extraSet = es
-
- if (er) pkg = {}
- else pkg = d
-
- ctx.filename = packageFile
- ctx.dirname = path.dirname(packageFile)
- ctx.basename = path.basename(ctx.dirname)
- if (!pkg.version || !semver.valid(pkg.version))
- delete pkg.version
-
- ctx.package = pkg
- ctx.config = config || {}
-
- // make sure that the input is valid.
- // if not, use the default
- var pz = new PZ(input, ctx)
- pz.backupFile = def
- pz.on('error', cb)
- pz.on('data', function (data) {
- Object.keys(data).forEach(function (k) {
- if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k]
- })
-
- // only do a few of these.
- // no need for mans or contributors if they're in the files
- var es = readJson.extraSet
- readJson.extraSet = es.filter(function (fn) {
- return fn.name !== 'authors' && fn.name !== 'mans'
- })
- readJson.extras(packageFile, pkg, function (er, pkg) {
- readJson.extraSet = es
- if (er) return cb(er, pkg)
- pkg = unParsePeople(pkg)
- // no need for the readme now.
- delete pkg.readme
- delete pkg.readmeFilename
-
- // really don't want to have this lying around in the file
- delete pkg._id
-
- // ditto
- delete pkg.gitHead
-
- // if the repo is empty, remove it.
- if (!pkg.repository)
- delete pkg.repository
-
- // readJson filters out empty descriptions, but init-package-json
- // traditionally leaves them alone
- if (!pkg.description)
- pkg.description = data.description
-
- var d = JSON.stringify(pkg, null, 2) + '\n'
- function write (yes) {
- fs.writeFile(packageFile, d, 'utf8', function (er) {
- if (!er && yes && !config.get('silent')) {
- console.log('Wrote to %s:\n\n%s\n', packageFile, d)
- }
- return cb(er, pkg)
- })
- }
- if (ctx.yes) {
- return write(true)
- }
- console.log('About to write to %s:\n\n%s\n', packageFile, d)
- read({prompt:'Is this OK? ', default: 'yes'}, function (er, ok) {
- if (er) {
- return cb(er)
- }
- if (!ok || ok.toLowerCase().charAt(0) !== 'y') {
- console.log('Aborted.')
- } else {
- return write()
- }
- })
- })
- })
- })
-
-}
-
-// turn the objects into somewhat more humane strings.
-function unParsePeople (data) {
- if (data.author) data.author = unParsePerson(data.author)
- ;["maintainers", "contributors"].forEach(function (set) {
- if (!Array.isArray(data[set])) return;
- data[set] = data[set].map(unParsePerson)
- })
- return data
-}
-
-function unParsePerson (person) {
- if (typeof person === "string") return person
- var name = person.name || ""
- var u = person.url || person.web
- var url = u ? (" ("+u+")") : ""
- var e = person.email || person.mail
- var email = e ? (" <"+e+">") : ""
- return name+email+url
-}
-
diff --git a/deps/node/deps/npm/node_modules/init-package-json/package.json b/deps/node/deps/npm/node_modules/init-package-json/package.json
deleted file mode 100644
index bd1b8743..00000000
--- a/deps/node/deps/npm/node_modules/init-package-json/package.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "_args": [
- [
- "init-package-json@1.10.3",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "init-package-json@1.10.3",
- "_id": "init-package-json@1.10.3",
- "_inBundle": false,
- "_integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==",
- "_location": "/init-package-json",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "init-package-json@1.10.3",
- "name": "init-package-json",
- "escapedName": "init-package-json",
- "rawSpec": "1.10.3",
- "saveSpec": null,
- "fetchSpec": "1.10.3"
- },
- "_requiredBy": [
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz",
- "_spec": "1.10.3",
- "_where": "/Users/rebecca/code/npm",
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "bugs": {
- "url": "https://github.com/npm/init-package-json/issues"
- },
- "dependencies": {
- "glob": "^7.1.1",
- "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0",
- "promzard": "^0.3.0",
- "read": "~1.0.1",
- "read-package-json": "1 || 2",
- "semver": "2.x || 3.x || 4 || 5",
- "validate-npm-package-license": "^3.0.1",
- "validate-npm-package-name": "^3.0.0"
- },
- "description": "A node module to get your node module started",
- "devDependencies": {
- "mkdirp": "^0.5.1",
- "npm": "^5.7.1",
- "rimraf": "^2.1.4",
- "standard-version": "^4.3.0",
- "tap": "^11.1.2"
- },
- "files": [
- "default-input.js",
- "init-package-json.js"
- ],
- "homepage": "https://github.com/npm/init-package-json#readme",
- "keywords": [
- "init",
- "package.json",
- "package",
- "helper",
- "wizard",
- "wizerd",
- "prompt",
- "start"
- ],
- "license": "ISC",
- "main": "init-package-json.js",
- "name": "init-package-json",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/npm/init-package-json.git"
- },
- "scripts": {
- "postrelease": "npm publish && git push --follow-tags",
- "prerelease": "npm t",
- "release": "standard-version -s",
- "test": "tap --nyc-arg=--all --coverage test"
- },
- "version": "1.10.3"
-}