mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:36:27 -05:00
yarn: initial commit
This commit is contained in:
3
.yarnrc
Normal file
3
.yarnrc
Normal file
@@ -0,0 +1,3 @@
|
||||
disturl "https://atom.io/download/electron"
|
||||
target "1.7.9"
|
||||
runtime "electron"
|
||||
@@ -57,6 +57,7 @@ const indentationFilter = [
|
||||
'!**/*.template',
|
||||
'!**/*.yaml',
|
||||
'!**/*.yml',
|
||||
'!**/yarn.lock',
|
||||
'!**/lib/**',
|
||||
'!extensions/**/*.d.ts',
|
||||
'!src/typings/**/*.d.ts',
|
||||
|
||||
@@ -5,21 +5,23 @@
|
||||
|
||||
const cp = require('child_process');
|
||||
const path = require('path');
|
||||
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||
|
||||
function npmInstall(location, opts) {
|
||||
process.exit(0);
|
||||
|
||||
function yarnInstall(location, opts) {
|
||||
opts = opts || {};
|
||||
opts.cwd = location;
|
||||
opts.stdio = 'inherit';
|
||||
|
||||
const result = cp.spawnSync(npm, ['install'], opts);
|
||||
const result = cp.spawnSync(yarn, ['install'], opts);
|
||||
|
||||
if (result.error || result.status !== 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
npmInstall('extensions'); // node modules shared by all extensions
|
||||
yarnInstall('extensions'); // node modules shared by all extensions
|
||||
|
||||
const extensions = [
|
||||
'vscode-api-tests',
|
||||
@@ -43,9 +45,9 @@ const extensions = [
|
||||
'jake'
|
||||
];
|
||||
|
||||
extensions.forEach(extension => npmInstall(`extensions/${extension}`));
|
||||
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
|
||||
|
||||
function npmInstallBuildDependencies() {
|
||||
function yarnInstallBuildDependencies() {
|
||||
// make sure we install gulp watch for the system installed
|
||||
// node, since that is the driver of gulp
|
||||
const env = Object.assign({}, process.env);
|
||||
@@ -54,9 +56,9 @@ function npmInstallBuildDependencies() {
|
||||
delete env['npm_config_target'];
|
||||
delete env['npm_config_runtime'];
|
||||
|
||||
npmInstall(path.join(path.dirname(__dirname), 'lib', 'watch'), { env });
|
||||
yarnInstall(path.join(path.dirname(__dirname), 'lib', 'watch'), { env });
|
||||
}
|
||||
|
||||
npmInstall(`build`); // node modules required for build
|
||||
npmInstall('test/smoke'); // node modules required for smoketest
|
||||
npmInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
|
||||
yarnInstall(`build`); // node modules required for build
|
||||
yarnInstall('test/smoke'); // node modules required for smoketest
|
||||
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
|
||||
@@ -3,13 +3,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
if (process.env['npm_config_disturl'] !== 'https://atom.io/download/electron') {
|
||||
console.error("You can't use plain npm to install Code's dependencies.");
|
||||
console.error(
|
||||
/^win/.test(process.platform)
|
||||
? "Please run '.\\scripts\\npm.bat install' instead."
|
||||
: "Please run './scripts/npm.sh install' instead."
|
||||
);
|
||||
if (!/yarn\.js$/.test(process.env['npm_execpath'])) {
|
||||
console.error('*** Please use yarn to install dependencies.\n');
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
6
npm-shrinkwrap.json
generated
6
npm-shrinkwrap.json
generated
@@ -306,9 +306,9 @@
|
||||
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.7.3.tgz",
|
||||
"dependencies": {
|
||||
"nan": {
|
||||
"version": "2.5.0",
|
||||
"from": "nan@2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.5.0.tgz"
|
||||
"version": "2.6.2",
|
||||
"from": "nan@2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user