Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@agrarium/types

agrarium14MIT0.1.0TypeScript support: included

TypeScript definitions for Agrarium

readme

Agrarium

Toolkit to collect information about components with microplugin infrastructure.

Usage

npm i agrarium

CLI

Put .agrarium.js config to the root of your project.

const { presetDefault, PluginDTS } = require('agrarium');

module.exports = {
    src: ['./src/components'],
    plugins: [
        presetDefault({/* options */}),
        new PluginDTS({/* options */})
    ]
};

Read more info about config here.

Run in terminal:

$ agrarium harvest --json -o data.json

Read more about CLI commands here.

Node API

const { agrarium, presetDefault, PluginDTS } = require('agrarium');

agrarium({
    src: ['./src/components'],
    plugins: [
        presetDefault({/* options */}),
        new PluginDTS({/* options */})
    ]
}); // -> Readable Stream

Read more about NodeJS usage here.

Plugins

Not enough? Build your own plugin!

Presets

Examples

Build your own plugin

const { Plugin } = require('agrarium');

class AwesomePlugin extends Plugin {
    async gather({ key, files }) {
        return { filesQty: files.length };
    }
}

agrarium({
    src: ['./src/components' ],
    plugins: [
        new AwesomePlugin()
    ]
}).on('data', ({ key, files, data }) => {
    console.log(data); // { filesQty }
}).resume();

Read more about plugins API here.

License MIT

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.1.0 (2018-04-02)

Bug Fixes

  • dont publish types package (4da9a22)
  • publish types as package (a1836c0)

Features