create-debuff 0.13.3 → 0.15.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.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts +8 -0
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +20 -2
- package/dist/interactive.js.map +1 -1
- package/dist/official.d.ts +2 -0
- package/dist/official.d.ts.map +1 -1
- package/dist/official.js +32 -1
- package/dist/official.js.map +1 -1
- package/dist/scaffold.d.ts +3 -0
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +5 -3
- package/dist/scaffold.js.map +1 -1
- package/package.json +1 -1
- package/templates/basic/.mcp.json +2 -1
- package/templates/basic/AGENTS.md +4 -2
- package/templates/basic/package.json +6 -6
- package/templates/basic/template.json +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as pc } from "./ansi.js";
|
|
2
2
|
export { amber, badge, banner, buff, LIME, lime, type Mood, PALETTE, type PaletteColor, paint, pink, sky, violet } from "./brand.js";
|
|
3
|
-
export { type CreateOptions, runCreate } from "./interactive.js";
|
|
3
|
+
export { type CreateOptions, runCreate, templateOptions } from "./interactive.js";
|
|
4
4
|
export { OFFICIAL_TEMPLATES, type OfficialTemplate } from "./official.js";
|
|
5
|
-
export { create, detectPackageManager, isEmptyDir, isRemoteTemplate, listTemplates, ownVersion, packageName, pinnedSource, resolveTemplate, type ScaffoldOptions, scaffold, scaffoldRemote, type TemplateInfo, templatesDir, } from "./scaffold.js";
|
|
5
|
+
export { create, detectPackageManager, isEmptyDir, isRemoteTemplate, listTemplates, ownVersion, packageName, pinnedSource, resolveTemplate, type ScaffoldOptions, scaffold, scaffoldRemote, type TemplateInfo, type TemplateKind, templatesDir, } from "./scaffold.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrI,OAAO,EAAE,KAAK,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrI,OAAO,EAAE,KAAK,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,KAAK,eAAe,EACpB,QAAQ,EACR,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,YAAY,GACb,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as pc } from "./ansi.js";
|
|
2
2
|
export { amber, badge, banner, buff, LIME, lime, PALETTE, paint, pink, sky, violet } from "./brand.js";
|
|
3
|
-
export { runCreate } from "./interactive.js";
|
|
3
|
+
export { runCreate, templateOptions } from "./interactive.js";
|
|
4
4
|
export { OFFICIAL_TEMPLATES } from "./official.js";
|
|
5
5
|
export { create, detectPackageManager, isEmptyDir, isRemoteTemplate, listTemplates, ownVersion, packageName, pinnedSource, resolveTemplate, scaffold, scaffoldRemote, templatesDir, } from "./scaffold.js";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAa,OAAO,EAAqB,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrI,OAAO,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAa,OAAO,EAAqB,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACrI,OAAO,EAAsB,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAyB,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EAEf,QAAQ,EACR,cAAc,EAGd,YAAY,GACb,MAAM,eAAe,CAAC"}
|
package/dist/interactive.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { type TemplateInfo } from "./scaffold.js";
|
|
1
2
|
export interface CreateOptions {
|
|
2
3
|
dir?: string | undefined;
|
|
3
4
|
template?: string | undefined;
|
|
4
5
|
/** Accept defaults without prompting (CI, agents). */
|
|
5
6
|
yes?: boolean;
|
|
6
7
|
}
|
|
8
|
+
/** The template list as select options, under a heading per kind. Headings are disabled rows, so the cursor skips them. */
|
|
9
|
+
export declare function templateOptions(templates: readonly TemplateInfo[]): {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}[];
|
|
7
15
|
/** Interactive scaffold flow. Falls back to defaults when stdin is not a TTY so agents
|
|
8
16
|
* and CI can call it non-interactively. */
|
|
9
17
|
export declare function runCreate(options: CreateOptions): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,sDAAsD;IACtD,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,2HAA2H;AAC3H,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,CAazI;AAED;4CAC4C;AAC5C,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAqDvE"}
|
package/dist/interactive.js
CHANGED
|
@@ -3,7 +3,24 @@ import { join, relative } from "node:path";
|
|
|
3
3
|
import * as p from "@clack/prompts";
|
|
4
4
|
import pc from "./ansi.js";
|
|
5
5
|
import { banner, lime, pink, sky } from "./brand.js";
|
|
6
|
-
import { create, detectPackageManager, isEmptyDir, listTemplates, ownVersion, resolveTemplate } from "./scaffold.js";
|
|
6
|
+
import { create, detectPackageManager, isEmptyDir, listTemplates, ownVersion, resolveTemplate, } from "./scaffold.js";
|
|
7
|
+
/** The template list as select options, under a heading per kind. Headings are disabled rows, so the cursor skips them. */
|
|
8
|
+
export function templateOptions(templates) {
|
|
9
|
+
const heading = {
|
|
10
|
+
base: "Base templates: a starting point for your own game",
|
|
11
|
+
example: "Examples: finished small games to learn from",
|
|
12
|
+
};
|
|
13
|
+
const options = [];
|
|
14
|
+
for (const kind of ["base", "example"]) {
|
|
15
|
+
const group = templates.filter((t) => t.kind === kind);
|
|
16
|
+
if (group.length === 0)
|
|
17
|
+
continue;
|
|
18
|
+
options.push({ value: `#${kind}`, label: pc.dim(heading[kind]), disabled: true });
|
|
19
|
+
for (const t of group)
|
|
20
|
+
options.push({ value: t.id, label: t.title, hint: t.description });
|
|
21
|
+
}
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
7
24
|
/** Interactive scaffold flow. Falls back to defaults when stdin is not a TTY so agents
|
|
8
25
|
* and CI can call it non-interactively. */
|
|
9
26
|
export async function runCreate(options) {
|
|
@@ -34,7 +51,8 @@ export async function runCreate(options) {
|
|
|
34
51
|
if (!template && interactive && templates.length > 1) {
|
|
35
52
|
const answer = await p.select({
|
|
36
53
|
message: "Pick a template",
|
|
37
|
-
options: templates
|
|
54
|
+
options: templateOptions(templates),
|
|
55
|
+
initialValue: templates[0]?.id,
|
|
38
56
|
});
|
|
39
57
|
if (p.isCancel(answer))
|
|
40
58
|
return cancelled();
|
package/dist/interactive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.js","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"interactive.js","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,UAAU,EACV,eAAe,GAGhB,MAAM,eAAe,CAAC;AASvB,2HAA2H;AAC3H,MAAM,UAAU,eAAe,CAAC,SAAkC;IAChE,MAAM,OAAO,GAAiC;QAC5C,IAAI,EAAE,oDAAoD;QAC1D,OAAO,EAAE,8CAA8C;KACxD,CAAC;IACF,MAAM,OAAO,GAA0E,EAAE,CAAC;IAC1F,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,EA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C,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,uBAAuB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CACpL,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,SAAS;IAChB,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACtB,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/official.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Official templates that are not bundled into the create-debuff package. They're downloaded on
|
|
3
3
|
* demand from the debuff repo, so adding templates never grows the npm download.
|
|
4
4
|
*/
|
|
5
|
+
import type { TemplateKind } from "./scaffold.js";
|
|
5
6
|
export interface OfficialTemplate {
|
|
6
7
|
id: string;
|
|
7
8
|
title: string;
|
|
8
9
|
description: string;
|
|
10
|
+
kind: TemplateKind;
|
|
9
11
|
/** giget source: where the template lives in the debuff repo. `create()` pins it to this release's tag. */
|
|
10
12
|
source: string;
|
|
11
13
|
}
|
package/dist/official.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"official.d.ts","sourceRoot":"","sources":["../src/official.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,2GAA2G;IAC3G,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,
|
|
1
|
+
{"version":3,"file":"official.d.ts","sourceRoot":"","sources":["../src/official.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;IACnB,2GAA2G;IAC3G,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAuDzD,CAAC"}
|
package/dist/official.js
CHANGED
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
export const OFFICIAL_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "topdown",
|
|
4
|
+
kind: "base",
|
|
5
|
+
title: "Top-down",
|
|
6
|
+
description: "Walk a tile world from above: tenten sprites and tileset, 8-way movement, wall collision, a following camera, pickups",
|
|
7
|
+
source: "github:debuffjp/debuff/templates/topdown",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "isometric",
|
|
11
|
+
kind: "base",
|
|
12
|
+
title: "Isometric",
|
|
13
|
+
description: "Walk a 2:1 isometric grid: tenten floor and cube tiles, depth sorting, grid-to-screen projection, a following camera, pickups",
|
|
14
|
+
source: "github:debuffjp/debuff/templates/isometric",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "sidescroller",
|
|
18
|
+
kind: "base",
|
|
19
|
+
title: "Side-scroller",
|
|
20
|
+
description: "Run and jump through a side-scrolling level: tenten tileset and sprites, coyote time, jump buffering, one-way planks, a following camera, pickups",
|
|
21
|
+
source: "github:debuffjp/debuff/templates/sidescroller",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "pointclick",
|
|
25
|
+
kind: "base",
|
|
26
|
+
title: "Point-and-click",
|
|
27
|
+
description: "Click to walk, look and use: rooms with exits and hotspots, an inventory, speech bubbles, a fade between rooms, tenten sprites",
|
|
28
|
+
source: "github:debuffjp/debuff/templates/pointclick",
|
|
29
|
+
},
|
|
2
30
|
{
|
|
3
31
|
id: "platformer",
|
|
32
|
+
kind: "example",
|
|
4
33
|
title: "Platformer",
|
|
5
34
|
description: "buff runs and jumps through a Tiled level: tilemap, collision, atlas, tunable movement, coins",
|
|
6
35
|
source: "github:debuffjp/debuff/templates/platformer",
|
|
7
36
|
},
|
|
8
37
|
{
|
|
9
38
|
id: "mossfell",
|
|
39
|
+
kind: "example",
|
|
10
40
|
title: "Mossfell",
|
|
11
41
|
description: "Top-down action-adventure: screen-by-screen scrolling, sword combat, hearts, enemies, a key and locked door, a small dungeon",
|
|
12
42
|
source: "github:debuffjp/debuff/templates/mossfell",
|
|
13
43
|
},
|
|
14
44
|
{
|
|
15
45
|
id: "squish",
|
|
16
|
-
|
|
46
|
+
kind: "example",
|
|
47
|
+
title: "Match 3",
|
|
17
48
|
description: "Squishy match-3 for touch and mouse: swap jelly blobs, cascades and combos, squash-and-stretch juice, drawn in code with no art files",
|
|
18
49
|
source: "github:debuffjp/debuff/templates/squish",
|
|
19
50
|
},
|
package/dist/official.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"official.js","sourceRoot":"","sources":["../src/official.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"official.js","sourceRoot":"","sources":["../src/official.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,kBAAkB,GAAgC;IAC7D;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,uHAAuH;QACpI,MAAM,EAAE,0CAA0C;KACnD;IACD;QACE,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,WAAW;QAClB,WAAW,EACT,+HAA+H;QACjI,MAAM,EAAE,4CAA4C;KACrD;IACD;QACE,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,mJAAmJ;QACrJ,MAAM,EAAE,+CAA+C;KACxD;IACD;QACE,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,gIAAgI;QAClI,MAAM,EAAE,6CAA6C;KACtD;IACD;QACE,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,+FAA+F;QAC5G,MAAM,EAAE,6CAA6C;KACtD;IACD;QACE,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,8HAA8H;QAChI,MAAM,EAAE,2CAA2C;KACpD;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,uIAAuI;QACzI,MAAM,EAAE,yCAAyC;KAClD;CACF,CAAC"}
|
package/dist/scaffold.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** Templates ship inside the published package (copied at build) and live at the repo
|
|
2
2
|
* root during development. */
|
|
3
3
|
export declare function templatesDir(): string;
|
|
4
|
+
/** A base template is a starting point to build your own game on. An example is a finished small game to learn from. */
|
|
5
|
+
export type TemplateKind = "base" | "example";
|
|
4
6
|
export interface TemplateInfo {
|
|
5
7
|
id: string;
|
|
6
8
|
title: string;
|
|
7
9
|
description: string;
|
|
10
|
+
kind: TemplateKind;
|
|
8
11
|
}
|
|
9
12
|
/** Every template: local ones plus official templates that download on demand. */
|
|
10
13
|
export declare function listTemplates(): TemplateInfo[];
|
package/dist/scaffold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAQA;+BAC+B;AAC/B,wBAAgB,YAAY,IAAI,MAAM,CAUrC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAQA;+BAC+B;AAC/B,wBAAgB,YAAY,IAAI,MAAM,CAUrC;AAED,wHAAwH;AACxH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;CACpB;AAcD,kFAAkF;AAClF,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAU9C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAWrH;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,2FAA2F;AAC3F,mHAAmH;AACnH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,6FAA6F;AAC7F,wBAAsB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAYrG;AAED,uGAAuG;AACvG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAOzD;AAED,0FAA0F;AAC1F,wBAAsB,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAItE;AAuBD,8GAA8G;AAC9G,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,oBAAoB,IAAI,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAMtE"}
|
package/dist/scaffold.js
CHANGED
|
@@ -26,18 +26,20 @@ function localTemplates() {
|
|
|
26
26
|
.map((id) => {
|
|
27
27
|
const meta = join(dir, id, "template.json");
|
|
28
28
|
const info = existsSync(meta) ? JSON.parse(readFileSync(meta, "utf8")) : {};
|
|
29
|
-
return { id, title: info.title ?? id, description: info.description ?? "" };
|
|
29
|
+
return { id, title: info.title ?? id, description: info.description ?? "", kind: info.kind ?? "example" };
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
/** Every template: local ones plus official templates that download on demand. */
|
|
33
33
|
export function listTemplates() {
|
|
34
34
|
const local = localTemplates();
|
|
35
|
-
const remote = OFFICIAL_TEMPLATES.filter((t) => !local.some((l) => l.id === t.id)).map(({ id, title, description }) => ({
|
|
35
|
+
const remote = OFFICIAL_TEMPLATES.filter((t) => !local.some((l) => l.id === t.id)).map(({ id, title, description, kind }) => ({
|
|
36
36
|
id,
|
|
37
37
|
title,
|
|
38
38
|
description,
|
|
39
|
+
kind,
|
|
39
40
|
}));
|
|
40
|
-
|
|
41
|
+
const all = [...local, ...remote];
|
|
42
|
+
return [...all.filter((t) => t.kind === "base"), ...all.filter((t) => t.kind !== "base")];
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* Where a template comes from: a local folder (bundled, or the repo checkout during development),
|
package/dist/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAErD;+BAC+B;AAC/B,MAAM,UAAU,YAAY;IAC1B,8FAA8F;IAC9F,0FAA0F;IAC1F,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC3D,KAAK,MAAM,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,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AAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAAe;IAC1D,OAAO,OAAO,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,kBAAkB,OAAO,EAAE,CAAC;AACrG,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAQ,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;AAC7G,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC;IACnD,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -20,9 +20,10 @@ This is a 2D browser game made with **debuff** (https://debuff.jp). These notes
|
|
|
20
20
|
|
|
21
21
|
- `src/main.ts`: the game, which creates `new Game(...)`, scenes (`update`, `render`, `inspect`) and params.
|
|
22
22
|
- `assets/`: source art, audio and data. The manifest and atlases are generated from it, and only files the game references ship. Don't edit generated files.
|
|
23
|
-
- `tests/`: logic tests (`*.test.ts`, `keiko`). They boot the real game headless, drive input, time and params, and assert on `inspect()` state. Add one for each mechanic you build. Guide: https://debuff.jp/docs/testing
|
|
23
|
+
- `tests/`: logic tests (`*.test.ts`, `keiko`). They boot the real game headless, drive input, time and params, and assert on `inspect()` state. Add one for each mechanic you build. If the game's logic awaits anything (an ad SDK, a save, a fetch), play it with `await game.run("1s")` rather than `wait("1s")`: `wait` is synchronous and promise callbacks only run between frames of `run()`. Guide: https://debuff.jp/docs/testing
|
|
24
|
+
- `inspect()` is all that tests, scenarios, fuzzing, replay diffs and agents can see of the game, so report what a player reacts to, not counts: enemies, bullets and pickups as lists of `{ x, y }` in game coordinates with a few fields such as `kind` and `hp`, the player with position and velocity, and a board as rows. Cap large lists (the nearest 50 is plenty). Name the camera or board transform for what it is (`camera`, `view`), not like an entity.
|
|
24
25
|
- `scenarios/`: JSON scripts run in a real browser. Prefer assertions on state over screenshots: `expect` and `until` read `state.*` (your `inspect()`) and `events.<name>`, the number of times the game called `game.emit("<name>")`. `{ "until": { "events.coin": { "gte": 1 } }, "within": 60 }` waits for a coin instead of guessing a wait. Add a capture only when a change is visual. When you add effects that flash or shake (hits, explosions, screen flashes), add a `{ "flashes": 240 }` step to check them for photosensitive safety, and a `{ "contrast": [x, y, w, h] }` step for new HUD text.
|
|
25
|
-
- `.mcp.json`: connects the debuff MCP server, so you can play and inspect the running game.
|
|
26
|
+
- `.mcp.json`: connects the debuff MCP server, so you can play and inspect the running game, and the tenten server for drawing pixel art.
|
|
26
27
|
|
|
27
28
|
## Work loop
|
|
28
29
|
|
|
@@ -35,6 +36,7 @@ This is a 2D browser game made with **debuff** (https://debuff.jp). These notes
|
|
|
35
36
|
## Rules
|
|
36
37
|
|
|
37
38
|
- **Creative direction belongs to the human:** art, feel, difficulty, story and names. Propose two or three options; don't decide.
|
|
39
|
+
- **Pixel art goes through tenten unless the human names another tool.** When the game needs a sprite, animation or tile drawn, use the `tenten` MCP server from `.mcp.json`: `tt_new`, `tt_draw`, `tt_render` to check it, `tt_save` to `assets/<name>.tt`, which the dev server turns into a sprite sheet, and `tt_preview` so the human sees it. If they draw in Aseprite or elsewhere, leave the art to them and load what they export.
|
|
38
40
|
- Don't update screenshot baselines (`--update`) without the human's say-so.
|
|
39
41
|
- If `game_errors` reports `debuff-bug`, it's a bug in debuff, not this game. Tell the human and share its `reportUrl`; don't work around debuff internals.
|
|
40
42
|
- Prefer debuff's APIs (`draw`, `input`, `assets`, `params`, `juice`) over adding new runtime dependencies. The game should stay small.
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"test": "debuff test && debuff scenario"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@debuffjp/audio": "0.
|
|
14
|
-
"@debuffjp/core": "0.
|
|
15
|
-
"@debuffjp/input": "0.
|
|
16
|
-
"@debuffjp/juice": "0.
|
|
13
|
+
"@debuffjp/audio": "0.15.0",
|
|
14
|
+
"@debuffjp/core": "0.15.0",
|
|
15
|
+
"@debuffjp/input": "0.15.0",
|
|
16
|
+
"@debuffjp/juice": "0.15.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@debuffjp/cli": "0.
|
|
19
|
+
"@debuffjp/cli": "0.15.0",
|
|
20
20
|
"typescript": "^7.0.2",
|
|
21
|
-
"@debuffjp/dev": "0.
|
|
21
|
+
"@debuffjp/dev": "0.15.0",
|
|
22
22
|
"keiko": "0.6.0"
|
|
23
23
|
}
|
|
24
24
|
}
|