play.core
play.core copied to clipboard
Turn this into a real JS package
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!
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…!
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.