Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions crates/acton-config/schemas/acton.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions crates/acton-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub enum ContractDependency {
kind: DependencyKind,
/// Custom name for the generated code function
function: Option<String>,
/// Custom output path for the generated code file
/// Project-relative custom output path for the generated code file
path: Option<String>,
},
}
Expand Down Expand Up @@ -437,13 +437,13 @@ const fn default_fmt_separate_import_groups() -> Option<bool> {
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Default)]
#[serde(rename_all = "kebab-case")]
pub struct BuildSettings {
/// Directory where JSON build artifacts are saved
/// Project-relative directory where JSON build artifacts are saved
pub out_dir: Option<String>,
/// Directory where generated dependency files are saved
/// Project-relative directory where generated dependency files are saved
pub gen_dir: Option<String>,
/// Directory where per-contract ABI JSON files are saved
/// Project-relative directory where per-contract ABI JSON files are saved
pub output_abi: Option<String>,
/// Directory where per-contract compiled Fift files are saved
/// Project-relative directory where per-contract compiled Fift files are saved
pub output_fift: Option<String>,
}

Expand All @@ -460,19 +460,19 @@ pub struct WrappersConfig {
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Default)]
#[serde(rename_all = "kebab-case")]
pub struct TolkWrapperSettings {
/// Directory where `acton wrapper` writes generated Tolk wrappers by default
/// Project-relative directory where `acton wrapper` writes generated Tolk wrappers by default
pub output_dir: Option<String>,
/// Generate a Tolk test stub by default for `acton wrapper`
pub generate_test: Option<bool>,
/// Directory where generated Tolk test stubs are written by default
/// Project-relative directory where generated Tolk test stubs are written by default
pub test_output_dir: Option<String>,
}

/// Default settings for TypeScript wrapper generation
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Default)]
#[serde(rename_all = "kebab-case")]
pub struct TypescriptWrapperSettings {
/// Directory where `acton wrapper --ts` writes generated TypeScript wrappers by default
/// Project-relative directory where `acton wrapper --ts` writes generated TypeScript wrappers by default
pub output_dir: Option<String>,
}

