mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
checkPlugin: Unconditionally run npm install
This commit is contained in:
parent
bba47ea2df
commit
b719affe6e
1 changed files with 10 additions and 21 deletions
|
@ -237,11 +237,6 @@ fs.readdir(pluginPath, (err, rootFiles) => {
|
||||||
hasAutoFixed = true;
|
hasAutoFixed = true;
|
||||||
parsedPackageJSON.devDependencies = Object.assign(devDependencies, lintDeps);
|
parsedPackageJSON.devDependencies = Object.assign(devDependencies, lintDeps);
|
||||||
writePackageJson(parsedPackageJSON);
|
writePackageJson(parsedPackageJSON);
|
||||||
try {
|
|
||||||
execSync('npm install', {stdio: 'inherit'});
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Failed to create package-lock.json: ${err.stack || err}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// include peer deps config
|
// include peer deps config
|
||||||
|
@ -254,12 +249,6 @@ fs.readdir(pluginPath, (err, rootFiles) => {
|
||||||
hasAutoFixed = true;
|
hasAutoFixed = true;
|
||||||
parsedPackageJSON.peerDependencies = peerDependencies;
|
parsedPackageJSON.peerDependencies = peerDependencies;
|
||||||
writePackageJson(parsedPackageJSON);
|
writePackageJson(parsedPackageJSON);
|
||||||
try {
|
|
||||||
execSync('npm install --no-save ep_etherpad-lite@file:../../src', {stdio: 'inherit'});
|
|
||||||
hasAutoFixed = true;
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Failed to create package-lock.json');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,16 +292,9 @@ fs.readdir(pluginPath, (err, rootFiles) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (files.indexOf('package-lock.json') === -1) {
|
if (files.indexOf('package-lock.json') === -1) {
|
||||||
console.warn('package-lock.json file not found.');
|
console.warn('package-lock.json not found');
|
||||||
|
if (!autoFix) {
|
||||||
console.warn('Run npm install in the plugin folder and commit the package-lock.json file.');
|
console.warn('Run npm install in the plugin folder and commit the package-lock.json file.');
|
||||||
if (autoFix) {
|
|
||||||
try {
|
|
||||||
execSync('npm install', {stdio: 'inherit'});
|
|
||||||
console.log('Making package-lock.json');
|
|
||||||
hasAutoFixed = true;
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Failed to create package-lock.json');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,6 +437,13 @@ fs.readdir(pluginPath, (err, rootFiles) => {
|
||||||
console.warn('Test files not found, please create tests. https://github.com/ether/etherpad-lite/wiki/Creating-a-plugin#writing-and-running-front-end-tests-for-your-plugin');
|
console.warn('Test files not found, please create tests. https://github.com/ether/etherpad-lite/wiki/Creating-a-plugin#writing-and-running-front-end-tests-for-your-plugin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Install dependencies so we can run ESLint. This should also create or update package-lock.json
|
||||||
|
// if autoFix is enabled.
|
||||||
|
const npmInstall = `npm install${autoFix ? '' : ' --no-package-lock'}`;
|
||||||
|
execSync(npmInstall, {stdio: 'inherit'});
|
||||||
|
// The ep_etherpad-lite peer dep must be installed last otherwise `npm install` will nuke it.
|
||||||
|
execSync(`${npmInstall} --no-save ep_etherpad-lite@file:../../src`, {stdio: 'inherit'});
|
||||||
|
|
||||||
// linting begins
|
// linting begins
|
||||||
try {
|
try {
|
||||||
console.log('Linting...');
|
console.log('Linting...');
|
||||||
|
|
Loading…
Reference in a new issue