Skip to content

Prepare for 2.0 release #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.*
!/.gitignore
!/.jscsrc
!/.jshintrc
!/.travis.yml
/bower_components/
/node_modules/
Expand Down
17 changes: 17 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -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
}
19 changes: 19 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
12 changes: 6 additions & 6 deletions src/Node/URL.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
32 changes: 16 additions & 16 deletions src/Node/URL.purs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
foreign import toQueryString :: Query -> String