Skip to content
Merged
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
6 changes: 3 additions & 3 deletions docs/src/content/docs/concepts/typescript-as-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: TypeScript as Data
description: How chant reads the resource objects your TypeScript exports, and the supported subset
---

chant reads the resource objects your TypeScript exports. It supports a specific subset of the language, the part whose value is fully determined by literals, constants, and cross-resource references. `chant build` imports and runs your files to collect those objects. The subset exists so that running them has no side effects and always yields the same output. This page documents exactly which patterns are supported and which are not.
chant reads the resource objects your TypeScript exports. It supports a specific subset of the language, the part whose value is fully determined by literals, constants, and cross-resource references. `chant build` reduces your files directly to those objects without executing them; a file that steps outside the subset is imported and run instead. The subset exists so that either path has no side effects and always yields the same output. This page documents exactly which patterns are supported and which are not.

## Supported Patterns

Expand Down Expand Up @@ -187,7 +187,7 @@ Helpers that read the environment are deliberately excluded. `env()` is a functi

## Unsupported Patterns

The following patterns are caught by the evaluability lint rules (EVL). Your editor shows them as lint errors, and `chant lint` reports them in CI. By default, `chant build` does not enforce them — it imports and runs your file regardless, so a pattern below still produces whatever JavaScript produces, correct or not. Run lint, or rely on your editor, to keep source inside the supported subset.
The following patterns are caught by the evaluability lint rules (EVL). Your editor shows them as lint errors, and `chant lint` reports them in CI. `chant build` does not fail on them — a pattern below makes fold reject that one file, which then falls back to being imported and run, producing whatever JavaScript produces, correct or not. Run lint, or rely on your editor, to keep source inside the supported subset.

