Skip to content

Conversation

wangcch
Copy link
Collaborator

@wangcch wangcch commented Mar 4, 2025

const store = useStore({
  resourceLinks: ref({
      esModuleShims: 'https://registry.npmmirror.com/es-module-shims/1.5.18/files/dist/es-module-shims.wasm.js',
      pkgLatestVersionUrl: (pkgName: string) => `https://registry.npmmirror.com/${pkgName}/latest/files/package.json`,
      pkgDirUrl: (pkgName: string, pkgVersion: string, pkgPath: string) => `https://registry.npmmirror.com/${pkgName}/${pkgVersion}/files/${pkgPath}/?meta`,
      pkgFileTextUrl: (pkgName: string, pkgVersion: string | undefined, pkgPath: string) => `https://registry.npmmirror.com/${pkgName}/${pkgVersion || 'latest'}/files/${pkgPath}`,
      typescriptLib: (version) => `https://registry.npmmirror.com/typescript/${version}/files/lib/typescript.js`,
  }),
})
export type ResourceLinkConfigs = {
  esModuleShims?: string
  vueCompilerUrl?: (version: string) => string
  typescriptLib?: (version: string) => string

  // for monaco
  pkgLatestVersionUrl?: (pkgName: string) => string
  pkgDirUrl?: (pkgName: string, pkgVersion: string, pkgPath: string) => string
  pkgFileTextUrl?: (pkgName: string, pkgVersion: string | undefined, pkgPath: string) => string
}

close #280 #159

Copy link

vercel bot commented Mar 4, 2025

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

Project Deployment Preview Comments Updated (UTC)
repl Ready Ready Preview Comment Sep 9, 2025 8:00am

Copy link

pkg-pr-new bot commented Mar 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@vue/repl@325

commit: 96069b1

@edison1105
Copy link
Member

LGTM. I feel we need add some docs for this feature.

@wangcch
Copy link
Collaborator Author

wangcch commented Mar 10, 2025

Hi 👋 @edison1105 . Added some cases (unpkg, npmmirror)
https://github.com/vuejs/repl/blob/feat-switch-npm-registry/README.md

@edison1105
Copy link
Member

@wangcch
Could you please resolve those conflicts?

@wangcch
Copy link
Collaborator Author

wangcch commented Sep 9, 2025

@wangcch Could you please resolve those conflicts?

ok
sorry, my progress is a bit behind schedule. 🙈

@edison1105
Copy link
Member

@wangcch No worries, let's merge it in the next release.

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.

[feature]cdn.jsdelivr.net address change
2 participants