Skip to content

Commit c04085a

Browse files
committed
yarn: initial commit
1 parent 4e172cd commit c04085a

6 files changed

+5992
-21
lines changed

.yarnrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
disturl "https://atom.io/download/electron"
2+
target "1.7.9"
3+
runtime "electron"

build/gulpfile.hygiene.js

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const indentationFilter = [
5757
'!**/*.template',
5858
'!**/*.yaml',
5959
'!**/*.yml',
60+
'!**/yarn.lock',
6061
'!**/lib/**',
6162
'!extensions/**/*.d.ts',
6263
'!src/typings/**/*.d.ts',

build/npm/postinstall.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@
55

66
const cp = require('child_process');
77
const path = require('path');
8-
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
8+
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
99

10-
function npmInstall(location, opts) {
10+
process.exit(0);
11+
12+
function yarnInstall(location, opts) {
1113
opts = opts || {};
1214
opts.cwd = location;
1315
opts.stdio = 'inherit';
1416

15-
const result = cp.spawnSync(npm, ['install'], opts);
17+
const result = cp.spawnSync(yarn, ['install'], opts);
1618

1719
if (result.error || result.status !== 0) {
1820
process.exit(1);
1921
}
2022
}
2123

22-
npmInstall('extensions'); // node modules shared by all extensions
24+
yarnInstall('extensions'); // node modules shared by all extensions
2325

2426
const extensions = [
2527
'vscode-api-tests',
@@ -43,9 +45,9 @@ const extensions = [
4345
'jake'
4446
];
4547

46-
extensions.forEach(extension => npmInstall(`extensions/${extension}`));
48+
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
4749

48-
function npmInstallBuildDependencies() {
50+
function yarnInstallBuildDependencies() {
4951
// make sure we install gulp watch for the system installed
5052
// node, since that is the driver of gulp
5153
const env = Object.assign({}, process.env);
@@ -54,9 +56,9 @@ function npmInstallBuildDependencies() {
5456
delete env['npm_config_target'];
5557
delete env['npm_config_runtime'];
5658

57-
npmInstall(path.join(path.dirname(__dirname), 'lib', 'watch'), { env });
59+
yarnInstall(path.join(path.dirname(__dirname), 'lib', 'watch'), { env });
5860
}
5961

60-
npmInstall(`build`); // node modules required for build
61-
npmInstall('test/smoke'); // node modules required for smoketest
62-
npmInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
62+
yarnInstall(`build`); // node modules required for build
63+
yarnInstall('test/smoke'); // node modules required for smoketest
64+
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron

build/npm/preinstall.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
if (process.env['npm_config_disturl'] !== 'https://atom.io/download/electron') {
7-
console.error("You can't use plain npm to install Code's dependencies.");
8-
console.error(
9-
/^win/.test(process.platform)
10-
? "Please run '.\\scripts\\npm.bat install' instead."
11-
: "Please run './scripts/npm.sh install' instead."
12-
);
6+
if (!/yarn\.js$/.test(process.env['npm_execpath'])) {
7+
console.error('*** Please use yarn to install dependencies.\n');
138

149
process.exit(1);
15-
}
10+
}

npm-shrinkwrap.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)