Skip to content

Commit b86d346

Browse files
Update to v0.15.0 (#57)
* 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 * Update Bower dependencies to master or main * Update packages.dhall to 'prepare-0.15' package set * Update .eslintrc.json to ES6 * Fix spago transitive errors * Remove unused deps * Add pulp and bower to CI * Comment out spago test (temporarily) * Add changelog entry
1 parent 83947ea commit b86d346

File tree

9 files changed

+49
-52
lines changed

9 files changed

+49
-52
lines changed

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"env": { "browser": true, "commonjs": true },
2+
"env": { "browser": true },
33
"extends": "eslint:recommended",
4-
"parserOptions": { "ecmaVersion": 5 },
4+
"parserOptions": { "ecmaVersion": 6, "sourceType": "module" },
55
"rules": {
66
"block-scoped-var": "error",
77
"consistent-return": "error",

.github/workflows/ci.yml

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

2122
- name: Cache PureScript dependencies
@@ -49,8 +50,15 @@ jobs:
4950
- name: Build the project
5051
run: npm run build
5152

52-
- name: Run tests
53-
run: npm run test
53+
# - name: Run tests
54+
# run: npm run test
5455

5556
- name: Check formatting
5657
run: purs-tidy check src test
58+
59+
- name: Verify Bower & Pulp
60+
run: |
61+
npm install bower [email protected]
62+
npx bower install
63+
npx pulp build -- --censor-lib --strict
64+
npx pulp test

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 (#57 by @JordanMartinez)
89

910
New features:
1011

bower.json

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,19 @@
2727
"package.json"
2828
],
2929
"dependencies": {
30-
"purescript-arrays": "^6.0.0",
31-
"purescript-control": "^5.0.0",
32-
"purescript-either": "^5.0.0",
33-
"purescript-foreign-object": "^3.0.0",
34-
"purescript-functions": "^5.0.0",
35-
"purescript-gen": "^3.0.0",
36-
"purescript-maybe": "^5.0.0",
37-
"purescript-nonempty": "^6.0.0",
38-
"purescript-prelude": "^5.0.0",
39-
"purescript-strings": "^5.0.0",
40-
"purescript-tailrec": "^5.0.0"
30+
"purescript-arrays": "master",
31+
"purescript-control": "master",
32+
"purescript-either": "master",
33+
"purescript-foreign-object": "master",
34+
"purescript-functions": "master",
35+
"purescript-gen": "master",
36+
"purescript-maybe": "master",
37+
"purescript-nonempty": "master",
38+
"purescript-prelude": "master",
39+
"purescript-strings": "master",
40+
"purescript-tailrec": "master"
4141
},
4242
"devDependencies": {
43-
"purescript-console": "^5.0.0",
44-
"purescript-effect": "^3.0.0",
45-
"purescript-partial": "^3.0.0",
46-
"purescript-quickcheck": "^7.0.0",
47-
"purescript-tuples": "^6.0.0"
43+
"purescript-quickcheck": "master"
4844
}
4945
}

packages.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +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

44
in upstream

spago.dhall

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
, "nonempty"
1313
, "partial"
1414
, "prelude"
15-
, "psci-support"
1615
, "quickcheck"
1716
, "strings"
1817
, "tailrec"

src/Data/Argonaut/Core.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
11
/* eslint-disable no-eq-null, eqeqeq */
2-
"use strict";
3-
42
function id(x) {
53
return x;
64
}
75

8-
exports.fromBoolean = id;
9-
exports.fromNumber = id;
10-
exports.fromString = id;
11-
exports.fromArray = id;
12-
exports.fromObject = id;
13-
14-
exports.jsonNull = null;
6+
export {id as fromBoolean};
7+
export {id as fromNumber};
8+
export {id as fromString};
9+
export {id as fromArray};
10+
export {id as fromObject};
11+
export const jsonNull = null;
1512

16-
exports.stringify = function (j) {
13+
export function stringify(j) {
1714
return JSON.stringify(j);
18-
};
15+
}
1916

20-
exports.stringifyWithIndent = function (i) {
17+
export function stringifyWithIndent(i) {
2118
return function (j) {
2219
return JSON.stringify(j, null, i);
2320
};
24-
};
21+
}
2522

2623
function isArray(a) {
2724
return Object.prototype.toString.call(a) === "[object Array]";
2825
}
2926

30-
exports._caseJson = function (isNull, isBool, isNum, isStr, isArr, isObj, j) {
27+
export function _caseJson(isNull, isBool, isNum, isStr, isArr, isObj, j) {
3128
if (j == null) return isNull();
3229
else if (typeof j === "boolean") return isBool(j);
3330
else if (typeof j === "number") return isNum(j);
3431
else if (typeof j === "string") return isStr(j);
3532
else if (Object.prototype.toString.call(j) === "[object Array]")
3633
return isArr(j);
3734
else return isObj(j);
38-
};
35+
}
3936

40-
exports._compare = function _compare(EQ, GT, LT, a, b) {
37+
export function _compare(EQ, GT, LT, a, b) {
4138
if (a == null) {
4239
if (b == null) return EQ;
4340
else return LT;
@@ -102,4 +99,4 @@ exports._compare = function _compare(EQ, GT, LT, a, b) {
10299
return EQ;
103100
}
104101
}
105-
};
102+
}

src/Data/Argonaut/Parser.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._jsonParser = function (fail, succ, s) {
1+
export function _jsonParser(fail, succ, s) {
42
try {
53
return succ(JSON.parse(s));
64
}
75
catch (e) {
86
return fail(e.message);
97
}
10-
};
8+
}

test/Test/Main.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
"use strict";
2-
3-
exports.thisIsNull = null;
4-
exports.thisIsBoolean = true;
5-
exports.thisIsNumber = 12;
6-
exports.thisIsString = "foobar";
7-
exports.thisIsArray = ["foo", "bar"];
8-
exports.thisIsObject = { foo: "bar" };
9-
exports.thisIsInvalidString = "\\\ffff";
1+
export const thisIsNull = null;
2+
export const thisIsBoolean = true;
3+
export const thisIsNumber = 12;
4+
export const thisIsString = "foobar";
5+
export const thisIsArray = ["foo", "bar"];
6+
export const thisIsObject = { foo: "bar" };
7+
export const thisIsInvalidString = "\\\ffff";

0 commit comments

Comments
 (0)