fix: resolve ~137 DTS warnings in vp pack when importing UserConfig#993
fix: resolve ~137 DTS warnings in vp pack when importing UserConfig#993fengmk2 merged 18 commits intovoidzero-dev:mainfrom
Conversation
…nds to resolve MISSING_EXPORT warnings
✅ Deploy Preview for viteplus-preview canceled.
|
|
Could you refer to https://github.com/voidzero-dev/vite-plus/blob/main/.claude/skills/add-ecosystem-ci/SKILL.md or the current snap tests code and add a corresponding e2e test case or snap test case to ensure this fix remains effective going forward? |
|
I've already added snapshot test case and more improvement fixes. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f142fa5ef
ℹ️ 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".
|
@kazupon Thanks for helping to deal with this complex issue. 👍 |
…993) Fixes #991 ## Changes ### `packages/cli/src/pack-bin.ts` - Add rolldown transform plugin (`vite-plus:external-dts-type-only`) that converts `import`/`export` to `import type`/`export type` in postcss and lightningcss `.d.ts` files at bundle time - Also transforms `import * as PostCSS from "postcss"` to `import type` in `@voidzero-dev/vite-plus-core` `.d.ts` files to prevent `IMPORT_IS_UNDEFINED` warnings ### `packages/test/build.ts` - Fix `vitest/browser` path mapping from `index.js` to `context.js` to match vitest's own `package.json` exports, resolving `CDPSession` missing export - Extend `patchModuleAugmentations()` to merge augmented type definitions (e.g. `ExpectPollOptions`) into target `.d.ts` files, since rolldown cannot resolve cross-file `declare module` augmentations - Add `BrowserCommands` re-export to `context.d.ts` ## Testing - Run `vp pack` in [kazupon/vp-config](https://github.com/kazupon/vp-config) and verify zero `MISSING_EXPORT` / `IMPORT_IS_UNDEFINED` warnings --------- Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
Fixes #991
Changes
packages/cli/src/pack-bin.tsvite-plus:external-dts-type-only) that convertsimport/exporttoimport type/export typein postcss and lightningcss.d.tsfiles at bundle timeimport * as PostCSS from "postcss"toimport typein@voidzero-dev/vite-plus-core.d.tsfiles to preventIMPORT_IS_UNDEFINEDwarningspackages/test/build.tsvitest/browserpath mapping fromindex.jstocontext.jsto match vitest's ownpackage.jsonexports, resolvingCDPSessionmissing exportpatchModuleAugmentations()to merge augmented type definitions (e.g.ExpectPollOptions) into target.d.tsfiles, since rolldown cannot resolve cross-filedeclare moduleaugmentationsBrowserCommandsre-export tocontext.d.tsTesting
vp packin kazupon/vp-config and verify zeroMISSING_EXPORT/IMPORT_IS_UNDEFINEDwarnings