On the fold path (see [Folded vs Run](#folded-vs-run) below), the same subset is what a file must stay inside to fold at all: a pattern below makes fold reject that one file and fall back to running it, logged with the reason. That fallback is not a build error either — it just means the file loses the no-execution property for this run.

Expand Down Expand Up @@ -328,7 +328,7 @@ Folded files execute none of their own code, but a run-fallback file does — in

## Why These Constraints?

The supported subset is the set of TypeScript patterns whose value is fully determined by literals, known constants, and symbolic cross-resource references. `chant build` imports and runs your files. The evaluability rules reject patterns that would make the result depend on anything else, so running the supported subset has no side effects.
The supported subset is the set of TypeScript patterns whose value is fully determined by literals, known constants, and symbolic cross-resource references. `chant build` folds source inside that subset and imports and runs whatever falls outside it. The evaluability rules reject patterns that would make the result depend on anything else, so running the supported subset has no side effects either.

This makes synthesis fast, deterministic for conforming source (same source, same output), and auditable (every output value traces to a specific line in the source).

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/lint-rules/evaluability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Rules that flag TypeScript patterns the evaluator cannot statically

Evaluability rules flag TypeScript patterns that the chant evaluator cannot statically resolve. All evaluability rules have severity **error**.

These are a diagnostic layer over one specific enforcement mechanism, not a guarantee that holds regardless of it. EVL001 and EVL003 share a single subset definition with `fold()`, the static AST reducer `chant build --fold` uses (see [TypeScript as Data](/chant/concepts/typescript-as-data/#folded-vs-run)) — so a shape either rule flags is, with a few environment-dependent exceptions below, exactly a shape the folder rejects, at the same line. EVL exists to catch it early — in your editor and in `chant lint`, before a build — while `fold()` is what actually enforces it, and only when `--fold` is passed. The default `chant build` runs your file either way; EVL is what keeps that run itself inside the deterministic subset.
These are a diagnostic layer over one specific enforcement mechanism, not a guarantee that holds regardless of it. EVL001 and EVL003 share a single subset definition with `fold()`, the static AST reducer `chant build` uses by default (see [TypeScript as Data](/chant/concepts/typescript-as-data/#folded-vs-run)) — so a shape either rule flags is, with a few environment-dependent exceptions below, exactly a shape the folder rejects, at the same line. EVL exists to catch it early — in your editor and in `chant lint`, before a build — while `fold()` is what actually enforces it. A file the folder rejects is not a build error: it falls back to being imported and run, and EVL is what keeps that run inside the deterministic subset.

**Where EVL and `fold()` diverge.** Both import the same classifier (`fold/subset.ts`) so they can't drift on node kinds or operators, but several things are inherently environment-dependent and can't be decided from shape alone:

Expand Down
4 changes: 4 additions & 0 deletions lexicons/aws/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default defineConfig({
{
"label": "Deploying to EKS",
"slug": "eks-kubernetes"
},
{
"label": "Nested Stacks",
"slug": "nested-stacks"
}
],
}),
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/cloudformation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "CloudFormation Concepts"
description: "Templates, resources, parameters, outputs, dependencies, and tagging in the AWS CloudFormation lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
Every exported resource declaration becomes a logical resource in a CloudFormation template. The serializer handles the translation automatically:

- Wraps output in `AWSTemplateFormatVersion: "2010-09-09"`
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/composites.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Composites"
description: "Composite resources, built-in composites, action constants, and withDefaults presets in the AWS CloudFormation lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
Composites group related resources into reusable factories. See also the core [Composite Resources](/chant/guide/composite-resources/) guide.

```typescript title="lambda-api.ts"
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/custom-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Custom Lint Rules"
description: "Writing and registering project-specific lint rules for AWS CloudFormation"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
Chant's lint engine runs TypeScript AST visitors. Write project-specific rules that enforce domain conventions.

## Anatomy of a lint rule
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Examples"
description: "Walkthrough of the AWS CloudFormation lexicon examples"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
Runnable examples live in the lexicon's `examples/` directory — one per built-in composite. Clone the repo and try them:

```bash
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "AWS CloudFormation"
description: "AWS CloudFormation lexicon for chant — resource types, intrinsics, and lint rules"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}

The **AWS CloudFormation** lexicon provides full support for defining AWS infrastructure using chant's declarative TypeScript syntax. Resources are serialized to CloudFormation JSON templates.

This lexicon is generated from the official [CloudFormation Resource Provider Schemas](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) and includes coverage for all publicly available resource types.
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/intrinsics-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Intrinsics Guide"
description: "Worked examples for every CloudFormation intrinsic function and their chant syntax"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
See [Intrinsic Functions](../intrinsics/) for the generated reference table (name, description, output key, whether it's a tagged template, whether folding can reduce it). This page is the worked-example companion — one `Fn::` intrinsic function per section, with real usage.

CloudFormation intrinsic functions are available as imports from the lexicon. They produce the corresponding `Fn::` calls in the serialized template.
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/intrinsics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "Intrinsic Functions"
description: "Built-in intrinsic functions for the AWS CloudFormation lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}

The AWS CloudFormation lexicon provides **9** intrinsic functions.

**Tag?** shows how an intrinsic is authored: a genuine tagged template (`Sub\`...\``) or a plain function call (`Ref(...)`). **Folds?** shows whether [folding](/chant/concepts/typescript-as-data/#folded-vs-run) — the default `chant build` path — can reduce a use of this intrinsic today, without running the file — generated directly from this lexicon's registration, not restated by hand. A tagged template folds once it is registered. A plain call folds only where this lexicon has opted that intrinsic in one at a time (`foldsAsCall`), so a `No` in this column means this intrinsic has not been opted in, not that calls in general cannot fold.
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/lint-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Lint Rules"
description: "Built-in lint rules and post-synth checks for AWS CloudFormation"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
The AWS lexicon ships lint rules that run during `chant lint` and post-synth checks that validate the serialized CloudFormation output after `chant build`.

## Lint rules
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/nested-stacks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Nested Stacks"
description: "Splitting resources into child CloudFormation templates with automatic cross-stack reference wiring"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
import Diagram from '../../components/Diagram.astro';

CloudFormation nested stacks (`AWS::CloudFormation::Stack`) let you decompose large templates into smaller, reusable child templates. The AWS lexicon's `nestedStack()` function references a **child project directory** — a subdirectory that builds independently to a valid CloudFormation template.
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/serialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "Serialization"
description: "Output format for the AWS CloudFormation lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}

The AWS lexicon serializes resources into **CloudFormation JSON templates**.

## Building
Expand Down
3 changes: 3 additions & 0 deletions lexicons/aws/docs/src/content/docs/skills.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "AI Skills"
description: "AI agent skills bundled with the AWS CloudFormation lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-aws` — DO NOT EDIT.
Edit lexicons/aws/src/codegen/docs.ts instead; changes here are overwritten. */}
The AWS lexicon ships an AI skill called **chant-aws** that teaches AI coding agents (like Claude Code) how to build, validate, and deploy CloudFormation templates from a chant project.

## What are skills?
Expand Down
1 change: 1 addition & 0 deletions lexicons/aws/src/codegen/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ The lexicon also provides MCP (Model Context Protocol) tools and resources that
],
sidebarExtra: [
{ label: "Deploying to EKS", slug: "eks-kubernetes" },
{ label: "Nested Stacks", slug: "nested-stacks" },
],
};

Expand Down
42 changes: 39 additions & 3 deletions lexicons/azure/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,49 @@ export default defineConfig({
"label": "Pseudo-Parameters",
"slug": "pseudo-parameters"
},
{
"label": "Serialization",
"slug": "serialization"
},
{
"label": "Getting Started",
"slug": "getting-started"
},
{
"label": "Resources",
"slug": "resources"
},
{
"label": "Parameters & Outputs",
"slug": "parameters-outputs"
},
{
"label": "Composites",
"slug": "composites"
},
{
"label": "Linked Templates",
"slug": "linked-templates"
},
{
"label": "Lint Rules",
"slug": "rules"
"slug": "lint-rules"
},
{
"label": "Serialization",
"slug": "serialization"
"label": "Importing ARM Templates",
"slug": "importing"
},
{
"label": "Deploying to AKS",
"slug": "aks-kubernetes"
},
{
"label": "Examples",
"slug": "examples"
},
{
"label": "AI Skills",
"slug": "skills"
}
],
}),
Expand Down
4 changes: 3 additions & 1 deletion lexicons/azure/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "Azure Resource Manager"
description: "Typed constructors for Azure Resource Manager templates"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-azure` — DO NOT EDIT.
Edit lexicons/azure/src/codegen/docs.ts instead; changes here are overwritten. */}

The **Azure Resource Manager** lexicon provides support for defining Azure infrastructure using chant's declarative TypeScript syntax. Resources are serialized to ARM template JSON.

This lexicon is generated from the official [Azure Resource Manager Schemas](https://github.com/Azure/azure-resource-manager-schemas) and includes coverage for commonly used resource types.
Expand All @@ -29,5 +32,4 @@ npm install --save-dev @intentius/chant-lexicon-azure

- [Intrinsic Functions](./intrinsics) — 9 built-in functions
- [Pseudo-Parameters](./pseudo-parameters) — 6 pseudo-parameters
- [Lint Rules](./rules) — 23 rules
- [Serialization](./serialization) — output format details
3 changes: 3 additions & 0 deletions lexicons/azure/docs/src/content/docs/intrinsics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "Intrinsic Functions"
description: "Built-in intrinsic functions for the Azure Resource Manager lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-azure` — DO NOT EDIT.
Edit lexicons/azure/src/codegen/docs.ts instead; changes here are overwritten. */}

