Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Resolve circular dependency #3054

Closed
1 task
FK78 opened this issue Feb 4, 2020 · 5 comments
Closed
1 task

Resolve circular dependency #3054

FK78 opened this issue Feb 4, 2020 · 5 comments
Labels
bug Something isn't working external blocked Blocked by an external dependency ws-articles Tasks for the WS Articles Team
Projects

Comments

@FK78
Copy link
Contributor

FK78 commented Feb 4, 2020

Describe the bug
Related to bbc/simorgh#5182

The latest update of jest-styled-components requires styled-components as a peerDependency, adding styled-components inside psammead-test-helpers causes a test failure.

Bumping of styled-components in the root package.json resolves the test failure above, but produces new test failures, this is because psammead-test-helpers is used throughout psammead.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to psammead-test-helpers and open package.json
  2. Bump jest-styled-components and add styled-components as a peerDependency.
  3. Run npm install inside packages/utilities/psammead-test-helpers
  4. Run unit tests.
  5. See error
  6. Go to Psammead's root package.json
  7. Bump styled-components to 5.0.0
  8. Run npm install
  9. Run unit tests.
  10. See error

Expected behaviour
No errors.
We should not have to publish a failing package.

Screenshots
Screenshot 2020-02-04 at 10 55 23
Bumping jest-styled-components and adding styled-components as a peerDependency in psammead-test-helpers.

image (1)
Bumping styled-components in root package.json.

Testing notes

  • This bug fix is expected to need manual testing.

Additional context
Add any other context about the problem here.

@FK78 FK78 added bug Something isn't working ws-home Tasks for the WS Home Team ws-articles Tasks for the WS Articles Team ws-media The World Service media stream Heracles labels Feb 4, 2020
@FK78 FK78 added this to the Psammead 3.0 milestone Feb 4, 2020
@FK78 FK78 added this to To do in Simorgh via automation Feb 4, 2020
@amywalkerdev amywalkerdev moved this from To do to Ready for dev in Simorgh Feb 4, 2020
@oluoluoxenfree oluoluoxenfree moved this from Ready for dev to Issue in Progress in Simorgh Feb 4, 2020
@oluoluoxenfree oluoluoxenfree mentioned this issue Feb 5, 2020
3 tasks
@oluoluoxenfree
Copy link
Contributor

This seems to be a recently reported issue to the jest-styled-components team: styled-components/jest-styled-components#297 (comment)

I don't think it's because the dependency is circular; I think it's the versions.

@oluoluoxenfree oluoluoxenfree removed their assignment Feb 13, 2020
@oluoluoxenfree oluoluoxenfree moved this from Issue in Progress to Ready for dev in Simorgh Feb 13, 2020
@mykeels
Copy link
Contributor

mykeels commented Feb 25, 2020

I found that to bump styled-components to 5.0.0, we have to bump jest-styled-components to 7.0.0

It's also important to modify the package-lock.json in root to specify ^7.0.0 for the jest-styled-components version, and run npm ci instead of npm i, so the specified versions in the lock file are installed.

@mykeels mykeels mentioned this issue Feb 25, 2020
3 tasks
@mykeels mykeels added the external blocked Blocked by an external dependency label Mar 3, 2020
@FK78 FK78 moved this from Ready for dev to Blocked (by something outside pod) in Simorgh Mar 5, 2020
@sareh
Copy link
Contributor

sareh commented May 4, 2020

jest-styled-components has released 7.0.0, so can this ticket be unblocked? https://www.npmjs.com/package/jest-styled-components?activeTab=versions

@sareh sareh removed the Heracles label May 4, 2020
@sareh
Copy link
Contributor

sareh commented May 4, 2020

It seems like this is still an issue. Still blocked pending this being fixed in jest-styled-components: styled-components/jest-styled-components#297

@simonsinclair
Copy link
Contributor

We've started tackling this as part of bbc/simorgh#6922 and bbc/simorgh#5182 with the merge of #3636 and #3638.

Simorgh automation moved this from Blocked to Done Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working external blocked Blocked by an external dependency ws-articles Tasks for the WS Articles Team
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants