Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createRelease(version, body) {
console.log(`Creating new Github release for v${version}`);
console.log(body);
// Connect to github
let github = new GitHubAPI();
github.authenticate(token);
github.repos.createRelease({
user: USER,
repo: REPO,
tag_name: `v${version}`,
body: body,
prerelease: semver.prerelease(version)?true:false,
}, (err,res) => {
if(err) {
console.log(err);
} else {
let id = res.id;
console.log('Uploading assets')
for(let asset of ASSETS) {
github.repos.uploadAsset({
user: USER,
repo: REPO,
id: id,
name: path.basename(asset),
filePath: asset,
});
}
return groups.map((group) => {
// only include changes from
const groupName = Object.keys(group)[0]
const relevantMonorepoChangeFiles = monorepo.filter(change => {
return group[groupName].packages.includes(change.value.filename)
})
const version = distTags[distTag]
if (semver.prerelease(version) && !semver.prerelease(relevantMonorepoChangeFiles[0].value.oldVersion)) {
log.info(`exited: ${dependency} ${version} is a prerelease on latest and user does not use prereleases`)
return
}
return {
data: Object.assign({
name: 'create-group-version-branch',
group,
version,
dependency,
dependencyUpdatedAt,
versions,
repositoryId,
oldVersionResolved,
installation: account.installation,
accountId: account.id || account._id,
types,
function prereleaseType(v) {
return semver.prerelease(v)[0];
}
function isMajorPrerelease(version) {
return (
semver.prerelease(version) &&
semver.minor(version) === 0 &&
semver.patch(version) === 0
);
}
getTag({ tag = DEFAULT_TAG, version, isPreRelease } = {}) {
if (!isPreRelease || !version || tag !== DEFAULT_TAG) {
return tag;
} else {
const preReleaseComponents = semver.prerelease(version);
return _.get(preReleaseComponents, 0, tag);
}
}
const args = require('minimist')(process.argv.slice(2))
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const semver = require('semver')
const currentVersion = require('../package.json').version
const { prompt } = require('enquirer')
const execa = require('execa')
const preId = args.preid || semver.prerelease(currentVersion)[0] || 'alpha'
const isDryRun = args.dry
const skipTests = args.skipTests
const skipBuild = args.skipBuild
const packages = fs
.readdirSync(path.resolve(__dirname, '../packages'))
.filter(p => !p.endsWith('.ts') && !p.startsWith('.'))
const skippedPackages = ['server-renderer']
const versionIncrements = [
'patch',
'minor',
'major',
'prepatch',
'preminor',
'premajor',
function isPrerelease(version){
const preRelComp = semver.prerelease(version)
return preRelComp != null && preRelComp.length > 0
}
function parseRange(range) {
var condition = regex.condition.exec(range)[1] || '=';
var version = regex.version.exec(range)[1];
var prerelease = semver.prerelease(version);
return { condition, prerelease, version };
}
function isPreRelease (version) {
return !!semver.prerelease(version)
}