refs #7427
- prevent unnecessary reloads of the server due to changes in client files, this makes working on the client as quick/painless as the old `grunt dev` command
- fix nodemon `watch` config - it only accepts directories not files
- update nodemon `ignore` config - directories should be specified without a `/*`, add directories that are changed on each client re-compile
refs #7427
- Deleting the `built` or `dist` directory doesn't result in an error, when running `gulp dev`
- Adds default task as `gulp dev`
- Adds abbreviations for the repositories in `gulp setup` task (`--ghost` -> `-g`, `--admin` -> `-a` and `--casper` -> `-c`) to type less 😊
- Installs dependencies on `gulp dev`, if called with `--deps` or `-d`
- Sets `verbose` option nodemon to default (=`false`) to have less unneccessary logging.
- Will do a delete of all dependencies and install them again ('FFS'), if `gulp deps` is called with a force flag.
- Will update submodules not matter what, if `gulp submodules` is called with a force flag. Calling `gulp submodules` without the force flag will only update/initiate the submodules, if the folders don't exist.
- Better logging messages and sequential task handling.
- Removes `gulp-shell` as dependency, as this is on gulp's blacklist
- Refactors code, that used `gulp-shell` to use `child_process.exec` or `spawn` instead.
- Exits properly if node crashes
-----------------------
Tasks available after this PR:
- `gulp server`: Starts a nodemon server with livereload of the ghost core only. No client build here.
- `gulp dev`: [ --deps | -d ] Starts development mode for Ghost, incl. client build and livereload for both. Will also update the submodules if the directories are missing. If called with with `--deps` flag, it will install client and core dependencies.
- `gulp submodules`: [ --force | -f ] Will update the submodules, if directories are missing. Will update no matter what, if called with force flag.
- `gulp deps`: [ --force | -f ] Will update client and core dependencies. Does a fresh install of both (delete, cache clear and install) if called with force flag.
- `gulp setup`: </br>[ --ghost | -g 'branch' or 'pr/1234' ]
[ --admin | -a 'branch' or 'pr/1234' ]
[ --casper | -c 'branch' or 'pr/1234' ]
[ --force | -f ]
Takes various - optional - parameters. If called without parameters, this task will update submodules first (if directory doesn't exist) and then install client and core dependendies.
If called with branch 'master', submodules will be updated.
Calling with the force flag will do a clean install of the dependencies.
There's no autocomplete for branchnames at the moment 😔
To check out a PR (e. g. `--ghost pr/7444`), it is necessary, that you add an additional fetch line in the `.git/config` file for each repository: `fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*`. See https://dev.ghost.org/easy-git-pr-test/ for further information.
refs #7427
With this PR, we'll get some development tooling magic:
`gulp setup`
Will update dependecies and submodules (if submodule branches are on master) for
currently chosen branches.
`gulp setup --force`
Will delete all dependencies and install them again, incl. submodules for
currently chosen branches.
`gulp setup --ghost some-branch --admin some-branch --casper some-branch`
Will checkout the branches for each repository.
Can also be used to checkout only selected branches e. g.
`gulp setup --admin some-branch`
Will leave the current branch for `ghost` and `casper`, but checkout the named
branch for admin. Will also install dependencies.
`gulp setup --admin pr/123 --ghost pr/1234 --casper pr/123`
Will fetch the named PR of the repository and checkout to this new branch.
Will also install dependencies. NOTE: This works only with an additional fetch line
in the .git/config file for each repository: `fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*`.
See https://dev.ghost.org/easy-git-pr-test/ for further information.
All the combinations above can be executed with the `--force` or `-f` flag, which
will delete the dependencies and install them again, but for the chosen branches.
refs #7427
Use `gulp dev` to start development mode. Starts ember build and does livereload for client and server changes.
Use `gulp server` to start server development mode. Doesn't start ember build and livereloads for server changes only.