n4bb12/verdaccio-github-oauth-ui

I need help to debug this plugin

lankerxd opened this issue · 10 comments

As shown in title , I know how to debug verdaccio source code .
I tried to introduce it in verdaccio , and Modify main in package.json is
"src/server/index.ts". but it didn't succeed. so can give me some advice ? thanks.

Hi @lankerxd

I'm not sure what you're trying to do. Could you share some more context, please?

Hi @lankerxd

I'm not sure what you're trying to do. Could you share some more context, please?

Hi @n4bb12 I try to debug verdaccio-github-oauth-ui 。I try to introduce it into verdaccio source code to debug , but it didn't succeed 。Can you tell me how you did it。

Could you describe what you mean by "debug"?

Could you describe what you mean by "debug"?

It's debugging , see this link : https://github.com/verdaccio/verdaccio/wiki/Debugging-Verdaccio
I create a debug configuration in VSCODE .
image

Don't try to debug the plugin directly. It doesn't run standalone, it only works as a Verdaccio plugin.
If you install the plugin as usual and debug Verdaccio, you can automatically debug the plugin, too.

I know the plugin is part of verdaccio 。I try to debug plugin source code,When verdaccio loading plugin ,it failed to load successfully。
I changed the configuration of the file : package.json
image

Modifying the package.json won't help you. index.ts is TypeScript and can't be run by node like that.

If you want to start Verdaccio with the plugin from within this repository I would recommend running yarn dev.

well,
I seem to understand ,thanks much.

I've made some attempts these days, but I doesn't succeed. I want to know is how to debugging when start Verdaccio with the plugin from within this repository .
Looking at the following picture, I can debug the code in the dist folder, but because after parcel build, the function name is renamed and all the contents are placed in one JS file, it is more difficult to debug.
image

The source code at the breakpoint is:
image

I solved the problem by using TSC to build the server folder and vite (Iife) to build the client folder. Although there are still some problems in the build of the client folder,But it's ready for debugging.
image