Skip to content

Commit e636d1d

Browse files
sigma-andexnwolversonthomashoneyman
authored
Update to PureScript v0.15.0 (#34)
* ESM conversion The changes are interesting WRT require, as it should still be in existance in ESM but is CJS specific https://nodejs.org/api/esm.html#require __filename and __dirname are probably broken * Arrow/let transformation * Missing export * Fix process export * Bad process export * Breaking: Remove Node.Globals Some of these bindings are no longer available with es modules, and all of them are dodgy (and probably in the wrong place). * 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 changelog entry * Update ci.yml to v2 * Update src/Node/Process.js * Update eslintrc * Readd environment section to eslint Co-authored-by: Nicholas Wolverson <nicholas.wolverson@gmail.com> Co-authored-by: Thomas Honeyman <hello@thomashoneyman.com>
1 parent e1e807a commit e636d1d

File tree

8 files changed

+56
-99
lines changed

8 files changed

+56
-99
lines changed

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
67
"env": {
7-
"commonjs": true,
88
"node": true
99
},
1010
"rules": {

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
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

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

910
New features:
1011

bower.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"output"
1313
],
1414
"dependencies": {
15-
"purescript-effect": "^3.0.0",
16-
"purescript-foreign-object": "^3.0.0",
17-
"purescript-maybe": "^5.0.0",
18-
"purescript-node-streams": "^5.0.0",
19-
"purescript-posix-types": "^5.0.0",
20-
"purescript-prelude": "^5.0.0",
21-
"purescript-unsafe-coerce": "^5.0.0"
15+
"purescript-effect": "master",
16+
"purescript-foreign-object": "master",
17+
"purescript-maybe": "master",
18+
"purescript-node-streams": "master",
19+
"purescript-posix-types": "master",
20+
"purescript-prelude": "master",
21+
"purescript-unsafe-coerce": "master"
2222
}
2323
}

package.json

Lines changed: 2 additions & 2 deletions
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/Globals.js

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

src/Node/Globals.purs

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

src/Node/Process.js

Lines changed: 40 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,70 @@
1-
"use strict";
1+
import process from "process";
2+
export { process };
23

3-
exports.process = process;
4-
5-
exports.onBeforeExit = function (callback) {
6-
return function () {
4+
export function onBeforeExit(callback) {
5+
return () => {
76
process.on("beforeExit", callback);
87
};
9-
};
8+
}
109

11-
exports.onExit = function (callback) {
12-
return function () {
13-
process.on("exit", function (code) {
10+
export function onExit(callback) {
11+
return () => {
12+
process.on("exit", code => {
1413
callback(code)();
1514
});
1615
};
17-
};
16+
}
1817

19-
exports.onUncaughtException = function (callback) {
20-
return function () {
21-
process.on("uncaughtException", function (error) {
18+
export function onUncaughtException(callback) {
19+
return () => {
20+
process.on("uncaughtException", error => {
2221
callback(error)();
2322
});
2423
};
25-
};
24+
}
2625

27-
exports.onUnhandledRejection = function (callback) {
28-
return function () {
29-
process.on("unhandledRejection", function (error, promise) {
26+
export function onUnhandledRejection(callback) {
27+
return () => {
28+
process.on("unhandledRejection", (error, promise) => {
3029
callback(error)(promise)();
3130
});
3231
};
33-
};
32+
}
3433

35-
exports.onSignalImpl = function (signal) {
36-
return function (callback) {
37-
return function () {
38-
process.on(signal, callback);
39-
};
34+
export function onSignalImpl(signal) {
35+
return callback => () => {
36+
process.on(signal, callback);
4037
};
41-
};
38+
}
4239

43-
exports.chdir = function (dir) {
44-
return function () {
40+
export function chdir(dir) {
41+
return () => {
4542
process.chdir(dir);
4643
};
47-
};
44+
}
4845

49-
exports.setEnv = function (var_) {
50-
return function (val) {
51-
return function () {
52-
process.env[var_] = val;
53-
};
46+
export function setEnv(var_) {
47+
return val => () => {
48+
process.env[var_] = val;
5449
};
55-
};
50+
}
5651

57-
exports.unsetEnv = function (var_) {
58-
return function () {
52+
export function unsetEnv(var_) {
53+
return () => {
5954
delete process.env[var_];
6055
};
61-
};
56+
}
6257

63-
exports.exit = function (code) {
64-
return function () {
58+
export function exit(code) {
59+
return () => {
6560
process.exit(code);
6661
};
67-
};
62+
}
6863

69-
exports.copyArray = function (xs) {
70-
return function () {
71-
return xs.slice();
72-
};
73-
};
64+
export function copyArray(xs) {
65+
return () => xs.slice();
66+
}
7467

75-
exports.copyObject = function (o) {
76-
return function () {
77-
return Object.assign({}, o);
78-
};
79-
};
68+
export function copyObject(o) {
69+
return () => Object.assign({}, o);
70+
}

0 commit comments

Comments
 (0)