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", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43f9f20..a37ef4a 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 @@ -49,8 +50,15 @@ 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 + + - 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 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: diff --git a/bower.json b/bower.json index 3d29e88..f40b6ad 100644 --- a/bower.json +++ b/bower.json @@ -17,22 +17,26 @@ "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" + }, + "devDependencies": { + "purescript-minibench": "master", + "purescript-assert": "master" } } 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" } } 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 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" diff --git a/src/Effect/Aff.js b/src/Effect/Aff.js index e45a46b..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 = {}; @@ -1039,17 +1037,16 @@ var Aff = function () { return Aff; }(); -exports._pure = Aff.Pure; - -exports._throwError = Aff.Throw; +export const _pure = Aff.Pure; +export const _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 +1056,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 const _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 const 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 +1114,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 const _delay = function () { function setDelay(n, k) { if (n === 0 && typeof setImmediate !== "undefined") { return setImmediate(k); @@ -1154,4 +1151,4 @@ exports._delay = function () { }; }(); -exports._sequential = Aff.Seq; +export const _sequential = Aff.Seq;