diff --git a/.eslintrc.json b/.eslintrc.json index d68166a..7b219e5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,10 @@ { "parserOptions": { - "ecmaVersion": 5 + "ecmaVersion": 6, + "sourceType": "module" }, "extends": "eslint:recommended", "env": { - "commonjs": true, "node": true }, "rules": { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 063845e..06ed895 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,12 @@ jobs: - uses: actions/checkout@v2 - uses: purescript-contrib/setup-purescript@main + with: + purescript: "unstable" - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - node-version: "10" + node-version: "14" - name: Install dependencies run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 06148d7..3f10dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: +- Update project and deps to PureScript v0.15.0 (#34 by @nwolverson, @JordanMartinez, @sigma-andex) New features: diff --git a/bower.json b/bower.json index afb184e..d9c12d7 100644 --- a/bower.json +++ b/bower.json @@ -12,12 +12,12 @@ "output" ], "dependencies": { - "purescript-effect": "^3.0.0", - "purescript-foreign-object": "^3.0.0", - "purescript-maybe": "^5.0.0", - "purescript-node-streams": "^5.0.0", - "purescript-posix-types": "^5.0.0", - "purescript-prelude": "^5.0.0", - "purescript-unsafe-coerce": "^5.0.0" + "purescript-effect": "master", + "purescript-foreign-object": "master", + "purescript-maybe": "master", + "purescript-node-streams": "master", + "purescript-posix-types": "master", + "purescript-prelude": "master", + "purescript-unsafe-coerce": "master" } } diff --git a/package.json b/package.json index 1c67b54..4ea39f9 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ }, "devDependencies": { "eslint": "^7.15.0", - "pulp": "^15.0.0", - "purescript-psa": "^0.8.0", + "pulp": "16.0.0-0", + "purescript-psa": "^0.8.2", "rimraf": "^3.0.2" } } diff --git a/src/Node/Globals.js b/src/Node/Globals.js deleted file mode 100644 index ecf278c..0000000 --- a/src/Node/Globals.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -exports.__dirname = __dirname; -exports.__filename = __filename; -exports.unsafeRequire = require; - -exports.requireResolve = function (mod) { - return function () { - return require.resolve(mod); - }; -}; diff --git a/src/Node/Globals.purs b/src/Node/Globals.purs deleted file mode 100644 index 40fa116..0000000 --- a/src/Node/Globals.purs +++ /dev/null @@ -1,26 +0,0 @@ --- | Global objects exposed by Node.js. See also the [Node.js API --- | documentation](https://nodejs.org/api/globals.html). -module Node.Globals where - -import Effect (Effect) - --- | The name of the directory that the currently executing script resides in. --- | --- | Note that this will probably not give you a very useful answer unless you --- | have bundled up your PureScript code using `purs bundle`! -foreign import __dirname :: String - --- | The absolute path of the code file being executed. --- | --- | Note that this will probably not give you a very useful answer unless you --- | have bundled up your PureScript code using `purs bundle`! -foreign import __filename :: String - --- | Just calls `require`. You might also consider using the FFI instead. This --- | function is, in general, horribly unsafe, and may perform side effects. -foreign import unsafeRequire :: forall a. String -> a - --- | `require.resolve()`. Use the internal `require` machinery to look up the --- | location of a module, but rather than loading the module, just return the --- | resolved filename. -foreign import requireResolve :: String -> Effect String diff --git a/src/Node/Process.js b/src/Node/Process.js index 1834150..11b9594 100644 --- a/src/Node/Process.js +++ b/src/Node/Process.js @@ -1,79 +1,70 @@ -"use strict"; +import process from "process"; +export { process }; -exports.process = process; - -exports.onBeforeExit = function (callback) { - return function () { +export function onBeforeExit(callback) { + return () => { process.on("beforeExit", callback); }; -}; +} -exports.onExit = function (callback) { - return function () { - process.on("exit", function (code) { +export function onExit(callback) { + return () => { + process.on("exit", code => { callback(code)(); }); }; -}; +} -exports.onUncaughtException = function (callback) { - return function () { - process.on("uncaughtException", function (error) { +export function onUncaughtException(callback) { + return () => { + process.on("uncaughtException", error => { callback(error)(); }); }; -}; +} -exports.onUnhandledRejection = function (callback) { - return function () { - process.on("unhandledRejection", function (error, promise) { +export function onUnhandledRejection(callback) { + return () => { + process.on("unhandledRejection", (error, promise) => { callback(error)(promise)(); }); }; -}; +} -exports.onSignalImpl = function (signal) { - return function (callback) { - return function () { - process.on(signal, callback); - }; +export function onSignalImpl(signal) { + return callback => () => { + process.on(signal, callback); }; -}; +} -exports.chdir = function (dir) { - return function () { +export function chdir(dir) { + return () => { process.chdir(dir); }; -}; +} -exports.setEnv = function (var_) { - return function (val) { - return function () { - process.env[var_] = val; - }; +export function setEnv(var_) { + return val => () => { + process.env[var_] = val; }; -}; +} -exports.unsetEnv = function (var_) { - return function () { +export function unsetEnv(var_) { + return () => { delete process.env[var_]; }; -}; +} -exports.exit = function (code) { - return function () { +export function exit(code) { + return () => { process.exit(code); }; -}; +} -exports.copyArray = function (xs) { - return function () { - return xs.slice(); - }; -}; +export function copyArray(xs) { + return () => xs.slice(); +} -exports.copyObject = function (o) { - return function () { - return Object.assign({}, o); - }; -}; +export function copyObject(o) { + return () => Object.assign({}, o); +}