@wix/himalaya-cli 0.1441.0 → 0.1442.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.
@@ -1,7 +1,7 @@
1
1
  import type { IncomingMessage, ServerResponse } from "node:http";
2
2
  import type { DerivedAppMeta } from "./app-module.js";
3
3
  import { type WixCachePolicy } from "./wix-cache-policy.js";
4
- import type { WixMockRule } from "./wix-gateway.js";
4
+ import type { NetMocksFile, WixMockRule } from "./wix-gateway.js";
5
5
  import { type UnmappedPushDestination } from "../../ts/src/wix-push-links.js";
6
6
  import type { PushConfig, FlagConfig, AppControl, TabBarConfig, DrawerConfig, SidebarConfig, SplashConfig, LocaleConfig, NavKind, OrientationConfig, StreamPolicy } from "@wix/himalaya/core";
7
7
  export type { PushConfig, FlagConfig, AppControl, TabBarConfig, DrawerConfig, SidebarConfig, SplashConfig, LocaleConfig, NavKind, OrientationConfig, StreamPolicy };
@@ -234,6 +234,31 @@ export interface ServedPush {
234
234
  */
235
235
  export declare function derivePushForApp(app: DerivedAppMeta, linkableScreens?: readonly LinkableScreen[]): ServedPush;
236
236
  export declare function deriveNavigationConfig(app: DerivedAppMeta, bundleCtx?: NavBundleContext): NavigationConfig;
237
+ /**
238
+ * Ship a package's checked-in net-mocks fixture to DEVICES (#4607).
239
+ *
240
+ * `dev/net-mocks.json` used to seed only the dev-server's in-process gateway, which answers
241
+ * the web bridge (web preview, `himi render`, `himi test`). A native DEBUG build never asks
242
+ * that gateway: it arms its scenario from the served `devGatewayConfig.rules`
243
+ * (`NetFake` / `NavigationConfigStore`), which came from config.ts alone. So one worker call
244
+ * was mocked on web and went to live Wix on iOS/Android Player.
245
+ *
246
+ * The file fills the device scenario only when the app declares none of its own: declared
247
+ * `rules` (or a `scenarioRef`) are the app's scenario and are served untouched, and
248
+ * `devGateway: { enabled: false }` — the real-site opt-out — stays out. The app's own keys
249
+ * (scope, redirect, mode, unmatched) win over the file's policy. An absent mode becomes
250
+ * `mock`, the default `applyNetMocks` gives the same fixture on the gateway.
251
+ *
252
+ * The dev-server passes a fixture only for a CONTENT PACKAGE, and only the one its gateway was
253
+ * seeded from at boot (index.ts `deviceNetMocks`), so web and device share one scenario. An in-repo
254
+ * shell wires its device scenario through `devGateway` itself.
255
+ *
256
+ * DEV-ONLY by construction: only the dev-server passes a fixture here, and a release strips
257
+ * the whole block (`withoutDevOnlyAppConfig`, tools/release-build/build.ts) unless the build
258
+ * is a local dev preview (`himi run --content`) or a DEBUG seed. Returns `config` unchanged
259
+ * when there is nothing to add; never mutates it.
260
+ */
261
+ export declare function withDevNetMocks(config: NavigationConfig, declared: DevGatewayConfig | undefined, fileMocks: NetMocksFile | null | undefined): NavigationConfig;
237
262
  export interface AppConfigDocument {
238
263
  config: NavigationConfig;
239
264
  body: string;
@@ -263,5 +288,7 @@ export declare function completeLinkableScreens<T extends {
263
288
  /** A merged (overridden) config with its linkable screens completed — ONE rule for every place that
264
289
  * shows or serves the effective config, so the admin view and the device payload cannot diverge. */
265
290
  export declare function withCompleteLinkables<T extends object>(cfg: T): T;
266
- export declare function buildAppConfigDocument(req: IncomingMessage, meta: DerivedAppMeta, override?: Record<string, unknown>, bundleCtx?: NavBundleContext): AppConfigDocument;
267
- export declare function handleAppConfigRequest(req: IncomingMessage, res: ServerResponse, meta: DerivedAppMeta, override?: Record<string, unknown>, bundleCtx?: NavBundleContext): void;
291
+ export declare function buildAppConfigDocument(req: IncomingMessage, meta: DerivedAppMeta, override?: Record<string, unknown>, bundleCtx?: NavBundleContext,
292
+ /** The package's checked-in net-mocks fixture, for a DEBUG device (#4607). Dev-server only. */
293
+ devNetMocks?: NetMocksFile | null): AppConfigDocument;
294
+ export declare function handleAppConfigRequest(req: IncomingMessage, res: ServerResponse, meta: DerivedAppMeta, override?: Record<string, unknown>, bundleCtx?: NavBundleContext, devNetMocks?: NetMocksFile | null): void;