kalamuna / kalastatic

:electric_plug: Facilitate the front-end experience through Styleguides and Prototypes
https://kalamuna.github.io/kalastatic/
41 stars 14 forks source link

adds support for plugins array accepting object #552

Closed thiagodemellobueno closed 6 years ago

thiagodemellobueno commented 6 years ago

This makes developing plugins that rely on kalastatic for testing much easier. With accepting only strings we wound up in a situation that developing a plugin that relied on kalastatic for testing required editing the instance of it in node_modules, rather than working in lib/index.js directly. This allows us to populate the plugins object with an instance of the plugin but keep the convenience of configuration and overriding.

Heres an example.

const mgc = require('../lib/index.js')
…
      const testOpts = {
        base: path.join('test', 'fixtures', name),
        plugins: [
          // Bring in data from gathercontent
          {
            plugin: mgc,
            name: 'metalsmith-gathercontent'
          },
thiagodemellobueno commented 6 years ago

@RobLoach - tests are borking on node 4. Question, do we want to continue to support node 4?

thiagodemellobueno commented 6 years ago

@RobLoach - can you look into this? it seems to be a node 4 version thing. This is quite useful, and has been ageing.

Do we even need to support node 4?

RobLoach commented 6 years ago

Do we even need to support node 4?

Don't think anymore.

thiagodemellobueno commented 6 years ago

@RobLoach lets merge this one!