From e27c9d986b9bd22ac89e5acbd92b1f7d26c99162 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Sat, 22 Oct 2016 14:22:45 +0100 Subject: [PATCH] Prepare for 2.0 release --- .gitignore | 2 ++ .jscsrc | 17 +++++++++++++++++ .jshintrc | 19 +++++++++++++++++++ .travis.yml | 7 ++++++- README.md | 2 +- bower.json | 4 ++-- package.json | 11 +++++++---- src/Node/URL.js | 12 ++++++------ src/Node/URL.purs | 32 ++++++++++++++++---------------- 9 files changed, 76 insertions(+), 30 deletions(-) create mode 100644 .jscsrc create mode 100644 .jshintrc diff --git a/.gitignore b/.gitignore index 307f9c0..e306283 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ /.* !/.gitignore +!/.jscsrc +!/.jshintrc !/.travis.yml /bower_components/ /node_modules/ 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..94a944d --- /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, + "node": true +} diff --git a/.travis.yml b/.travis.yml index 64825f3..78cde3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,11 @@ node_js: 6 install: - npm install -g bower - npm install - - bower install + - bower install --production script: - npm run -s build +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 e0dad8d..a3edd39 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # purescript-node-url -[![Latest release](http://img.shields.io/bower/v/purescript-node-url.svg)](https://github.com/purescript-node/purescript-node-url/releases) +[![Latest release](http://img.shields.io/github/release/purescript-node/purescript-node-url.svg)](https://github.com/purescript-node/purescript-node-url/releases) [![Build Status](https://travis-ci.org/purescript-node/purescript-node-url.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-url) A wrapper for Node's `URL` and `QueryString` APIs diff --git a/bower.json b/bower.json index 1f61975..456aea9 100644 --- a/bower.json +++ b/bower.json @@ -12,9 +12,9 @@ "url": "git://github.com/purescript-node/purescript-node-url.git" }, "devDependencies": { - "purescript-console": "^1.0.0" + "purescript-console": "^2.0.0" }, "dependencies": { - "purescript-nullable": "^1.0.0" + "purescript-nullable": "^2.0.0" } } diff --git a/package.json b/package.json index 8212e00..8e20023 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,15 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build --censor-lib --strict" + "build": "jshint src && jscs src && pulp build --censor-lib --strict", + "test": "pulp test" }, "devDependencies": { - "pulp": "^9.0.0", + "jscs": "^3.0.7", + "jshint": "^2.9.4", + "pulp": "^9.0.1", "purescript-psa": "^0.3.9", - "purescript": "^0.9.1", - "rimraf": "^2.5.0" + "purescript": "^0.10.1", + "rimraf": "^2.5.4" } } diff --git a/src/Node/URL.js b/src/Node/URL.js index 14b4ad7..1040baa 100644 --- a/src/Node/URL.js +++ b/src/Node/URL.js @@ -1,16 +1,16 @@ "use strict"; -var url = require('url'); -var queryString = require('querystring'); +var url = require("url"); +var queryString = require("querystring"); exports.parse = url.parse; exports.format = url.format; -exports.resolve = function(from) { - return function(to) { - return url.resolve(from, to); - } +exports.resolve = function (from) { + return function (to) { + return url.resolve(from, to); + }; }; exports.parseQueryString = queryString.parse; diff --git a/src/Node/URL.purs b/src/Node/URL.purs index 88190f6..08df4f8 100644 --- a/src/Node/URL.purs +++ b/src/Node/URL.purs @@ -1,36 +1,36 @@ -- | This module defines bindings to the Node URL and Query String APIs. module Node.URL where - + import Data.Nullable - + -- | A query object is a JavaScript object whose values are strings or arrays of strings. -- | -- | It is intended that the user coerce values of this type to/from some trusted representation via -- | e.g. `Data.Foreign` or `Unsafe.Coerce`.. data Query - + -- | A URL object. -- | --- | All fields are nullable, and will be missing if the URL string passed to +-- | All fields are nullable, and will be missing if the URL string passed to -- | `parse` did not contain the appropriate URL part. -type URL = +type URL = { protocol :: Nullable String - , slashes :: Nullable Boolean - , host :: Nullable String - , auth :: Nullable String + , slashes :: Nullable Boolean + , host :: Nullable String + , auth :: Nullable String , hostname :: Nullable String - , port :: Nullable String + , port :: Nullable String , pathname :: Nullable String - , search :: Nullable String - , path :: Nullable String - , query :: Nullable String - , hash :: Nullable String + , search :: Nullable String + , path :: Nullable String + , query :: Nullable String + , hash :: Nullable String } - + -- | Parse a URL string into a URL object. foreign import parse :: String -> URL - + -- | Format a URL object as a URL string. foreign import format :: URL -> String @@ -41,4 +41,4 @@ foreign import resolve :: String -> String -> String foreign import parseQueryString :: String -> Query -- | Convert a query string to an object. -foreign import toQueryString :: Query -> String \ No newline at end of file +foreign import toQueryString :: Query -> String