fix(gteam-internal): widen @crawlee/core peer range, fix subpath type resolution - #8
Merged
Conversation
…s for subpath imports @crawlee/core's peer range was ~3.16, which conflicts with @crawlee/basic's exact 3.17.0 dependency pulled in transitively by @crawlee/cheerio — this forced npm to install two separate @crawlee/core copies, breaking instanceof checks on NonRetryableError and other cross-package types. Widening to ^3.16.0 lets npm's resolver converge on one shared instance (confirmed via a fresh install against a locally packed tarball). Also adds typesVersions so `@apify/actor-utils/gteam-internal` (and the other subpath exports) resolve under TypeScript's classic "Node" module resolution, which predates and ignores the package.json exports map. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
Testing the gteam-internal subpath in a real consumer (tripadvisor) surfaced two problems. The @crawlee/core peer range of ~3.16 conflicts with @crawlee/basic's exact 3.17.0 dependency, which gets pulled in transitively through @crawlee/cheerio. npm ends up installing two separate @crawlee/core copies, and instanceof checks on NonRetryableError (and other cross-package types like ProxyConfiguration) silently break across the duplicated classes. Separately, importing @apify/actor-utils/gteam-internal failed to type-check under TypeScript's classic "Node" module resolution, which predates and ignores the package.json exports map.
What?
Widens the @crawlee/core peer range to ^3.16.0 so npm's resolver can converge on a single shared instance — verified by packing the library locally, installing it into tripadvisor with a fresh lockfile, and confirming npm ls @crawlee/core shows one deduped version and the build passes. Also adds a typesVersions field so the gteam-internal, qc-logger, and type-utils subpath exports resolve their types under classic "Node" resolution without requiring consumers to change their tsconfig.
Further notes
Consumers need a fresh npm install (regenerating package-lock.json) to actually pick up the dedup — bumping the version with an existing lockfile in place won't trigger the re-resolution.