Skip to content

Commit

Permalink
add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
giabao committed Apr 19, 2019
1 parent 0a98742 commit ff0fdce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rangy2",
"description": "A cross-browser DOM range and selection library",
"version": "2.0.0",
"version": "2.1.0",
"author": {
"name": "Tim Down",
"email": "tim@timdown.co.uk",
Expand Down Expand Up @@ -45,7 +45,9 @@
"prebuild": "yarn run tsc:scripts",
"build:src": "npm-run-all tsc:src rollup:src",
"build:test": "npm-run-all --parallel tsc:test rollup:test",
"build": "npm-run-all --parallel build:* dist-prepare",
"build": "npm-run-all --parallel build:*",
"prerelease": "npm-run-all clean tsc:scripts --parallel build:* dist-prepare",
"release": "node scripts/publish.js",
"watch:src": "TODO FORCE_COLOR=1 rollup -c --watch",
"watch": "TODO run-p -l watch:types watch:js",
"test": "echo 'pls browse test/*.html for testing'"
Expand Down
14 changes: 14 additions & 0 deletions scripts/publish.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {spawnSync} from "child_process";
import {modules, projectRoot} from "./util";

function publish(module: string) {
const args = ['yarn', ['publish', `dist/${module}`, '--non-interactive']];
console.log(args.flat().join(' '));
spawnSync('yarn', ['publish', `dist/${module}`, '--non-interactive'], {
stdio:'inherit',
cwd: projectRoot,
});
}

console.log('publishing modules: ' + modules.join(', ') + '...');
modules.forEach(publish);

0 comments on commit ff0fdce

Please sign in to comment.