Skip to content

Commit dff666d

Browse files
Update to PureScript v0.15.0 (#28)
* ESM conversion * ES6 transformations * 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 * Add eslint config * Fix eslint errors * Update changelog * Update ci.yml to v2 Co-authored-by: Nicholas Wolverson <[email protected]>
1 parent c59deb3 commit dff666d

File tree

6 files changed

+54
-63
lines changed

6 files changed

+54
-63
lines changed

.eslintrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
67
"env": {
7-
"commonjs": true
8+
"node": true
89
},
910
"rules": {
1011
"strict": [2, "global"],

.github/workflows/ci.yml

+4-2
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

+1
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+
- Update project and deps to PureScript v0.15.0 (#28 by @JordanMartinez, @sigma-andex)
89

910
New features:
1011

bower.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
"package.json"
1717
],
1818
"devDependencies": {
19-
"purescript-console": "^5.0.0"
19+
"purescript-console": "master"
2020
},
2121
"dependencies": {
22-
"purescript-effect": "^3.0.0",
23-
"purescript-foreign": "^6.0.0",
24-
"purescript-node-process": "^8.0.0",
25-
"purescript-node-streams": "^5.0.0",
26-
"purescript-options": "^6.0.0",
27-
"purescript-prelude": "^5.0.0"
22+
"purescript-effect": "master",
23+
"purescript-foreign": "master",
24+
"purescript-node-process": "master",
25+
"purescript-node-streams": "master",
26+
"purescript-options": "main",
27+
"purescript-prelude": "master"
2828
}
2929
}

package.json

+2-2
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/Node/ReadLine.js

+37-50
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,51 @@
1-
"use strict";
2-
31
// module Node.ReadLine
42

5-
exports.createInterfaceImpl = function (options) {
6-
return function () {
7-
var readline = require("readline");
8-
return readline.createInterface({
9-
input: options.input,
10-
output: options.output,
11-
completer:
12-
options.completer &&
13-
function (line) {
14-
var res = options.completer(line)();
15-
return [res.completions, res.matched];
16-
},
17-
terminal: options.terminal,
18-
historySize: options.historySize,
19-
});
20-
};
21-
};
3+
import { createInterface } from "readline";
224

23-
exports.close = function (readline) {
24-
return function () {
5+
export function createInterfaceImpl(options) {
6+
return () => createInterface({
7+
input: options.input,
8+
output: options.output,
9+
completer: options.completer && (line => {
10+
const res = options.completer(line)();
11+
return [res.completions, res.matched];
12+
}),
13+
terminal: options.terminal,
14+
historySize: options.historySize,
15+
});
16+
}
17+
18+
export function close(readline) {
19+
return () => {
2520
readline.close();
2621
};
27-
};
22+
}
2823

29-
exports.prompt = function (readline) {
30-
return function () {
24+
export function prompt(readline) {
25+
return () => {
3126
readline.prompt();
3227
};
33-
};
28+
}
3429

35-
exports.question = function (text) {
36-
return function (callback) {
37-
return function (readline) {
38-
return function () {
39-
readline.question(text, function (result) {
40-
callback(result)();
41-
});
42-
};
43-
};
30+
export function question(text) {
31+
return callback => readline => () => {
32+
readline.question(text, result => {
33+
callback(result)();
34+
});
4435
};
45-
};
36+
}
4637

47-
exports.setPrompt = function (prompt) {
48-
return function (readline) {
49-
return function () {
50-
readline.setPrompt(prompt);
51-
};
38+
export function setPrompt(prompt) {
39+
return readline => () => {
40+
readline.setPrompt(prompt);
5241
};
53-
};
42+
}
5443

55-
exports.setLineHandler = function (callback) {
56-
return function (readline) {
57-
return function () {
58-
readline.removeAllListeners("line");
59-
readline.on("line", function (line) {
60-
callback(line)();
61-
});
62-
};
44+
export function setLineHandler(callback) {
45+
return readline => () => {
46+
readline.removeAllListeners("line");
47+
readline.on("line", line => {
48+
callback(line)();
49+
});
6350
};
64-
};
51+
}

0 commit comments

Comments
 (0)