Back in March we moved all of Ghost's SASS over to the Ghost-UI repository so that we no longer had a ruby dependency here in the main Ghost repo.
We also hoped to turn the SASS into a Bootstrap-esque framework for creating interfaces that look like Ghost. We hoped to share the code between Ghost and Ghost.org, as well as provide an easy way for people building internal and external apps for Ghost to maintain consistency.
This was an experiment, and the experiment has failed for a number of reasons.
Firstly, maintaining code across 2 repositories is a nightmare. Issues get raised in one, the other, or both, and it's always confusing, pull requests which change html & css have to be done in 2 places, and links between issues in the 2 repos aren't clear.
Secondly, the move to Ember makes it almost impossible to build flexible, generic and reusable components outside of the Ghost repository. This removes half the point of having a separate framework for the UI. It makes it less likely the code will be shared, and it means creating components is just a lot more work.
Whilst the SASS has been in the Ghost-UI repo, it has been reviewed, refactored and a big redesign done. The result is that we no longer really need to use ruby SASS, as we are no longer depending on the extended features of it and of bourbon.
Therefore, the plan is to switch to libsass, move the SASS code back to the Ghost repository, and go back to the way things were but still without the awful ruby dependency.
Part 1 is now complete - TryGhost/Ghost-UI@cbbe5af...a6934d1
I've made a start on Task 2, I have an example of how this will look in terms of the structure of core/client/assets on a branch called master-with-ui and you can see that this has also maintained / merged the history.
Imported from Ghost-UI is:
If you're interested, this was done with the following git-fu:
git remote add ghost-ui firstname.lastname@example.org:TryGhost/Ghost-UI.git
git merge -s ours --no-commit ghost-ui/gui2.0-nodesass
git read-tree --prefix=core/client/assets/ -u ghost-ui/gui2.0-nodesass
git reset HEAD
There are a couple of outstanding questions to wrap up:
Once we've decided on these things I'll complete and push the merge.
So in my mind the concept of GUI as a named thing is now dead. The new "thing" is the Ember app, which comprises of both GUI and Ember. I wouldn't be against naming it something, for the sake of easy reference.
To that end, I think the "root directory" for this project is /client/ - that's where the readme should live, that's where the docs should live, that's maybe even where (in future) a subset of tests or specialised build tasks should live.
The only other thing I noticed was that the assets/lib folder doesn't feel right. Lib should be 3rd party components, these are not that that, as far as I can tell. I don't know where they should live, but not in a lib directory and probably not in /assets/ either?
I can't see the sense in having all the docs for Ghost at docs.ghost.org, but docs for GUI somewhere else. As for getting GUI styles into docs, that could be a submobule, as GitHub pages can now compile Sass. Maybe this is another issue though.
What docs actually are / where they live / what's in them is a very different issue. My comment is purely directed at the structure in which GUI is merged into core. Which is to say that, if anything, /docs/ of any kind should not live inside /assets/
That's totally fine, /docs/ can go into the root of client.
/lib/ contains two jquery things which need to be emberified and die and lib will die with them
ok so then readme + docs => client, and that's it. Make it so!
Oh yes and +1 for squashing the sass=>libsass conversion commits into 1, and any others which fit the same pattern.
/docs/ and the readme*
Jinx! All good, this is super easy as well, bloody love git, and learning new git-fu
@ErisDS ping me if you need a workhouse for the jQ -> Ember fun
@JohnONolan lib is standard fair for "the code that we wrote for our project", I don't associate it with vendor code. Maybe this is a dev/design split, or maybe it's just a Matt/John split ^ ^
@novaugust would <3 you to look at Emberifying those 2 jQuery files. Guess I should raise an issue to make it so.
With regard to merging these 2 repos, this has taken a lot of reading and messing around and testing, but I think I have achieved the following 3 goals:
I've changed my approach quite drastically. On Ghost-UI, I took Paul's branch, squashed some commits and then ran:
git filter-branch -f --prune-empty --index-filter 'git rm --cached --ignore-unmatch -rf -- dist* js* bower.json .bowerrc .editorconfig .gitattributes .gitignore CONTRIBUTING.md Gruntfile.js LICENSE package.json'
git filter-branch --tree-filter "mkdir -p assets; git mv -fk sass fonts assets"
git filter-branch -f --tree-filter "mkdir -p core/client; git mv -fk assets docs README.md _config.yml core/client"
Command 1. deleted everything from Ghost-UI we don't want to keep
Command 2. moved the sass and fonts subdirectories down a level in the hierarchy to a folder called assets
Command 3. did a similar thing, moving everything into /core/client so that the hierarchy of Ghost-UI matches Ghost
The important thing is that using filter-branch means that the files and directories didn't just get deleted and moved, but the history gets updated to match meaning every commit is amended, or if there's no reason for the commit to exist anymore it's completely removed. This means that all of @PaulAdamDavis's version bump commits are gone because both the package.json and bower.json files have been deleted and those commits no longer apply to anything.
I think this is what we want. Those version bump commits only made sense in the context of Ghost-UI as a separate repo. The history of how the files we have kept have changed remains, and all editors and git should still be able to understand the history, because the history has been updated so the files match their new locations.
Finally, all this was merged into Ghost by simply adding Ghost-UI as a remote and doing a pull. Here's the result: https://github.com/TryGhost/Ghost/commits/master-with-ui
This is now complete.