#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);
Promise.all([
stat(__dirname + '/../package-lock.json'),
stat(__dirname + '/../dll/vendor.json')
stat(`${__dirname}/../yarn.lock`),
stat(`${__dirname}/../dll/vendor.json`)
])
.then(function(stats) {
.then((stats) => {
const lockFile = new Date(stats[0].mtime);
const dll = new Date(stats[1].mtime);
@ -26,15 +26,15 @@ Promise.all([
logResult(chalk.green('Current dlls are up to date!'));
})
.catch(function(err) {
.catch((err) => {
if (err.code !== 'ENOENT' && err.code !== 'OUTDATED') {
return Promise.reject(err);
}
console.log('Rebuilding dlls...');
return new Promise(function(resolve, reject) {
compiler.run(function(err, stats) {
return new Promise(((resolve, reject) => {
compiler.run((err, stats) => {
if (err) {
return reject(err);
}
@ -46,9 +46,9 @@ Promise.all([
resolve();
});
});
}));
})
.catch(function(err) {
.catch((err) => {
logResult(chalk.red('Unexpected error checking dll state'), err);
process.exit(1);
});
@ -60,9 +60,9 @@ function logResult() {
}
function stat(path) {
return new Promise(function(resolve, reject) {
fs.stat(path, function(err, stats) {
return new Promise(((resolve, reject) => {
fs.stat(path, (err, stats) => {
err ? reject(err) : resolve(stats);
});
});
}));
}