n4bb12 / verdaccio-github-oauth-ui

📦🔐 GitHub OAuth plugin for Verdaccio
https://verdaccio.org
MIT License
71 stars 45 forks source link

I need help to debug this plugin #154

Closed lankerxd closed 2 years ago

lankerxd commented 2 years ago

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.

n4bb12 commented 2 years ago

Hi @lankerxd

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

lankerxd commented 2 years ago

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。

n4bb12 commented 2 years ago

Could you describe what you mean by "debug"?

lankerxd commented 2 years ago

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

n4bb12 commented 2 years ago

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.

lankerxd commented 2 years ago

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

n4bb12 commented 2 years ago

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.

lankerxd commented 2 years ago

well, I seem to understand ,thanks much.

lankerxd commented 2 years ago

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

lankerxd commented 2 years ago

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