@flare-engine/engine 0.2.1 → 0.3.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/LICENSE +201 -21
- package/NOTICE +2 -0
- package/README.md +23 -8
- package/dist/headless.d.mts +16 -0
- package/dist/headless.d.ts +16 -0
- package/dist/headless.js +130 -0
- package/dist/headless.mjs +16 -0
- package/dist/index.d.mts +19 -132
- package/dist/index.d.ts +19 -132
- package/dist/index.js +421 -157
- package/dist/index.mjs +13 -107
- package/dist/tier2-wiring-C_axfiT6.d.mts +119 -0
- package/dist/tier2-wiring-C_axfiT6.d.mts.map +1 -0
- package/dist/tier2-wiring-C_axfiT6.d.ts +119 -0
- package/dist/tier2-wiring-C_axfiT6.d.ts.map +1 -0
- package/dist/tier2-wiring-D3p-Zp9Y.mjs +109 -0
- package/dist/tier2-wiring-D3p-Zp9Y.mjs.map +1 -0
- package/dist/tier2-wiring-svjBCfgF.js +120 -0
- package/dist/tier2-wiring-svjBCfgF.js.map +1 -0
- package/package.json +48 -28
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Grzegorz Otto
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Convenience integration layer — `createGame(config)` is a pure factory that constructs `World` + `Camera2D` + `Renderer` + `SpriteBatch` + `InputManager` + `AudioManager` + `AssetManager` + `SceneManager` + `GameLoop` and returns them with `start()` / `stop()`. Does **not** own the render loop or Skia canvas lifecycle — those belong to `@flare-engine/react`.
|
|
4
4
|
|
|
5
|
-
The package
|
|
5
|
+
The package ships two entry points:
|
|
6
|
+
|
|
7
|
+
- **`.` (default)** — full curated barrel: the 14 headless packages + `@flare-engine/dynamics` + `@flare-engine/postfx` + curated `@flare-engine/react` exports. Pulls in React Native at module scope. `CompiledShader` and `SkImageLike` from postfx are aliased as `PostFxCompiledShader` and `PostFxSkImageLike` to avoid clashing with the render/assets versions. Dynamics' `World` and `Body` are aliased as `DynamicsWorld` and `DynamicsBody` so the ECS `World` keeps the name. React's `GameConfig` is re-exported as `GameViewConfig` to avoid clashing with `createGame`'s own `GameConfig`.
|
|
8
|
+
- **`./headless`** — RN-free subset: the 14 headless packages (math, events, core, ecs, render, input, physics, audio, assets, scene, animation, particles, tilemap, debug) plus `createGame` and tier2-wiring. No `@flare-engine/react`, no `@flare-engine/postfx`, no `@flare-engine/dynamics`. Safe for web-only and Node consumers.
|
|
6
9
|
|
|
7
10
|
`createTier2Wiring` glues optional `AchievementsProvider` / `LeaderboardsProvider` / `AnalyticsProvider` instances to a Tier-2 event source via declarative rules.
|
|
8
11
|
|
|
@@ -12,20 +15,32 @@ The package also re-exports all 15 lower `@flare-engine/*` packages as a conveni
|
|
|
12
15
|
bun add @flare-engine/engine
|
|
13
16
|
```
|
|
14
17
|
|
|
15
|
-
## Usage
|
|
18
|
+
## Usage — full stack (React Native + Web)
|
|
16
19
|
|
|
17
20
|
```ts
|
|
18
21
|
import { createGame } from '@flare-engine/engine';
|
|
19
22
|
|
|
20
|
-
const game = createGame({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const game = createGame({ fixedDt: 1 / 60 });
|
|
24
|
+
game.start();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage — headless (web-only / Node / tests)
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { createGame, World, GameLoop } from '@flare-engine/engine/headless';
|
|
31
|
+
|
|
32
|
+
const game = createGame({ fixedDt: 1 / 60 });
|
|
24
33
|
game.start();
|
|
25
34
|
```
|
|
26
35
|
|
|
27
|
-
See [API spec](
|
|
36
|
+
See [API spec](https://github.com/grzott/flare-engine/blob/main/docs/design/api-specs.md#flare-engineengine--2kb-gzip).
|
|
37
|
+
|
|
38
|
+
## React Native New Architecture
|
|
39
|
+
|
|
40
|
+
Flare's engine packages are architecture-agnostic pure TypeScript — they run on both the legacy and the New Architecture, so the engine itself imposes no New-Architecture requirement. The `react-native >= 0.79` peer floor still admits old-architecture apps: the New Architecture has been the default since RN 0.76, but 0.79-0.81 still allow an explicit `newArchEnabled: false` opt-out, and Flare runs either way.
|
|
41
|
+
|
|
42
|
+
The requirement comes from your app's *other* native dependencies, not from Flare. Notably, `react-native-reanimated` v4 is New-Architecture-only — if you pin Reanimated 4 (or any other New-Arch-only native module), enable the New Architecture. The Flare engine works either way.
|
|
28
43
|
|
|
29
44
|
## License
|
|
30
45
|
|
|
31
|
-
|
|
46
|
+
Apache-2.0
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { a as Tier2AnalyticsLike, c as Tier2Providers, d as createTier2Wiring, f as GameConfig, i as Tier2AchievementsLike, l as Tier2Rule, m as createGame, n as AnalyticsRule, o as Tier2EventSource, p as GameInstance, r as LeaderboardRule, s as Tier2LeaderboardsLike, t as AchievementRule, u as Tier2WiringOptions } from "./tier2-wiring-C_axfiT6.mjs";
|
|
2
|
+
export * from "@flare-engine/animation";
|
|
3
|
+
export * from "@flare-engine/assets";
|
|
4
|
+
export * from "@flare-engine/audio";
|
|
5
|
+
export * from "@flare-engine/core";
|
|
6
|
+
export * from "@flare-engine/debug";
|
|
7
|
+
export * from "@flare-engine/ecs";
|
|
8
|
+
export * from "@flare-engine/events";
|
|
9
|
+
export * from "@flare-engine/input";
|
|
10
|
+
export * from "@flare-engine/math";
|
|
11
|
+
export * from "@flare-engine/particles";
|
|
12
|
+
export * from "@flare-engine/physics";
|
|
13
|
+
export * from "@flare-engine/render";
|
|
14
|
+
export * from "@flare-engine/scene";
|
|
15
|
+
export * from "@flare-engine/tilemap";
|
|
16
|
+
export { type AchievementRule, type AnalyticsRule, type GameConfig, type GameInstance, type LeaderboardRule, type Tier2AchievementsLike, type Tier2AnalyticsLike, type Tier2EventSource, type Tier2LeaderboardsLike, type Tier2Providers, type Tier2Rule, type Tier2WiringOptions, createGame, createTier2Wiring };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { a as Tier2AnalyticsLike, c as Tier2Providers, d as createTier2Wiring, f as GameConfig, i as Tier2AchievementsLike, l as Tier2Rule, m as createGame, n as AnalyticsRule, o as Tier2EventSource, p as GameInstance, r as LeaderboardRule, s as Tier2LeaderboardsLike, t as AchievementRule, u as Tier2WiringOptions } from "./tier2-wiring-C_axfiT6.js";
|
|
2
|
+
export * from "@flare-engine/animation";
|
|
3
|
+
export * from "@flare-engine/assets";
|
|
4
|
+
export * from "@flare-engine/audio";
|
|
5
|
+
export * from "@flare-engine/core";
|
|
6
|
+
export * from "@flare-engine/debug";
|
|
7
|
+
export * from "@flare-engine/ecs";
|
|
8
|
+
export * from "@flare-engine/events";
|
|
9
|
+
export * from "@flare-engine/input";
|
|
10
|
+
export * from "@flare-engine/math";
|
|
11
|
+
export * from "@flare-engine/particles";
|
|
12
|
+
export * from "@flare-engine/physics";
|
|
13
|
+
export * from "@flare-engine/render";
|
|
14
|
+
export * from "@flare-engine/scene";
|
|
15
|
+
export * from "@flare-engine/tilemap";
|
|
16
|
+
export { type AchievementRule, type AnalyticsRule, type GameConfig, type GameInstance, type LeaderboardRule, type Tier2AchievementsLike, type Tier2AnalyticsLike, type Tier2EventSource, type Tier2LeaderboardsLike, type Tier2Providers, type Tier2Rule, type Tier2WiringOptions, createGame, createTier2Wiring };
|
package/dist/headless.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_tier2_wiring = require("./tier2-wiring-svjBCfgF.js");
|
|
3
|
+
exports.createGame = require_tier2_wiring.createGame;
|
|
4
|
+
exports.createTier2Wiring = require_tier2_wiring.createTier2Wiring;
|
|
5
|
+
var _flare_engine_animation = require("@flare-engine/animation");
|
|
6
|
+
Object.keys(_flare_engine_animation).forEach(function(k) {
|
|
7
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function() {
|
|
10
|
+
return _flare_engine_animation[k];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
var _flare_engine_assets = require("@flare-engine/assets");
|
|
15
|
+
Object.keys(_flare_engine_assets).forEach(function(k) {
|
|
16
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return _flare_engine_assets[k];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
var _flare_engine_audio = require("@flare-engine/audio");
|
|
24
|
+
Object.keys(_flare_engine_audio).forEach(function(k) {
|
|
25
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return _flare_engine_audio[k];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var _flare_engine_core = require("@flare-engine/core");
|
|
33
|
+
Object.keys(_flare_engine_core).forEach(function(k) {
|
|
34
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function() {
|
|
37
|
+
return _flare_engine_core[k];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var _flare_engine_debug = require("@flare-engine/debug");
|
|
42
|
+
Object.keys(_flare_engine_debug).forEach(function(k) {
|
|
43
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function() {
|
|
46
|
+
return _flare_engine_debug[k];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _flare_engine_ecs = require("@flare-engine/ecs");
|
|
51
|
+
Object.keys(_flare_engine_ecs).forEach(function(k) {
|
|
52
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function() {
|
|
55
|
+
return _flare_engine_ecs[k];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
var _flare_engine_events = require("@flare-engine/events");
|
|
60
|
+
Object.keys(_flare_engine_events).forEach(function(k) {
|
|
61
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function() {
|
|
64
|
+
return _flare_engine_events[k];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
var _flare_engine_input = require("@flare-engine/input");
|
|
69
|
+
Object.keys(_flare_engine_input).forEach(function(k) {
|
|
70
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function() {
|
|
73
|
+
return _flare_engine_input[k];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
var _flare_engine_math = require("@flare-engine/math");
|
|
78
|
+
Object.keys(_flare_engine_math).forEach(function(k) {
|
|
79
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function() {
|
|
82
|
+
return _flare_engine_math[k];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
var _flare_engine_particles = require("@flare-engine/particles");
|
|
87
|
+
Object.keys(_flare_engine_particles).forEach(function(k) {
|
|
88
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function() {
|
|
91
|
+
return _flare_engine_particles[k];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
var _flare_engine_physics = require("@flare-engine/physics");
|
|
96
|
+
Object.keys(_flare_engine_physics).forEach(function(k) {
|
|
97
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function() {
|
|
100
|
+
return _flare_engine_physics[k];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
var _flare_engine_render = require("@flare-engine/render");
|
|
105
|
+
Object.keys(_flare_engine_render).forEach(function(k) {
|
|
106
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function() {
|
|
109
|
+
return _flare_engine_render[k];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
var _flare_engine_scene = require("@flare-engine/scene");
|
|
114
|
+
Object.keys(_flare_engine_scene).forEach(function(k) {
|
|
115
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function() {
|
|
118
|
+
return _flare_engine_scene[k];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
var _flare_engine_tilemap = require("@flare-engine/tilemap");
|
|
123
|
+
Object.keys(_flare_engine_tilemap).forEach(function(k) {
|
|
124
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function() {
|
|
127
|
+
return _flare_engine_tilemap[k];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { n as createGame, t as createTier2Wiring } from "./tier2-wiring-D3p-Zp9Y.mjs";
|
|
2
|
+
export * from "@flare-engine/animation";
|
|
3
|
+
export * from "@flare-engine/assets";
|
|
4
|
+
export * from "@flare-engine/audio";
|
|
5
|
+
export * from "@flare-engine/core";
|
|
6
|
+
export * from "@flare-engine/debug";
|
|
7
|
+
export * from "@flare-engine/ecs";
|
|
8
|
+
export * from "@flare-engine/events";
|
|
9
|
+
export * from "@flare-engine/input";
|
|
10
|
+
export * from "@flare-engine/math";
|
|
11
|
+
export * from "@flare-engine/particles";
|
|
12
|
+
export * from "@flare-engine/physics";
|
|
13
|
+
export * from "@flare-engine/render";
|
|
14
|
+
export * from "@flare-engine/scene";
|
|
15
|
+
export * from "@flare-engine/tilemap";
|
|
16
|
+
export { createGame, createTier2Wiring };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,132 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export * from
|
|
7
|
-
|
|
8
|
-
export * from
|
|
9
|
-
|
|
10
|
-
export * from
|
|
11
|
-
|
|
12
|
-
export * from
|
|
13
|
-
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export
|
|
20
|
-
export * from '@flare-engine/tilemap';
|
|
21
|
-
export * from '@flare-engine/debug';
|
|
22
|
-
export * from '@flare-engine/react';
|
|
23
|
-
|
|
24
|
-
/** Configuration for createGame(). */
|
|
25
|
-
interface GameConfig extends GameLoopConfig {
|
|
26
|
-
/** Asset loader for the AssetManager. Defaults to a no-op loader. */
|
|
27
|
-
assetLoader?: AssetLoader;
|
|
28
|
-
}
|
|
29
|
-
/** The game instance returned by createGame(). */
|
|
30
|
-
interface GameInstance {
|
|
31
|
-
/** ECS world. */
|
|
32
|
-
world: World;
|
|
33
|
-
/** Primary 2D camera. */
|
|
34
|
-
camera: Camera2D;
|
|
35
|
-
/** Renderer (manages Skia canvas lifecycle). */
|
|
36
|
-
renderer: Renderer;
|
|
37
|
-
/** Sprite batch — queue draw commands, flushed by the render-loop owner. */
|
|
38
|
-
batch: SpriteBatch;
|
|
39
|
-
/** Input manager. */
|
|
40
|
-
input: InputManager;
|
|
41
|
-
/** Audio manager. */
|
|
42
|
-
audio: AudioManager;
|
|
43
|
-
/** Asset manager. */
|
|
44
|
-
assets: AssetManager;
|
|
45
|
-
/** Scene manager. */
|
|
46
|
-
scenes: SceneManager;
|
|
47
|
-
/** Game loop. */
|
|
48
|
-
loop: GameLoop;
|
|
49
|
-
/** Start the game loop. */
|
|
50
|
-
start(): void;
|
|
51
|
-
/** Stop the game loop. */
|
|
52
|
-
stop(): void;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* createGame — convenience factory that wires all core subsystems together.
|
|
56
|
-
*
|
|
57
|
-
* Creates a World, Camera2D, Renderer, InputManager, AudioManager,
|
|
58
|
-
* AssetManager, SceneManager, and GameLoop. Returns a GameInstance with
|
|
59
|
-
* `start()` and `stop()` helpers.
|
|
60
|
-
*/
|
|
61
|
-
declare function createGame(config?: GameConfig): GameInstance;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* createTier2Wiring — small, structurally-typed bridge from a game's event
|
|
65
|
-
* bus to Tier-2 providers (analytics / leaderboards / achievements).
|
|
66
|
-
*
|
|
67
|
-
* Stays decoupled from the concrete Tier-2 packages (`@flare-engine/analytics`,
|
|
68
|
-
* `@flare-engine/leaderboards`, `@flare-engine/achievements`) by using
|
|
69
|
-
* structural interfaces — any provider that exposes `track` / `submitScore` /
|
|
70
|
-
* `unlock` in the expected shape plugs in, including the shipped NoopProviders.
|
|
71
|
-
*
|
|
72
|
-
* Extracted from Pan Tvardowski per Phase 11.14. IAP is not wired here —
|
|
73
|
-
* the IAP adapter is subscribed to directly via `EntitlementStore.attachProvider`.
|
|
74
|
-
*/
|
|
75
|
-
interface Tier2AnalyticsLike {
|
|
76
|
-
track(event: string, props?: Record<string, unknown>): void | Promise<void>;
|
|
77
|
-
}
|
|
78
|
-
interface Tier2LeaderboardsLike {
|
|
79
|
-
submitScore(id: string, score: number): void | Promise<void>;
|
|
80
|
-
}
|
|
81
|
-
interface Tier2AchievementsLike {
|
|
82
|
-
unlock(id: string): void | Promise<void>;
|
|
83
|
-
}
|
|
84
|
-
interface Tier2Providers {
|
|
85
|
-
readonly analytics?: Tier2AnalyticsLike;
|
|
86
|
-
readonly leaderboards?: Tier2LeaderboardsLike;
|
|
87
|
-
readonly achievements?: Tier2AchievementsLike;
|
|
88
|
-
}
|
|
89
|
-
/** Event source: any object exposing `on(event, handler): () => void`. */
|
|
90
|
-
interface Tier2EventSource {
|
|
91
|
-
on(event: string, handler: (...args: readonly unknown[]) => void): () => void;
|
|
92
|
-
}
|
|
93
|
-
/** Dispatch an analytics event whenever the source emits the named event. */
|
|
94
|
-
interface AnalyticsRule {
|
|
95
|
-
readonly kind: 'analytics';
|
|
96
|
-
readonly event: string;
|
|
97
|
-
/**
|
|
98
|
-
* Returns the analytics payload, or `null` to skip dispatch.
|
|
99
|
-
*/
|
|
100
|
-
readonly map: (...args: readonly unknown[]) => {
|
|
101
|
-
readonly event: string;
|
|
102
|
-
readonly props?: Record<string, unknown>;
|
|
103
|
-
} | null;
|
|
104
|
-
}
|
|
105
|
-
/** Submit a leaderboard score whenever the source emits the named event. */
|
|
106
|
-
interface LeaderboardRule {
|
|
107
|
-
readonly kind: 'leaderboard';
|
|
108
|
-
readonly event: string;
|
|
109
|
-
readonly map: (...args: readonly unknown[]) => {
|
|
110
|
-
readonly id: string;
|
|
111
|
-
readonly score: number;
|
|
112
|
-
} | null;
|
|
113
|
-
}
|
|
114
|
-
/** Unlock one or more achievements whenever the source emits the named event. */
|
|
115
|
-
interface AchievementRule {
|
|
116
|
-
readonly kind: 'achievement';
|
|
117
|
-
readonly event: string;
|
|
118
|
-
readonly map: (...args: readonly unknown[]) => string | readonly string[] | null;
|
|
119
|
-
}
|
|
120
|
-
type Tier2Rule = AnalyticsRule | LeaderboardRule | AchievementRule;
|
|
121
|
-
interface Tier2WiringOptions {
|
|
122
|
-
readonly events: Tier2EventSource;
|
|
123
|
-
readonly providers: Tier2Providers;
|
|
124
|
-
readonly rules: readonly Tier2Rule[];
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Subscribe every rule to the event source. Returns an unsubscribe function
|
|
128
|
-
* that tears down every listener.
|
|
129
|
-
*/
|
|
130
|
-
declare function createTier2Wiring(options: Tier2WiringOptions): () => void;
|
|
131
|
-
|
|
132
|
-
export { type AchievementRule, type AnalyticsRule, type GameConfig, type GameInstance, type LeaderboardRule, type Tier2AchievementsLike, type Tier2AnalyticsLike, type Tier2EventSource, type Tier2LeaderboardsLike, type Tier2Providers, type Tier2Rule, type Tier2WiringOptions, createGame, createTier2Wiring };
|
|
1
|
+
import { a as Tier2AnalyticsLike, c as Tier2Providers, d as createTier2Wiring, f as GameConfig, i as Tier2AchievementsLike, l as Tier2Rule, m as createGame, n as AnalyticsRule, o as Tier2EventSource, p as GameInstance, r as LeaderboardRule, s as Tier2LeaderboardsLike, t as AchievementRule, u as Tier2WiringOptions } from "./tier2-wiring-C_axfiT6.mjs";
|
|
2
|
+
import { Body as DynamicsBody, World as DynamicsWorld, addBody, createBody, createWorld, step } from "@flare-engine/dynamics";
|
|
3
|
+
import { BLOOM_SKSL, BloomUniforms, CHROMATIC_ABERRATION_SKSL, COLOR_GRADING_LUT_SKSL, COMPOSITE_SKSL, CRT_SKSL, ChromaticAberrationUniforms, ColorGradingLutUniforms, CompiledPass, CompiledShader as PostFxCompiledShader, CompositeUniforms, CrtUniforms, Effect, EffectChain, EffectKind, EffectUniforms, GOD_RAYS_SKSL, GRAYSCALE_FLASH_SKSL, GodRaysUniforms, GrayscaleFlashUniforms, PostFxController, PostFxControllerOptions, PostFxFlashConfig, PostFxRuntime, SkImageLike as PostFxSkImageLike, SkiaPostFxModuleLike, SkiaRuntimeEffectFactory, SkiaRuntimeEffectLike, VIGNETTE_SKSL, VignetteUniforms, WEATHER_CLOUDS_SKSL, WEATHER_DARK_VIGNETTE_SKSL, WEATHER_RAIN_SKSL, WEATHER_SUN_SHAFT_SKSL, WeatherCloudsUniforms, WeatherDarkVignetteUniforms, WeatherRainUniforms, WeatherSunShaftUniforms, createBloom, createChromaticAberration, createColorGradingLut, createCrt, createGodRays, createGrayscaleFlash, createNeutralLutBytes, createPostFxComposite, createPostFxController, createPostFxRuntime, createVignette, createWeatherClouds, createWeatherDarkVignette, createWeatherRain, createWeatherSunShaft } from "@flare-engine/postfx";
|
|
4
|
+
import { CompiledPassLike, GameConfig as GameViewConfig, GameContext, GameContextValue, GameView, GameViewProps, LoadingScreen, LoadingScreenProps, PostFxChainLike, PostFxPassDescriptor, PostFxRenderHook, PostFxRuntimeLike, RenderHook, RenderShapesOpts, SafeArea, SafeAreaContext, ShapeRect, SkOffscreenCanvasLike, SkiaFrameRenderer, SkiaModuleLike, VirtualButton, VirtualButtonProps, VirtualJoystick, VirtualJoystickProps, createSkiaFrameRenderer, renderShapesToImage, skiaAtlasModule, useCountUp, useEntity, useGame, useGameLoop, useOverlayFade, useSafeArea, useSignalState } from "@flare-engine/react";
|
|
5
|
+
export * from "@flare-engine/animation";
|
|
6
|
+
export * from "@flare-engine/assets";
|
|
7
|
+
export * from "@flare-engine/audio";
|
|
8
|
+
export * from "@flare-engine/core";
|
|
9
|
+
export * from "@flare-engine/debug";
|
|
10
|
+
export * from "@flare-engine/ecs";
|
|
11
|
+
export * from "@flare-engine/events";
|
|
12
|
+
export * from "@flare-engine/input";
|
|
13
|
+
export * from "@flare-engine/math";
|
|
14
|
+
export * from "@flare-engine/particles";
|
|
15
|
+
export * from "@flare-engine/physics";
|
|
16
|
+
export * from "@flare-engine/render";
|
|
17
|
+
export * from "@flare-engine/scene";
|
|
18
|
+
export * from "@flare-engine/tilemap";
|
|
19
|
+
export { type AchievementRule, type AnalyticsRule, BLOOM_SKSL, type BloomUniforms, CHROMATIC_ABERRATION_SKSL, COLOR_GRADING_LUT_SKSL, COMPOSITE_SKSL, CRT_SKSL, type ChromaticAberrationUniforms, type ColorGradingLutUniforms, type CompiledPass, type CompiledPassLike, type CompositeUniforms, type CrtUniforms, type DynamicsBody, type DynamicsWorld, type Effect, EffectChain, type EffectKind, type EffectUniforms, GOD_RAYS_SKSL, GRAYSCALE_FLASH_SKSL, type GameConfig, GameContext, type GameContextValue, type GameInstance, GameView, type GameViewConfig, type GameViewProps, type GodRaysUniforms, type GrayscaleFlashUniforms, type LeaderboardRule, LoadingScreen, type LoadingScreenProps, type PostFxChainLike, type PostFxCompiledShader, type PostFxController, type PostFxControllerOptions, type PostFxFlashConfig, type PostFxPassDescriptor, type PostFxRenderHook, type PostFxRuntime, type PostFxRuntimeLike, type PostFxSkImageLike, type RenderHook, type RenderShapesOpts, type SafeArea, SafeAreaContext, type ShapeRect, type SkOffscreenCanvasLike, type SkiaFrameRenderer, type SkiaModuleLike, type SkiaPostFxModuleLike, type SkiaRuntimeEffectFactory, type SkiaRuntimeEffectLike, type Tier2AchievementsLike, type Tier2AnalyticsLike, type Tier2EventSource, type Tier2LeaderboardsLike, type Tier2Providers, type Tier2Rule, type Tier2WiringOptions, VIGNETTE_SKSL, type VignetteUniforms, VirtualButton, type VirtualButtonProps, VirtualJoystick, type VirtualJoystickProps, WEATHER_CLOUDS_SKSL, WEATHER_DARK_VIGNETTE_SKSL, WEATHER_RAIN_SKSL, WEATHER_SUN_SHAFT_SKSL, type WeatherCloudsUniforms, type WeatherDarkVignetteUniforms, type WeatherRainUniforms, type WeatherSunShaftUniforms, addBody, createBloom, createBody, createChromaticAberration, createColorGradingLut, createCrt, createGame, createGodRays, createGrayscaleFlash, createNeutralLutBytes, createPostFxComposite, createPostFxController, createPostFxRuntime, createSkiaFrameRenderer, createTier2Wiring, createVignette, createWeatherClouds, createWeatherDarkVignette, createWeatherRain, createWeatherSunShaft, createWorld, renderShapesToImage, skiaAtlasModule, step, useCountUp, useEntity, useGame, useGameLoop, useOverlayFade, useSafeArea, useSignalState };
|