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

deck-task-registry

v1.2.3

Published

Theme toolchain used for Drupal projects running the Deck subtheme.

Downloads

3

Readme

Drupal Deck task registry

Build Status

Overview

This toolset is just a collection of Gulp based development and build tasks. They were written primarily for use on Drupal sites using the Deck subtheme, but there's no reason that they can't be used on other platforms/themes.

They use Gulp v4, but the latest version of Gulp CLI will ensure you don't need to remove your current v3 installation of Gulp.

Requirements

  • NodeJS >= v6
  • Gulp CLI (npm install -g gulp-cli).

Installation

Into a new task suite

  1. Run $ npm install deck-task-registry
  2. If the stub files aren't created, then navigate to node_modules/src/post-install/files and copy the example.config.js and gulpfile.js files into your Gulp tasks directory, removing any example prefixes.

Into an existing task suite

  1. Run $ npm install deck-task-registry
  2. If the stub files aren't created, then navigate to node_modules/src/post-install/files and copy the example.config.js file into your Gulp tasks directory, removing any example prefixes.
  3. require your config and the drupal-task-registry module.
  4. Add the registry to your project by adding gulp.registry(config)

Usage

Basic usage

The tools are gulp tasks, so simply run gulp TASKNAME.

To see an available list if tasks, run gulp --tasks

Build mode

There are two build modes available to the toolset: development and production.

By default, all Gulp tasks will run in development mode. This means that you get all sourcemaps and uncompressed build assets this is also true of the main build task.

To enable production mode, simple pass --production or --prod to the Gulp task you are running. Further information about what production mode does on a per-task basis can be found below.

Tasks

Styles

build:styles

Compiles your SASS and places it into the configured css directory.

It also pipes your styles through AutoPrefixer, using the provided browser configuration.

Development mode

  • Sourcemaps will be generated.

Production mode

  • Sourcemaps are not generated.
  • Output CSS is minified.

Scripts

build:scripts

Compiles your JavaScript and/or TypeScript and places it into the configured js directory.

If es2015 is set to true, then your scripts will be piped through the TypeScript transpiler. This will optimise your code, as well as enable the following:

  • Ability to write ES2015 compliant code
  • Ability to write TypeScript compliant code.

Please note, that this does NOT include module loading. There is no module loader available with these tools at this time.

Development mode

  • Sourcemaps will be generated

Production mode

  • Sourcemaps will not be generated
  • Output JS is minified with Uglify. Variables are not truncated as it tends to break Drupal.behaviors.

lint:scripts

Lints your scripts using ESLint and TSLint (if using TypeScript). Configuration files are loaded by searching parent directories relative to the scripts being linted, so generally if you want to override them

  • simply place a configuration file in your theme directory. In no .eslintrc file is provided; ESLint will use the default configuration that ships with Drupal (if using Drupal 8). If you're writing ES2015; you'll also want a custom .eslintrc file.

Development mode

  • Linting failure will not break return an error code.

Production mode*

  • Linting failure will prevent the build from continuing.

Images

build:images

Compress and optimise all images.

There are no differences between development and production mode for this task.

Fonts

Copy all fonts found in the src directory to the dest directory.

There are no differences between development and production mode for this task.

Build

build:clean

Remove any and all assets from the destination directory of each resource type.

There are no differences between development and production mode for this task.

build

Run any linting and testing tasks, and then run build tasks providing the test tasks complete. At the time of writing, the task breakdown is as follows. Note; all tasks on the same level are run in parallel. Different levels denote series based tasks.

  • build:clean
    • lint:scripts
      • build:scripts
      • build:styles
      • build:images
      • build:fonts

Development/production mode

  • All development mode settings for each individual task apply as they are run. For example, in development mode; sourcemaps are generated, and the output is not compressed for scripts and styles.

Contribution

  • Ensure there are tests where possible
  • In lieu of a formal styleguide; follow existing formatting, and ensure ESLint doesn't fail.
  • Document your changes.