Skip to content

Commit c4547f8

Browse files
authored
Merge pull request #7 from purescript-node/update-build
Update build & style stuff
2 parents 86ab67d + ca82107 commit c4547f8

File tree

10 files changed

+224
-165
lines changed

10 files changed

+224
-165
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/.*
22
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
35
!/.travis.yml
46
/bower_components/
57
/node_modules/

.jscsrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"preset": "grunt",
3+
"disallowSpacesInFunctionExpression": null,
4+
"requireSpacesInFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
8+
"disallowSpacesInAnonymousFunctionExpression": null,
9+
"requireSpacesInAnonymousFunctionExpression": {
10+
"beforeOpeningRoundBrace": true,
11+
"beforeOpeningCurlyBrace": true
12+
},
13+
"disallowSpacesInsideObjectBrackets": null,
14+
"requireSpacesInsideObjectBrackets": "all",
15+
"validateQuoteMarks": "\"",
16+
"requireCurlyBraces": null
17+
}

.jshintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bitwise": true,
3+
"eqeqeq": true,
4+
"forin": true,
5+
"freeze": true,
6+
"funcscope": true,
7+
"futurehostile": true,
8+
"strict": "global",
9+
"latedef": true,
10+
"noarg": true,
11+
"nocomma": true,
12+
"nonew": true,
13+
"notypeof": true,
14+
"singleGroups": true,
15+
"undef": true,
16+
"unused": true,
17+
"eqnull": true,
18+
"predef": ["exports", "require", "process"]
19+
}

.travis.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ language: node_js
22
dist: trusty
33
sudo: required
44
node_js: 6
5-
env:
6-
- PATH=$HOME/purescript:$PATH
75
install:
8-
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
9-
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
10-
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
11-
- chmod a+x $HOME/purescript
126
- npm install -g bower
137
- npm install
14-
- bower install
158
script:
9+
- bower install --production
1610
- npm run -s build
11+
- bower install
12+
- npm test
1713
after_success:
1814
- >-
1915
test $TRAVIS_TAG &&

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# purescript-node-child-process
22

