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

Without master branch, bower doesn't work #180

Closed
kud opened this issue Nov 16, 2013 · 47 comments
Closed

Without master branch, bower doesn't work #180

kud opened this issue Nov 16, 2013 · 47 comments

Comments

@kud
Copy link

kud commented Nov 16, 2013

bower install prism --save-dev
bower not-cached    git://github.com/LeaVerou/prism.git#*
bower resolve       git://github.com/LeaVerou/prism.git#*
bower ENORESTARGET  Tag/branch master does not exist
@kud
Copy link
Author

kud commented Nov 16, 2013

A way to fix it:

bower install git@github.com:LeaVerou/prism.git\#gh-pages --save-dev

@callumacrae
Copy link

Thanks for the fix.

I suspect if you're only using Prism during development though, you're doing something wrong!

@dristic
Copy link

dristic commented Jan 27, 2014

+1 For fixing this. Also had issues installing here

@kud
Copy link
Author

kud commented Jan 28, 2014

@callumacrae It's not the subject here, do --save-dev or --save :)

@sabcio
Copy link

sabcio commented Jan 29, 2014

I'm trying to use prism with https://rails-assets.org so I can ditch bower when developing my Rails apps. rails-assets uses master branch by default to build ruby gems.

Also I think this project should be properly versioned with a change log.

@adam-lynch
Copy link
Contributor

+1

@adam-lynch
Copy link
Contributor

@LeaVerou: as far as I can tell, you should do the following:


Note

Typically when a project has a master and gh-pages branch, you'd have everything for dev on master plus anything needed for package managers. So no css-tricks logo, etc.

Then the gh-pages branch would only have what's needed for prismjs.com, so no package.json, bower.json, etc.

This means though that any outstanding pull requests would have to be re-issued to the master branch.

@sgarbesi
Copy link

This really should have a master branch, we don't need the gh-pages in our code repos.

Also it's defeating the purpose of Bower. Bower aka making it easy for us (developers) to install JS libraries without having to browse the web.

@thomaswelton
Copy link

I'd like to see this repo refactored to have a master branch. It's not just a bower thing

@LeaVerou
Copy link
Member

LeaVerou commented Jun 2, 2014

The only reason this is on gh-pages is that Github only uses that for Github Pages. Once Github allows Github pages from master, I will switch all my repos to use a master branch instead.

I like @adam-lynch’s idea of using the master branch for all Prism code and gh-pages for the website files. That would also eliminate contributor confusion about which file to edit. However, I'm still not sure how to do this in a maintainable way. I don't want to have to manually keep the branches in sync…

@callumacrae
Copy link

You could branch gh-pages into master, and then delete all website stuff from master. Merge master into gh-pages, then use git revert in the gh-pages branch to revert the changes so you've got the website stuff back. You will then have two branches, one containing only the code, and the other containing both the code and the website stuff.

Prism changes would need to be made to master and then merged into gh-pages, but that's pretty easy (you could probably even have it running on a hook, although that could be dangerous). So, it's sort of manual, but it's not as bad as copying and pasting code.

It sounds more confusing than it is. I could fork the repo and demonstrate, if you want.

@apfelbox
Copy link
Contributor

apfelbox commented Jun 2, 2014

What exactly do you need to keep in sync? Isn't it just the components.js?

This file needs to be edited manually anyways, so there should be no issues. The only thing you need to change then would be the download URL in the website.

(Or am I missing something?)

@LeaVerou
Copy link
Member

LeaVerou commented Jun 2, 2014

The whole components folder. Not sure if components.js should even be in the master branch, it's only used by the website. But if it's not, then people would have to issue PRs to two branches every time they add a language/theme/plugin, which is suboptimal…

@callumacrae
Copy link

The way I'm suggesting, they'd only need to send it to master, but then you'd need to merge it (although it really would be as simple as git checkout gh-pages && git merge master).

It would be confusing if the branches diverged, but they don't need to.

@LeaVerou
Copy link
Member

LeaVerou commented Jun 2, 2014

Sure, but it's an extra step every single time a change is made. I know from experience that even a tiny extra step every time adds quite a lot of extra work in total. If it could be automatic somehow, sure.

@callumacrae
Copy link

You could use a git hook—use the post-merge hook to merge a change into gh-pages when you merge it into master.

@sgarbesi
Copy link

sgarbesi commented Jun 3, 2014

