Skip to content

Commit 5c09f73

Browse files
authored
Updates for 0.11 (#10)
* Updates for 0.11 * eslint * Remove test script, eslint --fix * Add .eslintrc
1 parent 49829c6 commit 5c09f73

File tree

10 files changed

+129
-131
lines changed

10 files changed

+129
-131
lines changed

.eslintrc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"env": {
3+
"node": true,
4+
},
5+
"rules": {
6+
"valid-jsdoc": [2, {
7+
"prefer": { "return": "returns" },
8+
"requireReturn": true,
9+
"requireParamDescription": true,
10+
"requireReturnDescription": false
11+
}],
12+
"camelcase": 1,
13+
"no-multi-spaces": 0,
14+
"comma-spacing": 1,
15+
"comma-style": [2, "first"],
16+
"consistent-return": 0,
17+
"eol-last": 1,
18+
"indent": [1, 4],
19+
"no-use-before-define": [2, "nofunc"],
20+
"no-process-exit": 0,
21+
"no-trailing-spaces": 1,
22+
"no-underscore-dangle": 0,
23+
"no-unused-vars": 1,
24+
"space-infix-ops": 1,
25+
"quotes": [1, "single"],
26+
"semi": [1, "always"],
27+
"semi-spacing": 1,
28+
"strict": [2, "global"],
29+
"yoda": [1, "never"]
30+
},
31+
"globals": {
32+
"describe": true,
33+
"it": true,
34+
"before": true,
35+
"beforeEach": true,
36+
"after": true,
37+
"afterEach": true
38+
}
39+
}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/.*
22
!/.gitignore
3-
!/.jscsrc
4-
!/.jshintrc
3+
!/.eslintrc
54
!/.travis.yml
65
/bower_components/
76
/node_modules/

.jscsrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 19 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ install:
88
script:
99
- bower install --production
1010
- npm run -s build
11-
- bower install
12-
- npm test
1311
after_success:
1412
- >-
1513
test $TRAVIS_TAG &&

bower.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
"package.json"
1717
],
1818
"dependencies": {
19-
"purescript-exceptions": "^2.0.0",
20-
"purescript-foreign": "^3.0.0",
21-
"purescript-functions": "^2.0.0",
22-
"purescript-maps": "^2.0.0",
23-
"purescript-node-fs": "^3.0.0",
24-
"purescript-node-streams": "^2.0.0",
25-
"purescript-nullable": "^2.0.0",
26-
"purescript-posix-types": "^2.0.0",
27-
"purescript-unsafe-coerce": "^2.0.0"
19+
"purescript-exceptions": "^3.0.0",
20+
"purescript-foreign": "^4.0.0",
21+
"purescript-functions": "^3.0.0",
22+
"purescript-maps": "^3.0.0",
23+
"purescript-node-fs": "^4.0.0",
24+
"purescript-node-streams": "^3.0.0",
25+
"purescript-nullable": "^3.0.0",
26+
"purescript-posix-types": "^3.0.0",
27+
"purescript-unsafe-coerce": "^3.0.0"
2828
},
2929
"devDependencies": {
30-
"purescript-console": "^2.0.0"
30+
"purescript-console": "^3.0.0"
3131
}
3232
}

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6-
"test": "pulp test"
5+
"build": "eslint src && pulp build -- --censor-lib --strict"
76
},
87
"devDependencies": {
9-
"jscs": "^3.0.7",
10-
"jshint": "^2.9.4",
11-
"pulp": "^9.0.1",
12-
"purescript-psa": "^0.3.9",
13-
"purescript": "^0.10.1",
8+
"eslint": "^3.17.1",
9+
"pulp": "^11.0.0",
10+
"purescript-psa": "^0.5.0",
11+
"purescript": "^0.11.1",
1412
"rimraf": "^2.5.4"
1513
}
1614
}

src/Node/ChildProcess.js

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,112 @@
1-
"use strict";
1+
'use strict';
22

33
/* eslint-env node*/
44

55
exports.unsafeFromNullable = function unsafeFromNullable (msg) {
6-
return function (x) {
7-
if (x === null) throw new Error(msg);
8-
return x;
9-
};
6+
return function (x) {
7+
if (x === null) throw new Error(msg);
8+
return x;
9+
};
1010
};
1111

1212
exports.spawnImpl = function spawnImpl (command) {
13-
return function (args) {
14-
return function (opts) {
15-
return function () {
16-
return require("child_process").spawn(command, args, opts);
17-
};
13+
return function (args) {
14+
return function (opts) {
15+
return function () {
16+
return require('child_process').spawn(command, args, opts);
17+
};
18+
};
1819
};
19-
};
2020
};
2121

2222
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) {
27-
callback(err)(stdout)(stderr)();
28-
});
29-
};
23+
return function (opts) {
24+
return function (callback) {
25+
return function () {
26+
return require('child_process').exec(command, opts, function (err, stdout, stderr) {
27+
callback(err)(stdout)(stderr)();
28+
});
29+
};
30+
};
3031
};
31-
};
3232
};
3333

3434
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) {
40-
callback(err)(stdout)(stderr)();
41-
});
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) {
40+
callback(err)(stdout)(stderr)();
41+
});
42+
};
43+
};
4244
};
43-
};
4445
};
45-
};
4646
};
4747

