#379: remove package-lock.json and switch vendor dll to track yarn.lock

This commit is contained in:
SleepWalker 2017-12-30 21:52:33 +02:00
parent 4458b1fe97
commit b19eeb9e94
2 changed files with 36 additions and 11752 deletions

11716
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,10 +11,10 @@ const webpackConfig = require('../webpack.dll.config.js');
const compiler = webpack(webpackConfig); const compiler = webpack(webpackConfig);
Promise.all([ Promise.all([
stat(__dirname + '/../package-lock.json'), stat(`${__dirname}/../yarn.lock`),
stat(__dirname + '/../dll/vendor.json') stat(`${__dirname}/../dll/vendor.json`)
]) ])
.then(function(stats) { .then((stats) => {
const lockFile = new Date(stats[0].mtime); const lockFile = new Date(stats[0].mtime);
const dll = new Date(stats[1].mtime); const dll = new Date(stats[1].mtime);
@ -25,16 +25,16 @@ Promise.all([
} }
logResult(chalk.green('Current dlls are up to date!')); logResult(chalk.green('Current dlls are up to date!'));
}) })
.catch(function(err) { .catch((err) => {
if (err.code !== 'ENOENT' && err.code !== 'OUTDATED') { if (err.code !== 'ENOENT' && err.code !== 'OUTDATED') {
return Promise.reject(err); return Promise.reject(err);
} }
console.log('Rebuilding dlls...'); console.log('Rebuilding dlls...');
return new Promise(function(resolve, reject) { return new Promise(((resolve, reject) => {
compiler.run(function(err, stats) { compiler.run((err, stats) => {
if (err) { if (err) {
return reject(err); return reject(err);
} }
@ -46,12 +46,12 @@ Promise.all([
resolve(); resolve();
}); });
}); }));
}) })
.catch(function(err) { .catch((err) => {
logResult(chalk.red('Unexpected error checking dll state'), err); logResult(chalk.red('Unexpected error checking dll state'), err);
process.exit(1); process.exit(1);
}); });
function logResult() { function logResult() {
console.log('\n'); console.log('\n');
@ -60,9 +60,9 @@ function logResult() {
} }
function stat(path) { function stat(path) {
return new Promise(function(resolve, reject) { return new Promise(((resolve, reject) => {
fs.stat(path, function(err, stats) { fs.stat(path, (err, stats) => {
err ? reject(err) : resolve(stats); err ? reject(err) : resolve(stats);
}); });
}); }));
} }