@makefully/adaptfully 2.1.0 → 3.0.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/CHANGELOG.md +87 -64
- package/LICENSE +21 -21
- package/README.md +515 -430
- package/bin/adaptfully.js +7 -0
- package/bin/wrapfully-deploy.js +22 -7
- package/lib/node/archive.js +43 -34
- package/lib/node/config.js +42 -42
- package/lib/node/deploy.js +52 -69
- package/lib/node/fs-utils.js +49 -0
- package/lib/node/index.js +20 -18
- package/lib/node/paths.js +18 -0
- package/lib/node/pipeline.js +77 -0
- package/lib/node/prebuild.js +63 -0
- package/lib/node/registrations.js +314 -0
- package/lib/node/report.js +42 -42
- package/lib/runtime/auth/_helpers.js +38 -38
- package/lib/runtime/auth/dev-auth.js +78 -78
- package/lib/runtime/auth/google-auth.js +176 -176
- package/lib/runtime/auth/steam-auth.js +50 -50
- package/lib/runtime/core.js +56 -61
- package/lib/runtime/platform.js +89 -89
- package/package.json +62 -61
- package/lib/node/distribution.js +0 -138
package/README.md
CHANGED
|
@@ -1,430 +1,515 @@
|
|
|
1
|
-
# Adaptfully
|
|
2
|
-
|
|
3
|
-
Platform abstraction and Wrapfully deploy client for Makefully games.
|
|
4
|
-
|
|
5
|
-
- **Adaptfully runtime** — shared auth and platform services via `adaptfully.register()` / `adaptfully.get()`
|
|
6
|
-
- **
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
platform
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
| `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```javascript
|
|
40
|
-
|
|
41
|
-
adaptfully.register('
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
"
|
|
298
|
-
"
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
{
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
1
|
+
# Adaptfully
|
|
2
|
+
|
|
3
|
+
Platform abstraction and Wrapfully deploy client for Makefully games.
|
|
4
|
+
|
|
5
|
+
- **Adaptfully runtime** — shared auth and platform services via `adaptfully.register()` / `adaptfully.get()`
|
|
6
|
+
- **Adaptfully pipeline** — prebuild, build, and deploy stages driven by `config.platforms`
|
|
7
|
+
- **Wrapfully deploy** — zip-and-post client for building desktop, mobile, and Steam packages
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @makefully/adaptfully
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Maintainers: see [PUBLISHING.md](PUBLISHING.md) for npm trusted publishing setup.
|
|
16
|
+
|
|
17
|
+
## Adaptfully runtime
|
|
18
|
+
|
|
19
|
+
Games register platform services before load and retrieve them in-game. Adaptfully applies platform registrations during **prebuild** — games compile a neutral `deploy/` folder, then Adaptfully writes `output/<platform>-prebuild/` with the correct auth and plugin scripts injected into HTML.
|
|
20
|
+
|
|
21
|
+
### Pipeline stages
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
adaptfully prebuild web # deploy/ → output/web-prebuild/
|
|
25
|
+
adaptfully build steam # prebuild + zip and send to Wrapfully
|
|
26
|
+
adaptfully deploy steam # build + platform release when credentials are present
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Stage | What it does |
|
|
30
|
+
|-------|----------------|
|
|
31
|
+
| `prebuild` | Copy `deploy/` to `output/<platform>-prebuild/` and inject registrations |
|
|
32
|
+
| `build` | Prebuild, then POST the result to Wrapfully |
|
|
33
|
+
| `deploy` | Build, then release to the target platform (Steam upload, webapp SFTP, etc. via Wrapfully when credentials are in `assets/meta/publish/`) |
|
|
34
|
+
|
|
35
|
+
`wrapfully-deploy` is a compatibility alias for `adaptfully deploy` when invoked with a Wrapfully builder name (`steam`, `win`, `android`, etc.).
|
|
36
|
+
|
|
37
|
+
Place `<!-- adaptfully -->` / `<!-- /adaptfully -->` markers in your HTML templates where registrations should be injected (typically between split bundle scripts, before `account.js` runs).
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
// Injected into deploy/index.html for the target platform (before game code):
|
|
41
|
+
adaptfully.register('auth', adaptfully.auth.Google);
|
|
42
|
+
|
|
43
|
+
// In-game:
|
|
44
|
+
var platform = adaptfully.get('auth');
|
|
45
|
+
platform.login(function (result) { /* ... */ });
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Auth plugins
|
|
49
|
+
|
|
50
|
+
| Plugin key | Registration | Runtime |
|
|
51
|
+
|------------|--------------|---------|
|
|
52
|
+
| `google-auth` | `adaptfully.register('auth', adaptfully.auth.Google)` | Web, Android, iOS |
|
|
53
|
+
| `steam-auth` | `adaptfully.register('auth', adaptfully.auth.Steam)` | Steam / Electron |
|
|
54
|
+
| `dev-auth` | `adaptfully.register('auth', adaptfully.auth.Dev)` | Local dev (test user) |
|
|
55
|
+
|
|
56
|
+
Use plugin keys in `config.platforms.<platform>.registrations`. Custom deploy scripts use a path relative to the deploy folder instead:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"config": {
|
|
61
|
+
"platforms": {
|
|
62
|
+
"steam": {
|
|
63
|
+
"registrations": {
|
|
64
|
+
"auth": "steam-auth",
|
|
65
|
+
"storage": "/javascript/custom-storage-solution.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"web": {
|
|
69
|
+
"registrations": {
|
|
70
|
+
"auth": "google-auth",
|
|
71
|
+
"storage": "/javascript/adaptfully-bridge.js"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"dev": {
|
|
75
|
+
"registrations": {
|
|
76
|
+
"auth": "dev-auth"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Standard plugin keys load bundled Adaptfully runtime scripts and emit an inline `adaptfully.register()` call. Path values add a `<script src="...">` tag — the script is expected to call `adaptfully.register()` itself (for example a bridge that wires `storage` and `config`).
|
|
85
|
+
|
|
86
|
+
Wrapfully builders (`steam`, `win`, `mac`, `android`, etc.) map to platform keys via defaults (`win` → `steam`) or an explicit `builders` array on the platform config.
|
|
87
|
+
|
|
88
|
+
### Node API
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
import {
|
|
92
|
+
prebuildPlatform,
|
|
93
|
+
runAdaptfullyStage,
|
|
94
|
+
buildAdaptfullyInjection,
|
|
95
|
+
injectAdaptfullyRegistrations,
|
|
96
|
+
adaptfullyInjectionForPlatform,
|
|
97
|
+
resolveRegistrationAssets,
|
|
98
|
+
resolvePlatformKey,
|
|
99
|
+
resolveBuilderForPlatform,
|
|
100
|
+
getRuntimeDir,
|
|
101
|
+
resolveRuntimeScript,
|
|
102
|
+
STANDARD_PLUGINS,
|
|
103
|
+
} from '@makefully/adaptfully';
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- **`prebuildPlatform(deployFolder, platformKey, pkg)`** — copy `deploy/` to `output/<platform>-prebuild/` and inject registrations into all HTML files.
|
|
107
|
+
- **`resolveRegistrationAssets(registrations)`** — resolve runtime script paths, inline registration JS, and external script tags for a registration map (useful for Vite dev servers).
|
|
108
|
+
- **`runAdaptfullyStage('prebuild' | 'build' | 'deploy', platformKey, options)`** — run a pipeline stage programmatically.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Wrapfully deploy
|
|
113
|
+
|
|
114
|
+
After prebuild, the build and deploy stages zip `output/<platform>-prebuild/` and POST it to a Wrapfully build server. Artifacts are saved to `./output/`.
|
|
115
|
+
|
|
116
|
+
## Quick start
|
|
117
|
+
|
|
118
|
+
1. Build your web app into a neutral deploy folder (default: `./deploy/`, must include `index.html` with adaptfully markers).
|
|
119
|
+
2. Add `config.platforms` and other settings to `package.json` (see [Configuration](#configuration)).
|
|
120
|
+
3. Add icons and any signing credentials under `./assets/meta/`.
|
|
121
|
+
4. Prebuild for your target platform, then build or deploy:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx adaptfully prebuild web
|
|
125
|
+
npx adaptfully deploy steam http://build.example.com:9630/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
For web-only hosting (no Wrapfully), stop after prebuild and upload `output/web-prebuild/` yourself.
|
|
129
|
+
|
|
130
|
+
## Usage
|
|
131
|
+
|
|
132
|
+
### Adaptfully CLI
|
|
133
|
+
|
|
134
|
+
Run from your project root:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npx adaptfully <prebuild|build|deploy> <platform> [server] [mode]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Stage | Description |
|
|
141
|
+
|-------|-------------|
|
|
142
|
+
| `prebuild` | Copy `deploy/` → `output/<platform>-prebuild/` with registrations injected |
|
|
143
|
+
| `build` | Prebuild, then POST to Wrapfully (no platform release) |
|
|
144
|
+
| `deploy` | Prebuild, POST to Wrapfully, then release when credentials are present |
|
|
145
|
+
|
|
146
|
+
| Argument | Default | Description |
|
|
147
|
+
|----------|---------|-------------|
|
|
148
|
+
| `platform` | — | Platform key from `config.platforms` (`web`, `steam`, etc.) |
|
|
149
|
+
| `server` | see below | Wrapfully server base URL (`build` and `deploy` only) |
|
|
150
|
+
| `mode` | `extract` | `extract` unpacks the response zip into `./output/`; any other value saves `./output/{name}-{version}-{builder}.zip` |
|
|
151
|
+
|
|
152
|
+
Examples:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Prebuild for web (upload output/web-prebuild/ via FTP, S3, etc.)
|
|
156
|
+
npx adaptfully prebuild web
|
|
157
|
+
|
|
158
|
+
# Build for Steam via Wrapfully
|
|
159
|
+
npx adaptfully build steam http://build.example.com:9630/
|
|
160
|
+
|
|
161
|
+
# Full Steam deploy (build + upload when steam.json credentials are present)
|
|
162
|
+
npx adaptfully deploy steam http://build.example.com:9630/
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Add scripts to your project's `package.json`:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"scripts": {
|
|
170
|
+
"web:prebuild": "adaptfully prebuild web",
|
|
171
|
+
"steam:deploy": "adaptfully deploy steam"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### wrapfully-deploy (legacy alias)
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
npx wrapfully-deploy [builder] [server] [mode]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Accepts Wrapfully builder names (`steam`, `win`, `mac`, `android`, `webapp`, etc.) instead of platform keys. Maps to the matching `config.platforms` entry (defaults: `win` → `steam`, `webapp` → `web`) and runs the `deploy` stage.
|
|
183
|
+
|
|
184
|
+
### Server address
|
|
185
|
+
|
|
186
|
+
The server URL is resolved in this order:
|
|
187
|
+
|
|
188
|
+
1. CLI argument
|
|
189
|
+
2. `WRAPFULLY_SERVER` environment variable
|
|
190
|
+
3. `server` field in `wrapfully.json`
|
|
191
|
+
4. `http://localhost:9630/`
|
|
192
|
+
|
|
193
|
+
Keep server addresses and credentials out of version control — use environment variables or a gitignored `wrapfully.json`.
|
|
194
|
+
|
|
195
|
+
## What gets sent
|
|
196
|
+
|
|
197
|
+
The client POSTs a zip stream built from `output/<platform>-prebuild/` to:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
{server}{builder}/{name}-{version}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
For example, a project named `mygame` at version `1.2.0` with builder `android`:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
http://build.example.com:9630/android/mygame-1.2.0
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The server extracts the zip, reads the embedded `package.json`, runs the build for that platform, and streams a zip of artifacts back to the client.
|
|
210
|
+
|
|
211
|
+
### Zip contents
|
|
212
|
+
|
|
213
|
+
| Archive path | Source on disk | Purpose |
|
|
214
|
+
|--------------|----------------|---------|
|
|
215
|
+
| `deploy/` | prebuilt `output/<platform>-prebuild/` | Built web app with Adaptfully registrations injected |
|
|
216
|
+
| `deploy/index.html` | prebuilt entry point | Platform-specific HTML |
|
|
217
|
+
| `meta/` | `./assets/meta/` (if present) | Icons, signing keys, and publish credentials |
|
|
218
|
+
| `package.json` | project root | Merged `package.json` + `wrapfully.json` config |
|
|
219
|
+
|
|
220
|
+
### Project layout
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
mygame/
|
|
224
|
+
├── package.json # npm metadata + config.platforms (see below)
|
|
225
|
+
├── wrapfully.json # optional — merged into config
|
|
226
|
+
├── deploy/ # neutral build output (default deployFolder)
|
|
227
|
+
│ └── index.html
|
|
228
|
+
├── output/
|
|
229
|
+
│ ├── web-prebuild/ # after adaptfully prebuild web
|
|
230
|
+
│ └── steam-prebuild/ # after adaptfully prebuild steam
|
|
231
|
+
└── assets/
|
|
232
|
+
└── meta/ # packaged as meta/ in the zip
|
|
233
|
+
├── icon-foreground.png
|
|
234
|
+
├── icon-background.png
|
|
235
|
+
└── publish/ # platform signing & deploy credentials
|
|
236
|
+
├── build.json
|
|
237
|
+
├── android/
|
|
238
|
+
├── apple.json
|
|
239
|
+
└── ...
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Icons (`icon-foreground.png`, `icon-background.png`) are required for mobile, desktop, and Steam builds.
|
|
243
|
+
|
|
244
|
+
### Icons
|
|
245
|
+
|
|
246
|
+
Place two layered PNG files in `./assets/meta/` (packaged as `meta/` in the zip):
|
|
247
|
+
|
|
248
|
+
| File | Purpose |
|
|
249
|
+
|------|---------|
|
|
250
|
+
| `icon-foreground.png` | Foreground layer (typically the character or subject) |
|
|
251
|
+
| `icon-background.png` | Background layer (typically the scene or environment) |
|
|
252
|
+
|
|
253
|
+
The build server composites the foreground over the background, applies a binding/logo overlay, and generates the icon sizes each platform needs.
|
|
254
|
+
|
|
255
|
+
**Recommended format:** 1536×1536 pixel square PNGs for both files. Images with other dimensions are scaled to 1536×1536 automatically, but matching the target size produces the sharpest results.
|
|
256
|
+
|
|
257
|
+
## Configuration
|
|
258
|
+
|
|
259
|
+
Build settings are read from `package.json`. The client merges any `wrapfully.json` fields into `package.json`'s `config` object before sending.
|
|
260
|
+
|
|
261
|
+
### `package.json`
|
|
262
|
+
|
|
263
|
+
Standard npm fields (`name`, `version`, `description`) are used directly. Add a `config` block:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"name": "mygame",
|
|
268
|
+
"version": "1.2.0",
|
|
269
|
+
"description": "My game",
|
|
270
|
+
"config": {
|
|
271
|
+
"title": "My Game",
|
|
272
|
+
"packageName": "com.example.mygame",
|
|
273
|
+
"publisherDisplayName": "Example Games",
|
|
274
|
+
"publisherFullName": "Example Games LLC",
|
|
275
|
+
"publisherWebsite": "https://example.com",
|
|
276
|
+
"publisherEmailAddress": "hello@example.com",
|
|
277
|
+
"scope": "https://example.com/games/",
|
|
278
|
+
"themeColor": "#1a1a2e",
|
|
279
|
+
"twitterId": "@examplegames",
|
|
280
|
+
"steamId": 1234567,
|
|
281
|
+
"deployFolder": "deploy",
|
|
282
|
+
"platforms": {
|
|
283
|
+
"web": {
|
|
284
|
+
"registrations": {
|
|
285
|
+
"auth": "google-auth",
|
|
286
|
+
"storage": "/javascript/adaptfully-bridge.js"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"steam": {
|
|
290
|
+
"registrations": {
|
|
291
|
+
"auth": "steam-auth",
|
|
292
|
+
"storage": "/javascript/adaptfully-bridge.js"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"properties": [
|
|
297
|
+
{ "tag": "plugin", "name": "cordova-plugin-inappbrowser" },
|
|
298
|
+
{ "tag": "allow-navigation", "href": "*" }
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
| Field | Used by | Description |
|
|
305
|
+
|-------|---------|-------------|
|
|
306
|
+
| `title` | All | Display name shown in stores and app shells |
|
|
307
|
+
| `packageName` | Cordova, Electron, UWP | Reverse-DNS identifier (`com.company.game`) |
|
|
308
|
+
| `publisherDisplayName` | Cordova, Electron, web | Short publisher name |
|
|
309
|
+
| `publisherFullName` | Electron | Legal entity name for copyright |
|
|
310
|
+
| `publisherWebsite` | Cordova, web | Company URL |
|
|
311
|
+
| `publisherEmailAddress` | Cordova | Contact email |
|
|
312
|
+
| `scope` | Web/PWA | Base URL scope for the web app |
|
|
313
|
+
| `themeColor` | Cordova, UWP, web | Loading screen / theme color |
|
|
314
|
+
| `twitterId` | Web | Twitter handle for meta tags |
|
|
315
|
+
| `steamId` | Steam | Steam app ID |
|
|
316
|
+
| `deployFolder` | Client | Neutral deploy directory staged before prebuild (default: `deploy`) |
|
|
317
|
+
| `outputFolder` | Client | Prebuild output root (default: `output`) |
|
|
318
|
+
| `platforms` | Prebuild | Per-platform registration maps (see [Adaptfully runtime](#adaptfully-runtime)) |
|
|
319
|
+
| `platforms.<name>.builder` | Build/deploy | Override Wrapfully builder for a platform (default: `web` → `webapp`, others match platform key) |
|
|
320
|
+
| `platforms.<name>.builders` | wrapfully-deploy | Map additional Wrapfully builder names to a platform |
|
|
321
|
+
| `properties` | Cordova | Cordova config.xml entries (plugins, allow-navigation, etc.) |
|
|
322
|
+
|
|
323
|
+
### `wrapfully.json`
|
|
324
|
+
|
|
325
|
+
Optional. Fields are shallow-merged into `package.json`'s `config`:
|
|
326
|
+
|
|
327
|
+
```json
|
|
328
|
+
{
|
|
329
|
+
"deployFolder": "dist",
|
|
330
|
+
"server": "http://build.example.com:9630/",
|
|
331
|
+
"title": "My Game",
|
|
332
|
+
"packageName": "com.example.mygame"
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Use this to set the server address or override config per environment without editing `package.json`.
|
|
337
|
+
|
|
338
|
+
## Builders
|
|
339
|
+
|
|
340
|
+
Each builder name becomes a path segment on the server. Some builds require a specific host OS on the server side; composite builders fan out to multiple platforms automatically.
|
|
341
|
+
|
|
342
|
+
| Builder | Output |
|
|
343
|
+
|---------|--------|
|
|
344
|
+
| `android` | Release Android (.aab) |
|
|
345
|
+
| `android-dev` | Debug Android (.apk) |
|
|
346
|
+
| `ios` | Release iOS (.ipa) |
|
|
347
|
+
| `ios-dev` | Debug iOS (.ipa) |
|
|
348
|
+
| `ios-sim` | iOS Simulator (.app) |
|
|
349
|
+
| `mac` | Release Mac (.app) |
|
|
350
|
+
| `mac-dev` | Debug Mac (.app) with DevTools |
|
|
351
|
+
| `win` | Windows portable (.exe) |
|
|
352
|
+
| `win-dev` | Debug Windows portable with DevTools |
|
|
353
|
+
| `linux` | Linux build |
|
|
354
|
+
| `linux-dev` | Debug Linux build with DevTools |
|
|
355
|
+
| `uwp` | Universal Windows Package |
|
|
356
|
+
| `webapp` | Service-worker web app (optionally SFTP deploy) |
|
|
357
|
+
| `steam` | Windows + Mac + Linux, uploads to Steam |
|
|
358
|
+
| `steam-dev` | Debug Windows + Mac + Linux, no Steam upload |
|
|
359
|
+
| `cordova` | Release Android + iOS |
|
|
360
|
+
| `cordova-dev` | Debug Android + iOS |
|
|
361
|
+
| `apple` | Release Mac + iOS |
|
|
362
|
+
| `apple-dev` | Release Mac + debug iOS |
|
|
363
|
+
|
|
364
|
+
For a single platform, pass the specific builder name rather than a composite.
|
|
365
|
+
|
|
366
|
+
### Platform package requirements
|
|
367
|
+
|
|
368
|
+
Signing keys, provisioning profiles, and store credentials go in `./assets/meta/publish/` on disk (sent as `meta/publish/` in the zip). **These files contain secrets** — add them to `.gitignore` and never commit them to a public repository.
|
|
369
|
+
|
|
370
|
+
#### Android (`android`, `android-dev`)
|
|
371
|
+
|
|
372
|
+
Place keystore files in `assets/meta/publish/android/`. Include `assets/meta/publish/build.json`:
|
|
373
|
+
|
|
374
|
+
```json
|
|
375
|
+
{
|
|
376
|
+
"android": {
|
|
377
|
+
"debug": {
|
|
378
|
+
"keystore": "./android/debug.keystore",
|
|
379
|
+
"packageType": "apk",
|
|
380
|
+
"storePassword": "android",
|
|
381
|
+
"alias": "androiddebugkey",
|
|
382
|
+
"password": "android",
|
|
383
|
+
"keystoreType": ""
|
|
384
|
+
},
|
|
385
|
+
"release": {
|
|
386
|
+
"keystore": "./android/release.keystore",
|
|
387
|
+
"packageType": "bundle",
|
|
388
|
+
"storePassword": "(your store password)",
|
|
389
|
+
"alias": "(your alias)",
|
|
390
|
+
"password": "(your password)",
|
|
391
|
+
"keystoreType": ""
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
To deploy to Google Play, also include `assets/meta/publish/google.json`:
|
|
398
|
+
|
|
399
|
+
```json
|
|
400
|
+
{
|
|
401
|
+
"type": "service_account",
|
|
402
|
+
"project_id": "(your project id)",
|
|
403
|
+
"private_key_id": "(your private key id)",
|
|
404
|
+
"private_key": "(your private key)",
|
|
405
|
+
"client_email": "(your service account email)",
|
|
406
|
+
"client_id": "(your client id)",
|
|
407
|
+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
|
408
|
+
"token_uri": "https://oauth2.googleapis.com/token",
|
|
409
|
+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
|
410
|
+
"client_x509_cert_url": "(your service account cert URL)"
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### Apple (`ios`, `ios-dev`, `ios-sim`, `mac`, `apple`, `apple-dev`)
|
|
415
|
+
|
|
416
|
+
Include `assets/meta/publish/build.json` with iOS signing settings:
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"ios": {
|
|
421
|
+
"debug": {
|
|
422
|
+
"codeSignIdentity": "iPhone Development",
|
|
423
|
+
"provisioningProfile": "(your development provisioning profile id)",
|
|
424
|
+
"developmentTeam": "(your team id)",
|
|
425
|
+
"packageType": "development",
|
|
426
|
+
"automaticProvisioning": false
|
|
427
|
+
},
|
|
428
|
+
"release": {
|
|
429
|
+
"codeSignIdentity": "iPhone Distribution",
|
|
430
|
+
"provisioningProfile": "(your distribution provisioning profile id)",
|
|
431
|
+
"developmentTeam": "(your team id)",
|
|
432
|
+
"packageType": "app-store",
|
|
433
|
+
"automaticProvisioning": false
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
To deploy to the App Store, include `assets/meta/publish/apple.json`:
|
|
440
|
+
|
|
441
|
+
```json
|
|
442
|
+
{
|
|
443
|
+
"category": "(your app's category)",
|
|
444
|
+
"identity": "(your team identity)",
|
|
445
|
+
"username": "(your username)",
|
|
446
|
+
"password": "(your password)"
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
#### Cordova (`cordova`, `cordova-dev`)
|
|
451
|
+
|
|
452
|
+
Requires the Android and Apple package requirements above.
|
|
453
|
+
|
|
454
|
+
#### Steam (`steam`, `steam-dev`)
|
|
455
|
+
|
|
456
|
+
`steam-dev` builds debug Electron binaries for Windows, Mac, and Linux without uploading to Steam. No `steam.json` credentials are required.
|
|
457
|
+
|
|
458
|
+
For release uploads, include `assets/meta/publish/steam.json`:
|
|
459
|
+
|
|
460
|
+
```json
|
|
461
|
+
{
|
|
462
|
+
"username": "(your username)",
|
|
463
|
+
"password": "(your password)"
|
|
464
|
+
}
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
Also set `steamId` in your `config` block.
|
|
468
|
+
|
|
469
|
+
Steam builds can run on either the Windows or Mac server. The server that receives the request builds its own platforms and requests the rest from the other server (Windows builds `win` and requests `mac`/`linux`; Mac builds `mac`/`linux` and requests `win`). Install the Steamworks SDK ContentBuilder on any server that will upload to Steam.
|
|
470
|
+
|
|
471
|
+
When builds relay between servers, `meta/publish/` credentials travel in the zip with the game payload.
|
|
472
|
+
|
|
473
|
+
#### Electron (`win`, `win-dev`, `mac`, `mac-dev`, `linux`, `linux-dev`, `steam`, `steam-dev`)
|
|
474
|
+
|
|
475
|
+
`-dev` builders produce debug Electron apps with DevTools enabled and the application menu visible. Dev builds skip code signing, notarization, and Steam upload. No publish credentials are required for dev builds.
|
|
476
|
+
|
|
477
|
+
Release `win` builds can be signed with `assets/meta/publish/ms.json` (see Windows below). Release `mac` builds can use `assets/meta/publish/apple.json` for signing and notarization (see Apple above).
|
|
478
|
+
|
|
479
|
+
#### Web app (`webapp`)
|
|
480
|
+
|
|
481
|
+
To deploy via SFTP, include `assets/meta/publish/sftp.json`:
|
|
482
|
+
|
|
483
|
+
```json
|
|
484
|
+
{
|
|
485
|
+
"webapp": {
|
|
486
|
+
"host": "(your sftp host)",
|
|
487
|
+
"port": 22,
|
|
488
|
+
"user": "(your username)",
|
|
489
|
+
"password": "(your password)",
|
|
490
|
+
"path": "(the sftp subdirectory in which to publish the app)"
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
#### Windows (`win`, `win-dev`, `uwp`)
|
|
496
|
+
|
|
497
|
+
To sign the app, place your certificate at `assets/meta/publish/ms/packcert.pfx` and include `assets/meta/publish/ms.json`:
|
|
498
|
+
|
|
499
|
+
```json
|
|
500
|
+
{
|
|
501
|
+
"publisherName": "CN=(your publisher id)",
|
|
502
|
+
"certificateFile": "./ms/packcert.pfx",
|
|
503
|
+
"password": "(your password)"
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
## Response
|
|
508
|
+
|
|
509
|
+
The server responds with a zip stream containing build artifacts (`.apk`, `.aab`, `.ipa`, `.app`, `.exe`, etc.) and optional status files. By default the client extracts this into `./output/`. Use a non-`extract` mode value to save the raw response zip instead.
|
|
510
|
+
|
|
511
|
+
Every build also includes `wrapfully-status.json` with structured `success`, `warn`, and `error` events. The client prints these after extraction and exits with code 1 if any errors were reported, so build failures do not crash the server silently.
|
|
512
|
+
|
|
513
|
+
## License
|
|
514
|
+
|
|
515
|
+
MIT
|