Skip to content

Declare typescript as a peer dependency - #784

Open
Purv-Kabaria wants to merge 1 commit into
Effect-TS:mainfrom
Purv-Kabaria:typescript-peer-dependency
Open

Purv-Kabaria wants to merge 1 commit into
Effect-TS:mainfrom
Purv-Kabaria:typescript-peer-dependency

Conversation

@Purv-Kabaria

Copy link
Copy Markdown

Closes #772

@effect/language-service imports typescript/lib/tsserverlibrary but its published manifest declares no relationship to typescript. With an isolated linker (Bun's, or pnpm without hoisting) that import can resolve to an unrelated hoisted copy, e.g. a TypeScript 7 alias, and the CLI fails with Package subpath './lib/tsserverlibrary' is not defined by "exports".

This adds typescript: "^5.0.0 || ^6.0.0" as a peer dependency, matching the range the CLI already reports as supported (supports TypeScript 5.x and 6.x in src/cli/utils.ts).

Since the published package.json is generated in tsup.config.ts from a fixed list of fields, the peerDependencies field is passed through there too; otherwise it would never reach npm. I built the package and checked that dist/package.json now contains it. The lockfile change is the new importer entry that pnpm 8.11.0 records for the peer.

Checked: pnpm install --frozen-lockfile, pnpm --filter @effect/language-service build, and tsc -b for the package. No TypeScript sources changed, so I didn't run the full v3/v4 test suites.

@changeset-bot

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d391475

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/language-service Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Purv-Kabaria

Copy link
Copy Markdown
Author

@mattiamanzati could you approve the workflows when you get a chance? Small change: typescript is declared as a peer dependency and added to the generated dist/package.json, with a changeset included (#772).

@Purv-Kabaria

Copy link
Copy Markdown
Author

Hi! Thanks for getting the workflows running. Build, lint, and both the v3 and v4 test suites are green. The peer dependency also goes into the generated dist/package.json, and the changeset is included. Happy to adjust the version range or packaging approach if you would prefer something different.

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.

Declare TypeScript as a peer dependency for isolated linkers

1 participant