mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-06 06:57:21 +00:00
push all website files
This commit is contained in:
103
website/node_modules/npm/scripts/changelog.js
generated
vendored
Normal file
103
website/node_modules/npm/scripts/changelog.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
'use strict'
|
||||
/*
|
||||
Usage:
|
||||
|
||||
node scripts/changelog.js [comittish]
|
||||
|
||||
Generates changelog entries in our format as best as its able based on
|
||||
commits starting at comittish, or if that's not passed, latest.
|
||||
|
||||
Ordinarily this is run via the gen-changelog shell script, which appends
|
||||
the result to the changelog.
|
||||
|
||||
*/
|
||||
const execSync = require('child_process').execSync
|
||||
const branch = process.argv[2] || 'origin/latest'
|
||||
const log = execSync(`git log --reverse --pretty='format:%h %H%d %s (%aN)%n%b%n---%n' ${branch}...`).toString().split(/\n/)
|
||||
|
||||
main()
|
||||
|
||||
function shortname (url) {
|
||||
let matched = url.match(/https:\/\/github\.com\/([^/]+\/[^/]+)\/(?:pull|issues)\/(\d+)/) ||
|
||||
url.match(/https:\/\/(npm\.community)\/t\/(?:[^/]+\/)(\d+)/)
|
||||
if (!matched) return false
|
||||
let repo = matched[1]
|
||||
let id = matched[2]
|
||||
if (repo !== 'npm/cli') {
|
||||
return `${repo}#${id}`
|
||||
} else {
|
||||
return `#${id}`
|
||||
}
|
||||
}
|
||||
|
||||
function printCommit (c) {
|
||||
console.log(`* [\`${c.shortid}\`](https://github.com/npm/cli/commit/${c.fullid})`)
|
||||
if (c.fixes) {
|
||||
let label = shortname(c.fixes)
|
||||
if (label) {
|
||||
console.log(` [${label}](${c.fixes})`)
|
||||
} else {
|
||||
console.log(` [npm.community#${c.fixes}](https://npm.community/t/${c.fixes})`)
|
||||
}
|
||||
} else if (c.prurl) {
|
||||
let label = shortname(c.prurl)
|
||||
if (label) {
|
||||
console.log(` [${label}](${c.prurl})`)
|
||||
} else {
|
||||
console.log(` [#](${c.prurl})`)
|
||||
}
|
||||
}
|
||||
let msg = c.message
|
||||
.replace(/^\s+/mg, '')
|
||||
.replace(/^[-a-z]+: /, '')
|
||||
.replace(/^/mg, ' ')
|
||||
.replace(/\n$/, '')
|
||||
// backtickify package@version
|
||||
.replace(/^(\s*[^@\s]+@\d+[.]\d+[.]\d+)(\s*\S)/g, '$1:$2')
|
||||
.replace(/\b([^@\s]+@\d+[.]\d+[.]\d+)\b/g, '`$1`')
|
||||
// linkify commitids
|
||||
.replace(/\b([a-f0-9]{7,8})\b/g, '[`$1`](https://github.com/npm/cli/commit/$1)')
|
||||
.replace(/\b#(\d+)\b/g, '[#$1](https://npm.community/t/$1)')
|
||||
console.log(msg)
|
||||
if (c.credit) {
|
||||
c.credit.forEach(function (credit) {
|
||||
console.log(` ([@${credit}](https://github.com/${credit}))`)
|
||||
})
|
||||
} else {
|
||||
console.log(` ([@${c.author}](https://github.com/${c.author}))`)
|
||||
}
|
||||
}
|
||||
|
||||
function main () {
|
||||
let commit
|
||||
log.forEach(function (line) {
|
||||
line = line.replace(/\r/g, '')
|
||||
let m
|
||||
/* eslint no-cond-assign:0 */
|
||||
if (/^---$/.test(line)) {
|
||||
printCommit(commit)
|
||||
} else if (m = line.match(/^([a-f0-9]{7,10}) ([a-f0-9]+) (?:[(]([^)]+)[)] )?(.*?) [(](.*?)[)]/)) {
|
||||
commit = {
|
||||
shortid: m[1],
|
||||
fullid: m[2],
|
||||
branch: m[3],
|
||||
message: m[4],
|
||||
author: m[5],
|
||||
prurl: null,
|
||||
fixes: null,
|
||||
credit: null
|
||||
}
|
||||
} else if (m = line.match(/^PR-URL: (.*)/)) {
|
||||
commit.prurl = m[1]
|
||||
} else if (m = line.match(/^Credit: @(.*)/)) {
|
||||
if (!commit.credit) commit.credit = []
|
||||
commit.credit.push(m[1])
|
||||
} else if (m = line.match(/^Fixes: #?(.*)/)) {
|
||||
commit.fixes = m[1]
|
||||
} else if (m = line.match(/^Reviewed-By: @(.*)/)) {
|
||||
commit.reviewed = m[1]
|
||||
} else if (/\S/.test(line)) {
|
||||
commit.message += `\n${line}`
|
||||
}
|
||||
})
|
||||
}
|
165
website/node_modules/npm/scripts/clean-old.sh
generated
vendored
Normal file
165
website/node_modules/npm/scripts/clean-old.sh
generated
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
#!/bin/bash
|
||||
|
||||
# look for old 0.x cruft, and get rid of it.
|
||||
# Should already be sitting in the npm folder.
|
||||
|
||||
# This doesn't have to be quite as cross-platform as install.sh.
|
||||
# There are some bash-isms, because maintaining *two*
|
||||
# fully-portable posix/bourne sh scripts is too much for
|
||||
# one project with a sane maintainer.
|
||||
|
||||
# If readlink isn't available, then this is just too tricky.
|
||||
# However, greadlink is fine, so Solaris can join the party, too.
|
||||
readlink="readlink"
|
||||
which $readlink >/dev/null 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
readlink="greadlink"
|
||||
which $readlink >/dev/null 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Can't find the readlink or greadlink command. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$npm_config_prefix" != "x" ]; then
|
||||
PREFIXES=$npm_config_prefix
|
||||
else
|
||||
node="$NODE"
|
||||
if [ "x$node" = "x" ]; then
|
||||
node=`which node`
|
||||
fi
|
||||
if [ "x$node" = "x" ]; then
|
||||
echo "Can't find node to determine prefix. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
PREFIX=`dirname $node`
|
||||
PREFIX=`dirname $PREFIX`
|
||||
echo "cleanup prefix=$PREFIX"
|
||||
PREFIXES=$PREFIX
|
||||
|
||||
altprefix=`"$node" -e process.installPrefix`
|
||||
if [ "x$altprefix" != "x" ] && [ "x$altprefix" != "x$PREFIX" ]; then
|
||||
echo "altprefix=$altprefix"
|
||||
PREFIXES="$PREFIX $altprefix"
|
||||
fi
|
||||
fi
|
||||
|
||||
# now prefix is where npm would be rooted by default
|
||||
# go hunting.
|
||||
|
||||
packages=
|
||||
for prefix in $PREFIXES; do
|
||||
packages="$packages
|
||||
"`ls "$prefix"/lib/node/.npm 2>/dev/null | grep -v .cache`
|
||||
done
|
||||
|
||||
packages=`echo $packages`
|
||||
|
||||
filelist=()
|
||||
fid=0
|
||||
|
||||
for prefix in $PREFIXES; do
|
||||
# remove any links into the .npm dir, or links to
|
||||
# version-named shims/symlinks.
|
||||
for folder in share/man bin lib/node; do
|
||||
find $prefix/$folder -type l | while read file; do
|
||||
target=`$readlink $file | grep '/\.npm/'`
|
||||
if [ "x$target" != "x" ]; then
|
||||
# found one!
|
||||
filelist[$fid]="$file"
|
||||
let 'fid++'
|
||||
# also remove any symlinks to this file.
|
||||
base=`basename "$file"`
|
||||
base=`echo "$base" | awk -F@ '{print $1}'`
|
||||
if [ "x$base" != "x" ]; then
|
||||
find "`dirname $file`" -type l -name "$base"'*' \
|
||||
| while read l; do
|
||||
target=`$readlink "$l" | grep "$base"`
|
||||
if [ "x$target" != "x" ]; then
|
||||
filelist[$fid]="$1"
|
||||
let 'fid++'
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Scour for shim files. These are relics of 0.2 npm installs.
|
||||
# note: grep -r is not portable.
|
||||
find $prefix/$folder -type f \
|
||||
| xargs grep -sl '// generated by npm' \
|
||||
| while read file; do
|
||||
filelist[$fid]="$file"
|
||||
let 'fid++'
|
||||
done
|
||||
done
|
||||
|
||||
# now remove the package modules, and the .npm folder itself.
|
||||
if [ "x$packages" != "x" ]; then
|
||||
for pkg in $packages; do
|
||||
filelist[$fid]="$prefix/lib/node/$pkg"
|
||||
let 'fid++'
|
||||
for i in $prefix/lib/node/$pkg\@*; do
|
||||
filelist[$fid]="$i"
|
||||
let 'fid++'
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
for folder in lib/node/.npm lib/npm share/npm; do
|
||||
if [ -d $prefix/$folder ]; then
|
||||
filelist[$fid]="$prefix/$folder"
|
||||
let 'fid++'
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# now actually clean, but only if there's anything TO clean
|
||||
if [ "${#filelist[@]}" -gt 0 ]; then
|
||||
echo ""
|
||||
echo "This script will find and eliminate any shims, symbolic"
|
||||
echo "links, and other cruft that was installed by npm 0.x."
|
||||
echo ""
|
||||
|
||||
if [ "x$packages" != "x" ]; then
|
||||
echo "The following packages appear to have been installed with"
|
||||
echo "an old version of npm, and will be removed forcibly:"
|
||||
for pkg in $packages; do
|
||||
echo " $pkg"
|
||||
done
|
||||
echo "Make a note of these. You may want to install them"
|
||||
echo "with npm 1.0 when this process is completed."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
OK=
|
||||
if [ "x$1" = "x-y" ]; then
|
||||
OK="yes"
|
||||
fi
|
||||
|
||||
while [ "$OK" != "y" ] && [ "$OK" != "yes" ] && [ "$OK" != "no" ]; do
|
||||
echo "Is this OK?"
|
||||
echo " enter 'yes' or 'no'"
|
||||
echo " or 'show' to see a list of files "
|
||||
read OK
|
||||
if [ "x$OK" = "xshow" ] || [ "x$OK" = "xs" ]; then
|
||||
for i in "${filelist[@]}"; do
|
||||
echo "$i"
|
||||
done
|
||||
fi
|
||||
done
|
||||
if [ "$OK" = "no" ]; then
|
||||
echo "Aborting"
|
||||
exit 1
|
||||
fi
|
||||
for i in "${filelist[@]}"; do
|
||||
rm -rf "$i"
|
||||
done
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo 'All clean!'
|
||||
|
||||
exit 0
|
7
website/node_modules/npm/scripts/dep-update
generated
vendored
Normal file
7
website/node_modules/npm/scripts/dep-update
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
node . install --save $1@$2 &&\
|
||||
node scripts/gen-dev-ignores.js &&\
|
||||
git add node_modules package.json package-lock.json &&\
|
||||
git commit -m"$1@$2" &&\
|
||||
node . repo $1 &&\
|
||||
git commit --amend
|
7
website/node_modules/npm/scripts/dev-dep-update
generated
vendored
Normal file
7
website/node_modules/npm/scripts/dev-dep-update
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
node . install --save --save-dev $1@$2 &&\
|
||||
node scripts/gen-dev-ignores.js &&\
|
||||
git add package.json package-lock.json &&\
|
||||
git commit -m"$1@$2" &&\
|
||||
node . repo $1 &&\
|
||||
git commit --amend
|
67
website/node_modules/npm/scripts/doc-build.sh
generated
vendored
Normal file
67
website/node_modules/npm/scripts/doc-build.sh
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $DEBUG != "" ]]; then
|
||||
set -x
|
||||
fi
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
src=$1
|
||||
dest=$2
|
||||
name=$(basename ${src%.*})
|
||||
date=$(date -u +'%Y-%m-%d %H:%M:%S')
|
||||
version=$(node bin/npm-cli.js -v)
|
||||
|
||||
mkdir -p $(dirname $dest)
|
||||
|
||||
html_replace_tokens () {
|
||||
local url=$1
|
||||
sed "s|@NAME@|$name|g" \
|
||||
| sed "s|@DATE@|$date|g" \
|
||||
| sed "s|@URL@|$url|g" \
|
||||
| sed "s|@VERSION@|$version|g" \
|
||||
| perl -p -e 's/<h1([^>]*)>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\2<\/h1> <p>\3<\/p>/g' \
|
||||
| perl -p -e 's/npm-npm/npm/g' \
|
||||
| perl -p -e 's/([^"-])(npm-)?README(?!\.html)(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
|
||||
| perl -p -e 's/<title><a href="[^"]+README.html">README<\/a><\/title>/<title>README<\/title>/g' \
|
||||
| perl -p -e 's/([^"-])([^\(> ]+)(\(1\))/\1<a href="..\/cli\/\2.html">\2\3<\/a>/g' \
|
||||
| perl -p -e 's/([^"-])([^\(> ]+)(\(3\))/\1<a href="..\/api\/\2.html">\2\3<\/a>/g' \
|
||||
| perl -p -e 's/([^"-])([^\(> ]+)(\(5\))/\1<a href="..\/files\/\2.html">\2\3<\/a>/g' \
|
||||
| perl -p -e 's/([^"-])([^\(> ]+)(\(7\))/\1<a href="..\/misc\/\2.html">\2\3<\/a>/g' \
|
||||
| perl -p -e 's/\([1357]\)<\/a><\/h1>/<\/a><\/h1>/g' \
|
||||
| (if [ $(basename $(dirname $dest)) == "doc" ]; then
|
||||
perl -p -e 's/ href="\.\.\// href="/g'
|
||||
else
|
||||
cat
|
||||
fi)
|
||||
}
|
||||
|
||||
man_replace_tokens () {
|
||||
sed "s|@VERSION@|$version|g" \
|
||||
| perl -p -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(1\)/npm help \2/g' \
|
||||
| perl -p -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(([57])\)/npm help \3 \2/g' \
|
||||
| perl -p -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(3\)/npm apihelp \2/g' \
|
||||
| perl -p -e 's/npm\(1\)/npm help npm/g' \
|
||||
| perl -p -e 's/npm\(3\)/npm apihelp npm/g'
|
||||
}
|
||||
|
||||
case $dest in
|
||||
*.[1357])
|
||||
./node_modules/.bin/marked-man --roff $src \
|
||||
| man_replace_tokens > $dest
|
||||
exit $?
|
||||
;;
|
||||
*.html)
|
||||
url=${dest/html\//}
|
||||
(cat html/dochead.html && \
|
||||
cat $src | ./node_modules/.bin/marked &&
|
||||
cat html/docfoot.html)\
|
||||
| html_replace_tokens $url \
|
||||
> $dest
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
echo "Invalid destination type: $dest" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
7
website/node_modules/npm/scripts/gen-changelog
generated
vendored
Normal file
7
website/node_modules/npm/scripts/gen-changelog
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Usage: gen-changelog [comittish]
|
||||
# Reads all the commits since comittish and produces changelog entries in
|
||||
# our style as best as it can, appendning them to CHANGELOG.md. If it
|
||||
# encounters a git error it won't modify CHANGELOG.md
|
||||
# @iarna uses this as the first step in producing changelogs for a release.
|
||||
(node $(npm prefix)/scripts/changelog.js "$@"; cat CHANGELOG.md) > new.md && mv new.md CHANGELOG.md
|
5
website/node_modules/npm/scripts/gen-dev-ignores.js
generated
vendored
Normal file
5
website/node_modules/npm/scripts/gen-dev-ignores.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
const fs = require('fs')
|
||||
const plock = require('../package-lock.json')
|
||||
fs.writeFileSync(`${__dirname}/../node_modules/.gitignore`,
|
||||
'## Automatically generated dev dependency ignores\n' +
|
||||
Object.keys(plock.dependencies).filter(_ => plock.dependencies[_].dev).map(_ => `/${_}`).join('\n') + '\n')
|
58
website/node_modules/npm/scripts/index-build.js
generated
vendored
Normal file
58
website/node_modules/npm/scripts/index-build.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env node
|
||||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var root = path.resolve(__dirname, '..')
|
||||
var glob = require('glob')
|
||||
var conversion = { 'cli': 1, 'api': 3, 'files': 5, 'misc': 7 }
|
||||
|
||||
glob(root + '/{README.md,doc/*/*.md}', function (er, files) {
|
||||
if (er) throw er
|
||||
|
||||
output(files.map(function (f) {
|
||||
var b = path.basename(f)
|
||||
if (b === 'README.md') return [0, b]
|
||||
if (b === 'index.md') return null
|
||||
var s = conversion[path.basename(path.dirname(f))]
|
||||
return [s, f]
|
||||
}).filter(function (f) {
|
||||
return f
|
||||
}).sort(function (a, b) {
|
||||
return (a[0] === b[0])
|
||||
? (path.basename(a[1]) === 'npm.md' ? -1
|
||||
: path.basename(b[1]) === 'npm.md' ? 1
|
||||
: a[1] > b[1] ? 1 : -1)
|
||||
: a[0] - b[0]
|
||||
}))
|
||||
})
|
||||
|
||||
function output (files) {
|
||||
console.log(
|
||||
'npm-index(7) -- Index of all npm documentation\n' +
|
||||
'==============================================\n')
|
||||
|
||||
writeLines(files, 0)
|
||||
writeLines(files, 1, 'Command Line Documentation', 'Using npm on the command line')
|
||||
writeLines(files, 3, 'API Documentation', 'Using npm in your Node programs')
|
||||
writeLines(files, 5, 'Files', 'File system structures npm uses')
|
||||
writeLines(files, 7, 'Misc', 'Various other bits and bobs')
|
||||
}
|
||||
|
||||
function writeLines (files, sxn, heading, desc) {
|
||||
if (heading) {
|
||||
console.log('## %s\n\n%s\n', heading, desc)
|
||||
}
|
||||
files.filter(function (f) {
|
||||
return f[0] === sxn
|
||||
}).forEach(writeLine)
|
||||
}
|
||||
|
||||
function writeLine (sd) {
|
||||
var sxn = sd[0] || 1
|
||||
var doc = sd[1]
|
||||
var d = path.basename(doc, '.md')
|
||||
|
||||
var content = fs.readFileSync(doc, 'utf8').split('\n')[0].split('-- ')[1]
|
||||
|
||||
console.log('### %s(%d)\n', d, sxn)
|
||||
console.log(content + '\n')
|
||||
}
|
241
website/node_modules/npm/scripts/install.sh
generated
vendored
Normal file
241
website/node_modules/npm/scripts/install.sh
generated
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
#!/bin/sh
|
||||
|
||||
# A word about this shell script:
|
||||
#
|
||||
# It must work everywhere, including on systems that lack
|
||||
# a /bin/bash, map 'sh' to ksh, ksh97, bash, ash, or zsh,
|
||||
# and potentially have either a posix shell or bourne
|
||||
# shell living at /bin/sh.
|
||||
#
|
||||
# See this helpful document on writing portable shell scripts:
|
||||
# https://www.gnu.org/s/hello/manual/autoconf/Portable-Shell.html
|
||||
#
|
||||
# The only shell it won't ever work on is cmd.exe.
|
||||
|
||||
if [ "x$0" = "xsh" ]; then
|
||||
# run as curl | sh
|
||||
# on some systems, you can just do cat>npm-install.sh
|
||||
# which is a bit cuter. But on others, &1 is already closed,
|
||||
# so catting to another script file won't do anything.
|
||||
# Follow Location: headers, and fail on errors
|
||||
curl -f -L -s https://www.npmjs.org/install.sh > npm-install-$$.sh
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
(exit 0)
|
||||
else
|
||||
rm npm-install-$$.sh
|
||||
echo "Failed to download script" >&2
|
||||
exit $ret
|
||||
fi
|
||||
sh npm-install-$$.sh
|
||||
ret=$?
|
||||
rm npm-install-$$.sh
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
# See what "npm_config_*" things there are in the env,
|
||||
# and make them permanent.
|
||||
# If this fails, it's not such a big deal.
|
||||
configures="`env | grep 'npm_config_' | sed -e 's|^npm_config_||g'`"
|
||||
|
||||
npm_config_loglevel="error"
|
||||
if [ "x$npm_debug" = "x" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
echo "Running in debug mode."
|
||||
echo "Note that this requires bash or zsh."
|
||||
set -o xtrace
|
||||
set -o pipefail
|
||||
npm_config_loglevel="verbose"
|
||||
fi
|
||||
export npm_config_loglevel
|
||||
|
||||
# make sure that node exists
|
||||
node=`which node 2>&1`
|
||||
ret=$?
|
||||
# if not found, try "nodejs" as it is the case on debian
|
||||
if [ $ret -ne 0 ]; then
|
||||
node=`which nodejs 2>&1`
|
||||
ret=$?
|
||||
fi
|
||||
if [ $ret -eq 0 ] && [ -x "$node" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
echo "npm cannot be installed without node.js." >&2
|
||||
echo "Install node first, and then try again." >&2
|
||||
echo "" >&2
|
||||
echo "Maybe node is installed, but not in the PATH?" >&2
|
||||
echo "Note that running as sudo can change envs." >&2
|
||||
echo ""
|
||||
echo "PATH=$PATH" >&2
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
# set the temp dir
|
||||
TMP="${TMPDIR}"
|
||||
if [ "x$TMP" = "x" ]; then
|
||||
TMP="/tmp"
|
||||
fi
|
||||
TMP="${TMP}/npm.$$"
|
||||
rm -rf "$TMP" || true
|
||||
mkdir "$TMP"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "failed to mkdir $TMP" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BACK="$PWD"
|
||||
|
||||
ret=0
|
||||
tar="${TAR}"
|
||||
if [ -z "$tar" ]; then
|
||||
tar="${npm_config_tar}"
|
||||
fi
|
||||
if [ -z "$tar" ]; then
|
||||
tar=`which tar 2>&1`
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
if [ $ret -eq 0 ] && [ -x "$tar" ]; then
|
||||
echo "tar=$tar"
|
||||
echo "version:"
|
||||
$tar --version
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
(exit 0)
|
||||
else
|
||||
echo "No suitable tar program found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Try to find a suitable make
|
||||
# If the MAKE environment var is set, use that.
|
||||
# otherwise, try to find gmake, and then make.
|
||||
# If no make is found, then just execute the necessary commands.
|
||||
|
||||
# XXX For some reason, make is building all the docs every time. This
|
||||
# is an annoying source of bugs. Figure out why this happens.
|
||||
MAKE=NOMAKE
|
||||
|
||||
if [ "x$MAKE" = "x" ]; then
|
||||
make=`which gmake 2>&1`
|
||||
if [ $? -eq 0 ] && [ -x "$make" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
make=`which make 2>&1`
|
||||
if [ $? -eq 0 ] && [ -x "$make" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
make=NOMAKE
|
||||
fi
|
||||
fi
|
||||
else
|
||||
make="$MAKE"
|
||||
fi
|
||||
|
||||
if [ -x "$make" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
# echo "Installing without make. This may fail." >&2
|
||||
make=NOMAKE
|
||||
fi
|
||||
|
||||
# If there's no bash, then don't even try to clean
|
||||
if [ -x "/bin/bash" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
clean="no"
|
||||
fi
|
||||
|
||||
node_version=`"$node" --version 2>&1`
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "You need node to run this program." >&2
|
||||
echo "node --version reports: $node_version" >&2
|
||||
echo "with exit code = $ret" >&2
|
||||
echo "Please install node before continuing." >&2
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
t="${npm_install}"
|
||||
if [ -z "$t" ]; then
|
||||
# switch based on node version.
|
||||
# note that we can only use strict sh-compatible patterns here.
|
||||
case $node_version in
|
||||
0.[01234567].* | v0.[01234567].*)
|
||||
echo "You are using an outdated and unsupported version of" >&2
|
||||
echo "node ($node_version). Please update node and try again." >&2
|
||||
exit 99
|
||||
;;
|
||||
*)
|
||||
echo "install npm@latest"
|
||||
t="latest"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# need to echo "" after, because Posix sed doesn't treat EOF
|
||||
# as an implied end of line.
|
||||
url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \
|
||||
| sed -e 's/^.*tarball":"//' \
|
||||
| sed -e 's/".*$//'`
|
||||
|
||||
ret=$?
|
||||
if [ "x$url" = "x" ]; then
|
||||
ret=125
|
||||
# try without the -e arg to sed.
|
||||
url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \
|
||||
| sed 's/^.*tarball":"//' \
|
||||
| sed 's/".*$//'`
|
||||
ret=$?
|
||||
if [ "x$url" = "x" ]; then
|
||||
ret=125
|
||||
fi
|
||||
fi
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "Failed to get tarball url for npm/$t" >&2
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
|
||||
echo "fetching: $url" >&2
|
||||
|
||||
cd "$TMP" \
|
||||
&& curl -SsL "$url" \
|
||||
| $tar -xzf - \
|
||||
&& cd "$TMP"/* \
|
||||
&& (ret=0
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "Aborted 0.x cleanup. Exiting." >&2
|
||||
exit $ret
|
||||
fi) \
|
||||
&& (if [ "x$configures" = "x" ]; then
|
||||
(exit 0)
|
||||
else
|
||||
echo "./configure $configures"
|
||||
echo "$configures" > npmrc
|
||||
fi) \
|
||||
&& (if [ "$make" = "NOMAKE" ]; then
|
||||
(exit 0)
|
||||
elif "$make" uninstall install; then
|
||||
(exit 0)
|
||||
else
|
||||
make="NOMAKE"
|
||||
fi
|
||||
if [ "$make" = "NOMAKE" ]; then
|
||||
"$node" bin/npm-cli.js rm npm -gf
|
||||
"$node" bin/npm-cli.js install -gf $("$node" bin/npm-cli.js pack | tail -1)
|
||||
fi) \
|
||||
&& cd "$BACK" \
|
||||
&& rm -rf "$TMP" \
|
||||
&& echo "It worked"
|
||||
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "It failed" >&2
|
||||
fi
|
||||
exit $ret
|
93
website/node_modules/npm/scripts/maketest
generated
vendored
Normal file
93
website/node_modules/npm/scripts/maketest
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict'
|
||||
const loadFromDir = require('tacks/load-from-dir.js')
|
||||
|
||||
process.exit(main(process.argv.slice(2)))
|
||||
|
||||
function main (argv) {
|
||||
if (argv.length !== 1) {
|
||||
console.error('Usage: maketest <fixturedir>')
|
||||
return 1
|
||||
}
|
||||
const fixturedir = process.argv[2]
|
||||
|
||||
console.log(generateFromDir(fixturedir))
|
||||
return 0
|
||||
}
|
||||
|
||||
function indent (ind, str) {
|
||||
return str.replace(/\n/g, '\n' + ind)
|
||||
}
|
||||
|
||||
function generateFromDir (dir) {
|
||||
const tacks = loadFromDir(dir)
|
||||
return `'use strict'
|
||||
const path = require('path')
|
||||
const test = require('tap').test
|
||||
const mr = require('npm-registry-mock')
|
||||
const Tacks = require('tacks')
|
||||
const File = Tacks.File
|
||||
const Symlink = Tacks.Symlink
|
||||
const Dir = Tacks.Dir
|
||||
const common = require('../common-tap.js')
|
||||
|
||||
const basedir = path.join(__dirname, path.basename(__filename, '.js'))
|
||||
const testdir = path.join(basedir, 'testdir')
|
||||
const cachedir = path.join(basedir, 'cache')
|
||||
const globaldir = path.join(basedir, 'global')
|
||||
const tmpdir = path.join(basedir, 'tmp')
|
||||
|
||||
const conf = {
|
||||
cwd: testdir,
|
||||
env: Object.assign({}, process.env, {
|
||||
npm_config_cache: cachedir,
|
||||
npm_config_tmp: tmpdir,
|
||||
npm_config_prefix: globaldir,
|
||||
npm_config_registry: common.registry,
|
||||
npm_config_loglevel: 'warn'
|
||||
})
|
||||
}
|
||||
|
||||
let server
|
||||
const fixture = new Tacks(Dir({
|
||||
cache: Dir(),
|
||||
global: Dir(),
|
||||
tmp: Dir(),
|
||||
testdir: ${indent(' ', tacks.fixture.toSource())}
|
||||
}))
|
||||
|
||||
function setup () {
|
||||
cleanup()
|
||||
fixture.create(basedir)
|
||||
}
|
||||
|
||||
function cleanup () {
|
||||
fixture.remove(basedir)
|
||||
}
|
||||
|
||||
test('setup', function (t) {
|
||||
setup()
|
||||
mr({port: common.port, throwOnUnmatched: true}, function (err, s) {
|
||||
if (err) throw err
|
||||
server = s
|
||||
t.done()
|
||||
})
|
||||
})
|
||||
|
||||
test('example', function (t) {
|
||||
common.npm(['install'], conf, function (err, code, stdout, stderr) {
|
||||
if (err) throw err
|
||||
t.is(code, 0, 'command ran ok')
|
||||
t.comment(stdout.trim())
|
||||
t.comment(stderr.trim())
|
||||
// your assertions here
|
||||
t.done()
|
||||
})
|
||||
})
|
||||
|
||||
test('cleanup', function (t) {
|
||||
server.close()
|
||||
cleanup()
|
||||
t.done()
|
||||
})\n`
|
||||
}
|
3
website/node_modules/npm/scripts/publish-tag.js
generated
vendored
Normal file
3
website/node_modules/npm/scripts/publish-tag.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var semver = require('semver')
|
||||
var version = semver.parse(require('../package.json').version)
|
||||
console.log('v%s.%s-next', version.major, version.minor)
|
39
website/node_modules/npm/scripts/release.sh
generated
vendored
Normal file
39
website/node_modules/npm/scripts/release.sh
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script for creating a zip and tarball for inclusion in node
|
||||
|
||||
unset CDPATH
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf release *.tgz || true
|
||||
mkdir release
|
||||
node ./bin/npm-cli.js pack --loglevel error >/dev/null
|
||||
mv *.tgz release
|
||||
cd release
|
||||
tar xzf *.tgz
|
||||
cp -r ../test package/
|
||||
|
||||
mkdir node_modules
|
||||
mv package node_modules/npm
|
||||
|
||||
# make the zip for windows users
|
||||
cp node_modules/npm/bin/*.cmd .
|
||||
zipname=npm-$(node ../bin/npm-cli.js -v).zip
|
||||
zip -q -9 -r -X "$zipname" *.cmd node_modules
|
||||
|
||||
# make the tar for node's deps
|
||||
cd node_modules
|
||||
tarname=npm-$(node ../../bin/npm-cli.js -v).tgz
|
||||
tar czf "$tarname" npm
|
||||
|
||||
cd ..
|
||||
mv "node_modules/$tarname" .
|
||||
|
||||
rm -rf *.cmd
|
||||
rm -rf node_modules
|
||||
|
||||
cd ..
|
||||
|
||||
echo "release/$tarname"
|
||||
echo "release/$zipname"
|
26
website/node_modules/npm/scripts/relocate.sh
generated
vendored
Normal file
26
website/node_modules/npm/scripts/relocate.sh
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Change the cli shebang to point at the specified node
|
||||
# Useful for when the program is moved around after install.
|
||||
# Also used by the default 'make install' in node to point
|
||||
# npm at the newly installed node, rather than the first one
|
||||
# in the PATH, which would be the default otherwise.
|
||||
|
||||
# bash /path/to/npm/scripts/relocate.sh $nodepath
|
||||
# If $nodepath is blank, then it'll use /usr/bin/env
|
||||
|
||||
dir="$(dirname "$(dirname "$0")")"
|
||||
cli="$dir"/bin/npm-cli.js
|
||||
tmp="$cli".tmp
|
||||
|
||||
node="$1"
|
||||
if [ "x$node" = "x" ]; then
|
||||
node="/usr/bin/env node"
|
||||
fi
|
||||
node="#!$node"
|
||||
|
||||
sed -e 1d "$cli" > "$tmp"
|
||||
echo "$node" > "$cli"
|
||||
cat "$tmp" >> "$cli"
|
||||
rm "$tmp"
|
||||
chmod ogu+x $cli
|
9
website/node_modules/npm/scripts/update-authors.sh
generated
vendored
Normal file
9
website/node_modules/npm/scripts/update-authors.sh
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
git log --reverse --format='%aN <%aE>' | perl -wnE '
|
||||
BEGIN {
|
||||
say "# Authors sorted by whether or not they\x27re me";
|
||||
}
|
||||
|
||||
print $seen{$_} = $_ unless $seen{$_}
|
||||
' > AUTHORS
|
Reference in New Issue
Block a user