@hastebrot
Copy link

@kud With the \ it throws an error on my machine. It worked without the \.

bower install git@github.com:LeaVerou/prism.git#gh-pages --save 

@homosaur
Copy link

I personally believe this you have the wrong outlook to have on this issue @LeaVerou. Who cares about the gh-pages branch being up to the minute accurate? It's just a demo. The far more important issue is that Prism works in packaging systems so people can easily include it in their projects which means that master should be the default branch.

If it is important to have the demo up to the minute, why can't you just link to the default raw file in the master branch like https://raw.githubusercontent.com/LeaVerou/prism/gh-pages/prism.js?

@kud
Copy link
Author

kud commented Aug 22, 2014

I don't use anymore bower, instead npm.

@apfelbox
Copy link
Contributor

@homosaur because you can't include these files to be runnable. Github serves these files as text/plain therefore it won't work if you include them in a <script> tag (not in all browsers at least...).

But: I am currently working on a github setup which would solve all these things. Just a little more patience. 😉

@adam-lynch
Copy link
Contributor

@apfelbox @homosaur what about rawgit?

@cheshrkat
Copy link

+1 to being bower friendly.

@karlgroves
Copy link

+1 to the other plus 1s!

@ImanMh
Copy link

ImanMh commented Nov 15, 2014

I think I don't really need the gh-pages in my development environment please make a master branch.
I wish:
bower install prism --save
would just pull necessary files for using prism and defining new languages.

@maciejczyzewski
Copy link

My, gosh. Hopeless branchy structure.

@LeaVerou
Copy link
Member

My, gosh. Hopeless branchy structure.

My, gosh. Useless comment.

@alonextou
Copy link

Still seems impossible to install with bower, without specifying #gh-pages branch.

@xsynaptic
Copy link

Prism is great! I also look forward to when it can be consumed via Bower without a workaround 👍

@Robdel12
Copy link

Makes this hard to use with Ember CLI.

@brunowego
Copy link

Need make a tag with the version 0.0.1 👍

@kwyn
Copy link

kwyn commented Feb 16, 2015

Would love to use this but I would love to not have to use the gh-pages branch. It's not semantic and makes it a pain to manage. Also proper semver would be great on bower distribution. You can do it with git-tags and if you need to you can also use an interactive rebase on a master branch to tag appropriately. I know it's a lot of work but it'll make your project much more successful.

@vkbansal
Copy link
Contributor

@LeaVerou what @HarleyKwyn says is true. And its a huge public demand.
I'll be happy to help in maintaining the semver for this repo

@johnwilliams713
Copy link

Hi all. I'm seeing this error when trying to install with this:
bower install git@github.com:LeaVerou/prism.git#gh-pages --save

Error:
Failed to execute "git ls-remote --tags --heads git@github.com:LeaVerou/prism.git", exit code of #128

@foxx
Copy link

foxx commented May 4, 2015

Has this now been resolved? Or does it need more work?

@Golmote
Copy link
Contributor

Golmote commented May 4, 2015

There is still no "master" branch. So Bower will still require you to specify the "gh-pages" branch.

@foxx
Copy link

foxx commented May 4, 2015

I can see a "master" branch on this repo, which was last updated approx 1 month ago, could you explain what you mean, given that there is one?

Also bower seems to work without problem for me lol.

Am I missing something here?

$ bower install prism
? May bower anonymously report usage statistics to improve the tool over time? No
bower prism#*               not-cached git://github.com/LeaVerou/prism.git#*
bower prism#*                  resolve git://github.com/LeaVerou/prism.git#*
bower prism#*                 checkout master
bower prism#*                 resolved git://github.com/LeaVerou/prism.git#6dbe885142
bower prism#*                  install prism#6dbe885142

prism#6dbe885142 bower_components/prism
 ls -lah bower_components/prism/
