solana-labs / oyster

oyster.vercel.app
Apache License 2.0
116 stars 127 forks source link

Q: How do I install and use this? Is this same as https://www.npmjs.com/package/oyster-common #331

Open r4881t opened 3 years ago

r4881t commented 3 years ago

I have a few questions. I am understanding how MetaPlex works, and found various references to @oyster/common in the codebade. Example - https://github.com/metaplex-foundation/metaplex/blob/81023eb3e52c31b605e1dcf2eb1e7425153600cd/js/packages/web/src/views/artCreate/index.tsx#L21

  1. Is this repo same as @oyster/common?
  2. I am currently using oyster-common from https://www.npmjs.com/package/oyster-common. The issue I'm facing is that while Metaplex seems to be able to import {useWallet} from @oyster/common. I am unable to do so because its not exported.
yamijuan commented 3 years ago

@r4881t metaplex repo has its own package called common and that's what you should be using.

drummerjolev commented 3 years ago

Having the same issue. How can I use @oyster/common in my own project?

r4881t commented 3 years ago

Here's what I did.

  1. I reorganised my repo to be a lerna package. It was a simple react app first.
  2. I noticed there are two "versions" of @oyester/common. There is 0.0.1 that is provided here, and then there is a 0.0.2 that is provided by Metaplex (here). I asked about this on Metaplex's discord but no one answered.
  3. I copied the codebase of both versions of @oyester/common in my lerna packages and started to see what works.
  4. I found that metaplex's version is generally better, but your use case may be different.

I think one can do smarter than copying the directories, maybe by using git submodules in some way.

ozyman42 commented 2 years ago

Why can't the package just be published like any normal open source repo? Metaplex just raised $46 million, it can afford 5 minutes to publish a package on npm.

ozyman42 commented 2 years ago

Looks like there is a library on npm after all: https://docs.metaplex.com/sdk/js/getting-started @metaplex/js