liuweiGL/vite-plugin-mkcert

Please export BaseSource class for extendability ๐Ÿ™

tolu opened this issue ยท 0 comments

tolu commented

Describe the bug

We're seeing rate limiting in CI from Github API from the default downloader.

I'd love to implement a custom BaseSource but since the class is not exported I'm not able to extend it ๐Ÿ˜Š

Reproduction

// this is the auto-complete from TS in VS Code when attempting to use the BaseSource class
import { BaseSource } from 'vite-plugin-mkcert/dist/mkcert/source';

Example repo

https://stackblitz.com/edit/vitejs-vite-jnavgp?file=vite.config.ts

โ˜๏ธ Trying to use the stable download-links presented on mkcert's latest release-notes.

Would also love if mkcertLocalPath-option could be a function that receives output from getPlatformIdentifier and can select the appropriate binary ๐Ÿ™Œ

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

Ofc not system info from stackblitz repro-repo ๐Ÿ˜„

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 402.25 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
  npmPackages:
    vite: ^2.8.6 => 2.9.13

Used package manager: npm

Logs

failed to load config from /home/projects/vitejs-vite-jnavgp/vite.config.ts
error when starting dev server:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/mkcert/source' is not defined by "exports" in /home/projects/vitejs-vite-jnavgp/node_modules/vite-plugin-mkcert/package.json imported from /home/projects/vitejs-vite-jnavgp/vite.config.ts.mjs
    at InternalError.get (https://vitejs-vite-jnavgp.w.staticblitz.com/blitz.9dc2007b053e3e7ca4daf0ec1a74b5c3910935fe.js:6:292488)
    at CAC.eval (file:///home/projects/vitejs-vite-jnavgp/node_modules/vite/dist/node/cli.js:734:135)