diff --git a/.eslintrc.json b/.eslintrc.json index cb9c786..3a97d05 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,10 @@ { "parserOptions": { - "ecmaVersion": 5 + "ecmaVersion": 6, + "sourceType": "module" }, "extends": "eslint:recommended", "env": { - "commonjs": true, "browser": 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 385a89e..3664ba2 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: +- Migrate FFI to ES modules (#14 by @JordanMartinez) New features: diff --git a/bower.json b/bower.json index 8fb882f..6327f7c 100644 --- a/bower.json +++ b/bower.json @@ -15,8 +15,8 @@ "package.json" ], "dependencies": { - "purescript-web-dom": "^5.0.0", - "purescript-web-html": "^3.0.0", - "purescript-web-uievents": "^3.0.0" + "purescript-web-dom": "master", + "purescript-web-html": "master", + "purescript-web-uievents": "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/Web/CSSOM.js b/src/Web/CSSOM.js index c7089bc..3800405 100644 --- a/src/Web/CSSOM.js +++ b/src/Web/CSSOM.js @@ -1,8 +1,6 @@ // Web.CSSOM -"use strict"; - -exports.getStyleSheets = function(doc) { +export function getStyleSheets(doc) { return function() { return doc.styleSheets; }; -}; +} diff --git a/src/Web/CSSOM/CSSStyleDeclaration.js b/src/Web/CSSOM/CSSStyleDeclaration.js index c51e14c..8ebb322 100644 --- a/src/Web/CSSOM/CSSStyleDeclaration.js +++ b/src/Web/CSSOM/CSSStyleDeclaration.js @@ -1,50 +1,48 @@ -"use strict"; - -exports.cssText = function (style) { +export function cssText(style) { return function () { return style.cssText; }; -}; +} -exports.setCssText = function (style) { +export function setCssText(style) { return function (newCSS) { return function () { style.cssText = newCSS; }; }; -}; +} -exports.length = function (style) { +export function length(style) { return function () { return style.length; }; -}; +} -exports.getPropertyPriority = function (style) { +export function getPropertyPriority(style) { return function (propName) { return function () { return style.getPropertyPriority(propName); }; }; -}; +} -exports.getPropertyValue = function (style) { +export function getPropertyValue(style) { return function (propName) { return function () { return style.getPropertyValue(propName); }; }; -}; +} -exports.removeProperty = function (style) { +export function removeProperty(style) { return function (propName) { return function () { style.removeProperty(propName); }; }; -}; +} -exports.setProperty = function (style) { +export function setProperty(style) { return function (propName) { return function (propValue) { return function () { @@ -52,4 +50,4 @@ exports.setProperty = function (style) { }; }; }; -}; +} diff --git a/src/Web/CSSOM/CSSStyleSheet.js b/src/Web/CSSOM/CSSStyleSheet.js index bf3e5b7..aca208a 100644 --- a/src/Web/CSSOM/CSSStyleSheet.js +++ b/src/Web/CSSOM/CSSStyleSheet.js @@ -1,30 +1,28 @@ -"use strict"; - var getProp = function (name) { return function (sheet) { return sheet[name]; }; }; -exports.disabled = getProp("disabled"); -exports._href = getProp("href"); -exports._ownerNode = getProp("ownerNode"); -exports._parentStyleSheet = getProp("parentStyleSheet"); -exports._title = getProp("title"); -exports._type = getProp("type"); +export const disabled = getProp("disabled"); +export const _href = getProp("href"); +export const _ownerNode = getProp("ownerNode"); +export const _parentStyleSheet = getProp("parentStyleSheet"); +export const _title = getProp("title"); +export const _type = getProp("type"); -exports.setDisabled = function (bool) { +export function setDisabled(bool) { return function (sheet) { return function () { sheet.disabled = bool; }; }; -}; +} -exports.toggleDisabled = function (sheet) { +export function toggleDisabled(sheet) { return function () { var bool = !sheet.disabled; sheet.disabled = bool; return bool; }; -}; +} diff --git a/src/Web/CSSOM/ElementCSSInlineStyle.js b/src/Web/CSSOM/ElementCSSInlineStyle.js index 8fb68e6..476f255 100644 --- a/src/Web/CSSOM/ElementCSSInlineStyle.js +++ b/src/Web/CSSOM/ElementCSSInlineStyle.js @@ -1,7 +1,5 @@ -"use strict"; - -exports.style = function (el) { +export function style(el) { return function () { return el.style; }; -}; +} diff --git a/src/Web/CSSOM/MouseEvent.js b/src/Web/CSSOM/MouseEvent.js index b45f683..0416d5b 100644 --- a/src/Web/CSSOM/MouseEvent.js +++ b/src/Web/CSSOM/MouseEvent.js @@ -1,9 +1,7 @@ -"use strict"; - -exports.offsetX = function (e) { +export function offsetX(e) { return e.offsetX; -}; +} -exports.offsetY = function (e) { +export function offsetY(e) { return e.offsetY; -}; +} diff --git a/src/Web/CSSOM/StyleSheetList.js b/src/Web/CSSOM/StyleSheetList.js index 5da6581..1825e98 100644 --- a/src/Web/CSSOM/StyleSheetList.js +++ b/src/Web/CSSOM/StyleSheetList.js @@ -1,21 +1,19 @@ -"use strict"; - -exports.length = function (list) { +export function length(list) { return function () { return list.length; }; -}; +} -exports.toArray = function (list) { +export function toArray(list) { return function () { return Array.prototype.slice.call(list); }; -}; +} -exports._item = function (index) { +export function _item(index) { return function (list) { return function () { return list.item(index); }; }; -}; +}