Skip to content

feat: module replacements v3#2068

Open
gameroman wants to merge 103 commits intonpmx-dev:mainfrom
gameroman:module-replacements-v3
Open

feat: module replacements v3#2068
gameroman wants to merge 103 commits intonpmx-dev:mainfrom
gameroman:module-replacements-v3

Conversation

@gameroman
Copy link
Copy Markdown
Contributor

@gameroman gameroman commented Mar 13, 2026

Module replacements v3

Description

  • Update module-replacements to v3

  • Update Compare/ReplacementSuggestion.vue, Package/Replacement.vue, npm/useReplacementDependencies.ts, useCompareReplacements.ts, useModuleReplacement.ts, package/[[org]]/[name].vue, replacements/[...pkg].get.ts accordingly

  • Remove "MDN" from locales

  • Update existing tests: a11y.spec.ts, composables/use-replacement-dependencies.spec.ts, composables/use-compare-replacements.spec.ts

  • Add new test fixture npm-registry/packuments/strip-ansi.json

  • Add new tests: e2e/compare-replacements.spec.ts, e2e/package-replacements.spec.ts

Screenshots

Simple

image

image

Native

image

Documented

image

Removal

image

Compare page

image

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 7, 2026 11:14am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 7, 2026 11:14am
npmx-lunaria Ignored Ignored Apr 7, 2026 11:14am

Request Review

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 84.00000% with 8 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Compare/ReplacementSuggestion.vue 83.33% 2 Missing and 1 partial ⚠️
app/components/Package/Replacement.vue 83.33% 2 Missing and 1 partial ⚠️
app/composables/useModuleReplacement.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@joaopedrodcf joaopedrodcf left a comment

Choose a reason for hiding this comment

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

Hope you guys don't mind me trying to review the PR 🙏

try {
const replacement = await $fetch<ModuleReplacement | null>(`/api/replacements/${name}`)
const response = await $fetch<{
mapping: ModuleReplacementMapping
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@danielroe iirc you said these types are inferred based on the route. is that true? does this not infer them because of the interpolation?

@ghostdevv
Copy link
Copy Markdown
Contributor

Are we deferring this till 0.9?

@43081j
Copy link
Copy Markdown
Contributor

43081j commented Apr 8, 2026

yes.

it relies on me publishing module-replacements@3 too, which I haven't done yet.

@gameroman
Copy link
Copy Markdown
Contributor Author

I'll also start on working adding replacements v3 to https://github.com/npmx-dev/vscode-npmx 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

5 participants