Skip to content

fix: resolve marko.internal.d.ts from the installed language-tools - #575

Merged
DylanPiercey merged 2 commits into
mainfrom
dpiercey-ws-marko-pnpm-triage-ulgto5
Jul 24, 2026
Merged

fix: resolve marko.internal.d.ts from the installed language-tools#575
DylanPiercey merged 2 commits into
mainfrom
dpiercey-ws-marko-pnpm-triage-ulgto5

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

getTypeLibs resolved its own shipped marko.internal.d.ts through TypeScript module resolution based at the consumer's project root. Under pnpm, @marko/language-tools is a transitive dep of @marko/type-check and deliberately isn't exposed at the consumer's top level, so the lookup returned nothing and mtc hard-crashed with Could not resolve marko type files. on a stock project. npm/yarn hoisting made it work by accident.

Takes the file from import.meta.url instead (esbuild shim for the cjs bundle, which also keeps the "use strict" prologue intact). The neighbouring marko and @marko/run lookups are left as module resolutions — those must find the consumer's installed versions. Both throws now name the specifier and base dir, or the exact path that was missing.

Verified with a project that exposes only marko at its root: mtc threw before, exits 0 after, and still reports real diagnostics. The new test builds that layout in a tmpdir and checks both published entrypoints; @marko/language-tools had no test script, so one was added and root pnpm test / CI now pick it up.

`getTypeLibs` resolved its own shipped type file as a module id based at the
consumer's project root. Under pnpm `@marko/language-tools` is a transitive
dep of `@marko/type-check` and is deliberately not exposed there, so the
lookup returned nothing and `mtc` threw "Could not resolve marko type files."
Hoisted layouts only worked by accident.

Take the file from `import.meta.url` instead (with an esbuild shim for the
cjs bundle). The neighbouring `marko` / `@marko/run` lookups stay module
resolutions — those must find the consumer's versions.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf1afa9e-dcb2-47ba-a3c5-b137e36949f3

📥 Commits

Reviewing files that changed from the base of the PR and between 335621b and 106c40b.

📒 Files selected for processing (7)
  • .changeset/internal-types-self-resolve.md
  • agent-feedback/bugs.md
  • packages/language-tools/.mocharc.json
  • packages/language-tools/build.mts
  • packages/language-tools/package.json
  • packages/language-tools/src/util/__tests__/project.test.ts
  • packages/language-tools/src/util/project.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dpiercey-ws-marko-pnpm-triage-ulgto5

Comment @coderabbitai help to get the list of available commands.

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 106c40b

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

This PR includes changesets to release 5 packages
Name Type
@marko/language-server Patch
@marko/language-tools Patch
@marko/ts-plugin Patch
@marko/type-check Patch
marko-vscode 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

`updateInternalDependents` defaults to "out-of-range", and every internal
range is a caret that a patch satisfies, so bumping @marko/language-tools
alone released nothing downstream — mtc, the language server, the ts plugin
and the vscode extension would all have kept shipping the old build.
@DylanPiercey

Copy link
Copy Markdown
Contributor Author

Added the four consumers to the changeset. Bumping @marko/language-tools alone released nothing downstream: updateInternalDependents defaults to out-of-range and every internal range is a caret that a patch satisfies, so changeset version produced a single 2.6.6 and left @marko/type-check, @marko/language-server, @marko/ts-plugin and marko-vscode untouched — the packages users actually install would have kept shipping the old build. Verified locally that it now bumps all five and rewrites every internal range.

@DylanPiercey
DylanPiercey merged commit 9679e10 into main Jul 24, 2026
5 checks passed
@DylanPiercey
DylanPiercey deleted the dpiercey-ws-marko-pnpm-triage-ulgto5 branch July 24, 2026 20:30
@github-actions github-actions Bot mentioned this pull request Jul 24, 2026
@DylanPiercey DylanPiercey moved this to Done in Roadmap Jul 31, 2026
@DylanPiercey DylanPiercey self-assigned this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant