@vnejs/plugins.compatibility.choose.counters 0.1.1 → 0.1.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 +12 -0
- package/dist/index.js +8 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.js +4 -0
- package/package.json +29 -6
- package/src/index.ts +22 -0
- package/src/types.ts +16 -0
- package/tsconfig.json +6 -0
- package/index.js +0 -12
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Module } from "@vnejs/module";
|
|
2
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
3
|
+
type ChooseExecHandler = (payload: {
|
|
4
|
+
line?: string;
|
|
5
|
+
keywords?: string[];
|
|
6
|
+
}) => unknown;
|
|
7
|
+
export declare class CompatibilityChooseCounters extends Module<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
8
|
+
name: string;
|
|
9
|
+
init: () => Promise<unknown[]> | undefined;
|
|
10
|
+
onChooseExec: ({ line, keywords }?: Parameters<ChooseExecHandler>[0]) => Promise<unknown> | undefined;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Module } from "@vnejs/module";
|
|
2
|
+
import { regModule } from "@vnejs/shared";
|
|
3
|
+
export class CompatibilityChooseCounters extends Module {
|
|
4
|
+
name = "compatibility.choose.counters";
|
|
5
|
+
init = () => this.emit(this.EVENTS.CHOOSE.EXEC_REG, { module: this.CONST.VARS_COUNTERS.EXEC_NAME, handler: this.onChooseExec });
|
|
6
|
+
onChooseExec = ({ line = "", keywords = [] } = {}) => this.emitOne(this.EVENTS.VARS_COUNTERS.EXEC_CHECK, { line, keywords });
|
|
7
|
+
}
|
|
8
|
+
regModule(CompatibilityChooseCounters);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VnePluginConstantsMapRegistry, VnePluginEventsMapRegistry, VnePluginParamsMapRegistry, VnePluginSettingsMapRegistry } from "@vnejs/shared";
|
|
2
|
+
import type { PluginName as VarsCountersPluginName, Constants as VarsCountersConstants, SubscribeEvents as VarsCountersSubscribeEvents } from "@vnejs/plugins.vars.counters.contract";
|
|
3
|
+
declare const CHOOSE_EVENTS: {
|
|
4
|
+
readonly EXEC_REG: "vne:choose:exec_reg";
|
|
5
|
+
};
|
|
6
|
+
export type PluginEvents = VnePluginEventsMapRegistry & Record<"CHOOSE", typeof CHOOSE_EVENTS> & Record<VarsCountersPluginName, VarsCountersSubscribeEvents>;
|
|
7
|
+
export type PluginConstants = VnePluginConstantsMapRegistry & Record<VarsCountersPluginName, VarsCountersConstants>;
|
|
8
|
+
export type PluginSettings = VnePluginSettingsMapRegistry;
|
|
9
|
+
export type PluginParams = VnePluginParamsMapRegistry;
|
|
10
|
+
export {};
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.compatibility.choose.counters",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.1.2",
|
|
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
|
+
],
|
|
5
20
|
"scripts": {
|
|
6
21
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
+
"build": "npx @vnejs/monorepo package",
|
|
7
23
|
"publish:major:plugin": "npm run publish:major",
|
|
8
24
|
"publish:minor:plugin": "npm run publish:minor",
|
|
9
25
|
"publish:patch:plugin": "npm run publish:patch",
|
|
10
|
-
"publish:major": "
|
|
11
|
-
"publish:minor": "
|
|
12
|
-
"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"
|
|
13
29
|
},
|
|
14
30
|
"author": "",
|
|
15
31
|
"license": "ISC",
|
|
16
|
-
"
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@vnejs/module": "~0.0.1",
|
|
34
|
+
"@vnejs/plugins.vars.counters.contract": "~0.0.1",
|
|
35
|
+
"@vnejs/shared": "~0.0.9"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@vnejs/configs.ts-common": "~0.0.1"
|
|
39
|
+
}
|
|
17
40
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Module } from "@vnejs/module";
|
|
2
|
+
import { regModule } from "@vnejs/shared";
|
|
3
|
+
|
|
4
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
5
|
+
|
|
6
|
+
type ChooseExecHandler = (payload: { line?: string; keywords?: string[] }) => unknown;
|
|
7
|
+
|
|
8
|
+
type ChooseExecRegPayload = {
|
|
9
|
+
module?: string;
|
|
10
|
+
handler?: ChooseExecHandler;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export class CompatibilityChooseCounters extends Module<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
14
|
+
name = "compatibility.choose.counters";
|
|
15
|
+
|
|
16
|
+
init = () => this.emit(this.EVENTS.CHOOSE.EXEC_REG, { module: this.CONST.VARS_COUNTERS.EXEC_NAME, handler: this.onChooseExec } satisfies ChooseExecRegPayload);
|
|
17
|
+
|
|
18
|
+
onChooseExec = ({ line = "", keywords = [] }: Parameters<ChooseExecHandler>[0] = {}) =>
|
|
19
|
+
this.emitOne(this.EVENTS.VARS_COUNTERS.EXEC_CHECK, { line, keywords });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
regModule(CompatibilityChooseCounters);
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { VnePluginConstantsMapRegistry, VnePluginEventsMapRegistry, VnePluginParamsMapRegistry, VnePluginSettingsMapRegistry } from "@vnejs/shared";
|
|
2
|
+
import type { PluginName as VarsCountersPluginName, Constants as VarsCountersConstants, SubscribeEvents as VarsCountersSubscribeEvents } from "@vnejs/plugins.vars.counters.contract";
|
|
3
|
+
|
|
4
|
+
const CHOOSE_EVENTS = {
|
|
5
|
+
EXEC_REG: "vne:choose:exec_reg",
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export type PluginEvents = VnePluginEventsMapRegistry &
|
|
9
|
+
Record<"CHOOSE", typeof CHOOSE_EVENTS> &
|
|
10
|
+
Record<VarsCountersPluginName, VarsCountersSubscribeEvents>;
|
|
11
|
+
|
|
12
|
+
export type PluginConstants = VnePluginConstantsMapRegistry & Record<VarsCountersPluginName, VarsCountersConstants>;
|
|
13
|
+
|
|
14
|
+
export type PluginSettings = VnePluginSettingsMapRegistry;
|
|
15
|
+
|
|
16
|
+
export type PluginParams = VnePluginParamsMapRegistry;
|
package/tsconfig.json
ADDED
package/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Module } from "@vnejs/module";
|
|
2
|
-
import { regModule } from "@vnejs/shared";
|
|
3
|
-
|
|
4
|
-
export class CompatibilityChooseCounters extends Module {
|
|
5
|
-
name = "compatibility.choose.counters";
|
|
6
|
-
|
|
7
|
-
init = () => this.emit(this.EVENTS.CHOOSE.EXEC_REG, { module: this.CONST.VARS_COUNTERS.EXEC_NAME, handler: this.onChooseExec });
|
|
8
|
-
|
|
9
|
-
onChooseExec = ({ line = "", keywords = [] } = {}) => this.emitOne(this.EVENTS.VARS_COUNTERS.EXEC_CHECK, { line, keywords });
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
regModule(CompatibilityChooseCounters);
|