Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
colors.cyan('package.json.')
);
const verifyTreeCmd = yarnExecutable + ' check --verify-tree';
exec(verifyTreeCmd);
log('Running', colors.cyan('yarn'), 'to update packages...');
/**
* NOTE: executing yarn with --production=false prevents having
* NODE_ENV=production variable set which forces yarn to not install
* devDependencies. This usually breaks gulp for example.
*/
execOrDie(`${yarnExecutable} install --production=false`); // Stop execution when Ctrl + C is detected.
} else {
log(
colors.green('All packages in'),
colors.cyan('node_modules'),
colors.green('are up to date.')
);
}
}
const isOK = condition => {
if(condition === undefined){
return acolors.yellow('[SKIPPED]');
}
return condition ? acolors.green('[OK]') : acolors.red('[KO]');
};
gulp.task('release', (cb) => {
fancyLog('# Performing Pre-Release Checks...');
if (!readyToRelease()) {
fancyLog(acolors.red('# Pre-Release Checks have failed. Please fix them and try again. Aborting...'));
cb();
}
else {
fancyLog(acolors.green('# Pre-Release Checks have succeeded. Continuing...'));
runSequence(
'bump-version',
'changelog',
'commit-changes',
'push-changes',
'create-new-tag',
'github-release',
'npm-publish',
'deploy:demo',
(error) => {
if (error) {
fancyLog(acolors.red(error.message));
} else {
fancyLog(acolors.green('RELEASE FINISHED SUCCESSFULLY'));
}
cb(error);
function getEventColor(event) {
if (event === 'change') {
return chalk.yellow('CHANGED:');
} else if (event === 'add' || event === 'addDir') {
return chalk.green('ADDED:');
} else if (event === 'unlink' || event === 'unlinkDir') {
return chalk.red('REMOVED:');
}
}
const isOK = condition => {
if(condition === undefined){
return acolors.yellow('[SKIPPED]');
}
return condition ? acolors.green('[OK]') : acolors.red('[KO]');
};
fs.readFile(entrypoint).then((buffer) => {
const timePassed = timer.stop();
const code = buffer.toString();
Console.log(`${chalk.green('BUILT AMD MODULE:')} ${moduleName} in ${formatTimePassed(timePassed)} [${formatSize(code.length)}]`);
resolve(code);
}).catch((error) => reject(error));
});
private format(level, ...args) {
let pad = (s, l, c='') => {
return s + Array( Math.max(0, l - s.length + 1)).join( c )
};
let msg = args.join(' ');
if(args.length > 1) {
msg = `${ pad(args.shift(), 13, ' ') }: ${ args.join(' ') }`;
}
switch(level) {
case LEVEL.INFO:
msg = c.green(msg);
break;
case LEVEL.WARN:
msg = c.yellow(msg);
break;
case LEVEL.DEBUG:
msg = c.gray(msg);
break;
case LEVEL.ERROR:
case LEVEL.FATAL:
msg = c.red(msg);
break;
}
.on('finish', function () {
log.info('Done', colors.green(name), 'in', first ? (Date.now() - first) / 1000 : '?', 's');
})
.on('error', function (err) {
async function changelog() {
if (!GITHUB_ACCESS_TOKEN) {
log(
colors.red(
'Warning! You have not set the ' +
'GITHUB_ACCESS_TOKEN env var. Aborting "changelog" task.'
)
);
log(
colors.green(
'See https://help.github.com/articles/' +
'creating-an-access-token-for-command-line-use/ ' +
'for instructions on how to create a github access token. We only ' +
'need `public_repo` scope.'
)
);
return;
}
return getGitMetadata();
}
logMessage(name, message) {
log(colors.cyan(name), colors.green(message));
notify(`${this.dirName} gulp ${name}`, message, false);
}
};