@mpgd/cli 0.56.0 → 0.58.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.
Files changed (49) hide show
  1. package/dist/capacitor-shell-starter.d.ts +30 -0
  2. package/dist/capacitor-shell-starter.js +243 -11
  3. package/dist/index.js +170 -11
  4. package/dist/legal-site-output.d.ts +18 -0
  5. package/dist/legal-site-output.js +46 -1
  6. package/dist/native-build-info.json +2 -2
  7. package/dist/native-build-target.js +3935 -1308
  8. package/dist/native-deploy-run.js +4 -0
  9. package/dist/native-shell-store-policy.d.ts +123 -0
  10. package/dist/native-shell-store-policy.js +816 -0
  11. package/dist/notifications-starter.js +26 -3
  12. package/dist/release-state.d.ts +2 -0
  13. package/dist/release-state.js +4 -2
  14. package/dist/testflight-submission.d.ts +9 -0
  15. package/dist/testflight-submission.js +69 -0
  16. package/package.json +16 -16
  17. package/templates/lite-overlay/agent/acceptance.md +1 -1
  18. package/templates/lite-overlay/agent/brief.md +1 -1
  19. package/templates/lite-overlay/src/lite/deleteAccountButton.ts +173 -0
  20. package/templates/lite-overlay/src/lite/restorePurchasesButton.ts +63 -0
  21. package/templates/lite-overlay/src/runtime/createGame.ts +8 -0
  22. package/templates/notifications-overlay/common/docs/NOTIFICATIONS.md +28 -6
  23. package/templates/notifications-overlay/common/notifications/deployment.json +2 -1
  24. package/templates/notifications-overlay/common/notifications/topics.json +3 -0
  25. package/templates/notifications-overlay/common/src/platform/capacitorNotifications.ts +8 -3
  26. package/templates/notifications-overlay/common/src/platform/notificationBackend.ts +111 -2
  27. package/templates/notifications-overlay/common/src/platform/notifications.ts +36 -4
  28. package/templates/phaser-game/README.md +72 -0
  29. package/templates/phaser-game/agent/acceptance.md +4 -1
  30. package/templates/phaser-game/agent/brief.md +14 -4
  31. package/templates/phaser-game/apps/target-devvit/src/server/bridge.ts +37 -0
  32. package/templates/phaser-game/gitignore +11 -0
  33. package/templates/phaser-game/legal/delete-account.html +133 -0
  34. package/templates/phaser-game/legal/privacy.html +111 -12
  35. package/templates/phaser-game/legal/support.html +1 -0
  36. package/templates/phaser-game/legal/terms.html +1 -0
  37. package/templates/phaser-game/mpgd.game.json +3 -0
  38. package/templates/phaser-game/src/env.d.ts +6 -0
  39. package/templates/phaser-game/src/i18n/messages.ts +86 -1
  40. package/templates/phaser-game/src/main.ts +69 -8
  41. package/templates/phaser-game/src/platform/commerceAccountBinding.ts +39 -10
  42. package/templates/phaser-game/src/platform/deleteAccount.ts +334 -0
  43. package/templates/phaser-game/src/platform/gameServices.ts +55 -10
  44. package/templates/phaser-game/src/platform/guestIdentity.ts +301 -0
  45. package/templates/phaser-game/src/platform/restorePurchases.ts +205 -0
  46. package/templates/phaser-game/src/platform/serverSession.ts +8 -0
  47. package/templates/phaser-game/src/platform/sessionGatedServices.ts +217 -0
  48. package/templates/phaser-game/src/scenes/LobbyScene.ts +254 -1
  49. 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 === 'legal-dir' ? 'read legal sources' : 'write legal site output';
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
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "kitGitSha": "dc28031ea2d85c442c084cd118cdd3fa2cecadba",
2
+ "kitGitSha": "f90c1b77055c4700195f5e393c3c17b6db23f9bc",
3
3
  "kitDirty": false,
4
- "packageVersion": "0.56.0"
4
+ "packageVersion": "0.58.0"
5
5
  }