spago publish reports used test dependencies as unused when setting pedanticPackages
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system
Research direction
Start by tracing the publish path where hasTests is set to false and how package.test.pedanticPackages is checked; the issue does not name specific files or tests. Reproduce with the listed commands on the v6.0.1 tag of purescript-unsafe-coerce. Done when publishing checks production dependencies without flagging the excluded test dependencies, while normal builds and tests still check both.
Written by the indexing model from the issue text.
Description
I found this while releasing unsafe-coerce with Spago 1.0.5 — that library has no production dependencies, but its tests use console, effect, and prelude, with package.test.pedanticPackages: true. Both spago build and spago test pass, but spago publish fails:
Tests for package 'unsafe-coerce' declare unused dependencies - please remove them from the project config:
- console
- effect
- prelude
You can reproduce this from the v6.0.1 tag of purescript/purescript-unsafe-coerce, using Spago 1.0.5:
npm install
npx spago build
npx spago test
npx spago publish --offline
Publishing excludes test sources by setting hasTests to false, but the build still checks test dependencies because package.test.pedanticPackages is enabled. With no test imports in the source graph, it then incorrectly reports every test dependency as unused. Instead, IMO publishing should check production dependencies without checking dependencies of tests it deliberately excluded. Normal builds and tests should continue checking both.
- Dominant language
- PureScript
- Stars
- 829
- Forks
- 138
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from purescript/spago
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
purescript/spago#1403 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 54/100
purescript/spago#1430 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 22/100
purescript/spago#1426 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
purescript/spago#1386 · 1 comment ·
-
bug UX
Difficulty 3/5 1-2 days Newbie friendliness 35/100
purescript/spago#1330 · 2 comments ·
All issues in purescript/spago
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
immortalwrt/immortalwrt#2522 ·
-
Font inlining cache is not created or reusedPossibly taken @nagahara-naoki claimed this today. Openarea: @angular/build
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
angular/angular-cli#34719 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
osaurus-ai/osaurus#3422 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
foundation/foundation-emails#2127 ·