@vnejs/plugins.vars.counters 0.1.20 → 0.2.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/modules/counters.js +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +10 -10
- package/src/modules/counters.ts +1 -1
- package/src/tests/setup.ts +1 -1
- package/src/types.ts +6 -2
package/dist/modules/counters.js
CHANGED
|
@@ -36,7 +36,7 @@ export class Counters extends ModuleCore {
|
|
|
36
36
|
const name = String(tokens[0] ?? "");
|
|
37
37
|
const action = String(tokens[1] ?? "");
|
|
38
38
|
const execValue = Number(tokens[2] ?? 0);
|
|
39
|
-
const isGlobal = keywords.includes(this.CONST.
|
|
39
|
+
const isGlobal = keywords.includes(this.CONST.VARS.LINE_KEYWORDS.GLOBAL);
|
|
40
40
|
const result = { name, action, isGlobal, execValue };
|
|
41
41
|
return withValue ? { ...result, value: Number(await this.emitOne(this.EVENTS.VARS_COUNTERS.GET, { name, isGlobal, state })) } : result;
|
|
42
42
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
-
import type { PluginName as VarsPluginName, SubscribeEvents as VarsSubscribeEvents } from "@vnejs/contracts.vars";
|
|
2
|
+
import type { Constants as VarsConstants, PluginName as VarsPluginName, SubscribeEvents as VarsSubscribeEvents } from "@vnejs/contracts.vars";
|
|
3
3
|
import type { Constants, PluginName, SubscribeEvents } from "@vnejs/contracts.vars.counters";
|
|
4
4
|
export type CountersPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<VarsPluginName, VarsSubscribeEvents>;
|
|
5
|
-
export type CountersPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
|
|
5
|
+
export type CountersPluginConstants = ModuleCoreConstants & Record<PluginName, Constants> & Record<VarsPluginName, VarsConstants>;
|
|
6
6
|
export type CountersPluginSettings = ModuleCoreSettings;
|
|
7
7
|
export type CountersPluginParams = ModuleCoreParams;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.vars.counters",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@vnejs/contracts.vars.counters": "~0.
|
|
33
|
+
"@vnejs/contracts.vars.counters": "~0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@vnejs/helpers": "~0.
|
|
37
|
-
"@vnejs/module.core": "~0.
|
|
38
|
-
"@vnejs/contracts.vars": "~0.
|
|
39
|
-
"@vnejs/shared": "~0.
|
|
36
|
+
"@vnejs/helpers": "~0.2.0",
|
|
37
|
+
"@vnejs/module.core": "~0.2.0",
|
|
38
|
+
"@vnejs/contracts.vars": "~0.2.0",
|
|
39
|
+
"@vnejs/shared": "~0.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@vnejs/configs.ts-common": "~0.
|
|
43
|
-
"@vnejs/configs.vitest": "~0.
|
|
44
|
-
"@vnejs/test-utils": "~0.
|
|
45
|
-
"@vnejs/contracts.vars": "~0.
|
|
42
|
+
"@vnejs/configs.ts-common": "~0.2.0",
|
|
43
|
+
"@vnejs/configs.vitest": "~0.2.0",
|
|
44
|
+
"@vnejs/test-utils": "~0.2.0",
|
|
45
|
+
"@vnejs/contracts.vars": "~0.2.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/src/modules/counters.ts
CHANGED
|
@@ -63,7 +63,7 @@ export class Counters extends ModuleCore<CountersPluginEvents, CountersPluginCon
|
|
|
63
63
|
const name = String(tokens[0] ?? "");
|
|
64
64
|
const action = String(tokens[1] ?? "");
|
|
65
65
|
const execValue = Number(tokens[2] ?? 0);
|
|
66
|
-
const isGlobal = keywords.includes(this.CONST.
|
|
66
|
+
const isGlobal = keywords.includes(this.CONST.VARS.LINE_KEYWORDS.GLOBAL);
|
|
67
67
|
const result: CountersExecInfoResult = { name, action, isGlobal, execValue };
|
|
68
68
|
|
|
69
69
|
return withValue ? { ...result, value: Number(await this.emitOne(this.EVENTS.VARS_COUNTERS.GET, { name, isGlobal, state })) } : result;
|
package/src/tests/setup.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { createTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/tes
|
|
|
4
4
|
|
|
5
5
|
export const registerCountersPluginVne = () => {
|
|
6
6
|
registerCoreVne();
|
|
7
|
-
registerVnePlugin(VARS, { events: VARS_EVENTS });
|
|
7
|
+
registerVnePlugin(VARS, { events: VARS_EVENTS, constants: VARS_CONST });
|
|
8
8
|
registerVnePlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS });
|
|
9
9
|
};
|
|
10
10
|
|
package/src/types.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
Constants as VarsConstants,
|
|
4
|
+
PluginName as VarsPluginName,
|
|
5
|
+
SubscribeEvents as VarsSubscribeEvents,
|
|
6
|
+
} from "@vnejs/contracts.vars";
|
|
3
7
|
import type { Constants, PluginName, SubscribeEvents } from "@vnejs/contracts.vars.counters";
|
|
4
8
|
|
|
5
9
|
export type CountersPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<VarsPluginName, VarsSubscribeEvents>;
|
|
6
10
|
|
|
7
|
-
export type CountersPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
|
|
11
|
+
export type CountersPluginConstants = ModuleCoreConstants & Record<PluginName, Constants> & Record<VarsPluginName, VarsConstants>;
|
|
8
12
|
|
|
9
13
|
export type CountersPluginSettings = ModuleCoreSettings;
|
|
10
14
|
|