Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Swapping lerna for yarn-autolink
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman committed Feb 3, 2017
1 parent b97ccce commit f0fcc9e
Show file tree
Hide file tree
Showing 14 changed files with 14,935 additions and 19 deletions.
42 changes: 42 additions & 0 deletions .scripts/version-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#! /usr/bin/env node

const { readdirSync, writeFileSync } = require('fs');
const { resolve, join } = require('path');
const { inc } = require('semver');
const rootPkg = require('../package.json');

const releases = ['major', 'minor', 'patch'];
const packages = resolve(__dirname, '../packages');
const [,,release] = process.argv;

if (!releases.includes(release)) {
throw new Error(`Release must be one of: major, minor, patch`);
}

const version = inc(rootPkg.version, release);

readdirSync(packages)
.map(name => {
const pkgPath = join(packages, name, 'package.json');
const pkg = require(pkgPath);

console.log(`Bumping ${name} to v${version}`);
pkg.version = version;

if (pkg.peerDependencies && pkg.peerDependencies.neutrino) {
console.log(` Bumping neutrino peer dependency to v${version}`);
pkg.peerDependencies.neutrino = `^${version}`;
}

Object
.keys(pkg.linkDependencies || {})
.map(key => {
console.log(` Bumping ${key} linked dependency to v${version}`);
pkg.linkDependencies[key].version = version;
});

writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
});

rootPkg.version = version;
writeFileSync(resolve(__dirname, '../package.json'), `${JSON.stringify(rootPkg, null, 2)}\n`);
7 changes: 0 additions & 7 deletions lerna.json

This file was deleted.

18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"name": "neutrino-dev",
"version": "1.0.0",
"version": "4.0.0",
"private": true,
"keywords": ["neutrino"],
"keywords": [
"neutrino"
],
"author": "Eli Perelman <eli@eliperelman.com>",
"license": "MPL-2.0",
"scripts": {
"postinstall": "lerna clean && lerna bootstrap",
"link-all": "lerna exec -- yarn link"
"postinstall": "autolink bootstrap",
"clean-all": "autolink clean",
"link-all": "autolink link",
"bump:major": ".scripts/version-all major",
"bump:minor": ".scripts/version-all minor",
"bump:patch": ".scripts/version-all patch",
"publish-all": ".scripts/publish-all"
},
"devDependencies": {
"lerna": "2.0.0-beta.36"
"semver": "^5.3.0",
"yarn-autolink": "^1.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/neutrino-preset-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"webpack-merge": "2.4.0"
},
"peerDependencies": {
"neutrino": "^3.0.0"
"neutrino": "^4.0.0"
}
}
Loading

0 comments on commit f0fcc9e

Please sign in to comment.