The "Coder DeveloperTools" (alias "DevTools") are a collection of grunt -tasks to simplify development and deployment of cubbles-webpackages. If you have created your cubx-project using the yeoman generator ( $ yo cubbles ), you already have a DevTools -version in place. You can use it as-is to develop your webpackage(s).
If you want to map-in the latest DevTools (with bugfixes, improvements and/or new features), read here ...
We use the "git subtree" -feature to add and (if needed) to update the DeveloperTools. The basic principle is, that a 'copy' of this project will be part (a subtree) of your project-file-tree. You find an overview on how to deal with git-subtrees at http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/.
This guide makes use of the npm-package https://www.npmjs.com/package/git-subtree. In combination with a grunt -task within in your original DevTools, it simplifies the whole thing a bit:
-
Init the config using the included grunt-task:
$ cd devtools $ grunt prepare-cubx.devtools-asGitSubtree
-
Map the DevTools into a separate folder "devtools-mappedIn":
# change into your projects root-directory $ cd .. $ gitsbt init
-
Install the dependencies and you are ready to rock:
# change into your new devtools-folder $ cd devtools-mappedIn # install the deps $ npm install # now run your first command $ grunt
And then, each time you want to merge in the latest changes of the DevTools:
# change into your projects root-directory
$ cd ..
# fetch and merge the latest changes
$ gitsbt pull devtools
Notes:
- The the config used for all the git-subtree commands is editable in subtrees.json within your projects root-directory.
- If you clone a project with an already included subtree - do also execute all these steps, if you want to be able to pull DevTools -changes too.
You can do the same using native git-commands only - by doing the following steps:
-
Add this repo as a remote-repository to your project´s git config:
$ git remote add -f cubbles-coder-devtools https://github.com/cubbles/cubbles-coder-devtools.git
-
Add the subtree:
# fetch the current state of the branch of your choice (here 'master') $ git fetch cubbles-coder-devtools master # create a folder 'devtools' and add all resources of the 'cubbles-coder-devtools' -remote´s 'master' -branch $ git subtree add --prefix devtools cubbles-coder-devtools/master --squash
-
Later ... Update the subtree in case you´d like to merge in changes:
# fetch the current state $ git fetch cubbles-coder-devtools master # merge in the locally available updates $ git subtree merge --prefix devtools cubbles-coder-devtools/master --squash
-
For IDE-Committers ... Pushing modifications from your subtree back to the upstream-repo is easy:
# fetch the current state $ git subtree push --prefix devtools cubbles-coder-devtools master
Note: For different modelVersions of a WebPackage surely we need to provide related devtools-Versions. Maybe we manage this with different branches. So be sure to refer to the right branch when using the commands above.