@vnejs/bridge.plugins.views.scenario.interface.plugins.text.wall 0.0.0-stage → 0.2.4

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.
@@ -0,0 +1,2 @@
1
+ import "@vnejs/contracts.text.wall";
2
+ import "@vnejs/contracts.views.scenario.interface";
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import "@vnejs/contracts.text.wall";
2
+ import "@vnejs/contracts.views.scenario.interface";
3
+ import { regPlugin } from "@vnejs/registry";
4
+ import { BridgePluginInterfacePluginTextWall } from "./modules/bridge_plugin_interface_plugin_text_wall.js";
5
+ const PLUGIN_NAME = "BRIDGE_PLUGIN_INTERFACE_PLUGIN_TEXT_WALL";
6
+ regPlugin(PLUGIN_NAME, {}, [BridgePluginInterfacePluginTextWall]);
@@ -0,0 +1,8 @@
1
+ import { ModuleCore } from "@vnejs/module.core";
2
+ import type { TextWallChangedPayload } from "@vnejs/contracts.text.wall";
3
+ import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "../types.js";
4
+ export declare class BridgePluginInterfacePluginTextWall extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
5
+ name: string;
6
+ subscribe: () => void;
7
+ onTextWallChanged: ({ wall }?: TextWallChangedPayload) => Promise<import("@vnejs/registry").EmitResults<"vne:interface:wall_changed">> | undefined;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ModuleCore } from "@vnejs/module.core";
2
+ export class BridgePluginInterfacePluginTextWall extends ModuleCore {
3
+ name = "bridge_plugin_interface_plugin_text_wall";
4
+ subscribe = () => {
5
+ this.on(this.EVENTS.TEXT_WALL.CHANGED, this.onTextWallChanged);
6
+ };
7
+ onTextWallChanged = ({ wall = [] } = {}) => this.emit(this.EVENTS.INTERFACE.WALL_CHANGED, { wall });
8
+ }
@@ -0,0 +1,7 @@
1
+ import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
2
+ import type { PluginName as InterfacePluginName, SubscribeEvents as InterfaceSubscribeEvents } from "@vnejs/contracts.views.scenario.interface";
3
+ import type { PluginName as TextWallPluginName, SubscribeEvents as TextWallSubscribeEvents } from "@vnejs/contracts.text.wall";
4
+ export type PluginEvents = ModuleCoreEvents & Record<TextWallPluginName, TextWallSubscribeEvents> & Record<InterfacePluginName, InterfaceSubscribeEvents>;
5
+ export type PluginConstants = ModuleCoreConstants;
6
+ export type PluginSettings = ModuleCoreSettings;
7
+ export type PluginParams = ModuleCoreParams;
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@vnejs/bridge.plugins.views.scenario.interface.plugins.text.wall",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.4",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "src",
18
+ "tsconfig.json"
19
+ ],
20
+ "scripts": {
21
+ "test": "npx @vnejs/monorepo test",
22
+ "build": "npx @vnejs/monorepo package",
23
+ "publish:major:plugin": "npm run publish:major",
24
+ "publish:minor:plugin": "npm run publish:minor",
25
+ "publish:patch:plugin": "npm run publish:patch",
26
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
27
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
28
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
29
+ },
30
+ "author": "",
31
+ "license": "ISC",
32
+ "peerDependencies": {
33
+ "@vnejs/module.core": "~0.2.0",
34
+ "@vnejs/contracts.text.wall": "~0.2.0",
35
+ "@vnejs/contracts.views.scenario.interface": "~0.2.0",
36
+ "@vnejs/registry": "~0.2.0"
37
+ },
38
+ "devDependencies": {
39
+ "@vnejs/configs.ts-common": "~0.2.0",
40
+ "@vnejs/configs.vitest": "~0.2.0",
41
+ "@vnejs/test-utils": "~0.2.0"
42
+ }
43
+ }
package/src/index.ts ADDED
@@ -0,0 +1,10 @@
1
+ import "@vnejs/contracts.text.wall";
2
+ import "@vnejs/contracts.views.scenario.interface";
3
+
4
+ import { regPlugin } from "@vnejs/registry";
5
+
6
+ import { BridgePluginInterfacePluginTextWall } from "./modules/bridge_plugin_interface_plugin_text_wall.js";
7
+
8
+ const PLUGIN_NAME = "BRIDGE_PLUGIN_INTERFACE_PLUGIN_TEXT_WALL";
9
+
10
+ regPlugin(PLUGIN_NAME, {}, [BridgePluginInterfacePluginTextWall]);
@@ -0,0 +1,14 @@
1
+ import { ModuleCore } from "@vnejs/module.core";
2
+ import type { TextWallChangedPayload } from "@vnejs/contracts.text.wall";
3
+
4
+ import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "../types.js";
5
+
6
+ export class BridgePluginInterfacePluginTextWall extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
7
+ name = "bridge_plugin_interface_plugin_text_wall";
8
+
9
+ subscribe = () => {
10
+ this.on(this.EVENTS.TEXT_WALL.CHANGED, this.onTextWallChanged);
11
+ };
12
+
13
+ onTextWallChanged = ({ wall = [] }: TextWallChangedPayload = {}) => this.emit(this.EVENTS.INTERFACE.WALL_CHANGED, { wall });
14
+ }
@@ -0,0 +1,16 @@
1
+ import { SUBSCRIBE_EVENTS as TEXT_WALL_EVENTS, PLUGIN_NAME as TEXT_WALL } from "@vnejs/contracts.text.wall";
2
+ import { SUBSCRIBE_EVENTS as INTERFACE_EVENTS, PLUGIN_NAME as INTERFACE } from "@vnejs/contracts.views.scenario.interface";
3
+ import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/test-utils";
4
+
5
+ export const registerCompatibilityVne = () => {
6
+ registerCoreVne();
7
+ registerVnePlugin(TEXT_WALL, { events: TEXT_WALL_EVENTS });
8
+ registerVnePlugin(INTERFACE, { events: INTERFACE_EVENTS });
9
+ };
10
+
11
+ export const createCompatibilityTestModule = <T extends Parameters<typeof baseCreateTestModule>[0]>(
12
+ ModuleClass: T,
13
+ options: Parameters<typeof baseCreateTestModule>[1] = {},
14
+ ) => baseCreateTestModule(ModuleClass, options);
15
+
16
+ export { INTERFACE_EVENTS, TEXT_WALL_EVENTS };
@@ -0,0 +1,21 @@
1
+ import { beforeEach, describe, expect, it, vi } from "vitest";
2
+
3
+ import { spyEvent } from "@vnejs/test-utils";
4
+
5
+ import { BridgePluginInterfacePluginTextWall } from "../modules/bridge_plugin_interface_plugin_text_wall.js";
6
+ import { createCompatibilityTestModule, INTERFACE_EVENTS, registerCompatibilityVne, TEXT_WALL_EVENTS } from "./setup.js";
7
+
8
+ describe("BridgePluginInterfacePluginTextWall", () => {
9
+ beforeEach(() => registerCompatibilityVne());
10
+
11
+ it("TEXT_WALL.CHANGED forwards wall to INTERFACE.WALL_CHANGED", async () => {
12
+ const { observer } = createCompatibilityTestModule(BridgePluginInterfacePluginTextWall);
13
+ const changed = spyEvent(observer, INTERFACE_EVENTS.WALL_CHANGED);
14
+ const wall = [{ x: 1, y: 2 }];
15
+
16
+ await observer.emit(TEXT_WALL_EVENTS.CHANGED, { wall });
17
+
18
+ expect(changed).toHaveBeenCalledOnce();
19
+ expect(changed).toHaveBeenCalledWith({ wall });
20
+ });
21
+ });
package/src/types.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
2
+ import type { PluginName as InterfacePluginName, SubscribeEvents as InterfaceSubscribeEvents } from "@vnejs/contracts.views.scenario.interface";
3
+ import type { PluginName as TextWallPluginName, SubscribeEvents as TextWallSubscribeEvents } from "@vnejs/contracts.text.wall";
4
+
5
+ export type PluginEvents = ModuleCoreEvents & Record<TextWallPluginName, TextWallSubscribeEvents> & Record<InterfacePluginName, InterfaceSubscribeEvents>;
6
+
7
+ export type PluginConstants = ModuleCoreConstants;
8
+
9
+ export type PluginSettings = ModuleCoreSettings;
10
+
11
+ export type PluginParams = ModuleCoreParams;
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@vnejs/configs.ts-common/tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["dist", "node_modules", "src/tests"]
9
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.