@vnejs/compatibility.text-with-scenario.autoread 0.2.0 → 0.2.2

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import "@vnejs/contracts.text";
3
3
  import { ModuleCore } from "@vnejs/module.core";
4
4
  import type { AutoreadSourcePayload } from "@vnejs/contracts.scenario.autoread";
5
5
  import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
6
- export declare class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
6
+ export declare class CompatibilityTextWithScenarioAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
7
7
  name: string;
8
8
  sourceArg: AutoreadSourcePayload;
9
9
  subscribe: () => void;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import "@vnejs/contracts.scenario.autoread";
2
2
  import "@vnejs/contracts.text";
3
3
  import { ModuleCore } from "@vnejs/module.core";
4
4
  import { regModule } from "@vnejs/shared";
5
- export class CompatibilityTextAutoread extends ModuleCore {
5
+ export class CompatibilityTextWithScenarioAutoread extends ModuleCore {
6
6
  name = "compatibility.text-with-scenario.autoread";
7
7
  sourceArg = { source: this.CONST.TEXT.SOURCE };
8
8
  subscribe = () => {
@@ -12,4 +12,4 @@ export class CompatibilityTextAutoread extends ModuleCore {
12
12
  onTextEmit = () => this.emit(this.EVENTS.AUTOREAD.PUSH, this.sourceArg);
13
13
  onTextEmitEnd = () => this.emit(this.EVENTS.AUTOREAD.POP, this.sourceArg);
14
14
  }
15
- regModule(CompatibilityTextAutoread);
15
+ regModule(CompatibilityTextWithScenarioAutoread);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/compatibility.text-with-scenario.autoread",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -7,7 +7,7 @@ import { regModule } from "@vnejs/shared";
7
7
 
8
8
  import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
9
9
 
10
- export class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
10
+ export class CompatibilityTextWithScenarioAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
11
11
  name = "compatibility.text-with-scenario.autoread";
12
12
 
13
13
  sourceArg: AutoreadSourcePayload = { source: this.CONST.TEXT.SOURCE };
@@ -21,4 +21,4 @@ export class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginCo
21
21
  onTextEmitEnd = () => this.emit(this.EVENTS.AUTOREAD.POP, this.sourceArg);
22
22
  }
23
23
 
24
- regModule(CompatibilityTextAutoread);
24
+ regModule(CompatibilityTextWithScenarioAutoread);
@@ -2,16 +2,16 @@ import { beforeEach, describe, expect, it } from "vitest";
2
2
 
3
3
  import { spyEvent } from "@vnejs/test-utils";
4
4
 
5
- import { CompatibilityTextAutoread } from "../index.js";
5
+ import { CompatibilityTextWithScenarioAutoread } from "../index.js";
6
6
  import { AUTOREAD_EVENTS, createCompatibilityTestModule, registerCompatibilityVne, TEXT_CONST, TEXT_EVENTS } from "./setup.js";
7
7
 
8
- describe("CompatibilityTextAutoread", () => {
8
+ describe("CompatibilityTextWithScenarioAutoread", () => {
9
9
  beforeEach(() => {
10
10
  registerCompatibilityVne();
11
11
  });
12
12
 
13
13
  it("TEXT.EMIT emits AUTOREAD.PUSH with text source", async () => {
14
- const { observer } = createCompatibilityTestModule(CompatibilityTextAutoread);
14
+ const { observer } = createCompatibilityTestModule(CompatibilityTextWithScenarioAutoread);
15
15
  const push = spyEvent(observer, AUTOREAD_EVENTS.PUSH);
16
16
 
17
17
  await observer.emit(TEXT_EVENTS.EMIT);
@@ -21,7 +21,7 @@ describe("CompatibilityTextAutoread", () => {
21
21
  });
22
22
 
23
23
  it("TEXT.EMIT_END emits AUTOREAD.POP with text source", async () => {
24
- const { observer } = createCompatibilityTestModule(CompatibilityTextAutoread);
24
+ const { observer } = createCompatibilityTestModule(CompatibilityTextWithScenarioAutoread);
25
25
  const pop = spyEvent(observer, AUTOREAD_EVENTS.POP);
26
26
 
27
27
  await observer.emit(TEXT_EVENTS.EMIT_END);
@@ -1,5 +1,16 @@
1
- import { PARAMS as AUTOREAD_PARAMS, PLUGIN_NAME as AUTOREAD, SETTINGS_KEYS as AUTOREAD_SETTINGS, SUBSCRIBE_EVENTS as AUTOREAD_EVENTS } from "@vnejs/contracts.scenario.autoread";
2
- import { CONSTANTS as TEXT_CONST, PARAMS as TEXT_PARAMS, PLUGIN_NAME as TEXT, SETTINGS_KEYS as TEXT_SETTINGS, SUBSCRIBE_EVENTS as TEXT_EVENTS } from "@vnejs/contracts.text";
1
+ import {
2
+ PARAMS as AUTOREAD_PARAMS,
3
+ PLUGIN_NAME as AUTOREAD,
4
+ SETTINGS_KEYS as AUTOREAD_SETTINGS,
5
+ SUBSCRIBE_EVENTS as AUTOREAD_EVENTS,
6
+ } from "@vnejs/contracts.scenario.autoread";
7
+ import {
8
+ CONSTANTS as TEXT_CONST,
9
+ PARAMS as TEXT_PARAMS,
10
+ PLUGIN_NAME as TEXT,
11
+ SETTINGS_KEYS as TEXT_SETTINGS,
12
+ SUBSCRIBE_EVENTS as TEXT_EVENTS,
13
+ } from "@vnejs/contracts.text";
3
14
  import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/test-utils";
4
15
 
5
16
  export const registerCompatibilityVne = () => {
package/src/types.ts CHANGED
@@ -2,9 +2,7 @@ import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCor
2
2
  import type { PluginName as AutoreadPluginName, SubscribeEvents as AutoreadSubscribeEvents } from "@vnejs/contracts.scenario.autoread";
3
3
  import type { Constants as TextConstants, PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/contracts.text";
4
4
 
5
- export type PluginEvents = ModuleCoreEvents &
6
- Record<TextPluginName, TextSubscribeEvents> &
7
- Record<AutoreadPluginName, AutoreadSubscribeEvents>;
5
+ export type PluginEvents = ModuleCoreEvents & Record<TextPluginName, TextSubscribeEvents> & Record<AutoreadPluginName, AutoreadSubscribeEvents>;
8
6
 
9
7
  export type PluginConstants = ModuleCoreConstants & Record<TextPluginName, TextConstants>;
10
8