Skip to content

Commit a503349

Browse files
Update to PureScript v0.15.0 (#41)
* Migrated FFI to ES modules via 'lebab' * Replaced 'export var' with 'export const' * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Add CI test: verify 'bower.json' file works via pulp * Ignore spago-based tests (temporarily) * Update Bower dependencies to master or main * Update packages.dhall to 'prepare-0.15' package set * Fix FFI exports * Update SProxy to use Proxy * Installed bower dev dependency: purescript-quickcheck-laws@main * Fix Proxy import * Add changelog entry * Update .github/workflows/ci.yml Co-authored-by: Thomas Honeyman <[email protected]> Co-authored-by: Thomas Honeyman <[email protected]>
1 parent 51271ec commit a503349

File tree

9 files changed

+147
-142
lines changed

9 files changed

+147
-142
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- name: Set up a PureScript toolchain
1717
uses: purescript-contrib/setup-purescript@main
1818
with:
19+
purescript: "unstable"
1920
purs-tidy: "latest"
2021

2122
- name: Cache PureScript dependencies
@@ -38,8 +39,17 @@ jobs:
3839
- name: Build tests
3940
run: spago -x spago-test.dhall build --no-install --purs-args '--censor-lib --strict'
4041

41-
- name: Run tests
42-
run: spago -x spago-test.dhall test --no-install
42+
# - name: Run tests
43+
# run: spago -x spago-test.dhall test --no-install
4344

4445
- name: Check formatting
4546
run: purs-tidy check src test
47+
48+
- name: Verify Bower & Pulp
49+
run: |
50+
npm install bower [email protected]
51+
npx bower install
52+
npx pulp build -- --censor-lib --strict
53+
if [ -d "test" ]; then
54+
npx pulp test
55+
fi

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## Unreleased
6+
7+
Breaking Changes:
8+
- Migrate FFI to ES modules (#41 by @JordanMartinez)
9+
- Replaced polymorphic proxies with monomorphic `Proxy` (#41 by @JordanMartinez)
10+
511
## v12.0.0
612

713
Delete the `TypedArray` polyfill which was preventing this

bower.json

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
{
2-
"name": "purescript-arraybuffer",
3-
"license": [
4-
"MIT"
5-
],
6-
"repository": {
7-
"type": "git",
8-
"url": "https://github.com/purescript-contrib/purescript-arraybuffer"
9-
},
10-
"ignore": [
11-
"**/.*",
12-
"node_modules",
13-
"bower_components",
14-
"output"
15-
],
16-
"dependencies": {
17-
"purescript-arraybuffer-types": "^v3.0.1",
18-
"purescript-arrays": "^v6.0.1",
19-
"purescript-effect": "^v3.0.0",
20-
"purescript-float32": "^v1.0.0",
21-
"purescript-functions": "^v5.0.0",
22-
"purescript-gen": "^v3.0.0",
23-
"purescript-maybe": "^v5.0.0",
24-
"purescript-nullable": "^v5.0.0",
25-
"purescript-prelude": "^v5.0.1",
26-
"purescript-tailrec": "^v5.0.1",
27-
"purescript-uint": "^v6.0.3",
28-
"purescript-unfoldable": "^v5.0.0"
29-
}
2+
"name": "purescript-arraybuffer",
3+
"license": [
4+
"MIT"
5+
],
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/purescript-contrib/purescript-arraybuffer"
9+
},
10+
"ignore": [
11+
"**/.*",
12+
"node_modules",
13+
"bower_components",
14+
"output"
15+
],
16+
"dependencies": {
17+
"purescript-arraybuffer-types": "main",
18+
"purescript-arrays": "master",
19+
"purescript-effect": "master",
20+
"purescript-float32": "main",
21+
"purescript-functions": "master",
22+
"purescript-gen": "master",
23+
"purescript-maybe": "master",
24+
"purescript-nullable": "main",
25+
"purescript-prelude": "master",
26+
"purescript-tailrec": "master",
27+
"purescript-uint": "main",
28+
"purescript-unfoldable": "master"
29+
},
30+
"devDependencies": {
31+
"purescript-quickcheck-laws": "main"
32+
}
3033
}

packages.dhall

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210722/packages.dhall sha256:1ceb43aa59436bf5601bac45f6f3781c4e1f0e4c2b8458105b018e5ed8c30f8c
2+
https://raw.githubusercontent.com/purescript/package-sets/prepare-0.15/src/packages.dhall
33

4-
let overrides = {=}
5-
6-
let additions = {=}
7-
8-
in upstream // overrides // additions
4+
in upstream

src/Data/ArrayBuffer/ArrayBuffer.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
"use strict";
2-
31
// module Data.ArrayBuffer.ArrayBuffer
42

5-
exports.emptyImpl = function empty (s) {
3+
export function emptyImpl(s) {
64
return new ArrayBuffer(s);
75
};
86

9-
exports.byteLength = function byteLength (a) {
7+
export function byteLength(a) {
108
return a.byteLength;
11-
};
9+
}
1210

13-
exports.sliceImpl = function sliceImpl (a, s, e) {
11+
export function sliceImpl(a, s, e) {
1412
return a.slice(s, e);
15-
};
13+
}

src/Data/ArrayBuffer/DataView.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
"use strict";
2-
31
// module Data.ArrayBuffer.DataView
42

53

6-
exports.whole = function whole (b) {
4+
export function whole(b) {
75
return new DataView(b);
8-
};
6+
}
97

10-
exports.remainderImpl = function remainderImpl (b,i) {
8+
export function remainderImpl(b, i) {
119
return new DataView(b,i);
12-
};
10+
}
1311

14-
exports.partImpl = function partImpl (b,i,j) {
12+
export function partImpl(b, i, j) {
1513
return new DataView(b,i,j);
16-
};
14+
}
1715

18-
exports.buffer = function buffer (v) {
16+
export function buffer(v) {
1917
return v.buffer;
20-
};
18+
}
2119

22-
exports.byteOffset = function byteOffset (v) {
20+
export function byteOffset(v) {
2321
return v.byteOffset;
24-
};
22+
}
2523

26-
exports.byteLength = function byteLength (v) {
24+
export function byteLength(v) {
2725
return v.byteLength;
28-
};
26+
}
2927

30-
exports.getterImpl = function getterImpl (data, v, o) {
28+
export function getterImpl(data, v, o) {
3129
return ((o + data.bytesPerValue) >>> 0) <= v.byteLength
3230
? v[data.functionName].call(v,o,data.littleEndian)
3331
: null;
34-
};
32+
}
3533

36-
exports.setterImpl = function setterImpl (data, v, o, n) {
34+
export function setterImpl(data, v, o, n) {
3735
if (((o + data.bytesPerValue) >>> 0) <= v.byteLength) {
3836
v[data.functionName].call(v,o,n,data.littleEndian);
3937
return true;
4038
} else {
4139
return false;
4240
}
43-
};
41+
}

src/Data/ArrayBuffer/DataView.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import Data.ArrayBuffer.ValueMapping (class BinaryValue, class BytesPerType, cla
4949
import Data.Float32 (Float32) as F
5050
import Data.Maybe (Maybe)
5151
import Data.Nullable (Nullable, toMaybe)
52-
import Data.Symbol (SProxy(..), class IsSymbol, reflectSymbol)
52+
import Data.Symbol (class IsSymbol, reflectSymbol)
5353
import Data.UInt (UInt)
5454
import Effect (Effect)
5555
import Effect.Uncurried (EffectFn2, EffectFn3, EffectFn4, runEffectFn2, runEffectFn3, runEffectFn4)
@@ -131,7 +131,7 @@ get
131131
get endian prx = do
132132
let
133133
le = endian == LE
134-
pnm = "get" <> reflectSymbol (SProxy :: SProxy name)
134+
pnm = "get" <> reflectSymbol (Proxy :: Proxy name)
135135
bpv = byteWidth prx
136136

137137
getter
@@ -203,7 +203,7 @@ set
203203
set endian prx = do
204204
let
205205
le = endian == LE
206-
pnm = "set" <> reflectSymbol (SProxy :: SProxy name)
206+
pnm = "set" <> reflectSymbol (Proxy :: Proxy name)
207207
bpv = byteWidth prx
208208

209209
setter

0 commit comments

Comments
 (0)