# Packages and dependencies

What Axle counts as a package, and how it knows which packages depend on which.

## Packages

A monorepo is one repository holding many packages, for example a website, a UI library and a shared utilities package. To Axle, a package is a folder inside the repository with its own `package.json`, matched by the repository's workspace patterns. The root `package.json` itself isn't a package, unless the repository isn't a monorepo; then it is the only one.

Each package has:

- a **name**, from the `name` field of its `package.json`, which must be unique in the repository;
- **scripts**, the commands in its `scripts` field that you can run, like `build` or `test`;
- **dependencies** on other packages in the same repository.

## Dependencies

A package depends on another package in the repository when it lists that package's name in `dependencies`, `devDependencies`, `optionalDependencies` or `peerDependencies`. The version doesn't matter: `workspace:*`, `*` and `^1.0.0` all count. Packages from the npm registry aren't part of the monorepo, so Axle leaves them out.

Dependencies decide the order of work: when `web` depends on `ui`, `ui` has to be built before `web`. That order is what [`axle run`](https://axlers.dev/docs/reference/run.md) uses.

## Projects

Not everything in a repository has a `package.json`. A **project** is a folder Axle runs tasks in all the same, such as a Go service or a Python tool. The root `axle.toml` lists where projects are with `projects`, and each project's own `axle.toml` gives its name and the command of each task. [Plugins](https://axlers.dev/docs/reference/plugins.md) can find projects too, such as the Python projects of a uv workspace.

Projects and packages are treated alike: they run, cache and count as affected in the same way, and can depend on each other. Since a project has no `package.json` to list its dependencies, `implicitDependencies` in its `axle.toml` names the packages and projects it depends on; a package can use it too. `tags` label packages and projects, to choose them with `--filter tag:<name>` and to write [boundaries rules](https://axlers.dev/docs/reference/boundaries.md). See [projects](https://axlers.dev/docs/reference/configuration.md#projects) in the `axle.toml` reference.
