Skip to content

Commit 2178c74

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 4d783e2 + 7edd367 commit 2178c74

23 files changed

Lines changed: 349 additions & 82 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Supported formats: `.yaml`, `.yml`, `.json`
222222

223223
Example `my-project.raid.yaml`:
224224
```yaml
225-
# yaml-language-server: $schema=https://raw.githubusercontent.com/8bitalex/raid/main/schemas/raid-profile.schema.json
225+
# yaml-language-server: $schema=https://raidcli.dev/schema/v1/raid-profile.schema.json
226226

227227
name: my-project
228228

@@ -288,7 +288,7 @@ Multiple profiles can be defined in a single file using YAML document separators
288288
Individual repositories can carry their own `raid.yaml` at their root to define repo-specific environments and commands. These are merged with the profile configuration at load time. Committing this file to each repo is the primary way knowledge is shared — the command for running tests, applying patches, or starting a proxy lives here instead of in a wiki.
289289

290290
```yaml
291-
# yaml-language-server: $schema=https://raw.githubusercontent.com/8bitalex/raid/main/schemas/raid-repo.schema.json
291+
# yaml-language-server: $schema=https://raidcli.dev/schema/v1/raid-repo.schema.json
292292
293293
name: my-service
294294
branch: main

docs/examples/demo.raid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=https://raw.githubusercontent.com/8bitalex/raid/main/schemas/raid-profile.schema.json
1+
# yaml-language-server: $schema=https://raidcli.dev/schema/v1/raid-profile.schema.json
22

33
# This is a raid profile definition for a fictional company called Acme. It defines two repositories (web and api)
44
# and a development environment with tasks to set up and run the projects.

docs/examples/example.raid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=../../schemas/raid-profile.schema.json
1+
# yaml-language-server: $schema=https://raidcli.dev/schema/v1/raid-profile.schema.json
22

33
name: raid
44
repositories:

docs/examples/raid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=../../schemas/raid-repo.schema.json
1+
# yaml-language-server: $schema=https://raidcli.dev/schema/v1/raid-repo.schema.json
22

33
name: raid
44
branch: main

llms.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Raid is written in Go, distributed as a single self-contained binary, and publis
4141

4242
## Schemas
4343

