From 1d042e350d6a1199d6143b8f7ef84a0a4bb600e9 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:26 -0500 Subject: [PATCH 01/10] 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 d27a510a1ebb1a3d519e758930af8f9f42b23561 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 02/10] Migrated FFI to ES modules via 'lebab' --- src/Effect/Timer.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Effect/Timer.js b/src/Effect/Timer.js index 50ce0de..66108d3 100644 --- a/src/Effect/Timer.js +++ b/src/Effect/Timer.js @@ -1,30 +1,30 @@ /* no-redeclare global exports */ "use strict"; -exports.setTimeout = function (ms) { +export function setTimeout(ms) { return function (fn) { return function () { return setTimeout(fn, ms); }; }; -}; +} -exports.clearTimeout = function (id) { +export function clearTimeout(id) { return function () { clearTimeout(id); }; -}; +} -exports.setInterval = function (ms) { +export function setInterval(ms) { return function (fn) { return function () { return setInterval(fn, ms); }; }; -}; +} -exports.clearInterval = function (id) { +export function clearInterval(id) { return function () { clearInterval(id); }; -}; +} From 5c609e6b40b5b48c7f9b310dd1f0774bd017b7d4 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 03/10] Removed '"use strict";' in FFI files --- src/Effect/Timer.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Effect/Timer.js b/src/Effect/Timer.js index 66108d3..b535175 100644 --- a/src/Effect/Timer.js +++ b/src/Effect/Timer.js @@ -1,6 +1,4 @@ /* no-redeclare global exports */ -"use strict"; - export function setTimeout(ms) { return function (fn) { return function () { From f277a8f83e16a488eeb03b7c9f5817c44a6d5294 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 04/10] 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 ac221e395368a16397e3721af5ab29dd2615aa7c Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 05/10] 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 5315326c686ae3b502b834e15f0654e0b77b5918 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 06/10] 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 71b84f3480769075ae36d7a4323ca95c146362d6 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 07/10] Update Bower dependencies to master or main --- bower.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 6881d61..d3262b4 100644 --- a/bower.json +++ b/bower.json @@ -17,11 +17,11 @@ "package.json" ], "dependencies": { - "purescript-effect": "^3.0.0" + "purescript-effect": "master" }, "devDependencies": { - "purescript-assert": "^5.0.0", - "purescript-console": "^5.0.0", - "purescript-refs": "^5.0.0" + "purescript-assert": "master", + "purescript-console": "master", + "purescript-refs": "master" } } From 492a5596198a5993d11499c76edc3dedae33053f Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:21:27 -0500 Subject: [PATCH 08/10] 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 23ef0843c5e62034c2fa943037d971755ac466a8 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 10:30:18 -0500 Subject: [PATCH 09/10] Removed unneeded 'psci-support' package --- spago.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spago.dhall b/spago.dhall index 59d1efd..419091e 100644 --- a/spago.dhall +++ b/spago.dhall @@ -1,6 +1,6 @@ { name = "js-timers" , dependencies = - [ "assert", "console", "effect", "prelude", "psci-support", "refs" ] + [ "assert", "console", "effect", "prelude", "refs" ] , packages = ./packages.dhall , sources = [ "src/**/*.purs", "test/**/*.purs" ] } From c5e6413731de296538315b238de77eaf2e157732 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 10:31:17 -0500 Subject: [PATCH 10/10] Added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbdb74d..a3aa617 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 (#27 by @JordanMartinez) New features: