Lusito / box2d.ts

Full blown Box2D Ecosystem for the web, written in TypeScript
https://lusito.github.io/box2d.ts
60 stars 6 forks source link

[Proposal] Publishing to NPM #2

Closed DanielHZhang closed 3 years ago

DanielHZhang commented 3 years ago

I think it would be a good idea to publish the packages to NPM before a v1.0.0 release. This would give some initial exposure to the beginnings of the Box2d ecosystem, and allow early adopters to test/report issues/give feedback on the API before things have solidified. Versioning everything under 0.x.x and having a disclaimer in the readme should be enough forewarning.

From my fork, I published a few of the packages under the @plane2d organization (due to not having access to @box2d), purely to test the publish workflow. This involved manually running yarn publish for each package, as the global find-replace of all @box2d to @plane2d broke yarn workspaces run build for me.

Ideally, the entire publish workflow can be automated via GitHub actions and triggered on release.

@Lusito Do you own the @box2d organization on NPM? What are your thoughts on releasing to NPM during the initial development phase?

Lusito commented 3 years ago

Sounds reasonable to get early versions out. Not sure on automatic publish on release yet, haven't done that yet.

I'm just currently on the way to bring everything up to date with the original box2d code by erin catto. When I'm done with that, I'll publish that version.

Yes I own the @box2d organization. Will take a look how publishing a mono-repo works with yarn, but before that I'd like to see if the new npm workspaces will work as well.

DanielHZhang commented 3 years ago

Sounds good to me. I'll await your decision on using yarn or npm workspaces before looking into automating the publishing workflow. It seems like yarn has more documentation and examples supporting their workspaces ecosystem.

Lusito commented 3 years ago

I've just pushed the last upstream changes. Next I'll take a look at publishing an early version.

Lusito commented 3 years ago

0.7.2 is published to npm now. Haven't tried actually use it yet.

Lusito commented 3 years ago

So, I just copied the testbed, removed node_modules, cache, etc. Then I ran npm install and npm start and that seemed to work nicely, so it seems to have worked.

If you encounter issues, let me know. I'm gonna take a look at creating readme files, so that the npm pages aren't empty.