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, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43d2897..b6ebf3a 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: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e2fbd2..92480b5 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 (#41 by @JordanMartinez) New features: diff --git a/bower.json b/bower.json index f9e0321..a3e7994 100644 --- a/bower.json +++ b/bower.json @@ -16,9 +16,9 @@ "package.json" ], "dependencies": { - "purescript-effect": "^3.0.0", - "purescript-either": "^5.0.0", - "purescript-maybe": "^5.0.0", - "purescript-prelude": "^5.0.0" + "purescript-effect": "master", + "purescript-either": "master", + "purescript-maybe": "master", + "purescript-prelude": "master" } } 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" } } diff --git a/src/Effect/Exception.js b/src/Effect/Exception.js index a5aa8c4..40c0eee 100644 --- a/src/Effect/Exception.js +++ b/src/Effect/Exception.js @@ -1,36 +1,34 @@ -"use strict"; - -exports.showErrorImpl = function (err) { +export function showErrorImpl(err) { return err.stack || err.toString(); -}; +} -exports.error = function (msg) { +export function error(msg) { return new Error(msg); -}; +} -exports.message = function (e) { +export function message(e) { return e.message; -}; +} -exports.name = function (e) { +export function name(e) { return e.name || "Error"; -}; +} -exports.stackImpl = function (just) { +export function stackImpl(just) { return function (nothing) { return function (e) { return e.stack ? just(e.stack) : nothing; }; }; -}; +} -exports.throwException = function (e) { +export function throwException(e) { return function () { throw e; }; -}; +} -exports.catchException = function (c) { +export function catchException(c) { return function (t) { return function () { try { @@ -44,4 +42,4 @@ exports.catchException = function (c) { } }; }; -}; +}