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

rub-cli

v0.2.8

Published

Adapt Buildkit (rub-cli)

Downloads

180

Readme

rub-cli

Extends the grunt commands which come with Adapt Framework.

Support

Supports only Adapt versions >=4

Installation

Please make sure you leave the following files and folders in your development folder:

node_modules (if it's there)
grunt

Then run npm install -g rub-cli grunt-cli

N.B. it is critical to install grunt-cli otherwise the commands may fail silently.

Execute

Run rub dev

$ rub help

Adapt Buildkit (rub-cli)

  Usage: rub [options] [courses...]

  Options:

    -V, version          display version numbers     
    -h, help             display this help text      
    -v, verbose          verbose output
    -f, force            force rebuild
    -F, forceall         force clean then rebuild    
    -p                   number of parallel tasks (2)
    -c, clean            clean output folder
    tracking:insert      add block tracking ids      
    tracking:remove      remove block tracking ids
    tracking:reset       reset block tracking ids
    -j, json             process json
    -M, minify           minify json
    -P, prettify         prettify json
    -b, build            production build (no sourcemaps, with uglify)
    -d, dev              development build (with sourcemaps, no uglify)
    -U, uglify           uglify js
    -z, zip              zip output folders
    -Z, zipaat           zip for import to AAT
    -r, redundantassets  check for redundant assets
    -t, techspec         check assets against techspec
    -C, compress         compress images
    -w, watch            watch for changes
    -s, server           run server environment
    translate:export     export translatable text
    translate:import     import translated text
    -W, wait             wait for keypress

Tech Spec

  1. Run rub techspec
  2. Edit techspec.json
  3. Run rub techspec

Including/excluding plugins

If one (or more) of your modules only uses a subset of the installed plugins, you can specify which should be included by adding the following to the config.json for that module:

"build": {
	"includes": [
		"adapt-contrib-media",
		"adapt-contrib-narrative",
		"adapt-contrib-bookmarking",
		"adapt-contrib-pageLevelProgress",
		"adapt-quicknav"
	]
}

Changing .json file endings

Add to Adapt framework package.json

    "grunt": {
        "options": {
            "jsonext": "txt"
        }
    }

Changing course folder name

Add to Adapt framework package.json

    "grunt": {
        "options": {
            "coursedir": "alternative"
        }
    }

IMSMANIFEST.XML variable replacement

@@course.title
@@course.customName.subAttributeName
@@config.anyOtherName

You can only use variables from config and course.

Tracking Ids

These three commands (tracking:remove, tracking:insert and tracking:remove) will change the src/course if you’re using the Adapt Learning structure, or the builds/moduleName/course/ files otherwise.

Flags vs commands vs options

Commands will typically run at the exclusion of all other non-dependent tasks, such that rub prettify will only perform a json prettification task. Flags now assume a build should happen, such that rub -P will build and prettify, rub -Pz will build, prettify and zip, etc. Options specify a value, such as rub -p=10, to allow 10 parallel tasks.

Migrating from adapt-cli to rub

In order to use rub, your Adapt project's folder structure will require a few changes.

  1. Create a builds folder in the root of your project.
  2. Create a folder inside the builds folder using your module name (e.g. `p101).
  3. Move the contents of the 'src/course' folder into 'builds/p101/course'. Then, remove 'src/course' entirely.
  4. Finally, run rub dev p101 to build.