44-
- [Profile JSON Schema](https://raw.githubusercontent.com/8bitalex/raid/main/schemas/raid-profile.schema.json): Validation schema for `*.raid.yaml` profile files
45-
- [Repository JSON Schema](https://raw.githubusercontent.com/8bitalex/raid/main/schemas/raid-repo.schema.json): Validation schema for per-repo `raid.yaml` files
46-
- [Shared definitions schema](https://raw.githubusercontent.com/8bitalex/raid/main/schemas/raid-defs.schema.json): Common type definitions referenced by both schemas
44+
- [Profile JSON Schema](https://raidcli.dev/schema/v1/raid-profile.schema.json): Validation schema for `*.raid.yaml` profile files (v1 — stable URL)
45+
- [Repository JSON Schema](https://raidcli.dev/schema/v1/raid-repo.schema.json): Validation schema for per-repo `raid.yaml` files (v1 — stable URL)
46+
- [Shared definitions schema](https://raidcli.dev/schema/v1/raid-defs.schema.json): Common type definitions referenced by both schemas (v1 — stable URL)
4747
- [SchemaStore catalog](https://www.schemastore.org/api/json/catalog.json): Published catalog entries — auto-discovered by VS Code, JetBrains, Neovim, and other editors using the schemastore catalog
4848

4949
## Examples

schemas/README.md

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,59 @@
11
# Raid Schema Specifications
22

3-
This directory contains JSON Schema definitions for Raid configuration files.
3+
This directory contains the JSON Schema definitions for Raid configuration files.
4+
It is the **single source of truth** for the schemas — files here are both:
45

5-
## Schema Files
6-
7-
- `raid-profile.schema.json` - Schema for raid profile configuration files
8-
- `raid-repo.schema.json` - Schema for individual repository configuration files
9-
10-
## Schema Version
11-
12-
These schemas follow the **JSON Schema Draft 2020-12** specification and are compatible with the `github.com/santhosh-tekuri/jsonschema/v6` library (v6.0.2).
6+
1. Embedded into the Go binary via `go:embed` (used at runtime to validate
7+
profile and repo files), and
8+
2. Copied into `site/static/schema/v1/` by `site/plugins/copy-schemas.ts` at
9+
docsite build time, so they are served at the canonical URLs:
1310

14-
The `$schema` field is properly supported and the library fully validates against the JSON Schema Draft 2020-12 specification.
11+
- https://raidcli.dev/schema/v1/raid-defs.schema.json
12+
- https://raidcli.dev/schema/v1/raid-profile.schema.json
13+
- https://raidcli.dev/schema/v1/raid-repo.schema.json
1514

16-
## Usage
17-
18-
The schemas are used to validate YAML and JSON configuration files in the Raid CLI tool. The validation ensures that configuration files have the correct structure and required fields.
15+
## Schema Files
1916

20-
### Supported File Formats
17+
- `raid-defs.schema.json` — Shared `$defs` (task types, environments,
18+
commands, install). Referenced from the other two schemas.
19+
- `raid-profile.schema.json` — Profile file schema (`*.raid.yaml`).
20+
- `raid-repo.schema.json` — Per-repository schema (`raid.yaml`).
2121

22-
- YAML files (`.yaml`, `.yml`)
23-
- JSON files (`.json`)
22+
## Versioning
2423

25-
### Validation
24+
The `/schema/v1/` path is a **public stability contract**.
2625

27-
Profile files are validated against `raid-profile.schema.json` when using the `raid profile add` command. The validation checks:
26+
- Additive changes (new optional fields, new task types, new enum values) are
27+
allowed within v1.
28+
- Breaking changes (renaming or removing a field, tightening a `required` list,
29+
removing an enum value, turning an optional field required) require a new
30+
major version. Cut a `/schema/v2/` folder by freezing the current v1 files
31+
alongside the source and evolving the source separately.
32+
- Bump the second position of `version` in `src/resources/app.properties` when
33+
publishing a new major schema version.
2834

29-
- Required fields are present
30-
- Data types are correct
31-
- Structure matches the schema definition
35+
The `$id` fields are baked as absolute URLs so external validators resolve
36+
cross-references without depending on the retrieval URL. Internal validation
37+
(see `src/internal/lib/lib.go`) registers each embedded schema under its `$id`
38+
and compiles by URL — no network access at runtime.
3239

33-
## Schema Structure
40+
## Schema draft
3441

35-
### Raid Profile Schema
42+
These schemas follow **JSON Schema Draft 2020-12** and are validated with
43+
[`github.com/santhosh-tekuri/jsonschema/v6`](https://github.com/santhosh-tekuri/jsonschema)
44+
(v6.0.2).
3645

37-
A raid profile configuration must contain:
46+
## Supported file formats
3847

39-
- `name` (string, required) - The name of the raid profile
40-
- `repositories` (array, optional) - Array of repository configurations
41-
- Each repository must have:
42-
- `name` (string, required) - The name of the repository
43-
- `path` (string, required) - The local path to the repository
44-
- `url` (string, required) - The URL of the repository
48+
YAML (`.yaml`, `.yml`) and JSON (`.json`).
4549

46-
### Raid Repository Schema
50+
## Usage
4751

48-
A repository configuration must contain:
52+
Profile files are validated against `raid-profile.schema.json` by `raid profile
53+
add` and during config load. Repository `raid.yaml` files are validated against
54+
`raid-repo.schema.json` when a repo is loaded.
4955

50-
- `name` (string, required) - The name of the repository
51-
- `branch` (string, required) - The branch to checkout
56+
Editors that consult [SchemaStore](https://www.schemastore.org/) — VS Code +
57+
Red Hat YAML, JetBrains, Neovim `yaml-language-server`, Helix — auto-associate
58+
`*.raid.yaml` and `raid.yaml` with the published schemas, so the `# yaml-language-server`
59+
modeline is optional.

schemas/raid-defs.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "raid-defs.schema.json",
3+
"$id": "https://raidcli.dev/schema/v1/raid-defs.schema.json",
44
"title": "Raid Schema Definitions",
55
"description": "Shared schema definitions for raid",
66
"type": "object",

schemas/raid-profile.schema.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{
1+
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "raid-profile.schema.json",
3+
"$id": "https://raidcli.dev/schema/v1/raid-profile.schema.json",
44
"title": "Raid Profile Configuration",
55
"description": "Configuration for one or more raid profiles.",
66
"type": "object",
@@ -34,22 +34,21 @@
3434
"minItems": 1
3535
},
3636
"environments": {
37-
"$ref": "raid-defs.schema.json#/properties/environments"
37+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/environments"
3838
},
3939
"install": {
40-
"$ref": "raid-defs.schema.json#/properties/install"
40+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/install"
4141
},
4242
"task_groups": {
4343
"type": "object",
4444
"description": "Named reusable task sequences. Reference them in any task list with type: Group and ref: <name>.",
4545
"additionalProperties": {
46-
"$ref": "raid-defs.schema.json#/properties/tasks"
46+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/tasks"
4747
}
4848
},
4949
"commands": {
50-
"$ref": "raid-defs.schema.json#/properties/commands"
50+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/commands"
5151
}
5252
},
5353
"required": ["name"]
5454
}
55-

schemas/raid-repo.schema.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "raid-repo.schema.json",
3+
"$id": "https://raidcli.dev/schema/v1/raid-repo.schema.json",
44
"title": "Raid Repository Configuration",
55
"description": "Configuration for a single repository.",
66
"type": "object",
@@ -15,14 +15,14 @@
1515
"description": "The branch to checkout"
1616
},
1717
"environments": {
18-
"$ref": "raid-defs.schema.json#/properties/environments"
18+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/environments"
1919
},
2020
"install": {
21-
"$ref": "raid-defs.schema.json#/properties/install"
21+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/install"
2222
},
2323
"commands": {
24-
"$ref": "raid-defs.schema.json#/properties/commands"
24+
"$ref": "https://raidcli.dev/schema/v1/raid-defs.schema.json#/properties/commands"
2525
}
2626
},
2727
"required": ["name","branch"]
28-
}
28+
}

site/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
raid
1111
.env
1212

13+
# Schemas copied from /schemas by plugins/copy-schemas.ts at build time
14+
/static/schema/
15+
1316
# Misc
1417
.DS_Store
1518
.env.local

0 commit comments

Comments
 (0)