Skip to content

Update to v0.15.0 #57

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"env": { "browser": true, "commonjs": true },
"env": { "browser": true },
"extends": "eslint:recommended",
"parserOptions": { "ecmaVersion": 5 },
"parserOptions": { "ecmaVersion": 6, "sourceType": "module" },
"rules": {
"block-scoped-var": "error",
"consistent-return": "error",
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- name: Set up PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purs-tidy: "latest"

- name: Cache PureScript dependencies
Expand Down Expand Up @@ -49,8 +50,15 @@ jobs:
- name: Build the project
run: npm run build

- name: Run tests
run: npm run test
# - name: Run tests
# run: npm run test

- name: Check formatting
run: purs-tidy check src test

- name: Verify Bower & Pulp
run: |
npm install bower [email protected]
npx bower install
npx pulp build -- --censor-lib --strict
npx pulp test
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 (#57 by @JordanMartinez)

New features:

Expand Down
28 changes: 12 additions & 16 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,19 @@
"package.json"
],
"dependencies": {
"purescript-arrays": "^6.0.0",
"purescript-control": "^5.0.0",
"purescript-either": "^5.0.0",
"purescript-foreign-object": "^3.0.0",
"purescript-functions": "^5.0.0",
"purescript-gen": "^3.0.0",
"purescript-maybe": "^5.0.0",
"purescript-nonempty": "^6.0.0",
"purescript-prelude": "^5.0.0",
"purescript-strings": "^5.0.0",
"purescript-tailrec": "^5.0.0"
"purescript-arrays": "master",
"purescript-control": "master",
"purescript-either": "master",
"purescript-foreign-object": "master",
"purescript-functions": "master",
"purescript-gen": "master",
"purescript-maybe": "master",
"purescript-nonempty": "master",
"purescript-prelude": "master",
"purescript-strings": "master",
"purescript-tailrec": "master"
},
"devDependencies": {
"purescript-console": "^5.0.0",
"purescript-effect": "^3.0.0",
"purescript-partial": "^3.0.0",
"purescript-quickcheck": "^7.0.0",
"purescript-tuples": "^6.0.0"
"purescript-quickcheck": "master"
}
}
2 changes: 1 addition & 1 deletion packages.dhall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210722/packages.dhall sha256:1ceb43aa59436bf5601bac45f6f3781c4e1f0e4c2b8458105b018e5ed8c30f8c
https://raw.githubusercontent.com/purescript/package-sets/prepare-0.15/src/packages.dhall

in upstream
1 change: 0 additions & 1 deletion spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
, "nonempty"
, "partial"
, "prelude"
, "psci-support"
, "quickcheck"
, "strings"
, "tailrec"
Expand Down
31 changes: 14 additions & 17 deletions src/Data/Argonaut/Core.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
/* eslint-disable no-eq-null, eqeqeq */
"use strict";

function id(x) {
return x;
}

exports.fromBoolean = id;
exports.fromNumber = id;
exports.fromString = id;
exports.fromArray = id;
exports.fromObject = id;

exports.jsonNull = null;
export {id as fromBoolean};
export {id as fromNumber};
export {id as fromString};
export {id as fromArray};
export {id as fromObject};
export const jsonNull = null;

exports.stringify = function (j) {
export function stringify(j) {
return JSON.stringify(j);
};
}

exports.stringifyWithIndent = function (i) {
export function stringifyWithIndent(i) {
return function (j) {
return JSON.stringify(j, null, i);
};
};
}

function isArray(a) {
return Object.prototype.toString.call(a) === "[object Array]";
}

exports._caseJson = function (isNull, isBool, isNum, isStr, isArr, isObj, j) {
export function _caseJson(isNull, isBool, isNum, isStr, isArr, isObj, j) {
if (j == null) return isNull();
else if (typeof j === "boolean") return isBool(j);
else if (typeof j === "number") return isNum(j);
else if (typeof j === "string") return isStr(j);
else if (Object.prototype.toString.call(j) === "[object Array]")
return isArr(j);
else return isObj(j);
};
}

exports._compare = function _compare(EQ, GT, LT, a, b) {
export function _compare(EQ, GT, LT, a, b) {
if (a == null) {
if (b == null) return EQ;
else return LT;
Expand Down Expand Up @@ -102,4 +99,4 @@ exports._compare = function _compare(EQ, GT, LT, a, b) {
return EQ;
}
}
};
}
6 changes: 2 additions & 4 deletions src/Data/Argonaut/Parser.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"use strict";

exports._jsonParser = function (fail, succ, s) {
export function _jsonParser(fail, succ, s) {
try {
return succ(JSON.parse(s));
}
catch (e) {
return fail(e.message);
}
};
}
16 changes: 7 additions & 9 deletions test/Test/Main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

exports.thisIsNull = null;
exports.thisIsBoolean = true;
exports.thisIsNumber = 12;
exports.thisIsString = "foobar";
exports.thisIsArray = ["foo", "bar"];
exports.thisIsObject = { foo: "bar" };
exports.thisIsInvalidString = "\\\ffff";
export const thisIsNull = null;
export const thisIsBoolean = true;
export const thisIsNumber = 12;
export const thisIsString = "foobar";
export const thisIsArray = ["foo", "bar"];
export const thisIsObject = { foo: "bar" };
export const thisIsInvalidString = "\\\ffff";