From f1dfa24a0865f79efe2cef30ed41dec2dd4b125d Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 14 Oct 2026 23:49:53 +0000 Subject: [PATCH 1/8] Migrate repository tooling and CI to Spago --- .eslintrc.json | 30 ------------------------------ .github/workflows/ci.yml | 30 ++++++++++++++++-------------- .gitignore | 6 ++++-- .oxfmtrc.json | 3 +++ .tidyrc.json | 10 ++++++++++ CHANGELOG.md | 3 ++- bower.json | 22 ---------------------- package.json | 17 ++++++++++------- scripts/test | 1 - spago.yaml | 14 ++++++++++++++ 10 files changed, 59 insertions(+), 77 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 .oxfmtrc.json create mode 100644 .tidyrc.json delete mode 100644 bower.json create mode 100644 spago.yaml diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 70febb7..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "extends": "eslint:recommended", - "globals": { - "console": true - }, - "rules": { - "strict": [2, "global"], - "block-scoped-var": 2, - "consistent-return": 2, - "eqeqeq": [2, "smart"], - "guard-for-in": 2, - "no-caller": 2, - "no-extend-native": 2, - "no-loop-func": 2, - "no-new": 2, - "no-param-reassign": 2, - "no-return-assign": 2, - "no-unused-expressions": 2, - "no-use-before-define": 2, - "radix": [2, "always"], - "indent": [2, 2], - "quotes": [2, "double"], - "semi": [2, "always"], - "no-console": 0 - } -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c69237a..3e77289 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,30 +6,32 @@ on: pull_request: branches: [master] +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - uses: purescript-contrib/setup-purescript@main - with: - purescript: "unstable" + - uses: actions/checkout@v6 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v6 with: - node-version: "14.x" + node-version: "24" - name: Install dependencies - run: | - npm install -g bower - npm install - bower install --production + run: npm install - name: Build source - run: npm run-script build + run: npm run build - name: Run tests run: | - bower install - npm run-script test --if-present + npm test + ./scripts/test + + - name: Lint + run: npm run lint + + - name: Check formatting + run: npm run format:check diff --git a/.gitignore b/.gitignore index 5b50308..5b8046e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ /.* !/.gitignore -!/.eslintrc.json +!/.tidyrc.json +!/.oxfmtrc.json !/.github/ /bower_components/ /node_modules/ /output/ -package-lock.json +/package-lock.json +/spago.lock test/actual_output.txt diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..757fd64 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,3 @@ +{ + "trailingComma": "es5" +} diff --git a/.tidyrc.json b/.tidyrc.json new file mode 100644 index 0000000..9e39cf1 --- /dev/null +++ b/.tidyrc.json @@ -0,0 +1,10 @@ +{ + "importSort": "ide", + "importWrap": "source", + "indent": 2, + "operatorsFile": null, + "ribbon": 1, + "typeArrowPlacement": "first", + "unicode": "never", + "width": null +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 68339cc..a879d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Bugfixes: Other improvements: +- Migrated from Bower/Pulp to Spago and updated CI, linting, and formatting. + ## [v6.1.0](https://github.com/purescript/purescript-console/releases/tag/v6.1.0) - 2023-10-08 New features: @@ -92,4 +94,3 @@ This release works with versions 0.7.\* of the PureScript compiler. It will not ## [v0.1.0-rc.1](https://github.com/purescript/purescript-console/releases/tag/v0.1.0-rc.1) - 2015-06-06 Initial release candidate. - diff --git a/bower.json b/bower.json deleted file mode 100644 index da93c7f..0000000 --- a/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "purescript-console", - "homepage": "https://github.com/purescript/purescript-console", - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "https://github.com/purescript/purescript-console.git" - }, - "ignore": [ - "**/.*", - "bower_components", - "node_modules", - "output", - "test", - "bower.json", - "package.json" - ], - "dependencies": { - "purescript-effect": "^4.0.0", - "purescript-prelude": "^6.0.0" - } -} diff --git a/package.json b/package.json index 6b85059..c0a8ad2 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,17 @@ { "private": true, "scripts": { - "clean": "rimraf output && rimraf .pulp-cache", - "build": "eslint src && pulp build -- --censor-lib --strict", - "test": "npm run build && ./scripts/test" + "build": "spago build", + "test": "spago test", + "lint": "oxlint --deny-warnings src test", + "format": "purs-tidy format-in-place src test && oxfmt --write .", + "format:check": "purs-tidy check src test && oxfmt --check ." }, "devDependencies": { - "eslint": "^7.15.0", - "pulp": "16.0.0-0", - "purescript-psa": "^0.8.2", - "rimraf": "^3.0.2" + "oxfmt": "^0.73.0", + "oxlint": "^1.88.0", + "purescript": "^0.15.16", + "purs-tidy": "^0.11.1", + "spago": "^1.0.5" } } diff --git a/scripts/test b/scripts/test index cd6b2e8..3e2d64f 100755 --- a/scripts/test +++ b/scripts/test @@ -1,5 +1,4 @@ #!/bin/bash -e -pulp build -I test node --input-type=module -e 'import { main } from "./output/Test.Main/index.js"; main();' > test/actual_output.txt 2>&1 diff -u test/expected_output.txt test/actual_output.txt diff --git a/spago.yaml b/spago.yaml new file mode 100644 index 0000000..5e148c8 --- /dev/null +++ b/spago.yaml @@ -0,0 +1,14 @@ +package: + name: console + build: + strict: true + pedanticPackages: true + dependencies: + - effect: ">=4.0.0 <5.0.0" + - prelude: ">=6.0.0 <7.0.0" + test: + main: Test.Main + strict: true + pedanticPackages: true + dependencies: [] +workspace: {} From b4de5a41fcf73e1f505eb03c3c656a576877fb6a Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 14 Oct 2026 23:49:53 +0000 Subject: [PATCH 2/8] Format repository files with purs-tidy and Oxfmt --- CHANGELOG.md | 13 +++++++++---- src/Effect/Class/Console.purs | 2 +- src/Effect/Console.purs | 5 ++--- test/Main.purs | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a879d1b..72cbc26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,14 +17,17 @@ Other improvements: ## [v6.1.0](https://github.com/purescript/purescript-console/releases/tag/v6.1.0) - 2023-10-08 New features: + - Added `group`, `groupCollapsed`, and `groupEnd` (#42 by @pete-murphy) ## [v6.0.0](https://github.com/purescript/purescript-console/releases/tag/v6.0.0) - 2022-04-27 Breaking changes: + - Migrated FFI to ES modules (#39 by @kl0tl and @JordanMartinez) New features: + - Added `debug` (#36) Bugfixes: @@ -34,16 +37,18 @@ Other improvements: ## [v5.0.0](https://github.com/purescript/purescript-console/releases/tag/v5.0.0) - 2021-02-26 Breaking changes: - - Added support for PureScript 0.14 and dropped support for all previous versions (#30) + +- Added support for PureScript 0.14 and dropped support for all previous versions (#30) New features: Bugfixes: Other improvements: - - Migrated CI to GitHub Actions and updated installation instructions to use Spago (#32) - - Added a CHANGELOG.md file and pull request template (#33, #34) - - Removed `return {}` from FFI functions for a small performance boost (#30) + +- Migrated CI to GitHub Actions and updated installation instructions to use Spago (#32) +- Added a CHANGELOG.md file and pull request template (#33, #34) +- Removed `return {}` from FFI functions for a small performance boost (#30) ## [v4.4.0](https://github.com/purescript/purescript-console/releases/tag/v4.4.0) - 2020-01-26 diff --git a/src/Effect/Class/Console.purs b/src/Effect/Class/Console.purs index d11db86..65ebc73 100644 --- a/src/Effect/Class/Console.purs +++ b/src/Effect/Class/Console.purs @@ -1,6 +1,6 @@ module Effect.Class.Console where -import Control.Bind (discard, bind, pure) +import Control.Bind (bind, discard, pure) import Data.Function ((<<<)) import Data.Show (class Show) import Data.Unit (Unit) diff --git a/src/Effect/Console.purs b/src/Effect/Console.purs index f3d08df..996455b 100644 --- a/src/Effect/Console.purs +++ b/src/Effect/Console.purs @@ -1,10 +1,9 @@ module Effect.Console where -import Control.Bind (discard, bind, pure) -import Effect (Effect) - +import Control.Bind (bind, discard, pure) import Data.Show (class Show, show) import Data.Unit (Unit) +import Effect (Effect) -- | Write a message to the console. foreign import log diff --git a/test/Main.purs b/test/Main.purs index fee924f..8e9387d 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -18,5 +18,5 @@ main = do Console.log "log in groupCollapsed" Console.groupEnd Console.groupEnd - Console.grouped "grouped" do + Console.grouped "grouped" do Console.log "log in grouped" From e40a51f85ac473d43fc7553b9ff00130cdf08072 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 14 Oct 2026 23:58:48 +0000 Subject: [PATCH 3/8] Add Spago publication metadata for console 6.1.1 --- spago.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spago.yaml b/spago.yaml index 5e148c8..d2830ff 100644 --- a/spago.yaml +++ b/spago.yaml @@ -3,6 +3,12 @@ package: build: strict: true pedanticPackages: true + publish: + version: 6.1.1 + license: BSD-3-Clause + location: + githubOwner: purescript + githubRepo: purescript-console dependencies: - effect: ">=4.0.0 <5.0.0" - prelude: ">=6.0.0 <7.0.0" From 7966c90e542df730a62cf816a8bca7f5906f17f5 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:32:45 +0000 Subject: [PATCH 4/8] Credit migration pull request in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72cbc26..7ccfe7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ Bugfixes: Other improvements: -- Migrated from Bower/Pulp to Spago and updated CI, linting, and formatting. +- Migrated from Bower/Pulp to Spago and updated CI, linting, and formatting (#43 by @thomashoneyman) ## [v6.1.0](https://github.com/purescript/purescript-console/releases/tag/v6.1.0) - 2023-10-08 From 37829738f75c87ad5ba9139360adaa19dc1edb54 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:44:46 +0000 Subject: [PATCH 5/8] Prepare versioned changelog for release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ccfe7b..b31e06b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ 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). -## [Unreleased] +## [v6.1.1](https://github.com/purescript/purescript-console/releases/tag/v6.1.1) Breaking changes: From 09349776565b0370cca6177824df467881049e0b Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 21:26:16 +0000 Subject: [PATCH 6/8] Restore Unreleased changelog template and date proposed release --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b31e06b..591f8fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,17 @@ 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). -## [v6.1.1](https://github.com/purescript/purescript-console/releases/tag/v6.1.1) +## [Unreleased] + +Breaking changes: + +New features: + +Bugfixes: + +Other improvements: + +## [v6.1.1](https://github.com/purescript/purescript-console/releases/tag/v6.1.1) - 2026-10-17 Breaking changes: From f44db7e344bf443c2776a7c80daf220e713fe760 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 21:33:16 +0000 Subject: [PATCH 7/8] Describe the library in Spago metadata --- spago.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/spago.yaml b/spago.yaml index d2830ff..bd06c67 100644 --- a/spago.yaml +++ b/spago.yaml @@ -1,5 +1,6 @@ package: name: console + description: Effectful functions for writing to the console build: strict: true pedanticPackages: true From 4052820b445325031027e669c9fc63f364d1a880 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Sat, 17 Oct 2026 16:01:35 +0000 Subject: [PATCH 8/8] Link Unreleased changelog to planned release comparison --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 591f8fa..c7e469c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ 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). -## [Unreleased] +## [Unreleased](https://github.com/purescript/purescript-console/compare/v6.1.1...HEAD) Breaking changes: