discord.js
discord.js copied to clipboard
Fork installation
Which package is this bug report for?
discord.js
Issue description
After monorepo refactor (#7175) it's now difficult to install a fork as dependancy from GitHub. I found this tool witch https://gitpkg.vercel.app/ helped me to install my discord.js fork.
Is there an easier way ?
Package version
master
Node.js version
v16.13.1 and [email protected]
Operating system
Linux
Priority this issue should have
Low (slightly annoying)
I've been experiencing the same issue since I use a fork too. My solution was to import the repo by specifying the package path.
Example:
import {
Client as DiscordClient,
Collection,
WebhookClient,
MessageEmbed,
MessageButton,
MessageSelectMenu,
MessageActionRow,
Permissions,
Util as DiscordUtil,
} from '@discordjs/discord.js/packages/discord.js/src/index.js';
It's a tricky way but it works, I am only importing it once and get all the classes I need.
Not realy DX frendly 😬 Also, it's a half-solution because you don't have access to typings with this way 🥺
Yeah obviously just sharing as a workaround. And I'm not using typings so it doesn't bother me.
You can do one of the following solutions if you have the fork downloaded locally:
- Use
yarn linkinside thepackages/discord.jsdirectory and in your application's folder. - Run
yarn pack, copy the contents of the.tgzfile and drop them into yournode_modules.
I found some options that would require a repo change :
- https://stackoverflow.com/a/39195334
- https://stackoverflow.com/a/65105135
if that is not possible, it would be nice to add a part to the documentation to advise using gitpkg for fork use :man_shrugging:
You can do one of the following solutions if you have the fork downloaded locally:
- Use
yarn linkinside thepackages/discord.jsdirectory and in your application's folder.- Run
yarn pack, copy the contents of the.tgzfile and drop them into yournode_modules.
Yeah, we should document that somewhere 👍
Hi @DraftProducts 👋 I'm new to open source and this repository, may I contribute to this issue? I'm willing to help to contribute to the documentation. But I need a little assist to do it. I've been trying to reproduce the error but I think I misunderstood the problem.