yarn: initial commit

This commit is contained in:
Joao Moreno
2017-11-13 22:36:57 +01:00
parent 4e172cd197
commit c04085ad84
6 changed files with 5992 additions and 21 deletions

3
.yarnrc Normal file
View File

@@ -0,0 +1,3 @@
disturl "https://atom.io/download/electron"
target "1.7.9"
runtime "electron"

View File

@@ -57,6 +57,7 @@ const indentationFilter = [
'!**/*.template',
'!**/*.yaml',
'!**/*.yml',
'!**/yarn.lock',
'!**/lib/**',
'!extensions/**/*.d.ts',
'!src/typings/**/*.d.ts',

View File

@@ -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

View File

@@ -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
View File

@@ -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"
}
}
},

5970
yarn.lock Normal file

File diff suppressed because it is too large Load Diff