Home

Awesome

sey

npm version npm download dependencies license

Simple JavaScript bundling tool with declarative and easy configuration. It also has incremental build support which only rebuilds changed files to pace up build and bundling processes.

Sey

Built-in modules take the responsibility of maintaining dependencies and compatibility issues.

Why sey

As we know, there is grunt and gulp for running some tasks to make your web project production-ready.

They also brought extra learning curve and maintenance cost for learning own configuration and packages with them.

This is where sey comes into play and offers alternative build system:

FeatureseyGruntGulp
Configuration ApproachDescriptiveImperativeImperative
Configuration TypeAPI and JSONJSONAPI
Platform targetingnode and webAgnosticAgnostic
Incremental builds
Built-in modules
No disk IO during tasks
No maintainance cost

in other words, sey...

Built-in Tasks

Usage

To Install:
npm install -g sey

To create the seyfile in current directory:
sey init

To create the seyfile (with API-type configuration) in current directory:
sey init --api

To edit seyfile created:
vim seyfile.js (or open seyfile.js with your favorite text editor)

To build:
sey build

To build single bundle named 'main':
sey build main

To clean working directory:
sey clean

Configuration (seyfile) Examples

Configuration Based:

let config = {
    global: {
        clean: {
            before: ['./dist/*'],
            after: []
        }
    },

    main: {
        target: 'node',
        standard: 2016,

        eslint: {
            quotes: [ 2, 'single' ]
        },

        eser: true,

        banner: [
            '/**',
            ' * my package',
            ' */',
            ''
        ].join('\n'),

        ops: [
            {
                src: ['./src/**/*.js', './src/**/*.ts', './src/**/*.jsx'],
                dest: './dist/scripts/',

                addheader: true,
                compile: true,
                commonjs: { name: 'browserified.js', entry: './index.js' },
                eolfix: true,
                lint: true,
                optimize: true,
                preprocess: true,
                transpile: true
            },
            {
                src: ['./src/**/*.css', './src/**/*.less', './src/**/*.scss'],
                dest: './dist/styles/',

                addheader: true,
                compile: true,
                concat: 'style.css',
                eolfix: true,
                lint: true,
                minify: true,
                optimize: true,
                preprocess: true
            },
            {
                src: './test/*.js',
                test: true
            }
        ]
    }
};

sey.run(config);

API Based:

let config = new sey.config();

config.setGlobal({
        clean: {
            before: ['./dist/*'],
            after: []
        }
    });

config.bundle('main')
    .setTarget('node')
    .setStandard(2016)
    .set({
        eslint: {
            quotes: [ 2, 'single' ]
        },

        eser: true,

        banner: [
            '/**',
            ' * my package',
            ' */',
            ''
        ].join('\n')
    });

config.bundle('main')
    .src(['./src/**/*.js', './src/**/*.ts', './src/**/*.jsx'])
    .addheader()
    .compile()
    .commonjs({ name: 'browserified.js', entry: './index.js' })
    .eolfix()
    .lint()
    .optimize()
    .preprocess()
    .transpile()
    .dest('./dist/scripts/')
    .exec();

config.bundle('main')
    .src(['./src/**/*.css', './src/**/*.less', './src/**/*.scss'])
    .addheader()
    .compile()
    .concat('style.css')
    .eolfix()
    .lint()
    .minify()
    .optimize()
    .preprocess()
    .transpile()
    .dest('./dist/styles/')
    .exec();

config.bundle('main')
    .src('./test/*.js')
    .test()
    .exec();

sey.run(config);

How sey works

sey is usually being started from command line. It simply loads its configuration named seyfile.js and built-in modules first.

Loaded modules may delegate any "phase". Or, they can subscribe any internal event.

Depending on command line parameters, a "preset" will be executed.


Sample Hierarchy:

- \ (presets)
  + lint
  - build (phases)
    + init
    + preprocess
    + lint
    - compile (operations)
      - compile (tasks)
        + babeljsx
        + less
        + sass
        + typescript
      + transpile
    + bundling
    + finalize
  + publish
  + test
  + server
  + deploy

Preset: A set of phases in execution order. For example build executes init, preprocess, lint, compile, bundling and finalize "phase"s in a sequence.

Phase: Each step of delivery. Consists of "operation"s.

Operation: The delegation point of tasks. However configuration directives tell us which operation is asked, operation must correspond to a task to be executed.

To do so, the dominant (with higher weight point) task is elected depending on modules' claims.

Task: The class definition of the task.

Todo List

See GitHub Issues.

Requirements

License

Apache 2.0, for further details, please see LICENSE file

Contributing

See contributors.md

It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome.