@combos-fun/engine 0.0.11 → 0.0.13
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/agent-skill.md +144 -82
- package/dist/engine.cjs.js +17 -7
- package/dist/engine.cjs.js.map +1 -1
- package/dist/engine.cjs.prod.js +1 -1
- package/dist/engine.d.ts +324 -317
- package/dist/engine.esm.js +17 -7
- package/dist/engine.esm.js.map +1 -1
- package/package.json +2 -2
package/agent-skill.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@combos-fun/engine` — Agent notes
|
|
2
2
|
|
|
3
|
-
ECS microkernel for Combos Fun. This file is the canonical knowledge source for **using** the engine. For **authoring** a new `@combos-fun/plugin
|
|
3
|
+
ECS microkernel for Combos Fun. This file is the canonical knowledge source for **using** the engine. For **authoring** a new `@combos-fun/plugin-`*, read `@combos-fun/engine/plugin-authoring` instead.
|
|
4
4
|
|
|
5
5
|
## When to read
|
|
6
6
|
|
|
@@ -25,14 +25,16 @@ Read this every time before working on a Combos Fun project. The entry skill loa
|
|
|
25
25
|
|
|
26
26
|
### `GameParams`
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
28
|
+
|
|
29
|
+
| Field | Type | Default | Notes |
|
|
30
|
+
| ------------------------------ | ------------------------ | ------- | ---------------------------------------- |
|
|
31
|
+
| `systems` | `System[]` | `[]` | Bootstrapped async in registration order |
|
|
32
|
+
| `frameRate` | `number` | `60` | |
|
|
33
|
+
| `autoStart` | `boolean` | `true` | |
|
|
34
|
+
| `needScene` | `boolean` | `true` | Auto-creates `Scene('scene')` |
|
|
35
|
+
| `onSystemsBootstrapComplete` | `(game, error?) => void` | — | After all systems init |
|
|
36
|
+
| `pluginInitNotifyTargetOrigin` | `string` | `'*'` | postMessage target |
|
|
37
|
+
|
|
36
38
|
|
|
37
39
|
### `Game` methods
|
|
38
40
|
|
|
@@ -40,19 +42,23 @@ Read this every time before working on a Combos Fun project. The entry skill loa
|
|
|
40
42
|
|
|
41
43
|
### `resource` singleton
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
45
|
+
|
|
46
|
+
| Method | Notes |
|
|
47
|
+
| ---------------------------------------------------------- | ------------------------- |
|
|
48
|
+
| `addResource(resources[])` | Register (no load) |
|
|
49
|
+
| `preload()` | Load all `preload: true` |
|
|
50
|
+
| `loadConfig(resources[])` | `addResource` + `preload` |
|
|
51
|
+
| `loadSingle(resource): Promise` | Add + load one |
|
|
52
|
+
| `getResource(name): Promise` | Get loaded |
|
|
53
|
+
| `destroy(name): Promise` | Destroy one |
|
|
54
|
+
| `registerResourceType(type, value?)` | Custom type |
|
|
55
|
+
| `registerInstance(type, cb)` / `registerDestroy(type, cb)` | Factory / destructor |
|
|
56
|
+
|
|
53
57
|
|
|
54
58
|
Fields: `timeout` (6000ms), `resourcesMap`, `progress`.
|
|
55
59
|
|
|
60
|
+
> ⚠️ `addResource` only registers; it does **not** kick off network load. Components that reference an unloaded `resource` (e.g. `Img({ resource: 'logo' })`) silently render nothing — the canvas stays blank with no console error. Always pair it with `preload()` (and gate `new Game(...)` behind `resource.once(LOAD_EVENT.COMPLETE, ...)`), or skip the pair entirely and use `loadConfig(resources[])` which does both in one call.
|
|
61
|
+
|
|
56
62
|
## ECS hard rules (mandatory)
|
|
57
63
|
|
|
58
64
|
These rules apply to every code change. Violations must be fixed before the change is considered complete.
|
|
@@ -63,7 +69,7 @@ Any data belonging to a game entity must be a field on a `Component` attached to
|
|
|
63
69
|
|
|
64
70
|
### Rule 2: All behaviour logic lives in Component / System hooks
|
|
65
71
|
|
|
66
|
-
Code that runs per-frame, reacts to events, or mutates entity state must live in `Component` hooks (`init` / `awake` / `start` / `update` / `lateUpdate` / `onPause` / `onResume` / `onDestroy`) or `System` hooks (same set + `componentObserver` in `update`). No event callbacks in bootstrap, no `setInterval` outside Components, no `game.ticker.add` for game logic.
|
|
72
|
+
Code that runs per-frame, reacts to events, or mutates entity state must live in `Component` hooks (`init` / `awake` / `start` / `update` / `lateUpdate` / `onPause` / `onResume` / `onDestroy`) or `System` hooks (same set + `componentObserver` in `update`). No event callbacks in bootstrap, no `setInterval` outside Components, no `game.ticker.add` for game logic. Every `.on(...)` / `addEventListener(...)` subscription set up in `start` / `awake` must be torn down in `onDestroy`.
|
|
67
73
|
|
|
68
74
|
### Rule 3: Bootstrap code only wires, never implements
|
|
69
75
|
|
|
@@ -71,11 +77,11 @@ The entry file may: register resources, create `Game` with `systems`, create `Ga
|
|
|
71
77
|
|
|
72
78
|
### Rule 4: Single concern per Component, cross-entity logic in Systems
|
|
73
79
|
|
|
74
|
-
A Component holds data + self-contained behaviour for one concern on one entity. A System holds cross-entity logic reacting to component changes. Do not put multi-entity coordination inside a Component.
|
|
80
|
+
A Component holds data + self-contained behaviour for one concern on one entity. A System holds cross-entity logic reacting to component changes. Do not put multi-entity coordination inside a Component. Every custom Component subclass must set `static componentName`; every custom System reacts via `@decorators.componentObserver({ Name: ['prop'] })` and drains observations in `update()` — never via ad-hoc scans of the scene graph.
|
|
75
81
|
|
|
76
82
|
### Rule 5: No direct Pixi / Three.js / DOM manipulation outside Renderer pattern
|
|
77
83
|
|
|
78
|
-
2D display objects must come through `plugin-renderer
|
|
84
|
+
2D display objects must come through `plugin-renderer-`* systems or a custom `Renderer` subclass registered via `rendererManager.register(this)`. 3D objects must come through `plugin-renderer-3d-`* systems or a custom `Renderer3D` subclass. No raw `new PIXI.Sprite(...)` / `new THREE.Mesh(...)` in bootstrap or plain Components.
|
|
79
85
|
|
|
80
86
|
### Rule 6: Component configuration via params, not imperative calls
|
|
81
87
|
|
|
@@ -94,99 +100,154 @@ Runs only once at startup to wire things?
|
|
|
94
100
|
└── Rendering integration → Renderer (2D) / Renderer3D (3D) subclass
|
|
95
101
|
```
|
|
96
102
|
|
|
97
|
-
## ECS compliance checklist
|
|
98
|
-
|
|
99
|
-
Run after every change:
|
|
100
|
-
|
|
101
|
-
- [ ] No game logic in entry file — only resource registration, `Game` / `System` creation, `GameObject` + `Component` wiring, scene setup
|
|
102
|
-
- [ ] No retained component references — entry file does not store `addComponent()` returns for later use
|
|
103
|
-
- [ ] No anonymous event handlers — all `.on(...)` / `addEventListener(...)` inside Component lifecycle hooks with cleanup in `onDestroy`
|
|
104
|
-
- [ ] No module-scope mutable state holding entity data
|
|
105
|
-
- [ ] All entity state accessible via `gameObject.getComponent(...)`
|
|
106
|
-
- [ ] All per-frame logic in Component / System `update` / `lateUpdate`
|
|
107
|
-
- [ ] Custom behaviour = named Component class with `static componentName`
|
|
108
|
-
- [ ] Every event subscription has cleanup in `onDestroy`
|
|
109
|
-
- [ ] Systems use `@decorators.componentObserver` and drain in `update()`
|
|
110
|
-
- [ ] No direct Pixi / Three.js manipulation outside `Renderer` / `Renderer3D` subclasses
|
|
111
|
-
|
|
112
103
|
## Inventory (mandatory after every task)
|
|
113
104
|
|
|
114
105
|
After every development task, write or update three inventory tables in the **project memory**:
|
|
115
106
|
|
|
116
107
|
**Component inventory** — for each custom Component:
|
|
117
108
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
109
|
+
|
|
110
|
+
| Field | Description |
|
|
111
|
+
| --------------- | ----------------------------------------------------------------------------------------- |
|
|
112
|
+
| `componentName` | Static name string |
|
|
113
|
+
| Purpose | One-sentence description |
|
|
114
|
+
| Key params | Constructor params that affect behaviour |
|
|
123
115
|
| Lifecycle hooks | Which of `init` / `awake` / `start` / `update` / `lateUpdate` / `onDestroy` it implements |
|
|
124
116
|
|
|
117
|
+
|
|
125
118
|
**GameObject inventory** — for each GameObject:
|
|
126
119
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
120
|
+
|
|
121
|
+
| Field | Description |
|
|
122
|
+
| ---------- | ------------------------------- |
|
|
123
|
+
| Name | Identifier or variable name |
|
|
124
|
+
| Parent | Parent GameObject or scene root |
|
|
125
|
+
| Components | Attached Components |
|
|
126
|
+
| Purpose | Role in the game |
|
|
127
|
+
|
|
133
128
|
|
|
134
129
|
**System inventory** — for each System:
|
|
135
130
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
131
|
+
|
|
132
|
+
| Field | Description |
|
|
133
|
+
| ------------ | ------------------------------------- |
|
|
134
|
+
| Class name | System class |
|
|
135
|
+
| Order | Registration order in `systems` array |
|
|
136
|
+
| What it owns | Components observed / coordinated |
|
|
137
|
+
| Purpose | One-sentence description |
|
|
138
|
+
|
|
142
139
|
|
|
143
140
|
Skipping inventory is treated with the same weight as the ECS hard rules.
|
|
144
141
|
|
|
145
142
|
## Common pitfalls
|
|
146
143
|
|
|
147
|
-
| Symptom | Fix |
|
|
148
|
-
|---------|-----|
|
|
149
|
-
| Blank canvas | Add the right base renderer system (`RendererSystem` for 2D, `Renderer3DSystem` for 3D); ensure `autoStart: true` or call `game.start()` |
|
|
150
|
-
| Nothing draws | Add the matching sub-system (e.g. `ImgSystem`, `Graphics3DSystem`) before adding components |
|
|
151
|
-
| `getSystem` returns undefined | Use class reference, not string: `game.getSystem(RendererSystem)` |
|
|
152
|
-
| "Component already added" error | Use a new `Component` instance per `GameObject` |
|
|
153
|
-
| Destroyed `GameObject` causes errors | Retained reference in a closure — move logic into a Component |
|
|
154
|
-
| Cannot pause / resume behaviour | Logic in `setInterval` / `ticker.add` — move into `Component.update()` |
|
|
155
|
-
| Resource name not found | Match `resource.addResource` `name` to component `resource` field |
|
|
156
|
-
| TS: `onError` missing on `SoundSystem` | `SoundSystem` requires `onError` callback |
|
|
157
|
-
| Stale render after async load | 3D: use `increaseAsyncId` / `validateAsyncId` to drop stale work |
|
|
158
144
|
|
|
159
|
-
|
|
145
|
+
| Symptom | Fix |
|
|
146
|
+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
147
|
+
| Blank canvas | Add the right base renderer system (`RendererSystem` for 2D, `Renderer3DSystem` for 3D); ensure `autoStart: true` or call `game.start()` |
|
|
148
|
+
| Nothing draws | Add the matching sub-system (e.g. `ImgSystem`, `Graphics3DSystem`) before adding components |
|
|
149
|
+
| `getSystem` returns undefined | Use class reference, not string: `game.getSystem(RendererSystem)` |
|
|
150
|
+
| "Component already added" error | Use a new `Component` instance per `GameObject` |
|
|
151
|
+
| Resource name not found | Match `resource.addResource` `name` to component `resource` field |
|
|
152
|
+
| TS: `onError` missing on `SoundSystem` | `SoundSystem` requires `onError` callback |
|
|
153
|
+
| Stale render after async load | 3D: use `increaseAsyncId` / `validateAsyncId` to drop stale work |
|
|
160
154
|
|
|
161
|
-
```ts
|
|
162
|
-
import { Game, resource } from '@combos-fun/engine';
|
|
163
|
-
import { RendererSystem } from '@combos-fun/plugin-renderer';
|
|
164
|
-
import { RenderSystem } from '@combos-fun/plugin-renderer-render';
|
|
165
|
-
import { ImgSystem } from '@combos-fun/plugin-renderer-img';
|
|
166
155
|
|
|
167
|
-
|
|
156
|
+
## Minimal 2D bootstrap
|
|
168
157
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
158
|
+
```ts
|
|
159
|
+
import {
|
|
160
|
+
Game,
|
|
161
|
+
GameObject,
|
|
162
|
+
resource,
|
|
163
|
+
RESOURCE_TYPE,
|
|
164
|
+
LOAD_EVENT,
|
|
165
|
+
} from "@combos-fun/engine";
|
|
166
|
+
import { RendererSystem } from "@combos-fun/plugin-renderer";
|
|
167
|
+
import { Render, RenderSystem } from "@combos-fun/plugin-renderer-render";
|
|
168
|
+
import { Img, ImgSystem } from "@combos-fun/plugin-renderer-img";
|
|
169
|
+
|
|
170
|
+
resource.once(LOAD_EVENT.COMPLETE, () => {
|
|
171
|
+
new Game({
|
|
172
|
+
systems: [
|
|
173
|
+
new RendererSystem({
|
|
174
|
+
canvas: document.querySelector("#canvas")!,
|
|
175
|
+
width: 750,
|
|
176
|
+
height: 1334,
|
|
177
|
+
}),
|
|
178
|
+
new RenderSystem(),
|
|
179
|
+
new ImgSystem(),
|
|
180
|
+
],
|
|
181
|
+
// Safe place to wire the scene graph: every system has finished init.
|
|
182
|
+
onSystemsBootstrapComplete: (g) => {
|
|
183
|
+
// Transform values go through constructor params — never set them imperatively.
|
|
184
|
+
const logo = new GameObject("logo", {
|
|
185
|
+
position: { x: 100, y: 100 },
|
|
186
|
+
size: { width: 200, height: 200 },
|
|
187
|
+
origin: { x: 0.5, y: 0.5 },
|
|
188
|
+
});
|
|
189
|
+
logo.addComponent(new Img({ resource: "logo" }));
|
|
190
|
+
// Render is only needed when you want to hide / fade / reorder; without it the
|
|
191
|
+
// object is still drawn at alpha 1, zIndex 0. Requires RenderSystem registered.
|
|
192
|
+
logo.addComponent(new Render({ zIndex: 5 }));
|
|
193
|
+
// Use addChild — not addGameObject — so transform parent + scene are both wired.
|
|
194
|
+
g.scene.addChild(logo);
|
|
195
|
+
},
|
|
196
|
+
});
|
|
175
197
|
});
|
|
198
|
+
|
|
199
|
+
resource.loadConfig([
|
|
200
|
+
{
|
|
201
|
+
name: "logo",
|
|
202
|
+
type: RESOURCE_TYPE.IMAGE,
|
|
203
|
+
src: { image: { type: "png", url: "logo.png" } },
|
|
204
|
+
preload: true,
|
|
205
|
+
},
|
|
206
|
+
]);
|
|
176
207
|
```
|
|
177
208
|
|
|
209
|
+
`ResourceBase` requires both `type: RESOURCE_TYPE` and a nested `src` object keyed by media slot (`image` / `json` / `audio` / `video` / `tex` / `ske` / …) where each slot is `{ type, url }`. A flat `src: 'logo.png'` is invalid.
|
|
210
|
+
|
|
178
211
|
## Minimal 3D bootstrap
|
|
179
212
|
|
|
180
213
|
```ts
|
|
181
|
-
import { Game } from
|
|
182
|
-
import { Renderer3DSystem } from
|
|
183
|
-
import {
|
|
214
|
+
import { Game, GameObject } from "@combos-fun/engine";
|
|
215
|
+
import { Renderer3DSystem } from "@combos-fun/plugin-renderer-3d";
|
|
216
|
+
import {
|
|
217
|
+
Graphics3D,
|
|
218
|
+
Graphics3DSystem,
|
|
219
|
+
} from "@combos-fun/plugin-renderer-3d-graphics";
|
|
184
220
|
|
|
185
221
|
new Game({
|
|
186
222
|
systems: [
|
|
187
|
-
new Renderer3DSystem({
|
|
223
|
+
new Renderer3DSystem({
|
|
224
|
+
canvas: document.querySelector("#canvas")!,
|
|
225
|
+
width: 750,
|
|
226
|
+
height: 1000,
|
|
227
|
+
}),
|
|
188
228
|
new Graphics3DSystem(),
|
|
189
229
|
],
|
|
230
|
+
// Safe place to wire the scene graph: every system has finished init.
|
|
231
|
+
onSystemsBootstrapComplete: (g) => {
|
|
232
|
+
// 3D position / rotation / scale go through the component's own params
|
|
233
|
+
// (positionX/Y/Z, rotationX/Y/Z, scaleX/Y/Z) — GameObject's TransformParams
|
|
234
|
+
// is 2D-only (Vector2 + Size2) and is not read by 3D renderers.
|
|
235
|
+
const box = new GameObject("box");
|
|
236
|
+
box.addComponent(
|
|
237
|
+
new Graphics3D({
|
|
238
|
+
shape: "box",
|
|
239
|
+
width: 1,
|
|
240
|
+
height: 1,
|
|
241
|
+
depth: 1,
|
|
242
|
+
color: 0xff0000,
|
|
243
|
+
positionX: 0,
|
|
244
|
+
positionY: 1,
|
|
245
|
+
positionZ: 0,
|
|
246
|
+
}),
|
|
247
|
+
);
|
|
248
|
+
// Use addChild — not addGameObject — so transform parent + scene are both wired.
|
|
249
|
+
g.scene.addChild(box);
|
|
250
|
+
},
|
|
190
251
|
});
|
|
191
252
|
```
|
|
192
253
|
|
|
@@ -202,3 +263,4 @@ After modifying engine code:
|
|
|
202
263
|
## See also
|
|
203
264
|
|
|
204
265
|
- `@combos-fun/engine/plugin-authoring` — full spec for writing a new `@combos-fun/plugin-*` package, including Component / System / Renderer / Renderer3D subclassing, manifest format, and publish requirements.
|
|
266
|
+
|
package/dist/engine.cjs.js
CHANGED
|
@@ -35,6 +35,12 @@ function getComponentName(component) {
|
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
37
|
class Component extends EventEmitter__default.default {
|
|
38
|
+
/**
|
|
39
|
+
* Get the game instance this component belongs to
|
|
40
|
+
*/
|
|
41
|
+
get game() {
|
|
42
|
+
return this.gameObject?.scene?.game;
|
|
43
|
+
}
|
|
38
44
|
constructor(params) {
|
|
39
45
|
super();
|
|
40
46
|
/**
|
|
@@ -80,8 +86,10 @@ function getObjectCache(component, keys) {
|
|
|
80
86
|
}
|
|
81
87
|
const keyIndex = keys.length - 1;
|
|
82
88
|
let property = component;
|
|
83
|
-
// FIXME: Bug is here, property[keys[i]] maybe undefined
|
|
84
89
|
for (let i = 0; i < keyIndex; i++) {
|
|
90
|
+
if (property[keys[i]] === undefined || property[keys[i]] === null) {
|
|
91
|
+
return { property: undefined, key: undefined };
|
|
92
|
+
}
|
|
85
93
|
property = property[keys[i]];
|
|
86
94
|
}
|
|
87
95
|
cache[key] = { property, key: keys[keyIndex] };
|
|
@@ -321,7 +329,7 @@ class Transform extends Component {
|
|
|
321
329
|
for (const key of props) {
|
|
322
330
|
Object.assign(this[key], params[key]);
|
|
323
331
|
}
|
|
324
|
-
this.rotation = params.rotation
|
|
332
|
+
this.rotation = params.rotation ?? this.rotation;
|
|
325
333
|
}
|
|
326
334
|
set parent(val) {
|
|
327
335
|
if (val) {
|
|
@@ -584,7 +592,7 @@ class GameObject {
|
|
|
584
592
|
if (this.parent)
|
|
585
593
|
return this.parent.removeChild(this);
|
|
586
594
|
}
|
|
587
|
-
/**
|
|
595
|
+
/** Destroy this gameObject */
|
|
588
596
|
destroy() {
|
|
589
597
|
if (!this.transform) {
|
|
590
598
|
console.error('Cannot destroy gameObject that have already been destroyed.');
|
|
@@ -678,7 +686,7 @@ class System {
|
|
|
678
686
|
const Ctor = this.constructor;
|
|
679
687
|
this.name = Ctor.systemName;
|
|
680
688
|
}
|
|
681
|
-
/** Default
|
|
689
|
+
/** Default destroy method */
|
|
682
690
|
destroy() {
|
|
683
691
|
this.componentObserver = null;
|
|
684
692
|
this.__systemDefaultParams = null;
|
|
@@ -873,6 +881,7 @@ class Ticker {
|
|
|
873
881
|
this._lastFrameTime = frameTime;
|
|
874
882
|
const options = {
|
|
875
883
|
deltaTime,
|
|
884
|
+
delta: deltaTime,
|
|
876
885
|
time: frameTime,
|
|
877
886
|
currentTime: frameTime,
|
|
878
887
|
frameCount: ++this._frameCount,
|
|
@@ -1069,7 +1078,7 @@ const gameObjectPause = (gameObjects) => {
|
|
|
1069
1078
|
component.onPause && component.onPause();
|
|
1070
1079
|
}
|
|
1071
1080
|
catch (e) {
|
|
1072
|
-
console.error(`gameObject: ${gameObject.name}, ${component.name},
|
|
1081
|
+
console.error(`gameObject: ${gameObject.name}, ${component.name}, onPause error`, e);
|
|
1073
1082
|
}
|
|
1074
1083
|
}
|
|
1075
1084
|
}
|
|
@@ -1109,7 +1118,7 @@ class Game extends EventEmitter__default.default {
|
|
|
1109
1118
|
await this.addSystem(system);
|
|
1110
1119
|
}
|
|
1111
1120
|
if (needScene) {
|
|
1112
|
-
this.loadScene(new Scene("scene"));
|
|
1121
|
+
this.loadScene({ scene: new Scene("scene") });
|
|
1113
1122
|
}
|
|
1114
1123
|
if (autoStart) {
|
|
1115
1124
|
this.start();
|
|
@@ -1315,6 +1324,7 @@ class Game extends EventEmitter__default.default {
|
|
|
1315
1324
|
if (!scene) {
|
|
1316
1325
|
return;
|
|
1317
1326
|
}
|
|
1327
|
+
scene.game = this;
|
|
1318
1328
|
switch (mode) {
|
|
1319
1329
|
case exports.LOAD_SCENE_MODE.SINGLE:
|
|
1320
1330
|
this.scene = scene;
|
|
@@ -1538,7 +1548,7 @@ class Resource extends EventEmitter__default.default {
|
|
|
1538
1548
|
const res = this.resourcesMap[name];
|
|
1539
1549
|
return this.makeInstanceFunctions[res.type] && (await this.makeInstanceFunctions[res.type](res));
|
|
1540
1550
|
}
|
|
1541
|
-
/**
|
|
1551
|
+
/** Destroy resource by name */
|
|
1542
1552
|
async destroy(name) {
|
|
1543
1553
|
await this._destroy(name);
|
|
1544
1554
|
}
|