Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const requireNodeVersion = pkg.get('engines.node');
const minNodeVersion = requireNodeVersion
? semverUtils.parseRange(requireNodeVersion)[0].major
: latestNodeVersion;
// Only LTS or latest
const nodeVersions = range(minNodeVersion, latestNodeVersion + 1).filter(
ver => ver % 2 === 0 || ver === latestNodeVersion
);
travisYml.set('node_js', nodeVersions);
travisYml.save();
// Add Travis package badge to Readme
const url = `https://travis-ci.org/${github}/${pkg.get('name')}`;
markdown(readmeFile).addBadge(`${url}.svg`, url, 'Build Status').save();
console.log(`
1. Activate your repository on Travis CI:
${url}
2. Commit and push your changes
`);
}
);
}
// .travis.yml
if (!travisYml.get('after_success', []).includes(uploadCommand)) {
travisYml
.merge({
script: [`npm run ${coverageScript}`],
after_success: [uploadCommand],
})
.save();
}
// Add Codecov badge to Readme
const url = `https://codecov.io/gh/${github}/${pkg.get('name')}`;
markdown(readme).addBadge(`${url}/branch/master/graph/badge.svg`, url, 'Codecov').save();
}
after_success: [
`npm install -g semantic-release`,
'semantic-release pre && npm publish && semantic-release post',
],
branches: {
except: ['/^v\\d+\\.\\d+\\.\\d+$/'],
},
})
.save();
// Add Changelog.md to .gitignore
lines('.gitignore').add(config('changelog', 'Changelog.md')).save();
// Add npm package version badge to Readme.md
const name = pkg.get('name');
const readme = markdown(config('readme', 'Readme.md'));
if (readme.exists()) {
readme
.addBadge(
`https://img.shields.io/npm/v/${name}.svg`,
`https://www.npmjs.com/package/${name}`,
'npm'
)
.save();
}
// Dependencies
uninstall(PACKAGE_NAME);
};
module.exports.description = 'Adds semantic-release';