@samva/cli 0.5.0 → 0.6.1
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 +7 -1
- package/README.md +13 -2
- package/dist/bin.mjs +5438 -4544
- package/package.json +13 -12
package/AGENTS.md
CHANGED
|
@@ -38,7 +38,7 @@ image or font as unsaved bytes at `assets/<file name>` unless `--path` names ano
|
|
|
38
38
|
`--replace` is required to change a path that already holds a file. The Git commands remain the way
|
|
39
39
|
to author a project you have cloned.
|
|
40
40
|
|
|
41
|
-
`samva brands pull [slug]` writes the brand snapshot `.samva/brands/<slug>.json` that
|
|
41
|
+
`samva brands pull [slug]` writes the brand snapshot `.samva/brands/<slug>.json` that the CLI
|
|
42
42
|
resolves `samva:brand` from offline; bare `pull` snapshots the default brand, and `theme.css` is
|
|
43
43
|
never written. Keep `.samva` gitignored. `samva brands push <file>` validates brand CSS locally,
|
|
44
44
|
exits `1` with located findings when it is outside the brand grammar, and otherwise replaces the
|
|
@@ -57,6 +57,8 @@ repository. `samva templates clone <project-or-template-id>` clones an existing
|
|
|
57
57
|
repository-local credential helper that exchanges Samva authorization for a short-lived,
|
|
58
58
|
repository-scoped credential; the token is never stored in the remote URL or Git config. Normal
|
|
59
59
|
`git fetch`, `git pull`, `git add`, `git commit`, and `git push` remain the synchronization commands.
|
|
60
|
+
A pushed commit is picked up on the next hosted workspace open; independent draft edits rebase,
|
|
61
|
+
and overlapping edits produce explicit conflicts.
|
|
60
62
|
Install from the project's lockfile (`bun install --frozen-lockfile` or `npm ci`) before `samva templates check` or `samva templates build`, then
|
|
61
63
|
publish a clean, pushed commit with `samva templates publish`. Publish checks that the selected
|
|
62
64
|
commit is an ancestor of the fetched `origin/<default-branch>` and creates an immutable receipt; it
|
|
@@ -72,3 +74,7 @@ when it is missing; other CLI commands are self-contained.
|
|
|
72
74
|
the matching platform-specific `@samva/cli-*` executable and falls back to the packaged JavaScript
|
|
73
75
|
CLI through Bun when npm omits optional dependencies. Depend on `@samva/cli`, never a native
|
|
74
76
|
artifact directly.
|
|
77
|
+
|
|
78
|
+
Keep Samva brand resolution in the CLI and pass `samvaBrandPlugin` to the project's authoring
|
|
79
|
+
toolchain, so standalone `@samva/vite` stays independent of Samva authentication and storage.
|
|
80
|
+
Standalone callers supply their own resolver. The README owns resolution order and configuration.
|
package/README.md
CHANGED
|
@@ -202,8 +202,11 @@ with relative asset URLs, plus `<fixture>.sms.txt` and `<fixture>.whatsapp.json`
|
|
|
202
202
|
Like `check` and `build`, it treats the current directory as the project: its `theme.css` themes
|
|
203
203
|
the export and `samva:brand` resolves live or from `.samva/brands`.
|
|
204
204
|
|
|
205
|
-
`git fetch`, `git pull`, `git add`, `git commit`, and `git push` are ordinary Git operations.
|
|
206
|
-
|
|
205
|
+
`git fetch`, `git pull`, `git add`, `git commit`, and `git push` are ordinary Git operations.
|
|
206
|
+
The next hosted workspace open picks up a pushed commit, rebases independent draft edits, and
|
|
207
|
+
records explicit conflicts for overlapping edits.
|
|
208
|
+
|
|
209
|
+
The CLI's `init` and `clone` commands configure the repository-local helper; `publish` does not push
|
|
207
210
|
for you. It accepts a clean commit that is reachable from the fetched `origin/<default-branch>`
|
|
208
211
|
and publishes that exact commit. A clone records its project in `samva.projectId`; pass
|
|
209
212
|
`--project-id` from a checkout that `samva templates init` or `clone` did not create.
|
|
@@ -218,6 +221,14 @@ automation path.
|
|
|
218
221
|
editor from the project's `@samva/vite/dev` under Node.js, with no `vite.config.ts`. It prints the
|
|
219
222
|
editor URL and runs until interrupted; `SIGINT` and `SIGTERM` close the server.
|
|
220
223
|
|
|
224
|
+
The CLI supplies Samva brand resolution to `dev`, `check`, `build`, `render`, `snapshot` and
|
|
225
|
+
`export`. An imported `samva:brand` uses `SAMVA_API_KEY` from the environment or project `.env`
|
|
226
|
+
(and `SAMVA_API_URL` for another endpoint), or `samva brands get --json` on `PATH` with your login
|
|
227
|
+
session. Live answers refresh `.samva/brands/<slug>.json`; an unavailable live brand falls back to
|
|
228
|
+
that snapshot with `brand-offline`. A changed live digest reports `brand-snapshot-stale`. With
|
|
229
|
+
neither a live answer nor a snapshot, the command fails with `brand-unavailable`. Keep `.samva/`
|
|
230
|
+
gitignored. Standalone `@samva/vite` callers configure a resolver themselves.
|
|
231
|
+
|
|
221
232
|
`samva templates check` runs the project's TypeScript configuration, then uses the project's
|
|
222
233
|
`@samva/vite/build` to compile every template, render every fixture, and report located findings
|
|
223
234
|
plus email-client compatibility findings. It writes no files and exits non-zero on TypeScript,
|