Skip to content

Update to PureScript v0.15.0 #16

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
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
6 changes: 2 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"parserOptions": {
"ecmaVersion": 5
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": "eslint:recommended",
"env": {
"commonjs": true
},
"rules": {
"strict": [2, "global"],
"block-scoped-var": 2,
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: "10"
node-version: "14"

- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
## [Unreleased]

Breaking changes:
- Update project and deps to PureScript v0.15.0 (#16 by @nwolverson, @JordanMartinez, @sigma-andex)

New features:

Expand Down
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"url": "https://github.com/purescript-node/purescript-node-url.git"
},
"dependencies": {
"purescript-nullable": "^5.0.0"
"purescript-nullable": "main"
},
"devDependencies": {
"purescript-assert": "master"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a devDependency?

}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "eslint src && pulp build -- --censor-lib --strict"
"build": "eslint src && pulp build -- --censor-lib --strict",
"test": "pulp test -- --censor-lib --strict"
},
"devDependencies": {
"eslint": "^7.15.0",
"pulp": "^15.0.0",
"purescript-psa": "^0.8.0",
"pulp": "16.0.0-0",
"purescript-psa": "^0.8.2",
"rimraf": "^3.0.2"
}
}
24 changes: 8 additions & 16 deletions src/Node/URL.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
"use strict";
import url from "url";
import queryString from "querystring";
export { parse, format } from "url";

var url = require("url");
var queryString = require("querystring");
export function resolve(from) {
return to => url.resolve(from, to);
}

exports.parse = url.parse;

exports.format = url.format;

exports.resolve = function (from) {
return function (to) {
return url.resolve(from, to);
};
};

exports.parseQueryString = queryString.parse;

exports.toQueryString = queryString.stringify;
export const parseQueryString = queryString.parse;
export const toQueryString = queryString.stringify;
12 changes: 12 additions & 0 deletions test/Main.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Test.Main where

import Prelude

import Effect (Effect)
import Node.URL (format, parse, parseQueryString, toQueryString)
import Test.Assert (assertEqual)

main ∷ Effect Unit
main = do
assertEqual { expected: "http://example.com/", actual: format $ parse "http://example.com/" }
assertEqual { expected: "foo=42", actual: toQueryString $ parseQueryString "foo=42" }