From 80cf3e82675bb2bfa96cde2507a9bd9828bf5f37 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 01/11] Migrated FFI to ES modules via 'lebab' --- src/Data/Nullable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Data/Nullable.js b/src/Data/Nullable.js index 35039cf..affeca5 100644 --- a/src/Data/Nullable.js +++ b/src/Data/Nullable.js @@ -4,10 +4,10 @@ exports["null"] = null; -exports.nullable = function (a, r, f) { +export function nullable(a, r, f) { return a == null ? r : f(a); -}; +} -exports.notNull = function (x) { +export function notNull(x) { return x; -}; +} From 7d71f6b91da0d38085fbe1b6af97cb1bebbc2c55 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 02/11] Removed '"use strict";' in FFI files --- src/Data/Nullable.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Data/Nullable.js b/src/Data/Nullable.js index affeca5..c15af7b 100644 --- a/src/Data/Nullable.js +++ b/src/Data/Nullable.js @@ -1,7 +1,5 @@ /* eslint-disable no-eq-null, eqeqeq */ -"use strict"; - exports["null"] = null; export function nullable(a, r, f) { From c8a67835295af84a13bc2da72b283158f4be60f4 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 03/11] 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 05d0d2cf3d5b1d5d7bbccfbd631970fa428b46f2 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 04/11] Add CI test: verify 'bower.json' file works via pulp --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4989d99..fc54710 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,3 +55,12 @@ 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 + if [ -d "test" ]; then + npx pulp test + fi From f8fc3627ff67b03cf1f06adbb6e80d0361233fd8 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 05/11] 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 fc54710..e16f413 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 b6b5f748fe377010f5a2881311407dfc120533af Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 06/11] Update Bower dependencies to master or main --- bower.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bower.json b/bower.json index 00e99a3..3a3f733 100644 --- a/bower.json +++ b/bower.json @@ -18,12 +18,12 @@ "package.json" ], "dependencies": { - "purescript-effect": "^3.0.0", - "purescript-functions": "^5.0.0", - "purescript-maybe": "^5.0.0", - "purescript-prelude": "^5.0.0" + "purescript-effect": "master", + "purescript-functions": "master", + "purescript-maybe": "master", + "purescript-prelude": "master" }, "devDependencies": { - "purescript-assert": "^5.0.0" + "purescript-assert": "master" } } From 8f806271fe4487c239294d68c61344ca4ef3212c Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 07/11] 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 ac1995817854c3f72ab84784e47276759ba331d1 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:39:01 -0500 Subject: [PATCH 08/11] Removed unneeded 'psci-support' package --- spago.dhall | 1 - 1 file changed, 1 deletion(-) diff --git a/spago.dhall b/spago.dhall index 2f813bb..4e13bfd 100644 --- a/spago.dhall +++ b/spago.dhall @@ -5,7 +5,6 @@ , "functions" , "maybe" , "prelude" - , "psci-support" ] , packages = ./packages.dhall , sources = [ "src/**/*.purs", "test/**/*.purs" ] From 7d29f59444d2bb3d35a0b3fe24ae451bbeb0bce7 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:43:55 -0500 Subject: [PATCH 09/11] Update .eslintrc.json to ES6 --- .eslintrc.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 17f167d..240b092 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,7 @@ { - "env": { "browser": true, "commonjs": true }, + "env": { "browser": true }, "extends": "eslint:recommended", - "parserOptions": { "ecmaVersion": 5 }, + "parserOptions": { "ecmaVersion": 6, "sourceType": "module" }, "rules": { "block-scoped-var": "error", "consistent-return": "error", From 53cc83deb918aabcbebfd16443c2722bffb0e1af Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:44:06 -0500 Subject: [PATCH 10/11] Fix exporting of null --- src/Data/Nullable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Data/Nullable.js b/src/Data/Nullable.js index c15af7b..e66d640 100644 --- a/src/Data/Nullable.js +++ b/src/Data/Nullable.js @@ -1,6 +1,7 @@ /* eslint-disable no-eq-null, eqeqeq */ -exports["null"] = null; +const nullImpl = null; +export { nullImpl as null }; export function nullable(a, r, f) { return a == null ? r : f(a); From 21b1e1b4c397722d162427ce4f7a9f93f8492f69 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 08:46:23 -0500 Subject: [PATCH 11/11] Added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 880ae14..a11de33 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 (#44 by @JordanMartinez) New features: