From 6406e9671975905738addc44969206b8177f333d Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 01/13] Migrated FFI to ES modules via 'lebab' --- src/Data/Float32.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Data/Float32.js b/src/Data/Float32.js index 4017f2b..044f9a8 100644 --- a/src/Data/Float32.js +++ b/src/Data/Float32.js @@ -1,9 +1,10 @@ "use strict"; -exports.float32Top = 3.40282e38; -exports.float32Bottom = -3.40282e38; -exports.fromNumberImpl = function fromNumberImpl (x) { +export var float32Top = 3.40282e38; +export var float32Bottom = -3.40282e38; + +export function fromNumberImpl(x) { if (typeof Math.fround !== 'undefined') { return Math.fround(x); } else { @@ -17,5 +18,5 @@ exports.fromNumberImpl = function fromNumberImpl (x) { return r[0]; } } -}; +} From 7afd3bb224645698d9112e8b7371f3f5ea306dda Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 02/13] Replaced 'export var' with 'export const' --- src/Data/Float32.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Data/Float32.js b/src/Data/Float32.js index 044f9a8..18c117d 100644 --- a/src/Data/Float32.js +++ b/src/Data/Float32.js @@ -1,8 +1,8 @@ "use strict"; -export var float32Top = 3.40282e38; -export var float32Bottom = -3.40282e38; +export const float32Top = 3.40282e38; +export const float32Bottom = -3.40282e38; export function fromNumberImpl(x) { if (typeof Math.fround !== 'undefined') { From 64b2748c9a23d7afd29646e1d731f573a1147348 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 03/13] Removed '"use strict";' in FFI files --- src/Data/Float32.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Data/Float32.js b/src/Data/Float32.js index 18c117d..d8ef0da 100644 --- a/src/Data/Float32.js +++ b/src/Data/Float32.js @@ -1,6 +1,3 @@ -"use strict"; - - export const float32Top = 3.40282e38; export const float32Bottom = -3.40282e38; From 4b5aa5f9398b714b178b6d9f34dc78a078c450c2 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 04/13] 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 2d28510..16fa120 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: - name: Set up a PureScript toolchain uses: purescript-contrib/setup-purescript@main with: + purescript: "unstable" purs-tidy: "latest" - name: Cache PureScript dependencies From 993dca2c5541ba525f6a591d3daf22f262231877 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 05/13] 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 16fa120..c5a1684 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,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 ded3f817b03a2e3709af2355f896142ac4ff8145 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 06/13] Ignore spago-based tests (temporarily) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5a1684..cfaf9d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - name: Build tests run: spago -x test.dhall build --no-install --purs-args '--censor-lib --strict' - - name: Run tests +# - name: Run tests run: spago -x test.dhall test --no-install - name: Check formatting From 750a127f9b651de1dc351c71fda1efb5680d4da0 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 07/13] Update Bower dependencies to master or main --- bower.json | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bower.json b/bower.json index 0536de8..a6ecd00 100644 --- a/bower.json +++ b/bower.json @@ -1,22 +1,22 @@ { - "name": "purescript-float32", - "license": [ - "BSD-3-Clause" - ], - "repository": { - "type": "git", - "url": "https://github.com/purescript-contrib/purescript-float32.git" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "output" - ], - "dependencies": { - "purescript-gen": "^v3.0.0", - "purescript-maybe": "^v5.0.0", - "purescript-prelude": "^v5.0.0", - "purescript-psci-support": "^v5.0.0" - } + "name": "purescript-float32", + "license": [ + "BSD-3-Clause" + ], + "repository": { + "type": "git", + "url": "https://github.com/purescript-contrib/purescript-float32.git" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "output" + ], + "dependencies": { + "purescript-gen": "master", + "purescript-maybe": "master", + "purescript-prelude": "master", + "purescript-psci-support": "master" + } } From a46aa40422e691069e0a6077e365d43ace944715 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 08/13] Update packages.dhall to 'prepare-0.15' package set --- packages.dhall | 126 +------------------------------------------------ 1 file changed, 2 insertions(+), 124 deletions(-) diff --git a/packages.dhall b/packages.dhall index 2a73f20..582d6d3 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,126 +1,4 @@ -{- -Welcome to your new Dhall package-set! - -Below are instructions for how to edit this file for most use -cases, so that you don't need to know Dhall to use it. - -## Warning: Don't Move This Top-Level Comment! - -Due to how `dhall format` currently works, this comment's -instructions cannot appear near corresponding sections below -because `dhall format` will delete the comment. However, -it will not delete a top-level comment like this one. - -## Use Cases - -Most will want to do one or both of these options: -1. Override/Patch a package's dependency -2. Add a package not already in the default package set - -This file will continue to work whether you use one or both options. -Instructions for each option are explained below. - -### Overriding/Patching a package - -Purpose: -- Change a package's dependency to a newer/older release than the - default package set's release -- Use your own modified version of some dependency that may - include new API, changed API, removed API by - using your custom git repo of the library rather than - the package set's repo - -Syntax: -Replace the overrides' "{=}" (an empty record) with the following idea -The "//" or "⫽" means "merge these two records and - when they have the same value, use the one on the right:" -------------------------------- -let overrides = - { packageName = - upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" } - , packageName = - upstream.packageName // { version = "v4.0.0" } - , packageName = - upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" } - } -------------------------------- - -Example: -------------------------------- -let overrides = - { halogen = - upstream.halogen // { version = "master" } - , halogen-vdom = - upstream.halogen-vdom // { version = "v4.0.0" } - } -------------------------------- - -### Additions - -Purpose: -- Add packages that aren't already included in the default package set - -Syntax: -Replace the additions' "{=}" (an empty record) with the following idea: -------------------------------- -let additions = - { package-name = - { dependencies = - [ "dependency1" - , "dependency2" - ] - , repo = - "https://example.com/path/to/git/repo.git" - , version = - "tag ('v4.0.0') or branch ('master')" - } - , package-name = - { dependencies = - [ "dependency1" - , "dependency2" - ] - , repo = - "https://example.com/path/to/git/repo.git" - , version = - "tag ('v4.0.0') or branch ('master')" - } - , etc. - } -------------------------------- - -Example: -------------------------------- -let additions = - { benchotron = - { dependencies = - [ "arrays" - , "exists" - , "profunctor" - , "strings" - , "quickcheck" - , "lcg" - , "transformers" - , "foldable-traversable" - , "exceptions" - , "node-fs" - , "node-buffer" - , "node-readline" - , "datetime" - , "now" - ] - , repo = - "https://github.com/hdgarrood/purescript-benchotron.git" - , version = - "v7.0.0" - } - } -------------------------------- --} let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210722/packages.dhall sha256:1ceb43aa59436bf5601bac45f6f3781c4e1f0e4c2b8458105b018e5ed8c30f8c - -let overrides = {=} - -let additions = {=} + https://raw.githubusercontent.com/purescript/package-sets/prepare-0.15/src/packages.dhall -in upstream // overrides // additions +in upstream From 0ab77a3ff74c634458e1c04598e15a9f8f057ceb Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 09:20:56 -0500 Subject: [PATCH 09/13] Removed unneeded 'psci-support' package --- spago.dhall | 1 - 1 file changed, 1 deletion(-) diff --git a/spago.dhall b/spago.dhall index 673f9a7..62bafc8 100644 --- a/spago.dhall +++ b/spago.dhall @@ -4,7 +4,6 @@ [ "gen" , "maybe" , "prelude" - , "psci-support" ] , packages = ./packages.dhall , sources = [ "src/**/*.purs" ] From 1db70f311753cd642a072eee5042a52e20099004 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 12:56:41 -0500 Subject: [PATCH 10/13] Add quickcheck-laws as bower dev dep --- bower.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bower.json b/bower.json index a6ecd00..c002cdf 100644 --- a/bower.json +++ b/bower.json @@ -18,5 +18,8 @@ "purescript-maybe": "master", "purescript-prelude": "master", "purescript-psci-support": "master" + }, + "devDependencies": { + "purescript-quickcheck-laws": "main" } } From bf9225c4465e96be55a18f9cf2c6c457f52584c3 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 12:56:55 -0500 Subject: [PATCH 11/13] Move psci-support to dev dep --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index c002cdf..85259c4 100644 --- a/bower.json +++ b/bower.json @@ -16,10 +16,10 @@ "dependencies": { "purescript-gen": "master", "purescript-maybe": "master", - "purescript-prelude": "master", - "purescript-psci-support": "master" + "purescript-prelude": "master" }, "devDependencies": { + "purescript-psci-support": "master", "purescript-quickcheck-laws": "main" } } From 1d0736958173e2746375d764ebdc7ad93859196e Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Tue, 22 Mar 2022 12:57:44 -0500 Subject: [PATCH 12/13] Added changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 948e65c..0dd5a23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] +Breaking changes: +- Migrate FFI to ES modules (#8 by @JordanMartinez) + ## v1.0.0 2021-06-23 Thank you Athan Clark for donating this package to __purescript-contrib__. From 1907ca2c65dd70d87e39666583d61c00243b89c0 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Tue, 22 Mar 2022 14:00:24 -0400 Subject: [PATCH 13/13] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfaf9d3..50d9084 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: run: spago -x test.dhall build --no-install --purs-args '--censor-lib --strict' # - name: Run tests - run: spago -x test.dhall test --no-install +# run: spago -x test.dhall test --no-install - name: Check formatting run: purs-tidy check src test