diff --git a/.jscsrc b/.jscsrc index 342da66..2561ce9 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,5 +1,10 @@ { "preset": "grunt", + "disallowSpacesInFunctionExpression": null, + "requireSpacesInFunctionExpression": { + "beforeOpeningRoundBrace": true, + "beforeOpeningCurlyBrace": true + }, "disallowSpacesInAnonymousFunctionExpression": null, "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, diff --git a/.jshintrc b/.jshintrc index f391159..620d8d7 100644 --- a/.jshintrc +++ b/.jshintrc @@ -5,7 +5,7 @@ "freeze": true, "funcscope": true, "futurehostile": true, - "globalstrict": true, + "strict": "global", "latedef": true, "maxparams": 1, "noarg": true, @@ -15,5 +15,6 @@ "singleGroups": true, "undef": true, "unused": true, - "eqnull": true + "eqnull": true, + "predef": ["exports"] } diff --git a/.travis.yml b/.travis.yml index 791313a..bab2434 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js -sudo: false -node_js: - - 0.10 +sudo: required +dist: trusty +node_js: 5 env: - PATH=$HOME/purescript:$PATH install: @@ -9,6 +9,16 @@ 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 + - 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 e7d7127..e5d0d87 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Typed definitions for standard Javascript globals. bower install purescript-globals ``` -## Module documentation +## Documentation + +Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-globals). -- [Global](docs/Global.md) diff --git a/bower.json b/bower.json index 132c606..0ea523d 100644 --- a/bower.json +++ b/bower.json @@ -2,9 +2,6 @@ "name": "purescript-globals", "homepage": "https://github.com/purescript/purescript-globals", "description": "Typed definitions for standard Javascript globals", - "keywords": [ - "purescript" - ], "license": "MIT", "repository": { "type": "git", @@ -20,7 +17,7 @@ "package.json" ], "devDependencies": { - "purescript-assert": "^0.1.0", - "purescript-console": "^0.1.0" + "purescript-assert": "^1.0.0-rc.1", + "purescript-console": "^1.0.0-rc.1" } } diff --git a/docs/Global.md b/docs/Global.md deleted file mode 100644 index 64f0efd..0000000 --- a/docs/Global.md +++ /dev/null @@ -1,86 +0,0 @@ -## Module Global - -This module defines types for some global Javascript functions -and values. - -#### `nan` - -``` purescript -nan :: Number -``` - -Not a number (NaN) - -#### `isNaN` - -``` purescript -isNaN :: Number -> Boolean -``` - -Test whether a number is NaN - -#### `infinity` - -``` purescript -infinity :: Number -``` - -Positive infinity - -#### `isFinite` - -``` purescript -isFinite :: Number -> Boolean -``` - -Test whether a number is finite - -#### `readInt` - -``` purescript -readInt :: Int -> String -> Number -``` - -Parse an integer from a `String` in the specified base - -#### `readFloat` - -``` purescript -readFloat :: String -> Number -``` - -Parse a floating point value from a `String` - -#### `decodeURI` - -``` purescript -decodeURI :: String -> String -``` - -uri decoding - -#### `encodeURI` - -``` purescript -encodeURI :: String -> String -``` - -uri encoding - -#### `decodeURIComponent` - -``` purescript -decodeURIComponent :: String -> String -``` - -uri component decoding - -#### `encodeURIComponent` - -``` purescript -encodeURIComponent :: String -> String -``` - -uri component encoding - - diff --git a/docs/Global/Unsafe.md b/docs/Global/Unsafe.md deleted file mode 100644 index 179d8c4..0000000 --- a/docs/Global/Unsafe.md +++ /dev/null @@ -1,12 +0,0 @@ -## Module Global.Unsafe - -#### `unsafeStringify` - -``` purescript -unsafeStringify :: forall a. a -> String -``` - -Uses the global JSON object to turn anything into a string. Careful! Trying -to serialize functions returns undefined - - diff --git a/package.json b/package.json index 7b32506..af45679 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "private": true, "scripts": { - "postinstall": "pulp dep install", - "build": "jshint src && jscs src && pulp test && rimraf docs && pulp docs" + "clean": "rimraf output && rimraf .pulp-cache", + "build": "jshint src && jscs src && pulp build" }, "devDependencies": { - "jscs": "^1.13.1", - "jshint": "^2.8.0", - "pulp": "^4.0.2", - "rimraf": "^2.4.1" + "jscs": "^2.8.0", + "jshint": "^2.9.1", + "pulp": "^8.1.0", + "rimraf": "^2.5.0" } } diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 05ac444..6019d59 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -1,10 +1,15 @@ module Test.Main where -import Prelude -import Control.Monad.Eff.Console (log) +import Prelude (Unit, (==), ($), bind, not, negate, (<), (>), (/=)) + +import Control.Monad.Eff (Eff) +import Control.Monad.Eff.Console (CONSOLE, log) + import Global -import Test.Assert (assert) +import Test.Assert (ASSERT, assert) + +main :: Eff (console :: CONSOLE, assert :: ASSERT) Unit main = do log "nan /= nan"