Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ jobs:
docker:
- image: node:6
<<: *test_steps
test-linux-node4:
<<: *docker_defaults
docker:
- image: node:4
<<: *test_steps
test-macos-node10:
<<: *macos_defaults
steps:
Expand Down Expand Up @@ -263,10 +258,6 @@ workflows:
filters: *default_filters
requires:
- install
- test-linux-node4:
filters: *default_filters
requires:
- install
- test-macos-node10:
filters: *default_filters
requires:
Expand Down Expand Up @@ -294,7 +285,6 @@ workflows:
- test-linux-node10
- test-linux-node8
- test-linux-node6
- test-linux-node4
- test-macos-node10
- test-macos-node8
- test-macos-node6
Expand Down
23 changes: 10 additions & 13 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,17 @@ test('should add lockfile package', async () => {
expectAddOutput(stdout);
});

// test is failing on Node 4, https://travis-ci.org/yarnpkg/yarn/jobs/216254539
if (semver.satisfies(ver, '>=5.0.0')) {
test.concurrent('should add progress package globally', async () => {
const stdout = await execCommand(
'global',
['add', '[email protected]', '--global-folder', './global'],
'run-add-progress-globally',
true,
);
test.concurrent('should add progress package globally', async () => {
const stdout = await execCommand(
'global',
['add', '[email protected]', '--global-folder', './global'],
'run-add-progress-globally',
true,
);

const lastLine = stdout[stdout.length - 1];
expect(lastLine).toMatch(/^Done/);
});
}
const lastLine = stdout[stdout.length - 1];
expect(lastLine).toMatch(/^Done/);
});

test.concurrent('should run custom script', async () => {
const stdout = await execCommand('run', ['custom-script'], 'run-custom-script');
Expand Down
6 changes: 3 additions & 3 deletions bin/yarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
var ver = process.versions.node;
var majorVer = parseInt(ver.split('.')[0], 10);

if (majorVer < 4) {
console.error('Node version ' + ver + ' is not supported, please use Node.js 4.0 or higher.');
if (majorVer < 6) {
console.error('Node version ' + ver + ' is not supported, please use Node.js 6.0 or higher.');
process.exit(1); // eslint-disable-line no-process-exit
} else {
var dirPath = '../lib/';
var v8CompileCachePath = dirPath + 'v8-compile-cache';
var fs = require('fs');
// We don't have/need this on legacy builds and dev builds
// We don't have/need this on dev builds
if (fs.existsSync(v8CompileCachePath)) {
require(v8CompileCachePath);
}
Expand Down
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"yargs": "^6.3.0"
},
"engines": {
"node": ">=4.0.0"
"node": "^6.2.2 || >=8.0.0"
},
"repository": "yarnpkg/yarn",
"bin": {
Expand Down Expand Up @@ -124,14 +124,9 @@
"commit": "git-cz"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.js"
],
"collectCoverageFrom": ["src/**/*.js"],
"testEnvironment": "node",
"modulePathIgnorePatterns": [
"__tests__/fixtures/",
"packages/pkg-tests/pkg-tests-fixtures"
],
"modulePathIgnorePatterns": ["__tests__/fixtures/", "packages/pkg-tests/pkg-tests-fixtures"],
"testPathIgnorePatterns": [
"__tests__/(fixtures|__mocks__)/",
"updates/",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ensureAvailable lintian
ensureAvailable rpmbuild

PACKAGE_TMPDIR=tmp/debian_pkg
VERSION=`./artifacts/yarn-legacy-* --version`
VERSION=`./artifacts/yarn-*.js --version`
OUTPUT_DIR=artifacts
TARBALL_NAME=$OUTPUT_DIR/yarn-v$VERSION.tar.gz
DEB_PACKAGE_NAME=yarn_$VERSION'_all.deb'
Expand Down
9 changes: 2 additions & 7 deletions scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,12 @@ eval $system_yarn run build
eval $system_yarn run build-bundle
chmod +x artifacts/*.js
# Verify that it works as expected
if (( node_version > 4 )); then
[[ "$version" == "$(node artifacts/yarn-$version.js --version)" ]] || exit 1
fi
[[ "$version" == "$(node artifacts/yarn-legacy-$version.js --version)" ]] || exit 1
[[ "$version" == "$(node artifacts/yarn-$version.js --version)" ]] || exit 1

cp package.json dist/
cp README.md dist/
cp LICENSE dist/
# Only use the legacy version for NPM builds so we are compatible
# with any Node >= 4 and still small in terms of size.
cp artifacts/yarn-legacy-$version.js dist/lib/cli.js
cp artifacts/yarn-$version.js dist/lib/cli.js
cp bin/{yarn.js,yarn,yarnpkg,*.cmd} dist/bin/
chmod +x dist/bin/*

Expand Down
36 changes: 0 additions & 36 deletions scripts/build-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,3 @@ compiler.run((err, stats) => {
const filenames = fileDependencies.map(x => x.replace(basedir, ''));
console.log(util.inspect(filenames, {maxArrayLength: null}));
});

//
// Legacy build
//

const compilerLegacy = webpack({
// devtool: 'inline-source-map',
entry: path.join(basedir, 'src/cli/index.js'),
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: babelRc.env['pre-node5'],
},
],
},
plugins: [
new webpack.BannerPlugin({
banner: '#!/usr/bin/env node',
raw: true,
}),
],
output: {
filename: `yarn-legacy-${version}.js`,
path: path.join(basedir, 'artifacts'),
libraryTarget: 'commonjs2',
},
target: 'node',
node: nodeOptions,
});

compilerLegacy.run((err, stats) => {
// do nothing, but keep here for debugging...
});
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDep
export const RESOLUTIONS = 'resolutions';
export const MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES];

export const SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0';
export const SUPPORTED_NODE_VERSIONS = '^6.2.2 || >=8.0.0';

export const YARN_REGISTRY = 'https://registry.yarnpkg.com';

Expand Down