@wix/himalaya-cli 0.838.0 → 0.839.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/dist/cli.mjs +205 -116
- package/guides/cms-collections.md +65 -9
- package/guides/wix-site-to-himi-app.md +3 -1
- package/package.json +2 -2
|
@@ -84,8 +84,9 @@ An adopted `wixId` declaration is **optional for reads**. A worker may call
|
|
|
84
84
|
read even when `config.ts` has no `cms` block; declaring it records the expected
|
|
85
85
|
schema for humans and `himi validate`, but does not grant or enable that read.
|
|
86
86
|
|
|
87
|
-
`himi cms query` labels every collection on the site `owned`, `adopted`, or
|
|
88
|
-
`foreign`, so the blast radius is visible before you run anything.
|
|
87
|
+
`himi cms query --all` labels every collection on the site `owned`, `adopted`, or
|
|
88
|
+
`foreign`, so the blast radius is visible before you run anything. (Without `--all`
|
|
89
|
+
it reads only the ids you declare — see [below](#himi-cms-query--read-only).)
|
|
89
90
|
|
|
90
91
|
### `site analyze --apply` adopts, it never claims
|
|
91
92
|
|
|
@@ -275,7 +276,8 @@ boots as — an unauthenticated visitor — rather than as one it has no way to
|
|
|
275
276
|
export WIX_SITE_ID=<msid> # or pass --site <msid> to every command
|
|
276
277
|
|
|
277
278
|
himi validate # offline: prefix, field types, displayField, seed keys, permissions
|
|
278
|
-
himi cms query
|
|
279
|
+
himi cms query --all # READ-ONLY: what the SITE has, including collections you never declared
|
|
280
|
+
himi cms query # READ-ONLY: just your declared ids — what exists, who owns it, where it drifts
|
|
279
281
|
himi cms create # provision the owned collections (idempotent)
|
|
280
282
|
himi cms seed # fill the EMPTY owned collections from `seed:`
|
|
281
283
|
himi push --draft # ship the content package; does NOT touch the site
|
|
@@ -287,13 +289,67 @@ publishing a release is exactly the surprise this design avoids.
|
|
|
287
289
|
|
|
288
290
|
### `himi cms query` — read-only
|
|
289
291
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
it after `create` to confirm.
|
|
292
|
+
**By default it reads only the ids you declared.** One targeted `GET` per declared
|
|
293
|
+
collection, and the report says so with `siteScanned: false`. You get item counts and
|
|
294
|
+
a `drift` list: declared-but-missing collections, missing fields, undeclared extra
|
|
295
|
+
fields, and type mismatches. Run it first, and run it after `create` to confirm.
|
|
294
296
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
+
The default never lists the site, so it cannot show you a collection you did not
|
|
298
|
+
declare — **including one this app owns**. A leftover `himi_<app>_*` from a renamed
|
|
299
|
+
declaration is labeled `owned` when the scan finds it, but only `--all` looks.
|
|
300
|
+
|
|
301
|
+
The default stays off the site-wide list on purpose: that list is ~1MB and 46–60s on
|
|
302
|
+
a real site (194 collections on one test site) and its socket gets reset mid-transfer,
|
|
303
|
+
while the per-id reads it actually needs are ~3KB each.
|
|
304
|
+
|
|
305
|
+
#### `--all` — scan the site and discover what to adopt
|
|
306
|
+
|
|
307
|
+
`himi cms query --all --site <msid>` additionally lists the whole site and describes
|
|
308
|
+
every **foreign** collection — one this app neither owns nor declares:
|
|
309
|
+
|
|
310
|
+
```json
|
|
311
|
+
{
|
|
312
|
+
"siteScanned": true,
|
|
313
|
+
"foreign": {
|
|
314
|
+
"count": 31,
|
|
315
|
+
"collections": [
|
|
316
|
+
{ "id": "QaRecipes", "displayName": "Recipes", "readRole": "ANYONE", "itemCount": null,
|
|
317
|
+
"fields": [ { "key": "title", "type": "TEXT" }, { "key": "cookMinutes", "type": "NUMBER" } ] }
|
|
318
|
+
],
|
|
319
|
+
"truncated": 6
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
That is enough to write the adopted declaration without a second call: `wixId` is the
|
|
325
|
+
`id`, and the `fields` carry the keys **and** the types a declaration must mirror (Wix
|
|
326
|
+
cannot retype a field in place, so a wrong type is a refusal, not a warning). A field
|
|
327
|
+
with no `type` is one the site did not report a type for — read that collection directly
|
|
328
|
+
before declaring it, rather than guessing; the scan will not invent one for you.
|
|
329
|
+
|
|
330
|
+
- **It works with no `cms` block at all.** Discovering what to declare is precisely the
|
|
331
|
+
case where nothing is declared yet, so `--all` is the one flag for which a missing
|
|
332
|
+
`cms` block is *not* "nothing to do".
|
|
333
|
+
- **Foreign collections are never item-counted** (`itemCount: null`). A row count is one
|
|
334
|
+
query each, and fanning that across a whole site is the cost this scan must not pay.
|
|
335
|
+
Declare or adopt the collection and the count arrives with the next `himi cms query`.
|
|
336
|
+
- **Only the first 25 are described.** `foreign.count` is how many the scan listed and
|
|
337
|
+
`foreign.truncated` says how many of those went undescribed, so a short list is never
|
|
338
|
+
mistaken for a short site. For the full per-collection picture — field types,
|
|
339
|
+
read/write roles and sample rows — use
|
|
340
|
+
[`himi site analyze --site <msid>`](wix-business-context.md).
|
|
341
|
+
- **`foreign.count` is not a site census.** `GET /data/v2/collections` is paged and this
|
|
342
|
+
scan reads one page. When Wix reports a total larger than that page,
|
|
343
|
+
`unlistedCollections` says how many the listing left out; when Wix reports no total,
|
|
344
|
+
neither field can tell you, so treat `foreign.count` as "foreign collections in what we
|
|
345
|
+
listed" and use `site analyze` if you need certainty about a very large site.
|
|
346
|
+
|
|
347
|
+
**The scan is owner-scoped, and there is no tokenless alternative.** It needs
|
|
348
|
+
`--site <msid>` (or `WIX_SITE_ID`) and owner auth via `wix token`, because enumerating
|
|
349
|
+
collections is `GET /data/v2/collections`, which requires the *Manage Data
|
|
350
|
+
Collections* scope. A visitor/anonymous token can read the **items** of an
|
|
351
|
+
`ANYONE`-read collection whose id you already have, but it can never list collections —
|
|
352
|
+
so no CLI work can make the tokenless path discover them.
|
|
297
353
|
|
|
298
354
|
### `himi cms create` — additive and idempotent
|
|
299
355
|
|
|
@@ -184,7 +184,9 @@ images stay as `static.wixstatic.com` URLs in descriptors — do not vendor
|
|
|
184
184
|
|
|
185
185
|
### 4. CMS, verticals, forms, pages
|
|
186
186
|
|
|
187
|
-
- **CMS the site already has** — `himi cms query
|
|
187
|
+
- **CMS the site already has** — `himi cms query --all --site <msid>` (owner-scoped;
|
|
188
|
+
it is the only door that reveals a collection id you do not already know), then
|
|
189
|
+
**adopt** with `wixId` in
|
|
188
190
|
`config.ts` (`himi docs cms-collections`). Read-only. Never seed or alter a
|
|
189
191
|
collection you did not create. Create `himi_<appSlug>_*` only for storage the
|
|
190
192
|
site does not have.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.839.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"artifactId": "himalaya-cli"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"falconPackageHash": "
|
|
66
|
+
"falconPackageHash": "5de4fef57d6c6e87d57791a1f1af4e7bd241ef8902a4fbb3292442a0"
|
|
67
67
|
}
|