Grunt tasks for LaxarJS
$ grunt laxar-test laxar-build laxar-dist laxar-develop └─1──────┘ └─2───────┘ └─3──────┘ └─4─────────┘ 1) run widget tests 2) generate required application artifacts, bring your own server 3) generate an optimized version for production (may take a bit longer) 4) do a build, then run a development server with live-reload of changes
This plugin requires Grunt
In case you have not used Grunt before, be sure to have a look at its Getting Started guide.
To use this plugin, you first need to install it using npm:
$ npm install grunt-laxar
After that, load its tasks from your Gruntfile:
grunt.loadNpmTasks( 'grunt-laxar' );
These are the bread-and-butter tasks for developing and optimizing your LaxarJS application.
Usually, the only task that you will have to configure manually is
These tasks form the public API for grunt-laxar, and any change in their configuration or end-result is subject to the semantic versioning of this package.
Configures all flow-based tasks and their building blocks. This is the only task that requires manual configuration (more).
Generates all artifacts that are needed to develop your application on an existing web server (more).
Generates dependencies and resource listings required by the LaxarJS runtime, and starts a development server with live reloading (more).
Prepares your application for production (more).
Runs the spec tests of all widgets that are a direct part of the application (more).
Runs the spec test of an individual widget (more).
Obtain information about the artifacts in your application (more).
Create API documentation in Markdown format (more).
Internal Building-Block Tasks
These tasks are used under the hood by the main tasks listed above.
Usually you do not need to know the details on these tasks, but sometimes you can save a few seconds by only running the sub-tasks you need, instead of the whole toolchain. The APIs of these tasks and their intermediate output is considered internal, so that behavior may change in incompatible ways between minor versions of grunt-laxar.
All of these tasks are multitasks that must be configured once for each set of flows that they may handle. Thus, If your Gruntfile contains the laxar-configure settings given above, you would (re)create the artifacts model for the main flow by executing:
grunt laxar-configure laxar-artifacts:main
The easiest way to generate the required configuration is by running laxar-configure before launching any of these tasks. The main tasks listed above do that for you out of the box.
For a given flow target, generates all artifacts that are needed to run that flow in the browser during development (more).
For a given flow target, collects all reachable artifacts and produce an artifacts model in JSON format (more).
For a given flow target, determines static assets (JSON, CSS, HTML) from the artifacts model in order to produce a resources listing in JSON format (more).
For a given flow target, generates an AMD module that references all direct dependencies (more).
For a given flow target, collects and merges all require_config.js files found in widgets and controls (more).
For a given flow target, run all widget tests (more).
Prepares test-configuration for all widgets of the given flow (more).
Runs pre-configured widget tests (prepared by
laxar-test-configure-flow or by
These tasks were originally available for LaxarJS v0.x and have similar objectives to the tasks listed above. Yhese tasks are kept for compatibility only, because they shipped with LaxarJS v1.0. It is recommended to instead use the tasks listed above, which are flow-aware and much less likely to cause CPU problems due to rampant watchers.
css_merger: Merge multiple CSS files into one file.
directory_tree: Generate a JSON mapping of files inside a specific directory tree.
laxar_application_dependencies: Generate a RequireJS module to bootstrap AngularJS.
test_results_merger: Merges XML test results.
These tasks are automatically configured by grunt-laxar to work with a LaxarJS application. Starting with grunt-laxar v1.1.0, it is recommended not to use these tasks directly but to use the main tasks above. If using these tasks directly, try not to rely on the current pre-configuration performed by grunt-laxar. In the future, configuration for these tasks may be scoped to affect only specific named targets defined by grunt-laxar This way, configuration will not influence any (alias) tasks defined by yourself.