Skip to content

Commit f22bedf

Browse files
Update to v0.15.0 (#47)
* Convert foreign modules to try bundling with esbuild * fixup! Convert foreign modules to try bundling with esbuild * Replaced 'export var' with 'export const' * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Update pulp to 16.0.0-0 and psa to 0.8.2 * Update Bower dependencies to master * Update .eslintrc.json to ES6 * Fix eslint warning * Added changelog entry Co-authored-by: Cyril Sobierajewicz <sobierajewicz.cyril@gmail.com>
1 parent 994eb5e commit f22bedf

File tree

6 files changed

+29
-27
lines changed

6 files changed

+29
-27
lines changed

.eslintrc.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
6-
"env": {
7-
"commonjs": true
8-
},
97
"rules": {
108
"strict": [2, "global"],
119
"block-scoped-var": 2,

.github/workflows/ci.yml

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

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

1719
- uses: actions/setup-node@v1
1820
with:

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 (#47 by @kl0tl and @JordanMartinez)
89

910
New features:
1011

bower.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-partial": "^3.0.0",
21-
"purescript-prelude": "^5.0.0",
22-
"purescript-tailrec": "^5.0.0",
23-
"purescript-unsafe-coerce": "^5.0.0"
20+
"purescript-partial": "master",
21+
"purescript-prelude": "master",
22+
"purescript-tailrec": "master",
23+
"purescript-unsafe-coerce": "master"
2424
},
2525
"devDependencies": {
26-
"purescript-console": "^5.0.0"
26+
"purescript-console": "master"
2727
}
2828
}

package.json

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

src/Control/Monad/ST/Internal.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
1-
"use strict";
2-
3-
exports.map_ = function (f) {
1+
export const map_ = function (f) {
42
return function (a) {
53
return function () {
64
return f(a());
75
};
86
};
97
};
108

11-
exports.pure_ = function (a) {
9+
export const pure_ = function (a) {
1210
return function () {
1311
return a;
1412
};
1513
};
1614

17-
exports.bind_ = function (a) {
15+
export const bind_ = function (a) {
1816
return function (f) {
1917
return function () {
2018
return f(a())();
2119
};
2220
};
2321
};
2422

25-
exports.run = function (f) {
23+
export const run = function (f) {
2624
return f();
2725
};
2826

29-
exports["while"] = function (f) {
27+
function whileST(f) {
3028
return function (a) {
3129
return function () {
3230
while (f()) {
3331
a();
3432
}
3533
};
3634
};
37-
};
35+
}
36+
export { whileST as while };
3837

39-
exports["for"] = function (lo) {
38+
function forST(lo) {
4039
return function (hi) {
4140
return function (f) {
4241
return function () {
@@ -46,9 +45,10 @@ exports["for"] = function (lo) {
4645
};
4746
};
4847
};
49-
};
48+
}
49+
export { forST as for };
5050

51-
exports.foreach = function (as) {
51+
export const foreach = function (as) {
5252
return function (f) {
5353
return function () {
5454
for (var i = 0, l = as.length; i < l; i++) {
@@ -58,19 +58,20 @@ exports.foreach = function (as) {
5858
};
5959
};
6060

61-
exports.new = function (val) {
61+
function newSTRef(val) {
6262
return function () {
6363
return { value: val };
6464
};
65-
};
65+
}
66+
export { newSTRef as new };
6667

67-
exports.read = function (ref) {
68+
export const read = function (ref) {
6869
return function () {
6970
return ref.value;
7071
};
7172
};
7273

73-
exports.modifyImpl = function (f) {
74+
export const modifyImpl = function (f) {
7475
return function (ref) {
7576
return function () {
7677
var t = f(ref.value);
@@ -80,7 +81,7 @@ exports.modifyImpl = function (f) {
8081
};
8182
};
8283

83-
exports.write = function (a) {
84+
export const write = function (a) {
8485
return function (ref) {
8586
return function () {
8687
return ref.value = a; // eslint-disable-line no-return-assign

0 commit comments

Comments
 (0)