Home / Docs / Configure a package

ita.una

What it does

From edition 0.4, a package describes itself in ita.una, a short file at the root of the package, next to src/. It replaces una.toml, which editions 0.1 to 0.3 keep. ita.una is written in Una's own lexical syntax: two-space indentation, -- comments, words and text in double quotes. It holds no code. There are no expressions, no interpolation, no conditions and no includes, so reading it never runs anything. Its grammar is closed: every line has one of a fixed set of forms, and anything else is an error at that line (U7008).

The file starts with the head, ita <name> and its lines, then the sections the package needs, in a fixed order. The sections that una.toml had keep their meaning: labels, trusted, escapes, boundaries, contracts and run.

ita.unauna
ita shop
  version 0.1.0
  edition 0.4
  about "A small shop"
  license "Apache-2.0"

labels
  PII

run
  entry shop
  grants
    console
src/shop.unauna
module shop

pub main() -> Unit
  uses @console: Console[print]
=
  @console.print("open")

Next to it, ita.lock pins the solver and every dependency (see ita.lock).

Forms

text
ita <name>                       -- or <owner>/<name>
  version <MAJOR.MINOR.PATCH>    -- required
  edition 0.4 | 0.5              -- required
  profile app | systems          -- optional; app by default
  about "<one line>"             -- optional; required to publish
  license "<SPDX expression>"    -- optional; required to publish
  home "<https URL>"             -- optional
  publish to <source>            -- optional; without it the package is never published

sources | needs | replace | trust | labels | trusted | escapes | boundaries | contracts | run | drive | serve

Examples

A version that is not MAJOR.MINOR.PATCH is U7008 at its line:

ita.unauna
-- fails with U7008
ita shop
  version 0.1
  edition 0.4
src/shop.unauna
module shop

pub one() -> Int = 1

A section that is not one of the forms, such as settings, is U7008 at its line: the grammar is closed.

ita.unauna
-- fails with U7008
ita shop
  version 0.1.0
  edition 0.4

settings
  color "red"
src/shop.unauna
module shop

pub one() -> Int = 1

Edge cases

Diagnostics

Edition

Edition 0.4 and later, a preview. Editions 0.1 to 0.3 are described by una.toml (see una migrate).

Normative source