bonescript-compiler 0.5.4 → 0.5.6
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/cli.js +94 -4
- package/dist/cli.js.map +1 -1
- package/dist/emit_audit.d.ts +7 -0
- package/dist/emit_audit.js +89 -0
- package/dist/emit_audit.js.map +1 -0
- package/dist/emit_full.js +19 -0
- package/dist/emit_full.js.map +1 -1
- package/dist/emit_nakama.d.ts +23 -0
- package/dist/emit_nakama.js +510 -0
- package/dist/emit_nakama.js.map +1 -0
- package/dist/emit_openapi.d.ts +7 -0
- package/dist/emit_openapi.js +333 -0
- package/dist/emit_openapi.js.map +1 -0
- package/dist/emit_postman.d.ts +6 -0
- package/dist/emit_postman.js +126 -0
- package/dist/emit_postman.js.map +1 -0
- package/dist/emit_sdk.d.ts +7 -0
- package/dist/emit_sdk.js +162 -0
- package/dist/emit_sdk.js.map +1 -0
- package/dist/emit_seed.d.ts +6 -0
- package/dist/emit_seed.js +88 -0
- package/dist/emit_seed.js.map +1 -0
- package/dist/emit_zod.d.ts +7 -0
- package/dist/emit_zod.js +115 -0
- package/dist/emit_zod.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/cli.ts +97 -4
- package/src/emit_audit.ts +112 -0
- package/src/emit_full.ts +25 -0
- package/src/emit_nakama.ts +576 -0
- package/src/emit_openapi.ts +344 -0
- package/src/emit_postman.ts +145 -0
- package/src/emit_sdk.ts +195 -0
- package/src/emit_seed.ts +91 -0
- package/src/emit_zod.ts +111 -0
- package/src/index.ts +10 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* BoneScript Nakama Emitter
|
|
4
|
+
*
|
|
5
|
+
* Generates a Nakama TypeScript runtime module from an IRSystem.
|
|
6
|
+
* Output is a self-contained src/index.ts that registers:
|
|
7
|
+
* - nk.registerRpc() for every capability (capability -> RPC)
|
|
8
|
+
* - nk.registerMatch() for every realtime_service module (channel -> match handler)
|
|
9
|
+
* - Storage helpers for every entity/model (entity -> storage object)
|
|
10
|
+
* - Event hooks for every event emission (event -> stream send)
|
|
11
|
+
*
|
|
12
|
+
* Deploy with: nakama migrate up && nakama --runtime.path ./build
|
|
13
|
+
* Docs: https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.NakamaEmitter = void 0;
|
|
17
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
18
|
+
function toSnakeCase(s) {
|
|
19
|
+
return s.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
function toCamelCase(s) {
|
|
22
|
+
return s.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
|
|
23
|
+
}
|
|
24
|
+
function toPascalCase(s) {
|
|
25
|
+
const c = toCamelCase(s);
|
|
26
|
+
return c.charAt(0).toUpperCase() + c.slice(1);
|
|
27
|
+
}
|
|
28
|
+
const TS_TYPE_MAP = {
|
|
29
|
+
string: "string",
|
|
30
|
+
uint: "number",
|
|
31
|
+
int: "number",
|
|
32
|
+
float: "number",
|
|
33
|
+
bool: "boolean",
|
|
34
|
+
timestamp: "string", // ISO string — Nakama runtime has no Date
|
|
35
|
+
uuid: "string",
|
|
36
|
+
bytes: "string", // base64 in Nakama
|
|
37
|
+
json: "unknown",
|
|
38
|
+
};
|
|
39
|
+
function toTsType(irType) {
|
|
40
|
+
if (TS_TYPE_MAP[irType])
|
|
41
|
+
return TS_TYPE_MAP[irType];
|
|
42
|
+
const listMatch = irType.match(/^list<(.+)>$/);
|
|
43
|
+
if (listMatch)
|
|
44
|
+
return `${toTsType(listMatch[1])}[]`;
|
|
45
|
+
const setMatch = irType.match(/^set<(.+)>$/);
|
|
46
|
+
if (setMatch)
|
|
47
|
+
return `${toTsType(setMatch[1])}[]`;
|
|
48
|
+
const optMatch = irType.match(/^optional<(.+)>$/);
|
|
49
|
+
if (optMatch)
|
|
50
|
+
return `${toTsType(optMatch[1])} | null`;
|
|
51
|
+
return irType;
|
|
52
|
+
}
|
|
53
|
+
// ─── Package.json ─────────────────────────────────────────────────────────────
|
|
54
|
+
function emitNakamaPackageJson(system) {
|
|
55
|
+
return JSON.stringify({
|
|
56
|
+
name: toSnakeCase(system.name),
|
|
57
|
+
version: system.version,
|
|
58
|
+
private: true,
|
|
59
|
+
scripts: {
|
|
60
|
+
build: "npx tsc",
|
|
61
|
+
dev: "npx tsc --watch",
|
|
62
|
+
},
|
|
63
|
+
devDependencies: {
|
|
64
|
+
"@heroiclabs/nakama-runtime": "1.16.0",
|
|
65
|
+
typescript: "5.3.3",
|
|
66
|
+
"ts-node": "10.9.2",
|
|
67
|
+
},
|
|
68
|
+
}, null, 2);
|
|
69
|
+
}
|
|
70
|
+
// ─── tsconfig.json ────────────────────────────────────────────────────────────
|
|
71
|
+
function emitNakamaTsConfig() {
|
|
72
|
+
return JSON.stringify({
|
|
73
|
+
compilerOptions: {
|
|
74
|
+
target: "ES2020",
|
|
75
|
+
module: "commonjs",
|
|
76
|
+
lib: ["ES2020"],
|
|
77
|
+
outDir: "./build",
|
|
78
|
+
rootDir: "./src",
|
|
79
|
+
strict: true,
|
|
80
|
+
esModuleInterop: true,
|
|
81
|
+
skipLibCheck: true,
|
|
82
|
+
},
|
|
83
|
+
include: ["src/**/*"],
|
|
84
|
+
exclude: ["node_modules", "build"],
|
|
85
|
+
}, null, 2);
|
|
86
|
+
}
|
|
87
|
+
// ─── Storage helpers ──────────────────────────────────────────────────────────
|
|
88
|
+
// One collection per entity. Nakama storage: collection/key/userId pattern.
|
|
89
|
+
function emitStorageHelpers(system) {
|
|
90
|
+
const lines = [];
|
|
91
|
+
lines.push(`// Generated by BoneScript compiler. DO NOT EDIT.`);
|
|
92
|
+
lines.push(`// Storage helpers — one Nakama storage collection per entity.`);
|
|
93
|
+
lines.push(``);
|
|
94
|
+
lines.push(`const nkRuntime: nkruntime.Nakama = (globalThis as any).__nk;`);
|
|
95
|
+
lines.push(``);
|
|
96
|
+
for (const mod of system.modules) {
|
|
97
|
+
for (const model of mod.models) {
|
|
98
|
+
const collection = toSnakeCase(model.name) + "s";
|
|
99
|
+
const typeName = toPascalCase(model.name);
|
|
100
|
+
// TypeScript interface
|
|
101
|
+
lines.push(`export interface ${typeName} {`);
|
|
102
|
+
for (const field of model.fields) {
|
|
103
|
+
const nullable = field.nullable ? " | null" : "";
|
|
104
|
+
lines.push(` ${field.name}: ${toTsType(field.type)}${nullable};`);
|
|
105
|
+
}
|
|
106
|
+
lines.push(`}`);
|
|
107
|
+
lines.push(``);
|
|
108
|
+
// read
|
|
109
|
+
lines.push(`export function read${typeName}(nk: nkruntime.Nakama, userId: string, id: string): ${typeName} | null {`);
|
|
110
|
+
lines.push(` const objs = nk.storageRead([{ collection: "${collection}", key: id, userId }]);`);
|
|
111
|
+
lines.push(` if (objs.length === 0) return null;`);
|
|
112
|
+
lines.push(` return JSON.parse(objs[0].value) as ${typeName};`);
|
|
113
|
+
lines.push(`}`);
|
|
114
|
+
lines.push(``);
|
|
115
|
+
// write
|
|
116
|
+
lines.push(`export function write${typeName}(nk: nkruntime.Nakama, userId: string, obj: ${typeName}): void {`);
|
|
117
|
+
lines.push(` nk.storageWrite([{`);
|
|
118
|
+
lines.push(` collection: "${collection}",`);
|
|
119
|
+
lines.push(` key: (obj as any).id ?? userId,`);
|
|
120
|
+
lines.push(` userId,`);
|
|
121
|
+
lines.push(` value: JSON.stringify(obj),`);
|
|
122
|
+
lines.push(` permissionRead: 1,`);
|
|
123
|
+
lines.push(` permissionWrite: 0,`);
|
|
124
|
+
lines.push(` }]);`);
|
|
125
|
+
lines.push(`}`);
|
|
126
|
+
lines.push(``);
|
|
127
|
+
// delete
|
|
128
|
+
lines.push(`export function delete${typeName}(nk: nkruntime.Nakama, userId: string, id: string): void {`);
|
|
129
|
+
lines.push(` nk.storageDelete([{ collection: "${collection}", key: id, userId }]);`);
|
|
130
|
+
lines.push(`}`);
|
|
131
|
+
lines.push(``);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return lines.join("\n");
|
|
135
|
+
}
|
|
136
|
+
// ─── RPC handlers (capabilities) ─────────────────────────────────────────────
|
|
137
|
+
function emitRpcHandlers(system) {
|
|
138
|
+
const lines = [];
|
|
139
|
+
lines.push(`// Generated by BoneScript compiler. DO NOT EDIT.`);
|
|
140
|
+
lines.push(`// RPC handlers — one nk.registerRpc() per capability.`);
|
|
141
|
+
lines.push(``);
|
|
142
|
+
lines.push(`import * as storage from "./storage";`);
|
|
143
|
+
lines.push(``);
|
|
144
|
+
for (const mod of system.modules) {
|
|
145
|
+
for (const iface of mod.interfaces) {
|
|
146
|
+
for (const method of iface.methods) {
|
|
147
|
+
const rpcId = `${toSnakeCase(mod.name)}/${toSnakeCase(method.name)}`;
|
|
148
|
+
const fnName = `rpc${toPascalCase(mod.name)}${toPascalCase(method.name)}`;
|
|
149
|
+
lines.push(`// RPC: ${rpcId}`);
|
|
150
|
+
lines.push(`// Capability: ${method.name} on ${mod.name}`);
|
|
151
|
+
if (method.preconditions.length > 0) {
|
|
152
|
+
lines.push(`// Preconditions: ${method.preconditions.map(p => p.description).join(", ")}`);
|
|
153
|
+
}
|
|
154
|
+
lines.push(`const ${fnName}: nkruntime.RpcFunction = (`);
|
|
155
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
156
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
157
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
158
|
+
lines.push(` payload: string`);
|
|
159
|
+
lines.push(`): string => {`);
|
|
160
|
+
// Auth guard
|
|
161
|
+
if (method.authenticated) {
|
|
162
|
+
lines.push(` if (!ctx.userId) {`);
|
|
163
|
+
lines.push(` throw Error("Authentication required");`);
|
|
164
|
+
lines.push(` }`);
|
|
165
|
+
}
|
|
166
|
+
// Parse payload
|
|
167
|
+
if (method.input.length > 0) {
|
|
168
|
+
const inputType = method.input.map(f => `${f.name}: ${toTsType(f.type)}`).join("; ");
|
|
169
|
+
lines.push(` const input: { ${inputType} } = payload ? JSON.parse(payload) : {};`);
|
|
170
|
+
}
|
|
171
|
+
// Precondition stubs
|
|
172
|
+
if (method.preconditions.length > 0) {
|
|
173
|
+
lines.push(``);
|
|
174
|
+
lines.push(` // Preconditions`);
|
|
175
|
+
for (const pre of method.preconditions) {
|
|
176
|
+
lines.push(` // CHECK: ${pre.description}`);
|
|
177
|
+
lines.push(` // if (!(${pre.expression})) throw Error("Precondition failed: ${pre.description.replace(/"/g, "'")}"); `);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// Effect stubs
|
|
181
|
+
if (method.effects.length > 0) {
|
|
182
|
+
lines.push(``);
|
|
183
|
+
lines.push(` // Effects`);
|
|
184
|
+
for (const eff of method.effects) {
|
|
185
|
+
const op = eff.op === "assign" ? "=" : eff.op === "add" ? "+=" : "-=";
|
|
186
|
+
lines.push(` // EFFECT: ${eff.target} ${op} ${eff.value}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Event emissions via Nakama streams
|
|
190
|
+
if (method.emissions.length > 0) {
|
|
191
|
+
lines.push(``);
|
|
192
|
+
lines.push(` // Event emissions — broadcast to stream subscribers`);
|
|
193
|
+
for (const ev of method.emissions) {
|
|
194
|
+
lines.push(` nk.streamSend(`);
|
|
195
|
+
lines.push(` { mode: 1, subject: ctx.userId ?? "", label: "${ev}" },`);
|
|
196
|
+
lines.push(` JSON.stringify({ event: "${ev}", actor: ctx.userId, ts: Date.now() }),`);
|
|
197
|
+
lines.push(` undefined,`);
|
|
198
|
+
lines.push(` true`);
|
|
199
|
+
lines.push(` );`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
lines.push(``);
|
|
203
|
+
lines.push(` logger.info("rpc_called", "${rpcId}", ctx.userId ?? "anon");`);
|
|
204
|
+
lines.push(` return JSON.stringify({ ok: true, action: "${method.name}" });`);
|
|
205
|
+
lines.push(`};`);
|
|
206
|
+
lines.push(``);
|
|
207
|
+
// Export the function name and rpc id for registration
|
|
208
|
+
lines.push(`export const ${fnName}Id = "${rpcId}";`);
|
|
209
|
+
lines.push(`export { ${fnName} };`);
|
|
210
|
+
lines.push(``);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return lines.join("\n");
|
|
215
|
+
}
|
|
216
|
+
// ─── Match handler (realtime channels) ───────────────────────────────────────
|
|
217
|
+
function emitMatchHandlers(system) {
|
|
218
|
+
const realtimeMods = system.modules.filter(m => m.kind === "realtime_service");
|
|
219
|
+
if (realtimeMods.length === 0)
|
|
220
|
+
return "";
|
|
221
|
+
const lines = [];
|
|
222
|
+
lines.push(`// Generated by BoneScript compiler. DO NOT EDIT.`);
|
|
223
|
+
lines.push(`// Match handlers — one per realtime_service module.`);
|
|
224
|
+
lines.push(``);
|
|
225
|
+
for (const mod of realtimeMods) {
|
|
226
|
+
const handlerName = `${toCamelCase(mod.name)}MatchHandler`;
|
|
227
|
+
const matchName = toSnakeCase(mod.name);
|
|
228
|
+
lines.push(`// Match handler for channel: ${mod.name}`);
|
|
229
|
+
lines.push(`const ${handlerName}: nkruntime.MatchHandler = {`);
|
|
230
|
+
lines.push(``);
|
|
231
|
+
// matchInit
|
|
232
|
+
lines.push(` matchInit(`);
|
|
233
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
234
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
235
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
236
|
+
lines.push(` params: { [key: string]: string }`);
|
|
237
|
+
lines.push(` ): { state: unknown; tickRate: number; label: string } {`);
|
|
238
|
+
lines.push(` logger.info("match_init", "${matchName}");`);
|
|
239
|
+
lines.push(` return {`);
|
|
240
|
+
lines.push(` state: { players: {}, tick: 0 },`);
|
|
241
|
+
lines.push(` tickRate: ${mod.config["tick_rate"] ?? 10},`);
|
|
242
|
+
lines.push(` label: "${matchName}",`);
|
|
243
|
+
lines.push(` };`);
|
|
244
|
+
lines.push(` },`);
|
|
245
|
+
lines.push(``);
|
|
246
|
+
// matchJoinAttempt
|
|
247
|
+
lines.push(` matchJoinAttempt(`);
|
|
248
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
249
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
250
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
251
|
+
lines.push(` dispatcher: nkruntime.MatchDispatcher,`);
|
|
252
|
+
lines.push(` tick: number,`);
|
|
253
|
+
lines.push(` state: unknown,`);
|
|
254
|
+
lines.push(` presence: nkruntime.Presence,`);
|
|
255
|
+
lines.push(` metadata: { [key: string]: any }`);
|
|
256
|
+
lines.push(` ): { state: unknown; accept: boolean; rejectMessage?: string } {`);
|
|
257
|
+
lines.push(` return { state, accept: true };`);
|
|
258
|
+
lines.push(` },`);
|
|
259
|
+
lines.push(``);
|
|
260
|
+
// matchJoin
|
|
261
|
+
lines.push(` matchJoin(`);
|
|
262
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
263
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
264
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
265
|
+
lines.push(` dispatcher: nkruntime.MatchDispatcher,`);
|
|
266
|
+
lines.push(` tick: number,`);
|
|
267
|
+
lines.push(` state: unknown,`);
|
|
268
|
+
lines.push(` presences: nkruntime.Presence[]`);
|
|
269
|
+
lines.push(` ): { state: unknown } | null {`);
|
|
270
|
+
lines.push(` const s = state as any;`);
|
|
271
|
+
lines.push(` for (const p of presences) {`);
|
|
272
|
+
lines.push(` s.players[p.userId] = { userId: p.userId, sessionId: p.sessionId, joinedAt: Date.now() };`);
|
|
273
|
+
lines.push(` }`);
|
|
274
|
+
lines.push(` dispatcher.broadcastMessage(1, JSON.stringify({ type: "player_joined", players: Object.keys(s.players) }), null, null, true);`);
|
|
275
|
+
lines.push(` return { state: s };`);
|
|
276
|
+
lines.push(` },`);
|
|
277
|
+
lines.push(``);
|
|
278
|
+
// matchLeave
|
|
279
|
+
lines.push(` matchLeave(`);
|
|
280
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
281
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
282
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
283
|
+
lines.push(` dispatcher: nkruntime.MatchDispatcher,`);
|
|
284
|
+
lines.push(` tick: number,`);
|
|
285
|
+
lines.push(` state: unknown,`);
|
|
286
|
+
lines.push(` presences: nkruntime.Presence[]`);
|
|
287
|
+
lines.push(` ): { state: unknown } | null {`);
|
|
288
|
+
lines.push(` const s = state as any;`);
|
|
289
|
+
lines.push(` for (const p of presences) delete s.players[p.userId];`);
|
|
290
|
+
lines.push(` if (Object.keys(s.players).length === 0) return null; // end match`);
|
|
291
|
+
lines.push(` return { state: s };`);
|
|
292
|
+
lines.push(` },`);
|
|
293
|
+
lines.push(``);
|
|
294
|
+
// matchLoop
|
|
295
|
+
lines.push(` matchLoop(`);
|
|
296
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
297
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
298
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
299
|
+
lines.push(` dispatcher: nkruntime.MatchDispatcher,`);
|
|
300
|
+
lines.push(` tick: number,`);
|
|
301
|
+
lines.push(` state: unknown,`);
|
|
302
|
+
lines.push(` messages: nkruntime.MatchMessage[]`);
|
|
303
|
+
lines.push(` ): { state: unknown } | null {`);
|
|
304
|
+
lines.push(` const s = state as any;`);
|
|
305
|
+
lines.push(` s.tick = tick;`);
|
|
306
|
+
lines.push(` for (const msg of messages) {`);
|
|
307
|
+
lines.push(` // Route incoming messages to capability handlers`);
|
|
308
|
+
lines.push(` try {`);
|
|
309
|
+
lines.push(` const data = JSON.parse(nk.binaryToString(msg.data));`);
|
|
310
|
+
lines.push(` dispatcher.broadcastMessage(msg.opCode, msg.data, null, msg.sender, true);`);
|
|
311
|
+
lines.push(` } catch (e) {`);
|
|
312
|
+
lines.push(` logger.error("match_message_error", String(e));`);
|
|
313
|
+
lines.push(` }`);
|
|
314
|
+
lines.push(` }`);
|
|
315
|
+
lines.push(` return { state: s };`);
|
|
316
|
+
lines.push(` },`);
|
|
317
|
+
lines.push(``);
|
|
318
|
+
// matchTerminate
|
|
319
|
+
lines.push(` matchTerminate(`);
|
|
320
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
321
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
322
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
323
|
+
lines.push(` dispatcher: nkruntime.MatchDispatcher,`);
|
|
324
|
+
lines.push(` tick: number,`);
|
|
325
|
+
lines.push(` state: unknown,`);
|
|
326
|
+
lines.push(` graceSeconds: number`);
|
|
327
|
+
lines.push(` ): { state: unknown } | null {`);
|
|
328
|
+
lines.push(` dispatcher.broadcastMessage(0, JSON.stringify({ type: "match_terminated" }), null, null, true);`);
|
|
329
|
+
lines.push(` return null;`);
|
|
330
|
+
lines.push(` },`);
|
|
331
|
+
lines.push(``);
|
|
332
|
+
// matchSignal
|
|
333
|
+
lines.push(` matchSignal(`);
|
|
334
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
335
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
336
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
337
|
+
lines.push(` dispatcher: nkruntime.MatchDispatcher,`);
|
|
338
|
+
lines.push(` tick: number,`);
|
|
339
|
+
lines.push(` state: unknown,`);
|
|
340
|
+
lines.push(` data: string`);
|
|
341
|
+
lines.push(` ): { state: unknown; data: string } {`);
|
|
342
|
+
lines.push(` return { state, data };`);
|
|
343
|
+
lines.push(` },`);
|
|
344
|
+
lines.push(`};`);
|
|
345
|
+
lines.push(``);
|
|
346
|
+
lines.push(`export const ${handlerName}Name = "${matchName}";`);
|
|
347
|
+
lines.push(`export { ${handlerName} };`);
|
|
348
|
+
lines.push(``);
|
|
349
|
+
}
|
|
350
|
+
return lines.join("\n");
|
|
351
|
+
}
|
|
352
|
+
// ─── Main entry point (InitModule) ───────────────────────────────────────────
|
|
353
|
+
function emitNakamaIndex(system) {
|
|
354
|
+
const lines = [];
|
|
355
|
+
lines.push(`// Generated by BoneScript compiler. DO NOT EDIT.`);
|
|
356
|
+
lines.push(`// Nakama TypeScript runtime module for: ${system.name}`);
|
|
357
|
+
lines.push(`// Deploy: copy build/ to Nakama runtime path and restart.`);
|
|
358
|
+
lines.push(``);
|
|
359
|
+
lines.push(`import * as rpc from "./rpc";`);
|
|
360
|
+
const hasRealtime = system.modules.some(m => m.kind === "realtime_service");
|
|
361
|
+
if (hasRealtime) {
|
|
362
|
+
lines.push(`import * as match from "./match";`);
|
|
363
|
+
}
|
|
364
|
+
lines.push(``);
|
|
365
|
+
lines.push(`function InitModule(`);
|
|
366
|
+
lines.push(` ctx: nkruntime.Context,`);
|
|
367
|
+
lines.push(` logger: nkruntime.Logger,`);
|
|
368
|
+
lines.push(` nk: nkruntime.Nakama,`);
|
|
369
|
+
lines.push(` initializer: nkruntime.Initializer`);
|
|
370
|
+
lines.push(`): Error | void {`);
|
|
371
|
+
lines.push(` logger.info("init_module", "${system.name} v${system.version}");`);
|
|
372
|
+
lines.push(``);
|
|
373
|
+
// Register all RPCs
|
|
374
|
+
const allMethods = [];
|
|
375
|
+
for (const mod of system.modules) {
|
|
376
|
+
for (const iface of mod.interfaces) {
|
|
377
|
+
for (const method of iface.methods) {
|
|
378
|
+
allMethods.push({ mod, method });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (allMethods.length > 0) {
|
|
383
|
+
lines.push(` // Register RPC handlers`);
|
|
384
|
+
for (const { mod, method } of allMethods) {
|
|
385
|
+
const fnName = `rpc${toPascalCase(mod.name)}${toPascalCase(method.name)}`;
|
|
386
|
+
lines.push(` initializer.registerRpc(rpc.${fnName}Id, rpc.${fnName});`);
|
|
387
|
+
}
|
|
388
|
+
lines.push(``);
|
|
389
|
+
}
|
|
390
|
+
// Register match handlers
|
|
391
|
+
if (hasRealtime) {
|
|
392
|
+
const realtimeMods = system.modules.filter(m => m.kind === "realtime_service");
|
|
393
|
+
lines.push(` // Register match handlers`);
|
|
394
|
+
for (const mod of realtimeMods) {
|
|
395
|
+
const handlerName = `${toCamelCase(mod.name)}MatchHandler`;
|
|
396
|
+
lines.push(` initializer.registerMatch(match.${handlerName}Name, match.${handlerName});`);
|
|
397
|
+
}
|
|
398
|
+
lines.push(``);
|
|
399
|
+
}
|
|
400
|
+
lines.push(` logger.info("init_complete", "${allMethods.length} RPCs, ${hasRealtime ? system.modules.filter(m => m.kind === "realtime_service").length : 0} match handlers");`);
|
|
401
|
+
lines.push(`}`);
|
|
402
|
+
lines.push(``);
|
|
403
|
+
lines.push(`// Required Nakama module export`);
|
|
404
|
+
lines.push(`(globalThis as any).InitModule = InitModule;`);
|
|
405
|
+
return lines.join("\n");
|
|
406
|
+
}
|
|
407
|
+
// ─── README ───────────────────────────────────────────────────────────────────
|
|
408
|
+
function emitNakamaReadme(system) {
|
|
409
|
+
const rpcs = [];
|
|
410
|
+
for (const mod of system.modules) {
|
|
411
|
+
for (const iface of mod.interfaces) {
|
|
412
|
+
for (const method of iface.methods) {
|
|
413
|
+
rpcs.push(`- \`${toSnakeCase(mod.name)}/${toSnakeCase(method.name)}\``);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const realtimeMods = system.modules.filter(m => m.kind === "realtime_service");
|
|
418
|
+
return `# ${system.name} — Nakama Backend
|
|
419
|
+
|
|
420
|
+
Generated by BoneScript compiler (target: nakama). Source hash: ${system.source_hash}
|
|
421
|
+
|
|
422
|
+
## Quick Start
|
|
423
|
+
|
|
424
|
+
\`\`\`bash
|
|
425
|
+
# Install deps
|
|
426
|
+
npm install
|
|
427
|
+
|
|
428
|
+
# Build TypeScript -> JS
|
|
429
|
+
npm run build
|
|
430
|
+
|
|
431
|
+
# Start Nakama with this module
|
|
432
|
+
docker run --rm -v $(pwd)/build:/nakama/data/modules \\
|
|
433
|
+
heroiclabs/nakama:latest
|
|
434
|
+
\`\`\`
|
|
435
|
+
|
|
436
|
+
## RPC Endpoints
|
|
437
|
+
|
|
438
|
+
Call these from any Nakama client SDK:
|
|
439
|
+
|
|
440
|
+
${rpcs.join("\n")}
|
|
441
|
+
|
|
442
|
+
## Match Handlers
|
|
443
|
+
|
|
444
|
+
${realtimeMods.length > 0
|
|
445
|
+
? realtimeMods.map(m => `- \`${toSnakeCase(m.name)}\` (tick rate: ${m.config["tick_rate"] ?? 10}/s)`).join("\n")
|
|
446
|
+
: "_No realtime channels declared._"}
|
|
447
|
+
|
|
448
|
+
## Storage Collections
|
|
449
|
+
|
|
450
|
+
${system.modules.flatMap(m => m.models).map(m => `- \`${toSnakeCase(m.name)}s\``).join("\n") || "_No entities declared._"}
|
|
451
|
+
|
|
452
|
+
## Auth
|
|
453
|
+
|
|
454
|
+
All authenticated RPCs require a valid Nakama session token.
|
|
455
|
+
Use any Nakama client SDK to authenticate before calling RPCs.
|
|
456
|
+
`;
|
|
457
|
+
}
|
|
458
|
+
class NakamaEmitter {
|
|
459
|
+
emit(system) {
|
|
460
|
+
const files = [];
|
|
461
|
+
files.push({
|
|
462
|
+
path: "package.json",
|
|
463
|
+
content: emitNakamaPackageJson(system),
|
|
464
|
+
language: "json",
|
|
465
|
+
source_module: "root",
|
|
466
|
+
});
|
|
467
|
+
files.push({
|
|
468
|
+
path: "tsconfig.json",
|
|
469
|
+
content: emitNakamaTsConfig(),
|
|
470
|
+
language: "json",
|
|
471
|
+
source_module: "root",
|
|
472
|
+
});
|
|
473
|
+
files.push({
|
|
474
|
+
path: "src/storage.ts",
|
|
475
|
+
content: emitStorageHelpers(system),
|
|
476
|
+
language: "typescript",
|
|
477
|
+
source_module: "storage",
|
|
478
|
+
});
|
|
479
|
+
files.push({
|
|
480
|
+
path: "src/rpc.ts",
|
|
481
|
+
content: emitRpcHandlers(system),
|
|
482
|
+
language: "typescript",
|
|
483
|
+
source_module: "rpc",
|
|
484
|
+
});
|
|
485
|
+
const matchContent = emitMatchHandlers(system);
|
|
486
|
+
if (matchContent) {
|
|
487
|
+
files.push({
|
|
488
|
+
path: "src/match.ts",
|
|
489
|
+
content: matchContent,
|
|
490
|
+
language: "typescript",
|
|
491
|
+
source_module: "match",
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
files.push({
|
|
495
|
+
path: "src/index.ts",
|
|
496
|
+
content: emitNakamaIndex(system),
|
|
497
|
+
language: "typescript",
|
|
498
|
+
source_module: "root",
|
|
499
|
+
});
|
|
500
|
+
files.push({
|
|
501
|
+
path: "README.md",
|
|
502
|
+
content: emitNakamaReadme(system),
|
|
503
|
+
language: "markdown",
|
|
504
|
+
source_module: "root",
|
|
505
|
+
});
|
|
506
|
+
return files;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
exports.NakamaEmitter = NakamaEmitter;
|
|
510
|
+
//# sourceMappingURL=emit_nakama.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit_nakama.js","sourceRoot":"","sources":["../src/emit_nakama.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAKH,iFAAiF;AAEjF,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACzB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,C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,EAAE,MAAM;YAChB,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;QAEH,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,kBAAkB,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,YAAY;YACtB,aAAa,EAAE,SAAS;SACzB,CAAC,CAAC;QAEH,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;YAChC,QAAQ,EAAE,YAAY;YACtB,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,YAAY,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,YAAY;gBACrB,QAAQ,EAAE,YAAY;gBACtB,aAAa,EAAE,OAAO;aACvB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC;YAChC,QAAQ,EAAE,YAAY;YACtB,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;QAEH,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC;YACjC,QAAQ,EAAE,UAAU;YACpB,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA1DD,sCA0DC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BoneScript OpenAPI Emitter
|
|
3
|
+
* Generates OpenAPI 3.0.3 YAML and JSON specs from an IRSystem.
|
|
4
|
+
*/
|
|
5
|
+
import * as IR from "./ir";
|
|
6
|
+
export declare function emitOpenApiSpec(system: IR.IRSystem): string;
|
|
7
|
+
export declare function emitOpenApiJson(system: IR.IRSystem): string;
|