Skip to content

davewilton/generator-typescript-wab-widget

Repository files navigation

generator-typescript-wab-widget Build Status

Yeoman generator to create custom Dojo widgets for Esri WebApp Builder applications.

About

This generator scaffolds out the boilerplate files that are need each time you create a new custom WebApp Builder widget. The structure is designed to remove dependancy on the WAB to enable tests to be easily written and allow rapid development testing within the html test page. It replaces the previous generator which relied on interfaces and instead uses the decorator pattern for dojo inheritance.

It creates:

  • TypeScript Widgets.
  • Pure dojo widget inside the esri WAB BaseWidget.
  • A test html page with the dojo widget for development outside of the WAB.

A sample of the generated TypeScript widget can be viewed here

This generator was adapted from @steveoh's generator-dojo-widget, @tomwaysons generator-esri-widget and Esri/generator-esri-appbuilder-js.

Getting Started

Installation

To install Yeoman from npm (if not already), run:

$ npm install -g yo

To install generator-esri-widget from npm, run:

$ npm install -g generator-typescript-wab-widget

Running the Generator

Navigate to your application's widgets folder and run the following at the command line:

$ yo typescript-wab-widget

tsconfig.json

The following options should be set in the tsconfig (noImplicitUseStrict and experimentalDecorators):

{
    "compilerOptions": {
        "sourceMap": true,
        "target": "es5",
        "module": "amd",
        "experimentalDecorators": true,
        "moduleResolution": "classic",
        "noImplicitUseStrict": true
    }
}

License

MIT