@samva/cli 0.20.0 → 0.22.0
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/AGENTS.md +11 -3
- package/dist/bin.mjs +775 -234
- package/package.json +8 -8
package/AGENTS.md
CHANGED
|
@@ -60,7 +60,10 @@ The developer loop for a template project is `samva templates dev` (the local vi
|
|
|
60
60
|
`vite.config.ts`), `check` (type-check, compile, and render every fixture), `render <template>
|
|
61
61
|
--fixture <name>` (subject, preheader, and plain-text body; `--format html`, `--channel sms|whatsapp`),
|
|
62
62
|
and `snapshot <template> --fixture <name>` (desktop and mobile PNGs, light and dark, in
|
|
63
|
-
`.samva/snapshots`, needing `playwright` in the project or a system Chrome
|
|
63
|
+
`.samva/snapshots`, needing `playwright` in the project or a system Chrome; imported images come
|
|
64
|
+
from the project's own files unless an HTTPS `--asset-base` is given). The commands run the project's
|
|
65
|
+
installed `@samva/markup` and `@samva/vite`, which must be on the release line the CLI drives; any
|
|
66
|
+
other line stops with the `npm install` command that fixes it. With `--json`, every
|
|
64
67
|
finding carries `code`, `severity`, `message`, `file`, `line`/`column`, `range`, and, where the
|
|
65
68
|
compiler has them, `fix`, a machine-applicable `edit`, and `upgrade`, the instructions for migrating
|
|
66
69
|
a template written in a format the compiler rejects. Templates live in `templates/` and
|
|
@@ -94,7 +97,8 @@ and finish it in the other; `add-asset` alone has no MCP twin, because a chat cl
|
|
|
94
97
|
bytes to send. Every subcommand prints its complete
|
|
95
98
|
result as JSON because these outputs — revisions, digests, diagnostics — are inputs to the next
|
|
96
99
|
call. `open` returns the revision every other subcommand is fenced to; a workspace that moved refuses
|
|
97
|
-
them, and reopening is the recovery.
|
|
100
|
+
them, and reopening is the recovery. The reads (`diff`, `check`, `fixture`) fence to the current
|
|
101
|
+
revision when `--revision` is omitted. A source that does not build is a successful call carrying a
|
|
98
102
|
null declaration and located findings, not a failed one. `add-asset <template-id> <file>` writes one
|
|
99
103
|
image or font as unsaved bytes at `assets/<file name>` unless `--path` names another project path;
|
|
100
104
|
`--replace` is required to change a path that already holds a file. The Git commands remain the way
|
|
@@ -110,7 +114,11 @@ CSS of the brand `--brand <slug>` names, or of the default brand. `--dry-run` va
|
|
|
110
114
|
catalog: the input each published template accepts, and the reference a send carries. The default
|
|
111
115
|
reference is each template's current publication, so a generated file keeps sending the same
|
|
112
116
|
message until it is regenerated; `--reference contract-latest` follows new publications while the
|
|
113
|
-
input contract holds. `--
|
|
117
|
+
input contract holds. `--by slug` writes the helper for callers that send by template slug: it
|
|
118
|
+
returns `{ templateSlug, templateData }`, renders the template's current publication (the API takes a
|
|
119
|
+
publication or contract reference only beside a template id), types the input from the current input
|
|
120
|
+
contract, and refuses `--reference`. Both modes export `TemplateSlug`, and `templateData` is typed to
|
|
121
|
+
what `email.send` accepts. `--check` writes nothing and exits `1` when the file no longer describes the
|
|
114
122
|
catalog, naming what moved. A schema the generator cannot express as a checking type is refused
|
|
115
123
|
with the template and the JSON pointer rather than generated as `unknown`.
|
|
116
124
|
|