mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Update all dependencies
This commit is contained in:
parent
5bb2a27249
commit
ed1ee25b7b
19 changed files with 2480 additions and 2397 deletions
49
build/npm/installAll.js
Normal file
49
build/npm/installAll.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
const glob = require('glob');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const cp = require('child_process');
|
||||
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
const files = glob.sync('**/package.json', {
|
||||
cwd: REPO_ROOT,
|
||||
ignore: ['**/node_modules/**', '**/out/**', '**/release/**']
|
||||
});
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(REPO_ROOT, file);
|
||||
const contents = JSON.parse(fs.readFileSync(filePath).toString());
|
||||
if (!contents.dependencies && !contents.devDependencies && !contents.optionalDependencies) {
|
||||
// nothing to install
|
||||
continue;
|
||||
}
|
||||
|
||||
npmInstall(path.dirname(file));
|
||||
}
|
||||
|
||||
function npmInstall(location) {
|
||||
/** @type {'inherit'} */
|
||||
const stdio = 'inherit';
|
||||
const opts = {
|
||||
env: process.env,
|
||||
cwd: location,
|
||||
stdio
|
||||
};
|
||||
const args = ['install'];
|
||||
|
||||
console.log(`Installing dependencies in ${location}...`);
|
||||
console.log(`$ npm ${args.join(' ')}`);
|
||||
const result = cp.spawnSync(npm, args, opts);
|
||||
|
||||
if (result.error || result.status !== 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
23
build/npm/removeAll.js
Normal file
23
build/npm/removeAll.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
const glob = require('glob');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
const files = glob.sync('**/package-lock.json', {
|
||||
cwd: REPO_ROOT,
|
||||
ignore: ['**/node_modules/**', '**/out/**', '**/release/**']
|
||||
});
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(REPO_ROOT, file);
|
||||
console.log(`Deleting ${file}...`);
|
||||
fs.unlinkSync(filePath);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue