Skip to content
This repository was archived by the owner on Jun 5, 2022. It is now read-only.

Commit c052d22

Browse files
Update to v0.15.0 (#33)
* Convert foreign modules to try bundling with esbuild * Update .eslintrc.json to ES6 * Replaced 'export var' with 'export const' * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Update pulp and psa * Update changelog Co-authored-by: Cyril Sobierajewicz <[email protected]>
1 parent 59746cc commit c052d22

File tree

5 files changed

+36
-37
lines changed

5 files changed

+36
-37
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 (#33 by @kl0tl and @JordanMartinez)
89

910
New features:
1011

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/Math.js

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
"use strict";
2-
31
// module Math
42

5-
exports.abs = Math.abs;
3+
export const abs = Math.abs;
64

7-
exports.acos = Math.acos;
5+
export const acos = Math.acos;
86

9-
exports.asin = Math.asin;
7+
export const asin = Math.asin;
108

11-
exports.atan = Math.atan;
9+
export const atan = Math.atan;
1210

13-
exports.atan2 = function (y) {
11+
export const atan2 = function (y) {
1412
return function (x) {
1513
return Math.atan2(y, x);
1614
};
1715
};
1816

19-
exports.ceil = Math.ceil;
17+
export const ceil = Math.ceil;
2018

21-
exports.cos = Math.cos;
19+
export const cos = Math.cos;
2220

23-
exports.exp = Math.exp;
21+
export const exp = Math.exp;
2422

25-
exports.floor = Math.floor;
23+
export const floor = Math.floor;
2624

2725
function nativeImul(a) {
2826
return function (b) {
@@ -44,60 +42,60 @@ function emulatedImul(a) {
4442
};
4543
}
4644

47-
exports.imul = Math.imul ? nativeImul : emulatedImul;
45+
export const imul = Math.imul ? nativeImul : emulatedImul;
4846

49-
exports.trunc = Math.trunc || function (n) {
47+
export const trunc = Math.trunc || function (n) {
5048
return n < 0 ? Math.ceil(n) : Math.floor(n);
5149
};
5250

53-
exports.log = Math.log;
51+
export const log = Math.log;
5452

55-
exports.max = function (n1) {
53+
export const max = function (n1) {
5654
return function (n2) {
5755
return Math.max(n1, n2);
5856
};
5957
};
6058

61-
exports.min = function (n1) {
59+
export const min = function (n1) {
6260
return function (n2) {
6361
return Math.min(n1, n2);
6462
};
6563
};
6664

67-
exports.pow = function (n) {
65+
export const pow = function (n) {
6866
return function (p) {
6967
return Math.pow(n, p);
7068
};
7169
};
7270

73-
exports.remainder = function (n) {
71+
export const remainder = function (n) {
7472
return function (m) {
7573
return n % m;
7674
};
7775
};
7876

79-
exports.round = Math.round;
77+
export const round = Math.round;
8078

81-
exports.sin = Math.sin;
79+
export const sin = Math.sin;
8280

83-
exports.sqrt = Math.sqrt;
81+
export const sqrt = Math.sqrt;
8482

85-
exports.tan = Math.tan;
83+
export const tan = Math.tan;
8684

87-
exports.e = Math.E;
85+
export const e = Math.E;
8886

89-
exports.ln2 = Math.LN2;
87+
export const ln2 = Math.LN2;
9088

91-
exports.ln10 = Math.LN10;
89+
export const ln10 = Math.LN10;
9290

93-
exports.log2e = Math.LOG2E;
91+
export const log2e = Math.LOG2E;
9492

95-
exports.log10e = Math.LOG10E;
93+
export const log10e = Math.LOG10E;
9694

97-
exports.pi = Math.PI;
95+
export const pi = Math.PI;
9896

99-
exports.tau = 2 * Math.PI;
97+
export const tau = 2 * Math.PI;
10098

101-
exports.sqrt1_2 = Math.SQRT1_2;
99+
export const sqrt1_2 = Math.SQRT1_2;
102100

103-
exports.sqrt2 = Math.SQRT2;
101+
export const sqrt2 = Math.SQRT2;

0 commit comments

Comments
 (0)