Skip to content

Commit a76d2e3

Browse files
Update to PureScript v0.15.0 (#17)
* Update Bower dependencies to master or main * Update packages.dhall to 'prepare-0.15' package set * Migrated FFI to ES modules via 'lebab' * Replaced 'export var' with 'export const' * Removed '"use strict";' in FFI files * Update eslint to es6 * Update aff-promise to master * Update CI to use Node 14 * Added changelog entry * Try running tests without bundling * Update CI to use purescript "unstable" * Fix spago trans deps error * Fix formatting of spago.dhall * Verify that bower file works correctly
1 parent cf39405 commit a76d2e3

File tree

12 files changed

+146
-185
lines changed

12 files changed

+146
-185
lines changed

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"env": { "browser": true, "commonjs": true },
2+
"env": { "browser": true },
33
"extends": "eslint:recommended",
4-
"parserOptions": { "ecmaVersion": 6 },
4+
"parserOptions": { "ecmaVersion": 6, "sourceType": "module" },
55
"rules": {
66
"block-scoped-var": "error",
77
"consistent-return": "error",

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111

1212
- name: Set up PureScript toolchain
1313
uses: purescript-contrib/setup-purescript@main
14+
with:
15+
purescript: "unstable"
1416

1517
- name: Cache PureScript dependencies
1618
uses: actions/cache@v2
@@ -21,9 +23,9 @@ jobs:
2123
output
2224
2325
- name: Set up Node toolchain
24-
uses: actions/setup-node@v1
26+
uses: actions/setup-node@v2
2527
with:
26-
node-version: "12.x"
28+
node-version: "14.x"
2729

2830
- name: Cache NPM dependencies
2931
uses: actions/cache@v2
@@ -44,9 +46,15 @@ jobs:
4446
run: npm run build
4547

4648
- name: Build and bundle tests
47-
run: spago bundle-module --main Test.Main --to output/index.js && ./node_modules/@vercel/ncc/dist/ncc/cli.js build --minify test/index.js
49+
run: ./node_modules/@vercel/ncc/dist/ncc/cli.js build --minify test/index.js
4850

4951
- name: Run tests
5052
uses: ./test
5153
with:
5254
testinput: test
55+
56+
- name: Verify Bower & Pulp
57+
run: |
58+
npm install bower [email protected]
59+
npx bower install
60+
npx pulp build -- --censor-lib --strict

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
55
## [Unreleased]
66

77
Breaking changes:
8+
- Migrate FFI to ES modules (#17 by @JordanMartinez)
89

910
New features:
1011

bower.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"name": "purescript-github-actions-toolkit",
3-
"license": [
4-
"MIT"
5-
],
6-
"repository": {
7-
"type": "git",
8-
"url": "https://github.com/purescript-contrib/purescript-github-actions-toolkit"
9-
},
10-
"ignore": [
11-
"**/.*",
12-
"node_modules",
13-
"bower_components",
14-
"output"
15-
],
16-
"dependencies": {
17-
"purescript-aff": "^v6.0.0",
18-
"purescript-aff-promise": "^v3.0.0",
19-
"purescript-effect": "^v3.0.0",
20-
"purescript-foreign-object": "^v3.0.0",
21-
"purescript-node-buffer": "^v7.0.0",
22-
"purescript-node-path": "^v4.0.0",
23-
"purescript-node-streams": "^v5.0.0",
24-
"purescript-nullable": "^v5.0.0",
25-
"purescript-transformers": "^v5.0.0"
26-
}
2+
"name": "purescript-github-actions-toolkit",
3+
"license": [
4+
"MIT"
5+
],
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/purescript-contrib/purescript-github-actions-toolkit"
9+
},
10+
"ignore": [
11+
"**/.*",
12+
"node_modules",
13+
"bower_components",
14+
"output"
15+
],
16+
"dependencies": {
17+
"purescript-aff": "main",
18+
"purescript-aff-promise": "master",
19+
"purescript-effect": "master",
20+
"purescript-foreign-object": "master",
21+
"purescript-node-buffer": "master",
22+
"purescript-node-path": "master",
23+
"purescript-node-streams": "master",
24+
"purescript-nullable": "main",
25+
"purescript-transformers": "master"
26+
}
2727
}

packages.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210318/packages.dhall sha256:98bbacd65191cef354ecbafa1610be13e183ee130491ab9c0ef6e3d606f781b5
2+
https://raw.githubusercontent.com/purescript/package-sets/prepare-0.15/src/packages.dhall
33

44
in upstream

spago.dhall

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
, dependencies =
33
[ "aff"
44
, "aff-promise"
5+
, "control"
56
, "effect"
7+
, "either"
8+
, "exceptions"
69
, "foreign-object"
10+
, "maybe"
711
, "node-buffer"
812
, "node-path"
913
, "node-streams"
1014
, "nullable"
15+
, "prelude"
1116
, "transformers"
1217
]
1318
, packages = ./packages.dhall
1419
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
1520
, license = "MIT"
16-
, repository = "https://github.com/purescript-contrib/purescript-github-actions-toolkit"
21+
, repository =
22+
"https://github.com/purescript-contrib/purescript-github-actions-toolkit"
1723
}

