@combos-fun/renderer-adapter 0.0.6 → 0.0.8

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,76 @@
1
+ # `@combos-fun/renderer-adapter` — Agent notes
2
+
3
+ Pixi v8 display-object adapter layer used by `@combos-fun/plugin-renderer` and its 2D rendering sub-plugins. **Not** a game `System`. It exposes a stable shape over Pixi primitives so 2D rendering plugins are not coupled to a specific Pixi version.
4
+
5
+ ## When to read
6
+
7
+ Read whenever a 2D rendering task touches `Container` parenting, low-level Pixi display object shape, or whenever the entry skill loads "Core" packages for any project.
8
+
9
+ ## Public API
10
+
11
+ Wrappers re-exported from `@combos-fun/renderer-adapter`:
12
+
13
+ | Export | Wraps | Used by |
14
+ |--------|-------|---------|
15
+ | `Application` | `pixi.js` Application | `RendererSystem` (plugin-renderer) bootstrap |
16
+ | `Container` | `PIXI.Container` | All container parenting via `containerManager` |
17
+ | `Graphics` | `PIXI.Graphics` | `plugin-renderer-graphics` |
18
+ | `Sprite` | `PIXI.Sprite` | `plugin-renderer-sprite`, `plugin-renderer-img` |
19
+ | `SpriteAnimation` | Pixi animated sprite | `plugin-renderer-sprite-animation` |
20
+ | `NinePatch` | nine-slice sprite | `plugin-renderer-nine-patch` |
21
+ | `TilingSprite` | `PIXI.TilingSprite` | `plugin-renderer-tiling-sprite` |
22
+ | `Text` | `PIXI.Text` | `plugin-renderer-text` |
23
+
24
+ These are **adapter classes** — plugins consume them, end users typically do not import them directly.
25
+
26
+ ## Required setup
27
+
28
+ None on the user side. Adapter is a dependency of `@combos-fun/plugin-renderer` and is loaded transitively. End users install the plugin packages, not the adapter directly.
29
+
30
+ ## Runtime behaviour
31
+
32
+ - Each wrapper instantiates a Pixi display object and exposes a thin API used
33
+ by the matching renderer plugin.
34
+ - All 2D rendering plugins reach Pixi via these wrappers; if you are
35
+ authoring a custom 2D rendering plugin, prefer extending `Renderer` from
36
+ `plugin-renderer` and constructing display objects via the matching adapter
37
+ type. Do **not** import `pixi.js` directly in plugin code.
38
+
39
+ ## Common pitfalls
40
+
41
+ - Coupling a custom 2D rendering plugin directly to `pixi.js` means a Pixi
42
+ major bump can break the plugin. Use the adapter types instead.
43
+ - Mixing adapter `Container` and raw `PIXI.Container` in the same scene
44
+ graph is not supported — `containerManager.getContainer(gameObject.id)`
45
+ returns the adapter type.
46
+
47
+ ## Minimal example
48
+
49
+ Inside a custom 2D rendering plugin's `Renderer` subclass:
50
+
51
+ ```ts
52
+ import { Sprite } from '@combos-fun/renderer-adapter';
53
+ import { Renderer, RendererSystem } from '@combos-fun/plugin-renderer';
54
+
55
+ class MyRenderer extends Renderer {
56
+ init() {
57
+ this.rendererSystem = this.game.getSystem(RendererSystem);
58
+ this.rendererSystem.rendererManager.register(this);
59
+ }
60
+ componentChanged(changed) {
61
+ if (changed.type === OBSERVER_TYPE.ADD) {
62
+ const sprite = new Sprite(/* ... */);
63
+ const container = this.rendererSystem.containerManager.getContainer(
64
+ changed.gameObject.id,
65
+ );
66
+ container.addChild(sprite);
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ ## Verification
73
+
74
+ - `pnpm --filter @combos-fun/renderer-adapter run build` should succeed.
75
+ - After upgrading `pixi.js`, run any example app from `examples/` to verify
76
+ 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.8",
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",