@vnejs/plugins.views.achievement 0.2.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.views.achievement",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,6 +41,5 @@ export class AchievementController extends ModuleController<
41
41
  this.updateStateAndViewFast({ array: this.state.array?.filter((i) => i.id !== id) });
42
42
  };
43
43
 
44
- getIconSrc = async (icon = "") =>
45
- (await this.loadImageMedia(`achievement/${icon}`, "icons", this.shared.settings[this.SETTINGS.LAYER.QUALITY])).src;
44
+ getIconSrc = async (icon = "") => (await this.loadImageMedia(`achievement/${icon}`, "icons", this.shared.settings[this.SETTINGS.LAYER.QUALITY])).src;
46
45
  }
@@ -11,9 +11,7 @@ export class AchievementLogs extends ModuleCore<AchievementPluginEvents, Achieve
11
11
  this.on(this.EVENTS.ACHIEVEMENT.UNLOCKED, this.onAchievementUnlocked, this.CONST.LOGS.FILTER_FROM_RESULT_OPTIONS);
12
12
  };
13
13
 
14
- onAchievementLocked = ({ id = "" }: AchievementLockedPayload = {}) =>
15
- void this.emitLog({ action: this.CONST.ACHIEVEMENT.LOGS_ACTIONS.LOCKED, id });
14
+ onAchievementLocked = ({ id = "" }: AchievementLockedPayload = {}) => void this.emitLog({ action: this.CONST.ACHIEVEMENT.LOGS_ACTIONS.LOCKED, id });
16
15
 
17
- onAchievementUnlocked = ({ id = "" }: AchievementUnlockedPayload = {}) =>
18
- void this.emitLog({ action: this.CONST.ACHIEVEMENT.LOGS_ACTIONS.UNLOCKED, id });
16
+ onAchievementUnlocked = ({ id = "" }: AchievementUnlockedPayload = {}) => void this.emitLog({ action: this.CONST.ACHIEVEMENT.LOGS_ACTIONS.UNLOCKED, id });
19
17
  }
@@ -16,7 +16,7 @@ describe("AchievementExec", () => {
16
16
  const unlock = spyEvent(observer, SUBSCRIBE_EVENTS.UNLOCK);
17
17
 
18
18
  await (module as AchievementExec).init();
19
- await (module as AchievementExec).onLineExec({ line: 'unlock kekw', keywords: [] });
19
+ await (module as AchievementExec).onLineExec({ line: "unlock kekw", keywords: [] });
20
20
 
21
21
  expect(unlock).toHaveBeenCalledExactlyOnceWith({ id: "kekw", isSkipIfPossible: false });
22
22
  });
@@ -26,7 +26,7 @@ describe("AchievementExec", () => {
26
26
  const unlock = spyEvent(observer, SUBSCRIBE_EVENTS.UNLOCK);
27
27
 
28
28
  await (module as AchievementExec).onLineExec({
29
- line: 'unlock kekw',
29
+ line: "unlock kekw",
30
30
  keywords: [SCENARIO_CONST.LINE_KEYWORDS.SKIP_IF_POSSIBLE],
31
31
  });
32
32
 
@@ -37,7 +37,7 @@ describe("AchievementExec", () => {
37
37
  const { module, observer } = createAchievementTestModule(AchievementExec, { subscribe: false });
38
38
  const load = spyEvent(observer, SUBSCRIBE_EVENTS.LOAD);
39
39
 
40
- await (module as AchievementExec).onLineLoad({ line: 'unlock kekw' });
40
+ await (module as AchievementExec).onLineLoad({ line: "unlock kekw" });
41
41
 
42
42
  expect(load).toHaveBeenCalledOnce();
43
43
  });
@@ -48,7 +48,7 @@ describe("AchievementExec", () => {
48
48
 
49
49
  observer.subscribe("vne:scenario:next", next);
50
50
 
51
- await (module as AchievementExec).onLineExec({ line: 'unlock kekw' });
51
+ await (module as AchievementExec).onLineExec({ line: "unlock kekw" });
52
52
 
53
53
  expect(next).toHaveBeenCalledOnce();
54
54
  });
@@ -2,13 +2,7 @@ import { CONSTANTS as LAYER_CONST, PLUGIN_NAME as LAYER, SETTINGS_KEYS as LAYER_
2
2
  import { SUBSCRIBE_EVENTS as MEDIA_EVENTS } from "@vnejs/contracts.core.media";
3
3
  import { SUBSCRIBE_EVENTS as STORAGE_EVENTS } from "@vnejs/contracts.core.storage";
4
4
  import { CONSTANTS, PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.achievement";
5
- import {
6
- createTestModule as baseCreateTestModule,
7
- registerCoreVne,
8
- registerVnePlugin,
9
- stubEvent,
10
- stubSilentEvent,
11
- } from "@vnejs/test-utils";
5
+ import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin, stubEvent, stubSilentEvent } from "@vnejs/test-utils";
12
6
 
13
7
  export const registerAchievementPluginVne = () => {
14
8
  registerCoreVne();
package/src/types.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import type { ModuleComponentsConstants, ModuleComponentsEvents, ModuleComponentsParams, ModuleComponentsSettings } from "@vnejs/module.components";
2
2
  import type { Constants as LogsConstants, PluginName as LogsPluginName, SubscribeEvents as LogsSubscribeEvents } from "@vnejs/contracts.core.logs";
3
- import type { Constants as ScenarioConstants, PluginName as ScenarioPluginName, SubscribeEvents as ScenarioSubscribeEvents } from "@vnejs/contracts.core.scenario";
3
+ import type {
4
+ Constants as ScenarioConstants,
5
+ PluginName as ScenarioPluginName,
6
+ SubscribeEvents as ScenarioSubscribeEvents,
7
+ } from "@vnejs/contracts.core.scenario";
4
8
  import type { PluginName as StoragePluginName, SubscribeEvents as StorageSubscribeEvents } from "@vnejs/contracts.core.storage";
5
9
  import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.achievement";
6
10