3-
[![Latest release](http://img.shields.io/bower/v/purescript-node-child-process.svg)](https://github.com/purescript/purescript-node-child-process/releases)
4-
[![Build Status](https://travis-ci.org/purescript/purescript-node-child-process.svg?branch=master)](https://travis-ci.org/purescript/purescript-node-child-process)
5-
[![Dependency Status](https://www.versioneye.com/user/projects/579e4755aa78d50051183eec/badge.svg?style=flat)](https://www.versioneye.com/user/projects/579e4755aa78d50051183eec)
3+
[![Latest release](http://img.shields.io/github/release/purescript-node/purescript-node-child-process.svg)](https://github.com/purescript/purescript-node-child-process/releases)
4+
[![Build Status](https://travis-ci.org/purescript-node/purescript-node-child-process.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-child-process)
65

76
Bindings to Node's `child_process` API.
87

bower.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
"type": "git",
77
"url": "git://github.com/purescript-node/purescript-node-child-process"
88
},
9+
"ignore": [
10+
"**/.*",
11+
"bower_components",
12+
"node_modules",
13+
"output",
14+
"test",
15+
"bower.json",
16+
"package.json"
17+
],
918
"dependencies": {
1019
"purescript-exceptions": "^2.0.0",
1120
"purescript-foreign": "^3.0.0",

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build --censor-lib --strict"
5+
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6+
"test": "pulp test"
67
},
78
"devDependencies": {
9+
"jscs": "^3.0.7",
10+
"jshint": "^2.9.4",
811
"pulp": "^9.0.1",
912
"purescript-psa": "^0.3.9",
13+
"purescript": "^0.10.1",
1014
"rimraf": "^2.5.4"
1115
}
1216
}

src/Node/ChildProcess.js

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,106 +2,112 @@
22

33
/* eslint-env node*/
44

5-
exports.unsafeFromNullable = function unsafeFromNullable(msg){
6-
return function(x) {
7-
if (x === null) {
8-
throw new Error(msg);
9-
} else {
10-
return x;
11-
};
5+
exports.unsafeFromNullable = function unsafeFromNullable (msg) {
6+
return function (x) {
7+
if (x === null) throw new Error(msg);
8+
return x;
129
};
1310
};
14-
exports.spawnImpl = function spawnImpl(command) {
15-
return function(args) {
16-
return function(opts) {
17-
return function() {
11+
12+
exports.spawnImpl = function spawnImpl (command) {
13+
return function (args) {
14+
return function (opts) {
15+
return function () {
1816
return require("child_process").spawn(command, args, opts);
1917
};
2018
};
2119
};
2220
};
23-
exports.execImpl = function execImpl(command) {
24-
return function(opts) {
25-
return function(callback) {
26-
return function() {
27-
return require("child_process").exec(command, opts, function(err, stdout, stderr) {
21+
22+
exports.execImpl = function execImpl (command) {
23+
return function (opts) {
24+
return function (callback) {
25+
return function () {
26+
return require("child_process").exec(command, opts, function (err, stdout, stderr) {
2827
callback(err)(stdout)(stderr)();
2928
});
3029
};
3130
};
3231
};
3332
};
34-
exports.execFileImpl = function execImpl(command) {
35-
return function(args) {
36-
return function(opts) {
37-
return function(callback) {
38-
return function() {
39-
return require("child_process").execFile(command, args, opts, function(err, stdout, stderr) {
33+
34+
exports.execFileImpl = function execImpl (command) {
35+
return function (args) {
36+
return function (opts) {
37+
return function (callback) {
38+
return function () {
39+
return require("child_process").execFile(command, args, opts, function (err, stdout, stderr) {
4040
callback(err)(stdout)(stderr)();
4141
});
4242
};
4343
};
4444
};
4545
};
4646
};
47-
exports.fork = function fork(cmd) {
48-
return function(args) {
49-
return function() {
47+
48+
exports.fork = function fork (cmd) {
49+
return function (args) {
50+
return function () {
5051
return require("child_process").fork(cmd, args);
5152
};
5253
};
5354
};
54-
exports.mkOnExit = function mkOnExit(mkChildExit){
55-
return function onExit(cp){
56-
return function(cb){
57-
return function(){
58-
cp.on("exit", function(code, signal){
55+
56+
exports.mkOnExit = function mkOnExit (mkChildExit) {
57+
return function onExit (cp) {
58+
return function (cb) {
59+
return function () {
60+
cp.on("exit", function (code, signal) {
5961
cb(mkChildExit(code)(signal))();
6062
});
6163
};
6264
};
6365
};
6466
};
65-
exports.mkOnClose = function mkOnClose(mkChildExit){
66-
return function onClose(cp){
67-
return function(cb){
68-
return function(){
69-
cp.on("exit", function(code, signal){
67+
68+
exports.mkOnClose = function mkOnClose (mkChildExit) {
69+
return function onClose (cp) {
70+
return function (cb) {
71+
return function () {
72+
cp.on("exit", function (code, signal) {
7073
cb(mkChildExit(code)(signal))();
7174
});
7275
};
7376
};
7477
};
7578
};
76-
exports.onDisconnect = function onDisconnect(cp){
77-
return function(cb){
78-
return function(){
79+
80+
exports.onDisconnect = function onDisconnect (cp) {
81+
return function (cb) {
82+
return function () {
7983
cp.on("disconnect", cb);
8084
};
8185
};
8286
};
83-
exports.mkOnMessage = function mkOnMessage(nothing){
84-
return function(just){
85-
return function onMessage(cp){
86-
return function(cb){
87-
return function(){
88-
cp.on("message", function(mess, sendHandle){
87+
88+
exports.mkOnMessage = function mkOnMessage (nothing) {
89+
return function (just) {
90+
return function onMessage (cp) {
91+
return function (cb) {
92+
return function () {
93+
cp.on("message", function (mess, sendHandle) {
8994
cb(mess, sendHandle ? just(sendHandle) : nothing)();
9095
});
9196
};
9297
};
9398
};
9499
};
95100
};
96-
exports.onError = function onError(cp){
97-
return function(cb){
98-
return function(){
99-
cp.on("error", function(err) {
100-
cb(err)()
101+
102+
exports.onError = function onError (cp) {
103+
return function (cb) {
104+
return function () {
105+
cp.on("error", function (err) {
106+
cb(err)();
101107
});
102108
};
103109
};
104110
};
105111

106-
exports["undefined"] = undefined;
112+
exports.undefined = undefined;
107113
exports.process = process;

0 commit comments

Comments
 (0)