@wix/himalaya-cli 0.1701.0 → 0.1702.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +10 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +5 -5
- package/dist/cli.mjs +841 -254
- package/guides/himi-json-output.md +12 -0
- package/guides/release-notes.md +16 -0
- package/guides/wix-business-context.md +27 -2
- package/guides/wix-site-to-himi-app.md +2 -1
- package/package.json +2 -2
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ export declare function isDesugarableSiteScreen(descriptor: ScreenDescriptor): b
|
|
|
209
209
|
*/
|
|
210
210
|
export declare function desugarSiteScreen(descriptor: ScreenDescriptor): ScreenDescriptor;
|
|
211
211
|
/** Options for {@link siteScreens}. */
|
|
212
|
-
export interface SiteScreensOptions {
|
|
212
|
+
export interface SiteScreensOptions extends SiteShellCheckOptions {
|
|
213
213
|
/** Absent ⇒ `"t3"`. See {@link SiteScreenForm}. */
|
|
214
214
|
form?: SiteScreenForm;
|
|
215
215
|
}
|
|
@@ -254,9 +254,16 @@ export declare function siteNavKind(site: SiteShellConfig): "responsive" | "sing
|
|
|
254
254
|
export declare function siteSidebar(site: SiteShellConfig): NavTabItem[];
|
|
255
255
|
/** Tab-bar and drawer items for a site. Pages beyond {@link SITE_SHELL_MAX_TABS} that
|
|
256
256
|
* asked for a tab fall into the drawer rather than disappearing. */
|
|
257
|
-
export declare function siteNav(site: SiteShellConfig): {
|
|
257
|
+
export declare function siteNav(site: SiteShellConfig, opts?: SiteShellCheckOptions): {
|
|
258
258
|
tabs: NavTabItem[];
|
|
259
259
|
drawer: DrawerItem[];
|
|
260
260
|
};
|
|
261
|
+
/** Options for {@link assertSiteShellConfig} (and the builders that run it). */
|
|
262
|
+
export interface SiteShellCheckOptions {
|
|
263
|
+
/** Absent or `true` ⇒ at least one page must have `placement: "tab"`, as a site shell needs. A
|
|
264
|
+
* host whose own native screens own the tab bar (RFC 0079 phase 3 — branded-lite with website
|
|
265
|
+
* pages in its drawer) passes `false`: its site block may be drawer-only. */
|
|
266
|
+
requireTab?: boolean;
|
|
267
|
+
}
|
|
261
268
|
/** Throws with a legible message on a site description no shell can build from. */
|
|
262
|
-
export declare function assertSiteShellConfig(site: SiteShellConfig): void;
|
|
269
|
+
export declare function assertSiteShellConfig(site: SiteShellConfig, opts?: SiteShellCheckOptions): void;
|
|
@@ -14525,7 +14525,7 @@ function desugarSiteScreen(descriptor) {
|
|
|
14525
14525
|
};
|
|
14526
14526
|
}
|
|
14527
14527
|
function siteScreens(site, opts) {
|
|
14528
|
-
assertSiteShellConfig(site);
|
|
14528
|
+
assertSiteShellConfig(site, opts);
|
|
14529
14529
|
const form = opts?.form ?? "t3";
|
|
14530
14530
|
if (!SITE_SCREEN_FORMS.includes(form)) {
|
|
14531
14531
|
throw new Error(`site screen form ${JSON.stringify(form)} must be one of ${SITE_SCREEN_FORMS.join(", ")}`);
|
|
@@ -14632,8 +14632,8 @@ function siteSidebar(site) {
|
|
|
14632
14632
|
assertSiteShellConfig(site);
|
|
14633
14633
|
return site.pages.filter((page) => (page.placement ?? "tab") !== "overflow").map((page) => ({ id: page.id, screenId: siteScreenId(page), label: page.title, icon: page.icon ?? "globe" }));
|
|
14634
14634
|
}
|
|
14635
|
-
function siteNav(site) {
|
|
14636
|
-
assertSiteShellConfig(site);
|
|
14635
|
+
function siteNav(site, opts) {
|
|
14636
|
+
assertSiteShellConfig(site, opts);
|
|
14637
14637
|
const tabs = [];
|
|
14638
14638
|
const drawer = [];
|
|
14639
14639
|
for (const page of site.pages) {
|
|
@@ -14662,7 +14662,7 @@ function assertSitePage(page) {
|
|
|
14662
14662
|
throw new Error(`site page ${page.id} needs a title`);
|
|
14663
14663
|
}
|
|
14664
14664
|
}
|
|
14665
|
-
function assertSiteShellConfig(site) {
|
|
14665
|
+
function assertSiteShellConfig(site, opts) {
|
|
14666
14666
|
normalizeSiteOrigin(site.origin);
|
|
14667
14667
|
if (site.kind !== "wix" && site.kind !== "base44") {
|
|
14668
14668
|
throw new Error(`site kind ${JSON.stringify(site.kind)} must be "wix" or "base44"`);
|
|
@@ -14687,7 +14687,7 @@ function assertSiteShellConfig(site) {
|
|
|
14687
14687
|
if (site.menuSource !== void 0 && site.menuSource !== "contract" && site.menuSource !== "runtime") {
|
|
14688
14688
|
throw new Error(`site menuSource ${JSON.stringify(site.menuSource)} must be "contract" or "runtime"`);
|
|
14689
14689
|
}
|
|
14690
|
-
if (!site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
|
|
14690
|
+
if (opts?.requireTab !== false && !site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
|
|
14691
14691
|
throw new Error('a site shell needs at least one page with placement "tab"');
|
|
14692
14692
|
}
|
|
14693
14693
|
}
|