@yagejs-addons/dialogue 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.
Files changed (2) hide show
  1. package/README.md +77 -0
  2. package/package.json +94 -0
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # @yagejs-addons/dialogue
2
+
3
+ The first **YAGE addon** — an installable, opinionated dialogue system: a
4
+ headless branching runner plus swappable, themeable presenters. Drop it into a
5
+ scene, point it at a dialogue script, and get a working typewriter box (or
6
+ speech bubble) with branching choices and inline markup — then re-theme or
7
+ replace any piece without forking.
8
+
9
+ Addons are the layer between engine plugins (`@yagejs/core`, `@yagejs/renderer`,
10
+ …) and your game: real implementations of common gameplay patterns, opinionated
11
+ enough to be worth installing, layered so the opinions stay overridable. See
12
+ `packages/addons/AGENTS.md` for the authoring model.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm install @yagejs-addons/dialogue
18
+ ```
19
+
20
+ The addon declares the engine packages as **peer dependencies**, so it reuses
21
+ your single engine install rather than duplicating it. Install the engine
22
+ yourself:
23
+
24
+ ```bash
25
+ npm install @yagejs/core @yagejs/input @yagejs/renderer
26
+ ```
27
+
28
+ - `@yagejs/core` and `@yagejs/input` are **required** peers — the headless
29
+ runner and the `DialogueController` use them.
30
+ - `@yagejs/renderer` is the **optional** peer — only the `./presenters` subpath
31
+ needs it (and it brings `pixi.js` transitively, so you never install pixi
32
+ yourself). If you consume only the headless runner you can skip it.
33
+
34
+ ## Two entry points
35
+
36
+ The package is split so the headless path never pulls a renderer:
37
+
38
+ ```ts
39
+ // Headless + input only — no pixi, fully unit-testable.
40
+ import { DialogueRunner, DialogueController } from "@yagejs-addons/dialogue";
41
+
42
+ // Pixi presentation — Graphics chrome + canvas text, themes, factories.
43
+ import { defaultTheme, createBoxDialogue } from "@yagejs-addons/dialogue/presenters";
44
+ ```
45
+
46
+ | Entry | Imports | Contains |
47
+ | -------------- | -------------------------------- | ----------------------------------------------------------------------- |
48
+ | `.` | `@yagejs/core`, `@yagejs/input` | runner, session, types, markup, i18n, canonical format, events, `DialogueController`, input bindings |
49
+ | `./presenters` | + `@yagejs/renderer` (brings pixi) | chrome, text views, composites, avatars, factories, `defaultTheme()`, textured nine-slice variants, radial (experimental) |
50
+
51
+ ## Defaults & opt-ins
52
+
53
+ - **Default presenters are zero-asset**: Graphics objects for chrome plus canvas
54
+ `SplitText`/`Text` for the typewriter, with native bold/italic and per-glyph
55
+ effects. `defaultTheme()` gives you a working look with no bundled files.
56
+ - **Bitmap fonts** (baked variant atlases via `bakeBitmapFont`) are an **opt-in**
57
+ theme path, not the default.
58
+ - **Textured chrome/bubble** (nine-slice from your own textures) is an **opt-in**
59
+ variant; pass texture fields on the theme.
60
+ - **Radial choice presenter** is exported under `./presenters` as
61
+ **`@experimental`** — not polished, opt-in only.
62
+
63
+ ## Save / load
64
+
65
+ Snapshot/restore is **deferred to v1.1**. The runner keeps its cursor reachable
66
+ through read-only getters so a `SnapshotContributor` (`@yagejs/save`) can be
67
+ added later without a breaking change.
68
+
69
+ ## Publishing caveat (`@yagejs-addons` scope)
70
+
71
+ Addons live under the **`@yagejs-addons` npm scope** — a separate org from the
72
+ engine's `@yagejs` scope. The scope is the only category marker (no
73
+ `-toolkit`/`-system` suffixes). Addons are **independently versioned**: they are
74
+ deliberately kept out of the engine's `fixed` changeset group, so engine
75
+ releases never force an addon bump and vice-versa. Publishing requires
76
+ membership in the `@yagejs-addons` org and `publishConfig.access: "public"`
77
+ (already set here).
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "@yagejs-addons/dialogue",
3
+ "version": "0.1.0",
4
+ "description": "Dialogue runner, branching, and swappable presenters for YAGE — the first YAGE addon",
5
+ "keywords": [
6
+ "yage",
7
+ "yage-addon",
8
+ "game-engine",
9
+ "2d",
10
+ "typescript",
11
+ "dialogue",
12
+ "narrative",
13
+ "branching",
14
+ "visual-novel"
15
+ ],
16
+ "license": "MIT",
17
+ "author": "Marco Lepore",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/marco-lepore/yage.git",
21
+ "directory": "packages/addons/dialogue"
22
+ },
23
+ "homepage": "https://yage.dev",
24
+ "type": "module",
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./dist/index.js"
33
+ },
34
+ "require": {
35
+ "types": "./dist/index.d.cts",
36
+ "default": "./dist/index.cjs"
37
+ }
38
+ },
39
+ "./presenters": {
40
+ "import": {
41
+ "types": "./dist/presenters.d.ts",
42
+ "default": "./dist/presenters.js"
43
+ },
44
+ "require": {
45
+ "types": "./dist/presenters.d.cts",
46
+ "default": "./dist/presenters.cjs"
47
+ }
48
+ },
49
+ "./yaml": {
50
+ "import": {
51
+ "types": "./dist/yaml.d.ts",
52
+ "default": "./dist/yaml.js"
53
+ },
54
+ "require": {
55
+ "types": "./dist/yaml.d.cts",
56
+ "default": "./dist/yaml.cjs"
57
+ }
58
+ }
59
+ },
60
+ "files": [
61
+ "dist"
62
+ ],
63
+ "publishConfig": {
64
+ "access": "public"
65
+ },
66
+ "scripts": {
67
+ "build": "tsup",
68
+ "dev": "tsup --watch",
69
+ "typecheck": "tsc --noEmit",
70
+ "lint": "eslint src/",
71
+ "test": "vitest run",
72
+ "clean": "rm -rf dist"
73
+ },
74
+ "dependencies": {
75
+ "yaml": "^2.8.3"
76
+ },
77
+ "peerDependencies": {
78
+ "@yagejs/core": ">=0.8.0 <0.9.0",
79
+ "@yagejs/input": ">=0.8.0 <0.9.0",
80
+ "@yagejs/renderer": ">=0.8.0 <0.9.0"
81
+ },
82
+ "peerDependenciesMeta": {
83
+ "@yagejs/renderer": {
84
+ "optional": true
85
+ }
86
+ },
87
+ "devDependencies": {
88
+ "@vitest/coverage-v8": "^4.0.18",
89
+ "@yagejs/core": ">=0.7.0 <0.9.0",
90
+ "@yagejs/input": ">=0.7.0 <0.9.0",
91
+ "@yagejs/renderer": ">=0.7.0 <0.9.0",
92
+ "pixi.js": "^8.5.0"
93
+ }
94
+ }