@ghentcdh/crouton-core 0.0.1-alpha.83 → 0.0.1-alpha.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-docs/1.getting-started/index.md +4 -0
- package/agent-docs/5.tooling/migrate.md +54 -2
- package/dist/crouton.schema.json +19 -0
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -192,3 +192,7 @@ npx @ghentcdh/add-crouton --cwd /path/to/project
|
|
|
192
192
|
6. **Installs dependencies** — runs `<pm> install` if missing deps were detected.
|
|
193
193
|
|
|
194
194
|
After running `@ghentcdh/add-crouton`, wire `CroutonApiModule` into your NestJS app module — see [Backend setup](backend.md).
|
|
195
|
+
|
|
196
|
+
## Keeping agent files current
|
|
197
|
+
|
|
198
|
+
After upgrading crouton, run `crouton migrate` to update your `resource.json` files **and** refresh the Claude skill, Cursor rule, and `AGENTS.md` block to the new version. See [Migrations](../5.tooling/migrate.md#agent-files) for details.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: crouton migrate — automated codemod for upgrading resource.json files.
|
|
2
|
+
description: crouton migrate — automated codemod for upgrading resource.json files and syncing agent files.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Migrations
|
|
6
6
|
|
|
7
|
-
The `crouton migrate` command transforms `resource.json` files automatically.
|
|
7
|
+
The `crouton migrate` command transforms `resource.json` files automatically and keeps your agent files (Claude skill, Cursor rule, `AGENTS.md` block) in sync with the installed crouton version.
|
|
8
8
|
|
|
9
9
|
## `crouton migrate`
|
|
10
10
|
|
|
@@ -45,6 +45,58 @@ crouton migrate --check
|
|
|
45
45
|
|
|
46
46
|
The transform is **idempotent** — running it twice produces no further diff.
|
|
47
47
|
|
|
48
|
+
### Flags
|
|
49
|
+
|
|
50
|
+
| Flag | Description |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `--dry-run` | Print a diff of what would change; do not write files. |
|
|
53
|
+
| `--check` | Exit 1 if any file needs migration or agent files are out of date (useful in CI). |
|
|
54
|
+
| `--no-agent-files` | Only migrate `resource.json` files; skip agent file sync. |
|
|
55
|
+
| `--agent-files-only` | Only sync agent files; skip `resource.json` migration. |
|
|
56
|
+
| `--targets claude,cursor` | Which agent file sets to sync (default: those already present, or both on first run). |
|
|
57
|
+
| `--force` | Overwrite agent files even if they were edited locally. |
|
|
58
|
+
| `[paths...]` | One or more file or directory paths to scan (default: `resourcesDir` from `crouton.json`). |
|
|
59
|
+
|
|
48
60
|
### When to run
|
|
49
61
|
|
|
50
62
|
Run after upgrading `@ghentcdh/crouton-core` to a version that introduces breaking layout or schema changes. The schema validator will tell you when migration is needed.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Agent files
|
|
67
|
+
|
|
68
|
+
`crouton migrate` also keeps your AI agent files in sync with the installed crouton version. This ensures agents always write resources in the current schema shape.
|
|
69
|
+
|
|
70
|
+
### What is synced
|
|
71
|
+
|
|
72
|
+
| File | Description |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `.claude/skills/crouton/SKILL.md` | Main crouton skill for Claude Code. Includes YAML frontmatter with `crouton-version`. |
|
|
75
|
+
| `.claude/skills/crouton/references/*.md` | Reference files: `resource-json.md`, `relations.md`, `field-inputs.md`, `data-sources.md`, `recipes.md`, `common-mistakes.md`. |
|
|
76
|
+
| `.cursor/rules/crouton.mdc` | Cursor rule equivalent. |
|
|
77
|
+
| `AGENTS.md` (crouton block) | The `<!-- crouton configuration -->` block. |
|
|
78
|
+
|
|
79
|
+
### Safe updates
|
|
80
|
+
|
|
81
|
+
A manifest at `.crouton/agent-files.json` tracks what crouton last wrote. The update logic per file:
|
|
82
|
+
|
|
83
|
+
- **File missing** → written.
|
|
84
|
+
- **Hash matches manifest** (untouched since last crouton write) → overwritten with the new version.
|
|
85
|
+
- **Hash differs** (you edited it) → skipped; the new version is written to `.crouton/agent-files/<name>.new` and reported. Use `--force` to overwrite.
|
|
86
|
+
- **File crouton no longer ships** → deleted if untouched, reported if edited.
|
|
87
|
+
|
|
88
|
+
### Project-specific notes
|
|
89
|
+
|
|
90
|
+
Put project conventions in `.claude/skills/crouton/project.md`. Crouton never touches this file. The skill links to it automatically if it exists.
|
|
91
|
+
|
|
92
|
+
### `crouton.json` configuration
|
|
93
|
+
|
|
94
|
+
After the first run, crouton stores the chosen targets in `crouton.json`:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"agentFiles": { "targets": ["claude", "cursor"] }
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Change or remove this to adjust which sets are managed.
|
package/dist/crouton.schema.json
CHANGED
|
@@ -913,6 +913,25 @@
|
|
|
913
913
|
"languages"
|
|
914
914
|
],
|
|
915
915
|
"markdownDescription": "Optional i18n / translation configuration. Omit if the app is single-language.\n\n[Docs](https://ghentcdh.github.io/crouton/guide/1.setup/crouton-json)"
|
|
916
|
+
},
|
|
917
|
+
"agentFiles": {
|
|
918
|
+
"description": "Agent file sync configuration for `crouton migrate`. Stored after the first run.",
|
|
919
|
+
"type": "object",
|
|
920
|
+
"properties": {
|
|
921
|
+
"targets": {
|
|
922
|
+
"description": "Which agent file sets to manage. Defaults to those already present in the project, or both on first run.",
|
|
923
|
+
"type": "array",
|
|
924
|
+
"items": {
|
|
925
|
+
"type": "string",
|
|
926
|
+
"enum": [
|
|
927
|
+
"claude",
|
|
928
|
+
"cursor"
|
|
929
|
+
]
|
|
930
|
+
},
|
|
931
|
+
"markdownDescription": "Which agent file sets to manage. Defaults to those already present in the project, or both on first run.\n\n[Docs](https://ghentcdh.github.io/crouton/guide/1.setup/crouton-json)"
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
"markdownDescription": "Agent file sync configuration for `crouton migrate`. Stored after the first run.\n\n[Docs](https://ghentcdh.github.io/crouton/guide/1.setup/crouton-json)"
|
|
916
935
|
}
|
|
917
936
|
},
|
|
918
937
|
"required": [
|
package/dist/index.cjs
CHANGED
|
@@ -4485,7 +4485,10 @@ var CroutonConfigSchema = import_zod48.z.object({
|
|
|
4485
4485
|
rules: RulesetSchema.default(RulesetSchema.parse({})).describe("Optional overrides of the default visibility and behaviour ruleset applied to all resources."),
|
|
4486
4486
|
sidebarGroups: import_zod48.z.record(import_zod48.z.string(), SidebarGroupSchema).default({}).describe('Sidebar group definitions, keyed by group slug (e.g. "metadata"). Resources reference a group via sidebar.group in their resource.json.'),
|
|
4487
4487
|
autoSave: import_zod48.z.boolean().default(true).describe("Whether form fields are saved automatically as the user edits them. Default true."),
|
|
4488
|
-
i18n: I18nConfigSchema.optional().describe("Optional i18n / translation configuration. Omit if the app is single-language.")
|
|
4488
|
+
i18n: I18nConfigSchema.optional().describe("Optional i18n / translation configuration. Omit if the app is single-language."),
|
|
4489
|
+
agentFiles: import_zod48.z.object({
|
|
4490
|
+
targets: import_zod48.z.array(import_zod48.z.enum(["claude", "cursor"])).optional().describe("Which agent file sets to manage. Defaults to those already present in the project, or both on first run.")
|
|
4491
|
+
}).optional().describe("Agent file sync configuration for `crouton migrate`. Stored after the first run.")
|
|
4489
4492
|
});
|
|
4490
4493
|
|
|
4491
4494
|
// src/lib/config/readConfig.ts
|