wab

wabid

Module to identify an ESRI Web Appbuilder widget

Showing:

Popularity

Downloads/wk

1

Maintenance

No Maintenance Data Available

Package

Dependencies

2

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Wabid

A node module to aid in dependency managment for Web Appbuilder projects, by identifying whether a dependency is a WAB widget and should be placed in the /widgets directory, or another dependency (i.e., third-party library, dojo dijit) which should go in /libs.

Currently implemented as a set of file checks; by default, any directory which contains both Widget.js and manifest.json will be considered a WAB widget. The caller can also pass in a custom list of files to test against.

This module is meant to be used together with grunt-bower-task; An example gruntfile might look like:


var wabid = require('./node_modules/wabid');
module.exports = function (grunt) {

    grunt.loadNpmTasks('grunt-bower-task');

    grunt.initConfig({
        bower: {
            install: {
                options: {
                    targetDir: './',
                    cleanBowerDir: false,
                    layout: function (type, component, source) {
                        var path = '', subDirectory = '';
                        if (wabid.isWidget('bower_components/' + component)) {
                            subDirectory = ' is a widget';
                            path = 'widgets/' + component;
                        } else {
                            subDirectory = ' is a lib';
                            path = 'libs/' + component;
                        }
                        console.log(component + subDirectory);
                        return path;
                    }
                }
            }
        },
    });

    grunt.registerTask('bower-deps', ['bower:install']);
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100