kss-node / grunt-kss

KSS style guide generator for grunt.
MIT License
14 stars 7 forks source link

Problems with v5.0.0 #8

Closed rafhun closed 8 years ago

rafhun commented 8 years ago

Just tested v5.0.0 in my existing workflow and I am experiencing problems.

Environment: Mac OS X 10.11.4, Node v5.11, Grunt v1.0.1

For one my Grunt task stops or spins out during or immediately after the KSS subtask. I do have some more tasks defined after it, however they do not run. The last line of output to the command line in verbose mode are:

Running "kss:styleguide" (kss) task
Verifying property kss.styleguide exists in config...OK
Files: src/scss/ -> wwwroot/styleguide/
Options: css=["/wp-content/themes/werbelinie/style.css","https://fonts.googleapis.com/css?family=Istok+Web:700|Lora:400,700"], js="/wp-content/themes/werbelinie/js/script.js", template="src/config/.kss-dest/template/"
WARNING: no homepage content found in homepage.md.
Style guide build completed successfully!

As you see, I do load some additional resources and am building from a custom template (slightly adjusted default template).

After reloading my styleguide page after running the task, I do see a newly generated Styleguide, however my custom template does not seem to be loaded as I get back the default one.

My config is built like so (using the load-grunt-config plugin):

module.exports = {
  options: {
    css: ['/<%= config.buildFolders.themes %><%= config.themeName %>/style.css', 'https://fonts.googleapis.com/css?family=Istok+Web:700|Lora:400,700'],
    js: '/<%= config.buildFolders.themes %><%= config.themeName %>/<%= config.buildFolders.js %>script.js',
    template: '<%= config.srcFolders.config %><%= config.srcFolders.kssTemp %>template/'
  },
  styleguide: {
    files: {
      '<%= config.rootFolder %><%= config.buildFolders.styleguide %>' : ['<%= config.srcFolders.scss %>']
    }
  }
}

Is an update to the configuration necessary (would be helpful to mention this in the plugin readme) or does something else break?

You can find everything I use put together in this repo. If you'd like to test the bug yourself, change the grunt-kss version in package.json and follow the instructions to setup a project.

JohnAlbin commented 8 years ago

You may need to continue to use grunt-kss 4. As stated on the grunt-kss homepage, grunt-kss 5 drops support for kss-node 2 and Node.js 0.12. And the --template option no longer applies to kss-node 3.

The --template option was replaced with --builder in kss-node 3. Custom templates will need significant updating for them to work as custom builders with kss-node 3. If you want to try, I would suggest installing kss-node 3 and then using the --clone option to make a fresh custom builder and then porting over the CSS and markup you want from your old custom template. Good luck!