src/GitHub/Actions/Cache.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
"use strict";
2-
const cache = require("@actions/cache");
1+
import cache from "@actions/cache";
2+
export const restoreCache2Impl = cache.restoreCache;
3+
export const restoreCache3Impl = cache.restoreCache;
34

4-
exports.restoreCache2Impl = cache.restoreCache;
5+
export function restoreCache3Impl2(paths, primaryKey, options) {
6+
return cache.restoreCache(paths, primaryKey, undefined, options);
7+
}
58

6-
exports.restoreCache3Impl = cache.restoreCache;
7-
8-
exports.restoreCache3Impl2 = (paths, primaryKey, options) =>
9-
cache.restoreCache(paths, primaryKey, undefined, options);
10-
11-
exports.restoreCache4Impl = cache.restoreCache;
12-
13-
exports.saveCache2Impl = cache.saveCache;
14-
15-
exports.saveCache3Impl = cache.saveCache;
9+
export const restoreCache4Impl = cache.restoreCache;
10+
export const saveCache2Impl = cache.saveCache;
11+
export const saveCache3Impl = cache.saveCache;

src/GitHub/Actions/Core.js

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,19 @@
1-
"use strict";
2-
const core = require("@actions/core");
3-
4-
exports.exportVariableImpl = core.exportVariable;
5-
6-
exports.setSecretImpl = core.setSecret;
7-
8-
exports.addPathImpl = core.addPath;
9-
10-
exports.getInput1Impl = core.getInput;
11-
12-
exports.getInput2Impl = core.getInput;
13-
14-
exports.setOutputImpl = core.setOutput;
15-
16-
exports.setCommandEchoImpl = core.setCommandEcho;
17-
18-
exports.setFailedImpl = core.setFailed;
19-
20-
exports.isDebugImpl = core.isDebug;
21-
22-
exports.debugImpl = core.debug;
23-
24-
exports.errorImpl = core.error;
25-
26-
exports.warningImpl = core.warning;
27-
28-
exports.infoImpl = core.info;
29-
30-
exports.startGroupImpl = core.startGroup;
31-
32-
exports.endGroupImpl = core.endGroup;
33-
34-
exports.saveStateImpl = core.saveState;
35-
36-
exports.getStateImpl = core.getState;
37-
38-
exports.groupImpl = core.group;
1+
import core from "@actions/core";
2+
export const exportVariableImpl = core.exportVariable;
3+
export const setSecretImpl = core.setSecret;
4+
export const addPathImpl = core.addPath;
5+
export const getInput1Impl = core.getInput;
6+
export const getInput2Impl = core.getInput;
7+
export const setOutputImpl = core.setOutput;
8+
export const setCommandEchoImpl = core.setCommandEcho;
9+
export const setFailedImpl = core.setFailed;
10+
export const isDebugImpl = core.isDebug;
11+
export const debugImpl = core.debug;
12+
export const errorImpl = core.error;
13+
export const warningImpl = core.warning;
14+
export const infoImpl = core.info;
15+
export const startGroupImpl = core.startGroup;
16+
export const endGroupImpl = core.endGroup;
17+
export const saveStateImpl = core.saveState;
18+
export const getStateImpl = core.getState;
19+
export const groupImpl = core.group;

src/GitHub/Actions/Exec.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
"use strict";
2-
const exec = require("@actions/exec");
1+
import exec from "@actions/exec";
2+
export const exec1Impl = exec.exec;
3+
export const exec2Impl = exec.exec;
34

4-
exports.exec1Impl = exec.exec;
5+
export function exec2Impl2(command, options) {
6+
return exec.exec(command, undefined, options);
7+
}
58

6-
exports.exec2Impl = exec.exec;
7-
8-
exports.exec2Impl2 = (command, options) =>
9-
exec.exec(command, undefined, options);
10-
11-
exports.exec3Impl = exec.exec;
9+
export const exec3Impl = exec.exec;

src/GitHub/Actions/IO.js

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
"use strict";
2-
const io = require("@actions/io");
3-
4-
exports.cp2Impl = io.cp;
5-
6-
exports.cp3Impl = io.cp;
7-
8-
exports.mv2Impl = io.mv;
9-
10-
exports.mv3Impl = io.mv;
11-
12-
exports.rmRFImpl = io.rmRF;
13-
14-
exports.mkdirPImpl = io.mkdirP;
15-
16-
exports.which2Impl = io.which;
17-
18-
exports.which3Impl = io.which;
1+
import io from "@actions/io";
2+
export const cp2Impl = io.cp;
3+
export const cp3Impl = io.cp;
4+
export const mv2Impl = io.mv;
5+
export const mv3Impl = io.mv;
6+
export const rmRFImpl = io.rmRF;
7+
export const mkdirPImpl = io.mkdirP;
8+
export const which2Impl = io.which;
9+
export const which3Impl = io.which;

0 commit comments

Comments
 (0)