> For the complete documentation index, see [llms.txt](https://docs.aurelia.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aurelia.io/~/revisions/gR80klCEJxq2vRaf1v0G/community-contribution/building-and-testing-aurelia.md).

# Building and testing aurelia

Get setup to build and test the Aurelia 2 source!

If you're looking to contribute directly to Aurelia or its test suite, you've come to the right place!

{% hint style="success" %}
**Here's what you'll learn...**

* Setting up your machine and cloning the Aurelia repository.
* Building the entire Aurelia 2 monorepo.
* Running tests in the browser and Node.js.
  {% endhint %}

## Setup

In order to build Aurelia, ensure that you have [Git](https://git-scm.com/downloads), [Node.js](https://nodejs.org/) `v15.4.0` or higher, and `npm@7.0.0` or higher installed.

Run the following commands to clone, install:

```bash
git clone https://github.com/aurelia/aurelia.git && cd aurelia
npm ci
```

### packages

From the root level of the project, run `npm run dev` to start the development. This will:

* build & watch the `runtime` package for rebuild
* build & watch the `runtime-html` package for rebuild
* build & watch the `__testing__` package for rebuild
* start a process to run all the tests with `karma`

Example scenarios:

1. Fixing a repeater bug, so run all the repeater tests and rebuild repeater source code on change:

```
npm run dev -- --test repeater
```

2. Fixing a router bug, so run all the router tests and rebuild router source code on change:

```
npm run dev -- --dev router --test router
```

* The `--dev` (shortcut: `-d`) is to specify what additional package beside `runtime` & `runtime-html` packages should be rebuild on changes
* The `--test` (shortcut: `-t`) is to specify what glob to search test files to run

This documentation will be expanded upon in the future.

### packages-tooling

Similar to core packages, to develop/test any of the tooling packages, run `npm run dev:tooling` to start the development. This will

* build & watch the `kernel` core package for rebuild
* build & watch the `plugin-conventions` tooling package for rebuild
* start a process to run all the tests with `mocha`

Example scenarios:

1. Fixing a convention bug, so run all the plugin convention tests, and rebuild `plugin-conventions` tooling package on code change:

```
npm run dev -- --test plugin-conventions
# or
npm run dev -- --test conventions
```

2. Fixing a webpack loader bug, sp run all the load tests and rebuild webpack loader code on change

```
npm run dev -- --dev webpack-loader --test loader
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aurelia.io/~/revisions/gR80klCEJxq2vRaf1v0G/community-contribution/building-and-testing-aurelia.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
