A yeoman generator that scaffolds a yFiles for HTML powered application. Requires a local yFiles for HTML package which can be obtained and evaluated here.
First, install Yeoman and generator-yfiles-app using npm (we assume you have pre-installed node.js). The current version scaffolds yFiles for HTML 2.0 projects.
npm install -g yo
npm install -g generator-yfiles-app
Then generate your new project:
yo yfiles-app
Simply answer a few questions and everything you need for your yFiles app is at the right place.
To scaffold a yFiles for HTML 1.3 project, please install v0.9.4 of the generator-yfiles-app, i.e:
npm install -g [email protected]
To scaffold a yFiles for HTML 1.4 project, please install v0.9.5 of the generator-yfiles-app, i.e:
npm install -g [email protected]
This generator scaffolds a yFiles for HTML application. It allows you to choose between different build tools and programming languages (ECMAScript 5, ECMAScript 6 (+Babel) and TypeScript).
Here is a rundown of the options you have:
The name of the app, the first class and the generated main files. Only valid JavaScript identifiers (consisting of [a-zA-Z$_]) are accepted.
The name of the module/namespace the first class shall live in. Only valid JavaScript identifiers (consisting of [a-zA-Z$_]) are accepted.
The path to the root of a valid yFiles for HTML package (e.g. "path/to/yFilesPackage"). This package must contain the following folders:
- "lib/yfiles"
- "deployment"
- "ide-support"
Usually your yFiles package contains a license.js file at top level. If not, you may provide a path to a valid license, e.g. "path/to/license.js".
You can choose between those build tools:
- none: No build file is provided and you can run your app directly without the need of a compile step.
- Grunt: A simple Gruntfile.js is provided, that packages the required yFiles modules to a single file but leaves your code unchanged.
- Grunt + Browserify Packages and minifies all JavaScript resources to a single file using Browserify.
- Grunt + Webpack Packages all JavaScript resources to a single file using Webpack.
Decide whether you want to load the library via
- AMD require,
- systemjs or
- <script>-tags. This option will not be available when Webpack or Browserify have been selected as build tool, as the resulting package is included via <script>-tag.
Choose which yFiles modules your app will need. For an overview of these take a look at the Developer's Guide's module section. The generator will automatically optimize the requires.
- Use yfiles-typeinfo.js Includes the yfiles-typeinfo.js file which provides runtime type checking during development time. It is recommended to exclude this file in releases. Further information can be found here
- npm & git Runs the node generator, which initializes a npm package and git.
- Visual Studio Code integration Creates additional files required for Visual Studio Codes' IntelliSense as well as a task runner if applicable.
- ECMAScript 6 (+babel) Enables you to use ECMAScript 6 (only available if you have chosen a build tool).
- TypeScript Use TypeScript instead of plain JavaScript (only available if have chosen a build tool).
Choosing TypeScript will disable ECMAScript (+Babel).
MIT © yWorks GmbH