Skip to content

feat(playground): introduce dependency types support and allow @rstest/core - #2126

Merged
fansenze merged 5 commits into
mainfrom
feat/playground-source-types
Sep 16, 2026
Merged

fansenze merged 5 commits into
mainfrom
feat/playground-source-types

Conversation

@elecmonkey

@elecmonkey elecmonkey commented Sep 10, 2026

Copy link
Copy Markdown
Member

Motivation

When sharing @rstest/core rule examples in the Playground, the editor reports unresolved imports and type-aware rules cannot see the corresponding package types.

image

Changes

Following the existing rslint.config.js type loading approach, the Playground now resolves supported package declarations from esm.sh and installs them into Monaco. The same declarations are also passed to the wasm lint request through the virtual file system, with an in-memory compilerOptions.paths mapping so type-aware rules can resolve them without changing the user's visible tsconfig.

The source dependency support is catalog-driven: each entry defines the import pattern, esm.sh package URL, Monaco mount path, and lint VFS path. This makes @rstest/core the first supported dependency without baking Rstest-specific loading logic into the Playground.

This change currently detects static import/export forms such as from '@rstest/core'. It loads the bundled Rstest declaration together with its supported Chai declaration graph, while code without a supported import keeps the existing behavior and does not fetch dependency types.

Current declaration sizes from esm.sh:

Declaration Raw Gzip
@rstest/core@0.11.12 156.0 KiB 38.0 KiB
@types/chai@5.2.3 85.5 KiB 7.7 KiB
@types/deep-eql@4.0.2 1.1 KiB 0.6 KiB
assertion-error@2.0.1 0.7 KiB 0.3 KiB
Total 243.3 KiB 46.5 KiB

@elecmonkey elecmonkey changed the title feat(website): introduce playground source dependency types support and allow @rstest/core feat(playground): introduce dependency types support and allow @rstest/core Sep 10, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploying rslint with  Cloudflare Pages  Cloudflare Pages

Latest commit: e3917c4
Status: ✅  Deploy successful!
Preview URL: https://59682d0f.rslint.pages.dev
Branch Preview URL: https://feat-playground-source-types.rslint.pages.dev

View logs

@elecmonkey
elecmonkey marked this pull request as ready for review September 10, 2026 10:07
@elecmonkey

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ca6bb6fb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread website/theme/components/Playground/source-types.ts Outdated
@elecmonkey
elecmonkey marked this pull request as draft September 10, 2026 10:28
@elecmonkey
elecmonkey marked this pull request as ready for review September 10, 2026 11:16
@elecmonkey

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 314d24c0a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread website/theme/components/Playground/Client.tsx
@elecmonkey

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4c36ad96f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread website/theme/components/Playground/source-types.ts
@elecmonkey
elecmonkey force-pushed the feat/playground-source-types branch from b4c36ad to 91596f7 Compare September 15, 2026 06:12
@elecmonkey

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: e3917c46a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fansenze
fansenze merged commit 29b9baf into main Sep 16, 2026
23 of 29 checks passed
@fansenze
fansenze deleted the feat/playground-source-types branch September 16, 2026 11:44
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.

2 participants