Skip to content

Commit 2644e5f

Browse files
Migrate to Spago and update CI (#42)
* Migrate repository tooling and CI to Spago * Format repository with purs-tidy and Oxfmt * Add registry publication metadata * Credit migration pull request in changelog * Prepare versioned changelog for release * Prepare changelog release date and unreleased section * Describe the library in Spago metadata * Clarify reference modification and test assertions * Link unreleased changelog comparison
1 parent f8e6216 commit 2644e5f

11 files changed

Lines changed: 89 additions & 84 deletions

File tree

‎.eslintrc.json‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ on:
66
pull_request:
77
branches: [master]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v2
14-
15-
- uses: purescript-contrib/setup-purescript@main
16-
with:
17-
purescript: "unstable"
16+
- uses: actions/checkout@v6
1817

19-
- uses: actions/setup-node@v2
18+
- uses: actions/setup-node@v6
2019
with:
21-
node-version: "14.x"
20+
node-version: "24"
2221

2322
- name: Install dependencies
24-
run: |
25-
npm install -g bower
26-
npm install
27-
bower install --production
23+
run: npm install
2824

2925
- name: Build source
30-
run: npm run-script build
26+
run: npm run build
3127

3228
- name: Run tests
33-
run: |
34-
bower install
35-
npm run-script test --if-present
29+
run: npm test
30+
31+
- name: Lint
32+
run: npm run lint
33+
34+
- name: Check formatting
35+
run: npm run format:check

‎.gitignore‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/.*
22
!/.gitignore
3-
!/.eslintrc.json
3+
!/.tidyrc.json
4+
!/.oxfmtrc.json
45
!/.github/
56
/bower_components/
67
/node_modules/
78
/output/
8-
package-lock.json
9+
/package-lock.json
10+
/spago.lock

‎.oxfmtrc.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"trailingComma": "es5"
3+
}

‎.tidyrc.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"importSort": "ide",
3+
"importWrap": "source",
4+
"indent": 2,
5+
"operatorsFile": null,
6+
"ribbon": 1,
7+
"typeArrowPlacement": "first",
8+
"unicode": "never",
9+
"width": null
10+
}

‎CHANGELOG.md‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5-
## [Unreleased]
5+
## [Unreleased](https://github.com/purescript/purescript-refs/compare/v6.0.1...HEAD)
66

77
Breaking changes:
88

@@ -12,9 +12,22 @@ Bugfixes:
1212

1313
Other improvements:
1414

15+
## [v6.0.1](https://github.com/purescript/purescript-refs/releases/tag/v6.0.1) - 2026-10-17
16+
17+
Breaking changes:
18+
19+
New features:
20+
21+
Bugfixes:
22+
23+
Other improvements:
24+
25+
- Migrate from Bower/Pulp to Spago and update CI, linting, and formatting (#42 by @thomashoneyman)
26+
1527
## [v6.0.0](https://github.com/purescript/purescript-refs/releases/tag/v6.0.0) - 2022-04-27
1628

1729
Breaking changes:
30+
1831
- Migrate FFI to ES modules (#39 by @kl0tl and @JordanMartinez)
1932

2033
New features:
@@ -26,18 +39,21 @@ Other improvements:
2639
## [v5.0.0](https://github.com/purescript/purescript-refs/releases/tag/v5.0.0) - 2021-02-26
2740

2841
Breaking changes:
42+
2943
- Added support for PureScript 0.14 and dropped support for all previous versions (#29)
3044

3145
New features:
46+
3247
- Allow the construction of self-referential `Ref`s (#21)
3348
- Add roles declarations to allow safe coercions (#29)
3449

3550
Bugfixes:
3651

3752
Other improvements:
53+
3854
- Add some examples and tests and update documentation (#19, #20, #31)
3955
- Remove primes from foreign module exports in preparation for ES modules (#24)
40-
- Remove `return {}` from FFI implementations for a small performance boost (#27)
56+
- Remove `return {}` from FFI implementations for a small performance boost (#27)
4157
- Migrated CI to GitHub Actions and updated installation instructions to use Spago (#33)
4258
- Added a changelog and pull request template (#34, #35)
4359

‎bower.json‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎package.json‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
22
"private": true,
33
"scripts": {
4-
"clean": "rimraf output && rimraf .pulp-cache",
5-
"test": "pulp test",
6-
"build": "eslint src && pulp build -- --censor-lib --strict"
4+
"build": "spago build",
5+
"test": "spago test",
6+
"lint": "oxlint --deny-warnings src test",
7+
"format": "purs-tidy format-in-place src test && oxfmt --write .",
8+
"format:check": "purs-tidy check src test && oxfmt --check ."
79
},
810
"devDependencies": {
9-
"eslint": "^7.15.0",
10-
"pulp": "16.0.0-0",
11-
"purescript-psa": "^0.8.2",
12-
"rimraf": "^3.0.2"
11+
"oxfmt": "^0.73.0",
12+
"oxlint": "^1.88.0",
13+
"purescript": "^0.15.16",
14+
"purs-tidy": "^0.11.1",
15+
"spago": "^1.0.5"
1316
}
1417
}

‎spago.yaml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package:
2+
name: refs
3+
description: Functions for creating, reading, and updating mutable references
4+
build:
5+
strict: true
6+
pedanticPackages: true
7+
publish:
8+
version: 6.0.1
9+
license: BSD-3-Clause
10+
location:
11+
githubOwner: purescript
12+
githubRepo: purescript-refs
13+
dependencies:
14+
- effect: ">=4.0.0 <5.0.0"
15+
- prelude: ">=6.0.0 <7.0.0"
16+
test:
17+
main: Test.Main
18+
strict: true
19+
pedanticPackages: true
20+
dependencies:
21+
- assert: ">=6.0.0 <7.0.0"
22+
workspace: {}

‎src/Effect/Ref.purs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ foreign import modifyImpl :: forall s b. (s -> { state :: s, value :: b }) -> Re
6363
-- | Update the value of a mutable reference by applying a function
6464
-- | to the current value. The updated value is returned.
6565
modify :: forall s. (s -> s) -> Ref s -> Effect s
66-
modify f = modify' \s -> let s' = f s in { state: s', value: s' }
66+
modify f = modify' \s -> do
67+
let s' = f s
68+
{ state: s', value: s' }
6769

6870
-- | A version of `modify` which does not return the updated value.
6971
modify_ :: forall s. (s -> s) -> Ref s -> Effect Unit

0 commit comments

Comments
 (0)