diff --git a/.gitignore b/.gitignore index 1036ea9..bd1f624 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ /.* !/.gitignore +!/.jscsrc +!/.jshintrc +!/.travis.yml /bower_components/ /node_modules/ -/output/ /tmp/ -docs/Node/FS/Internal.md +/output/ diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 0000000..2561ce9 --- /dev/null +++ b/.jscsrc @@ -0,0 +1,17 @@ +{ + "preset": "grunt", + "disallowSpacesInFunctionExpression": null, + "requireSpacesInFunctionExpression": { + "beforeOpeningRoundBrace": true, + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInAnonymousFunctionExpression": null, + "requireSpacesInAnonymousFunctionExpression": { + "beforeOpeningRoundBrace": true, + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInsideObjectBrackets": null, + "requireSpacesInsideObjectBrackets": "all", + "validateQuoteMarks": "\"", + "requireCurlyBraces": null +} diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..cbc1c5f --- /dev/null +++ b/.jshintrc @@ -0,0 +1,19 @@ +{ + "bitwise": true, + "eqeqeq": true, + "forin": true, + "freeze": true, + "funcscope": true, + "futurehostile": true, + "strict": "global", + "latedef": true, + "noarg": true, + "nocomma": true, + "nonew": true, + "notypeof": true, + "singleGroups": true, + "undef": true, + "unused": true, + "eqnull": true, + "predef": ["exports", "require"] +} diff --git a/.travis.yml b/.travis.yml index 2c1768e..3455305 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ language: node_js -sudo: false -node_js: - - 4 - - 5 +dist: trusty +sudo: required +node_js: 6 env: - PATH=$HOME/purescript:$PATH install: @@ -10,6 +9,15 @@ install: - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz - tar -xvf $HOME/purescript.tar.gz -C $HOME/ - chmod a+x $HOME/purescript + - npm install -g bower - npm install script: - - npm run build + - bower install --production + - npm run -s build + - bower install + - npm -s test +after_success: +- >- + test $TRAVIS_TAG && + echo $GITHUB_TOKEN | pulp login && + echo y | pulp publish --no-push diff --git a/README.md b/README.md index 2bd3bb4..6995ea8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ # purescript-node-fs -Bindings to node's "fs" module. +[![Latest release](http://img.shields.io/bower/v/purescript-node-fs.svg)](https://github.com/purescript-node/purescript-node-fs/releases) +[![Build Status](https://travis-ci.org/purescript-node/purescript-node-fs.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-fs) +[![Dependency Status](https://www.versioneye.com/user/projects/575bdefb7757a0003bd4bff5/badge.svg?style=flat)](https://www.versioneye.com/user/projects/575bdefb7757a0003bd4bff5) -Module documentation is hosted on [Pursuit](http://pursuit.purescript.org/packages/purescript-node-fs). +PureScript bindings to node's `fs` module. + +## Installation + +``` +bower install purescript-node-fs +``` + +## Documentation + +Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-node-fs). diff --git a/bower.json b/bower.json index 943eff3..acea05d 100644 --- a/bower.json +++ b/bower.json @@ -6,10 +6,15 @@ "purescript" ], "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/purescript-node/purescript-node-fs" + }, "ignore": [ "**/.*", "bower_components", "node_modules", + "tmp", "output", "bower.json", "package.json" @@ -28,9 +33,5 @@ }, "devDependencies": { "purescript-console": "^1.0.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/purescript-node/purescript-node-fs" } } diff --git a/package.json b/package.json index a986c5f..52970b2 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { "private": true, + "scripts": { + "clean": "rimraf output && rimraf .pulp-cache", + "build": "jshint src && jscs src && pulp build --censor-lib --strict", + "test": "pulp test" + }, "devDependencies": { + "jscs": "^2.8.0", + "jshint": "^2.9.1", "pulp": "^9.0.1", - "bower": "^1.7.7" - }, - "scripts": { - "postinstall": "bower install", - "build": "pulp build" + "purescript-psa": "^0.3.8", + "rimraf": "^2.5.0" } } diff --git a/src/Node/FS/Async.js b/src/Node/FS/Async.js index c47cf76..e1f1ba9 100644 --- a/src/Node/FS/Async.js +++ b/src/Node/FS/Async.js @@ -1,9 +1,5 @@ -/* global require */ -/* global exports */ "use strict"; -// module Node.FS.Async - exports.handleCallbackImpl = function (left, right, f) { return function (err, value) { if (err) { diff --git a/src/Node/FS/Internal.js b/src/Node/FS/Internal.js index 90c3442..0bced8a 100644 --- a/src/Node/FS/Internal.js +++ b/src/Node/FS/Internal.js @@ -1,4 +1,3 @@ "use strict"; -// module Node.FS.Internal exports.unsafeRequireFS = require("fs"); diff --git a/src/Node/FS/Stats.js b/src/Node/FS/Stats.js index dd0a0a5..31a1bc9 100644 --- a/src/Node/FS/Stats.js +++ b/src/Node/FS/Stats.js @@ -1,11 +1,7 @@ -/* global require */ -/* global exports */ "use strict"; -// module Node.FS.Stats - -exports.showStatsObj = require('util').inspect; +exports.showStatsObj = require("util").inspect; exports.statsMethod = function (m, s) { return s[m](); -} +};