Skip to content

Update to PureScript v0.15.0 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"parserOptions": {
"ecmaVersion": 5
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"browser": true
},
"globals": {
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the Node version as well (below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Done.

purescript: "unstable"

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: "10"
node-version: "14"

- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
## [Unreleased]

Breaking changes:
- Migrate FFI to ES modules (#7 by @JordanMartinez)

New features:

Expand Down
14 changes: 7 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"package.json"
],
"dependencies": {
"purescript-arraybuffer-types": "^3.0.0",
"purescript-effect": "^3.0.0",
"purescript-exceptions": "^5.0.0",
"purescript-nullable": "^5.0.0",
"purescript-prelude": "^5.0.0",
"purescript-tuples": "^6.0.0",
"purescript-web-promise": "https://github.com/purescript-web/purescript-web-promise.git#2.0.0"
"purescript-arraybuffer-types": "main",
"purescript-effect": "master",
"purescript-exceptions": "master",
"purescript-nullable": "main",
"purescript-prelude": "master",
"purescript-tuples": "master",
"purescript-web-promise": "https://github.com/purescript-web/purescript-web-promise.git#master"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
13 changes: 6 additions & 7 deletions src/Web/Streams/QueuingStrategy.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
"use strict";

exports.new = function(options) {
const newImpl = function (options) {
return function() {
return new QueuingStrategy(options);
};
};
export { newImpl as new };

exports.byteLengthQueuingStrategy = function(options) {
export function byteLengthQueuingStrategy(options) {
return function() {
return new ByteLengthQueuingStrategy(options);
};
};
}

exports.countQueuingStrategy = function(options) {
export function countQueuingStrategy(options) {
return function() {
return new CountQueuingStrategy(options);
};
};
}
22 changes: 10 additions & 12 deletions src/Web/Streams/ReadableStream.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
"use strict";

exports._new = function(source, strategy) {
export function _new(source, strategy) {
return new ReadableStream(source, strategy);
};
}

exports.cancel = function(stream) {
export function cancel(stream) {
return function() {
return stream.cancel();
};
};
}

exports.locked = function(stream) {
export function locked(stream) {
return function() {
return stream.locked;
};
};
}

exports.getReader = function(stream) {
export function getReader(stream) {
return function() {
return stream.getReader();
};
};
}

exports._tee = function(tuple, stream) {
export function _tee(tuple, stream) {
var r = stream.tee();
return tuple(r[0])(r[1]);
};
}
18 changes: 8 additions & 10 deletions src/Web/Streams/ReadableStreamController.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
"use strict";

exports.enqueue = function(chunk) {
export function enqueue(chunk) {
return function(controller) {
return function() {
return controller.enqueue(chunk);
};
};
};
}

exports.close = function(controller) {
export function close(controller) {
return function() {
return controller.close();
};
};
}

exports.error = function(error) {
export function error(error) {
return function(controller) {
return function() {
return controller.error(error);
};
};
};
}

exports.desiredSize = function(controller) {
export function desiredSize(controller) {
return function() {
return controller.desiredSize;
};
};
}
6 changes: 2 additions & 4 deletions src/Web/Streams/Reader.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"use strict";

exports._read = function(nothing, just, reader) {
export function _read(nothing, just, reader) {
return reader.read().then(function(res) {
if (res.done) {
return nothing;
}
return just(res.value);
});
};
}
6 changes: 2 additions & 4 deletions src/Web/Streams/Source.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"use strict";

exports._make = function(options) {
export function _make(options) {
var newOptions = {
start: function(controller) {
return options.start(controller)();
Expand All @@ -17,4 +15,4 @@ exports._make = function(options) {
};
}
return newOptions;
};
}