From 5e680ce39543d5b2e07f673948f8dc03d40fcacf Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:43 -0500 Subject: [PATCH 01/14] Update .eslintrc.json to ES6 --- .eslintrc.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2f987eb..d9c39fb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,6 @@ { - "env": { "commonjs": true }, "extends": "eslint:recommended", - "parserOptions": { "ecmaVersion": 5 }, + "parserOptions": { "ecmaVersion": 6, "sourceType": "module" }, "rules": { "block-scoped-var": "error", "consistent-return": "error", From 7a4a5583c5338f1f997922aaec5f816abe37bc41 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 02/14] Migrated FFI to ES modules via 'lebab' --- src/Effect/Aff.js | 57 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/Effect/Aff.js b/src/Effect/Aff.js index e45a46b..7eccaca 100644 --- a/src/Effect/Aff.js +++ b/src/Effect/Aff.js @@ -1039,17 +1039,16 @@ var Aff = function () { return Aff; }(); -exports._pure = Aff.Pure; +export var _pure = Aff.Pure; +export var _throwError = Aff.Throw; -exports._throwError = Aff.Throw; - -exports._catchError = function (aff) { +export function _catchError(aff) { return function (k) { return Aff.Catch(aff, k); }; -}; +} -exports._map = function (f) { +export function _map(f) { return function (aff) { if (aff.tag === Aff.Pure.tag) { return Aff.Pure(f(aff._1)); @@ -1059,57 +1058,57 @@ exports._map = function (f) { }); } }; -}; +} -exports._bind = function (aff) { +export function _bind(aff) { return function (k) { return Aff.Bind(aff, k); }; -}; +} -exports._fork = function (immediate) { +export function _fork(immediate) { return function (aff) { return Aff.Fork(immediate, aff); }; -}; +} -exports._liftEffect = Aff.Sync; +export var _liftEffect = Aff.Sync; -exports._parAffMap = function (f) { +export function _parAffMap(f) { return function (aff) { return Aff.ParMap(f, aff); }; -}; +} -exports._parAffApply = function (aff1) { +export function _parAffApply(aff1) { return function (aff2) { return Aff.ParApply(aff1, aff2); }; -}; +} -exports._parAffAlt = function (aff1) { +export function _parAffAlt(aff1) { return function (aff2) { return Aff.ParAlt(aff1, aff2); }; -}; +} -exports.makeAff = Aff.Async; +export var makeAff = Aff.Async; -exports.generalBracket = function (acquire) { +export function generalBracket(acquire) { return function (options) { return function (k) { return Aff.Bracket(acquire, options, k); }; }; -}; +} -exports._makeFiber = function (util, aff) { +export function _makeFiber(util, aff) { return function () { return Aff.Fiber(util, null, aff); }; -}; +} -exports._makeSupervisedFiber = function (util, aff) { +export function _makeSupervisedFiber(util, aff) { return function () { var supervisor = Aff.Supervisor(util); return { @@ -1117,13 +1116,13 @@ exports._makeSupervisedFiber = function (util, aff) { supervisor: supervisor }; }; -}; +} -exports._killAll = function (error, supervisor, cb) { +export function _killAll(error, supervisor, cb) { return supervisor.killAll(error, cb); -}; +} -exports._delay = function () { +export var _delay = function () { function setDelay(n, k) { if (n === 0 && typeof setImmediate !== "undefined") { return setImmediate(k); @@ -1154,4 +1153,4 @@ exports._delay = function () { }; }(); -exports._sequential = Aff.Seq; +export var _sequential = Aff.Seq; From 1a3bba5b78bcb49ddded8dceca10d5fb22b66b70 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 03/14] Replaced 'export var' with 'export const' --- src/Effect/Aff.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Effect/Aff.js b/src/Effect/Aff.js index 7eccaca..114cd81 100644 --- a/src/Effect/Aff.js +++ b/src/Effect/Aff.js @@ -1039,8 +1039,8 @@ var Aff = function () { return Aff; }(); -export var _pure = Aff.Pure; -export var _throwError = Aff.Throw; +export const _pure = Aff.Pure; +export const _throwError = Aff.Throw; export function _catchError(aff) { return function (k) { @@ -1072,7 +1072,7 @@ export function _fork(immediate) { }; } -export var _liftEffect = Aff.Sync; +export const _liftEffect = Aff.Sync; export function _parAffMap(f) { return function (aff) { @@ -1092,7 +1092,7 @@ export function _parAffAlt(aff1) { }; } -export var makeAff = Aff.Async; +export const makeAff = Aff.Async; export function generalBracket(acquire) { return function (options) { @@ -1122,7 +1122,7 @@ export function _killAll(error, supervisor, cb) { return supervisor.killAll(error, cb); } -export var _delay = function () { +export const _delay = function () { function setDelay(n, k) { if (n === 0 && typeof setImmediate !== "undefined") { return setImmediate(k); @@ -1153,4 +1153,4 @@ export var _delay = function () { }; }(); -export var _sequential = Aff.Seq; +export const _sequential = Aff.Seq; From 9bbe5a1ec7abb57eafa53960f1dfe88290f5f6d4 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 04/14] Removed '"use strict";' in FFI files --- src/Effect/Aff.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Effect/Aff.js b/src/Effect/Aff.js index 114cd81..c029eec 100644 --- a/src/Effect/Aff.js +++ b/src/Effect/Aff.js @@ -1,7 +1,5 @@ /* globals setImmediate, clearImmediate, setTimeout, clearTimeout */ /* eslint-disable no-unused-vars, no-prototype-builtins, no-use-before-define, no-unused-labels, no-param-reassign */ -"use strict"; - var Aff = function () { // A unique value for empty. var EMPTY = {}; From 5d4a9554b9c9ac247532e8c38eaf57f4775ae273 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 05/14] Update to CI to use 'unstable' purescript --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43f9f20..4989d99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: - name: Set up PureScript toolchain uses: purescript-contrib/setup-purescript@main with: + purescript: "unstable" purs-tidy: "latest" - name: Cache PureScript dependencies From c6cabdc9b88dd01410cd1c588ee2c546b410a98b Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 06/14] Add CI test: verify 'bower.json' file works via pulp --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4989d99..266172a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,3 +55,10 @@ jobs: - name: Check formatting run: purs-tidy check src test + + - name: Verify Bower & Pulp + run: | + npm install bower pulp@16.0.0-0 + npx bower install + npx pulp build -- --censor-lib --strict + npx pulp test From 094e33af501e98a7a70724192cd29c308e6c60d2 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 07/14] Ignore spago-based tests (temporarily) --- .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 266172a..a37ef4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,8 +50,8 @@ jobs: - name: Build the project run: npm run build - - name: Run tests - run: npm run test +# - name: Run tests +# run: npm run test - name: Check formatting run: purs-tidy check src test From 6825ca1ffa3c34af0fc4f4bcfc5d61a9a3eb6d1d Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 08/14] Update Bower dependencies to master or main --- bower.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/bower.json b/bower.json index 3d29e88..69a1041 100644 --- a/bower.json +++ b/bower.json @@ -17,22 +17,22 @@ "package.json" ], "dependencies": { - "purescript-arrays": "^v6.0.0", - "purescript-bifunctors": "^v5.0.0", - "purescript-control": "^v5.0.0", - "purescript-datetime": "^v5.0.0", - "purescript-effect": "^v3.0.0", - "purescript-either": "^v5.0.0", - "purescript-exceptions": "^v5.0.0", - "purescript-foldable-traversable": "^v5.0.0", - "purescript-functions": "^v5.0.0", - "purescript-maybe": "^v5.0.0", - "purescript-newtype": "^v4.0.0", - "purescript-parallel": "^v5.0.0", - "purescript-prelude": "^v5.0.0", - "purescript-refs": "^v5.0.0", - "purescript-tailrec": "^v5.0.0", - "purescript-transformers": "^v5.0.0", - "purescript-unsafe-coerce": "^v5.0.0" + "purescript-arrays": "master", + "purescript-bifunctors": "master", + "purescript-control": "master", + "purescript-datetime": "master", + "purescript-effect": "master", + "purescript-either": "master", + "purescript-exceptions": "master", + "purescript-foldable-traversable": "master", + "purescript-functions": "master", + "purescript-maybe": "master", + "purescript-newtype": "master", + "purescript-parallel": "master", + "purescript-prelude": "master", + "purescript-refs": "master", + "purescript-tailrec": "master", + "purescript-transformers": "master", + "purescript-unsafe-coerce": "master" } } From 924a53c4338c919b09fd93300477359c3430ef99 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 09/14] Update packages.dhall to 'prepare-0.15' package set --- packages.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.dhall b/packages.dhall index 7a6905b..582d6d3 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,4 +1,4 @@ let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210722/packages.dhall sha256:1ceb43aa59436bf5601bac45f6f3781c4e1f0e4c2b8458105b018e5ed8c30f8c + https://raw.githubusercontent.com/purescript/package-sets/prepare-0.15/src/packages.dhall in upstream From 9e32605b39239659c3a7fb0fc556ebe6c7a3c15f Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 10/14] Removed unneeded 'psci-support' package --- spago.dhall | 1 - 1 file changed, 1 deletion(-) diff --git a/spago.dhall b/spago.dhall index 69ebdb5..d6bc891 100644 --- a/spago.dhall +++ b/spago.dhall @@ -17,7 +17,6 @@ , "parallel" , "partial" , "prelude" - , "psci-support" , "refs" , "tailrec" , "transformers" From a4591a834046fae23efbb8fdea7f0de3e8f4286b Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:27:44 -0500 Subject: [PATCH 11/14] Update psa to 0.8.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca79d85..1079001 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,6 @@ }, "devDependencies": { "eslint": "^7.10.0", - "purescript-psa": "^0.8.0" + "purescript-psa": "^0.8.2" } } From 5b670ca6b28d1d9f5d3b3675423782bacde1b93e Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 18:47:48 -0500 Subject: [PATCH 12/14] Installed bower dev dependency: purescript-minibench@master --- bower.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bower.json b/bower.json index 69a1041..ec4b33d 100644 --- a/bower.json +++ b/bower.json @@ -34,5 +34,8 @@ "purescript-tailrec": "master", "purescript-transformers": "master", "purescript-unsafe-coerce": "master" + }, + "devDependencies": { + "purescript-minibench": "master" } } From 4c1285f82243854cf36eb4445fdd5ed2dee204b4 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 19:10:06 -0500 Subject: [PATCH 13/14] Installed bower dev dependency: purescript-assert@master --- bower.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index ec4b33d..f40b6ad 100644 --- a/bower.json +++ b/bower.json @@ -36,6 +36,7 @@ "purescript-unsafe-coerce": "master" }, "devDependencies": { - "purescript-minibench": "master" + "purescript-minibench": "master", + "purescript-assert": "master" } } From 05168f33d28bf3d7dd6a7ab7e7e463731f75f9a6 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 21 Mar 2022 19:19:03 -0500 Subject: [PATCH 14/14] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 858ba9e..4c8eb2e 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: +- Migrate FFI to ES modules (#209 by @JordanMartinez) New features: