Migrate from Spago 0.21.0 to Spago 1.0.3#322
Migrate from Spago 0.21.0 to Spago 1.0.3#322FranklinChen wants to merge 1 commit intoexercism:mainfrom
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. |
There was a problem hiding this comment.
Pull request overview
This PR migrates the track’s PureScript build tooling from Spago 0.21 (Dhall) to Spago 1.0.3 (YAML + Registry package sets), updating exercise configurations and CI scripts to keep CI efficient across many independent Spago projects.
Changes:
- Replace
spago.dhall/packages.dhall/.solution.dhallwithspago.yaml(Registry package set73.0.0) across template + exercises. - Rewrite
scripts/ciandscripts/ci-checkfor Spago 1.x and update the CI workflow to use Spago 1.0.3. - Update exercise invalidators and
.gitignoreentries for Spago 1.x artifacts (spago.lock,.spago/,.purs-repl).
Reviewed changes
Copilot reviewed 233 out of 235 changed files in this pull request and generated 34 comments.
Show a summary per file
| File | Description |
|---|---|
| template/spago.yaml | Adds Spago 1.x YAML config using Registry package set 73.0.0 |
| template/spago.dhall | Removes Spago Dhall config |
| template/packages.dhall | Removes package-set Dhall config |
| template/package.json | Updates Spago devDependency to ^1.0.3 |
| template/.gitignore | Updates ignored build/cache artifacts for Spago 1.x |
| scripts/ci | Reworks CI build/test flow for Spago 1.x with shared deps strategy |
| scripts/ci-check | Validates all exercises share the same spago.yaml (excluding name) |
| bin/update-exercises.sh | Propagates template spago.yaml + .gitignore to exercises |
| .github/workflows/ci.yml | Updates setup step to install Spago 1.0.3 (drops psa) |
| config.json | Updates invalidator to spago.yaml |
| exercises/**/spago.yaml | Adds per-exercise Spago 1.x configs |
| exercises/**/spago.dhall | Removes per-exercise Spago Dhall configs |
| exercises/**/packages.dhall | Removes per-exercise package-set Dhall configs |
| exercises/**/.solution.dhall | Removes per-exercise solution-only Dhall configs |
| exercises/**/.meta/config.json | Updates invalidators to spago.yaml |
| exercises/**/.gitignore | Updates ignored artifacts for Spago 1.x |
| exercises/**/src/*.purs | Updates student-facing source files (note: currently replaced with full implementations; see PR comments) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| anagramsFor :: String -> Array String -> Array String | ||
| anagramsFor word candidates = unsafeThrow "You need to implement this function." | ||
| anagramsFor word candidates = filter (isAnagram word) candidates | ||
|
|
There was a problem hiding this comment.
This introduces a complete anagramsFor implementation in the student-facing src/ file. That will make the exercise pass immediately and exposes the solution. Please restore this file to a stub and keep the working code in examples/src.
| meetup :: Year -> Month -> Week -> Weekday -> Maybe Date | ||
| meetup = unsafeThrow "You need to implement this function." | ||
| meetup y m w wd = enumFromTo bottom top | ||
| # map (exactDate y m) | ||
| # catMaybes | ||
| # filter (\d -> weekday d == wd) |
There was a problem hiding this comment.
This change adds a complete meetup implementation to the student-facing src/ file. That will ship a passing solution to learners and duplicates the reference implementation. Please restore this file to a stub and keep the working code in examples/src.
| toRNA :: String -> Maybe String | ||
| toRNA = unsafeThrow "You need to implement this function." | ||
| toRNA dna = fromCharArray <$> traverse complement (toCharArray dna) | ||
|
|
There was a problem hiding this comment.
This replaces the student stub with a complete implementation in src/. That will make the exercise pass immediately and exposes the solution. Please revert src/RnaTranscription.purs to a stub and keep the working solution in examples/src.
| largestProduct :: String -> Int -> Maybe Int | ||
| largestProduct = unsafeThrow "You need to implement this function." | ||
| largestProduct digits span | ||
| | span == 0 = Just 1 | ||
| | span < 0 = Nothing | ||
| | otherwise = do |
There was a problem hiding this comment.
This adds a full largestProduct implementation to the student solution file under src/. That will cause the exercise to pass immediately and exposes the solution. Please revert to a stub and keep the reference implementation in examples/src.
| phoneNumber :: String -> Maybe String | ||
| phoneNumber = unsafeThrow "You need to implement this function." | ||
| phoneNumber input = clean input >>= check |
There was a problem hiding this comment.
This implements the full phone number cleaning logic directly in src/, which is the student submission file. That will ship a working solution to learners. Please revert to a stub and keep the reference implementation in examples/src.
| hey :: String -> String | ||
| hey = unsafeThrow "You need to implement this function." | ||
| hey msg = | ||
| if isYell msg && isQuestion msg then | ||
| "Calm down, I know what I'm doing!" | ||
| else if isQuestion msg then |
There was a problem hiding this comment.
This replaces the student stub with a complete hey implementation in src/. That will ship a passing solution to learners and duplicates the reference implementation. Please revert this file to a stub and keep the working code in examples/src.
| wordCount :: String -> Map String Int | ||
| wordCount = unsafeThrow "You need to implement this function." | ||
| wordCount = prepare >>> freq |
There was a problem hiding this comment.
This appears to be the student-facing solution file (listed under files.solution), but it now contains a full working implementation identical in structure to the example solution. Student stubs should not ship with a passing implementation; keep the reference solution in examples/src and restore this file to a minimal starter that fails tests until implemented.
| raindrops :: Int -> String | ||
| raindrops = unsafeThrow "You need to implement this function." | ||
| raindrops n = | ||
| let |
There was a problem hiding this comment.
This introduces a full working implementation in the student-facing src/ file. That will make the exercise pass on download and exposes the solution. Please revert to a stub and keep the implementation in examples/src.
| isIsogram :: String -> Boolean | ||
| isIsogram = unsafeThrow "You need to implement this function." | ||
| isIsogram = toLower | ||
| >>> toCharArray | ||
| >>> filter letter | ||
| >>> foldl toMap empty |
There was a problem hiding this comment.
This adds a full isIsogram implementation to the learner’s src/ file. That will make the exercise pass out-of-the-box and exposes the solution. Please revert this file to a stub and keep the reference solution in examples/src.
| squareOfSum :: Int -> Int | ||
| squareOfSum = unsafeThrow "You need to implement `squareOfSum`." | ||
| squareOfSum n = sum (range 1 n) `pow` 2 | ||
|
|
||
| sumOfSquares :: Int -> Int | ||
| sumOfSquares = unsafeThrow "You need to implement `sumOfSquares`." | ||
| sumOfSquares n = map (_ `pow` 2) (range 1 n) # sum |
There was a problem hiding this comment.
This change fills in the full implementations for the student-facing functions in src/. That will ship a passing solution to learners and duplicates the reference implementation. Please revert src/DifferenceOfSquares.purs to a stub and keep the working code in examples/src.
Summary
Details
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
0.21.0->1.0.3psa(no longer needed with Spago 1.0)setup-purescriptaction handles spago 1.0.3 nativelyScript 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