feat: publish a consumable packages.json for the new spago by Unisay · Pull Request #5 · purescript-lua/purescript-lua-package-sets · GitHub
Skip to content

feat: publish a consumable packages.json for the new spago#5

Merged
Unisay merged 5 commits into
masterfrom
feat/json-package-set-new-spago
Jun 24, 2026
Merged

feat: publish a consumable packages.json for the new spago#5
Unisay merged 5 commits into
masterfrom
feat/json-package-set-new-spago

Conversation

@Unisay

@Unisay Unisay commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Why

The PureScript toolchain moved to the new spago (1.x), which takes a single workspace.packageSet source and dropped Dhall. Our forks-only packages.dhall overlay was never a whole set: consumers merged it with the upstream set via upstream-ps // upstream-lua. The new spago has no merge operator and no Dhall, so that overlay is no longer directly consumable.

The spike in purescript-lua/purescript-lua#115 confirmed three ways (the spago docs, the core/src/Config.purs codecs, and a working PoC) that the new spago consumes a custom set through packageSet.url / packageSet.path, and that such a set may carry git package entries. So the set can be a single, self-contained build input again.

What

Each psc-* release publishes packages.json: a RemotePackageSet with the pinned registry baseline (77.8.0) for the pure packages and the Lua forks overlaid as git entries ({ git, ref, dependencies }). A consumer points workspace.packageSet.url at it and drops the extraPackages block entirely. Dhall is dropped wholesale in the same change: the forks overlay becomes src/packages.json (the single source of truth), the legacy packages.dhall asset is gone, and spago 0.21 / Dhall is no longer supported. The whole ecosystem moves to the new spago.

Changes:

  • scripts/gen-package-set-json builds packages.json from src/packages.json folded onto the registry baseline. It is self-contained (pulls jq + curl from nixpkgs), the same pattern as scripts/gen-readme-table.sh, which now also reads the JSON overlay.
  • release.yml generates and publishes packages.json. While here it moves off the archived node12 release actions (actions/create-release, upload-release-asset) to gh release create, and bumps checkout / install-nix-action / cachix-action to current majors.
  • test-set.yml migrates the coherence check to the new spago: it generates the set, then builds test/ (now a spago.yaml pointing packageSet.path at the generated file) against it. The old check ran spago build -u "-g corefn" on a legacy spago.dhall, which the new spago in the pslua dev shell no longer accepts. So this also unbreaks the workflow, and exercises the generator on every push.
  • test/ moves from spago.dhall + packages.dhall to spago.yaml. The stale root packages.json (an upstream snapshot from the first commit, referenced nowhere) is removed; the generated artifacts are gitignored.
  • ADR 0008 records the decision (consumable JSON set, JSON source of truth, Dhall removed) and supersedes the spago 0.21 pin in ADR 0001 (the purs 0.15.16 and Lua 5.1 pins stand). The fork-level Dhall (dev-shell tool, treefmt formatter; ADR 0001/0007) goes in the per-fork migration pass. CONTRIBUTING and README are updated to the packageSet.url flow.

Verification

  • The generator produces a 640-package set (639 registry baseline + 21 forks, with lua-ngx net-new). A scratch project depending on prelude/effect/console/arrays/strings builds green against it via packageSet.path under spago 1.0.4.
  • The migrated test/ coherence project (every fork) builds green the same way (184 modules, no unused-dependency errors).
  • scripts/gen-readme-table.sh --check passes (the README table is unchanged).

Follow-up

After merge I will cut psc-0.15.15-20260623 so the release carries packages.json; latest-compatible-sets.json already points at it. Then pslua's own test/ps switches from its inlined extraPackages to this packageSet.url, and the forks migrate their own builds to the new spago.

The new spago (1.x) takes a single packageSet source and dropped Dhall, so
the forks-only `packages.dhall` overlay is no longer directly consumable: a
`//` merge can't be expressed. Spike purescript-lua/purescript-lua#115
confirmed spago consumes a custom set via `packageSet.url`/`path`, with git
package entries.

Each release now also publishes `packages.json` — a RemotePackageSet of the
pinned registry baseline (77.8.0) with the Lua forks overlaid as git entries.
Consumers point `workspace.packageSet.url` at it and drop `extraPackages`.
`src/packages.dhall` stays the single source of truth; the legacy
`packages.dhall` asset is still published for Dhall / spago 0.21 consumers.

- scripts/gen-package-set-json: build packages.json from src/packages.dhall
  onto the registry baseline (self-contained, nixpkgs dhall-json+jq+curl).
