Skip to content

Commit c1ac5de

Browse files
Update to PureScript v0.15.0 (#27)
* Update .eslintrc.json to ES6 * Migrated FFI to ES modules via 'lebab' * 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 * Removed unneeded 'psci-support' package * Added changelog entry
1 parent ac71ff8 commit c1ac5de

File tree

7 files changed

+29
-20
lines changed

7 files changed

+29
-20
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: 12 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,17 @@ 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 pulp@16.0.0-0
62+
npx bower install
63+
npx pulp build -- --censor-lib --strict
64+
if [ -d "test" ]; then
65+
npx pulp test
66+
fi

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

910
New features:
1011

bower.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-effect": "^3.0.0"
20+
"purescript-effect": "master"
2121
},
2222
"devDependencies": {
23-
"purescript-assert": "^5.0.0",
24-
"purescript-console": "^5.0.0",
25-
"purescript-refs": "^5.0.0"
23+
"purescript-assert": "master",
24+
"purescript-console": "master",
25+
"purescript-refs": "master"
2626
}
2727
}

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ name = "js-timers"
22
, dependencies =
3-
[ "assert", "console", "effect", "prelude", "psci-support", "refs" ]
3+
[ "assert", "console", "effect", "prelude", "refs" ]
44
, packages = ./packages.dhall
55
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
66
}

src/Effect/Timer.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
/* no-redeclare global exports */
2-
"use strict";
3-
4-
exports.setTimeout = function (ms) {
2+
export function setTimeout(ms) {
53
return function (fn) {
64
return function () {
75
return setTimeout(fn, ms);
86
};
97
};
10-
};
8+
}
119

12-
exports.clearTimeout = function (id) {
10+
export function clearTimeout(id) {
1311
return function () {
1412
clearTimeout(id);
1513
};
16-
};
14+
}
1715

18-
exports.setInterval = function (ms) {
16+
export function setInterval(ms) {
1917
return function (fn) {
2018
return function () {
2119
return setInterval(fn, ms);
2220
};
2321
};
24-
};
22+
}
2523

26-
exports.clearInterval = function (id) {
24+
export function clearInterval(id) {
2725
return function () {
2826
clearInterval(id);
2927
};
30-
};
28+
}

0 commit comments

Comments
 (0)