@evitcastudio/kit 3.4.0 → 3.6.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/lib/bundle/cli/cli.js +3 -3
- package/lib/events/event-system.d.ts +2 -3
- package/lib/events/event-system.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/kit.d.ts +5 -6
- package/lib/kit.d.ts.map +1 -1
- package/lib/kit.js +10 -5
- package/lib/plugins/kit-plugin.d.ts +1 -1
- package/lib/plugins/kit-plugin.d.ts.map +1 -1
- package/lib/types/shared-types.d.ts +8 -3
- package/lib/types/shared-types.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/bundle/cli/cli.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
/*!
|
|
5
|
-
* @evitcastudio/kit@3.
|
|
6
|
-
* Compiled Fri, 11 Sep 2026
|
|
5
|
+
* @evitcastudio/kit@3.6.0 git+https://github.com/EvitcaStudio/Kit.git
|
|
6
|
+
* Compiled Fri, 11 Sep 2026 04:43:34 UTC
|
|
7
7
|
* Copyright (c) 2026 Jared Bates, Evitca Studio, "doubleactii"
|
|
8
8
|
*
|
|
9
9
|
* @evitcastudio/kit is licensed under the MIT License.
|
|
@@ -11486,7 +11486,7 @@ import os2 from "os";
|
|
|
11486
11486
|
// package.json
|
|
11487
11487
|
var package_default = {
|
|
11488
11488
|
name: "@evitcastudio/kit",
|
|
11489
|
-
version: "3.
|
|
11489
|
+
version: "3.6.0",
|
|
11490
11490
|
author: "doubleactii 56242467+doubleactii@users.noreply.github.com (https://evitcastudio.com)",
|
|
11491
11491
|
main: "./lib/index.js",
|
|
11492
11492
|
types: "./lib/index.d.ts",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { EmitterEvent, Listener } from '../types/shared-types';
|
|
2
|
-
import type { KitPlugin } from '../plugins/kit-plugin';
|
|
1
|
+
import type { EmitterEvent, Listener, KitPluginLike } from '../types/shared-types';
|
|
3
2
|
export declare class EventEmitter {
|
|
4
3
|
private listener;
|
|
5
4
|
private plugin;
|
|
6
|
-
constructor(pListener: Listener, pPlugin:
|
|
5
|
+
constructor(pListener: Listener, pPlugin: KitPluginLike);
|
|
7
6
|
/**
|
|
8
7
|
* Emit an event to all listeners.
|
|
9
8
|
* @param pEvent - The event to emit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-system.d.ts","sourceRoot":"","sources":["../../src/events/event-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"event-system.d.ts","sourceRoot":"","sources":["../../src/events/event-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnF,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,MAAM,CAAgB;gBAElB,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa;IAKvD;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;CAcnC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Kit } from './kit';
|
|
2
2
|
export { EventEmitter } from './events/event-system';
|
|
3
|
-
export type { EmitterEvent, ResourceData, Listener, KitPluginConstructor } from './types/shared-types';
|
|
3
|
+
export type { EmitterEvent, ResourceData, Listener, KitPluginLike, KitPluginConstructor } from './types/shared-types';
|
|
4
4
|
export type { Client, Diob } from './types/vylo';
|
|
5
5
|
export { KitPlugin } from './plugins/kit-plugin';
|
|
6
6
|
export { Network } from './plugins/network';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACtH,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACH,MAAM,EACN,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,aAAa,EAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACR,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,UAAU,EACb,MAAM,kBAAkB,CAAC"}
|
package/lib/kit.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ResourceData, Listener, KitPluginConstructor } from './types/shared-types';
|
|
1
|
+
import type { ResourceData, Listener, KitPluginConstructor, KitPluginLike } from './types/shared-types';
|
|
3
2
|
export declare class Kit {
|
|
4
3
|
/**
|
|
5
4
|
* A record of all plugins registered with the Kit class.
|
|
@@ -19,18 +18,18 @@ export declare class Kit {
|
|
|
19
18
|
* @deprecated Use `registerPlugin` instead.
|
|
20
19
|
* @param pPlugins - An array of plugins to initialize.
|
|
21
20
|
*/
|
|
22
|
-
static init<T
|
|
21
|
+
static init<T>(pPlugins: KitPluginConstructor<T>[]): void;
|
|
23
22
|
/**
|
|
24
23
|
* Register a plugin with the Kit class.
|
|
25
24
|
* @param pPlugin - The plugin to register.
|
|
26
25
|
*/
|
|
27
|
-
static registerPlugin<T
|
|
28
|
-
static registerPlugin<T
|
|
26
|
+
static registerPlugin<T>(pPlugin: KitPluginConstructor<T>): T;
|
|
27
|
+
static registerPlugin<T>(pPlugin: KitPluginConstructor<T>[]): T[];
|
|
29
28
|
/**
|
|
30
29
|
* Gets a plugin by name.
|
|
31
30
|
* @param pName - String name of the plugin to retrieve.
|
|
32
31
|
*/
|
|
33
|
-
static getPlugin<T
|
|
32
|
+
static getPlugin<T = KitPluginLike>(pName: string): T | undefined;
|
|
34
33
|
/**
|
|
35
34
|
* Lists all registered plugins.
|
|
36
35
|
*/
|
package/lib/kit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../src/kit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../src/kit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAgBtH,qBAAa,GAAG;IACZ;;OAEG;IACF,OAAO,CAAC,MAAM,CAAC,OAAO,CAAqC;IAC3D;;OAEG;IACH,OAAO,C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
|
54
|
+
const pluginName = pluginRecord?.name;
|
|
54
55
|
if (!pluginName || typeof pluginName !== 'string' || !/^[a-zA-Z0-9-_]+$/.test(pluginName)) {
|
|
55
56
|
throw new Error(`[Kit] Invalid plugin name: '${pluginName}'. The name must be a non-empty string containing only alphanumeric characters, dashes, or underscores.`);
|
|
56
57
|
}
|
|
@@ -60,11 +61,15 @@ export class Kit {
|
|
|
60
61
|
const listener = function (pEvent) {
|
|
61
62
|
Kit.emit(pEvent);
|
|
62
63
|
};
|
|
63
|
-
const emitter = new EventEmitter(listener,
|
|
64
|
+
const emitter = new EventEmitter(listener, pluginRecord);
|
|
64
65
|
Kit.emitters.set(pluginName, emitter);
|
|
65
|
-
Kit.plugins[pluginName] =
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
Kit.plugins[pluginName] = pluginRecord;
|
|
67
|
+
if (typeof pluginRecord._register === 'function') {
|
|
68
|
+
pluginRecord._register(emitter);
|
|
69
|
+
}
|
|
70
|
+
if (typeof pluginRecord.onRegistered === 'function') {
|
|
71
|
+
pluginRecord.onRegistered();
|
|
72
|
+
}
|
|
68
73
|
return plugin;
|
|
69
74
|
}
|
|
70
75
|
}
|
|
@@ -8,7 +8,7 @@ export declare abstract class KitPlugin {
|
|
|
8
8
|
/**
|
|
9
9
|
* The emitter that belongs to this plugin.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
protected _emitter: EventEmitter | null;
|
|
12
12
|
/**
|
|
13
13
|
* Register this plugin with the event system.
|
|
14
14
|
* @param pEmitter - The emitter that belongs to this plugin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/kit-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,8BAAsB,SAAS;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"kit-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/kit-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,8BAAsB,SAAS;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAQ;IAE/C;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,YAAY;IAIhC;;OAEG;IACH,QAAQ,CAAC,YAAY,IAAI,IAAI;IAE7B;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY;CAO5B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { KitPlugin } from '../plugins/kit-plugin';
|
|
2
1
|
import type { VyloType } from './vylo.d.ts';
|
|
3
2
|
/**
|
|
4
3
|
* The EmitterEvent type is used to define the shape of the data that is passed to the event listeners.
|
|
@@ -19,12 +18,18 @@ type ResourceData = {
|
|
|
19
18
|
fileName: string;
|
|
20
19
|
};
|
|
21
20
|
type Listener = (pData: EmitterEvent) => void;
|
|
22
|
-
|
|
21
|
+
interface KitPluginLike {
|
|
22
|
+
name: string;
|
|
23
|
+
onRegistered?(): void;
|
|
24
|
+
_register?(pEmitter: unknown): void;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
type KitPluginConstructor<T = KitPluginLike> = new (...args: any[]) => T;
|
|
23
28
|
declare global {
|
|
24
29
|
/**
|
|
25
30
|
* The Vylocity engine.
|
|
26
31
|
*/
|
|
27
32
|
var VYLO: VyloType;
|
|
28
33
|
}
|
|
29
|
-
export type { EmitterEvent, ResourceData, Listener, KitPluginConstructor };
|
|
34
|
+
export type { EmitterEvent, ResourceData, Listener, KitPluginLike, KitPluginConstructor };
|
|
30
35
|
//# sourceMappingURL=shared-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-types.d.ts","sourceRoot":"","sources":["../../src/types/shared-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"shared-types.d.ts","sourceRoot":"","sources":["../../src/types/shared-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C;;GAEG;AACH,KAAK,YAAY,GAAG;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAA;AAED,KAAK,YAAY,GAAG;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAC;AAEF,KAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAE9C,UAAU,aAAa;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,IAAI,IAAI,CAAC;IACtB,SAAS,CAAC,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,KAAK,oBAAoB,CAAC,CAAC,GAAG,aAAa,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACzE,OAAO,CAAC,MAAM,CAAC;IACX;;OAEG;IAEH,IAAI,IAAI,EAAE,QAAQ,CAAC;CACtB;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|