Skip to content

feat(config): add an entry without pack types - #2679

Closed
fouteox wants to merge 1 commit into
voidzero-dev:mainfrom
fouteox:fix/config-entry-types
Closed

feat(config): add an entry without pack types#2679
fouteox wants to merge 1 commit into
voidzero-dev:mainfrom
fouteox:fix/config-entry-types

Conversation

@fouteox

@fouteox fouteox commented Sep 12, 2026

Copy link
Copy Markdown

Importing defineConfig from vite-plus brings tsdown's declarations into the project, even when it never uses vp pack.

vite-plus/config exposes the existing configuration helpers without the pack augmentation. The root entry keeps its current behavior by re-exporting the types from vite-plus/pack. Static extraction and migrations recognize the new entry; a migration that adds pack switches the import back to the root.

The two native CLI snapshots check the installed packages, strict TypeScript 7, static execution and ESM/CommonJS identity. Pack integrations are checked with TypeScript 6. The 1,210 JavaScript tests, 429 affected Rust tests, repository type checks and formatting pass; the full cross-platform snapshot matrix has not been run locally.

Importing the root or pack entry elsewhere in the same TypeScript program still loads the augmentation. This leaves the optional integrations' declarations unchanged. OXC #20416 previously suggested /config for another API, so the entry's name and scope need maintainer agreement.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-12T11:47:03.885469Z 9a92041 PR opened
🔒 Security Review Completed 2026-09-12T11:46:12.976224Z 9a92041 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​typescript@​7.0.29910089100100

View full report

@fengmk2

fengmk2 commented Sep 12, 2026

Copy link
Copy Markdown
Member

@fouteox Can I get more details about the reason for this change? Could you describe what problem you encountered?

@fouteox

fouteox commented Sep 12, 2026

Copy link
Copy Markdown
Author

Thanks, I should have included the original failure.

This came from a Laravel/Inertia/React application that uses Vite+ for its frontend, without vp pack. Removing skipLibCheck exposed errors from pack's optional integrations. A small example is:

import { defineConfig } from 'vite-plus';

export default defineConfig({
  build: { sourcemap: true },
  fmt: { semi: true },
});

With both vite-plus and @voidzero-dev/vite-plus-core at 0.3.0, TypeScript 7.0.2, strict: true, skipLibCheck: false and moduleResolution: "bundler", this reports errors such as:

TS2307: Cannot find module 'publint' or its corresponding type declarations.
TS2305: Module '"typescript"' has no exported member 'FileExtensionInfo'.

I rechecked with both packages at 0.3.1 from npm, and this example already passes. The bundled declarations now contain targeted @ts-ignore comments for these cases. I should have made clear that the original failure no longer requires this PR.

The remaining difference is which declarations TypeScript loads. With 0.3.1, tsc --listFiles still includes dist/tsdown/index-types.d.ts through the root import. Changing the import to vite-plus/config with this PR leaves that file out. The existing root and pack entries keep their behavior, including those suppressions; this PR does not remove them.

Given that 0.3.1 already resolves the failure, I don't have a strong enough use case to justify another public entry. I'm closing this PR. Thanks for asking for the concrete example.

@fouteox fouteox closed this Sep 12, 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.

2 participants