total 56K
drwxr-xr-x 1 vagrant vagrant  544 May  4 13:17 .
drwxr-xr-x 1 vagrant vagrant  136 May  4 13:17 ..
-rw-rw-r-- 1 vagrant vagrant  750 May  4 13:17 .bower.json
-rw-rw-r-- 1 vagrant vagrant  503 May  4 13:17 bower.json
drwxr-xr-x 1 vagrant vagrant 4.4K May  4 13:17 components
-rw-rw-r-- 1 vagrant vagrant 6.0K May  4 13:17 components.js
drwxr-xr-x 1 vagrant vagrant   68 May  4 13:17 examples
-rw-rw-r-- 1 vagrant vagrant 4.5K May  4 13:17 examples.js
-rw-rw-r-- 1 vagrant vagrant 1.4K May  4 13:17 gulpfile.js
-rw-rw-r-- 1 vagrant vagrant 1.1K May  4 13:17 LICENSE
-rw-rw-r-- 1 vagrant vagrant  635 May  4 13:17 package.json
drwxr-xr-x 1 vagrant vagrant  374 May  4 13:17 plugins
-rw-rw-r-- 1 vagrant vagrant  16K May  4 13:17 prism.js
-rw-rw-r-- 1 vagrant vagrant 2.3K May  4 13:17 README.md
drwxr-xr-x 1 vagrant vagrant  306 May  4 13:17 themes
drwxr-xr-x 1 vagrant vagrant  102 May  4 13:17 vendor

@LeaVerou
Copy link
Member

LeaVerou commented May 5, 2015

There didn’t use to be a master branch in the past, to prevent the inevitable syncing issues between the two. I don’t quite remember when one was added, @Golmote do you?

@foxx
Copy link

foxx commented May 5, 2015

Tbh merging changes to the master branch, and then only pushing to gh-pages
upon release is probably a better way of doing things anyway. You could use
a CI service such as Travis to only push to gh-pages if the tests are
successful, ensuring tested code only ever makes release. I'd be happy to
contribute some time to make that happen, it's a pipe work task I've done
for several other GitHub projects.

On Tuesday, May 5, 2015, Lea Verou notifications@github.com wrote:

There didn’t use to be a master branch in the past, to prevent the
inevitable syncing issues between the two. I don’t quite remember when one
was added, @Golmote https://github.com/Golmote do you?


Reply to this email directly or view it on GitHub
#180 (comment).

@Golmote
Copy link
Contributor

Golmote commented May 5, 2015

Crap! I didn't realize there were a master branch! I have no idea who created it and when. I don't know how to get the info...

I might even have created it by mistake... I think my local branch is named "master"...

@callumacrae
Copy link

I'd guess it was created on March 21st by you, because that's the last commit!

If you delete the master branch now, you could break any site that's started using prism between March and now. Could I suggest that now would be a good time to start using the master branch?

npm weekly had a couple links this week on how you can use npm scripts to speed this up.

@hastebrot
Copy link

Tbh merging changes to the master branch, and then only pushing to
gh-pages
upon release is probably a better way of doing things anyway. You could
use
a CI service such as Travis to only push to gh-pages if the tests are
successful, ensuring tested code only ever makes release.

That's a good idea. It prevents the GitHub page being broken and reduces
branch synchronisation to a no-op administratively.

@foxx
Copy link

foxx commented May 5, 2015

@LeaVerou Majority of this I can do in a PR, but some will require you to setup up hooks and accounts, which I can talk you through on Skype with screenshare etc. Travis CI will also give us all those lovely integrations we see on other projects, such as a build status logo on the README and a test build hook on every commit/PR, and most importantly it will give this project CI, which should be an absolute minimum imho.

Also the general rule of the thumb is that no one should be committing to master directly, all changes should happen within a feature branch and all merges to master should be done via a PR. If you haven't already, I'd strongly recommend reading Github Flow.

Anyway, my skype is cal.leeming. I'm free tonight after 8pm GMT.

@Golmote
Copy link
Contributor

Golmote commented May 5, 2015

A test build hook would be useful... if we actually had tests.

@foxx
Copy link

foxx commented May 5, 2015

Heh, so TDD is out of the window.. At the absolute very least we can have a
"does it compile/parse" acceptance test. Either way, the original proposal
is still valid.

On Tuesday, May 5, 2015, Golmote notifications@github.com wrote:

A test build hook would be useful... if we actually had tests.


Reply to this email directly or view it on GitHub
#180 (comment).

@Golmote
Copy link
Contributor

Golmote commented May 5, 2015

Sure, and I agree that this needs to be sorted out. Eventually we'll need tests too.

@Golmote
Copy link
Contributor

Golmote commented Jul 5, 2016

As we now have a master branch, that is updated on every new official release, I think this issue can be closed.
The current situation is probably not perfect yet, but it works for now.

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

No branches or pull requests