Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn this into a real JS package #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ChiliJohnson
Copy link

@ChiliJohnson ChiliJohnson commented May 14, 2021

These changes turn this project into a first-class JS package! These changes include:

  • A new package.json
  • A build script which can be run through npm
  • A README section with an example of importing + running package modules
  • A README section about building minified JS
  • Updates all absolute imports to be relative so that they can be packaged

Probably a good question for discussion:

  • Is play.core the right name for this package if it gets published to NPM?

Love this project!

@ertdfgcvb
Copy link
Owner

ertdfgcvb commented May 14, 2021

Hello, and thank you for your effort!
Personally I'm not a big fan of Node and Node packages in general so this won’t get merged for now: I’d prefer not to see it distributed as a package (this automatically solves the naming issue, too :).

I also wanted to avoid a double documentation in form of README and the manual, that’s why the readme is just a link to the full documentation. But you are right: the standalone / install / build section could need some extra love.

I added a MAKEFILE for minifying, even if it relies on globally installed npm packages it could quickly be adapted to local paths or to alternate build systems. Maybe a bit old-school…

Unfortunately for now I can’t change the import paths as they are used on the playground as well: ES6 modules are loaded trough a hack in the live-code environment and module paths used in the user- and example-scripts need to be absolute (I think it also makes more sense from a “playground” perspective to see an absolute path vs. “../../“ in the code).
Another point is: I don’t want to add all the modules to the “runner”: the idea is composability… You may want to use the Vec2 module – or not. Or maybe use one of the many (much better ones) around. Only the essential modules are included in the minified “core“ module.

Again, thank you for the precious inputs, I’m still reflecting on them…!

@cupojoe
Copy link

cupojoe commented Jun 29, 2021

I think the ability to distribute can only help. Why not do this? We could contribute and help you get the paths updated without breaking the playground. This is a seriously cool tool. Not being able to use it as a dependency makes it a bit odd in today's world and hard to maintain the project that is using it. Hope you take that into account and move to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants