@evitcastudio/kit 2.1.1 → 2.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.
Files changed (83) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +60 -59
  3. package/lib/bundle/cli/cli.js +1387 -53
  4. package/lib/bundle/cli/kit-game-templates/multi/README.md +15 -0
  5. package/lib/bundle/cli/kit-game-templates/multi/bun-build.ts +109 -0
  6. package/lib/bundle/cli/kit-game-templates/multi/favicon.ico +0 -0
  7. package/lib/bundle/cli/kit-game-templates/multi/package.json +23 -0
  8. package/lib/bundle/cli/kit-game-templates/multi/src/client/c-network.ts +22 -0
  9. package/lib/bundle/cli/kit-game-templates/multi/src/client/index.html +9 -0
  10. package/lib/bundle/cli/kit-game-templates/multi/src/client/index.ts +45 -0
  11. package/lib/bundle/cli/kit-game-templates/multi/src/client/packets/s-packets.ts +5 -0
  12. package/lib/bundle/cli/kit-game-templates/multi/src/client/vendor/vylocity-game-engine/vylo.client.js +19 -0
  13. package/lib/bundle/cli/kit-game-templates/multi/src/map-types.ts +9 -0
  14. package/lib/bundle/cli/kit-game-templates/multi/src/resources/default-atlas.vyi +0 -0
  15. package/lib/bundle/cli/kit-game-templates/multi/src/resources/default-macro.vymac +27 -0
  16. package/lib/bundle/cli/kit-game-templates/multi/src/resources/main-map.vym +1 -0
  17. package/lib/bundle/cli/kit-game-templates/multi/src/server/index.ts +58 -0
  18. package/lib/bundle/cli/kit-game-templates/multi/src/server/packets/c-packets.ts +5 -0
  19. package/lib/bundle/cli/kit-game-templates/multi/src/server/s-network.ts +16 -0
  20. package/lib/bundle/cli/kit-game-templates/multi/src/server/settings.json +4 -0
  21. package/lib/bundle/cli/kit-game-templates/multi/src/server/vendor/vylocity-game-engine/vylo.server.js +1 -0
  22. package/lib/bundle/cli/kit-game-templates/multi/src/types/shared-types.ts +13 -0
  23. package/lib/bundle/cli/kit-game-templates/multi/src/vylo.d.ts +3850 -0
  24. package/lib/bundle/cli/kit-game-templates/multi/tsconfig.json +28 -0
  25. package/lib/bundle/cli/kit-game-templates/single/README.md +15 -0
  26. package/lib/bundle/cli/kit-game-templates/single/bun-build.ts +33 -0
  27. package/lib/bundle/cli/kit-game-templates/single/bun-serve.ts +27 -0
  28. package/lib/bundle/cli/kit-game-templates/single/favicon.ico +0 -0
  29. package/lib/bundle/cli/kit-game-templates/single/package.json +23 -0
  30. package/lib/bundle/cli/kit-game-templates/single/src/index.html +12 -0
  31. package/lib/bundle/cli/kit-game-templates/single/src/index.ts +37 -0
  32. package/lib/bundle/cli/kit-game-templates/single/src/map-types.ts +9 -0
  33. package/lib/bundle/cli/kit-game-templates/single/src/resources/default-atlas.vyi +0 -0
  34. package/lib/bundle/cli/kit-game-templates/single/src/resources/default-macro.vymac +27 -0
  35. package/lib/bundle/cli/kit-game-templates/single/src/resources/main-map.vym +1 -0
  36. package/lib/bundle/cli/kit-game-templates/single/src/style.css +0 -0
  37. package/lib/bundle/cli/kit-game-templates/single/src/types/vylo.d.ts +3850 -0
  38. package/lib/bundle/cli/kit-game-templates/single/src/vendor/vylocity-game-engine/vylo.client.js +19 -0
  39. package/lib/bundle/cli/kit-game-templates/single/tsconfig.json +28 -0
  40. package/lib/cli/main.d.ts +8 -0
  41. package/lib/cli/main.d.ts.map +1 -0
  42. package/lib/cli/main.js +9 -0
  43. package/lib/cli/resource-builder.d.ts +6 -0
  44. package/lib/cli/resource-builder.d.ts.map +1 -0
  45. package/lib/cli/resource-builder.js +191 -0
  46. package/lib/cli/types.d.ts +11 -0
  47. package/lib/cli/types.d.ts.map +1 -0
  48. package/lib/cli/types.js +1 -0
  49. package/lib/index.d.ts +2 -1
  50. package/lib/index.d.ts.map +1 -1
  51. package/lib/package.json +72 -0
  52. package/lib/src/cli/init.d.ts +15 -0
  53. package/lib/src/cli/init.d.ts.map +1 -0
  54. package/lib/src/cli/init.js +176 -0
  55. package/lib/src/cli/main.d.ts +13 -0
  56. package/lib/src/cli/main.d.ts.map +1 -0
  57. package/lib/src/cli/main.js +16 -0
  58. package/lib/src/cli/resource-builder.d.ts +6 -0
  59. package/lib/src/cli/resource-builder.d.ts.map +1 -0
  60. package/lib/src/cli/resource-builder.js +191 -0
  61. package/lib/src/cli/types.d.ts +11 -0
  62. package/lib/src/cli/types.d.ts.map +1 -0
  63. package/lib/src/cli/types.js +1 -0
  64. package/lib/src/events/event-system.d.ts +13 -0
  65. package/lib/src/events/event-system.d.ts.map +1 -0
  66. package/lib/src/events/event-system.js +25 -0
  67. package/lib/src/index.d.ts +8 -0
  68. package/lib/src/index.d.ts.map +1 -0
  69. package/lib/src/index.js +5 -0
  70. package/lib/src/kit.d.ts +67 -0
  71. package/lib/src/kit.d.ts.map +1 -0
  72. package/lib/src/kit.js +158 -0
  73. package/lib/src/plugins/kit-plugin.d.ts +27 -0
  74. package/lib/src/plugins/kit-plugin.d.ts.map +1 -0
  75. package/lib/src/plugins/kit-plugin.js +24 -0
  76. package/lib/src/plugins/network/index.d.ts +55 -0
  77. package/lib/src/plugins/network/index.d.ts.map +1 -0
  78. package/lib/src/plugins/network/index.js +101 -0
  79. package/lib/src/types/shared-types.d.ts +30 -0
  80. package/lib/src/types/shared-types.d.ts.map +1 -0
  81. package/lib/src/types/shared-types.js +1 -0
  82. package/lib/types/vylo.d.ts +3848 -3848
  83. package/package.json +13 -5
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Jared Bates, Evitca Studio, "doubleactii"
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jared Bates, Evitca Studio, "doubleactii"
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,60 +1,61 @@
1
- # Kit
2
-
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 lets you build powerful projects through a plugin-driven architecture.
4
-
5
- # Install
6
- ```bash
7
- npm i @evitcastudio/kit -g
8
- ```
9
-
10
- *global flag is so the path is set properly for the CLI tool*
11
-
12
- # Resources
13
-
14
- This script will locate all Vylocity engine-related files within the specified directory and anonymize them before placing them in the designated resources folder.
15
-
16
- ```bash
17
- # From the CLI you will build all your resources to the out dir
18
- kit build -i ./<in-dir> -o ./<out-dir>
19
- ```
20
-
21
- During the execution of this command, a `resource.json` file will be automatically generated within your source directory.
22
- It is recommended to exclude this file from your version control system, as it is considered a build artifact.
23
-
24
-
25
- > [!IMPORTANT]
26
- This API should be ran BEFORE `VYLO.load()` is called.
27
-
28
- > [!WARNING]
29
- Depending on your environment the following [import syntax](https://github.com/EvitcaStudio/Kit/wiki/FAQ#importing-json-resources) for json may not work.
30
-
31
-
32
- ```js
33
- import resourceJSON from 'resource.json';
34
- await Kit.setResources(resourceJSON);
35
- ```
36
-
37
- # Using Kit with plugins
38
-
39
- ```ts
40
- import { Plugin } from 'custom-plugin';
41
-
42
- const plugin = Kit.registerPlugin(Plugin);
43
- ```
44
-
45
- # Listening for plugin events
46
-
47
- ```js
48
- const listener = (pEvent: EmitterEvent) => {
49
- const { data, timestamp } = pEvent;
50
- // Here you can use the data that the event sent down.
51
- }
52
-
53
- // Here you listen for an event from the plugin: `Plugin`, under the event name of `eventName`
54
- Kit.on('Plugin', 'eventName', listener);
55
-
56
- // You can also stop listening for an event
57
- Kit.off('Plugin', 'eventName', listener);
58
- ```
59
-
1
+ # Kit
2
+
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.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @evitcastudio/kit
9
+ ```
10
+ > **Note:** The `-g` flag ensures the `kit` CLI tool is globally available in your PATH.
11
+
12
+ ## CLI Core Commands
13
+
14
+ The `kit build` command locates all Vylocity engine-related resources in your source directory, anonymizes them, and moves them to a deploy-ready output directory.
15
+
16
+ ```bash
17
+ kit build -i ./<in-dir> -o ./<out-dir>
18
+ ```
19
+
20
+ Executing this command automatically generates a `resource.json` map in your input directory.
21
+ **Best Practice:** Exclude `resource.json` from version control (`.gitignore`), as it is an ephemeral build artifact.
22
+
23
+ ## Runtime Resource Loading
24
+
25
+ > [!IMPORTANT]
26
+ > `Kit.setResources()` should be called **before** `VYLO.load()`.
27
+
28
+ > [!WARNING]
29
+ > Depending on your build environment (e.g., webpack, vite, or bun), you may need specific loaders or assertions to import JSON natively.
30
+
31
+ ```typescript
32
+ import resourceJSON from './resource.json';
33
+
34
+ // Initialize the engine with mapped resources
35
+ await Kit.setResources(resourceJSON);
36
+ ```
37
+
38
+ ## Plugin Architecture
39
+
40
+ ```ts
41
+ import { Plugin } from 'custom-plugin';
42
+
43
+ const plugin = Kit.registerPlugin(Plugin);
44
+ ```
45
+
46
+ # Listening for plugin events
47
+
48
+ ```js
49
+ const listener = (pEvent: EmitterEvent) => {
50
+ const { data, timestamp } = pEvent;
51
+ // Here you can use the data that the event sent down.
52
+ }
53
+
54
+ // Here you listen for an event from the plugin: `Plugin`, under the event name of `eventName`
55
+ Kit.on('Plugin', 'eventName', listener);
56
+
57
+ // You can also stop listening for an event
58
+ Kit.off('Plugin', 'eventName', listener);
59
+ ```
60
+
60
61
  For more information check out the [wiki](https://github.com/EvitcaStudio/Kit/wiki)