Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add missing dependencies on local @netlify/testing package #6133

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

serhalp
Copy link
Contributor

@serhalp serhalp commented Mar 17, 2025

Summary

@netlify/build and @netlify/config had dev dependencies on the local @netlify/testing package (which is a local package only, not published to NPM) but they weren't specified in its package.json

So, I think this is what resulted:

pnpm and yarn support workspace:* to make this local dependency explicit, but we're using npm workspaces, which do not. I opted to include a -local prefix to make this extra explicit.

Disclaimer: I'm not 100% sure if this change will resolve the release-please issue, but it seems desirable either way.

`@netlify/build` and `@netlify/config` had dev dependencies on the local
`@netlify/testing` package (which is a local package only, not published to NPM) but they
weren't specified in its `package.json`

So:
- These imports only sort of happened to work
- TS wasn't complaining because we've explictly remapped that import:

  https://github.com/netlify/build/blob/65206cf/tsconfig.base.json#L30.
- ESLint wasn't complaining because although we are using eslint-plugin-import, we aren't
  using the recommended ruleset and we aren't enabling
  [`no-extraneous-dependencies`]
  (https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules)
- release-please didn't know about that part of our dependency graph, so it was opening
  [release PRs like this one](#6107) that should have
  bumped `@netlify/build` and `@netlify/config` in `packages/testing` but [did
  not](#6124)

  pnpm and yarn support `workspace:*` to make this local dependency explicit, but we're
  using npm workspaces, which do not. I opted to include a `-local` prefix to make this
  extra explicit.
serhalp added a commit that referenced this pull request Apr 9, 2025
See #6188.

The `packages/testing` package has dev dependencies on `packages/build` and
`packages/config`, but these also have (undeclared) dev dependencies on
`packages/testing`.

Since our release-please configuration does not include `packages/testing` at all (there's
nothing to release; it's a "local package" only), major bumps to either of its
dependencies results in `packages/testing` no longer pulling in their local versions and
instead pulls in a duplicated previous published version from the NPM registry.

This in turn results in `@netlify/config` and/or `@netlify/build` not actually testing
their own source, since they use `packages/testing` to test themselves...

This is a confusing mess, and [declaring the missing dependencies does not
work](#6133) because `nx` detects the circular
dependency and aborts 😭.

This prevents the problem from reoccuring.
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.

1 participant