Expand Down Expand Up @@ -605,7 +605,7 @@ pub struct ContractConfig {
pub src: String,
/// Dependencies of this contract
pub depends: Option<Vec<ContractDependency>>,
/// Path where the compiled `.boc` should be saved
/// Project-relative path where the compiled `.boc` should be saved
pub output: Option<String>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fn test_hover_contracts_depends_nested_objects() {
contracts.wallet.depends[0].path
```

Custom output path for the generated code file
Project-relative custom output path for the generated code file

- Type: `string`

Expand Down
25 changes: 13 additions & 12 deletions docs/content/docs/acton-toml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This matters for all relative paths from config sections, e.g., `[contracts].src
Relative CLI path flags are a separate rule:

- Relative paths written inside `Acton.toml` are resolved from project root.
- Manifest-configured output paths for build and wrapper generation must stay inside the project root.
- Relative CLI path flags stay relative to the current working directory unless they are absolute.
- `--manifest-path` chooses which manifest to load, but it does not rebase unrelated CLI path flags to the manifest directory.

Expand Down Expand Up @@ -100,7 +101,7 @@ This section is a map where each key is a contract name and the value is a contr
| `display-name` | `string` | No | Human-readable name of the contract. Defaults to the contract name. |
| `src` | `string` | **Yes** | Path to the contract source file (`.tolk`) or a precompiled `.boc`. |
| `depends` | `array` | No | List of contract dependencies. Can be simple names or detailed objects. |
| `output` | `string` | No | Custom path where the compiled `.boc` should be saved. |
| `output` | `string` | No | Project-relative path where the compiled `.boc` should be saved. |

### Contract dependencies

Expand All @@ -115,9 +116,9 @@ Dependencies can be specified in two ways:
- `name`: Name of the contract to depend on.
- `kind`: Dependency type. Either `embed_code` (default) or `library_ref`.
- `function`: Custom name for the generated code function.
- `path`: Custom output path for the generated code file.
- `path`: Project-relative custom output path for the generated code file.

Dependency helper naming uses the contract key from `[contracts.<name>]`, not `display-name`. Relative dependency `path` values are resolved from the project root.
Dependency helper naming uses the contract key from `[contracts.<name>]`, not `display-name`. Dependency `path` values are resolved from the project root and must stay inside it.

Example:

Expand All @@ -137,10 +138,10 @@ Configures defaults for `acton build`.

| Field | Type | Required | Description |
|:--------------|:---------|:---------|:-----------------------------------------------------------------------------------------|
| `out-dir` | `string` | No | Directory where build JSON artifacts are written (default: `build`). |
| `gen-dir` | `string` | No | Directory where generated dependency files are written (default: `gen`). |
| `output-abi` | `string` | No | Directory where contract ABI JSON files are written (default: `build/abi`). |
| `output-fift` | `string` | No | Directory where compiled Fift files are written (`<contract>.fif` per `.tolk` contract). |
| `out-dir` | `string` | No | Project-relative directory where build JSON artifacts are written (default: `build`). |
| `gen-dir` | `string` | No | Project-relative directory where generated dependency files are written (default: `gen`). |
| `output-abi` | `string` | No | Project-relative directory where contract ABI JSON files are written (default: `build/abi`). |
| `output-fift` | `string` | No | Project-relative directory where compiled Fift files are written (`<contract>.fif` per `.tolk` contract). |

Example:

Expand All @@ -152,7 +153,7 @@ output-abi = "build/abi"
output-fift = "build/fift"
```

`acton build --out-dir <DIR>`, `acton build --gen-dir <DIR>`, `acton build --output-abi <DIR>`, and `acton build --output-fift <DIR>` override these values for a single run. Config values here are project-root-relative. The CLI flags stay relative to the current working directory unless absolute paths are passed. Arbitrary `.boc` contracts are skipped in ABI and Fift output.
`acton build --out-dir <DIR>`, `acton build --gen-dir <DIR>`, `acton build --output-abi <DIR>`, and `acton build --output-fift <DIR>` override these values for a single run. Config values here are project-root-relative and must stay inside the project root. The CLI flags stay relative to the current working directory unless absolute paths are passed. Arbitrary `.boc` contracts are skipped in ABI and Fift output.

## `[wrappers]`

Expand All @@ -162,15 +163,15 @@ Configures default output locations for `acton wrapper`.

| Field | Type | Default | Description |
|:------------------|:----------|:--------|:----------------------------------------------------------------------|
| `output-dir` | `string` | - | Default directory for generated Tolk wrappers. |
| `output-dir` | `string` | - | Project-relative default directory for generated Tolk wrappers. |
| `generate-test` | `boolean` | `false` | Generate a Tolk test stub by default for non-TypeScript wrapper runs. |
| `test-output-dir` | `string` | - | Default directory for generated Tolk test stubs. |
| `test-output-dir` | `string` | - | Project-relative default directory for generated Tolk test stubs. |

### `[wrappers.typescript]`

| Field | Type | Default | Description |
|:-------------|:---------|:--------|:-----------------------------------------------------|
| `output-dir` | `string` | - | Default directory for generated TypeScript wrappers. |
| `output-dir` | `string` | - | Project-relative default directory for generated TypeScript wrappers. |

Example:

Expand All @@ -191,7 +192,7 @@ Override rules:
- For Tolk test stubs, `--test-output` has highest priority, then `--test-output-dir`, then `[wrappers.tolk].test-output-dir`, then the wrapper command's built-in default test location.
- `[wrappers.tolk].generate-test` affects only non-TypeScript wrapper generation. `acton wrapper --ts` still cannot be combined with test-stub generation.

Configured wrapper paths are resolved from project root. CLI paths such as `--output`, `--output-dir`, `--test-output`, and `--test-output-dir` stay relative to the current working directory unless absolute.
Configured wrapper paths are resolved from project root and must stay inside it. CLI paths such as `--output`, `--output-dir`, `--test-output`, and `--test-output-dir` stay relative to the current working directory unless absolute.

For full CLI behavior, see [`acton wrapper`](/docs/commands/wrapper).

Expand Down
17 changes: 9 additions & 8 deletions docs/content/docs/building/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This page provides a complete reference for all configuration options available
Acton uses two different path-resolution models:

- Relative paths from `Acton.toml` are resolved from project root.
- Manifest-configured output paths for build and wrapper generation must stay inside the project root.
- Relative CLI path flags stay relative to the current working directory unless absolute.
- `--manifest-path` only chooses which manifest to load. It does not rebase unrelated CLI path flags to the manifest directory.

Expand Down Expand Up @@ -103,7 +104,7 @@ acton build --output-abi artifacts/abi
acton build --output-fift artifacts/fift
```

Config values in `[build]` are project-root-relative. CLI paths such as `--out-dir`, `--gen-dir`, `--output-abi`, `--output-fift`, and `--graph` remain cwd-relative unless absolute.
Config values in `[build]` are project-root-relative and must stay inside the project root. CLI paths such as `--out-dir`, `--gen-dir`, `--output-abi`, `--output-fift`, and `--graph` remain cwd-relative unless absolute.

### Wrappers section

Expand All @@ -123,10 +124,10 @@ Available fields:

| Field | Type | Default | Description |
|------------------------------------|---------|---------|----------------------------------------------------------------------|
| `[wrappers.tolk].output-dir` | string | - | Default directory for generated Tolk wrappers |
| `[wrappers.tolk].output-dir` | string | - | Project-relative default directory for generated Tolk wrappers |
| `[wrappers.tolk].generate-test` | boolean | `false` | Generate a Tolk test stub by default for non-TypeScript wrapper runs |
| `[wrappers.tolk].test-output-dir` | string | - | Default directory for generated Tolk test stubs |
| `[wrappers.typescript].output-dir` | string | - | Default directory for generated TypeScript wrappers |
| `[wrappers.tolk].test-output-dir` | string | - | Project-relative default directory for generated Tolk test stubs |
| `[wrappers.typescript].output-dir` | string | - | Project-relative default directory for generated TypeScript wrappers |

Override rules:

Expand All @@ -135,7 +136,7 @@ Override rules:
- Test stub path: `--test-output` -> `--test-output-dir` -> `[wrappers.tolk].test-output-dir` -> wrapper command built-in default.
- `[wrappers.tolk].generate-test` only affects non-TypeScript runs. `acton wrapper --ts` still rejects test-stub options.

Configured wrapper paths are project-root-relative. CLI paths such as `--output`, `--output-dir`, `--test-output`, and `--test-output-dir` remain cwd-relative unless absolute.
Configured wrapper paths are project-root-relative and must stay inside the project root. CLI paths such as `--output`, `--output-dir`, `--test-output`, and `--test-output-dir` remain cwd-relative unless absolute.

### Contracts section

Expand All @@ -155,7 +156,7 @@ depends = []
|----------------|--------|----------|--------------------------------------------------------------------------------------------------------------------|
| `display-name` | string | No | Overrides full name (e.g. `Wallet` instead of `JettonWallet`) in console messages and UI. |
| `src` | string | Yes | Path to the contract source file. Can be a `.tolk` file for compilation or a `.boc` file for precompiled contracts |
| `output` | string | No | Path where the compiled `.boc` file should be saved. If omitted, the compiled contract is only cached |
| `output` | string | No | Project-relative path where the compiled `.boc` file should be saved. If omitted, the compiled contract is only cached |
| `depends` | array | No | Array of contract dependencies. Can be simple strings or detailed dependency objects |

#### Contract names
Expand Down Expand Up @@ -200,7 +201,7 @@ depends = [
| `name` | string | Yes | - | Contract name to depend on. Must match a `[contracts.*]` name |
| `kind` | string | No | `"embed_code"` | Dependency type: `"embed_code"` or `"library_ref"`. Omitting it in the detailed form still means `"embed_code"` |
| `function` | string | No | Auto-generated | Custom name for the generated function. If omitted, Acton derives it from the dependency key using the rules below |
| `path` | string | No | `{gen-dir}/{name}.code.tolk` | Custom output path for the generated file. Relative manifest paths are resolved from the project root |
| `path` | string | No | `{gen-dir}/{name}.code.tolk` | Project-relative custom output path for the generated file |

#### Dependency helper generation rules

Expand All @@ -217,7 +218,7 @@ Helper file placement uses this precedence:

Path resolution follows the normal config-vs-CLI rules:

- `depends[].path` and `[build].gen-dir` are project-root-relative unless absolute
- `depends[].path` and `[build].gen-dir` are project-root-relative and must stay inside the project root
- `--gen-dir` is cwd-relative unless absolute
- if `depends[].path` is set, it fully replaces the default helper location

Expand Down
10 changes: 7 additions & 3 deletions docs/content/docs/commands/build.mdx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/content/docs/commands/wrapper.mdx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading