@mpgd/adapter-devvit 0.1.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 +21 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +383 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 imjlk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type BridgeRequest, type BridgeResponse } from '@mpgd/bridge';
|
|
2
|
+
import type { PlatformGateway } from '@mpgd/platform';
|
|
3
|
+
export declare const defaultDevvitBridgeEndpoint = "/api/mpgd/bridge";
|
|
4
|
+
type BridgeErrorResponse = Extract<BridgeResponse, {
|
|
5
|
+
readonly ok: false;
|
|
6
|
+
}>;
|
|
7
|
+
export interface DevvitBridge {
|
|
8
|
+
request(input: BridgeRequest): Promise<BridgeResponse>;
|
|
9
|
+
}
|
|
10
|
+
export declare class DevvitBridgeError extends Error {
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly requestId: string;
|
|
13
|
+
readonly retryable: boolean;
|
|
14
|
+
constructor(response: BridgeErrorResponse);
|
|
15
|
+
}
|
|
16
|
+
export interface DevvitPlatformGatewayOptions {
|
|
17
|
+
readonly appVersion: string;
|
|
18
|
+
readonly buildId: string;
|
|
19
|
+
readonly bridge?: DevvitBridge;
|
|
20
|
+
readonly fallbackBridge?: DevvitBridge;
|
|
21
|
+
readonly endpoint?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function createDevvitPlatformGateway(input: DevvitPlatformGatewayOptions): PlatformGateway;
|
|
24
|
+
export declare function createDevvitFetchBridge(input?: {
|
|
25
|
+
readonly endpoint?: string | undefined;
|
|
26
|
+
readonly fetch?: typeof fetch | undefined;
|
|
27
|
+
}): DevvitBridge;
|
|
28
|
+
export declare function createDevvitSandboxBridge(): DevvitBridge;
|
|
29
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { assertBridgeResponse, createBridgeError, } from '@mpgd/bridge';
|
|
2
|
+
export const defaultDevvitBridgeEndpoint = '/api/mpgd/bridge';
|
|
3
|
+
const devvitFallbackStoragePrefix = 'mpgd:devvit:fallback:';
|
|
4
|
+
export class DevvitBridgeError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
requestId;
|
|
7
|
+
retryable;
|
|
8
|
+
constructor(response) {
|
|
9
|
+
super(response.error.message);
|
|
10
|
+
this.name = 'DevvitBridgeError';
|
|
11
|
+
this.code = response.error.code;
|
|
12
|
+
this.requestId = response.id;
|
|
13
|
+
this.retryable = response.error.retryable;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function createDevvitPlatformGateway(input) {
|
|
17
|
+
let lastResolvedStorageFallbackNamespace;
|
|
18
|
+
async function request(method, payload) {
|
|
19
|
+
const bridge = input.bridge ??
|
|
20
|
+
getBridge() ??
|
|
21
|
+
input.fallbackBridge ??
|
|
22
|
+
createDevvitFetchBridge({ endpoint: input.endpoint });
|
|
23
|
+
const response = await bridge.request({
|
|
24
|
+
id: generateRequestId(),
|
|
25
|
+
method,
|
|
26
|
+
payload,
|
|
27
|
+
meta: {
|
|
28
|
+
target: 'reddit',
|
|
29
|
+
appVersion: input.appVersion,
|
|
30
|
+
buildId: input.buildId,
|
|
31
|
+
sentAt: new Date().toISOString(),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
throw new DevvitBridgeError(response);
|
|
36
|
+
}
|
|
37
|
+
return response.data;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
target: 'reddit',
|
|
41
|
+
getCapabilities: () => request('runtime.getCapabilities', {}),
|
|
42
|
+
identity: {
|
|
43
|
+
getPlayer: async () => {
|
|
44
|
+
const player = await request('identity.getPlayer', {});
|
|
45
|
+
rememberStorageFallbackNamespace(player);
|
|
46
|
+
return player;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
commerce: {
|
|
50
|
+
getProducts: () => request('commerce.getProducts', {}),
|
|
51
|
+
purchase: (payload) => request('commerce.purchase', payload),
|
|
52
|
+
restore: () => request('commerce.restore', {}),
|
|
53
|
+
getEntitlements: () => request('commerce.getEntitlements', {}),
|
|
54
|
+
},
|
|
55
|
+
ads: {
|
|
56
|
+
preload: (payload) => request('ads.preload', payload),
|
|
57
|
+
showRewarded: (payload) => request('ads.showRewarded', payload),
|
|
58
|
+
showInterstitial: (payload) => request('ads.showInterstitial', payload),
|
|
59
|
+
},
|
|
60
|
+
leaderboard: {
|
|
61
|
+
submitScore: (payload) => request('leaderboard.submitScore', payload),
|
|
62
|
+
open: (payload) => request('leaderboard.open', payload ?? {}),
|
|
63
|
+
},
|
|
64
|
+
lifecycle: {
|
|
65
|
+
onPause() {
|
|
66
|
+
return () => { };
|
|
67
|
+
},
|
|
68
|
+
onResume() {
|
|
69
|
+
return () => { };
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
storage: {
|
|
73
|
+
async load(payload) {
|
|
74
|
+
let value;
|
|
75
|
+
try {
|
|
76
|
+
value = await request('storage.load', payload);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const fallback = await loadStorageFallback(payload.key, {
|
|
80
|
+
useCachedNamespaceOnFailure: true,
|
|
81
|
+
});
|
|
82
|
+
if (fallback !== null) {
|
|
83
|
+
return fallback;
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
const fallback = await loadStorageFallback(payload.key, {
|
|
88
|
+
useCachedNamespaceOnFailure: value === null,
|
|
89
|
+
});
|
|
90
|
+
return fallback ?? (value === null ? null : { value });
|
|
91
|
+
},
|
|
92
|
+
async save(payload) {
|
|
93
|
+
let result;
|
|
94
|
+
try {
|
|
95
|
+
result = await request('storage.save', payload);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (await saveStorageFallback(payload, undefined, {
|
|
99
|
+
useCachedNamespaceOnFailure: true,
|
|
100
|
+
})) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
if (result.saved !== true) {
|
|
106
|
+
if (await saveStorageFallback(payload, result.playerId, {
|
|
107
|
+
useCachedNamespaceOnFailure: false,
|
|
108
|
+
})) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
throw new Error('Devvit storage save was not persisted and local fallback storage is unavailable.');
|
|
112
|
+
}
|
|
113
|
+
await removeStorageFallback(payload.key, result.playerId);
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
async function loadStorageFallback(key, options) {
|
|
118
|
+
if (!hasDevvitStorageFallbackCandidate(key, input.appVersion)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
const namespace = await resolveNamespace(undefined, options);
|
|
122
|
+
return namespace === undefined ? null : loadDevvitStorageFallback(key, namespace);
|
|
123
|
+
}
|
|
124
|
+
async function saveStorageFallback(payload, playerId, options) {
|
|
125
|
+
const namespace = await resolveNamespace(playerId, options);
|
|
126
|
+
return namespace === undefined ? false : saveDevvitStorageFallback(payload, namespace);
|
|
127
|
+
}
|
|
128
|
+
async function removeStorageFallback(key, playerId) {
|
|
129
|
+
const namespace = await resolveNamespace(playerId, {
|
|
130
|
+
useCachedNamespaceOnFailure: true,
|
|
131
|
+
});
|
|
132
|
+
if (namespace === undefined) {
|
|
133
|
+
console.warn(`devvit storage fallback cleanup skipped due to unresolved namespace for key: ${key}`);
|
|
134
|
+
}
|
|
135
|
+
removeDevvitStorageFallback(key, namespace);
|
|
136
|
+
}
|
|
137
|
+
async function resolveNamespace(playerId, options) {
|
|
138
|
+
const namespace = storageFallbackNamespaceFromPlayerId(playerId);
|
|
139
|
+
if (namespace !== undefined) {
|
|
140
|
+
lastResolvedStorageFallbackNamespace = namespace;
|
|
141
|
+
return namespace;
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
return await resolveStorageFallbackNamespace();
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
console.warn(`devvit storage fallback namespace resolution failed: ${errorMessage(error)}`);
|
|
148
|
+
return options.useCachedNamespaceOnFailure ? lastResolvedStorageFallbackNamespace : undefined;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async function resolveStorageFallbackNamespace() {
|
|
152
|
+
const player = await request('identity.getPlayer', {});
|
|
153
|
+
return rememberStorageFallbackNamespace(player);
|
|
154
|
+
}
|
|
155
|
+
function rememberStorageFallbackNamespace(player) {
|
|
156
|
+
const playerId = player !== null && typeof player.playerId === 'string' && player.playerId.length > 0
|
|
157
|
+
? player.playerId
|
|
158
|
+
: 'anonymous';
|
|
159
|
+
const namespace = devvitStorageFallbackNamespace(input.appVersion, playerId);
|
|
160
|
+
lastResolvedStorageFallbackNamespace = namespace;
|
|
161
|
+
return namespace;
|
|
162
|
+
}
|
|
163
|
+
function storageFallbackNamespaceFromPlayerId(playerId) {
|
|
164
|
+
return playerId !== undefined && playerId.length > 0
|
|
165
|
+
? devvitStorageFallbackNamespace(input.appVersion, playerId)
|
|
166
|
+
: undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
export function createDevvitFetchBridge(input = {}) {
|
|
170
|
+
const endpoint = input.endpoint ?? defaultDevvitBridgeEndpoint;
|
|
171
|
+
return {
|
|
172
|
+
async request(bridgeRequest) {
|
|
173
|
+
const fetchImpl = input.fetch ?? globalThis.fetch;
|
|
174
|
+
if (typeof fetchImpl !== 'function') {
|
|
175
|
+
return createBridgeError(bridgeRequest.id, 'DEVVIT_FETCH_UNAVAILABLE', 'Devvit bridge fetch is not available.', false);
|
|
176
|
+
}
|
|
177
|
+
let response;
|
|
178
|
+
try {
|
|
179
|
+
response = await fetchImpl(endpoint, {
|
|
180
|
+
method: 'POST',
|
|
181
|
+
headers: {
|
|
182
|
+
'content-type': 'application/json',
|
|
183
|
+
},
|
|
184
|
+
body: JSON.stringify(bridgeRequest),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
return createBridgeError(bridgeRequest.id, 'DEVVIT_BRIDGE_NETWORK_ERROR', `Devvit bridge network request failed: ${errorMessage(error)}`, true);
|
|
189
|
+
}
|
|
190
|
+
if (!response.ok) {
|
|
191
|
+
return createBridgeError(bridgeRequest.id, 'DEVVIT_BRIDGE_HTTP_ERROR', `Devvit bridge request failed with HTTP ${response.status}.`, response.status >= 500);
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const body = await response.json();
|
|
195
|
+
return assertBridgeResponse(body);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
return createBridgeError(bridgeRequest.id, 'DEVVIT_BRIDGE_PARSE_ERROR', `Devvit bridge response was not valid JSON: ${errorMessage(error)}`, false);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function getBridge() {
|
|
204
|
+
const globalBridgeHost = globalThis;
|
|
205
|
+
return globalBridgeHost.__DEVVIT_GAME_PLATFORM_BRIDGE__ ?? globalBridgeHost.__GAME_PLATFORM_BRIDGE__;
|
|
206
|
+
}
|
|
207
|
+
function generateRequestId() {
|
|
208
|
+
const cryptoImpl = globalThis.crypto;
|
|
209
|
+
if (typeof cryptoImpl?.randomUUID === 'function') {
|
|
210
|
+
return cryptoImpl.randomUUID();
|
|
211
|
+
}
|
|
212
|
+
if (typeof cryptoImpl?.getRandomValues === 'function') {
|
|
213
|
+
const values = new Uint32Array(2);
|
|
214
|
+
cryptoImpl.getRandomValues(values);
|
|
215
|
+
const first = values[0] ?? 0;
|
|
216
|
+
const second = values[1] ?? 0;
|
|
217
|
+
return `${Date.now().toString(36)}-${first.toString(36)}-${second.toString(36)}`;
|
|
218
|
+
}
|
|
219
|
+
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
220
|
+
}
|
|
221
|
+
function errorMessage(error) {
|
|
222
|
+
return error instanceof Error ? error.message : String(error);
|
|
223
|
+
}
|
|
224
|
+
export function createDevvitSandboxBridge() {
|
|
225
|
+
const storage = new Map();
|
|
226
|
+
return {
|
|
227
|
+
async request(input) {
|
|
228
|
+
switch (input.method) {
|
|
229
|
+
case 'runtime.getCapabilities':
|
|
230
|
+
return ok(input, {
|
|
231
|
+
nativeIap: false,
|
|
232
|
+
nativeAds: false,
|
|
233
|
+
rewardedAds: false,
|
|
234
|
+
interstitialAds: false,
|
|
235
|
+
nativeLeaderboard: true,
|
|
236
|
+
achievements: false,
|
|
237
|
+
cloudSave: true,
|
|
238
|
+
socialShare: true,
|
|
239
|
+
haptics: false,
|
|
240
|
+
localizedContent: true,
|
|
241
|
+
});
|
|
242
|
+
case 'identity.getPlayer':
|
|
243
|
+
return ok(input, {
|
|
244
|
+
playerId: 'reddit-sandbox-player',
|
|
245
|
+
displayName: 'Reddit Sandbox Player',
|
|
246
|
+
});
|
|
247
|
+
case 'commerce.getProducts':
|
|
248
|
+
case 'commerce.getEntitlements':
|
|
249
|
+
return ok(input, []);
|
|
250
|
+
case 'commerce.purchase':
|
|
251
|
+
return ok(input, {
|
|
252
|
+
status: 'cancelled',
|
|
253
|
+
entitlementIds: [],
|
|
254
|
+
});
|
|
255
|
+
case 'commerce.restore':
|
|
256
|
+
return ok(input, {
|
|
257
|
+
restoredEntitlements: [],
|
|
258
|
+
});
|
|
259
|
+
case 'ads.preload':
|
|
260
|
+
return ok(input, {});
|
|
261
|
+
case 'leaderboard.open':
|
|
262
|
+
return createBridgeError(input.id, 'DEVVIT_LEADERBOARD_OPEN_UNAVAILABLE', 'Devvit leaderboard display is not implemented yet.');
|
|
263
|
+
case 'ads.showRewarded':
|
|
264
|
+
return ok(input, {
|
|
265
|
+
status: 'unavailable',
|
|
266
|
+
rewardGranted: false,
|
|
267
|
+
});
|
|
268
|
+
case 'ads.showInterstitial':
|
|
269
|
+
return ok(input, {
|
|
270
|
+
status: 'unavailable',
|
|
271
|
+
});
|
|
272
|
+
case 'leaderboard.submitScore':
|
|
273
|
+
return ok(input, {
|
|
274
|
+
submitted: true,
|
|
275
|
+
});
|
|
276
|
+
case 'storage.load': {
|
|
277
|
+
const payload = optionalObjectPayload(input.payload);
|
|
278
|
+
const key = typeof payload.key === 'string' ? payload.key : undefined;
|
|
279
|
+
return ok(input, key === undefined ? null : (storage.get(key) ?? null));
|
|
280
|
+
}
|
|
281
|
+
case 'storage.save': {
|
|
282
|
+
const payload = optionalObjectPayload(input.payload);
|
|
283
|
+
const key = typeof payload.key === 'string' ? payload.key : undefined;
|
|
284
|
+
if (key !== undefined) {
|
|
285
|
+
storage.set(key, payload.value);
|
|
286
|
+
}
|
|
287
|
+
return ok(input, {
|
|
288
|
+
saved: key !== undefined,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
default:
|
|
292
|
+
return createBridgeError(input.id, 'UNSUPPORTED_METHOD', `Unsupported Devvit sandbox method: ${input.method}`);
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function optionalObjectPayload(payload) {
|
|
298
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
299
|
+
return {};
|
|
300
|
+
}
|
|
301
|
+
return payload;
|
|
302
|
+
}
|
|
303
|
+
function ok(input, data) {
|
|
304
|
+
return {
|
|
305
|
+
id: input.id,
|
|
306
|
+
ok: true,
|
|
307
|
+
data,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function loadDevvitStorageFallback(key, namespace) {
|
|
311
|
+
const storage = browserLocalStorage();
|
|
312
|
+
if (storage === undefined) {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
const fallbackKey = devvitStorageFallbackKey(key, namespace);
|
|
316
|
+
const stored = storage.getItem(fallbackKey);
|
|
317
|
+
if (stored === null) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
return {
|
|
322
|
+
value: JSON.parse(stored),
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
storage.removeItem(fallbackKey);
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function saveDevvitStorageFallback(input, namespace) {
|
|
331
|
+
const storage = browserLocalStorage();
|
|
332
|
+
if (storage === undefined) {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
try {
|
|
336
|
+
storage.setItem(devvitStorageFallbackKey(input.key, namespace), JSON.stringify(input.value));
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function removeDevvitStorageFallback(key, namespace) {
|
|
344
|
+
const storage = browserLocalStorage();
|
|
345
|
+
if (storage !== undefined) {
|
|
346
|
+
if (namespace !== undefined) {
|
|
347
|
+
storage.removeItem(devvitStorageFallbackKey(key, namespace));
|
|
348
|
+
}
|
|
349
|
+
storage.removeItem(legacyDevvitStorageFallbackKey(key));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function hasDevvitStorageFallbackCandidate(key, appVersion) {
|
|
353
|
+
const storage = browserLocalStorage();
|
|
354
|
+
if (storage === undefined) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
const prefix = `${devvitFallbackStoragePrefix}${encodeURIComponent(appVersion)}:`;
|
|
358
|
+
const suffix = `:${encodeURIComponent(key)}`;
|
|
359
|
+
for (let index = 0; index < storage.length; index += 1) {
|
|
360
|
+
const candidate = storage.key(index);
|
|
361
|
+
if (candidate?.startsWith(prefix) === true && candidate.endsWith(suffix)) {
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
function devvitStorageFallbackNamespace(appVersion, playerId) {
|
|
368
|
+
return `${encodeURIComponent(appVersion)}:${encodeURIComponent(playerId)}`;
|
|
369
|
+
}
|
|
370
|
+
function devvitStorageFallbackKey(key, namespace) {
|
|
371
|
+
return `${devvitFallbackStoragePrefix}${namespace}:${encodeURIComponent(key)}`;
|
|
372
|
+
}
|
|
373
|
+
function legacyDevvitStorageFallbackKey(key) {
|
|
374
|
+
return `${devvitFallbackStoragePrefix}${encodeURIComponent(key)}`;
|
|
375
|
+
}
|
|
376
|
+
function browserLocalStorage() {
|
|
377
|
+
try {
|
|
378
|
+
return globalThis.localStorage;
|
|
379
|
+
}
|
|
380
|
+
catch {
|
|
381
|
+
return undefined;
|
|
382
|
+
}
|
|
383
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mpgd/adapter-devvit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Reddit Devvit Web platform adapter for mpgd games.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/imjlk/mpgd-kit.git",
|
|
9
|
+
"directory": "adapters/devvit"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/imjlk/mpgd-kit/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/imjlk/mpgd-kit#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mpgd",
|
|
17
|
+
"phaser",
|
|
18
|
+
"vite",
|
|
19
|
+
"typescript",
|
|
20
|
+
"devvit",
|
|
21
|
+
"reddit",
|
|
22
|
+
"game-development",
|
|
23
|
+
"game-distribution"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@mpgd/bridge": "0.1.0",
|
|
38
|
+
"@mpgd/platform": "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"ttsc": "0.16.9",
|
|
42
|
+
"typescript": "7.0.1-rc",
|
|
43
|
+
"vitest": "^4.0.0"
|
|
44
|
+
},
|
|
45
|
+
"main": "./dist/index.js",
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"check": "ttsc --noEmit",
|
|
52
|
+
"lint": "ttsc --noEmit",
|
|
53
|
+
"format": "ttsc format",
|
|
54
|
+
"fix": "ttsc fix",
|
|
55
|
+
"test": "vitest run"
|
|
56
|
+
}
|
|
57
|
+
}
|