The Azure Resource Manager lexicon provides **9** intrinsic functions.

**Tag?** shows how an intrinsic is authored: a genuine tagged template (`Sub\`...\``) or a plain function call (`Ref(...)`). **Folds?** shows whether [folding](/chant/concepts/typescript-as-data/#folded-vs-run) — the default `chant build` path — can reduce a use of this intrinsic today, without running the file — generated directly from this lexicon's registration, not restated by hand. A tagged template folds once it is registered. A plain call folds only where this lexicon has opted that intrinsic in one at a time (`foldsAsCall`), so a `No` in this column means this intrinsic has not been opted in, not that calls in general cannot fold.
Expand Down
3 changes: 3 additions & 0 deletions lexicons/azure/docs/src/content/docs/pseudo-parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "Pseudo-Parameters"
description: "Pseudo-parameters available in the Azure Resource Manager lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-azure` — DO NOT EDIT.
Edit lexicons/azure/src/codegen/docs.ts instead; changes here are overwritten. */}

The Azure Resource Manager lexicon provides **6** pseudo-parameters — predefined values available in every stack without explicit declaration.

| Name | Value |
Expand Down
41 changes: 0 additions & 41 deletions lexicons/azure/docs/src/content/docs/rules.mdx

This file was deleted.

3 changes: 3 additions & 0 deletions lexicons/azure/docs/src/content/docs/serialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: "Serialization"
description: "Output format for the Azure Resource Manager lexicon"
---

{/* GENERATED-BY-CHANT-DOCS by `npm run docs -w @intentius/chant-lexicon-azure` — DO NOT EDIT.
Edit lexicons/azure/src/codegen/docs.ts instead; changes here are overwritten. */}

The Azure lexicon serializes resources into **ARM template JSON**.

## Building
Expand Down
Loading
Loading