- release.yml: generate + publish packages.json alongside packages.dhall;
  modernize to `gh release create` (drops the deprecated node12 release
  actions); bump checkout/install-nix/cachix to current majors.
- test-set.yml: migrate the coherence check to the new spago — generate the
  set, then build test/ (now spago.yaml) against it via packageSet.path, so
  the generator is exercised on every push.
- test/: spago.dhall/packages.dhall -> spago.yaml; remove the stale committed
  root packages.json (vestigial upstream snapshot, referenced nowhere); ignore
  the generated artifacts.
- docs: ADR 0008 (supersedes the spago 0.21 pin in 0001); CONTRIBUTING +
  README updated to the new-spago packageSet.url flow.
@Unisay Unisay requested a review from Copilot June 23, 2026 16:19
@Unisay Unisay self-assigned this Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the package-set repo to support the new spago (1.x) by generating and publishing a consumable packages.json (RemotePackageSet) built from src/packages.dhall over a pinned PureScript Registry baseline, while keeping the legacy packages.dhall overlay for Dhall/spago 0.21 consumers.

Changes:

  • Add scripts/gen-package-set-json to generate a full packages.json from src/packages.dhall + registry baseline.
  • Migrate the coherence-check project under test/ from Dhall to spago.yaml and update CI to generate/build against the JSON set.
  • Update release workflow to publish both packages.json and packages.dhall, plus docs/ADR/README/CONTRIBUTING to reflect the new consumption flow.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/src/Main.purs Updates comment to reflect spago.yaml-based coherence check.
test/spago.yaml New spago 1.x project config that depends on all forks and points to ../packages.json.
test/spago.dhall Removes legacy spago Dhall config for the coherence check.
test/packages.dhall Removes legacy Dhall merge-based package-set configuration for the coherence check.
test/.gitignore Ignores spago.lock for the test project.
scripts/gen-package-set-json New generator that produces a spago-consumable RemotePackageSet JSON at repo root.
README.md Documents workspace.packageSet.url usage for spago 1.x and retains legacy Dhall instructions.
packages.json Removes the previously committed (stale) root packages.json snapshot.
latest-compatible-sets.json Bumps the “latest compatible” tag pointer to the new release tag.
docs/adr/README.md Adds ADR 0008 to the ADR index.
docs/adr/0008-new-spago-and-json-package-set.md New ADR recording the move to spago 1.x and publishing packages.json.
docs/adr/0001-overlay-flake-toolchain.md Notes that the spago pin from ADR 0001 is superseded by ADR 0008.
CONTRIBUTING.md Updates toolchain guidance and release asset documentation for spago 1.x + packages.json.
.gitignore Ignores generated release artifacts (/packages.json, /packages.dhall) and local-only /.local/.
.github/workflows/test-set.yml Updates CI to generate packages.json and build the test project with spago 1.x.
.github/workflows/release.yml Generates/publishes packages.json alongside packages.dhall using gh release create.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
src/packages.dhall used zero Dhall features beyond a flat record, and with the
forks migrating off spago 0.21 too, Dhall had no remaining purpose. Convert the
forks overlay to src/packages.json once and remove Dhall from the repo.

- src/packages.dhall -> src/packages.json (same {repo,version,dependencies}
  overlay, now JSON).
- gen-package-set-json / gen-readme-table.sh read src/packages.json with jq;
  drop dhall-to-json (and dhall-json from their nix shells).
- release.yml: stop publishing the legacy packages.dhall asset; only
  packages.json. spago 0.21 / Dhall is no longer supported.
- README / CONTRIBUTING / ADR 0006 / ADR 0008 + .gitignore + test-set.yml
  comments: point at src/packages.json; ADR 0008 records the wholesale Dhall
  removal. The fork-level Dhall (dev-shell tool, treefmt formatter; ADR 0001/
  0007) is removed in the per-fork migration pass.

Verified: generator still yields the 640-package set; coherence build green;
README table in sync.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 1 comment.

Comment thread CONTRIBUTING.md Outdated
Unisay added 3 commits June 23, 2026 19:28
- CONTRIBUTING.md:15: clarify the dev shell / flake.lock guidance is per-fork
  (forks carry flake.nix); the set repo has no flake and its CI builds through
  the pslua dev shell (#discussion_r3461467833)
- release.yml:19: drop the misplaced "generator pulls jq + curl" comment above
  install-nix-action (#discussion_r3461362852)
The packageSet.url example and latest-compatible-sets.json point at the tag this
change is released under.
@Unisay Unisay merged commit 8ae155b into master Jun 24, 2026
2 checks passed
@Unisay Unisay deleted the feat/json-package-set-new-spago branch June 24, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants