REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.00 KB
Close
//usr/lib/node_modules/npm/scripts/changelog.js
Text
Base64
'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}` } }) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 15
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
changelog.js
3.00 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
clean-old.sh
4.17 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dep-update
294 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dev-dep-update
292 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
docs-build.js
825 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
gen-changelog
420 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
gen-dev-ignores.js
350 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
install.sh
5.47 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
maketest
1.80 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pr
3.96 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
publish-tag.js
151 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
release.sh
889 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
relocate.sh
673 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
update-authors.sh
197 B
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
update-dist-tags.js
3.46 KB
lrw-r--r--
2021-03-10 14:36:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).