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.
- package/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/chunk-T3XTQIWG.js +6 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2571 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/package.json +46 -0
- package/templates/default/README.md +18 -0
- package/templates/default/gitignore +5 -0
- package/templates/default/package.json +20 -0
- package/templates/default/src/client/controls.ts +5 -0
- package/templates/default/src/client/features/module-toggle.ts +20 -0
- package/templates/default/src/client/main.ts +2 -0
- package/templates/default/src/server/features/gameplay.ts +12 -0
- package/templates/default/src/server/main.ts +1 -0
- package/templates/default/src/shared/settings.ts +7 -0
- package/templates/default/tsconfig.client.json +12 -0
- package/templates/default/tsconfig.json +7 -0
- package/templates/default/tsconfig.server.json +12 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
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,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,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,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,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
|
+
}
|