Skip to content

feat(vite-plugin): add Vite plugin#7

Merged
dangreen merged 7 commits into
mainfrom
add-vite-plugin
Jul 22, 2026
Merged

feat(vite-plugin): add Vite plugin#7
dangreen merged 7 commits into
mainfrom
add-vite-plugin

Conversation

@dangreen

Copy link
Copy Markdown
Member

Adds @srcset/vite-plugin - Vite plugin for generating responsive images.

  • Generates image variants on import with rules from the plugin options or the import query
  • Serves generated variants from memory in the dev server, emits assets on build
  • Reuses @srcset/bundler-utils for query parsing, module codegen and placeholders
  • Stage-consistent pnpm-lock.yaml

🤖 Generated with Claude Code

@coveralls

coveralls commented Jul 21, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29915174825

Coverage increased (+0.6%) to 87.811%

Details

  • Coverage increased (+0.6%) from the base build.
  • Patch coverage: 3 uncovered changes across 2 files (63 of 66 lines covered, 95.45%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
packages/vite-plugin/src/dev.ts 18 16 88.89%
packages/vite-plugin/src/plugin.ts 37 36 97.3%
Total (3 files) 66 63 95.45%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 472
Covered Lines: 430
Line Coverage: 91.1%
Relevant Branches: 332
Covered Branches: 276
Branch Coverage: 83.13%
Branches in Coverage %: Yes
Coverage Strength: 106649.31 hits per line

💛 - Coveralls

Copilot AI 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.

Pull request overview

Adds a new @srcset/vite-plugin package that integrates @srcset/* image generation into the Vite pipeline, supporting both dev-server in-memory serving and build-time asset emission.

Changes:

  • Introduces a Vite plugin (srcset()) that generates responsive image modules on import and emits/serves generated variants.
  • Adds query parsing + filtering helpers and dev-server middleware for serving generated variants.
  • Adds package scaffolding (tsconfigs, lint config, README, tests) and updates the lockfile for workspace consistency.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Adds the new workspace importer and its dependency graph.
packages/vite-plugin/vite.config.js Vitest configuration (timeout + coverage settings) for the new package.
packages/vite-plugin/tsconfig.json Package TS config for typechecking/tests.
packages/vite-plugin/tsconfig.build.json Build TS config for emitting dist/ outputs.
packages/vite-plugin/test/vite.mock.ts Test fixture helper for creating a temporary Vite project and image input.
packages/vite-plugin/src/types.ts Defines the plugin options type surface.
packages/vite-plugin/src/query.ts Implements module-id filtering and query decoding utilities.
packages/vite-plugin/src/query.spec.ts Unit tests for query parsing/filter behavior.
packages/vite-plugin/src/plugin.ts Core Vite plugin implementation (load hook + build/dev behavior).
packages/vite-plugin/src/plugin.spec.ts Integration-style tests for build and dev server behavior.
packages/vite-plugin/src/index.ts Public entry point exports for the package.
packages/vite-plugin/src/dev.ts Dev-server in-memory variant cache + middleware implementation.
packages/vite-plugin/README.md Package documentation and usage examples.
packages/vite-plugin/package.json New package manifest: exports, scripts, deps/peers, publish config.
packages/vite-plugin/oxlint.config.ts Package lint configuration extending repo defaults.
packages/vite-plugin/client.d.ts Ambient module typings for image imports.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/vite-plugin/src/query.ts
@dangreen
dangreen requested a review from Copilot July 21, 2026 21:34

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dangreen

Copy link
Copy Markdown
Member Author

@codex make 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: aebf2f7a38

ℹ️ 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 packages/vite-plugin/src/plugin.ts
Comment thread packages/vite-plugin/src/plugin.ts Outdated
Comment thread packages/vite-plugin/client.d.ts
@dangreen
dangreen requested a review from Copilot July 21, 2026 22:28

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dangreen

Copy link
Copy Markdown
Member Author

@codex make 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: a79920eeb3

ℹ️ 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 packages/vite-plugin/src/plugin.ts
Comment thread packages/vite-plugin/src/query.ts
Comment thread packages/vite-plugin/client.d.ts
Comment thread packages/vite-plugin/src/plugin.ts
@dangreen

Copy link
Copy Markdown
Member Author

@codex make 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: 3ce0ba00d5

ℹ️ 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 packages/vite-plugin/client.d.ts Outdated
Comment thread packages/vite-plugin/client.d.ts
@dangreen

Copy link
Copy Markdown
Member Author

@codex make 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: 3730122981

ℹ️ 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 packages/vite-plugin/client.d.ts
Comment thread packages/vite-plugin/client.d.ts
Comment thread packages/vite-plugin/client.d.ts
@dangreen

Copy link
Copy Markdown
Member Author

@codex make 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: fe94887b2b

ℹ️ 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 packages/vite-plugin/client.d.ts
Comment thread packages/vite-plugin/client.d.ts
Comment thread packages/vite-plugin/client.d.ts
@dangreen

Copy link
Copy Markdown
Member Author

@codex make review

Do not re-raise previously rejected and resolved findings. Already rejected by maintainer decision, do not repeat:

  • typings for query-suffixed image imports (left to the user side)
  • nullable src in the client declarations (null src = configuration error)
  • ambient declarations matching public-dir specifiers (TypeScript wildcard patterns cannot discriminate by resolution result)
  • tree-shaking of emitted asset files (platform behavior, rolldown has no needsCodeReference)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: fe94887b2b

ℹ️ 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".

@dangreen
dangreen merged commit be02c44 into main Jul 22, 2026
7 checks passed
@dangreen
dangreen deleted the add-vite-plugin branch July 22, 2026 11:19
@github-actions github-actions Bot mentioned this pull request Jul 21, 2026
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.

3 participants