"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scripts/bundle-and-gitignore-deps.js" between
npm-cli-7.16.0.tar.gz and npm-cli-7.17.0.tar.gz

About: npm is a JavaScript package manager (requires node v6 or higher).

bundle-and-gitignore-deps.js  (npm-cli-7.16.0):bundle-and-gitignore-deps.js  (npm-cli-7.17.0)
skipping to change at line 12 skipping to change at line 12
const { resolve } = require('path') const { resolve } = require('path')
const ignore = resolve(__dirname, '../node_modules/.gitignore') const ignore = resolve(__dirname, '../node_modules/.gitignore')
const { writeFileSync } = require('fs') const { writeFileSync } = require('fs')
const pj = resolve(__dirname, '../package.json') const pj = resolve(__dirname, '../package.json')
const pkg = require(pj) const pkg = require(pj)
const bundle = [] const bundle = []
const arb = new Arborist({ path: resolve(__dirname, '..') }) const arb = new Arborist({ path: resolve(__dirname, '..') })
const shouldIgnore = [] const shouldIgnore = []
arb.loadVirtual().then(tree => { arb.loadVirtual().then(tree => {
for (const [name, node] of tree.children.entries()) { for (const node of tree.children.values()) {
if (node.dev || node.isLink) { if (node.dev || node.isLink) {
console.error('ignore', node.name) console.error('ignore', node.name)
shouldIgnore.push(node.name) shouldIgnore.push(node.name)
} else if (tree.edgesOut.has(node.name)) { } else if (tree.edgesOut.has(node.name)) {
console.error('BUNDLE', node.name) console.error('BUNDLE', node.name)
bundle.push(node.name) bundle.push(node.name)
} }
} }
pkg.bundleDependencies = bundle.sort((a, b) => a.localeCompare(b, 'en')) pkg.bundleDependencies = bundle.sort((a, b) => a.localeCompare(b, 'en'))
const ignores = shouldIgnore.sort((a, b) => a.localeCompare(b, 'en')) const ignores = shouldIgnore.sort((a, b) => a.localeCompare(b, 'en'))
.map(i => `/${i}`) .map(i => `/${i}`)
.join('\n') .join('\n')
const ignoreData = `# Automatically generated to ignore dev deps const ignoreData = `# Automatically generated to ignore dev deps
/.package-lock.json /.package-lock.json
package-lock.json package-lock.json
CHANGELOG*
README*
.editorconfig
.idea/
.npmignore
.eslintrc*
.travis*
.github
.jscsrc
.nycrc
.istanbul*
.eslintignore
.jshintrc*
.prettierrc*
.jscs.json
.dir-locals*
.coveralls*
.babelrc*
.nyc_output
.gitkeep
${ignores} ${ignores}
` `
writeFileSync(ignore, ignoreData) writeFileSync(ignore, ignoreData)
writeFileSync(pj, JSON.stringify(pkg, 0, 2) + '\n') writeFileSync(pj, JSON.stringify(pkg, 0, 2) + '\n')
}) })
 End of changes. 2 change blocks. 
1 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)