paperjs / paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey
http://paperjs.org
Other
14.45k stars 1.22k forks source link

Fix tag version to work with Bower #221

Closed justinwinslow closed 11 years ago

justinwinslow commented 11 years ago

Because the package.json version and tag names don't match on v0.2.2, Bower fails to find the tag. I forked and created a fixed tag: https://github.com/justinwinslow/paper.js/tree/v0.2.2

We are using this now for dev but it would be great if you could add this to the paper.js repo.

lehni commented 11 years ago

Does it need the 'v'? Our convention now was to just name it 0.2.2 (we're actually currently at 0.8.4)

justinwinslow commented 11 years ago

I just tried to do a tag without the 'v' in my fork and bower couldn't find it. So, that leads me to believe that it depends on that somehow (I've not looked at their source code).

justinwinslow commented 11 years ago

Also, re: naming it 0.2.2 - I branched from the v0.22 tag, so, that tag is literally the same as the old tag with version numbers between package.json and the tag matching and formatted to work with Bower. I branched from that tag because that was before the inclusion of acorn.js which causes issues with AMD module loaders. I reference that issue here: https://github.com/paperjs/paper.js/issues/223

justinwinslow commented 11 years ago

Also # 2 - I should mention that Bower only needs the tag to be named vX.X.X. In package.json the v is dropped. Seems a little confusing but I'm not smart enough to comment.

lehni commented 11 years ago

It appears that Bower uses the SemVer specification 1.0.0, while we are currently using 2.0.0...

It seems to boil down to this issue here:

https://github.com/isaacs/node-semver/issues/16

lehni commented 11 years ago

Actually, SemVerTag was removed from 2.0.0: https://github.com/mojombo/semver.org/issues/50

But I'll rename the tags following that convention now.

lehni commented 11 years ago

Done.

justinwinslow commented 11 years ago

Not to be a pain but, 0.2.2 tag and package numbers aren't the same: https://github.com/paperjs/paper.js/blob/v0.2.2/package.json#L4

(ducks to avoid things being thrown)

lehni commented 11 years ago

Ooops! Will fix it sorry. BTW, what I said above about SemVer 2.0.0 was wrong. I was using this convention on another project and got the two confused.

lehni commented 11 years ago

Hmm, the problem is this: We tagged v0.22 in November 2011, but only fixed the wrong version in package.json in June 2012... So I can tag v0.2.2 in June 2012, and this will make it work, but it's kind of wrong too. The shameful truth is that we didn't care about versioning enough in the early days since it all was very alpha anyway... I will fix it in this way now and hope that the version at that point was functional enough...

lehni commented 11 years ago

BTW, how do I get this to work with Bower? Is there a simple document describing the process? I'd like to test this properly to make sure we're doing the right thing, also in regards to #223. I am curious for example how Bower handles the loading of the library, since the git repository does not contain the compiled version, only the one that loads itself from the sources through repro.js for developing purposes.

justinwinslow commented 11 years ago

No worries. This was only a small hack to get our stuff working until I had time to root through the latest and find out why it wasn't working with require (the AMD issue).

Re: Bower -

lehni commented 11 years ago

And how do you load paper.js as a component then? This to me suggests that you will end up with the "uncompiled" version of paper.js, there only for developing purposes, since it is leaking into the global scope and loaded from many separate files, which is far from ideal.

justinwinslow commented 11 years ago

Welllll, so bower only handles getting the source code. Right now we have to run the build to get the built dist/paper.js which works with Require as documented in #223. The script injection dependency management stuff in the provided distribution does not work with require at all.

lehni commented 11 years ago

Yeah I think we'll have to include a compiled version in dist from here onwards... So you use bower in combination with require.js? And you use require.js to load paper.js from the dist folder?

justinwinslow commented 11 years ago

Right, so in our local dev environments running your build.sh script is part of the process of getting the front end dependencies working. Most packages include a built version as part of the repo.