Skip to content

Commit 41d6fc7

Browse files
authored
Merge pull request #7 from purescript-node/update-build
Update build & style tweaks
2 parents 27a2756 + 34ef523 commit 41d6fc7

11 files changed

+80
-75
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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
"freeze": true,
66
"funcscope": true,
77
"futurehostile": true,
8-
"globalstrict": true,
8+
"strict": "global",
99
"latedef": true,
10-
"maxparams": 1,
1110
"noarg": true,
1211
"nocomma": true,
1312
"nonew": true,
1413
"notypeof": true,
1514
"singleGroups": true,
1615
"undef": true,
1716
"unused": true,
18-
"eqnull": true
17+
"eqnull": true,
18+
"node": true
1919
}
20-

.travis.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@ 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
8+
- bower install --production
159
script:
1610
- npm run -s build
1711
after_success:

README.md

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

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

76
The Node.js global `process` object in PureScript.
87

package.json

Lines changed: 6 additions & 2 deletions
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",
10-
"rimraf": "^2.5.0"
13+
"purescript": "^0.10.1",
14+
"rimraf": "^2.5.4"
1115
}
1216
}

src/Node/Globals.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
"use strict";
2-
/* global exports */
3-
/* global require */
4-
/* global __dirname */
5-
/* global __filename */
6-
7-
// module Node.Globals
82

93
exports.__dirname = __dirname;
104
exports.__filename = __filename;
115
exports.unsafeRequire = require;
126

13-
exports.requireResolve = function(mod) {
14-
return function() {
7+
exports.requireResolve = function (mod) {
8+
return function () {
159
return require.resolve(mod);
1610
};
1711
};

src/Node/Globals.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Node.Globals where
44

55
import Control.Monad.Eff
6-
import Node.FS (FS())
6+
import Node.FS (FS)
77

88
-- | The name of the directory that the currently executing script resides in.
99
-- |

src/Node/Platform.purs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module Node.Platform where
44

55
import Prelude
6-
import Data.Function (on)
76
import Data.Maybe (Maybe(..))
87

98
data Platform
@@ -36,8 +35,5 @@ instance showPlatform :: Show Platform where
3635
show SunOS = "SunOS"
3736
show Win32 = "Win32"
3837

39-
instance eqPlatform :: Eq Platform where
40-
eq = eq `on` toString
41-
42-
instance ordPlatform :: Ord Platform where
43-
compare = compare `on` toString
38+
derive instance eqPlatform :: Eq Platform
39+
derive instance ordPlatform :: Ord Platform

src/Node/Process.js

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,45 @@
11
"use strict";
2-
// module Node.Process
3-
4-
/* global exports */
5-
/* global process */
62

73
exports.process = process;
84

9-
exports.onBeforeExit = function(callback) {
10-
return function() {
11-
process.on('beforeExit', callback);
12-
};
5+
exports.onBeforeExit = function (callback) {
6+
return function () {
7+
process.on("beforeExit", callback);
8+
};
139
};
1410

15-
exports.onExit = function(callback) {
16-
return function() {
17-
process.on('exit', function(code) {
18-
callback(code)();
19-
});
20-
};
11+
exports.onExit = function (callback) {
12+
return function () {
13+
process.on("exit", function (code) {
14+
callback(code)();
15+
});
16+
};
2117
};
2218

23-
exports.onSignalImpl = function(signal) {
24-
return function(callback) {
25-
return function() {
26-
process.on(signal, callback);
27-
};
19+
exports.onSignalImpl = function (signal) {
20+
return function (callback) {
21+
return function () {
22+
process.on(signal, callback);
2823
};
24+
};
2925
};
3026

31-
exports.chdir = function(dir) {
32-
return function() {
33-
process.chdir(dir);
34-
};
27+
exports.chdir = function (dir) {
28+
return function () {
29+
process.chdir(dir);
30+
};
3531
};
3632

37-
exports.setEnv = function(var_) {
38-
return function(val) {
39-
return function() {
40-
process.env[var_] = val;
41-
};
33+
exports.setEnv = function (var_) {
34+
return function (val) {
35+
return function () {
36+
process.env[var_] = val;
4237
};
38+
};
4339
};
4440

45-
exports.exit = function(code) {
46-
return function() {
47-
process.exit(code);
48-
};
41+
exports.exit = function (code) {
42+
return function () {
43+
process.exit(code);
44+
};
4945
};

src/Node/Process.purs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- | Bindings to the global `process` object in Node.js. See also [the Node API documentation](https://nodejs.org/api/process.html)
22
module Node.Process
3-
( PROCESS()
3+
( PROCESS
44
, onBeforeExit
55
, onExit
66
, onSignal
@@ -24,21 +24,25 @@ module Node.Process
2424
) where
2525

2626
import Prelude
27-
import Partial.Unsafe (unsafePartial)
27+
2828
import Control.Monad.Eff (Eff)
29-
import Control.Monad.Eff.Console (CONSOLE())
30-
import Control.Monad.Eff.Exception (EXCEPTION())
31-
import Data.Maybe (Maybe(), fromJust)
32-
import Data.StrMap (StrMap())
33-
import Data.StrMap as StrMap
34-
import Data.Posix (Pid())
35-
import Data.Posix.Signal (Signal())
29+
import Control.Monad.Eff.Console (CONSOLE)
30+
import Control.Monad.Eff.Exception (EXCEPTION)
31+
32+
import Data.Maybe (Maybe, fromJust)
33+
import Data.Posix (Pid)
34+
import Data.Posix.Signal (Signal)
3635
import Data.Posix.Signal as Signal
37-
import Node.Stream (Readable(), Writable())
38-
import Unsafe.Coerce (unsafeCoerce)
36+
import Data.StrMap (StrMap)
37+
import Data.StrMap as StrMap
3938

40-
import Node.Platform (Platform())
39+
import Node.Platform (Platform)
4140
import Node.Platform as Platform
41+
import Node.Stream (Readable, Writable)
42+
43+
import Partial.Unsafe (unsafePartial)
44+
45+
import Unsafe.Coerce (unsafeCoerce)
4246

4347
-- | An effect tracking interaction with the global `process` object.
4448
foreign import data PROCESS :: !

0 commit comments

Comments
 (0)