From b4b5344ca3845770e77de4aa90049b68df7a8c46 Mon Sep 17 00:00:00 2001 From: Nicholas Wolverson Date: Sat, 12 Feb 2022 18:41:55 +0000 Subject: [PATCH 01/14] Add a test --- test/Main.purs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/Main.purs diff --git a/test/Main.purs b/test/Main.purs new file mode 100644 index 0000000..a9586bb --- /dev/null +++ b/test/Main.purs @@ -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" } \ No newline at end of file From 46f047f8f02300dc3c7c1212821bb8f25e5dd3e9 Mon Sep 17 00:00:00 2001 From: Nicholas Wolverson Date: Sat, 12 Feb 2022 18:42:17 +0000 Subject: [PATCH 02/14] ESM conversion --- src/Node/URL.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Node/URL.js b/src/Node/URL.js index 1040baa..d86377b 100644 --- a/src/Node/URL.js +++ b/src/Node/URL.js @@ -1,18 +1,12 @@ "use strict"; -var url = require("url"); -var queryString = require("querystring"); +import url from "url"; +import queryString from "querystring"; +export { parse, format } from 'url'; -exports.parse = url.parse; +export function resolve(from) { + return to => url.resolve(from, to); +} -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; From 57e873dc0a3e842ec243970ee2a86079bfd0a717 Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Sat, 19 Mar 2022 19:25:27 +0000 Subject: [PATCH 03/14] Update .eslintrc.json to ES6 --- .eslintrc.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 84cef4f..1c6afb9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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, From b31c0cf53aefb4075ff874effca808c638ec1ba7 Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Sat, 19 Mar 2022 19:25:28 +0000 Subject: [PATCH 04/14] Update Bower dependencies to master or main --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index b325efb..f8db945 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,6 @@ "url": "https://github.com/purescript-node/purescript-node-url.git" }, "dependencies": { - "purescript-nullable": "^5.0.0" + "purescript-nullable": "main" } } From e1f11ca588e0ecde33e8289b95b54b870f525c8e Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Sat, 19 Mar 2022 19:25:28 +0000 Subject: [PATCH 05/14] Update pulp to 16.0.0-0 and psa to 0.8.2 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1c67b54..4ea39f9 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ }, "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" } } From 04c84b3019108e42e9b5949c03eb8033cd087e8a Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 14:41:59 +0000 Subject: [PATCH 06/14] Removed '"use strict";' in FFI files --- src/Node/URL.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Node/URL.js b/src/Node/URL.js index d86377b..7f1b963 100644 --- a/src/Node/URL.js +++ b/src/Node/URL.js @@ -1,5 +1,3 @@ -"use strict"; - import url from "url"; import queryString from "querystring"; export { parse, format } from 'url'; From 16e3c9256ca3fb1d1e0a9c5a9190a1fbfe9c2373 Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 14:41:59 +0000 Subject: [PATCH 07/14] Update to CI to use 'unstable' purescript --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 063845e..f5a96fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: - uses: actions/checkout@v2 - uses: purescript-contrib/setup-purescript@main + with: + purescript: "unstable" - uses: actions/setup-node@v1 with: From 5018ae5bee4d9b2445e0e4824cead0fd1aa86aff Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 14:51:42 +0000 Subject: [PATCH 08/14] Update Bower dependencies to master or main --- bower.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index f8db945..eb39bfe 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,7 @@ "url": "https://github.com/purescript-node/purescript-node-url.git" }, "dependencies": { - "purescript-nullable": "main" + "purescript-nullable": "main", + "purescript-assert": "master" } } From 0b811096e491c3c2160ed5d3e339042d1382b843 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Tue, 22 Mar 2022 15:08:01 +0000 Subject: [PATCH 09/14] Update test/Main.purs Co-authored-by: Thomas Honeyman --- test/Main.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Main.purs b/test/Main.purs index a9586bb..7a5d9ee 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -9,4 +9,4 @@ 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" } \ No newline at end of file + assertEqual { expected: "foo=42", actual: toQueryString $ parseQueryString "foo=42" } From 55c43bb8e65abf0512fbf2dc979d11025cad8065 Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 15:10:54 +0000 Subject: [PATCH 10/14] Update ci.yml to node 14 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5a96fe..06ed895 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,9 @@ jobs: with: purescript: "unstable" - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - node-version: "10" + node-version: "14" - name: Install dependencies run: | From 2cb619ba68a8e9856e5c029825c7ef501e68024e Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 15:17:44 +0000 Subject: [PATCH 11/14] Add test script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ea39f9..4ed063e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "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", From 8438f780716b79f8501af0a4894d8fb778e3f931 Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 15:17:55 +0000 Subject: [PATCH 12/14] Fix linting issue --- src/Node/URL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node/URL.js b/src/Node/URL.js index 7f1b963..c8afc32 100644 --- a/src/Node/URL.js +++ b/src/Node/URL.js @@ -1,6 +1,6 @@ import url from "url"; import queryString from "querystring"; -export { parse, format } from 'url'; +export { parse, format } from "url"; export function resolve(from) { return to => url.resolve(from, to); From 88f6f865753571352d71047a374fbf8318ed2c8e Mon Sep 17 00:00:00 2001 From: sigma-andex Date: Tue, 22 Mar 2022 15:39:46 +0000 Subject: [PATCH 13/14] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7a06ee..577fb68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: From a9a00bd8425ce13d525f6a245a4103f7161f0b69 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Tue, 22 Mar 2022 12:38:58 -0400 Subject: [PATCH 14/14] Update bower.json --- bower.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index eb39bfe..71cfa21 100644 --- a/bower.json +++ b/bower.json @@ -12,7 +12,9 @@ "url": "https://github.com/purescript-node/purescript-node-url.git" }, "dependencies": { - "purescript-nullable": "main", + "purescript-nullable": "main" + }, + "devDependencies": { "purescript-assert": "master" } }