npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sey

v0.3.0

Published

Simple JavaScript build tool with declarative and easy configuration

Downloads

72

Readme

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:

| Feature | sey | Grunt | Gulp | | ----------------------- |:------------:|:------------:|:------------:| | Configuration Approach | Descriptive | Imperative | Imperative | | Configuration Type | API and JSON | JSON | API | | Platform targeting | node and web | Agnostic | Agnostic | | Incremental builds | ✓ | | | | Built-in modules | ✓ | | | | No disk IO during tasks | ✓ | | | | No maintainance cost | ✓ | | |

in other words, sey...

  • has ability to target node.js projects as well as web browser projects,
  • has built-in tasks, which does not need extra maintenance cost due to expiration of concepts and methods. all you need is updating to keep up to date,
  • has declarative configuration which only needs the input of what user expect. say goodbye to planning directives such as copy, concat, etc.
  • supports partial building on changed files. it never starts over doing all tasks.
  • supports both configuration and API at the same time,
  • is specialized for create bundles and building projects,
  • is as fast as it can be.

Built-in Tasks

  • addheader: adds file header to each file
  • compile: compiles various source files (typescript, jsx, sass, less) into JavaScript
  • commonjs: enables commonjs modules in browser
  • concat: concatenates all content of source files
  • eolfix: replaces various EOL types with unix standard
  • lint: lints source files
  • minify: minifies source files
  • optimize: optimizes source files if available
  • preprocess: proprocesses source files for macro support
  • transpile: transpiles source files to adapt standards (ES6 -> ES5, etc.)

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

  • Deploy Task
  • Watch Task (Refresh Friendliness)
  • PostCSS Tasks (transpile op)
  • Sourcemaps
  • Fancy output including line counts, lint and test results

See GitHub Issues.

Requirements

  • node.js (https://nodejs.org/)

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.

  • To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
  • To report a bug: If something does not work, please report it using GitHub issues.
  • To support: Donate