@wix/himalaya-cli 0.1701.0 → 0.1703.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/define-app.d.ts +7 -0
- 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 +19 -5
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{8155555b873d0194a45cb1fdbd06855900b3943c888ffa129ed48a373a32eb46.bin → df0422934aaa38861fe3fc040a30a521cc958ddcc9fee01e9202b3c6c5dbf4d6.bin} +1 -1
- package/dist/browser-plane/sw.js +7 -7
- package/dist/cli.mjs +4795 -3079
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/himi-json-output.md +36 -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/define-app.d.ts
CHANGED
|
@@ -241,6 +241,13 @@ export interface AppConfig {
|
|
|
241
241
|
* (`distAddRefusal`). A local build of the shell still uses `capabilities`.
|
|
242
242
|
*/
|
|
243
243
|
capabilityBase?: Capability[];
|
|
244
|
+
/**
|
|
245
|
+
* RFC 0080 — the app's own native extensions (`extensions/<name>/`, Swift + Kotlin action handlers),
|
|
246
|
+
* written by `himi ext create`. A `himi dist` build compiles each into the binary; a worker reaches
|
|
247
|
+
* one through `@ext/<name>`, and only from a screen whose `logicBundle.declaredCapabilities` lists
|
|
248
|
+
* `ext:<name with - as _>`. Names are lowercase letters, digits and single hyphens.
|
|
249
|
+
*/
|
|
250
|
+
extensions?: string[];
|
|
244
251
|
/**
|
|
245
252
|
* Per-capability permission prompt copy — the sentence the OS shows when the app asks for
|
|
246
253
|
* camera, location, photos, … (iOS usage strings). Served on app-config, so `himi dist` bakes
|
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;
|
|
@@ -8221,6 +8221,19 @@ function validateBase44Config(config) {
|
|
|
8221
8221
|
const dup = sameKindBase44Duplicate(b.entities);
|
|
8222
8222
|
if (dup) throw new Error(`defineApp: base44.entities: "${dup}": duplicate entity "${dup}" (entity-duplicate)`);
|
|
8223
8223
|
}
|
|
8224
|
+
function validateExtensions(extensions) {
|
|
8225
|
+
if (extensions === void 0) return;
|
|
8226
|
+
if (!Array.isArray(extensions)) throw new Error("defineApp: extensions must be an array of extension names.");
|
|
8227
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8228
|
+
for (const [i, name] of extensions.entries()) {
|
|
8229
|
+
if (typeof name !== "string" || !/^[a-z](?:[a-z0-9]|-(?=[a-z0-9])){1,39}$/.test(name)) {
|
|
8230
|
+
throw new Error(`defineApp: extensions[${i}] must be 2\u201340 lowercase letters, digits and single hyphens; got ${JSON.stringify(name)}.`);
|
|
8231
|
+
}
|
|
8232
|
+
if (seen.has(name)) throw new Error(`defineApp: extensions[${i}] repeats "${name}".`);
|
|
8233
|
+
seen.add(name);
|
|
8234
|
+
}
|
|
8235
|
+
if (extensions.length > 16) throw new Error("defineApp: an app may declare at most 16 extensions.");
|
|
8236
|
+
}
|
|
8224
8237
|
function validateConfigShape(config) {
|
|
8225
8238
|
if (!config.id || !/^[a-z0-9.]+$/.test(config.id)) {
|
|
8226
8239
|
throw new Error(
|
|
@@ -8240,6 +8253,7 @@ function validateConfigShape(config) {
|
|
|
8240
8253
|
if (config.distribution) {
|
|
8241
8254
|
validateDistribution(config.distribution, "defineApp: distribution");
|
|
8242
8255
|
}
|
|
8256
|
+
validateExtensions(config.extensions);
|
|
8243
8257
|
adoptedIdentity(config);
|
|
8244
8258
|
validateLadderConfig(config);
|
|
8245
8259
|
validateAuthGateScreen(config.auth);
|
|
@@ -14525,7 +14539,7 @@ function desugarSiteScreen(descriptor) {
|
|
|
14525
14539
|
};
|
|
14526
14540
|
}
|
|
14527
14541
|
function siteScreens(site, opts) {
|
|
14528
|
-
assertSiteShellConfig(site);
|
|
14542
|
+
assertSiteShellConfig(site, opts);
|
|
14529
14543
|
const form = opts?.form ?? "t3";
|
|
14530
14544
|
if (!SITE_SCREEN_FORMS.includes(form)) {
|
|
14531
14545
|
throw new Error(`site screen form ${JSON.stringify(form)} must be one of ${SITE_SCREEN_FORMS.join(", ")}`);
|
|
@@ -14632,8 +14646,8 @@ function siteSidebar(site) {
|
|
|
14632
14646
|
assertSiteShellConfig(site);
|
|
14633
14647
|
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
14648
|
}
|
|
14635
|
-
function siteNav(site) {
|
|
14636
|
-
assertSiteShellConfig(site);
|
|
14649
|
+
function siteNav(site, opts) {
|
|
14650
|
+
assertSiteShellConfig(site, opts);
|
|
14637
14651
|
const tabs = [];
|
|
14638
14652
|
const drawer = [];
|
|
14639
14653
|
for (const page of site.pages) {
|
|
@@ -14662,7 +14676,7 @@ function assertSitePage(page) {
|
|
|
14662
14676
|
throw new Error(`site page ${page.id} needs a title`);
|
|
14663
14677
|
}
|
|
14664
14678
|
}
|
|
14665
|
-
function assertSiteShellConfig(site) {
|
|
14679
|
+
function assertSiteShellConfig(site, opts) {
|
|
14666
14680
|
normalizeSiteOrigin(site.origin);
|
|
14667
14681
|
if (site.kind !== "wix" && site.kind !== "base44") {
|
|
14668
14682
|
throw new Error(`site kind ${JSON.stringify(site.kind)} must be "wix" or "base44"`);
|
|
@@ -14687,7 +14701,7 @@ function assertSiteShellConfig(site) {
|
|
|
14687
14701
|
if (site.menuSource !== void 0 && site.menuSource !== "contract" && site.menuSource !== "runtime") {
|
|
14688
14702
|
throw new Error(`site menuSource ${JSON.stringify(site.menuSource)} must be "contract" or "runtime"`);
|
|
14689
14703
|
}
|
|
14690
|
-
if (!site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
|
|
14704
|
+
if (opts?.requireTab !== false && !site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
|
|
14691
14705
|
throw new Error('a site shell needs at least one page with placement "tab"');
|
|
14692
14706
|
}
|
|
14693
14707
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2540494
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 23064
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/df0422934aaa38861fe3fc040a30a521cc958ddcc9fee01e9202b3c6c5dbf4d6.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-C_t7UQ95.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "df0422934aaa38861fe3fc040a30a521cc958ddcc9fee01e9202b3c6c5dbf4d6",
|
|
85
|
+
"file": "preview-deferred/df0422934aaa38861fe3fc040a30a521cc958ddcc9fee01e9202b3c6c5dbf4d6.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|