killscript 0.1.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.
@@ -0,0 +1,3 @@
1
+ declare const VERSION = "0.1.0";
2
+
3
+ export { VERSION };
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import {
2
+ VERSION
3
+ } from "./chunk-T3XTQIWG.js";
4
+ export {
5
+ VERSION
6
+ };
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "killscript",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript toolchain for KILLSCRIPT modules",
5
+ "license": "MIT",
6
+ "keywords": ["killscript", "typescript", "lua", "modding", "cli"],
7
+ "homepage": "https://silentbless.github.io/killscript/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/SilentBless/killscript.git",
11
+ "directory": "packages/cli"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "killscript": "./dist/cli.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "templates"
20
+ ],
21
+ "exports": {
22
+ ".": "./dist/index.js"
23
+ },
24
+ "scripts": {
25
+ "build": "tsup src/cli.ts src/index.ts --format esm --dts --clean",
26
+ "check": "tsc -p tsconfig.json --noEmit",
27
+ "prepack": "npm run build"
28
+ },
29
+ "dependencies": {
30
+ "@killscript/sdk": "0.1.0",
31
+ "@killscript/types": "0.1.0",
32
+ "chokidar": "5.0.0",
33
+ "commander": "15.0.0",
34
+ "fflate": "0.8.3",
35
+ "typescript": "6.0.2",
36
+ "typescript-to-lua": "1.37.1"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "26.1.1",
40
+ "tsup": "8.5.1"
41
+ },
42
+ "engines": {
43
+ "node": ">=20"
44
+ },
45
+ "publishConfig": { "access": "public" }
46
+ }
@@ -0,0 +1,18 @@
1
+ # __MODULE_NAME__
2
+
3
+ ```sh
4
+ npm run dev -- --modules <path-to-game-Modules>
5
+ ```
6
+
7
+ The first run builds and installs the generated folder module. The Modules path
8
+ is saved locally. Open or reopen the in-game module list, enable the module once,
9
+ and successful edits then hot reload in place. Use `npm run install:game` for a
10
+ single build-and-install without watching.
11
+
12
+ - `src/client` contains presentation and local input.
13
+ - `src/server` exists in Reflex projects and contains authoritative decisions.
14
+ - `src/shared` contains declarations and pure helpers used by both entries.
15
+ - `public` is copied into the module root for `images`, `sounds`, UXML and localization.
16
+
17
+ Use `npm run check` for a compile check and `npm run build` to create
18
+ `dist/__MODULE_NAME__.KillScript`.
@@ -0,0 +1,5 @@
1
+ node_modules/
2
+ .killscript/
3
+ dist/
4
+ *.KillScript
5
+ *.log
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "__MODULE_NAMESPACE__",
3
+ "private": true,
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "killscript dev",
8
+ "install:game": "killscript install",
9
+ "build": "killscript build",
10
+ "check": "killscript check",
11
+ "clean": "killscript clean",
12
+ "doctor": "killscript doctor"
13
+ },
14
+ "devDependencies": {
15
+ "@killscript/sdk": "__TOOLCHAIN_VERSION__",
16
+ "@killscript/types": "__TOOLCHAIN_VERSION__",
17
+ "killscript": "__TOOLCHAIN_VERSION__",
18
+ "typescript": "6.0.2"
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ import { Keyboard, defineControls } from "@killscript/sdk/client";
2
+
3
+ export const controls = defineControls("__MODULE_NAMESPACE__", {
4
+ toggle: Keyboard.F6,
5
+ });
@@ -0,0 +1,20 @@
1
+ import { agents, scheduler } from "@killscript/sdk/client";
2
+
3
+ import { settings } from "../../shared/settings";
4
+ import { controls } from "../controls";
5
+
6
+ controls.toggle.onPressed(() => {
7
+ settings.enabled = !settings.enabled;
8
+ NotificationController.ShowHint(
9
+ settings.enabled ? "Module enabled" : "Module disabled",
10
+ 2,
11
+ );
12
+ });
13
+
14
+ scheduler.frame(() => {
15
+ if (!settings.enabled) return;
16
+ const localAgent = agents.local();
17
+ if (localAgent === undefined) return;
18
+
19
+ // Update client-only visuals and presentation here.
20
+ });
@@ -0,0 +1,2 @@
1
+ // Keep main.ts as composition: imported features own their state and behavior.
2
+ import "./features/module-toggle";
@@ -0,0 +1,12 @@
1
+ import { agents, scheduler } from "@killscript/sdk/server";
2
+
3
+ import { settings } from "../../shared/settings";
4
+
5
+ scheduler.tick(() => {
6
+ if (!settings.enabled) return;
7
+ const localAgent = agents.local();
8
+ if (localAgent === undefined) return;
9
+
10
+ // Make authoritative gameplay decisions here when the native server API
11
+ // actually applies them. Keep the client informed through defineNetwork().
12
+ });
@@ -0,0 +1 @@
1
+ import "./features/gameplay";
@@ -0,0 +1,7 @@
1
+ import { defineSettings, setting } from "@killscript/sdk";
2
+
3
+ // Compile-time registrations may live at the top level of any imported file.
4
+ export const settings = defineSettings("__MODULE_NAMESPACE__", {
5
+ enabled: true,
6
+ updateRate: setting(1, { min: 1, max: 10 }),
7
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["ES2022"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "types": ["@killscript/types/client"]
10
+ },
11
+ "include": ["src/client/**/*.ts", "src/shared/**/*.ts"]
12
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.client.json" },
5
+ { "path": "./tsconfig.server.json" }
6
+ ]
7
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["ES2022"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "types": ["@killscript/types/server"]
10
+ },
11
+ "include": ["src/server/**/*.ts", "src/shared/**/*.ts"]
12
+ }