discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

Fork installation

Open DraftProducts opened this issue 3 years ago • 7 comments

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)

DraftProducts avatar Jan 28 '22 10:01 DraftProducts

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.

Koyamie avatar Jan 28 '22 17:01 Koyamie

Not realy DX frendly 😬 Also, it's a half-solution because you don't have access to typings with this way 🥺

DraftProducts avatar Jan 29 '22 11:01 DraftProducts

Yeah obviously just sharing as a workaround. And I'm not using typings so it doesn't bother me.

Koyamie avatar Jan 29 '22 11:01 Koyamie

You can do one of the following solutions if you have the fork downloaded locally:

  1. Use yarn link inside the packages/discord.js directory and in your application's folder.
  2. Run yarn pack, copy the contents of the .tgz file and drop them into your node_modules.

kyranet avatar Jan 29 '22 11:01 kyranet

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:

DraftProducts avatar Jan 29 '22 11:01 DraftProducts

You can do one of the following solutions if you have the fork downloaded locally:

  1. Use yarn link inside the packages/discord.js directory and in your application's folder.
  2. Run yarn pack, copy the contents of the .tgz file and drop them into your node_modules.

Yeah, we should document that somewhere 👍

DraftProducts avatar Jan 29 '22 12:01 DraftProducts

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.

irfandyj avatar Oct 17 '22 14:10 irfandyj