Skip to content

Commit bc1e8a4

Browse files
committed
Updates for RC
1 parent 7c123b1 commit bc1e8a4

File tree

11 files changed

+262
-148
lines changed

11 files changed

+262
-148
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/.*
22
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
5+
!/.travis.yml
36
/bower_components/
47
/node_modules/
58
/output/
6-
/tmp/

.jscsrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "grunt",
3+
"disallowSpacesInAnonymousFunctionExpression": null,
4+
"requireSpacesInAnonymousFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
8+
"disallowSpacesInsideObjectBrackets": null,
9+
"requireSpacesInsideObjectBrackets": "all",
10+
"validateQuoteMarks": "\"",
11+
"requireCurlyBraces": null
12+
}

.jshintrc

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

.travis.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: node_js
2+
sudo: false
3+
node_js:
4+
- 0.10
5+
env:
6+
- PATH=$HOME/purescript:$PATH
7+
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
12+
- npm install bower gulp -g
13+
- npm install && bower install
14+
script:
15+
- gulp

README.md

+9-91
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,17 @@
1-
# Module Documentation
1+
# purescript-node-path
22

3-
## Module Node.Path
3+
[![Latest release](http://img.shields.io/bower/v/purescript-node-path.svg)](https://github.com/purescript-node/purescript-node-path/releases)
4+
[![Build Status](https://travis-ci.org/purescript-node/purescript-node-path.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-path)
5+
[![Maintainer: garyb](https://img.shields.io/badge/maintainer-garyb-lightgrey.svg)](http://github.com/garyb)
46

5-
#### `FilePath`
7+
Type type definitions for Node's path module.
68

7-
``` purescript
8-
type FilePath = String
9-
```
10-
11-
Type for strings representing file paths.
12-
13-
#### `normalize`
14-
15-
``` purescript
16-
normalize :: FilePath -> FilePath
17-
```
18-
19-
Normalize a string path, taking care of `..` and `.`, duplicated slashes,
20-
etc. If the path contains a trailing slash it is preserved. On Windows
21-
backslashes are used.
22-
23-
#### `concat`
24-
25-
``` purescript
26-
concat :: [FilePath] -> FilePath
27-
```
28-
29-
Concatenates multiple path segments together and normalizes the resulting path.
30-
31-
#### `resolve`
32-
33-
``` purescript
34-
resolve :: [FilePath] -> FilePath -> FilePath
35-
```
36-
37-
Resolves `to` to an absolute path ([from...], to).
38-
39-
#### `relative`
40-
41-
``` purescript
42-
relative :: FilePath -> FilePath -> FilePath
43-
```
44-
45-
Solve the relative path from `from` to `to`.
46-
47-
#### `dirname`
48-
49-
``` purescript
50-
dirname :: FilePath -> FilePath
51-
```
52-
53-
Return the directory name of a path.
54-
55-
#### `basename`
56-
57-
``` purescript
58-
basename :: FilePath -> FilePath
59-
```
60-
61-
Return the last portion of a path.
62-
63-
#### `basenameWithoutExt`
64-
65-
``` purescript
66-
basenameWithoutExt :: FilePath -> FilePath -> FilePath
67-
```
68-
69-
Return the last portion of a path, also dropping a specific file extension
70-
if it matches the end of the name.
9+
## Installation
7110

72-
#### `extname`
73-
74-
``` purescript
75-
extname :: FilePath -> FilePath
76-
```
77-
78-
Return the extension of the path, from the last `.` to end of string in the
79-
last portion of the path. If there is no `.` in the last portion of the
80-
path or the first character of it is `.`, then it returns an empty string.
81-
82-
#### `sep`
83-
84-
``` purescript
85-
sep :: String
8611
```
87-
88-
The platform-specific file separator. `\\` or `/`.
89-
90-
#### `delimiter`
91-
92-
``` purescript
93-
delimiter :: String
12+
bower install purescript-node-path
9413
```
9514

96-
The platform-specific path delimiter, `;` or `:`.
97-
98-
15+
## Module documentation
9916

17+
- [Node.Path](docs/Node.Path.md)

bower.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{
22
"name": "purescript-node-path",
3-
"homepage": "https://github.com/purescript-contrib/purescript-node-path",
4-
"description": "Type declarations for Node's Path module",
3+
"homepage": "https://github.com/purescript-node/purescript-node-path",
4+
"description": "PureScript type definitions for Node's path module",
55
"keywords": [
66
"purescript"
77
],
88
"license": "MIT",
9+
"repository": {
10+
"type": "git",
11+
"url": "git://github.com/purescript-node/purescript-node-path.git"
12+
},
913
"ignore": [
1014
"**/.*",
1115
"bower_components",
1216
"node_modules",
1317
"output",
14-
"tests",
15-
"tmp",
1618
"bower.json",
17-
"Gruntfile.js",
19+
"gulpfile.js",
1820
"package.json"
1921
]
2022
}

docs/Node.Path.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
## Module Node.Path
2+
3+
#### `FilePath`
4+
5+
``` purescript
6+
type FilePath = String
7+
```
8+
9+
Type for strings representing file paths.
10+
11+
#### `normalize`
12+
13+
``` purescript
14+
normalize :: FilePath -> FilePath
15+
```
16+
17+
Normalize a string path, taking care of `..` and `.`, duplicated slashes,
18+
etc. If the path contains a trailing slash it is preserved. On Windows
19+
backslashes are used.
20+
21+
#### `concat`
22+
23+
``` purescript
24+
concat :: Array FilePath -> FilePath
25+
```
26+
27+
Concatenates multiple path segments together and normalizes the resulting path.
28+
29+
#### `resolve`
30+
31+
``` purescript
32+
resolve :: Array FilePath -> FilePath -> FilePath
33+
```
34+
35+
Resolves `to` to an absolute path ([from...], to).
36+
37+
#### `relative`
38+
39+
``` purescript
40+
relative :: FilePath -> FilePath -> FilePath
41+
```
42+
43+
Solve the relative path from `from` to `to`.
44+
45+
#### `dirname`
46+
47+
``` purescript
48+
dirname :: FilePath -> FilePath
49+
```
50+
51+
Return the directory name of a path.
52+
53+
#### `basename`
54+
55+
``` purescript
56+
basename :: FilePath -> FilePath
57+
```
58+
59+
Return the last portion of a path.
60+
61+
#### `basenameWithoutExt`
62+
63+
``` purescript
64+
basenameWithoutExt :: FilePath -> FilePath -> FilePath
65+
```
66+
67+
Return the last portion of a path, also dropping a specific file extension
68+
if it matches the end of the name.
69+
70+
#### `extname`
71+
72+
``` purescript
73+
extname :: FilePath -> FilePath
74+
```
75+
76+
Return the extension of the path, from the last `.` to end of string in the
77+
last portion of the path. If there is no `.` in the last portion of the
78+
path or the first character of it is `.`, then it returns an empty string.
79+
80+
#### `sep`
81+
82+
``` purescript
83+
sep :: String
84+
```
85+
86+
The platform-specific file separator. `\\` or `/`.
87+
88+
#### `delimiter`
89+
90+
``` purescript
91+
delimiter :: String
92+
```
93+
94+
The platform-specific path delimiter, `;` or `:`.
95+
96+

gulpfile.js

+45-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,60 @@
1+
/* jshint node: true */
12
"use strict";
23

34
var gulp = require("gulp");
5+
var jshint = require("gulp-jshint");
6+
var jscs = require("gulp-jscs");
47
var plumber = require("gulp-plumber");
58
var purescript = require("gulp-purescript");
6-
var jsvalidate = require("gulp-jsvalidate");
9+
var rimraf = require("rimraf");
710

8-
gulp.task("make", function() {
9-
return gulp.src(["src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"])
11+
var sources = [
12+
"src/**/*.purs",
13+
"bower_components/purescript-*/src/**/*.purs"
14+
];
15+
16+
var foreigns = [
17+
"src/**/*.js",
18+
"bower_components/purescript-*/src/**/*.js"
19+
];
20+
21+
gulp.task("clean-docs", function (cb) {
22+
rimraf("docs", cb);
23+
});
24+
25+
gulp.task("clean-output", function (cb) {
26+
rimraf("output", cb);
27+
});
28+
29+
gulp.task("clean", ["clean-docs", "clean-output"]);
30+
31+
gulp.task("lint", function() {
32+
return gulp.src("src/**/*.js")
33+
.pipe(jshint())
34+
.pipe(jshint.reporter())
35+
.pipe(jscs());
36+
});
37+
38+
gulp.task("make", ["lint"], function() {
39+
return gulp.src(sources)
1040
.pipe(plumber())
11-
.pipe(purescript.pscMake());
41+
.pipe(purescript.pscMake({ ffi: foreigns }));
1242
});
1343

14-
gulp.task("jsvalidate", ["make"], function () {
15-
return gulp.src("output/**/*.js")
44+
gulp.task("docs", ["clean-docs"], function () {
45+
return gulp.src(sources)
1646
.pipe(plumber())
17-
.pipe(jsvalidate());
47+
.pipe(purescript.pscDocs({
48+
docgen: {
49+
"Node.Path": "docs/Node.Path.md"
50+
}
51+
}));
1852
});
1953

20-
gulp.task("docs", function () {
21-
return gulp.src("src/**/*.purs")
54+
gulp.task("dotpsci", function () {
55+
return gulp.src(sources)
2256
.pipe(plumber())
23-
.pipe(purescript.pscDocs())
24-
.pipe(gulp.dest("README.md"));
57+
.pipe(purescript.dotPsci());
2558
});
2659

27-
gulp.task("default", ["jsvalidate", "docs"]);
60+
gulp.task("default", ["make", "docs", "dotpsci"]);

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"private": true,
33
"devDependencies": {
44
"gulp": "^3.8.11",
5-
"gulp-jsvalidate": "^1.0.1",
5+
"gulp-jscs": "^1.6.0",
6+
"gulp-jshint": "^1.10.0",
67
"gulp-plumber": "^1.0.0",
7-
"gulp-purescript": "^0.2.0"
8+
"gulp-purescript": "^0.5.0-rc.1",
9+
"rimraf": "^2.3.3"
810
}
911
}

0 commit comments

Comments
 (0)