From c553f47a5c8928ba450dbeac133a9c708298332f Mon Sep 17 00:00:00 2001 From: Cyril Sobierajewicz Date: Sat, 17 Jul 2021 20:49:51 +0200 Subject: [PATCH 1/8] Convert foreign modules to try bundling with esbuild --- src/Partial.js | 2 +- src/Partial/Unsafe.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Partial.js b/src/Partial.js index 4870111..fbf9f25 100644 --- a/src/Partial.js +++ b/src/Partial.js @@ -2,6 +2,6 @@ // module Partial -exports._crashWith = function (msg) { +export var _crashWith = function (msg) { throw new Error(msg); }; diff --git a/src/Partial/Unsafe.js b/src/Partial/Unsafe.js index 7ec706e..52e0965 100644 --- a/src/Partial/Unsafe.js +++ b/src/Partial/Unsafe.js @@ -2,6 +2,6 @@ // module Partial.Unsafe -exports._unsafePartial = function (f) { +export var _unsafePartial = function (f) { return f(); }; From 808ad8bb93f507732397e77ca5382808fba6dd06 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 12:20:34 -0800 Subject: [PATCH 2/8] Update .eslintrc.json to ES6 --- .eslintrc.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 84cef4f..3cae8bd 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,11 @@ { "parserOptions": { - "ecmaVersion": 5 + "ecmaVersion": 6, + "sourceType": "module" }, "extends": "eslint:recommended", "env": { - "commonjs": true + "es6": true }, "rules": { "strict": [2, "global"], From 4b829246a91a82ac36229649ca8f381ee422b0ca Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 12:20:35 -0800 Subject: [PATCH 3/8] Replaced 'export var' with 'export const' --- src/Partial.js | 2 +- src/Partial/Unsafe.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Partial.js b/src/Partial.js index fbf9f25..5e9aa99 100644 --- a/src/Partial.js +++ b/src/Partial.js @@ -2,6 +2,6 @@ // module Partial -export var _crashWith = function (msg) { +export const _crashWith = function (msg) { throw new Error(msg); }; diff --git a/src/Partial/Unsafe.js b/src/Partial/Unsafe.js index 52e0965..7d7d16d 100644 --- a/src/Partial/Unsafe.js +++ b/src/Partial/Unsafe.js @@ -2,6 +2,6 @@ // module Partial.Unsafe -export var _unsafePartial = function (f) { +export const _unsafePartial = function (f) { return f(); }; From 2d3cea481fd2176ea9a638bf316693d3f82bce74 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 12:20:35 -0800 Subject: [PATCH 4/8] Removed '"use strict";' in FFI files --- src/Partial.js | 2 -- src/Partial/Unsafe.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Partial.js b/src/Partial.js index 5e9aa99..1fea9b6 100644 --- a/src/Partial.js +++ b/src/Partial.js @@ -1,5 +1,3 @@ -"use strict"; - // module Partial export const _crashWith = function (msg) { diff --git a/src/Partial/Unsafe.js b/src/Partial/Unsafe.js index 7d7d16d..de0cb0e 100644 --- a/src/Partial/Unsafe.js +++ b/src/Partial/Unsafe.js @@ -1,5 +1,3 @@ -"use strict"; - // module Partial.Unsafe export const _unsafePartial = function (f) { From 8c202a6b6bff1abf5f3198c7447ab53e2e4ab0c6 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 12:20:35 -0800 Subject: [PATCH 5/8] 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 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: From f206449388a49e7a2aa4b36fdfee037e22159c00 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 13:38:58 -0800 Subject: [PATCH 6/8] Update pulp and psa --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fd4391e..a1d6811 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,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 f603a571ee3a0da2abb9ecf1d485128f1b64db8a Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 13:39:17 -0800 Subject: [PATCH 7/8] Drop es6: true in .eslintrc.json --- .eslintrc.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3cae8bd..1c6afb9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,9 +4,6 @@ "sourceType": "module" }, "extends": "eslint:recommended", - "env": { - "es6": true - }, "rules": { "strict": [2, "global"], "block-scoped-var": 2, From e860d4546929ee604bc2fce79ec981d8aacd2615 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 13:40:12 -0800 Subject: [PATCH 8/8] Update changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f55367b..46ba0a7 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 (#24 by @kl0tl and @JordanMartinez) New features: