ucd-theme-tasks
Base automation for compiling a UCD frontend.
Last updated a month ago by markmill .
GPL-2.0-or-later · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ucd-theme-tasks 
SYNC missed versions from official npm registry.

ucd-theme-tasks

Base automation for compiling a UCD frontend.

This package contains all of the gulp tasks needed by UCD frontend projects and themes.

Installation

  1. Require the ucd-theme-tasks package with node.js.
$ npm install ucd-theme-tasks --save-dev
  1. Create a gulp-config.js file which will contain any configuration overrides. You can copy the default config out of this package to see all default config.
$ cp node_modules/ucd-theme-tasks/gulp-config.default.js gulp-config.js
  1. Create a gulpfile.js in the root of your project.
'use strict';
const gulp = require('gulp');
const config = require('./gulp-config.js');

// Load all default tasks.
require('ucd-theme-tasks')(gulp, config);
  1. (Optional) Allow specific local config overrides of config.
'use strict';
const gulp = require('gulp');
const _ = require('lodash');
let config = require('./gulp-config');

// Load in custom config
try {
  const customConfig = require('./gulp-config.local');
  config = _.merge(config, customConfig);
}
catch (e) {
  console.log('Add a gulp-config.local.js file for any custom local configuration.');
}

// Load all default tasks.
require('ucd-theme-tasks')(gulp, config);

Validation and Linting

JavaScript Linting

Linting of JavaScript is done via EsLint. Place a .eslintrc.yml configuration file into the root of your project to set up the linting rules. A starting file can be copied from this project.

$ cp node_modules/ucd-theme-tasks/.eslintrc.yml .eslintrc.yml

Sass/Scss Linting

Linting of Sass/Scss files is done via Sass Lint Place a .sass-lint.yml configuration file into the root of your project to set up the linting rules. A starting file can be copied from this project.

$ cp node_modules/ucd-theme-tasks/.sass-lint.yml .sass-lint.yml

Gulp Tasks

Primary Tasks

  1. gulp - Generate the production code and start watching for changes.

  2. gulp compile - Generate all production-ready code.

  3. gulp validate - Validate CSS and JS by linting (don't forget to set up .eslintrc.yml and .sass-lint.yml files).

Site Building Tasks

  1. gulp newsite - Start a new site from a starterkit (used with Pattern Lab).

  2. gulp themesync - Export/Import Pattern Lab source files to a website theme.

Babel Compiling

Babel is used to transform es6 JavaScript into es5 usable by older browsers. The @babel/preset-env is used by default and can be customized in a .babelrc file placed into the root of your project.

Default Configuration

gulp-config.default.js contains all of the default configuration for controlling the gulp tasks. This file can be referenced for all possible config options. Docs can be found at https://github.com/ucdavis/ucd-theme-tasks/blob/master/docs/config.md

Pattern Lab

If you are using this package within Pattern Lab then it can build and watch patterns by setting patternLab.enabled: true. This will work for the Node.js version of Pattern Lab.

Current Tags

  • 3.0.1                                ...           latest (a month ago)

13 Versions

  • 3.0.1                                ...           a month ago
  • 3.0.0                                ...           a year ago
  • 2.0.5                                ...           a year ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 23
Dependencies (28)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |