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

asimov-build

v1.0.0

Published

Grunt tasks to compile an Asimov project

Downloads

25

Readme

asimov-build

Grunt tasks to compile an Asimov project.

Getting started

Install asimov-build via npm

npm install asimov-build --save-dev

Require asimov-build in your Gruntfile:

var build = require('asimov-build')(grunt);

Add the following following config keys fo your Gruntfile.js with the corresponding source and destination file locations for your applications scss and js files.

paths: {
    css: {
        src: 'src/scss',
        dist: 'dist/css'
    },
    js: {
        src: 'src/js',
        dist: 'dist/js'
    }
}

Some Asimov components will have their own assets like fonts or images. You can configure where they're copied with the paths.assets.dist key.

paths: {
    assets: {
        dist: 'dist'
    }
}

Building Asimov

From here you can let asimov-build bootstrap Grunt with the necessary config and tasks for compiling Asimov.

Alternative if you're not using Grunt, or simply don't want any magic in your asset pipeline you can query the specific config you'll need to integrate Asimov if your application.

API

The core things you'll need to get Asimov compiling are correctly configured Sass load paths, and RequireJS compilation targets.

getSassLoadPaths

Returns an array of path that need to be part of Sass' load_path config.

getRequireJSComponents

Returns an object of RequireJS configs. This can be passes directly to grunt-contrib-requirejs or you can iterate over each key and pass it's to requirejs.config().

This method optionally takes an object of r.js options which is use to normalise some configs like paths.

bootstrap

This is the simpliest way to get up with Asimov. It will load and configure a handful of grunt plugins with sane defaults.

If you Gruntfile already configures task asimov-build wants to bootstrap it will simply add any additionally required config.

note only ever call the bootstrap function after calling grunt.initConfig.

Config flags

use_bundler

Type: bool Default: true

Whether to use bundler when running tasks that use ruby i.e. sass

Example

An example setup might look like this

module.exports = function(grunt) {
    'use strict';

    //
    // Initialize config
    //

    grunt.initConfig({

        // Your grunt config here


        // Make some path information available to tasks
        //
        // Consumers of asimov-build should set these for their application

        paths: {
            css: {
                src: 'src/scss',
                dist: 'dist/css'
            },
            js: {
                src: 'src/js',
                dist: 'dist/js'
            },
            assets: {
                dist: 'dist'
            }
        },

        //
        // Asimov build config
        //

        asimov_build: {
            use_bundler: false
        }

    });

    // Bootstrap asimov-build.
    //
    // Always run this after calling `grunt.initConfig`
    // or bad things _will_ happen!

    var build = require('asimov-build')(grunt);
    build.bootstrap();

};