Skip to content

Commit a1b9a6b

Browse files
authored
Merge pull request #11 from purescript-node/build
Update build
2 parents 0c15e10 + eb7ed41 commit a1b9a6b

File tree

6 files changed

+164
-137
lines changed

6 files changed

+164
-137
lines changed

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
/.*
2+
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
5+
!/.travis.yml
16
/bower_components/
27
/node_modules/
38
/output/
4-
/.psci*
5-
/src/.webpack.js
6-
.pulp-cache/

.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+
"predef": ["exports", "Buffer"]
1919
}
20-

.travis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
language: node_js
2-
sudo: false
3-
node_js:
4-
- 4.2
5-
- 5.2
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
65
env:
76
- PATH=$HOME/purescript:$PATH
87
install:
98
- 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')
109
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
1110
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
1211
- chmod a+x $HOME/purescript
12+
- npm install -g bower
1313
- npm install
1414
script:
15-
- npm run build
15+
- bower install --production
16+
- npm run -s build
17+
- bower install
18+
- npm run -s test
19+
after_success:
20+
- >-
21+
test $TRAVIS_TAG &&
22+
echo $GITHUB_TOKEN | pulp login &&
23+
echo y | pulp publish --no-push

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"private": true,
33
"scripts": {
4-
"postinstall": "bower install",
5-
"build": "jshint src && pulp build && rimraf docs && pulp docs"
4+
"clean": "rimraf output && rimraf .pulp-cache",
5+
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6+
"test": "pulp test"
67
},
78
"devDependencies": {
8-
"jshint": "^2.8.0",
9-
"pulp": "^9.0.0",
10-
"rimraf": "^2.4.1",
11-
"stream-buffers": "^3.0.0"
9+
"jscs": "^3.0.7",
10+
"jshint": "^2.9.3",
11+
"pulp": "^9.0.1",
12+
"purescript-psa": "^0.3.9",
13+
"rimraf": "^2.5.4",
14+
"stream-buffers": "^3.0.1"
1215
}
1316
}

src/Node/Stream.js

Lines changed: 117 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,171 @@
1-
/* global exports */
2-
/* global Buffer */
31
"use strict";
42

53
exports.undefined = undefined;
64

