Skip to content

Commit 9603e90

Browse files
Update to PureScript v0.15.0 (#7)
* Migrated FFI to ES modules via 'lebab' * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Update Bower dependencies to master or main * Update pulp to 16.0.0-0 * Update psa to 0.8.2 * Update Bower dependencies to master or main * Update eslint to es6 * Fix FFI export * Update CI to use Node 14 * Add changelog entry
1 parent b8e10f3 commit 9603e90

File tree

10 files changed

+44
-50
lines changed

10 files changed

+44
-50
lines changed

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
67
"env": {
7-
"commonjs": true,
88
"browser": true
99
},
1010
"globals": {

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
- uses: actions/checkout@v2
1414

1515
- uses: purescript-contrib/setup-purescript@main
16+
with:
17+
purescript: "unstable"
1618

17-
- uses: actions/setup-node@v1
19+
- uses: actions/setup-node@v2
1820
with:
19-
node-version: "10"
21+
node-version: "14"
2022

2123
- name: Install dependencies
2224
run: |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
55
## [Unreleased]
66

77
Breaking changes:
8+
- Migrate FFI to ES modules (#7 by @JordanMartinez)
89

910
New features:
1011

bower.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
"package.json"
1616
],
1717
"dependencies": {
18-
"purescript-arraybuffer-types": "^3.0.0",
19-
"purescript-effect": "^3.0.0",
20-
"purescript-exceptions": "^5.0.0",
21-
"purescript-nullable": "^5.0.0",
22-
"purescript-prelude": "^5.0.0",
23-
"purescript-tuples": "^6.0.0",
24-
"purescript-web-promise": "https://github.com/purescript-web/purescript-web-promise.git#2.0.0"
18+
"purescript-arraybuffer-types": "main",
19+
"purescript-effect": "master",
20+
"purescript-exceptions": "master",
21+
"purescript-nullable": "main",
22+
"purescript-prelude": "master",
23+
"purescript-tuples": "master",
24+
"purescript-web-promise": "https://github.com/purescript-web/purescript-web-promise.git#master"
2525
}
2626
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
},
77
"devDependencies": {
88
"eslint": "^7.15.0",
9-
"pulp": "^15.0.0",
10-
"purescript-psa": "^0.8.0",
9+
"pulp": "16.0.0-0",
10+
"purescript-psa": "^0.8.2",
1111
"rimraf": "^3.0.2"
1212
}
1313
}

src/Web/Streams/QueuingStrategy.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
"use strict";
2-
3-
exports.new = function(options) {
1+
const newImpl = function (options) {
42
return function() {
53
return new QueuingStrategy(options);
64
};
75
};
6+
export { newImpl as new };
87

9-
exports.byteLengthQueuingStrategy = function(options) {
8+
export function byteLengthQueuingStrategy(options) {
109
return function() {
1110
return new ByteLengthQueuingStrategy(options);
1211
};
13-
};
12+
}
1413

15-
exports.countQueuingStrategy = function(options) {
14+
export function countQueuingStrategy(options) {
1615
return function() {
1716
return new CountQueuingStrategy(options);
1817
};
19-
};
18+
}

src/Web/Streams/ReadableStream.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
"use strict";
2-
3-
exports._new = function(source, strategy) {
1+
export function _new(source, strategy) {
42
return new ReadableStream(source, strategy);
5-
};
3+
}
64

7-
exports.cancel = function(stream) {
5+
export function cancel(stream) {
86
return function() {
97
return stream.cancel();
108
};
11-
};
9+
}
1210

13-
exports.locked = function(stream) {
11+
export function locked(stream) {
1412
return function() {
1513
return stream.locked;
1614
};
17-
};
15+
}
1816

19-
exports.getReader = function(stream) {
17+
export function getReader(stream) {
2018
return function() {
2119
return stream.getReader();
2220
};
23-
};
21+
}
2422

25-
exports._tee = function(tuple, stream) {
23+
export function _tee(tuple, stream) {
2624
var r = stream.tee();
2725
return tuple(r[0])(r[1]);
28-
};
26+
}
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
"use strict";
2-
3-
exports.enqueue = function(chunk) {
1+
export function enqueue(chunk) {
42
return function(controller) {
53
return function() {
64
return controller.enqueue(chunk);
75
};
86
};
9-
};
7+
}
108

11-
exports.close = function(controller) {
9+
export function close(controller) {
1210
return function() {
1311
return controller.close();
1412
};
15-
};
13+
}
1614

17-
exports.error = function(error) {
15+
export function error(error) {
1816
return function(controller) {
1917
return function() {
2018
return controller.error(error);
2119
};
2220
};
23-
};
21+
}
2422

25-
exports.desiredSize = function(controller) {
23+
export function desiredSize(controller) {
2624
return function() {
2725
return controller.desiredSize;
2826
};
29-
};
27+
}

src/Web/Streams/Reader.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
"use strict";
2-
3-
exports._read = function(nothing, just, reader) {
1+
export function _read(nothing, just, reader) {
42
return reader.read().then(function(res) {
53
if (res.done) {
64
return nothing;
75
}
86
return just(res.value);
97
});
10-
};
8+
}

src/Web/Streams/Source.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"use strict";
2-
3-
exports._make = function(options) {
1+
export function _make(options) {
42
var newOptions = {
53
start: function(controller) {
64
return options.start(controller)();
@@ -17,4 +15,4 @@ exports._make = function(options) {
1715
};
1816
}
1917
return newOptions;
20-
};
18+
}

0 commit comments

Comments
 (0)