Dependency Compatibility Fixes#24
Merged
Merged
Conversation
…mismatch starting in assemblyscript 0.28.16
…highlight util changes in vitest 4.1.0
…tions` types in vitest 4.1.1 vitest 4.1.1 flattened `CoverageOptions` and `ResolvedCoverageOptions` from generic discriminated types into flat interfaces in PR vitest-dev/vitest#9931. `ResolvedCoverageOptions<'v8'>` is now a hard type error, and the new flat `ResolvedCoverageOptions` requires more defaulted fields (`enabled`, `clean`, `cleanOnRerun`, `reportsDirectory`, etc.). - Drop `<'v8'>` from `Omit<ResolvedCoverageOptions, 'provider'>` in `ResolvedHybridProviderOptions`, and from local annotations in `hybrid-coverage-provider.ts`. The hybrid type now structurally satisfies the new `CoverageProvider.resolveOptions()` return shape - Cast through `unknown` at the project-config to `ResolvedHybridProviderOptions` boundary in `pool-runner-init.ts` and `resolve-config.ts`. These casts were always partially unsafe (the old generic just hid it from TS) Runtime contract is unchanged - `resolveOptions()` still spreads the v8 provider's resolved options and adds our extras, so the returned object satisfies both the old and new shapes at runtime.
…est major Vitest 4.1.1 deprecated `CustomProviderOptions` in favor of augmenting `CoverageOptions` directly. Switching the augmentation target wholesale isn't possible while supporting v3, because v3's `CoverageOptions` is a generic type alias. The only augmentation point that's an interface in both v3 and v4 is `CustomProviderOptions`, which is why the previous unified augmentation used it. Split the augmentation per major so the right one loads only via the matching entry point: - Reshape `HybridProviderOptions` to contain only the AS-specific user-facing fields (`debugIstanbul`, `assemblyScriptInclude`, `assemblyScriptExclude`) - `src/config/coverage-options.ts` - augments `CoverageOptions`, side-effect-loaded by the v4 entry (`./index.ts`) - `src/config/custom-provider-options-v3.ts` (renamed from `custom-provider-options.ts`) - augments `CustomProviderOptions`, side-effect-loaded by the v3 entry (`./index-v3.ts`) - Drop the side-effect import from `hybrid-coverage-provider.ts`; shared code must not pull a version-specific augmentation, since whichever it picked would break the other version's consumers - Switch the internal cast in `hybrid-coverage-provider.ts` from `as CustomProviderOptions` to `as CoverageOptions` - The custom-provider markers (`provider: 'custom'`, `customProviderModule`) are now inlined directly in `ResolvedHybridProviderOptions`, so both augmentation files can simply extend `HybridProviderOptions` without the v4 augmentation forcing `provider: 'custom'` onto vitest's flat `CoverageOptions` (which is shared across all provider types in v4.1.1+). This is a type-only change - no runtime behavior is affected. Future v3-removal will only require deleting `custom-provider-options-v3.ts` and its import.
|
🎉 This PR is included in version 0.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
conststo address redefinedconst enummismatch starting in assemblyscript 0.28.16SerializedRetry) and highlight util changes in vitest 4.1.0CoverageOptions/ResolvedCoverageOptionstypes in vitest 4.1.1 (backwards compatible approach)Refactoring