@mpgd/cli 0.57.0 → 0.59.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/dist/capacitor-shell-starter.d.ts +30 -0
- package/dist/capacitor-shell-starter.js +243 -11
- package/dist/index.js +170 -11
- package/dist/legal-site-output.d.ts +18 -0
- package/dist/legal-site-output.js +46 -1
- package/dist/native-build-info.json +2 -2
- package/dist/native-build-target.js +1663 -899
- package/dist/native-deploy-run.js +4 -0
- package/dist/native-shell-store-policy.d.ts +123 -0
- package/dist/native-shell-store-policy.js +816 -0
- package/dist/release-state.d.ts +2 -0
- package/dist/release-state.js +4 -2
- package/dist/testflight-submission.d.ts +9 -0
- package/dist/testflight-submission.js +69 -0
- package/package.json +17 -17
- package/templates/lite-overlay/agent/acceptance.md +1 -1
- package/templates/lite-overlay/agent/brief.md +1 -1
- package/templates/lite-overlay/src/lite/deleteAccountButton.ts +173 -0
- package/templates/lite-overlay/src/lite/restorePurchasesButton.ts +63 -0
- package/templates/lite-overlay/src/runtime/createGame.ts +8 -0
- package/templates/notifications-overlay/common/docs/NOTIFICATIONS.md +12 -6
- package/templates/notifications-overlay/common/notifications/deployment.json +2 -1
- package/templates/notifications-overlay/common/notifications/topics.json +3 -0
- package/templates/notifications-overlay/common/src/platform/capacitorNotifications.ts +8 -3
- package/templates/notifications-overlay/common/src/platform/notifications.ts +17 -3
- package/templates/phaser-game/README.md +72 -0
- package/templates/phaser-game/agent/acceptance.md +4 -1
- package/templates/phaser-game/agent/brief.md +14 -4
- package/templates/phaser-game/gitignore +11 -0
- package/templates/phaser-game/legal/delete-account.html +133 -0
- package/templates/phaser-game/legal/privacy.html +111 -12
- package/templates/phaser-game/legal/support.html +1 -0
- package/templates/phaser-game/legal/terms.html +1 -0
- package/templates/phaser-game/mpgd.game.json +3 -0
- package/templates/phaser-game/src/env.d.ts +6 -0
- package/templates/phaser-game/src/i18n/messages.ts +86 -1
- package/templates/phaser-game/src/main.ts +69 -8
- package/templates/phaser-game/src/platform/commerceAccountBinding.ts +39 -10
- package/templates/phaser-game/src/platform/deleteAccount.ts +334 -0
- package/templates/phaser-game/src/platform/gameServices.ts +55 -10
- package/templates/phaser-game/src/platform/guestIdentity.ts +301 -0
- package/templates/phaser-game/src/platform/restorePurchases.ts +205 -0
- package/templates/phaser-game/src/platform/serverSession.ts +8 -0
- package/templates/phaser-game/src/platform/sessionGatedServices.ts +217 -0
- package/templates/phaser-game/src/scenes/LobbyScene.ts +254 -1
- package/templates/phaser-game/src/scenes/PlayScene.ts +16 -6
|
@@ -157,7 +157,7 @@ function assertNoLegalSymlink(root, target, label) {
|
|
|
157
157
|
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
158
158
|
throw new Error(`${label} must be inside the project root: ${target}`);
|
|
159
159
|
}
|
|
160
|
-
const verb = label === '
|
|
160
|
+
const verb = label === 'out-dir' ? 'write legal site output' : 'read legal sources';
|
|
161
161
|
let current = root;
|
|
162
162
|
for (const part of relative.split(path.sep)) {
|
|
163
163
|
if (part === '' || part === '.') {
|
|
@@ -224,3 +224,48 @@ function ensureLegalDirectory(directory) {
|
|
|
224
224
|
function isErrno(error, code) {
|
|
225
225
|
return error !== null && typeof error === 'object' && 'code' in error && error.code === code;
|
|
226
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Google's AdMob line for `app-ads.txt` (`f08c47fec0942fa0` is Google's
|
|
229
|
+
* certification authority ID). AdMob shows the exact line for an account
|
|
230
|
+
* under Apps > View all apps > app-ads.txt; use a game-owned
|
|
231
|
+
* `legal/app-ads.txt` instead when it differs or mediation partners add lines.
|
|
232
|
+
*/
|
|
233
|
+
export function admobAppAdsTxtLine(publisherId) {
|
|
234
|
+
if (!/^pub-\d{16}$/u.test(publisherId)) {
|
|
235
|
+
throw new Error('mpgd.game.json ads.admob.publisherId must look like pub-0000000000000000.');
|
|
236
|
+
}
|
|
237
|
+
return `google.com, ${publisherId}, DIRECT, f08c47fec0942fa0`;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The `app-ads.txt` the legal site serves at its root, or undefined: a
|
|
241
|
+
* game-owned `<legal-dir>/app-ads.txt` verbatim, else the AdMob line for
|
|
242
|
+
* `ads.admob.publisherId` in the game's `mpgd.game.json`. Store listings
|
|
243
|
+
* name this site as the developer website (Play) or marketing URL (App
|
|
244
|
+
* Store), which is where ad buyers look for the file.
|
|
245
|
+
*/
|
|
246
|
+
export function resolveAppAdsTxt(input) {
|
|
247
|
+
if (input.ownFile !== undefined) {
|
|
248
|
+
if (input.ownFile.trim().length === 0) {
|
|
249
|
+
throw new Error('app-ads.txt in the legal directory is empty.');
|
|
250
|
+
}
|
|
251
|
+
return input.ownFile.endsWith('\n') ? input.ownFile : `${input.ownFile}\n`;
|
|
252
|
+
}
|
|
253
|
+
const config = input.gameConfig;
|
|
254
|
+
if (typeof config !== 'object' || config === null || !('ads' in config)) {
|
|
255
|
+
return undefined;
|
|
256
|
+
}
|
|
257
|
+
const ads = config.ads;
|
|
258
|
+
const admob = typeof ads === 'object' && ads !== null
|
|
259
|
+
? ads.admob
|
|
260
|
+
: undefined;
|
|
261
|
+
const publisherId = typeof admob === 'object' && admob !== null
|
|
262
|
+
? admob.publisherId
|
|
263
|
+
: undefined;
|
|
264
|
+
if (publisherId === undefined) {
|
|
265
|
+
return undefined;
|
|
266
|
+
}
|
|
267
|
+
if (typeof publisherId !== 'string') {
|
|
268
|
+
throw new Error('mpgd.game.json ads.admob.publisherId must be a string.');
|
|
269
|
+
}
|
|
270
|
+
return `${admobAppAdsTxtLine(publisherId)}\n`;
|
|
271
|
+
}
|