@evitcastudio/kit 3.3.2 → 3.4.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/README.md CHANGED
@@ -1,27 +1,80 @@
1
- # Kit
1
+ <p align="center">
2
+ <img src="./evitcastudio_round_branding.png" width="128" height="128" alt="Evitca Studio Logo" />
3
+ </p>
2
4
 
3
- **Kit** is a lightweight, extensible 2D framework for game development in the [Vylocity Game Engine](https://www.vylocity.com/). Designed to be simple and modular, Kit empowers developers to build complex projects quickly through a robust plugin-driven architecture.
5
+ <h1 align="center">@evitcastudio/kit</h1>
6
+
7
+ <p align="center">
8
+ A lightweight, extensible framework and developer toolkit for the Vylocity Game Engine.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@evitcastudio/kit"><img src="https://img.shields.io/npm/v/@evitcastudio/kit.svg?color=10b981" alt="npm version" /></a>
13
+ <a href="https://github.com/EvitcaStudio/Kit/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a>
14
+ <a href="https://github.com/EvitcaStudio/Kit"><img src="https://img.shields.io/badge/TypeScript-Ready-3178c6.svg" alt="TypeScript" /></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ ## Features
20
+
21
+ - **Modular Plugin Architecture**: Centralized service locator (`Kit.registerPlugin`, `Kit.getPlugin`) with lifecycle hooks and a decoupled typed event bus (`Kit.on`, `Kit.off`).
22
+ - **Official Plugins Included**:
23
+ - **`Camera` (Lens)**: 5 specialized camera types (`Follow`, `Pan`, `Spectate`, `Influence`, `Transition`), 29 shake presets, smooth zoom, zero-pop transitions, and native 2D canvas debug overlays.
24
+ - **`Network`**: Structured client-server packet communication with registered names and automatic indexing for bandwidth optimization.
25
+ - **Developer CLI (`kit`)**:
26
+ - **`kit init`**: Interactive scaffolding for Singleplayer and Multiplayer game templates.
27
+ - **`kit build`**: Zero-config compilation, asset hashing (`.vyr`), metadata manifest generation, and production minification/obfuscation.
28
+ - **`kit host`**: Built-in local HTTP and game server hosting with hot-reloading and LAN network URLs.
29
+ - **`kit create`**: Instant boilerplate generator for typed plugins.
30
+ - **`kit doctor`**: Comprehensive environment and project health diagnostics.
31
+ - **Smart Asset Pipeline**: Fast hashing, automatic passthrough for subdirectories, and automatic metadata manifest generation (`resource.json`, `bounds.json`, `sizes.json`, `icon-points.json`).
32
+ - **Zero-Config TypeScript**: Powered by Bun for blazing fast bundling, incremental watch mode, and complete type safety.
33
+
34
+ ---
4
35
 
5
36
  ## Installation
6
37
 
7
38
  ```bash
39
+ # Global CLI installation (recommended)
8
40
  bun install -g @evitcastudio/kit
41
+
42
+ # Or as a project dependency
43
+ bun add @evitcastudio/kit
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Quickstart
49
+
50
+ ```bash
51
+ # 1. Initialize a new project
52
+ kit init my-game --single --install
53
+
54
+ # 2. Build game and assets
55
+ cd my-game && kit build
56
+
57
+ # 3. Host locally
58
+ kit host
9
59
  ```
10
- > **Note:** The `-g` flag ensures the `kit` CLI tool is globally available in your PATH.
60
+
61
+ Your game will immediately be accessible at `http://localhost:8090` (or `http://localhost:30000` for multiplayer).
62
+
63
+ ---
11
64
 
12
65
  ## CLI Reference & Usage
13
66
 
14
- Kit includes a CLI tool (`kit`) for scaffolding projects, building game assets, generating plugin boilerplate, and diagnosing your environment.
67
+ Kit includes the `kit` CLI for scaffolding, asset compilation, boilerplate generation, and local testing.
15
68
 
16
69
  ### Global Options
17
70
  - `-v, --verbose`: Enables verbose output and detailed debugging logs.
18
- - `-h, --help`: Displays help and usage information for any command.
71
+ - `-h, --help`: Displays help and usage information.
19
72
  - `-V, --version`: Displays the installed Kit CLI version.
20
73
 
21
74
  ---
22
75
 
23
76
  ### `kit init [name]`
24
- Initializes a new game project for the Vylocity Game Engine. If run without arguments or flags, an interactive prompt will guide you through project setup.
77
+ Initializes a new game project. Run without arguments for an interactive setup prompt.
25
78
 
26
79
  ```bash
27
80
  # Interactive setup
@@ -31,195 +84,224 @@ kit init
31
84
  kit init my-game --single --install
32
85
  ```
33
86
 
34
- #### Flags & Options:
35
- | Flag / Option | Type | Default | Description |
36
- | :--- | :--- | :--- | :--- |
37
- | `[name]` | `string` | `kit-project` | The name of the project folder to create. |
38
- | `-s, --single` | `boolean` | `false` | Quick-starts a single-player game template. |
39
- | `-m, --multi` | `boolean` | `false` | Quick-starts a multiplayer game template (pass both `-s` and `-m` for both). |
40
- | `-f, --force` | `boolean` | `false` | Overwrites the destination folder if it already exists without aborting. |
41
- | `-i, --install` | `boolean` | `false` | Automatically runs `bun install` inside the new project directory after creation. |
87
+ | Option | Description | Default |
88
+ | :--- | :--- | :--- |
89
+ | `[name]` | Project folder name. | `kit-project` |
90
+ | `-s, --single` | Scaffolds a single-player game template. | `false` |
91
+ | `-m, --multi` | Scaffolds a multiplayer game template. | `false` |
92
+ | `-f, --force` | Overwrites destination folder if it already exists. | `false` |
93
+ | `-i, --install` | Automatically runs `bun install` after scaffolding. | `false` |
42
94
 
43
95
  ---
44
96
 
45
97
  ### `kit build`
46
- Builds resources and compiles game application code. Automatically detects whether your project is **Singleplayer** or **Multiplayer**, compiles TypeScript entrypoints to `dist/`, copies static web files (`.html`, `.css`, `.ico`, vendor directories), hashes raw assets into unique identifiers (`.vyr`), mirrors custom subdirectories, and exports metadata manifests (`resource.json`, `bounds.json`, `icon-points.json`, and `sizes.json`).
98
+ Compiles TypeScript application code to `dist/`, hashes raw assets into unique identifiers (`.vyr`), mirrors asset subdirectories, and generates metadata manifests.
47
99
 
48
100
  ```bash
49
- # Zero-config build (auto-detects project architecture, builds ./src to ./dist)
101
+ # Zero-config build (auto-detects project architecture)
50
102
  kit build
51
103
 
52
- # Production ready build (minified, obfuscated identifiers, stripped sourcemaps)
53
- kit build -p
54
-
55
- # Watch mode: auto-rebuilds on source or resource changes
104
+ # Watch mode (incremental rebuilds on source or resource changes)
56
105
  kit build --watch
57
106
 
58
- # Build only raw resources with custom directories
59
- kit build -i ./src/resources -o ./dist --no-app
60
-
61
- # Save the resource manifest to a custom location
62
- kit build --manifest ./dist/resource.json
63
- ```
64
-
65
- #### Flags & Options:
66
- | Flag / Option | Type | Required | Default | Description |
67
- | :--- | :--- | :--- | :--- | :--- |
68
- | `-i, --in <path>` | `string` | No | `./src/resources` | Input directory containing raw game assets (`.vyi`, `.vym`, `.vyint`, audio, etc.). |
69
- | `-o, --out <path>` | `string` | No | `./dist` | Destination directory where processed `resources/` and bundled app files will be written. |
70
- | `-m, --manifest <path>` | `string` | No | `./resource.json` | Path where the resource lookup JSON should be saved. If omitted, defaults to `./resource.json` in the current working directory. |
71
- | `-w, --watch` | `boolean` | No | `false` | Watches the source and resource directories for changes and triggers automatic incremental rebuilds. |
72
- | `-is, --ignore-sound` | `boolean` | No | `false` | Skips processing and copying sound and music files (`.mp3`, `.ogg`, `.wav`, etc.). |
73
- | `-p, --prod` | `boolean` | No | `false` | Production mode: enables full minification, identifier obfuscation/mangling, and strips sourcemaps. |
74
- | `--minify` | `boolean` | No | `false` | Minifies bundled JavaScript syntax, whitespace, and variable names. |
75
- | `--obfuscate` | `boolean` | No | `false` | Mangles and obfuscates identifiers across bundled output. |
76
- | `--sourcemap <mode>` | `string` | No | `linked` (`none` in prod) | Sourcemap mode (`none`, `linked`, `inline`, `external`). |
77
- | `--app` / `--no-app` | `boolean` | No | `true` (auto) | Toggles application code bundling. Enabled automatically if `src/index.ts` or `src/client/index.ts` exists. |
78
-
79
- #### What is the Resource Manifest (`resource.json`)?
80
- A manifest is an index or lookup table. `kit build` obfuscates asset names into unique identifiers (`uuid.vyr`) as a security benefit to protect and hide original asset filenames in production. It generates `resource.json` mapping your original human-readable asset names to their engine identifiers:
81
- ```json
82
- {
83
- "icon": [
84
- {
85
- "fileName": "player.vyi",
86
- "resourceIdentifier": "3cf72322-6b92-4ea5-bbca-b96fae1fe440.vyr"
87
- }
88
- ],
89
- "map": [ ... ],
90
- "sound": [ ... ]
91
- }
92
- ```
93
-
94
- #### Custom Asset Subdirectories (Automatic Pass-Through)
95
- Any subdirectories inside your resource folder (e.g. `src/resources/images`, `src/resources/fonts`, `src/resources/emitters`, `src/resources/particles`, etc.) are automatically mirrored to `<out>/resources/<folder>/`. Non-engine files remain in their original form.
96
-
97
- ---
98
-
99
- ### `kit create <type> <name>`
100
- Scaffolds boilerplate files inside an existing Kit project following standard architectural conventions.
101
-
102
- ```bash
103
- # Generate a typed plugin
104
- kit create plugin Inventory
107
+ # Production build (minified, obfuscated identifiers, stripped sourcemaps)
108
+ kit build -p
105
109
  ```
106
110
 
107
- #### Types:
108
- - `plugin`: Creates a new TypeScript file at `src/plugins/<name>.ts` that subclasses `KitPlugin` with typed lifecycle hooks (`onRegistered()`) ready to extend.
111
+ | Option | Description | Default |
112
+ | :--- | :--- | :--- |
113
+ | `-i, --in <path>` | Input resource directory containing raw game assets. | `./src/resources` |
114
+ | `-o, --out <path>` | Output directory for processed assets and bundled code. | `./dist` |
115
+ | `-m, --manifest <path>` | Custom destination path for `resource.json`. | `./resource.json` |
116
+ | `-w, --watch` | Watches source and resource folders for auto-rebuilding. | `false` |
117
+ | `-p, --prod` | Production mode (minification, mangled identifiers, no maps). | `false` |
118
+ | `--minify` / `--obfuscate` | Granular syntax minification or identifier mangling. | `false` |
119
+ | `--sourcemap <mode>` | Sourcemap mode (`none`, `linked`, `inline`, `external`). | `linked` |
120
+ | `--app` / `--no-app` | Toggles application code bundling. | `true` |
121
+
122
+ #### Generated Metadata Manifests
123
+ During build, Kit produces optimized metadata indices in your project:
124
+ - **`resource.json`**: Maps original human-readable asset filenames to obfuscated engine identifiers (`uuid.vyr`).
125
+ - **`bounds.json` & `sizes.json`**: Pre-calculated collision boundaries and dimensions for icons and tiles.
126
+ - **`icon-points.json`**: Defined anchor points and equipment attachment coordinates for sprites.
109
127
 
110
128
  ---
111
129
 
112
130
  ### `kit host`
113
- Hosts the game project locally for development and testing.
131
+ Hosts your compiled game project locally for browser or multiplayer testing.
114
132
 
115
133
  ```bash
116
- # Host the dist folder on port 8090
134
+ # Host dist folder on default port 8090
117
135
  kit host
118
136
 
119
137
  # Build before hosting and specify custom port
120
138
  kit host -b -p 8080
121
139
  ```
122
140
 
123
- #### Options:
124
- - `-p, --port <number>`: Port to bind the server to (default: `8090`).
125
- - `-d, --dir <path>`: Directory containing built files to serve (default: `./dist`).
126
- - `-b, --build`: Trigger a `kit build` before starting the server.
141
+ | Option | Description | Default |
142
+ | :--- | :--- | :--- |
143
+ | `-p, --port <number>` | Port to bind the server to. | `8090` |
144
+ | `-d, --dir <path>` | Directory of built files to serve. | `./dist` |
145
+ | `-b, --build` | Runs `kit build` prior to starting server. | `false` |
127
146
 
128
- #### Behavior:
129
- - **Singleplayer / Client Projects:** Spawns a lightweight local HTTP server powered by Bun that serves `dist/index.html` and static assets with local and network LAN URLs.
130
- - **Multiplayer Projects:** Automatically launches the backend node server (`dist/server.js`) with configured settings (`dist/settings.json`).
147
+ ---
148
+
149
+ ### `kit create <type> <name>`
150
+ Scaffolds typed boilerplate into an existing Kit project.
151
+
152
+ ```bash
153
+ kit create plugin Inventory
154
+ ```
155
+ Generates `src/plugins/inventory.ts` subclassing `KitPlugin` with lifecycle hooks ready to extend.
131
156
 
132
157
  ---
133
158
 
134
159
  ### `kit doctor`
135
- Inspects your local environment and current project health.
160
+ Inspects your local environment and project health (Bun runtime, Git availability, `package.json`, project architecture, and build pipeline).
136
161
 
137
162
  ```bash
138
163
  kit doctor
139
164
  ```
140
165
 
141
- #### What it checks:
142
- - **Bun Runtime:** Verifies that Bun is installed and detects the version.
143
- - **Git Installation:** Verifies that Git is accessible in your `PATH`.
144
- - **Project Structure:** If executed within a game project, checks `package.json`, `@evitcastudio/kit` framework dependencies, and asset folders (`src/resources`).
145
- - **Project Architecture:** Detects whether the project is **Singleplayer** (`src/index.ts`), **Multiplayer** (`src/client` & `src/server`), or **Dedicated Server**.
146
- - **Build Pipeline:** Verifies that a valid build pipeline is configured (either native `kit build` in `package.json` or legacy `bun-build.ts`).
147
-
148
166
  ---
149
167
 
150
168
  ## Runtime Resource Loading
151
169
 
152
- > **Note:** This process is preconfigured for you if you used `kit init`.
153
-
154
- `Kit.setResources()` should be called **before** `VYLO.load()`.
170
+ `Kit.setResources()` loads the generated `resource.json` manifest into the Vylocity engine prior to calling `VYLO.load()`:
155
171
 
156
172
  ```typescript
157
173
  import resourceJSON from 'resource.json';
158
174
 
159
- // Initialize the engine with mapped resources
175
+ // Initialize engine with mapped resource identifiers
160
176
  await Kit.setResources(resourceJSON);
177
+ await VYLO.load();
161
178
  ```
162
179
 
180
+ ---
163
181
 
164
- ## Local Development & Testing
182
+ ## Plugins
165
183
 
166
- Once your project is scaffolded and dependencies are installed and the project has been built, you can run your game locally.
184
+ Kit features a modular plugin architecture. Plugins register via `Kit.registerPlugin()`, are retrievable globally through `Kit.getPlugin(name)`, and communicate across decoupled systems using Kit's typed event bus.
167
185
 
168
- ### Running the Game
186
+ ```typescript
187
+ import { Kit } from '@evitcastudio/kit';
188
+ import { CustomPlugin } from 'custom-plugin';
169
189
 
170
- ```bash
171
- # For Single-Player or Multiplayer games
172
- bun run host
190
+ // Register with Kit
191
+ const plugin = Kit.registerPlugin(CustomPlugin);
192
+
193
+ // Retrieve anywhere by plugin name
194
+ const plugin = Kit.getPlugin<CustomPlugin>('CustomPlugin');
195
+ ```
196
+
197
+ ---
198
+
199
+ ### Official Plugins
200
+
201
+ #### 1. Camera Plugin (`Camera` / `@evitcastudio/lens`)
202
+ High-performance 2D camera system powered by [`@evitcastudio/lens`](https://github.com/EvitcaStudio/Lens). Supports 5 specialized camera types, 29 shake presets, smooth zoom, zero-pop transitions, native canvas debug overlays, and automatic event dispatching.
203
+
204
+ ##### Setup & Quickstart
205
+
206
+ ```typescript
207
+ import { Kit, Camera } from '@evitcastudio/kit';
208
+
209
+ // 1. Register with Kit (indexes under name 'Camera')
210
+ const camera = Kit.registerPlugin(Camera);
211
+
212
+ // 2. Track player entity with smooth lerping & deadzone
213
+ camera.createFollowCamera('main', playerMob, {
214
+ lerp: 0.1,
215
+ deadzone: { width: 64, height: 64 }
216
+ });
173
217
  ```
174
218
 
175
- ### Accessing the Game
219
+ ##### Seamless Transitions
220
+ Blend smoothly between cameras or targets with Hermite spline interpolation and spring-damping (zero visual pop):
176
221
 
177
- The server will be available at the following locations after being hosted:
222
+ ```typescript
223
+ await camera.switchTo(bossCamera, {
224
+ duration: 800,
225
+ smoothing: 'smoothDamp', // or 'cubicSpline'
226
+ springTension: 170,
227
+ springFriction: 26
228
+ });
229
+ ```
178
230
 
179
- > **Singleplayer**
180
- [http://localhost:8090](http://localhost:8090) defined in `./bun-serve.ts`
231
+ ##### Screen Shake & Zoom
232
+ ```typescript
233
+ // Trigger built-in presets or infinite ambient shakes
234
+ camera.shakePreset('explosion-large');
235
+ camera.shakePreset('rumble', undefined, true);
181
236
 
182
- > **Multiplayer or Singleplayer & Multiplayer**
183
- [http://localhost:30000](http://localhost:30000) defined in `./src/server/settings.json`
237
+ // Smooth zoom animations with 30+ easing equations
238
+ camera.zoom(2, 500, 'easeOutCubic');
239
+ camera.zoom(1, 400, 'easeInOutQuad'); // Reset
240
+ ```
184
241
 
242
+ ##### Camera Event Bus
243
+ All camera lifecycle events automatically dispatch to Kit's global event bus (`Kit.on`), allowing audio, gamepad vibration, or UI systems to decouple from camera logic:
185
244
 
186
- ## Plugin Architecture
245
+ ```typescript
246
+ Kit.on('Camera', 'shake-start', (event) => {
247
+ console.log('Camera shaking:', event.data.preset);
248
+ });
187
249
 
188
- ```ts
189
- import { Plugin } from 'custom-plugin';
250
+ Kit.on('Camera', 'transition-start', () => {
251
+ // e.g. animate cinematic bars
252
+ });
253
+ ```
254
+
255
+ ##### Native Debug Overlay & Gizmos
256
+ Built-in 2D canvas overlay for debugging cameras, bounds, target vectors, and crosshairs:
190
257
 
191
- // Register a single plugin
192
- const plugin = Kit.registerPlugin(Plugin);
258
+ ```typescript
259
+ camera.setDebugMode({
260
+ enabled: true,
261
+ showCameraMarkers: true,
262
+ showTargetLines: true,
263
+ showBounds: true,
264
+ showCenterCrosshair: true,
265
+ bounds: { minX: 0, maxX: 2000, minY: 0, maxY: 2000 }
266
+ });
193
267
  ```
194
268
 
195
- ```ts
196
- // Register multiple plugins
197
- import { Plugin1 } from 'custom-plugin1';
198
- import { Plugin2 } from 'custom-plugin2';
269
+ ---
270
+
271
+ #### 2. Network Plugin (`Network`)
272
+ Handles client-server packet communication with registered packet names, automatic indexing, and minimal bandwidth usage.
273
+
274
+ ```typescript
275
+ import { Kit, Network } from '@evitcastudio/kit';
199
276
 
200
- const plugins = Kit.registerPlugins([Plugin1, Plugin2]);
277
+ const network = Kit.registerPlugin(Network);
201
278
 
202
- // After being registered, kit can find the plugin by name.
203
- const plugin1 = Kit.getPlugin('plugin1-name');
204
- const plugin2 = Kit.getPlugin('plugin2-name');
279
+ // Client-side: register server packet definitions & listen
280
+ network.registerPackets(['CHAT_MESSAGE', 'PLAYER_HEAL'] as const);
281
+
282
+ network.on('CHAT_MESSAGE', (client, senderName, message) => {
283
+ console.log(`[${senderName}]: ${message}`);
284
+ });
205
285
  ```
206
286
 
207
- ### Listening for plugin events
287
+ ---
208
288
 
209
- Plugins emit events, this is how they pass relevant data to other plugins or the main thread.
210
- By listening to these events you can act on this data.
289
+ ### Plugin Events
211
290
 
212
- ```js
213
- const listener = (pEvent: EmitterEvent) => {
214
- const { data, timestamp } = pEvent;
215
- // Here you can use the data that the event sent down.
216
- }
291
+ Plugins can emit and listen to events across the entire application:
217
292
 
218
- // Choose to listen to specific event from a plugin
219
- Kit.on('plugin-name', 'event-name', listener);
293
+ ```typescript
294
+ // Listen for an event from any plugin
295
+ Kit.on('plugin-name', 'event-name', (event) => {
296
+ console.log(event.data, event.timestamp);
297
+ });
220
298
 
221
- // You can also stop listening for an event
299
+ // Remove listener
222
300
  Kit.off('plugin-name', 'event-name', listener);
223
301
  ```
224
302
 
225
- For more information check out the [wiki](https://github.com/EvitcaStudio/Kit/wiki)
303
+ ---
304
+
305
+ ## License
306
+
307
+ MIT © [Evitca Studio](https://evitcastudio.com) & [doubleactii](https://github.com/doubleactii)
@@ -2,8 +2,8 @@
2
2
  // @bun
3
3
 
4
4
  /*!
5
- * @evitcastudio/kit@3.3.2 git+https://github.com/EvitcaStudio/Kit.git
6
- * Compiled Wed, 09 Sep 2026 21:02:08 UTC
5
+ * @evitcastudio/kit@3.4.0 git+https://github.com/EvitcaStudio/Kit.git
6
+ * Compiled Fri, 11 Sep 2026 03:52:37 UTC
7
7
  * Copyright (c) 2026 Jared Bates, Evitca Studio, "doubleactii"
8
8
  *
9
9
  * @evitcastudio/kit is licensed under the MIT License.
@@ -1943,7 +1943,7 @@ var {
1943
1943
 
1944
1944
  // src/cli/resource-builder.ts
1945
1945
  import { promises as fs2, existsSync as existsSync2 } from "fs";
1946
- import { join as join4, extname as extname3, basename as basename3, resolve as resolve3, relative as relative3 } from "path";
1946
+ import { join as join4, extname as extname3, basename as basename3, resolve as resolve4, relative as relative3 } from "path";
1947
1947
 
1948
1948
  // node_modules/chokidar/index.js
1949
1949
  import { EventEmitter } from "events";
@@ -3609,17 +3609,11 @@ function v4(options, buf, offset) {
3609
3609
  return native_default.randomUUID();
3610
3610
  }
3611
3611
  options = options || {};
3612
- const rnds = options.random ?? options.rng?.() ?? rng();
3613
- if (rnds.length < 16) {
3614
- throw new Error("Random bytes length must be >= 16");
3615
- }
3612
+ const rnds = options.random || (options.rng || rng)();
3616
3613
  rnds[6] = rnds[6] & 15 | 64;
3617
3614
  rnds[8] = rnds[8] & 63 | 128;
3618
3615
  if (buf) {
3619
3616
  offset = offset || 0;
3620
- if (offset < 0 || offset + 16 > buf.length) {
3621
- throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
3622
- }
3623
3617
  for (let i = 0;i < 16; ++i) {
3624
3618
  buf[offset + i] = rnds[i];
3625
3619
  }
@@ -9143,7 +9137,7 @@ class WorkerPool {
9143
9137
 
9144
9138
  // src/cli/app-bundler.ts
9145
9139
  import { promises as fs, existsSync } from "fs";
9146
- import { join as join3, dirname as dirname3, extname as extname2 } from "path";
9140
+ import { join as join3, dirname as dirname3, extname as extname2, resolve as resolve3 } from "path";
9147
9141
 
9148
9142
  // node_modules/chalk/source/vendor/ansi-styles/index.js
9149
9143
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -9413,12 +9407,6 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
9413
9407
  if (env.TERM === "xterm-kitty") {
9414
9408
  return 3;
9415
9409
  }
9416
- if (env.TERM === "xterm-ghostty") {
9417
- return 3;
9418
- }
9419
- if (env.TERM === "wezterm") {
9420
- return 3;
9421
- }
9422
9410
  if ("TERM_PROGRAM" in env) {
9423
9411
  const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
9424
9412
  switch (env.TERM_PROGRAM) {
@@ -9783,7 +9771,7 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
9783
9771
  name: "kit-project-resolver",
9784
9772
  setup(build) {
9785
9773
  build.onResolve({ filter: /^resource\.json$/ }, () => {
9786
- const resourcePath = join3(pProjectRoot, "resource.json");
9774
+ const resourcePath = resolve3(pProjectRoot, "resource.json");
9787
9775
  if (existsSync(resourcePath)) {
9788
9776
  return { path: resourcePath };
9789
9777
  }
@@ -9841,7 +9829,7 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
9841
9829
  name: "kit-project-resolver",
9842
9830
  setup(build) {
9843
9831
  build.onResolve({ filter: /^resource\.json$/ }, () => {
9844
- const resourcePath = join3(pProjectRoot, "resource.json");
9832
+ const resourcePath = resolve3(pProjectRoot, "resource.json");
9845
9833
  if (existsSync(resourcePath)) {
9846
9834
  return { path: resourcePath };
9847
9835
  }
@@ -9881,7 +9869,21 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
9881
9869
  identifiers: shouldObfuscate,
9882
9870
  syntax: true,
9883
9871
  whitespace: true
9884
- } : false
9872
+ } : false,
9873
+ plugins: [
9874
+ {
9875
+ name: "kit-project-resolver",
9876
+ setup(build) {
9877
+ build.onResolve({ filter: /^resource\.json$/ }, () => {
9878
+ const resourcePath = resolve3(pProjectRoot, "resource.json");
9879
+ if (existsSync(resourcePath)) {
9880
+ return { path: resourcePath };
9881
+ }
9882
+ return;
9883
+ });
9884
+ }
9885
+ }
9886
+ ]
9885
9887
  });
9886
9888
  if (!serverResult.success) {
9887
9889
  console.error(serverResult.logs);
@@ -9985,7 +9987,7 @@ async function processDirectory(pDirectoryPath) {
9985
9987
  const contents = await fs2.readdir(pDirectoryPath);
9986
9988
  for (const item of contents) {
9987
9989
  const itemPath = join4(pDirectoryPath, item);
9988
- if (resolve3(itemPath) === resourceOutDirectory) {
9990
+ if (resolve4(itemPath) === resourceOutDirectory) {
9989
9991
  continue;
9990
9992
  }
9991
9993
  const stats = await fs2.stat(itemPath);
@@ -10334,7 +10336,7 @@ async function runWatch() {
10334
10336
  try {
10335
10337
  const stats = await fs2.stat(pFilePath);
10336
10338
  if (stats.isFile()) {
10337
- fileStats.set(resolve3(pFilePath), { mtime: stats.mtimeMs, size: stats.size });
10339
+ fileStats.set(resolve4(pFilePath), { mtime: stats.mtimeMs, size: stats.size });
10338
10340
  }
10339
10341
  } catch {
10340
10342
  }
@@ -10369,7 +10371,7 @@ async function runWatch() {
10369
10371
  watcher.on("all", async (event, filePath) => {
10370
10372
  if (event === "addDir" || event === "unlinkDir")
10371
10373
  return;
10372
- const absPath = resolve3(filePath);
10374
+ const absPath = resolve4(filePath);
10373
10375
  if (event === "unlink") {
10374
10376
  fileStats.delete(absPath);
10375
10377
  const relativePath2 = relative3(projectRootDirectory, filePath).replace(/\\/g, "/");
@@ -10396,8 +10398,8 @@ async function processResources({ inDirectory, outDirectory, manifestPath, watch
10396
10398
  projectRootDirectory = process.cwd();
10397
10399
  const resolvedIn = inDirectory || (existsSync2(join4(projectRootDirectory, "src", "resources")) ? "src/resources" : "");
10398
10400
  const resolvedOut = outDirectory || "dist";
10399
- resourceInDirectory = resolvedIn ? resolve3(resolvedIn) : "";
10400
- resourceOutDirectory = resolvedOut ? resolve3(resolvedOut) : "";
10401
+ resourceInDirectory = resolvedIn ? resolve4(resolvedIn) : "";
10402
+ resourceOutDirectory = resolvedOut ? resolve4(resolvedOut) : "";
10401
10403
  customManifestPath = manifestPath;
10402
10404
  isVerbose = verbose;
10403
10405
  ignoringSound = ignoreSound;
@@ -11484,7 +11486,7 @@ import os2 from "os";
11484
11486
  // package.json
11485
11487
  var package_default = {
11486
11488
  name: "@evitcastudio/kit",
11487
- version: "3.3.2",
11489
+ version: "3.4.0",
11488
11490
  author: "doubleactii 56242467+doubleactii@users.noreply.github.com (https://evitcastudio.com)",
11489
11491
  main: "./lib/index.js",
11490
11492
  types: "./lib/index.d.ts",
@@ -11494,6 +11496,10 @@ var package_default = {
11494
11496
  ".": {
11495
11497
  import: "./lib/index.js",
11496
11498
  types: "./lib/index.d.ts"
11499
+ },
11500
+ "./camera": {
11501
+ import: "./lib/plugins/camera/index.js",
11502
+ types: "./lib/plugins/camera/index.d.ts"
11497
11503
  }
11498
11504
  },
11499
11505
  description: "A single-player/multiplayer framework for the Vylocity Game Engine.",
@@ -11544,6 +11550,7 @@ var package_default = {
11544
11550
  },
11545
11551
  dependencies: {
11546
11552
  "@clack/prompts": "^1.1.0",
11553
+ "@evitcastudio/lens": "^4.3.0",
11547
11554
  chalk: "^5.4.0",
11548
11555
  chokidar: "^5.0.0",
11549
11556
  commander: "^12.1.0",
@@ -12030,7 +12037,7 @@ Error creating plugin: ${message}`));
12030
12037
 
12031
12038
  // src/cli/host.ts
12032
12039
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "fs";
12033
- import { join as join7, resolve as resolve4 } from "path";
12040
+ import { join as join7, resolve as resolve5 } from "path";
12034
12041
  import { networkInterfaces } from "os";
12035
12042
  function getNetworkAddress() {
12036
12043
  const interfaces = networkInterfaces();
@@ -12050,7 +12057,7 @@ async function processHost(pOptions = {}) {
12050
12057
  const cwd = process.cwd();
12051
12058
  const defaultPort = 8090;
12052
12059
  const port = pOptions.port || defaultPort;
12053
- const distDir = pOptions.directory ? resolve4(pOptions.directory) : join7(cwd, "dist");
12060
+ const distDir = pOptions.directory ? resolve5(pOptions.directory) : join7(cwd, "dist");
12054
12061
  const architecture = detectArchitecture(join7(cwd, "src"));
12055
12062
  if (!existsSync4(distDir)) {
12056
12063
  const message = `Target directory "${distDir}" does not exist. Run "kit build" or use "kit host -b" first.`;
@@ -0,0 +1,286 @@
1
+ // node_modules/@evitcastudio/kit/lib/events/event-system.js
2
+ class EventEmitter {
3
+ listener;
4
+ plugin;
5
+ constructor(pListener, pPlugin) {
6
+ this.listener = pListener;
7
+ this.plugin = pPlugin;
8
+ }
9
+ emit(pEvent) {
10
+ if (pEvent.plugin && pEvent.plugin !== this.plugin.name) {
11
+ throw new Error(`Event mismatch: ${this.plugin.name} tried to emit an event from the ${pEvent.plugin} namespace.`);
12
+ }
13
+ const event = {
14
+ plugin: this.plugin.name,
15
+ event: pEvent.event,
16
+ data: pEvent?.data,
17
+ timestamp: Date.now()
18
+ };
19
+ Object.freeze(event);
20
+ this.listener(event);
21
+ }
22
+ }
23
+
24
+ // node_modules/@evitcastudio/kit/lib/kit.js
25
+ var extensionToPath = {
26
+ ".vyint": "interface",
27
+ ".vym": "map",
28
+ ".vyi": "icon",
29
+ ".vymac": "macros",
30
+ ".aac": "sound",
31
+ ".mp3": "sound",
32
+ ".wav": "sound",
33
+ ".m4a": "sound",
34
+ ".ogg": "sound",
35
+ ".flac": "sound"
36
+ };
37
+
38
+ class Kit {
39
+ static plugins = {};
40
+ static emitters = new Map;
41
+ static events = {};
42
+ constructor() {
43
+ throw new Error("[Kit] is not to be instantiated.");
44
+ }
45
+ static init(pPlugins) {
46
+ pPlugins.forEach((pPlugin) => {
47
+ this.registerPlugin(pPlugin);
48
+ });
49
+ }
50
+ static registerPlugin(pPlugin) {
51
+ if (Array.isArray(pPlugin)) {
52
+ const plugins = [];
53
+ pPlugin.forEach((pPlugin2) => {
54
+ const plugin = this.registerPlugin(pPlugin2);
55
+ if (plugin && !Array.isArray(plugin)) {
56
+ plugins.push(plugin);
57
+ }
58
+ });
59
+ return plugins;
60
+ } else {
61
+ const plugin = new pPlugin;
62
+ const pluginName = plugin.name;
63
+ if (!pluginName || typeof pluginName !== "string" || !/^[a-zA-Z0-9-_]+$/.test(pluginName)) {
64
+ throw new Error(`[Kit] Invalid plugin name: '${pluginName}'. The name must be a non-empty string containing only alphanumeric characters, dashes, or underscores.`);
65
+ }
66
+ if (Kit.plugins[pluginName]) {
67
+ throw new Error(`[Kit] plugin with name '${pluginName}' is already registered.`);
68
+ }
69
+ const listener = function(pEvent) {
70
+ Kit.emit(pEvent);
71
+ };
72
+ const emitter = new EventEmitter(listener, plugin);
73
+ Kit.emitters.set(pluginName, emitter);
74
+ Kit.plugins[pluginName] = plugin;
75
+ plugin._register(emitter);
76
+ plugin.onRegistered();
77
+ return plugin;
78
+ }
79
+ }
80
+ static getPlugin(pName) {
81
+ const plugin = Kit.plugins[pName];
82
+ if (!plugin) {
83
+ return;
84
+ }
85
+ return plugin;
86
+ }
87
+ static getPlugins() {
88
+ return Object.keys(Kit.plugins);
89
+ }
90
+ static emit(pEvent) {
91
+ const { plugin, event } = pEvent;
92
+ const eventScope = `${plugin}-${event}`;
93
+ if (!Kit.events[eventScope]) {
94
+ return;
95
+ }
96
+ Kit.events[eventScope].forEach((pListener) => pListener(pEvent));
97
+ }
98
+ static on(pPluginName, pEventName, pListener) {
99
+ const eventScope = `${pPluginName}-${pEventName}`;
100
+ if (!Kit.events[eventScope]) {
101
+ Kit.events[eventScope] = [];
102
+ }
103
+ Kit.events[eventScope].push(pListener);
104
+ }
105
+ static off(pPluginName, pEventName, pListener) {
106
+ const eventScope = `${pPluginName}-${pEventName}`;
107
+ if (Kit.events[eventScope].includes(pListener)) {
108
+ Kit.events[eventScope].splice(Kit.events[eventScope].indexOf(pListener), 1);
109
+ }
110
+ }
111
+ static setResource(pData) {
112
+ pData.forEach((pResource) => {
113
+ const extensionMatch = pResource.fileName.match(/\.[^.]+$/);
114
+ const fileNameWithoutExtensionMatch = pResource.fileName.match(/(.+?)(?=\.[^.]+$|$)/);
115
+ if (extensionMatch && fileNameWithoutExtensionMatch) {
116
+ const extension = extensionMatch[0];
117
+ const fileNameWithoutExtension = fileNameWithoutExtensionMatch[0];
118
+ const resourceType = extensionToPath[extension];
119
+ if (resourceType) {
120
+ globalThis.VYLO.Resource.setResource(resourceType, fileNameWithoutExtension, `${pResource.resourceIdentifier}`);
121
+ }
122
+ }
123
+ });
124
+ }
125
+ static async setResources(pResourceJson) {
126
+ if (!globalThis.VYLO) {
127
+ throw new Error("[Kit] VYLO is not defined. Please ensure the VYLO variable is available in the global namespace.");
128
+ }
129
+ if (pResourceJson) {
130
+ const resources = Object.values(pResourceJson);
131
+ const consolidatedData = resources.flat();
132
+ this.setResource(consolidatedData);
133
+ }
134
+ }
135
+ }
136
+ // node_modules/@evitcastudio/kit/lib/plugins/kit-plugin.js
137
+ class KitPlugin {
138
+ _emitter = null;
139
+ _register(pEmitter) {
140
+ this._emitter = pEmitter;
141
+ }
142
+ emit(pEvent) {
143
+ if (!this._emitter) {
144
+ console.error("[Kit Plugin] emitter not set. This is an indication that the plugin is not registered.");
145
+ return;
146
+ }
147
+ this._emitter.emit(pEvent);
148
+ }
149
+ }
150
+ // node_modules/@evitcastudio/kit/lib/plugins/network/index.js
151
+ class Network extends KitPlugin {
152
+ name = "Network";
153
+ initiated = false;
154
+ packets = new Map;
155
+ reversedPacketMap = new Map;
156
+ onRegistered() {
157
+ this.initiated = true;
158
+ }
159
+ listeners = new Map;
160
+ onPacket(pPacketName, pListener) {
161
+ if (!this.packets.has(pPacketName)) {
162
+ throw new Error(`Packet name '${pPacketName}' is not registered.`);
163
+ }
164
+ this.listeners.set(pPacketName, pListener);
165
+ }
166
+ on(pPacketName, pListener) {
167
+ this.onPacket(pPacketName, pListener);
168
+ }
169
+ onNetwork(pClient, pPacketName, pData = [], pVerbose) {
170
+ if (!this.initiated)
171
+ return;
172
+ if (typeof pPacketName === "number") {
173
+ const packetName = this.reversedPacketMap.get(pPacketName);
174
+ if (!packetName) {
175
+ if (pVerbose) {
176
+ console.group(`Kit.${this.name}Plugin.onNetwork`);
177
+ console.warn(`Unknown packet index: ${pPacketName}`);
178
+ console.groupEnd();
179
+ }
180
+ return;
181
+ }
182
+ const listener = this.listeners.get(packetName);
183
+ if (pVerbose) {
184
+ console.group(`Kit.${this.name}Plugin.onNetwork`);
185
+ if (!listener) {
186
+ console.warn(`No listener was registered for this packet: ${packetName}`);
187
+ }
188
+ console.log(`Packet name: ${pPacketName}`);
189
+ console.log(`Resolved packet name: ${packetName}`);
190
+ console.log(`Data:`, pData);
191
+ console.groupEnd();
192
+ }
193
+ listener?.(pClient, ...pData);
194
+ }
195
+ }
196
+ registerPackets(pPackets) {
197
+ this.packets.clear();
198
+ this.reversedPacketMap.clear();
199
+ pPackets.forEach((name, index) => {
200
+ this.packets.set(name, index);
201
+ this.reversedPacketMap.set(index, name);
202
+ });
203
+ }
204
+ getPacket(pPacketName) {
205
+ const packet = this.packets.get(pPacketName);
206
+ if (packet === undefined) {
207
+ console.warn(`Packet '${pPacketName}' is not registered.`);
208
+ }
209
+ return packet;
210
+ }
211
+ }
212
+ // kit-game-templates/multi/src/map-types.ts
213
+ VYLO.setType("Tile", {
214
+ atlasName: "default-atlas",
215
+ iconName: "cobble"
216
+ });
217
+ VYLO.setType("Mob/Player", {
218
+ atlasName: "default-atlas",
219
+ iconName: "player"
220
+ });
221
+
222
+ // kit-game-templates/multi/src/client/packets/s-packets.ts
223
+ var serverPackets = [
224
+ "SERVER_EXAMPLE1_PACKET",
225
+ "SERVER_EXAMPLE2_PACKET",
226
+ "SERVER_EXAMPLE3_PACKET"
227
+ ];
228
+
229
+ // kit-game-templates/multi/src/client/c-network.ts
230
+ Kit.registerPlugin(Network);
231
+ var networkPlugin = Kit.getPlugin("Network");
232
+ if (!networkPlugin) {
233
+ throw new Error("Network plugin not found.");
234
+ }
235
+ networkPlugin.registerPackets(serverPackets);
236
+ networkPlugin.on("SERVER_EXAMPLE3_PACKET", (pClient, pData, pData2, pData3) => {
237
+ console.log("data", pData, pData2, pData3);
238
+ });
239
+ VYLO.setType("Client", {
240
+ onPacket(pPacketName, pData) {
241
+ networkPlugin?.onNetwork(this, pPacketName, pData, true);
242
+ }
243
+ });
244
+ // kit-game-templates/multi/resource.json
245
+ var resource_default = {
246
+ interface: [],
247
+ icon: [],
248
+ map: [],
249
+ sound: [],
250
+ macros: []
251
+ };
252
+
253
+ // kit-game-templates/multi/src/client/index.ts
254
+ await Kit.setResources(resource_default);
255
+ var networkPlugin2 = Kit.getPlugin("Network");
256
+ VYLO.setType("World", {
257
+ onNew() {
258
+ console.log("World created.");
259
+ },
260
+ onMapLoaded(pName) {
261
+ console.log(`'${pName}' map loaded.`);
262
+ }
263
+ });
264
+ VYLO.setType("Client", {
265
+ mainOutput: "",
266
+ maxFPS: 0,
267
+ hideFPS: false,
268
+ screenView: {
269
+ scaleTo: "normal",
270
+ scaleNearest: true,
271
+ disableImageSmoothing: true
272
+ },
273
+ onConnect() {
274
+ console.log("onConnect");
275
+ this.sendPacket(networkPlugin2?.getPacket("SERVER_EXAMPLE2_PACKET"), [1, 2, 3]);
276
+ }
277
+ });
278
+ VYLO.setType("Mob/Player", {
279
+ onLogin() {
280
+ console.log("onLogin");
281
+ },
282
+ onLogout() {
283
+ console.log("onLogout");
284
+ }
285
+ });
286
+ await VYLO.load();
@@ -1,6 +1,6 @@
1
1
  import { Kit } from '@evitcastudio/kit';
2
2
  import type { Network } from '@evitcastudio/kit';
3
- import '../map-types';
3
+ import '../map-types.js';
4
4
  import './c-network';
5
5
  import resourceJSON from 'resource.json';
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"app-bundler.d.ts","sourceRoot":"","sources":["../../src/cli/app-bundler.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,mBAAmB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAYvE;AA+DD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CA6NhI"}
1
+ {"version":3,"file":"app-bundler.d.ts","sourceRoot":"","sources":["../../src/cli/app-bundler.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,mBAAmB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAYvE;AA+DD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CA2OhI"}
@@ -1,5 +1,5 @@
1
1
  import { promises as fs, existsSync } from 'node:fs';
2
- import { join, dirname, extname } from 'node:path';
2
+ import { join, dirname, extname, resolve } from 'node:path';
3
3
  import chalk from 'chalk';
4
4
  import Bun from 'bun';
5
5
  import { theme } from './theme';
@@ -144,7 +144,7 @@ export async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
144
144
  name: 'kit-project-resolver',
145
145
  setup(build) {
146
146
  build.onResolve({ filter: /^resource\.json$/ }, () => {
147
- const resourcePath = join(pProjectRoot, 'resource.json');
147
+ const resourcePath = resolve(pProjectRoot, 'resource.json');
148
148
  if (existsSync(resourcePath)) {
149
149
  return { path: resourcePath };
150
150
  }
@@ -202,7 +202,7 @@ export async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
202
202
  name: 'kit-project-resolver',
203
203
  setup(build) {
204
204
  build.onResolve({ filter: /^resource\.json$/ }, () => {
205
- const resourcePath = join(pProjectRoot, 'resource.json');
205
+ const resourcePath = resolve(pProjectRoot, 'resource.json');
206
206
  if (existsSync(resourcePath)) {
207
207
  return { path: resourcePath };
208
208
  }
@@ -242,7 +242,21 @@ export async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
242
242
  identifiers: shouldObfuscate,
243
243
  syntax: true,
244
244
  whitespace: true
245
- } : false
245
+ } : false,
246
+ plugins: [
247
+ {
248
+ name: 'kit-project-resolver',
249
+ setup(build) {
250
+ build.onResolve({ filter: /^resource\.json$/ }, () => {
251
+ const resourcePath = resolve(pProjectRoot, 'resource.json');
252
+ if (existsSync(resourcePath)) {
253
+ return { path: resourcePath };
254
+ }
255
+ return undefined;
256
+ });
257
+ }
258
+ }
259
+ ]
246
260
  });
247
261
  if (!serverResult.success) {
248
262
  console.error(serverResult.logs);
package/lib/index.d.ts CHANGED
@@ -5,4 +5,6 @@ export type { Client, Diob } from './types/vylo';
5
5
  export { KitPlugin } from './plugins/kit-plugin';
6
6
  export { Network } from './plugins/network';
7
7
  export type { NetworkListener } from './plugins/network';
8
+ export { Camera, CameraPlugin, CameraManager, BaseCamera, FollowCamera, SpectateCamera, PanCamera, InfluenceCamera, TransitionCamera, GizmoRenderer } from './plugins/camera';
9
+ export type { CameraManagerOptions, CameraDebugOptions, CameraEventName, CameraEventMap, CameraEventListener, GameInstance, Vector2D, ShakePresetConfig, ShakeOptions, EaseType, DurationSettings, EaseSettings, ShakePreset, CameraOffset, FollowCameraOptions, SpectateCameraOptions, PanCameraOptions, InfluenceCameraOptions, TransitionCameraOptions, CameraType } from './plugins/camera';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -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;AACvG,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"}
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;AACvG,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/index.js CHANGED
@@ -3,3 +3,4 @@ export { EventEmitter } from './events/event-system';
3
3
  // Plugins
4
4
  export { KitPlugin } from './plugins/kit-plugin';
5
5
  export { Network } from './plugins/network';
6
+ export { Camera, CameraPlugin, CameraManager, BaseCamera, FollowCamera, SpectateCamera, PanCamera, InfluenceCamera, TransitionCamera, GizmoRenderer } from './plugins/camera';
@@ -0,0 +1,3 @@
1
+ export { CameraPlugin, CameraPlugin as Camera, CameraManager, BaseCamera, FollowCamera, SpectateCamera, PanCamera, InfluenceCamera, TransitionCamera, GizmoRenderer } from '@evitcastudio/lens';
2
+ export type { KitPluginEmitter, CameraManagerOptions, CameraDebugOptions, CameraEventName, CameraEventMap, CameraEventListener, GameInstance, Vector2D, ShakePresetConfig, ShakeOptions, EaseType, DurationSettings, EaseSettings, ShakePreset, CameraOffset, FollowCameraOptions, SpectateCameraOptions, PanCameraOptions, InfluenceCameraOptions, TransitionCameraOptions, CameraType } from '@evitcastudio/lens';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/camera/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,YAAY,EACZ,YAAY,IAAI,MAAM,EACtB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,aAAa,EAChB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACR,gBAAgB,EAChB,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,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ // Re-export Camera plugin and classes directly from @evitcastudio/lens
2
+ export { CameraPlugin, CameraPlugin as Camera, CameraManager, BaseCamera, FollowCamera, SpectateCamera, PanCamera, InfluenceCamera, TransitionCamera, GizmoRenderer } from '@evitcastudio/lens';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evitcastudio/kit",
3
- "version": "3.3.2",
3
+ "version": "3.4.0",
4
4
  "author": "doubleactii 56242467+doubleactii@users.noreply.github.com (https://evitcastudio.com)",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -10,6 +10,10 @@
10
10
  ".": {
11
11
  "import": "./lib/index.js",
12
12
  "types": "./lib/index.d.ts"
13
+ },
14
+ "./camera": {
15
+ "import": "./lib/plugins/camera/index.js",
16
+ "types": "./lib/plugins/camera/index.d.ts"
13
17
  }
14
18
  },
15
19
  "description": "A single-player/multiplayer framework for the Vylocity Game Engine.",
@@ -60,6 +64,7 @@
60
64
  },
61
65
  "dependencies": {
62
66
  "@clack/prompts": "^1.1.0",
67
+ "@evitcastudio/lens": "^4.3.0",
63
68
  "chalk": "^5.4.0",
64
69
  "chokidar": "^5.0.0",
65
70
  "commander": "^12.1.0",