Closed gooswa closed 10 years ago
+1
WTF?
-1 for npm package of GreenSock
NPM packages can be client side. I actually use a lot of client side libraries with npm. I setup Webpack to search through my node_modules folder for require() calls. So it'd be awesome if I could install gsap with npm i gsap
then var TweenMax = require('TweenMax')
, so +1
+1
Yeah I feel like browserify is gaining momentum and since they follow the npm package for even client side ones there is no reason not to include it. It's helps to also use it for devDependencies since then I don't have to check those into the repo and people who download a take a quick look at only the package.json and understand what's being used the project. if it's thought to be confusing what is used for client side and server if you are using javascript for both that's why there is both devDependencies and dependencies in the package.json
Yes indeed, I think this is a good idea. Got a proposed package.json file? I'm going 100mph on some other changes right now with GSAP and the new site, so if you'd like to accelerate things and shoot me a proposed file, it'd be swell.
Yes definitely, keep doing what you are doing, just to clearify you want a package.json for the NPM repo correct?
My understanding was that we need to add a package.json file to the github repository so that it conforms to the NPM guidelines. Disclaimer: I'm not much of a Node guy yet, so any advice is welcome, as is your patience :)
Done.
Just adding the package.json doesn't add the repo to the npm registry. You also need to run npm publish
from within.
Sorry about that. It should really be done now ;)
ideally for the package to work well as an NPM module it should have a main
key in package.json
. Without this, you can't require('gsap')
.
Since NPM is big on "one module, one interface", it might make more sense to define a package for each of `(Tween|Timeline)(Lite|Max), each of which returns its interface.
..or then like so:
var gsap = require('gsap')
var TweenMax = gsap.TweenMax
var TimelineMax = gsap.TimelineMax
Hm, it looks like the package.json already has a "main" key defined - am I missing something?
We do hope to restructure things in the future to be more modular, but it's a much bigger project than we have time for right now. If you have specific recommendations for edits to the package.json file or something that'd make it more usable without a big restructuring of things, I'm all ears.
I missed the main
key when I looked last, sorry for the distraction.
NPM seems to be more popular then bower, could you provide a package for NPM?