Skip to content

Commit

Permalink
Update to PureScript v0.15.0 (#7)
Browse files Browse the repository at this point in the history
* Migrated FFI to ES modules via 'lebab'

* 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

* Update eslint to es6

* Fix FFI export

* Update CI to use Node 14

* Add changelog entry
  • Loading branch information
JordanMartinez authored Mar 22, 2022
1 parent b8e10f3 commit 9603e90
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 50 deletions.
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:
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;
};
}

0 comments on commit 9603e90

Please sign in to comment.