|
@@ -5,16 +5,19 @@ permalink: "js-glossary.html"
|
|
|
parent: Overview
|
|
|
---
|
|
|
|
|
|
+
|
|
|
### What is `bower`?
|
|
|
|
|
|
Bower is a dependency management tool for client-side web packages. Each package can specify its production dependencies and its development-only dependencies by name and semver version expression. Package dependencies are specified in a `bower.json` file. Bower, when asked to install dependencies, looks for dependencies of the project and for dependencies of dependencies all the way down, unifies version constraints and then installs all dependencies from all levels of the hierarchy in flat manner (side-by-side) into directory `bower_components`.
|
|
|
|
|
|
+
|
|
|
### Where is `bower` used in Amber?
|
|
|
|
|
|
Amber itself is a client-side web package, so Amber itself is a bower package and uses bower to manage its own client-side dependencies (jQuery and others).
|
|
|
|
|
|
An Amber web project (a client-side web project that uses Amber) is encouraged to use bower to manage its dependencies as well, listing Amber itself as one of them. Default projects (the ones created by `amber init`) do just that.
|
|
|
|
|
|
+
|
|
|
### What is `grunt`?
|
|
|
|
|
|
Grunt is a build system for the JavaScript ecosystem. In the root directory of the project, grunt looks for a file called `Gruntfile.js`. This defines tasks to be done and binds them together, similarly to what a `Makefile` does for the `make` build system in UNIX. Grunt is installed through the npm package manager and must be installed in three parts:
|
|
@@ -22,10 +25,12 @@ Grunt is a build system for the JavaScript ecosystem. In the root directory of t
|
|
|
- `grunt-xxx-yyy` - modules with reusable tasks, also as development dependency of the project, and
|
|
|
- `grunt-cli`, the CLI command that drives the runtime using `Gruntfile.js`, which should be installed globally.
|
|
|
|
|
|
+
|
|
|
### Where is `grunt` used in Amber?
|
|
|
|
|
|
Amber itself and default Amber projects (the ones created by `amber init`) both contain `Gruntfile.js` and they include `grunt` and accompanying grunt task modules as development dependencies. In an Amber project, grunt is used to recompile Smalltalk source to JavaScript files from the command line (CLI), as well as running the tests from CLI. In Amber itself, grunt is used for the same, plus a few bookkeeping tasks.
|
|
|
|
|
|
+
|
|
|
### What is `grunt-init`?
|
|
|
|
|
|
Grunt-init is a create-project-from-a-template tool, spawned from `grunt` to be a standalone tool. It defines an API. The templates themselves are created as isolated `npm` packages, which the `grunt-init` CLI command can use. In template modules, you define the skeleton of the project, a set of questions to ask when the project is created and the way they are included in the skeleton. The result is, by running `grunt-init` with a specific template, you answer a few questions, and a project is created for you base on the answers.
|