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

@ianbytchek/guild

v0.0.14

Published

Gulp configuration framework for common build-test-deploy tasks

Downloads

7

Readme

Guild

Guild is a gulp configuration framework for common build-test-deploy tasks. Instead of copy-pasting repeated unmaintainable tasks from project to project, with guild, they can be required() as a single npm module and used with a simple configuration.

The above is the result of the following configuration, which goes into your guilpfile. It adds the specified tasks and can be safely used with your own tasks, given there are no naming conflicts.


// Keep path configuration and other complex / reusable stuff separately.

var configuration = require('./configuration/path');
var guild = require('@ianbytchek/guild');
var gulp = require('gulp');

guild(gulp, {
    dependency: {
        normalise: {
            "jquery": 'bower_components/jquery/dist/jquery.min.js',
            "normalize": 'bower_components/normalize.css/normalize.css'
        }
    },
    build: {
        webpack: require('./configuration/webpack'),
        less: true,
        twig: true
    },
    deployment: {
        s3: [
            'favicon.icon',
            'html/*'
        ]
    }
    path: configuration
});

Setup

Install using npm install @ianbytchek/guild or add it to package.json.

"dependencies": {
    "guild": "@ianbytchek/guild"
}

Configuration

Path

Path object holds default project paths if configuration contains relative paths or assumes the use of default locations. It can be created with require('@ianbytchek/guild').PathConfiguration('/absolute/project/path')).

Dependency

Prepares project dependencies, which most often require little touches to go into the code.

Normalise

Normalises dependencies, typical use case is to minify them, strip comments, and move to a single location, like library/js or library/css folder.

normalise: {
    "foo": path.join(configuration.path.dependency, 'bower/foo.js')
    "bar": {
        source: path.join(configuration.path.dependency, 'bower/bar/bar.css'),
        destination: path.join(configuration.path.library, 'css/bar.css'),
        pipeline: ['default', 'minify', 'uncomment', require('gulp-autoprefixer')]
    }
}

Normalise will automatically determine if the dependency is js or css and will send it through default streams, so you can simply tell it the where the source is, the key will be used to name the final file.

  • source – path, array of paths, required.
  • destination – path, array of paths, optional, outputs everything into configuration.path.library, will raise exception if not specified and multiple sources are used or when library path is not defined.
  • plugins – array of custom streams (when constants) or a function returning an array of actual streams. You can provide standard guild pipelines as strings, default includes them all.

Build

Builds project files, typically involves building js, css, html products and packaging them up with webpack.

Less

Compiles less sources, simplified form allows specifying only true or less source path.

less: true,
less: 'less/source/path'
less: {
    source: path.join(configuration.source, 'less'),
    destination: path.join(configuration.product, 'css')
}

Full form assumes a single configuration object or an array of them.

  • source - path, array of paths.
  • destination - path, array of paths.
  • plugins – same as for normalise task.

Webpack

Compiles webpack sources.

webpack: {
    source: path.join(configuration.source, 'less'),
    destination: path.join(configuration.product, 'css'),
    configuration: require('…')
}
  • source - path.
  • destination - path.
  • configuration – standard webpack configuration.
  • plugins – same as for normalise task.

Deployment

S3

Accepts the following syntax.


// Plain list of targets to upload. Passes parameters directly to awspublish.

s3: [
    'js',
    'css'
]

// List of targets with specifying base directory. The first case is very typical when
// we want to upload something to the root and something not, it will copy contents of
// `html` into the root, and everything else in `css` and `js`.

s3: [
    {path: 'html/*', base: 'html'},
    {path: 'css'},
    {path: 'js'}
]

// Full syntax allowing to specify extra s3 configuration. Obvious to state that sensitive
// parameters like access and secret keys and bucket name shouldn't be stored in open.

s3: [
    {
        target: path.join(configuration.product, 'js/**/*'),
        bucket: 'foo'
    },
    {
        target: path.join(configuration.product, 'css/**/*'),
        bucket: 'bar',
        accessKey: '…',
        secretKey: '…',
        region: '…',
    }
]
  • bucket – you can use this as an alias and specify --bucket-foo via cli options to provide the real bucket name. This is potentially more secure than having the real bucket exposed.

Similar projects

There are a few similar projects, I haven't seen a single compiled a list anywhere, so if you know something cool and fast-growing or already grown, I'd appreciate you adding it below.

  • https://github.com/vigetlabs/gulp-starter