Skip to content

Commit 51930e0

Browse files
committed
Optimisations, basic tests, tweaks
1 parent 693bc42 commit 51930e0

File tree

6 files changed

+287
-105
lines changed

6 files changed

+287
-105
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/externs/
33
/node_modules/
44
/bower_components/
5+
/tmp/

Gruntfile.js

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
11
module.exports = function(grunt) {
22

3-
"use strict";
4-
5-
grunt.initConfig({
6-
7-
clean: ["externs", "js"],
8-
9-
"purescript-make": {
10-
options: {
11-
tco: true,
12-
magicDo: true
13-
},
14-
lib: {
15-
src:
16-
[ "src/**/*.purs"
17-
, "bower_components/purescript-*/src/**/*.purs"
18-
]
19-
}
20-
}
21-
22-
});
23-
24-
grunt.loadNpmTasks("grunt-purescript");
25-
grunt.loadNpmTasks("grunt-contrib-clean");
26-
27-
grunt.registerTask("default", ["purescript-make:lib"]);
28-
};
3+
"use strict";
4+
5+
grunt.initConfig({
6+
7+
libFiles: [
8+
"src/**/*.purs",
9+
"bower_components/purescript-*/src/**/*.purs",
10+
"bower_components/purescript-*/src/**/*.purs.hs"
11+
],
12+
13+
clean: {
14+
tests: ["tmp"],
15+
lib: ["js", "externs"]
16+
},
17+
18+
"purescript-make": {
19+
lib: {
20+
src: "<%=libFiles%>"
21+
}
22+
},
23+
24+
purescript: {
25+
tests: {
26+
options: {
27+
main: "SimpleTests",
28+
module: ["SimpleTests"]
29+
},
30+
src: ["tests/Simple.purs", "<%=libFiles%>"],
31+
dest: "tmp/tests.js"
32+
}
33+
},
34+
35+
execute: {
36+
tests: {
37+
src: "tmp/tests.js"
38+
}
39+
}
40+
41+
});
42+
43+
grunt.loadNpmTasks("grunt-contrib-clean");
44+
grunt.loadNpmTasks("grunt-purescript");
45+
grunt.loadNpmTasks("grunt-execute");
46+
47+
grunt.registerTask("test", ["clean:tests", "purescript:tests", "execute:tests"]);
48+
grunt.registerTask("lib", ["purescript-make:lib"]);
49+
grunt.registerTask("default", ["test", "lib"]);
50+
};

bower.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@
1717
],
1818
"dependencies": {
1919
"purescript-maybe": "*"
20+
},
21+
"devDependencies": {
22+
"purescript-exceptions": "*",
23+
"purescript-tuples": "*"
2024
}
2125
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"devDependencies": {
55
"grunt": "~0.4.4",
66
"grunt-purescript": "~0.3.1",
7-
"grunt-contrib-clean": "~0.5.0"
7+
"grunt-contrib-clean": "~0.5.0",
8+
"grunt-execute": "~0.1.5"
89
}
910
}

0 commit comments

Comments
 (0)