Skip to content

Commit

Permalink
Add grunt watcher for development on resources.
Browse files Browse the repository at this point in the history
This watcher triggers a shell command recooking the files whenever anything changes in resources.
Otherwise the command has to be executed manually everytime one wants to see the effect in a running instance.
  • Loading branch information
Matthias Osswald committed Nov 7, 2019
1 parent 7eaa972 commit a40e752
Show file tree
Hide file tree
Showing 6 changed files with 570 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ src/
var/
.sass-cache
/.ruby-version
Gruntfile.js
node_modules
package.json
temp_resources
20 changes: 20 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
files: ['Gruntfile.js', 'ftw/**/*.js', 'ftw/**/*.css', 'ftw/**/*.scss'],
tasks: ['cook_resources']
},
shell: {
cook_resources: {
command: './bin/upgrade recook --all'
}
}
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-shell');

grunt.registerTask('cook_resources', ['shell:cook_resources']);
};
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ The Implementation needs to be done by yourself. `For an example check the Solr

.. image:: https://raw.github.com/OneGov/plonetheme.onegov/master/docs/screenshot_filter.png

Development
-----------

In Plone 5 working on resources is a pain because they have to be recooked after every
change. Therefore there is a Grunt setup provided watching the resources and updating them.

To setup and run the watcher do:

::

npm install
grunt watch


Print
Expand Down
2 changes: 2 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog

- Add Plone 5.1 support and drop Plone 4.3. [mbaechtold, maethu, shylux, busykoala]

- Add grunt setup for development. [busykoala]


3.3.0 (2019-09-10)
------------------
Expand Down
Loading

0 comments on commit a40e752

Please sign in to comment.