Skip to content

Commit 37107a7

Browse files
Migrate to GitHub Actions (#38)
1 parent 3600162 commit 37107a7

File tree

10 files changed

+92
-75
lines changed

10 files changed

+92
-75
lines changed

.eslintrc.json

+28
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

+33
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.*
22
!/.gitignore
3-
!/.travis.yml
3+
!/.eslintrc.json
4+
!/.github/
45
/bower_components/
56
/node_modules/
67
/output/

.jshintrc

-19
This file was deleted.

.travis.yml

-23
This file was deleted.

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# purescript-node-buffer
22

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

67
Type declarations and FFI wrappers for Node's [Buffer API](https://nodejs.org/api/buffer.html).
78

89
## Installation
910

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

1415
## Documentation

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"private": true,
44
"scripts": {
55
"clean": "rimraf output && rimraf .pulp-cache",
6-
"build": "pulp build -- --censor-lib --strict",
6+
"build": "eslint src && pulp build -- --censor-lib --strict",
77
"test": "pulp test"
88
},
99
"devDependencies": {
10-
"pulp": "^12.2.0",
11-
"purescript-psa": "^0.6.0",
12-
"rimraf": "^2.6.2"
10+
"eslint": "^7.15.0",
11+
"pulp": "^15.0.0",
12+
"purescript-psa": "^0.8.0",
13+
"rimraf": "^3.0.2"
1314
}
1415
}

src/Node/Buffer/Immutable.js

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
/* global exports */
21
/* global Buffer */
3-
/* global require */
42
"use strict";
53

6-
exports.showImpl = require('util').inspect;
4+
exports.showImpl = require("util").inspect;
75

8-
exports.eqImpl = function(a) {
9-
return function(b) {
6+
exports.eqImpl = function (a) {
7+
return function (b) {
108
return a.equals(b);
11-
}
9+
};
1210
};
1311

14-
exports.compareImpl = function(a) {
12+
exports.compareImpl = function (a) {
1513
return function (b) {
1614
return a.compare(b);
1715
};
18-
}
16+
};
1917

2018
exports.create = function (size) {
2119
return Buffer.alloc(size);
@@ -30,15 +28,15 @@ exports.size = function (buff) {
3028
};
3129

3230
exports.toArray = function (buff) {
33-
var json = buff.toJSON()
31+
var json = buff.toJSON();
3432
return json.data || json;
3533
};
3634

37-
exports.toArrayBuffer = function(buff) {
35+
exports.toArrayBuffer = function (buff) {
3836
return buff.buffer.slice(buff.byteOffset, buff.byteOffset + buff.byteLength);
3937
};
4038

41-
exports.fromArrayBuffer = function(ab) {
39+
exports.fromArrayBuffer = function (ab) {
4240
return Buffer.from(ab);
4341
};
4442

@@ -51,7 +49,7 @@ exports.fromStringImpl = function (str) {
5149
exports.readImpl = function (ty) {
5250
return function (offset) {
5351
return function (buf) {
54-
return buf['read' + ty](offset);
52+
return buf["read" + ty](offset);
5553
};
5654
};
5755
};
@@ -71,8 +69,7 @@ exports.getAtOffsetImpl = function (just) {
7169
return function (offset) {
7270
return function (buff) {
7371
var octet = buff[offset];
74-
return octet == null ? nothing
75-
: just(octet);
72+
return octet == null ? nothing : just(octet);
7673
};
7774
};
7875
};

src/Node/Buffer/Internal.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
/* global exports */
21
/* global Buffer */
32
"use strict";
43

5-
exports.copyAll = function(a) {
6-
return function() {
4+
exports.copyAll = function (a) {
5+
return function () {
76
return Buffer.from(a);
87
};
98
};
@@ -12,10 +11,10 @@ exports.writeInternal = function (ty) {
1211
return function (value) {
1312
return function (offset) {
1413
return function (buf) {
15-
return function() {
16-
buf['write' + ty](value, offset);
14+
return function () {
15+
buf["write" + ty](value, offset);
1716
return {};
18-
}
17+
};
1918
};
2019
};
2120
};
@@ -26,9 +25,9 @@ exports.writeStringInternal = function (encoding) {
2625
return function (length) {
2726
return function (value) {
2827
return function (buff) {
29-
return function() {
28+
return function () {
3029
return buff.write(value, offset, length, encoding);
31-
}
30+
};
3231
};
3332
};
3433
};
@@ -38,7 +37,7 @@ exports.writeStringInternal = function (encoding) {
3837
exports.setAtOffset = function (value) {
3938
return function (offset) {
4039
return function (buff) {
41-
return function() {
40+
return function () {
4241
buff[offset] = value;
4342
return {};
4443
};
@@ -51,7 +50,7 @@ exports.copy = function (srcStart) {
5150
return function (src) {
5251
return function (targStart) {
5352
return function (targ) {
54-
return function() {
53+
return function () {
5554
return src.copy(targ, targStart, srcStart, srcEnd);
5655
};
5756
};
@@ -64,7 +63,7 @@ exports.fill = function (octet) {
6463
return function (start) {
6564
return function (end) {
6665
return function (buf) {
67-
return function() {
66+
return function () {
6867
buf.fill(octet, start, end);
6968
return {};
7069
};

src/Node/Encoding.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* global exports */
21
/* global Buffer */
32
"use strict";
43

0 commit comments

Comments
 (0)