@combos-fun/renderer-adapter 0.0.6 → 0.0.7

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/README.md CHANGED
@@ -1,3 +1,27 @@
1
1
  # @combos-fun/renderer-adapter
2
2
 
3
- Internal workspace package (Combos Fun monorepo).
3
+ @combos-fun/renderer-adapter part of the Combos Fun engine monorepo.
4
+
5
+ Keywords: `pixi`, `adapter`, `display-object`, `wrapper`, `rendering`.
6
+
7
+ ## Documentation
8
+
9
+ - Per-package agent / developer notes: [`agent-skill.md`](./agent-skill.md)
10
+ - Machine-readable manifest: [`combos-plugin.json`](./combos-plugin.json)
11
+ (validated against `schemas/combos-plugin.schema.json` in the repo
12
+ root)
13
+ - Entry skill (single source of truth for AI agents working with this
14
+ monorepo): `skills/combos-engine-development/SKILL.md`
15
+
16
+ When consumed from npm, the manifest and agent notes are exposed as
17
+ stable subpaths:
18
+
19
+ ```ts
20
+ import manifest from '@combos-fun/renderer-adapter/plugin-manifest';
21
+ // or fetch the markdown directly:
22
+ // require.resolve('@combos-fun/renderer-adapter/agent-skill')
23
+ ```
24
+
25
+ ## License
26
+
27
+ Internal workspace package, part of the Combos Fun engine monorepo.
package/agent-skill.md ADDED
@@ -0,0 +1,84 @@
1
+ # `@combos-fun/renderer-adapter` — Agent notes
2
+
3
+ Pixi v8 display-object adapter layer used by `@combos-fun/plugin-renderer` and
4
+ its 2D rendering sub-plugins. **Not** a game `System`. It exposes a stable
5
+ shape over Pixi primitives so 2D rendering plugins are not coupled to a
6
+ specific Pixi version.
7
+
8
+ ## When to read
9
+
10
+ Read whenever a 2D rendering task touches `Container` parenting, low-level
11
+ Pixi display object shape, or whenever the entry skill loads "Core" packages
12
+ for any project.
13
+
14
+ ## Public API
15
+
16
+ Wrappers re-exported from `@combos-fun/renderer-adapter`:
17
+
18
+ | Export | Wraps | Used by |
19
+ |--------|-------|---------|
20
+ | `Application` | `pixi.js` Application | `RendererSystem` (plugin-renderer) bootstrap |
21
+ | `Container` | `PIXI.Container` | All container parenting via `containerManager` |
22
+ | `Graphics` | `PIXI.Graphics` | `plugin-renderer-graphics` |
23
+ | `Sprite` | `PIXI.Sprite` | `plugin-renderer-sprite`, `plugin-renderer-img` |
24
+ | `SpriteAnimation` | Pixi animated sprite | `plugin-renderer-sprite-animation` |
25
+ | `NinePatch` | nine-slice sprite | `plugin-renderer-nine-patch` |
26
+ | `TilingSprite` | `PIXI.TilingSprite` | `plugin-renderer-tiling-sprite` |
27
+ | `Text` | `PIXI.Text` | `plugin-renderer-text` |
28
+
29
+ These are **adapter classes** — plugins consume them, end users typically do
30
+ not import them directly.
31
+
32
+ ## Required setup
33
+
34
+ None on the user side. Adapter is a dependency of `@combos-fun/plugin-renderer`
35
+ and is loaded transitively. End users install the plugin packages, not the
36
+ adapter directly.
37
+
38
+ ## Runtime behaviour
39
+
40
+ - Each wrapper instantiates a Pixi display object and exposes a thin API used
41
+ by the matching renderer plugin.
42
+ - All 2D rendering plugins reach Pixi via these wrappers; if you are
43
+ authoring a custom 2D rendering plugin, prefer extending `Renderer` from
44
+ `plugin-renderer` and constructing display objects via the matching adapter
45
+ type. Do **not** import `pixi.js` directly in plugin code.
46
+
47
+ ## Common pitfalls
48
+
49
+ - Coupling a custom 2D rendering plugin directly to `pixi.js` means a Pixi
50
+ major bump can break the plugin. Use the adapter types instead.
51
+ - Mixing adapter `Container` and raw `PIXI.Container` in the same scene
52
+ graph is not supported — `containerManager.getContainer(gameObject.id)`
53
+ returns the adapter type.
54
+
55
+ ## Minimal example
56
+
57
+ Inside a custom 2D rendering plugin's `Renderer` subclass:
58
+
59
+ ```ts
60
+ import { Sprite } from '@combos-fun/renderer-adapter';
61
+ import { Renderer, RendererSystem } from '@combos-fun/plugin-renderer';
62
+
63
+ class MyRenderer extends Renderer {
64
+ init() {
65
+ this.rendererSystem = this.game.getSystem(RendererSystem);
66
+ this.rendererSystem.rendererManager.register(this);
67
+ }
68
+ componentChanged(changed) {
69
+ if (changed.type === OBSERVER_TYPE.ADD) {
70
+ const sprite = new Sprite(/* ... */);
71
+ const container = this.rendererSystem.containerManager.getContainer(
72
+ changed.gameObject.id,
73
+ );
74
+ container.addChild(sprite);
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ## Verification
81
+
82
+ - `pnpm --filter @combos-fun/renderer-adapter run build` should succeed.
83
+ - After upgrading `pixi.js`, run any example app from `examples/` to verify
84
+ no rendering regression.
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@combos-fun/renderer-adapter",
3
+ "pluginId": "renderer-adapter",
4
+ "category": "core",
5
+ "dimension": "shared",
6
+ "isCore": true,
7
+ "keywords": ["pixi", "adapter", "display-object", "wrapper", "rendering"],
8
+ "agentSkill": "./agent-skill.md",
9
+ "requires": [],
10
+ "exports": [
11
+ "Application",
12
+ "Container",
13
+ "Graphics",
14
+ "NinePatch",
15
+ "Sprite",
16
+ "SpriteAnimation",
17
+ "Text",
18
+ "TilingSprite"
19
+ ]
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/renderer-adapter",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "@combos-fun/renderer-adapter",
5
5
  "main": "index.js",
6
6
  "module": "dist/renderer-adapter.esm.js",
@@ -8,8 +8,22 @@
8
8
  "unpkg": "dist/CombosFun.rendererAdapter.min.js",
9
9
  "files": [
10
10
  "index.js",
11
- "dist"
11
+ "dist",
12
+ "agent-skill.md",
13
+ "combos-plugin.json"
12
14
  ],
15
+ "exports": {
16
+ ".": {
17
+ "import": "./dist/renderer-adapter.esm.js",
18
+ "require": "./index.js",
19
+ "types": "./dist/renderer-adapter.d.ts"
20
+ },
21
+ "./plugin-manifest": "./combos-plugin.json",
22
+ "./agent-skill": "./agent-skill.md"
23
+ },
24
+ "combos": {
25
+ "pluginManifest": "./combos-plugin.json"
26
+ },
13
27
  "types": "dist/renderer-adapter.d.ts",
14
28
  "keywords": [
15
29
  "combos-fun",