@doodle-engine/cli 0.0.13 → 0.0.14
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/CHANGELOG.md +9 -0
- package/dist/cli.js +24 -18
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createServer as $, build as H } from "vite";
|
|
|
5
5
|
import j from "@vitejs/plugin-react";
|
|
6
6
|
import { watch as M } from "chokidar";
|
|
7
7
|
import { readdir as p, readFile as f, mkdir as D, writeFile as k } from "fs/promises";
|
|
8
|
-
import { join as d, extname as g, relative as
|
|
8
|
+
import { join as d, extname as g, relative as b, dirname as F } from "path";
|
|
9
9
|
import { parse as y } from "yaml";
|
|
10
10
|
import { parseDialogue as E } from "@doodle-engine/core";
|
|
11
11
|
import P from "prompts";
|
|
@@ -354,7 +354,7 @@ async function X(n) {
|
|
|
354
354
|
for (const l of c)
|
|
355
355
|
if (g(l) === ".yaml" || g(l) === ".yml") {
|
|
356
356
|
const u = d(e, l), h = await f(u, "utf-8"), m = y(h);
|
|
357
|
-
m && m.id && (o[s][m.id] = m, r.set(m.id,
|
|
357
|
+
m && m.id && (o[s][m.id] = m, r.set(m.id, b(process.cwd(), u)));
|
|
358
358
|
}
|
|
359
359
|
} catch {
|
|
360
360
|
}
|
|
@@ -373,7 +373,7 @@ async function X(n) {
|
|
|
373
373
|
for (const e of s)
|
|
374
374
|
if (g(e) === ".dlg") {
|
|
375
375
|
const c = d(t, e), l = await f(c, "utf-8"), u = e.replace(".dlg", ""), h = E(l, u);
|
|
376
|
-
o.dialogues[h.id] = h, r.set(h.id,
|
|
376
|
+
o.dialogues[h.id] = h, r.set(h.id, b(process.cwd(), c));
|
|
377
377
|
}
|
|
378
378
|
} catch {
|
|
379
379
|
}
|
|
@@ -432,7 +432,7 @@ async function ee(n) {
|
|
|
432
432
|
for (const u of l)
|
|
433
433
|
if (g(u) === ".yaml" || g(u) === ".yml") {
|
|
434
434
|
const h = d(c, u), m = await f(h, "utf-8"), w = y(m);
|
|
435
|
-
w && w.id && (o[e][w.id] = w, r.set(w.id,
|
|
435
|
+
w && w.id && (o[e][w.id] = w, r.set(w.id, b(process.cwd(), h)));
|
|
436
436
|
}
|
|
437
437
|
} catch {
|
|
438
438
|
}
|
|
@@ -451,7 +451,7 @@ async function ee(n) {
|
|
|
451
451
|
for (const c of e)
|
|
452
452
|
if (g(c) === ".dlg") {
|
|
453
453
|
const l = d(s, c), u = await f(l, "utf-8"), h = c.replace(".dlg", ""), m = E(u, h);
|
|
454
|
-
o.dialogues[m.id] = m, r.set(m.id,
|
|
454
|
+
o.dialogues[m.id] = m, r.set(m.id, b(process.cwd(), l));
|
|
455
455
|
}
|
|
456
456
|
} catch {
|
|
457
457
|
}
|
|
@@ -499,7 +499,7 @@ async function te(n) {
|
|
|
499
499
|
for (const l of c)
|
|
500
500
|
if (g(l) === ".yaml" || g(l) === ".yml") {
|
|
501
501
|
const u = d(e, l), h = await f(u, "utf-8"), m = y(h);
|
|
502
|
-
m && m.id && (o[s][m.id] = m, r.set(m.id,
|
|
502
|
+
m && m.id && (o[s][m.id] = m, r.set(m.id, b(process.cwd(), u)));
|
|
503
503
|
}
|
|
504
504
|
} catch {
|
|
505
505
|
}
|
|
@@ -518,7 +518,7 @@ async function te(n) {
|
|
|
518
518
|
for (const e of s)
|
|
519
519
|
if (g(e) === ".dlg") {
|
|
520
520
|
const c = d(t, e), l = await f(c, "utf-8"), u = e.replace(".dlg", ""), h = E(l, u);
|
|
521
|
-
o.dialogues[h.id] = h, r.set(h.id,
|
|
521
|
+
o.dialogues[h.id] = h, r.set(h.id, b(process.cwd(), c));
|
|
522
522
|
}
|
|
523
523
|
} catch {
|
|
524
524
|
}
|
|
@@ -648,6 +648,11 @@ NODE order_drink
|
|
|
648
648
|
GOTO after_drink
|
|
649
649
|
END
|
|
650
650
|
|
|
651
|
+
# Try to bluff a free drink — launches the skill check dialogue (demonstrates: START dialogue)
|
|
652
|
+
CHOICE @bartender.choice.try_bluff
|
|
653
|
+
START dialogue bluff_check
|
|
654
|
+
END
|
|
655
|
+
|
|
651
656
|
# Always available as an out
|
|
652
657
|
CHOICE @bartender.choice.too_rich
|
|
653
658
|
GOTO start
|
|
@@ -957,11 +962,11 @@ category: places
|
|
|
957
962
|
title: "@journal.odd_jobs_accepted.title"
|
|
958
963
|
text: "@journal.odd_jobs_accepted.text"
|
|
959
964
|
category: quests
|
|
960
|
-
`,
|
|
965
|
+
`, be = `id: tavern_discovery
|
|
961
966
|
title: "@journal.tavern_discovery.title"
|
|
962
967
|
text: "@journal.tavern_discovery.text"
|
|
963
968
|
category: places
|
|
964
|
-
`,
|
|
969
|
+
`, _e = `# ===================
|
|
965
970
|
# Narrator Intros
|
|
966
971
|
# ===================
|
|
967
972
|
narrator.tavern_intro: "You push open the heavy oak door and step inside. The warmth hits you first, then the smell — stale ale, wood smoke, and something frying in the kitchen. A few patrons hunch over their mugs. Behind the bar, a broad-shouldered man wipes down glasses, watching you with quiet interest."
|
|
@@ -1030,6 +1035,7 @@ bartender.choice.nevermind: "Never mind, just passing through."
|
|
|
1030
1035
|
bartender.choice.tell_me_more: "Tell me more about that."
|
|
1031
1036
|
bartender.choice.interesting: "Interesting. I'll keep that in mind."
|
|
1032
1037
|
bartender.choice.sure_pay: "Sure, here's five gold."
|
|
1038
|
+
bartender.choice.try_bluff: "Try to talk your way to a free drink."
|
|
1033
1039
|
bartender.choice.too_rich: "On second thought, I'll pass."
|
|
1034
1040
|
bartender.choice.back_to_chat: "So, what else?"
|
|
1035
1041
|
bartender.choice.accept_work: "Sure, I could use the coin."
|
|
@@ -1288,8 +1294,8 @@ createRoot(document.getElementById('root')!).render(
|
|
|
1288
1294
|
"./templates/content/items/old_coin.yaml": fe,
|
|
1289
1295
|
"./templates/content/journal/market_square.yaml": pe,
|
|
1290
1296
|
"./templates/content/journal/odd_jobs_accepted.yaml": ye,
|
|
1291
|
-
"./templates/content/journal/tavern_discovery.yaml":
|
|
1292
|
-
"./templates/content/locales/en.yaml":
|
|
1297
|
+
"./templates/content/journal/tavern_discovery.yaml": be,
|
|
1298
|
+
"./templates/content/locales/en.yaml": _e,
|
|
1293
1299
|
"./templates/content/locations/market.yaml": we,
|
|
1294
1300
|
"./templates/content/locations/tavern.yaml": ke,
|
|
1295
1301
|
"./templates/content/maps/town.yaml": Ee,
|
|
@@ -1378,18 +1384,18 @@ async function je(n, o, r) {
|
|
|
1378
1384
|
const s = r ? "./templates/src/App.default.tsx" : "./templates/src/App.custom.tsx";
|
|
1379
1385
|
await k(d(n, "src/App.tsx"), S[s]), console.log(i.green(` ${T} Source files created`)), console.log(""), console.log(` ${x} ${i.bold("Starter content written")}`), console.log(""), console.log(i.dim(" Content includes:")), console.log(i.dim(" 2 locations (tavern, market)")), console.log(i.dim(" 2 characters (bartender, merchant)")), console.log(i.dim(" 1 item (old coin)")), console.log(i.dim(" 1 map (town with 2 locations)")), console.log(i.dim(" 1 quest (odd jobs, 3 stages)")), console.log(i.dim(" 3 journal entries")), console.log(i.dim(" 1 interlude (chapter one, auto-triggers at tavern)")), console.log(i.dim(" 5 dialogues (2 narrator intros, 2 NPC conversations, 1 skill check)")), console.log(i.dim(" English locale with all strings"));
|
|
1380
1386
|
}
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1387
|
+
const _ = new G();
|
|
1388
|
+
_.name("doodle").description(i.magenta("🐾 Doodle Engine") + i.dim(" — Narrative RPG development tools")).version("0.0.1");
|
|
1389
|
+
_.command("create <project-name>").description("Scaffold a new Doodle Engine game project").action(async (n) => {
|
|
1384
1390
|
await Se(n);
|
|
1385
1391
|
});
|
|
1386
|
-
|
|
1392
|
+
_.command("dev").description("Start development server with hot reload").action(async () => {
|
|
1387
1393
|
await K();
|
|
1388
1394
|
});
|
|
1389
|
-
|
|
1395
|
+
_.command("build").description("Build game for production").action(async () => {
|
|
1390
1396
|
await Z();
|
|
1391
1397
|
});
|
|
1392
|
-
|
|
1398
|
+
_.command("validate").description("Validate game content").action(async () => {
|
|
1393
1399
|
await ne();
|
|
1394
1400
|
});
|
|
1395
|
-
|
|
1401
|
+
_.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doodle-engine/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tools for Doodle Engine game development",
|
|
6
6
|
"bin": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"test": "echo no tests"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@doodle-engine/core": "0.0.
|
|
19
|
-
"@doodle-engine/react": "0.0.
|
|
18
|
+
"@doodle-engine/core": "0.0.14",
|
|
19
|
+
"@doodle-engine/react": "0.0.14",
|
|
20
20
|
"@vitejs/plugin-react": "^4.3.0",
|
|
21
21
|
"chokidar": "^4.0.0",
|
|
22
22
|
"commander": "^12.0.0",
|