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

mozu-theme-helpers

v1.3.2

Published

Helpers for compiling the JavaScript of Mozu themes and keeping Mozu themes up to date.

Downloads

607

Readme

mozu-theme-helpers

Library for common theme tasks: checking and maintaining repository relationship, and compiling JavaScript.

Requires

  • nodejs 0.12 or above

Install

npm install --save-dev mozu-theme-helpers

API

const mozuThemeHelpers = require('mozu-theme-helpers');
const pathToTheme = "/Users/you/mozuThemes/someTheme";
let task = mozuThemeHelpers('check', { dir: pathToTheme });
// tasks are EventEmitters, emitting "info", "warn", "error", and "done" events
task.on('info', console.log);
task.on('warn', console.log);
task.on('error' e => {
  console.error(e);
  process.exit(1);
});
task.on('done', summary => {
  console.log(summary);
  process.exit(0);
});

Task Types

check

Maintains base theme relationship in your theme.json and in Git, and informs you of available updates. This task is meant to be run on every incremental build of your theme.

  • Detects the base theme of the current theme, by looking in Git and in theme.json
  • Reattaches a basetheme remote if necessary.
  • Checks the base theme for updates.
  • Displays new available versions, or all new available commits, based on the baseThemeChannel setting in theme.json. If it's set to stable, displays only available stable versions. If it's set to prerelease, will also display prerelease versions. If it's set to edge, will display all commits that are available to merge.
  • Updates the baseThemeVersion in theme.json if it detects that you have merged in later versions.

Options:

  • dir - The directory of the theme to check. Defaults to process.cwd().

compile

Compiles your theme JavaScript using the customized Mozu RequireJS Compiler.

  • Puts built JS in the compiled directory.
  • Minifies JS using Uglify2 by default.
  • Detects extends in theme.json and uses a temp directory to simulate runtime resolution. This feature is deprecated; you should have "extends": null in your theme.json.

Options:

  • skipminification - Skip the minification step. Use this during development for faster builds. Default false.
  • verbose - Say a lot more stuff.

Grunt Task

This library is mostly designed for use in Grunt, and so it has a grunt task. Grunt will recognize the /tasks/ folder of any node module, so you can say:

grunt.loadNpmTasks('mozu-theme-helpers');

This will give Grunt a mozutheme task, that can run check and compile with options.

Example task configuration:

mozutheme: {
  check: {
    command: 'check'
  },
  fullcompile: {
    command: 'compile'
  },
  quickcompile: {
    command: 'compile',
    opts: {
      skipminification: true
    }
  }
}

Task configuration must include a command property that can be either 'check' or 'compile'. It can optionally include an opts object that will be sent to the task as options.

opts can also be a function, that can asynchronously create options. It will receive the grunt process object and a callback as arguments, and should call callback with an error as the first argument if an error occurred, or null as the first argument and an options object to be sent to the task as the second argument.

License

MIT. Copyright 2016 Volusion, LLC.