7-
exports.setEncodingImpl = function(s) {
8-
return function(enc) {
9-
return function() {
10-
s.setEncoding(enc);
11-
};
5+
exports.setEncodingImpl = function (s) {
6+
return function (enc) {
7+
return function () {
8+
s.setEncoding(enc);
129
};
10+
};
1311
};
1412

15-
exports.readChunkImpl = function(Left) {
16-
return function(Right) {
17-
return function(chunk) {
18-
if (chunk instanceof Buffer) {
19-
return Right(chunk);
20-
} else if (typeof chunk === 'string') {
21-
return Left(chunk);
22-
} else {
23-
throw new Error(
24-
"Node.Stream.readChunkImpl: Unrecognised " +
25-
"chunk type; expected String or Buffer, got: " +
26-
chunk);
27-
}
28-
};
13+
exports.readChunkImpl = function (Left) {
14+
return function (Right) {
15+
return function (chunk) {
16+
if (chunk instanceof Buffer) {
17+
return Right(chunk);
18+
} else if (typeof chunk === "string") {
19+
return Left(chunk);
20+
} else {
21+
throw new Error(
22+
"Node.Stream.readChunkImpl: Unrecognised " +
23+
"chunk type; expected String or Buffer, got: " +
24+
chunk);
25+
}
2926
};
27+
};
3028
};
3129

32-
exports.onDataEitherImpl = function(readChunk) {
33-
return function(r) {
34-
return function(f) {
35-
return function() {
36-
r.on('data', function(data) {
37-
f(readChunk(data))();
38-
});
39-
};
40-
};
30+
exports.onDataEitherImpl = function (readChunk) {
31+
return function (r) {
32+
return function (f) {
33+
return function () {
34+
r.on("data", function (data) {
35+
f(readChunk(data))();
36+
});
37+
};
4138
};
39+
};
4240
};
4341

44-
exports.onEnd = function(s) {
45-
return function(f) {
46-
return function() {
47-
s.on('end', f);
48-
};
42+
exports.onEnd = function (s) {
43+
return function (f) {
44+
return function () {
45+
s.on("end", f);
4946
};
47+
};
5048
};
5149

52-
exports.onReadable = function(s) {
53-
return function(f) {
54-
return function() {
55-
s.on('readable', f);
56-
};
50+
exports.onReadable = function (s) {
51+
return function (f) {
52+
return function () {
53+
s.on("readable", f);
5754
};
55+
};
5856
};
5957

60-
exports.onError = function(s) {
61-
return function(f) {
62-
return function() {
63-
s.on('error', function(e) {
64-
f(e)();
65-
});
66-
};
58+
exports.onError = function (s) {
59+
return function (f) {
60+
return function () {
61+
s.on("error", function (e) {
62+
f(e)();
63+
});
6764
};
65+
};
6866
};
6967

70-
exports.onClose = function(s) {
71-
return function(f) {
72-
return function() {
73-
s.on('close', f);
74-
};
68+
exports.onClose = function (s) {
69+
return function (f) {
70+
return function () {
71+
s.on("close", f);
7572
};
73+
};
7674
};
7775

78-
exports.resume = function(s) {
79-
return function() {
80-
s.resume();
81-
};
76+
exports.resume = function (s) {
77+
return function () {
78+
s.resume();
79+
};
8280
};
8381

84-
exports.pause = function(s) {
85-
return function() {
86-
s.pause();
87-
};
82+
exports.pause = function (s) {
83+
return function () {
84+
s.pause();
85+
};
8886
};
8987

90-
exports.isPaused = function(s) {
91-
return function() {
92-
return s.isPaused();
93-
};
88+
exports.isPaused = function (s) {
89+
return function () {
90+
return s.isPaused();
91+
};
9492
};
9593

96-
exports.pipe = function(r) {
97-
return function(w) {
98-
return function() {
99-
return r.pipe(w);
100-
};
94+
exports.pipe = function (r) {
95+
return function (w) {
96+
return function () {
97+
return r.pipe(w);
10198
};
99+
};
102100
};
103101

104-
exports.readImpl = function(readChunk) {
105-
return function(Nothing) {
106-
return function(Just) {
107-
return function(r) {
108-
return function(s) {
109-
return function() {
110-
var v = r.read(s);
111-
if (v === null) {
112-
return Nothing;
113-
} else {
114-
return Just(readChunk(v));
115-
}
116-
};
117-
};
118-
};
102+
exports.readImpl = function (readChunk) {
103+
return function (Nothing) {
104+
return function (Just) {
105+
return function (r) {
106+
return function (s) {
107+
return function () {
108+
var v = r.read(s);
109+
if (v === null) {
110+
return Nothing;
111+
} else {
112+
return Just(readChunk(v));
113+
}
114+
};
119115
};
116+
};
120117
};
118+
};
121119
};
122120

123-
exports.write = function(w) {
124-
return function(chunk) {
125-
return function(done) {
126-
return function() {
127-
return w.write(chunk, null, done);
128-
};
129-
};
121+
exports.write = function (w) {
122+
return function (chunk) {
123+
return function (done) {
124+
return function () {
125+
return w.write(chunk, null, done);
126+
};
130127
};
128+
};
131129
};
132130

133-
exports.writeStringImpl = function(w) {
134-
return function(enc) {
135-
return function(s) {
136-
return function(done) {
137-
return function() {
138-
return w.write(s, enc, done);
139-
};
140-
};
131+
exports.writeStringImpl = function (w) {
132+
return function (enc) {
133+
return function (s) {
134+
return function (done) {
135+
return function () {
136+
return w.write(s, enc, done);
141137
};
138+
};
142139
};
140+
};
143141
};
144142

145-
exports.cork = function(w) {
146-
return function() {
147-
return w.cork();
148-
};
143+
exports.cork = function (w) {
144+
return function () {
145+
return w.cork();
146+
};
149147
};
150148

151-
exports.uncork = function(w) {
152-
return function() {
153-
return w.uncork();
154-
};
149+
exports.uncork = function (w) {
150+
return function () {
151+
return w.uncork();
152+
};
155153
};
156154

157-
exports.setDefaultEncodingImpl = function(w) {
158-
return function(enc) {
159-
return function() {
160-
w.setDefaultEncoding(enc);
161-
};
155+
exports.setDefaultEncodingImpl = function (w) {
156+
return function (enc) {
157+
return function () {
158+
w.setDefaultEncoding(enc);
162159
};
160+
};
163161
};
164162

165-
exports.end = function(w) {
166-
return function(done) {
167-
return function() {
168-
w.end(null, null, function() {
169-
done();
170-
});
171-
};
163+
exports.end = function (w) {
164+
return function (done) {
165+
return function () {
166+
w.end(null, null, function () {
167+
done();
168+
});
172169
};
170+
};
173171
};

0 commit comments

Comments
 (0)