Skip to content

Commit a78ad29

Browse files
authoredMar 22, 2022
Update to PureScript v0.15.0 (#16)
1 parent d5671f5 commit a78ad29

File tree

7 files changed

+35
-26
lines changed

7 files changed

+35
-26
lines changed
 

‎.eslintrc.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
6-
"env": {
7-
"commonjs": true
8-
},
97
"rules": {
108
"strict": [2, "global"],
119
"block-scoped-var": 2,

‎.github/workflows/ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
- uses: actions/checkout@v2
1414

1515
- uses: purescript-contrib/setup-purescript@main
16+
with:
17+
purescript: "unstable"
1618

17-
- uses: actions/setup-node@v1
19+
- uses: actions/setup-node@v2
1820
with:
19-
node-version: "10"
21+
node-version: "14"
2022

2123
- name: Install dependencies
2224
run: |

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
55
## [Unreleased]
66

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

910
New features:
1011

‎bower.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"url": "https://github.com/purescript-node/purescript-node-url.git"
1313
},
1414
"dependencies": {
15-
"purescript-nullable": "^5.0.0"
15+
"purescript-nullable": "main"
16+
},
17+
"devDependencies": {
18+
"purescript-assert": "master"
1619
}
1720
}

‎package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "eslint src && pulp build -- --censor-lib --strict"
5+
"build": "eslint src && pulp build -- --censor-lib --strict",
6+
"test": "pulp test -- --censor-lib --strict"
67
},
78
"devDependencies": {
89
"eslint": "^7.15.0",
9-
"pulp": "^15.0.0",
10-
"purescript-psa": "^0.8.0",
10+
"pulp": "16.0.0-0",
11+
"purescript-psa": "^0.8.2",
1112
"rimraf": "^3.0.2"
1213
}
1314
}

‎src/Node/URL.js

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
"use strict";
1+
import url from "url";
2+
import queryString from "querystring";
3+
export { parse, format } from "url";
24

3-
var url = require("url");
4-
var queryString = require("querystring");
5+
export function resolve(from) {
6+
return to => url.resolve(from, to);
7+
}
58

6-
exports.parse = url.parse;
7-
8-
exports.format = url.format;
9-
10-
exports.resolve = function (from) {
11-
return function (to) {
12-
return url.resolve(from, to);
13-
};
14-
};
15-
16-
exports.parseQueryString = queryString.parse;
17-
18-
exports.toQueryString = queryString.stringify;
9+
export const parseQueryString = queryString.parse;
10+
export const toQueryString = queryString.stringify;

‎test/Main.purs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module Test.Main where
2+
3+
import Prelude
4+
5+
import Effect (Effect)
6+
import Node.URL (format, parse, parseQueryString, toQueryString)
7+
import Test.Assert (assertEqual)
8+
9+
main Effect Unit
10+
main = do
11+
assertEqual { expected: "http://example.com/", actual: format $ parse "http://example.com/" }
12+
assertEqual { expected: "foo=42", actual: toQueryString $ parseQueryString "foo=42" }

0 commit comments

Comments
 (0)
Please sign in to comment.