Skip to content

Commit aa672d6

Browse files
Migrate to GitHub Actions (#19)
1 parent 0d61e64 commit aa672d6

File tree

8 files changed

+113
-109
lines changed

8 files changed

+113
-109
lines changed

.eslintrc

Lines changed: 0 additions & 39 deletions
This file was deleted.

.eslintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 5
4+
},
5+
"extends": "eslint:recommended",
6+
"env": {
7+
"commonjs": true
8+
},
9+
"rules": {
10+
"strict": [2, "global"],
11+
"block-scoped-var": 2,
12+
"consistent-return": 2,
13+
"eqeqeq": [2, "smart"],
14+
"guard-for-in": 2,
15+
"no-caller": 2,
16+
"no-extend-native": 2,
17+
"no-loop-func": 2,
18+
"no-new": 2,
19+
"no-param-reassign": 2,
20+
"no-return-assign": 2,
21+
"no-unused-expressions": 2,
22+
"no-use-before-define": 2,
23+
"radix": [2, "always"],
24+
"indent": [2, 2],
25+
"quotes": [2, "double"],
26+
"semi": [2, "always"]
27+
}
28+
}

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: purescript-contrib/setup-purescript@main
16+
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: "10"
20+
21+
- name: Install dependencies
22+
run: |
23+
npm install -g bower
24+
npm install
25+
bower install --production
26+
27+
- name: Build source
28+
run: npm run-script build
29+
30+
- name: Run tests
31+
run: |
32+
bower install
33+
npm run-script test --if-present

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/.*
22
!/.gitignore
3-
!/.eslintrc
4-
!/.travis.yml
3+
!/.eslintrc.json
4+
!/.github/
55
/bower_components/
66
/node_modules/
77
/output/
8+
package-lock.json

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# purescript-node-readline
22

33
[![Latest release](http://img.shields.io/github/release/purescript-node/purescript-node-readline.svg)](https://github.com/purescript-node/purescript-node-readline/releases)
4-
[![Build Status](https://travis-ci.org/purescript-node/purescript-node-readline.svg?branch=master)](https://travis-ci.org/purescript-node/purescript-node-readline)
4+
[![Build status](https://github.com/purescript-node/purescript-node-readline/workflows/CI/badge.svg?branch=master)](https://github.com/purescript-node/purescript-node-readline/actions?query=workflow%3ACI+branch%3Amaster)
5+
[![Pursuit](https://pursuit.purescript.org/packages/purescript-node-readline/badge)](https://pursuit.purescript.org/packages/purescript-node-readline)
56

67
A low-level PureScript interface to the Node `readline` API.
78

89
## Installation
910

1011
```
11-
bower install purescript-node-readline
12+
spago install node-readline
1213
```
1314

1415
Module documentation can be found on [Pursuit](https://pursuit.purescript.org/packages/purescript-node-readline)

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"build": "eslint src && pulp build -- --censor-lib --strict"
66
},
77
"devDependencies": {
8-
"eslint": "^3.17.1",
9-
"pulp": "^11.0.0",
10-
"purescript-psa": "^0.5.0",
11-
"rimraf": "^2.5.4"
8+
"eslint": "^7.15.0",
9+
"pulp": "^15.0.0",
10+
"purescript-psa": "^0.8.0",
11+
"rimraf": "^3.0.2"
1212
}
1313
}

src/Node/ReadLine.js

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,66 @@
1-
/* global exports */
2-
'use strict';
1+
"use strict";
32

43
// module Node.ReadLine
54

65
exports.createInterfaceImpl = function (options) {
7-
return function () {
8-
var readline = require('readline');
9-
return readline.createInterface(
10-
{ input: options.input
11-
, output: options.output
12-
, completer: options.completer && function (line) {
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) {
1314
var res = options.completer(line)();
1415
return [res.completions, res.matched];
15-
}
16-
, terminal: options.terminal
17-
, historySize: options.historySize
18-
});
19-
};
16+
},
17+
terminal: options.terminal,
18+
historySize: options.historySize,
19+
});
20+
};
2021
};
2122

2223
exports.close = function (readline) {
23-
return function () {
24-
readline.close();
25-
};
24+
return function () {
25+
readline.close();
26+
};
2627
};
2728

2829
exports.prompt = function (readline) {
29-
return function () {
30-
readline.prompt();
31-
};
30+
return function () {
31+
readline.prompt();
32+
};
3233
};
3334

34-
exports.question = function(text) {
35-
return function(callback) {
36-
return function(readline) {
37-
return function() {
38-
readline.question(text, function(result) {
39-
callback(result)();
40-
});
41-
};
42-
};
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+
};
4343
};
44+
};
4445
};
4546

4647
exports.setPrompt = function (prompt) {
47-
return function (length) {
48-
return function (readline) {
49-
return function () {
50-
readline.setPrompt(prompt, length);
51-
};
52-
};
48+
return function (length) {
49+
return function (readline) {
50+
return function () {
51+
readline.setPrompt(prompt, length);
52+
};
5353
};
54+
};
5455
};
5556

5657
exports.setLineHandler = function (readline) {
57-
return function (callback) {
58-
return function () {
59-
readline.removeAllListeners('line');
60-
readline.on('line', function (line) {
61-
callback(line)();
62-
});
63-
};
58+
return function (callback) {
59+
return function () {
60+
readline.removeAllListeners("line");
61+
readline.on("line", function (line) {
62+
callback(line)();
63+
});
6464
};
65+
};
6566
};

0 commit comments

Comments
 (0)