Commands

Wee includes an extensible CLI with some useful default commands

Make

Quickly scaffold core Wee structures

Controller

VariableTypeDefaultDescriptionRequired

name

string

-

camelCase controller name

type

string

base

Define controller template to use

wee make:controller --name=controllerName

You can also create a controller using the extensions or api template by specifying the type name.

In this case, the type is also used as the name variable.

The Extensions controller allows you to use several chainable variations of -is-active and -is-disabled classes.

wee make:controller --type=extensions
Wee.fn.make('extensions', {
    _construct: function() {
        var disabled = '-is-disabled',
            active = '-is-active';

        $.chain({
            disable: function() {
                this.addClass(disabled);

                return this;
            },

            enable: function() {
                this.removeClass(disabled);
            },

            isDisabled: function() {
                return this.hasClass(disabled);
            },

            isEnabled: function() {
                return ! this.hasClass(disabled);
            },

            activate: function() {
                this.addClass(active);

                return this;
            },

            deactivate: function() {
                this.removeClass(active);

                return this;
            },

            isActive: function() {
                return this.hasClass(active);
            },

            isInactive: function() {
                return ! this.hasClass(active);
            }
        });
    }
});

The API controller scaffolding provides a convenient interface to Wee’s data request, allowing you to consolidate your data request logic in one place.

wee make:controller --type=api
Wee.fn.make('api', {
    get: function(conf) {
        this.$private.send(conf);
    },

    post: function(conf) {
        this.$private.send(Wee.$extend(true, {
            method: 'post'
        }, conf));
    },

    put: function(conf) {
        this.$private.send(Wee.$extend(true, {
            method: 'put'
        }, conf));
    },

    delete: function(conf) {
        this.$private.send(Wee.$extend(true, {
            method: 'delete'
        }, conf));
    }
}, {
    send: function(conf) {
        Wee.fetch.request(conf);
    }
});

Module

VariableTypeDefaultDescriptionRequired

name

string

-

camelCase module name

author

string

-

Module author

autoload

boolean

true

autoload toggle

extension

boolean

false

Extension toggle

website

string

-

Website reference

description

string

-

Internal module description

wee make:module --name=moduleName --extension=true

Test

VariableTypeDefaultDescriptionRequired

name

string

-

Title Cased test name

wee make:test --name="Test Name"

Reset

Remove unnecessary files and sample assets from the default install

wee reset

Validate

Enforce code quality and formatting

Wee leverages JSHint and JSCS for automatic and manual code validation. JSHint serves as more of a high-level quality check and JSCS is focused on code consistency and formatting. In wee.json you can disable either independently or point them to custom configurations.

To run validation on demand execute the command below

wee validate