4848
exports.fork = function fork (cmd) {
49-
return function (args) {
50-
return function () {
51-
return require("child_process").fork(cmd, args);
49+
return function (args) {
50+
return function () {
51+
return require('child_process').fork(cmd, args);
52+
};
5253
};
53-
};
5454
};
5555

5656
exports.mkOnExit = function mkOnExit (mkChildExit) {
57-
return function onExit (cp) {
58-
return function (cb) {
59-
return function () {
60-
cp.on("exit", function (code, signal) {
61-
cb(mkChildExit(code)(signal))();
62-
});
63-
};
57+
return function onExit (cp) {
58+
return function (cb) {
59+
return function () {
60+
cp.on('exit', function (code, signal) {
61+
cb(mkChildExit(code)(signal))();
62+
});
63+
};
64+
};
6465
};
65-
};
6666
};
6767

6868
exports.mkOnClose = function mkOnClose (mkChildExit) {
69-
return function onClose (cp) {
70-
return function (cb) {
71-
return function () {
72-
cp.on("exit", function (code, signal) {
73-
cb(mkChildExit(code)(signal))();
74-
});
75-
};
69+
return function onClose (cp) {
70+
return function (cb) {
71+
return function () {
72+
cp.on('exit', function (code, signal) {
73+
cb(mkChildExit(code)(signal))();
74+
});
75+
};
76+
};
7677
};
77-
};
7878
};
7979

8080
exports.onDisconnect = function onDisconnect (cp) {
81-
return function (cb) {
82-
return function () {
83-
cp.on("disconnect", cb);
81+
return function (cb) {
82+
return function () {
83+
cp.on('disconnect', cb);
84+
};
8485
};
85-
};
8686
};
8787

8888
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) {
94-
cb(mess, sendHandle ? just(sendHandle) : nothing)();
95-
});
89+
return function (just) {
90+
return function onMessage (cp) {
91+
return function (cb) {
92+
return function () {
93+
cp.on('message', function (mess, sendHandle) {
94+
cb(mess, sendHandle ? just(sendHandle) : nothing)();
95+
});
96+
};
97+
};
9698
};
97-
};
9899
};
99-
};
100100
};
101101

102102
exports.onError = function onError (cp) {
103-
return function (cb) {
104-
return function () {
105-
cp.on("error", function (err) {
106-
cb(err)();
107-
});
103+
return function (cb) {
104+
return function () {
105+
cp.on('error', function (err) {
106+
cb(err)();
107+
});
108+
};
108109
};
109-
};
110110
};
111111

112112
exports.undefined = undefined;

src/Node/ChildProcess.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module Node.ChildProcess
4848
import Prelude
4949

5050
import Control.Alt ((<|>))
51-
import Control.Monad.Eff (Eff)
51+
import Control.Monad.Eff (kind Effect, Eff)
5252
import Control.Monad.Eff.Exception as Exception
5353
import Control.Monad.Eff.Exception.Unsafe (unsafeThrow)
5454

@@ -68,10 +68,10 @@ import Node.Stream (Readable, Writable, Stream)
6868
import Unsafe.Coerce (unsafeCoerce)
6969

7070
-- | A handle for inter-process communication (IPC).
71-
foreign import data Handle :: *
71+
foreign import data Handle :: Type
7272

7373
-- | The effect for creating and interacting with child processes.
74-
foreign import data CHILD_PROCESS :: !
74+
foreign import data CHILD_PROCESS :: Effect
7575

7676
newtype ChildProcess = ChildProcess ChildProcessRec
7777

@@ -283,7 +283,7 @@ foreign import execFileImpl
283283
-> (Nullable Exception.Error -> Buffer -> Buffer -> Eff (cp :: CHILD_PROCESS | eff) Unit)
284284
-> Eff (cp :: CHILD_PROCESS | eff) Unit
285285

286-
foreign import data ActualExecOptions :: *
286+
foreign import data ActualExecOptions :: Type
287287

288288
convertExecOptions :: ExecOptions -> ActualExecOptions
289289
convertExecOptions opts = unsafeCoerce
@@ -376,7 +376,7 @@ foreign import process :: forall props. { | props }
376376
ignore :: Array (Maybe StdIOBehaviour)
377377
ignore = map Just [Ignore, Ignore, Ignore]
378378

379-
foreign import data ActualStdIOBehaviour :: *
379+
foreign import data ActualStdIOBehaviour :: Type
380380

381381
toActualStdIOBehaviour :: StdIOBehaviour -> ActualStdIOBehaviour
382382
toActualStdIOBehaviour b = case b of

test/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Node.ChildProcess (CHILD_PROCESS, Exit(..), defaultExecOptions, exec, onE
1313
import Node.Encoding (Encoding(UTF8))
1414
import Node.Stream (onData)
1515

16-
type TestEff = Eff (cp :: CHILD_PROCESS, console :: CONSOLE, err :: EXCEPTION, buffer :: Buffer.BUFFER) Unit
16+
type TestEff = Eff (cp :: CHILD_PROCESS, console :: CONSOLE, exception :: EXCEPTION, buffer :: Buffer.BUFFER) Unit
1717

1818
main :: TestEff
1919
main = do
@@ -36,7 +36,7 @@ main = do
3636

3737
log "kills processes"
3838
spawn "ls" ["-la"] defaultSpawnOptions >>= \ls -> do
39-
kill SIGTERM ls
39+
_ <- kill SIGTERM ls
4040
onExit ls \exit ->
4141
case exit of
4242
BySignal SIGTERM ->

0 commit comments

Comments
 (0)