diff --git a/.gitignore b/.gitignore index 4d159c2..e306283 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ +/.* +!/.gitignore +!/.jscsrc +!/.jshintrc +!/.travis.yml /bower_components/ /node_modules/ -/.pulp-cache/ /output/ -/.psci* -/src/.webpack.js 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..620d8d7 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,20 @@ +{ + "bitwise": true, + "eqeqeq": true, + "forin": true, + "freeze": true, + "funcscope": true, + "futurehostile": true, + "strict": "global", + "latedef": true, + "maxparams": 1, + "noarg": true, + "nocomma": true, + "nonew": true, + "notypeof": true, + "singleGroups": true, + "undef": true, + "unused": true, + "eqnull": true, + "predef": ["exports"] +} diff --git a/.travis.yml b/.travis.yml index 3475898..bab2434 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,24 @@ language: node_js -sudo: false -node_js: - - 0.10 +sudo: required +dist: trusty +node_js: 5 env: - PATH=$HOME/purescript:$PATH install: - - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/v0.8.0-RC1/linux64.tar.gz + - 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') + - 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 + - bower install script: - - npm run build + - npm test +after_success: +- >- + test $TRAVIS_TAG && + psc-publish > .pursuit.json && + curl -X POST http://pursuit.purescript.org/packages \ + -d @.pursuit.json \ + -H 'Accept: application/json' \ + -H "Authorization: token ${GITHUB_TOKEN}" diff --git a/README.md b/README.md index ad2e711..242b265 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,6 @@ Utilities for working with partial functions. bower install purescript-partial ``` -## Module documentation +## Documentation -- [Partial.Unsafe](docs/Partial/Unsafe.md) +Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-partial). diff --git a/bower.json b/bower.json index c483c80..65a76d8 100644 --- a/bower.json +++ b/bower.json @@ -1,16 +1,19 @@ { "name": "purescript-partial", - "moduleType": [ - "node" - ], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "output" - ], + "homepage": "https://github.com/purescript/purescript-partial", + "description": "Mutable value references", + "license": "MIT", "repository": { "type": "git", "url": "git://github.com/purescript/purescript-partial.git" - } + }, + "ignore": [ + "**/.*", + "bower_components", + "node_modules", + "output", + "test", + "bower.json", + "package.json" + ] } diff --git a/docs/Partial.md b/docs/Partial.md deleted file mode 100644 index 8fd3a12..0000000 --- a/docs/Partial.md +++ /dev/null @@ -1,21 +0,0 @@ -## Module Partial - -Some partial helper functions. - -#### `crash` - -``` purescript -crash :: forall a. (Partial) => a -``` - -A partial function which crashes on any input with a default message. - -#### `crashWith` - -``` purescript -crashWith :: forall a. (Partial) => String -> a -``` - -A partial function which crashes on any input with the specified message. - - diff --git a/docs/Partial/Unsafe.md b/docs/Partial/Unsafe.md deleted file mode 100644 index 3c9a5eb..0000000 --- a/docs/Partial/Unsafe.md +++ /dev/null @@ -1,21 +0,0 @@ -## Module Partial.Unsafe - -Utilities for working with partial functions. - -#### `unsafePartial` - -``` purescript -unsafePartial :: forall a. (Partial => a) -> a -``` - -Discharge a partiality constraint, unsafely. - -#### `unsafeCrashWith` - -``` purescript -unsafeCrashWith :: forall a. String -> a -``` - -A function which crashes with the specified error message. - - diff --git a/package.json b/package.json index e3348e6..55fc1c7 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { "private": true, "scripts": { - "postinstall": "pulp dep install", - "build": "pulp build && rimraf docs && pulp docs" + "clean": "rimraf output && rimraf .pulp-cache", + "build": "jshint src && jscs src && pulp build", + "test": "jshint src && jscs src && pulp test" }, "devDependencies": { - "pulp": "^6.0.0", - "rimraf": "^2.4.1" + "jscs": "^2.8.0", + "jshint": "^2.9.1", + "pulp": "^8.1.0", + "rimraf": "^2.5.0" } } diff --git a/src/Partial.js b/src/Partial.js index bfac946..7f7618c 100644 --- a/src/Partial.js +++ b/src/Partial.js @@ -2,8 +2,8 @@ // module Partial -exports.crashWith = function() { - return function(msg) { - throw new Error(msg); - }; +exports.crashWith = function () { + return function (msg) { + throw new Error(msg); + }; }; diff --git a/src/Partial/Unsafe.js b/src/Partial/Unsafe.js index 73f7379..f0be1fd 100644 --- a/src/Partial/Unsafe.js +++ b/src/Partial/Unsafe.js @@ -2,6 +2,6 @@ // module Partial.Unsafe -exports.unsafePartial = function(f) { - return f(); +exports.unsafePartial = function (f) { + return f(); };