create-hackhub-mod 0.1.0 → 0.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.
- package/dist/index.js +65 -15
- package/package.json +1 -1
- package/templates/base/esbuild.config.ts +3 -0
- package/templates/full/src/apps/ExampleApp.ts +18 -0
- package/templates/full/src/commands/HelloCommand.ts +20 -0
- package/templates/full/src/html/app.html +37 -0
- package/templates/full/src/index.ts +5 -108
- package/templates/full/src/pages/home.html +32 -0
- package/templates/full/src/quests/ExampleQuest.ts +29 -0
- package/templates/full/src/types.d.ts +4 -0
- package/templates/full/src/websites/ExampleWebsite.ts +13 -0
- package/templates/quest/src/index.ts +2 -21
- package/templates/quest/src/quests/ExampleQuest.ts +29 -0
- package/templates/website/src/index.ts +2 -36
- package/templates/website/src/pages/home.html +37 -0
- package/templates/website/src/types.d.ts +4 -0
- package/templates/website/src/websites/ExampleWebsite.ts +13 -0
package/dist/index.js
CHANGED
|
@@ -5,9 +5,22 @@ import * as p from "@clack/prompts";
|
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import fs from "fs";
|
|
7
7
|
import path from "path";
|
|
8
|
+
import { execSync } from "child_process";
|
|
8
9
|
import { fileURLToPath } from "url";
|
|
9
10
|
var __filename = fileURLToPath(import.meta.url);
|
|
10
11
|
var __dirname = path.dirname(__filename);
|
|
12
|
+
var BANNER = `
|
|
13
|
+
${pc.cyan(" \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}
|
|
14
|
+
${pc.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}
|
|
15
|
+
${pc.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}
|
|
16
|
+
${pc.cyan(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}
|
|
17
|
+
${pc.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}
|
|
18
|
+
${pc.cyan(" \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D ")}
|
|
19
|
+
${pc.dim(" \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")}
|
|
20
|
+
${pc.dim(" \u2502")} ${pc.green(" >")} ${pc.white("Create HackHub Mod")}${pc.dim(" \u2502")}
|
|
21
|
+
${pc.dim(" \u2502")} ${pc.dim(" Mod scaffolding tool for HackHub")}${pc.dim(" \u2502")}
|
|
22
|
+
${pc.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}
|
|
23
|
+
`;
|
|
11
24
|
function toKebabCase(str) {
|
|
12
25
|
return str.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
13
26
|
}
|
|
@@ -28,16 +41,36 @@ function copyDir(src, dest, vars) {
|
|
|
28
41
|
copyDir(srcPath, destPath, vars);
|
|
29
42
|
} else {
|
|
30
43
|
let content = fs.readFileSync(srcPath, "utf-8");
|
|
31
|
-
if (entry.name.endsWith(".hbs") || entry.name.endsWith(".ts") || entry.name.endsWith(".json")) {
|
|
44
|
+
if (entry.name.endsWith(".hbs") || entry.name.endsWith(".ts") || entry.name.endsWith(".html") || entry.name.endsWith(".json")) {
|
|
32
45
|
content = inject(content, vars);
|
|
33
46
|
}
|
|
34
47
|
fs.writeFileSync(destPath, content);
|
|
35
48
|
}
|
|
36
49
|
}
|
|
37
50
|
}
|
|
51
|
+
function detectPackageManager() {
|
|
52
|
+
const ua = process.env.npm_config_user_agent || "";
|
|
53
|
+
if (ua.startsWith("pnpm")) return "pnpm";
|
|
54
|
+
if (ua.startsWith("yarn")) return "yarn";
|
|
55
|
+
if (ua.startsWith("bun")) return "bun";
|
|
56
|
+
try {
|
|
57
|
+
execSync("bun --version", { stdio: "ignore" });
|
|
58
|
+
return "bun";
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
execSync("pnpm --version", { stdio: "ignore" });
|
|
63
|
+
return "pnpm";
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
return "npm";
|
|
67
|
+
}
|
|
68
|
+
function installCommand(pm) {
|
|
69
|
+
return pm === "yarn" ? "yarn" : `${pm} install`;
|
|
70
|
+
}
|
|
38
71
|
async function main() {
|
|
39
|
-
console.log();
|
|
40
|
-
p.intro(pc.bgCyan(pc.black("
|
|
72
|
+
console.log(BANNER);
|
|
73
|
+
p.intro(pc.bgCyan(pc.black(" create-hackhub-mod ")));
|
|
41
74
|
const project = await p.group(
|
|
42
75
|
{
|
|
43
76
|
name: () => p.text({
|
|
@@ -51,10 +84,10 @@ async function main() {
|
|
|
51
84
|
template: () => p.select({
|
|
52
85
|
message: "Select a template",
|
|
53
86
|
options: [
|
|
54
|
-
{ value: "basic", label: "Basic"
|
|
55
|
-
{ value: "quest", label: "Quest"
|
|
56
|
-
{ value: "website", label: "Website"
|
|
57
|
-
{ value: "full", label: "Full"
|
|
87
|
+
{ value: "basic", label: `${pc.bold("Basic")}`, hint: "Minimal mod setup" },
|
|
88
|
+
{ value: "quest", label: `${pc.bold("Quest")}`, hint: "Includes an example quest" },
|
|
89
|
+
{ value: "website", label: `${pc.bold("Website")}`, hint: "Includes an in-game website" },
|
|
90
|
+
{ value: "full", label: `${pc.bold("Full")}`, hint: "Quest + Website + Command + App" }
|
|
58
91
|
]
|
|
59
92
|
}),
|
|
60
93
|
author: () => p.text({
|
|
@@ -94,13 +127,30 @@ async function main() {
|
|
|
94
127
|
s.start("Scaffolding mod project...");
|
|
95
128
|
copyDir(baseDir, targetDir, vars);
|
|
96
129
|
copyDir(templateDir, targetDir, vars);
|
|
97
|
-
s.stop("Project scaffolded.");
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
130
|
+
s.stop(pc.green("Project scaffolded."));
|
|
131
|
+
const pm = detectPackageManager();
|
|
132
|
+
s.start(`Installing dependencies with ${pc.cyan(pm)}...`);
|
|
133
|
+
try {
|
|
134
|
+
execSync(installCommand(pm), { cwd: targetDir, stdio: "ignore" });
|
|
135
|
+
s.stop(pc.green("Dependencies installed."));
|
|
136
|
+
} catch {
|
|
137
|
+
s.stop(pc.yellow("Could not install dependencies. Run it manually."));
|
|
138
|
+
}
|
|
139
|
+
console.log();
|
|
140
|
+
console.log(pc.dim(" \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
141
|
+
console.log(pc.dim(" \u2502 \u2502"));
|
|
142
|
+
console.log(pc.dim(" \u2502") + pc.green(" \u2714 Your mod is ready!") + pc.dim(" \u2502"));
|
|
143
|
+
console.log(pc.dim(" \u2502 \u2502"));
|
|
144
|
+
console.log(pc.dim(" \u2502") + pc.white(` Project: ${pc.bold(modName)}`) + " ".repeat(Math.max(0, 40 - modName.length)) + pc.dim("\u2502"));
|
|
145
|
+
console.log(pc.dim(" \u2502") + pc.white(` Template: ${pc.bold(template)}`) + " ".repeat(Math.max(0, 40 - template.length)) + pc.dim("\u2502"));
|
|
146
|
+
console.log(pc.dim(" \u2502") + pc.white(` Author: ${pc.bold(author)}`) + " ".repeat(Math.max(0, 40 - author.length)) + pc.dim("\u2502"));
|
|
147
|
+
console.log(pc.dim(" \u2502 \u2502"));
|
|
148
|
+
console.log(pc.dim(" \u2502") + pc.dim(" Next steps:") + pc.dim(" \u2502"));
|
|
149
|
+
console.log(pc.dim(" \u2502") + pc.cyan(` cd ${modId}`) + " ".repeat(Math.max(0, 46 - modId.length)) + pc.dim("\u2502"));
|
|
150
|
+
console.log(pc.dim(" \u2502") + pc.cyan(` ${pm} run build`) + " ".repeat(Math.max(0, 38 - pm.length)) + pc.dim("\u2502"));
|
|
151
|
+
console.log(pc.dim(" \u2502 \u2502"));
|
|
152
|
+
console.log(pc.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"));
|
|
153
|
+
console.log();
|
|
154
|
+
p.outro(pc.green("Happy hacking! \u{1F513}"));
|
|
105
155
|
}
|
|
106
156
|
main().catch(console.error);
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { App, RegisterApp } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
import appHTML from "../html/app.html";
|
|
3
|
+
|
|
4
|
+
@RegisterApp()
|
|
5
|
+
export class ExampleApp extends App {
|
|
6
|
+
|
|
7
|
+
AppName: string = "{{className}}App";
|
|
8
|
+
Title: string = "{{modName}}";
|
|
9
|
+
Icon: string = "";
|
|
10
|
+
HTML: string = appHTML;
|
|
11
|
+
DefaultSize = { width: 420, height: 320 };
|
|
12
|
+
|
|
13
|
+
Store = {
|
|
14
|
+
title: "{{modName}}",
|
|
15
|
+
ratings: 5.0,
|
|
16
|
+
description: "{{description}}",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command, RegisterCommand, CommandTools } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
|
|
3
|
+
@RegisterCommand()
|
|
4
|
+
export class HelloCommand extends Command {
|
|
5
|
+
|
|
6
|
+
CommandName: string = "hello";
|
|
7
|
+
Description: string = "Says hello from {{modName}}";
|
|
8
|
+
Autocomplete = [
|
|
9
|
+
{ label: "hello", type: "STRING" as const },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
async Run(tools: CommandTools) {
|
|
13
|
+
const args = tools.getArgs();
|
|
14
|
+
if (args.length > 0) {
|
|
15
|
+
tools.println(`Hello, ${args.join(" ")}! From {{modName}}.`);
|
|
16
|
+
} else {
|
|
17
|
+
tools.println("Hello from {{modName}}!");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<style>
|
|
5
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
6
|
+
body {
|
|
7
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
8
|
+
background: #1a1a2e;
|
|
9
|
+
color: #eee;
|
|
10
|
+
padding: 24px;
|
|
11
|
+
}
|
|
12
|
+
h2 {
|
|
13
|
+
color: #e94560;
|
|
14
|
+
margin-bottom: 12px;
|
|
15
|
+
}
|
|
16
|
+
p {
|
|
17
|
+
color: #aaa;
|
|
18
|
+
margin-bottom: 16px;
|
|
19
|
+
}
|
|
20
|
+
button {
|
|
21
|
+
background: #e94560;
|
|
22
|
+
color: white;
|
|
23
|
+
border: none;
|
|
24
|
+
padding: 8px 16px;
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
}
|
|
29
|
+
button:hover { opacity: 0.85; }
|
|
30
|
+
</style>
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
<h2>{{modName}}</h2>
|
|
34
|
+
<p>This is a custom in-game application.</p>
|
|
35
|
+
<button onclick="alert('Hello from {{modName}}!')">Click me</button>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
App,
|
|
7
|
-
Events,
|
|
8
|
-
Network,
|
|
9
|
-
RegisterModPackage,
|
|
10
|
-
RegisterQuest,
|
|
11
|
-
RegisterWebsite,
|
|
12
|
-
RegisterCommand,
|
|
13
|
-
RegisterApp,
|
|
14
|
-
} from "@hotbunny/hackhub-content-sdk";
|
|
1
|
+
import { Bootstrap, RegisterModPackage } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
import "./quests/ExampleQuest";
|
|
3
|
+
import "./websites/ExampleWebsite";
|
|
4
|
+
import "./commands/HelloCommand";
|
|
5
|
+
import "./apps/ExampleApp";
|
|
15
6
|
|
|
16
7
|
@RegisterModPackage()
|
|
17
8
|
export default class {{className}} extends Bootstrap {
|
|
@@ -19,97 +10,3 @@ export default class {{className}} extends Bootstrap {
|
|
|
19
10
|
console.log("{{modName}} loaded!");
|
|
20
11
|
}
|
|
21
12
|
}
|
|
22
|
-
|
|
23
|
-
@RegisterQuest()
|
|
24
|
-
class ExampleQuest extends Quest {
|
|
25
|
-
definition = {
|
|
26
|
-
name: "ExampleQuest",
|
|
27
|
-
title: "Example Quest",
|
|
28
|
-
description: "An example quest from {{modName}}.",
|
|
29
|
-
rewards: { money: 100 },
|
|
30
|
-
objectives: [
|
|
31
|
-
{ name: "scan", description: "Scan the target server" },
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@RegisterWebsite()
|
|
37
|
-
class ExampleWebsite extends Website {
|
|
38
|
-
definition = {
|
|
39
|
-
url: "example.mod",
|
|
40
|
-
title: "Example Website",
|
|
41
|
-
html: `
|
|
42
|
-
<!DOCTYPE html>
|
|
43
|
-
<html>
|
|
44
|
-
<head>
|
|
45
|
-
<style>
|
|
46
|
-
body {
|
|
47
|
-
font-family: monospace;
|
|
48
|
-
background: #0a0a0a;
|
|
49
|
-
color: #00ff41;
|
|
50
|
-
display: flex;
|
|
51
|
-
align-items: center;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
height: 100vh;
|
|
54
|
-
margin: 0;
|
|
55
|
-
}
|
|
56
|
-
h1 { text-shadow: 0 0 10px #00ff41; }
|
|
57
|
-
</style>
|
|
58
|
-
</head>
|
|
59
|
-
<body>
|
|
60
|
-
<h1>Welcome to {{modName}}</h1>
|
|
61
|
-
</body>
|
|
62
|
-
</html>`,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@RegisterCommand()
|
|
67
|
-
class ExampleCommand extends Command {
|
|
68
|
-
definition = {
|
|
69
|
-
name: "hello",
|
|
70
|
-
description: "Says hello from {{modName}}",
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
execute(args: string[]) {
|
|
74
|
-
return `Hello from {{modName}}! Args: ${args.join(", ")}`;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@RegisterApp()
|
|
79
|
-
class ExampleApp extends App {
|
|
80
|
-
definition = {
|
|
81
|
-
id: "example-app",
|
|
82
|
-
name: "Example App",
|
|
83
|
-
icon: "terminal",
|
|
84
|
-
html: `
|
|
85
|
-
<!DOCTYPE html>
|
|
86
|
-
<html>
|
|
87
|
-
<head>
|
|
88
|
-
<style>
|
|
89
|
-
body {
|
|
90
|
-
font-family: sans-serif;
|
|
91
|
-
background: #1a1a2e;
|
|
92
|
-
color: #eee;
|
|
93
|
-
padding: 24px;
|
|
94
|
-
margin: 0;
|
|
95
|
-
}
|
|
96
|
-
h2 { color: #e94560; }
|
|
97
|
-
button {
|
|
98
|
-
background: #e94560;
|
|
99
|
-
color: white;
|
|
100
|
-
border: none;
|
|
101
|
-
padding: 8px 16px;
|
|
102
|
-
border-radius: 4px;
|
|
103
|
-
cursor: pointer;
|
|
104
|
-
}
|
|
105
|
-
button:hover { opacity: 0.85; }
|
|
106
|
-
</style>
|
|
107
|
-
</head>
|
|
108
|
-
<body>
|
|
109
|
-
<h2>{{modName}} App</h2>
|
|
110
|
-
<p>This is a custom in-game application.</p>
|
|
111
|
-
<button onclick="alert('Hello from {{modName}}!')">Click me</button>
|
|
112
|
-
</body>
|
|
113
|
-
</html>`,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<style>
|
|
5
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
6
|
+
body {
|
|
7
|
+
font-family: 'Courier New', monospace;
|
|
8
|
+
background: #0a0a0a;
|
|
9
|
+
color: #00ff41;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
padding: 24px;
|
|
16
|
+
}
|
|
17
|
+
h1 {
|
|
18
|
+
font-size: 2rem;
|
|
19
|
+
text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff4180;
|
|
20
|
+
margin-bottom: 16px;
|
|
21
|
+
}
|
|
22
|
+
p {
|
|
23
|
+
color: #00ff41aa;
|
|
24
|
+
font-size: 0.9rem;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<h1>{{modName}}</h1>
|
|
30
|
+
<p>Welcome to the website. You shouldn't be here.</p>
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Quest, RegisterQuest, QuestObjectiveDefinition } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
|
|
3
|
+
@RegisterQuest()
|
|
4
|
+
export class ExampleQuest extends Quest {
|
|
5
|
+
|
|
6
|
+
Name: string = "ExampleQuest";
|
|
7
|
+
Title: string = "Example Quest";
|
|
8
|
+
Description: string = "An example quest from {{modName}}.";
|
|
9
|
+
Rewards = { money: 100 };
|
|
10
|
+
Objectives: QuestObjectiveDefinition[] = [
|
|
11
|
+
{
|
|
12
|
+
name: "scan",
|
|
13
|
+
description: "Scan the target server",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "exploit",
|
|
17
|
+
description: "Exploit the vulnerability",
|
|
18
|
+
unlocksAfter: ["scan"],
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
OnStart() {
|
|
23
|
+
console.log("ExampleQuest started!");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
OnComplete() {
|
|
27
|
+
console.log("ExampleQuest completed!");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Website, RegisterWebsite, WebsitePageDefinition } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
import homePage from "../pages/home.html";
|
|
3
|
+
|
|
4
|
+
@RegisterWebsite()
|
|
5
|
+
export class ExampleWebsite extends Website {
|
|
6
|
+
|
|
7
|
+
SiteName: string = "{{modName}}";
|
|
8
|
+
Host: string = "{{modId}}.mod";
|
|
9
|
+
Icon: string = "";
|
|
10
|
+
Pages: WebsitePageDefinition[] = [
|
|
11
|
+
{ path: "/", title: "Home", html: homePage },
|
|
12
|
+
];
|
|
13
|
+
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Quest,
|
|
4
|
-
Events,
|
|
5
|
-
Network,
|
|
6
|
-
RegisterModPackage,
|
|
7
|
-
RegisterQuest,
|
|
8
|
-
} from "@hotbunny/hackhub-content-sdk";
|
|
1
|
+
import { Bootstrap, RegisterModPackage } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
import "./quests/ExampleQuest";
|
|
9
3
|
|
|
10
4
|
@RegisterModPackage()
|
|
11
5
|
export default class {{className}} extends Bootstrap {
|
|
@@ -13,16 +7,3 @@ export default class {{className}} extends Bootstrap {
|
|
|
13
7
|
console.log("{{modName}} loaded!");
|
|
14
8
|
}
|
|
15
9
|
}
|
|
16
|
-
|
|
17
|
-
@RegisterQuest()
|
|
18
|
-
class ExampleQuest extends Quest {
|
|
19
|
-
definition = {
|
|
20
|
-
name: "ExampleQuest",
|
|
21
|
-
title: "Example Quest",
|
|
22
|
-
description: "An example quest from {{modName}}.",
|
|
23
|
-
rewards: { money: 100 },
|
|
24
|
-
objectives: [
|
|
25
|
-
{ name: "scan", description: "Scan the target server" },
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Quest, RegisterQuest, QuestObjectiveDefinition } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
|
|
3
|
+
@RegisterQuest()
|
|
4
|
+
export class ExampleQuest extends Quest {
|
|
5
|
+
|
|
6
|
+
Name: string = "ExampleQuest";
|
|
7
|
+
Title: string = "Example Quest";
|
|
8
|
+
Description: string = "An example quest from {{modName}}.";
|
|
9
|
+
Rewards = { money: 100 };
|
|
10
|
+
Objectives: QuestObjectiveDefinition[] = [
|
|
11
|
+
{
|
|
12
|
+
name: "scan",
|
|
13
|
+
description: "Scan the target server",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "exploit",
|
|
17
|
+
description: "Exploit the vulnerability",
|
|
18
|
+
unlocksAfter: ["scan"],
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
OnStart() {
|
|
23
|
+
console.log("ExampleQuest started!");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
OnComplete() {
|
|
27
|
+
console.log("ExampleQuest completed!");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Website,
|
|
4
|
-
RegisterModPackage,
|
|
5
|
-
RegisterWebsite,
|
|
6
|
-
} from "@hotbunny/hackhub-content-sdk";
|
|
1
|
+
import { Bootstrap, RegisterModPackage } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
import "./websites/ExampleWebsite";
|
|
7
3
|
|
|
8
4
|
@RegisterModPackage()
|
|
9
5
|
export default class {{className}} extends Bootstrap {
|
|
@@ -11,33 +7,3 @@ export default class {{className}} extends Bootstrap {
|
|
|
11
7
|
console.log("{{modName}} loaded!");
|
|
12
8
|
}
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
@RegisterWebsite()
|
|
16
|
-
class ExampleWebsite extends Website {
|
|
17
|
-
definition = {
|
|
18
|
-
url: "example.mod",
|
|
19
|
-
title: "Example Website",
|
|
20
|
-
html: `
|
|
21
|
-
<!DOCTYPE html>
|
|
22
|
-
<html>
|
|
23
|
-
<head>
|
|
24
|
-
<style>
|
|
25
|
-
body {
|
|
26
|
-
font-family: monospace;
|
|
27
|
-
background: #0a0a0a;
|
|
28
|
-
color: #00ff41;
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
height: 100vh;
|
|
33
|
-
margin: 0;
|
|
34
|
-
}
|
|
35
|
-
h1 { text-shadow: 0 0 10px #00ff41; }
|
|
36
|
-
</style>
|
|
37
|
-
</head>
|
|
38
|
-
<body>
|
|
39
|
-
<h1>Welcome to {{modName}}</h1>
|
|
40
|
-
</body>
|
|
41
|
-
</html>`,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<style>
|
|
5
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
6
|
+
body {
|
|
7
|
+
font-family: 'Courier New', monospace;
|
|
8
|
+
background: #0a0a0a;
|
|
9
|
+
color: #00ff41;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
padding: 24px;
|
|
16
|
+
}
|
|
17
|
+
h1 {
|
|
18
|
+
font-size: 2rem;
|
|
19
|
+
text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff4180;
|
|
20
|
+
margin-bottom: 16px;
|
|
21
|
+
}
|
|
22
|
+
p {
|
|
23
|
+
color: #00ff41aa;
|
|
24
|
+
font-size: 0.9rem;
|
|
25
|
+
}
|
|
26
|
+
a {
|
|
27
|
+
color: #00bfff;
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
}
|
|
30
|
+
a:hover { text-decoration: underline; }
|
|
31
|
+
</style>
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<h1>{{modName}}</h1>
|
|
35
|
+
<p>Welcome to the website. You shouldn't be here.</p>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Website, RegisterWebsite, WebsitePageDefinition } from "@hotbunny/hackhub-content-sdk";
|
|
2
|
+
import homePage from "../pages/home.html";
|
|
3
|
+
|
|
4
|
+
@RegisterWebsite()
|
|
5
|
+
export class ExampleWebsite extends Website {
|
|
6
|
+
|
|
7
|
+
SiteName: string = "{{modName}}";
|
|
8
|
+
Host: string = "{{modId}}.mod";
|
|
9
|
+
Icon: string = "";
|
|
10
|
+
Pages: WebsitePageDefinition[] = [
|
|
11
|
+
{ path: "/", title: "Home", html: homePage },
|
|
12
|
+
];
|
|
13
|
+
}
|