Migrate from Spago 0.21.0 to Spago 1.0.3#323
Conversation
Replace Dhall configuration (spago.dhall, packages.dhall, .solution.dhall) with spago.yaml using registry-based package set 73.0.0 across all 32 exercises and the template. Key changes: - All exercises: spago.yaml replaces dhall files, invalidators updated - CI workflow: spago 1.0.3, removed psa - scripts/ci: pre-compile shared deps, copy example solutions to src/ (replaces .solution.dhall approach since Spago 1.0 has no custom sources) - scripts/ci-check: compare spago.yaml (stripping name field) - bin/update-exercises.sh: propagate template spago.yaml to exercises Companion PR needed in exercism/purescript-test-runner. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
|
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
|
Hello 👋 Thanks for your PR. This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed. If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track. Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum. (cc @exercism/cross-track-maintainers) |
|
This is an unmaintained repository. Cross-track maintainers - feel free to merge. |
|
This PR changes the build configuration (Dhall → YAML) but does not change any test logic or test files. Student test results will be identical. Please add to the merge commit message: |
There was a problem hiding this comment.
Pull request overview
Migrates the PureScript track exercises/template from Spago 0.21 (Dhall + package-sets) to Spago 1.0.3 (YAML + registry package set), and updates CI tooling/scripts accordingly so all exercises can be built/tested under the new Spago workflow.
Changes:
- Replace
spago.dhall/packages.dhall/.solution.dhallwithspago.yamlacross the template and all exercises (registry package set73.0.0). - Rewrite CI scripts (
scripts/ci,scripts/ci-check) for Spago 1.0 behavior and shared dependency caching. - Update GitHub Actions CI to use Node.js 22 and Spago 1.0.3; update invalidators to reference
spago.yaml.
Reviewed changes
Copilot reviewed 201 out of 203 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| template/spago.yaml | Add Spago v1 YAML project config (registry package set). |
| template/spago.dhall | Remove legacy Spago Dhall config. |
| template/packages.dhall | Remove legacy package-set Dhall pin. |
| template/package.json | Bump spago devDependency to ^1.0.3. |
| template/.gitignore | Update ignores for Spago v1 artifacts (.spago/, spago.lock, .purs-repl). |
| scripts/ci-check | Compare normalized spago.yaml across exercises to enforce a shared package set. |
| scripts/ci | Rewrite CI build/test loop for Spago 1 (shared deps + per-exercise test). |
| exercises/practice/word-count/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/word-count/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/word-count/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/word-count/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/word-count/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/word-count/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/triangle/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/triangle/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/triangle/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/triangle/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/triangle/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/triangle/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/sum-of-multiples/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/sum-of-multiples/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/sum-of-multiples/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/sum-of-multiples/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/sum-of-multiples/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/sum-of-multiples/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/spiral-matrix/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/spiral-matrix/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/spiral-matrix/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/spiral-matrix/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/spiral-matrix/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/spiral-matrix/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/scrabble-score/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/scrabble-score/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/scrabble-score/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/scrabble-score/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/scrabble-score/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/scrabble-score/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/rna-transcription/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/rna-transcription/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/rna-transcription/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/rna-transcription/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/rna-transcription/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/rna-transcription/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/raindrops/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/raindrops/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/raindrops/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/raindrops/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/raindrops/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/raindrops/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/phone-number/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/phone-number/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/phone-number/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/phone-number/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/phone-number/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/phone-number/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/pascals-triangle/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/pascals-triangle/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/pascals-triangle/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/pascals-triangle/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/pascals-triangle/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/pascals-triangle/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/pangram/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/pangram/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/pangram/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/pangram/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/pangram/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/pangram/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/meetup/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/meetup/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/meetup/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/meetup/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/meetup/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/meetup/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/matching-brackets/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/matching-brackets/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/matching-brackets/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/matching-brackets/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/matching-brackets/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/matching-brackets/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/leap/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/leap/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/leap/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/leap/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/leap/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/leap/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/largest-series-product/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/largest-series-product/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/largest-series-product/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/largest-series-product/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/largest-series-product/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/largest-series-product/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/knapsack/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/knapsack/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/knapsack/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/knapsack/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/knapsack/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/knapsack/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/isogram/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/isogram/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/isogram/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/isogram/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/isogram/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/isogram/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/hello-world/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/hello-world/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/hello-world/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/hello-world/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/hello-world/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/hello-world/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/hamming/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/hamming/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/hamming/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/hamming/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/hamming/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/hamming/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/etl/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/etl/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/etl/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/etl/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/etl/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/etl/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/difference-of-squares/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/difference-of-squares/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/difference-of-squares/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/difference-of-squares/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/difference-of-squares/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/difference-of-squares/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/diamond/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/diamond/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/diamond/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/diamond/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/diamond/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/diamond/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/crypto-square/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/crypto-square/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/crypto-square/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/crypto-square/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/crypto-square/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/crypto-square/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/collatz-conjecture/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/collatz-conjecture/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/collatz-conjecture/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/collatz-conjecture/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/collatz-conjecture/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/collatz-conjecture/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/bob/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/bob/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/bob/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/bob/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/bob/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/bob/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/binary-search/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/binary-search/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/binary-search/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/binary-search/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/binary-search/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/binary-search/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/atbash-cipher/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/atbash-cipher/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/atbash-cipher/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/atbash-cipher/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/atbash-cipher/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/atbash-cipher/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/anagram/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/anagram/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/anagram/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/anagram/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/anagram/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/anagram/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/allergies/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/allergies/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/allergies/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/allergies/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/allergies/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/allergies/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/all-your-base/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/all-your-base/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/all-your-base/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/all-your-base/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/all-your-base/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/all-your-base/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/acronym/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/acronym/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/acronym/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/acronym/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/acronym/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/acronym/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/practice/accumulate/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/practice/accumulate/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/practice/accumulate/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/practice/accumulate/.solution.dhall | Remove legacy solution-only config. |
| exercises/practice/accumulate/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/practice/accumulate/.gitignore | Update ignores for Spago v1 artifacts. |
| exercises/concept/annalyns-infiltration/spago.yaml | Add per-exercise Spago v1 YAML config. |
| exercises/concept/annalyns-infiltration/spago.dhall | Remove legacy Spago Dhall config. |
| exercises/concept/annalyns-infiltration/packages.dhall | Remove legacy package-set Dhall pin. |
| exercises/concept/annalyns-infiltration/.solution.dhall | Remove legacy solution-only config. |
| exercises/concept/annalyns-infiltration/.meta/config.json | Update invalidator to spago.yaml. |
| exercises/concept/annalyns-infiltration/.gitignore | Update ignores for Spago v1 artifacts. |
| config.json | Update top-level invalidators to spago.yaml. |
| bin/update-exercises.sh | Update propagation script to use template spago.yaml + .gitignore. |
| .github/workflows/ci.yml | Update CI to Node 22 and Spago 1.0.3; remove PSA setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
scripts/ci
Outdated
| # Copy node_modules symlink or directory | ||
| if [ ! -e node_modules ]; then | ||
| ln -s "${build_dir}/node_modules" node_modules | ||
| fi |
There was a problem hiding this comment.
If node_modules already exists (e.g. from a previous local run), this leaves it in place rather than linking to the shared "${build_dir}/node_modules". That can lead to inconsistent tool versions (including which spago binary npx resolves) and non-reproducible CI behavior. Consider removing/replacing an existing node_modules (directory or symlink) the same way you handle .spago/output.
| dependencies: | ||
| - arrays | ||
| - console | ||
| - datetime | ||
| - effect | ||
| - either | ||
| - enums | ||
| - exceptions | ||
| - foldable-traversable | ||
| - integers | ||
| - lists | ||
| - maybe | ||
| - numbers | ||
| - ordered-collections | ||
| - partial | ||
| - prelude | ||
| - psci-support | ||
| - strings | ||
| - test-unit | ||
| - tuples | ||
| - unfoldable | ||
| - unicode |
There was a problem hiding this comment.
PR description mentions adding an st dependency, but the new template spago.yaml does not include st in package.dependencies. Either add the dependency here (and propagate to exercises) or update the PR description to match what’s actually changing.
.github/workflows/ci.yml
Outdated
|
|
||
| - name: Fetch the PureScript compiler | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 |
There was a problem hiding this comment.
For supply-chain security and consistency with the pinned actions/checkout and setup-purescript steps, actions/setup-node should be pinned to a specific commit SHA instead of a mutable @v4 tag.
| uses: actions/setup-node@v4 | |
| uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 |
| echo "Fetching and compiling shared dependencies..." | ||
| spago --no-psa build --deps-only | ||
| npm install | ||
| npx spago install | ||
| popd > /dev/null || exit |
There was a problem hiding this comment.
The script says it is “compiling shared dependencies”, but it only runs npm install + spago install. That typically won’t produce a precompiled output/ directory, so the later cp -R -p "${build_dir}/output" . will fail (or each exercise will rebuild deps anyway). Run a spago build --deps-only (or equivalent) in the build_dir after installing dependencies so output/ is created and contains compiled deps.
bin/update-exercises.sh
Outdated
| for config in "$exercises_dir"/*/*/spago.dhall; do | ||
| exercise_dir=$(dirname "${config}") | ||
| for exercise_dir in "$base_dir"/exercises/*/*; do | ||
| [ -d "${exercise_dir}" ] || continue |
There was a problem hiding this comment.
| [ -d "${exercise_dir}" ] || continue | |
| [[ -d "${exercise_dir}" ]] || continue |
There was a problem hiding this comment.
Why is there a per-exercise .gitignore vs a common one at the root?
There was a problem hiding this comment.
I think it's a good idea to have exercise-scoped .gitignore because if someone downloads an independent exercise, we don't know what context it might exist in, as someone could want to work on an exercise within their own Git repo, so being self-contained guarantees that the right things will be ignored.
BTW, this PR is a mess because I screwed things up, so I'm preparing to address other stuff and create a new PR when I'm ready.
There was a problem hiding this comment.
I meant, the test runner one, where I have a new one exercism/purescript-test-runner#64
There was a problem hiding this comment.
None (or very few) of the other tracks use per-exercise .gitignores. If the user is checking in their code, would it make sense to let them manage their own .gitignore?
There was a problem hiding this comment.
I do think packaging directories with their own scoped .gitignore is the best way to go, and that it's a mistake that it's not a standard practice throughout Exercism.
scripts/ci
Outdated
| if [ -d "examples/src" ] && ls examples/src/*.purs 1>/dev/null 2>&1; then | ||
| cp examples/src/*.purs src/ | ||
| elif [ -f ".meta/Exemplar.purs" ]; then | ||
| # Find the single .purs file in src/ and replace it with the exemplar | ||
| src_file=$(ls src/*.purs | head -1) | ||
| cp ".meta/Exemplar.purs" "${src_file}" | ||
| else | ||
| echo "ERROR: No example solution found for ${slug}" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
| if [ -d "examples/src" ] && ls examples/src/*.purs 1>/dev/null 2>&1; then | |
| cp examples/src/*.purs src/ | |
| elif [ -f ".meta/Exemplar.purs" ]; then | |
| # Find the single .purs file in src/ and replace it with the exemplar | |
| src_file=$(ls src/*.purs | head -1) | |
| cp ".meta/Exemplar.purs" "${src_file}" | |
| else | |
| echo "ERROR: No example solution found for ${slug}" | |
| exit 1 | |
| fi | |
| if [ "$exercise_dir" = ./exercises/practice/* ]; then | |
| files=( examples/src/*.purs ) | |
| if ! [ -f $files ]; then | |
| echo "ERROR: No example solution found for practice exercise ${slug}" | |
| exit 1 | |
| fi | |
| cp examples/src/*.purs src/ | |
| else | |
| if ! [ -f ".meta/Exemplar.purs" ]; then | |
| echo "ERROR: No example solution found for concept exercise ${slug}" | |
| exit 1 | |
| fi | |
| # Find the single .purs file in src/ and replace it with the exemplar | |
| src_file=( src/*.purs ) | |
| cp ".meta/Exemplar.purs" "${src_file}" |
There was a problem hiding this comment.
Should this use the approach of ci-check and check all exercises prior to exiting?
bin/update-exercises.sh
Outdated
| for config in "$exercises_dir"/*/*/spago.dhall; do | ||
| exercise_dir=$(dirname "${config}") | ||
| for exercise_dir in "$base_dir"/exercises/*/*; do | ||
| [[ -d "${exercise_dir}" ]] || continue |
There was a problem hiding this comment.
Note if you add a trailing / to the glob, you don't need this check
scripts/ci
Outdated
|
|
||
| for exercise_dir in ./exercises/{concept,practice}/*/; do | ||
| exercise_dir="${exercise_dir%/}" | ||
| slug=$(basename "${exercise_dir}") |
There was a problem hiding this comment.
| slug=$(basename "${exercise_dir}") | |
| slug="${exercise_dir##*/}" |
scripts/ci
Outdated
| if [ -h .spago ] || [ -d .spago ]; then | ||
| echo "Removing existing spago local cache..." | ||
| # Link/copy pre-compiled dependencies (clean up any existing artifacts) | ||
| if [[ -h .spago ]] || [[ -d .spago ]]; then |
There was a problem hiding this comment.
| if [[ -h .spago ]] || [[ -d .spago ]]; then | |
| if [[ -h .spago || -d .spago ]]; then |
scripts/ci
Outdated
|
|
||
| # Build and test the solution | ||
| spago --no-psa --config .solution.dhall test | ||
| if [[ -h node_modules ]] || [[ -d node_modules ]]; then |
There was a problem hiding this comment.
| if [[ -h node_modules ]] || [[ -d node_modules ]]; then | |
| if [[ -h node_modules || -d node_modules ]]; then |
scripts/ci
Outdated
| # Concept exercises: copy .meta/Exemplar.purs over the single src/*.purs file | ||
| if [[ "$exercise_dir" == ./exercises/practice/* ]]; then | ||
| files=( examples/src/*.purs ) | ||
| if ! [[ -f ${files[0]} ]]; then |
There was a problem hiding this comment.
| if ! [[ -f ${files[0]} ]]; then | |
| if [[ ! -f ${files[0]} ]]; then |
scripts/ci
Outdated
| fi | ||
| cp examples/src/*.purs src/ | ||
| else | ||
| if ! [[ -f ".meta/Exemplar.purs" ]]; then |
There was a problem hiding this comment.
| if ! [[ -f ".meta/Exemplar.purs" ]]; then | |
| if [[ ! -f ".meta/Exemplar.purs" ]]; then |
scripts/ci
Outdated
| popd > /dev/null || exit | ||
| continue | ||
| fi | ||
| cp examples/src/*.purs src/ |
There was a problem hiding this comment.
| cp examples/src/*.purs src/ | |
| cp "${files[@]}" src/ |
scripts/ci
Outdated
| popd > /dev/null || exit | ||
| done | ||
|
|
||
| exit $rc |
There was a problem hiding this comment.
| exit $rc | |
| exit "$rc" |
Migrate from Spago 0.21.0 (Dhall) to Spago 1.0.3 (YAML + Registry) Replace Dhall configuration with spago.yaml using registry-based package set 73.0.0. Update Docker image and test runner for Spago 1.0 compatibility. Key changes: - Dockerfile: node:22-bookworm-slim (Spago 1.0.3 needs node:sqlite), documented dependencies, npm cache cleanup - bin/run.sh: rewrite package name to match pre-compiled lockfile for --offline --pure mode, HOME=/tmp for read-only Docker, sanitize Spago 1.0 output (strip stack traces, new preamble format) - pre-compiled: spago.yaml replaces dhall files - Test examples: spago.yaml, regenerated expected_results.json [Companion PR in exercism/purescript](exercism/purescript#323).
Summary
stdependency for mutable state/arraysDetails
Configuration migration
spago.dhall,packages.dhall,.solution.dhallfrom template and all 32 exercisesspago.yamlfor each, usingregistry: 73.0.0package set.meta/config.jsoninvalidators from["packages.dhall", "spago.dhall"]to["spago.yaml"]config.jsoninvalidatorCI workflow
setup-nodewith Node.js 22 (Spago 1.0.3 requires >=22.5.0 fornode:sqlite)0.21.0->1.0.3psa(no longer needed with Spago 1.0)Script rewrites
scripts/ci: Pre-compiles shared dependencies once, then for each exercise:.spago/andnode_modules/, copiesoutput/(preserving timestamps)src/(replaces.solution.dhallapproach, since Spago 1.0 doesn't support custom source paths)npx spago test --offlinescripts/ci-check: Validates all exercises use identicalspago.yaml(stripping thename:field before comparison)bin/update-exercises.sh: Propagates templatespago.yamlto all exercises with appropriate package nameCompanion PR
Companion test runner PR: exercism/purescript-test-runner#63
Both PRs should be merged together — the track depends on spago 1.0.3 which the test runner also needs.
Test plan
scripts/cishows 32✓ Test succeeded)scripts/ci-checkvalidates consistent spago.yaml across exercises.meta/config.jsoninvalidators updated🤖 Generated with Claude Code