ErdongChen-Andrew / CharacterControl

Floating Capsule Character Controller (Rigibody control)
https://character-control.vercel.app
MIT License
386 stars 52 forks source link

npm package #5

Closed Euregan closed 1 year ago

Euregan commented 1 year ago

Are you considering setting up this repo to publish a library on npm? I'd be happy to help if needed

ErdongChen-Andrew commented 1 year ago

Thank you, @Euregan! I'm actually considering publishing this as an npm library. My aim is to make it user-friendly and contribute it to pmndrs/drei. Your help would be greatly appreciated. 😁

Euregan commented 1 year ago

Great! What do you need help with?

ErdongChen-Andrew commented 1 year ago

I think, at the moment, I need to find a way for others to easily modify properties without having to dive into the source code. If I run into any difficulties regarding the npm upload process, I'll definitely reach out for your assistance. 👍

Euregan commented 1 year ago

Closing, as it's now available there: https://github.com/pmndrs/ecctrl 😄

ErdongChen-Andrew commented 12 months ago

Hi @Euregan ! I might have set up the npm package incorrectly, and I'm not entirely sure if it's related to the package.json or something else. 😅

The issue I'm facing is that when I try to import my ecctrl package, it gives me errors like this:

'...node_modules/react-dom/index.js does not provide an export named 'flushSync''

or like this:

'...node_modules/attr-accept/dist/es/index.js does not provide an export named 'default''

A temporary solution I found is to import {flushSync} from "react-dom" or import "attr-accept" before importing my ecctrl package. However, I believe there must be something wrong with ecctrl itself, and I've spent days trying to resolve this with no luck. 😂

Would you mind taking a look at my npm package setup? Thank you for your time! 🙏

Euregan commented 11 months ago

Sorry, I'm caught up in stuff ATM, will definitely give it a look by next week!

ErdongChen-Andrew commented 11 months ago

No worries at all! Life can get hectic. I'll also try some other methods to republish it, and hopefully, that can resolve the issue. 🤔

ErdongChen-Andrew commented 11 months ago

Hi @Euregan ! I believe the issue has been resolved! I used 'tsup' to generate different versions of the files, and now everything works just fine 😁!

Euregan commented 11 months ago

Good to hear! Sorry I couldn't help

ErdongChen-Andrew commented 11 months ago

No problem at all, your willingness to help is what matters most. Thank you! 😁