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

gulp-inuit

v0.2.4

Published

A plugin for Gulp

Downloads

32

Readme

gulp-inuit

NPM version Build Status Coverage Status Dependency Status

Inuit plugin for gulp

There are a few common problem we want to solve when developing custom Inuit themes using its new modular approach with Bower.

  • Import the modular sections in order: you would usually need to maintain an index.scss that imports all the .scss files from your bower modules, like it is recommended
  • Customizing variables defined by all those modules you are depending on.

These common problems (and common solutions) are not only tedious, but also problem-prone (think: copying a new variable for customization after upgrading an Inuit module). This gulp plugin is designed to specifically fill these gaps.

How it works:

  1. The primary function of gulp-inuit takes a vinyl stream and generate a virtual index.scss on the fly, importing all .scss files from all bower dependencies, in order. You can then pipe it to gulp-sass to get your css output. Simply put, you would never need to manually maintain a index.scss any more.
  2. The secondary function of gulp-inuit (exported as variables) will take a vinyl stream and translate that into a stream of files (vinyl objects) with the variables extracted from those in the original stream.

Try it out: gulp-inuit-example

Usage

First, install gulp-inuit as a development dependency:

npm install --save-dev gulp-inuit

API

Primary usage

inuit ( fileStream [, options ] )

var sass = require('gulp-sass');
var mainBowerFiles = require('main-bower-files');
var inuit = require("gulp-inuit");

// it is not necessary to read in the content
var sassFileStream = gulp.src(mainBowerFiles().concat('**/*.scss'), {read: false});

inuit(sassFileStream)
  .pipe(sass())
  .pipe(gulp.dest("./dist"));

options.name

Type: String
Default: index

The file name of the resulting vinyl object.

var sassFileStream = gulp.src(mainBowerFiles().concat('**/*.scss'), {read: false});

// this will generate a file './dist/main.css', instead of './dist/index.css'
inuit(sassFileStream, { name: 'main' })
  .pipe(sass())
  .pipe(gulp.dest("./dist"));

options.sections

Type: Array
Default: [ 'settings', 'tools', 'generic', 'base', 'objects', 'components', 'trumps' ]

The array of section names, in their expected import order. The default values is as documented on Inuit's getting started guide.

You may never have to change any of the following options.

options.starttag

Type: String
Default: //= {{name}}:{{ext}}

gulp-inuit uses gulp-inject internally to create a centralized index.scss file that imports all modular .scss files in order. This option is in fact the starttag option from that plugin.

options.endtag

Type: String
Default: //= endinject

Same reason as options.starttag, this is simply endtag option from gulp-inject.

options.ext

Type: String
Default: scss

Inuit uses .scss syntax, this option allows the plugin to work with any potential porting to other css preprocessing languages.


Secondary usage

inuit.variables ( [ options ] )

var gulp = require('gulp');
var mainBowerFiles = require('main-bower-files');
var conflict = require('gulp-conflit');
var inuit = require("gulp-inuit");

gulp.task('customize-variales', function () {
  // you must NOT set { read: faslse }, the plugin needs to read into the content for variable extraction.
  return gulp.src(mainBowerFiles())
    .pipe(inuit.variables())
    .pipe(conflict('./app/styles/customize'))
    .pipe(gulp.dest('./app/styles/customize'));
});

You can run this gulp task every time when you add/remove/update your bower dependencies. The task will generate a list of .scss files that captures the variables declared in those bower packages, and put the files in app/styles/customize directory. The conflict() gulp plugin shown in example should help you navigate through the changes before you apply them.

options.sections

Type: Array
Default: [ 'settings', 'tools', 'generic', 'base', 'objects', 'components', 'trumps' ]

The array of section names, in their expected import order. The default values is as documented on Inuit's getting started guide. Only files with a name that follows the inuit file naming convention would be processed for variable extraction.

options.ext

Type: String
Default: scss

Inuit uses .scss syntax, this option allows the plugin to work with any potential porting to other css preprocessing languages.

License

MIT License