@mpgd/cli 0.23.0 → 0.24.1

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.
@@ -10,11 +10,13 @@ export interface ProductionTargetPolicy {
10
10
  readonly runtime: string;
11
11
  readonly features: {
12
12
  readonly iap: boolean;
13
+ readonly bannerAds?: boolean;
13
14
  readonly rewardedAds: boolean;
14
15
  readonly interstitialAds: boolean;
15
16
  };
16
17
  readonly monetization: {
17
18
  readonly iap: boolean;
19
+ readonly bannerAds?: boolean;
18
20
  readonly rewardedAds: boolean;
19
21
  readonly interstitialAds: boolean;
20
22
  };
@@ -32,9 +32,11 @@ export function assertProductionTargetReadiness(input) {
32
32
  const requiresWebMonetizationAuthority = (targetPolicy?.runtime === 'web'
33
33
  || targetPolicy?.runtime === 'microsoft-store-pwa')
34
34
  && (targetPolicy.features.iap
35
+ || targetPolicy.features.bannerAds === true
35
36
  || targetPolicy.features.rewardedAds
36
37
  || targetPolicy.features.interstitialAds
37
38
  || targetPolicy.monetization.iap
39
+ || targetPolicy.monetization.bannerAds === true
38
40
  || targetPolicy.monetization.rewardedAds
39
41
  || targetPolicy.monetization.interstitialAds);
40
42
  const requiresMonetizationAuthority = requiresVerse8RewardAuthority
@@ -90,12 +92,14 @@ function disableMonetization(policy) {
90
92
  features: {
91
93
  ...policy.features,
92
94
  iap: false,
95
+ bannerAds: false,
93
96
  rewardedAds: false,
94
97
  interstitialAds: false,
95
98
  },
96
99
  monetization: {
97
100
  ...policy.monetization,
98
101
  iap: false,
102
+ bannerAds: false,
99
103
  rewardedAds: false,
100
104
  interstitialAds: false,
101
105
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/cli",
3
- "version": "0.23.0",
3
+ "version": "0.24.1",
4
4
  "description": "Gunshi CLI for mpgd-kit starter generation and target workflow orchestration.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -52,19 +52,19 @@
52
52
  "@types/node": "^24.0.0",
53
53
  "ttsc": "0.18.4",
54
54
  "typescript": "7.0.2",
55
- "@mpgd/adapter-ait": "0.9.0",
56
- "@mpgd/adapter-browser": "0.7.0",
57
- "@mpgd/adapter-capacitor": "0.4.6",
58
- "@mpgd/adapter-devvit": "0.9.0",
59
- "@mpgd/adapter-verse8": "0.3.0",
60
- "@mpgd/analytics": "0.3.9",
61
- "@mpgd/bridge": "0.8.0",
62
- "@mpgd/catalog": "0.6.0",
63
- "@mpgd/i18n": "0.5.5",
64
- "@mpgd/game-services": "0.12.0",
65
- "@mpgd/platform": "0.9.0",
55
+ "@mpgd/adapter-browser": "0.7.1",
56
+ "@mpgd/adapter-devvit": "0.9.2",
57
+ "@mpgd/adapter-verse8": "0.3.1",
58
+ "@mpgd/adapter-capacitor": "0.4.7",
59
+ "@mpgd/adapter-ait": "0.10.0",
60
+ "@mpgd/analytics": "0.3.10",
61
+ "@mpgd/catalog": "0.7.0",
62
+ "@mpgd/bridge": "0.9.0",
63
+ "@mpgd/game-services": "0.12.1",
66
64
  "@mpgd/phaser-assets": "0.4.1",
67
- "@mpgd/target-config": "0.12.0"
65
+ "@mpgd/target-config": "0.13.0",
66
+ "@mpgd/platform": "0.10.0",
67
+ "@mpgd/i18n": "0.5.6"
68
68
  },
69
69
  "main": "./dist/index.js",
70
70
  "types": "./dist/index.d.ts",
@@ -312,18 +312,21 @@ Apps in Toss navigation chrome is target-owned. Configure the `ait` target's
312
312
  `navigationBar` in `mpgd.targets.json`; `mpgd target build ait` validates the
313
313
  supported appearance options and forwards them to `apps-in-toss.config.ts` at
314
314
  build time. The Phaser starter uses a transparent dark navigation bar without
315
- back or home chrome so game content can continue underneath it. Keep
315
+ back, home, title, or app-icon chrome so game content can continue underneath it. Keep
316
316
  the game's own safe-area padding clear of Toss controls.
317
317
 
318
- Before the first SDK 3 release, allow both of these exact origins on every API
318
+ During the SDK 3 origin transition, allow all four exact origins on every API
319
319
  called by the mini-app:
320
320
 
321
321
  - `https://__GAME_NAME__.web.tossmini.com`
322
322
  - `https://__GAME_NAME__.private-web.tossmini.com`
323
+ - `https://__GAME_NAME__.apps.tossmini.com`
324
+ - `https://__GAME_NAME__.private-apps.tossmini.com`
323
325
 
324
- The first is production and the second is console QR testing. Apps in Toss does
325
- not allow an app that has released an SDK 3 bundle to roll back to SDK 2, so run
326
- the QR test and verify both CORS origins before publishing.
326
+ The `web` pair is the legacy production/QR origin and the `apps` pair is the
327
+ replacement production/QR origin for uploads after the transition. Apps in Toss
328
+ does not allow an app that has released an SDK 3 bundle to roll back to SDK 2,
329
+ so run the QR test and verify all applicable CORS origins before publishing.
327
330
 
328
331
  The starter also installs `@apps-in-toss/web-framework` and awaits
329
332
  `install()` from `@ait-co/polyfill` only when `__APP_TARGET__` is `ait`. In the
@@ -15,12 +15,12 @@
15
15
  "fix": "ttsc fix"
16
16
  },
17
17
  "dependencies": {
18
- "@apps-in-toss/web-framework": "3.0.2",
18
+ "@apps-in-toss/web-framework": "3.1.1",
19
19
  "@mpgd/adapter-ait": "__MPGD_DEPENDENCY_VERSION_ADAPTER_AIT__"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@ait-co/devtools": "^0.1.140",
23
- "@apps-in-toss/cli": "3.0.2",
23
+ "@apps-in-toss/cli": "3.1.1",
24
24
  "@ttsc/unplugin": "0.18.4",
25
25
  "@types/node": "^24.0.0",
26
26
  "ttsc": "0.18.4",
@@ -1,12 +1,13 @@
1
1
  import './styles.css';
2
2
 
3
+ import type { AitAdPlacementType } from '@mpgd/adapter-ait/ad-config';
3
4
  import { installAitHostBridge, type InstallAitHostBridgeOptions } from '@mpgd/adapter-ait/host';
4
5
  import { mountAitGameBundle } from '@mpgd/adapter-ait/wrapper';
5
6
 
6
7
  declare const __MPGD_AIT_APP_NAME__: string;
7
8
  declare const __MPGD_AIT_AD_GROUP_IDS__: Readonly<Record<string, string>>;
8
9
  declare const __MPGD_AIT_AD_PLACEMENT_TYPES__: Readonly<
9
- Record<string, 'rewarded' | 'interstitial'>
10
+ Record<string, AitAdPlacementType>
10
11
  >;
11
12
 
12
13
  installAitHostBridge({
@@ -1,6 +1,9 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
 
3
- import { extractAitAdBridgeConfig } from '@mpgd/adapter-ait/ad-config';
3
+ import {
4
+ extractAitAdBridgeConfig,
5
+ type AitAdBridgeConfig,
6
+ } from '@mpgd/adapter-ait/ad-config';
4
7
  import ttsc from '@ttsc/unplugin/vite';
5
8
  import { defineConfig } from 'vite';
6
9
 
@@ -40,10 +43,7 @@ export default defineConfig(({ command, isPreview }) => {
40
43
  };
41
44
  });
42
45
 
43
- function readAitAdConfig(path: string | undefined): {
44
- readonly adGroupIds: Readonly<Record<string, string>>;
45
- readonly adPlacementTypes: Readonly<Record<string, 'rewarded' | 'interstitial'>>;
46
- } {
46
+ function readAitAdConfig(path: string | undefined): AitAdBridgeConfig {
47
47
  if (path === undefined || path.trim().length === 0) {
48
48
  return { adGroupIds: {}, adPlacementTypes: {} };
49
49
  }
@@ -19,17 +19,17 @@
19
19
  "fix": "ttsc fix"
20
20
  },
21
21
  "dependencies": {
22
- "@devvit/web": "0.13.8",
22
+ "@devvit/web": "0.14.1",
23
23
  "@mpgd/adapter-devvit": "__MPGD_DEPENDENCY_VERSION_ADAPTER_DEVVIT__",
24
24
  "@mpgd/bridge": "__MPGD_DEPENDENCY_VERSION_BRIDGE__"
25
25
  },
26
26
  "devDependencies": {
27
- "@devvit/start": "0.13.8",
27
+ "@devvit/start": "0.14.1",
28
28
  "@ttsc/unplugin": "0.18.4",
29
29
  "@types/node": "^24.0.0",
30
- "devvit": "0.13.8",
30
+ "devvit": "0.14.1",
31
31
  "ttsc": "0.18.4",
32
32
  "typescript": "7.0.2",
33
- "vite": "8.1.3"
33
+ "vite": "7.3.6"
34
34
  }
35
35
  }
@@ -2,7 +2,7 @@ import { resolve } from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
 
4
4
  import { devvit } from '@devvit/start/vite';
5
- import { defineConfig } from 'vite';
5
+ import { defineConfig, type PluginOption } from 'vite';
6
6
 
7
7
  import { createGameViteSharedConfig } from '../../vite.shared';
8
8
 
@@ -10,7 +10,7 @@ const wrapperRoot = fileURLToPath(new URL('.', import.meta.url));
10
10
  const gameRoot = resolve(wrapperRoot, '../..');
11
11
 
12
12
  export default defineConfig(({ mode }) => {
13
- const shared = createGameViteSharedConfig({
13
+ const shared = createGameViteSharedConfig<PluginOption>({
14
14
  appTarget: 'reddit',
15
15
  configTarget: 'reddit',
16
16
  gameRoot,
@@ -55,6 +55,7 @@
55
55
  "navigationBar": {
56
56
  "withBackButton": false,
57
57
  "withHomeButton": false,
58
+ "withTitle": false,
58
59
  "transparentBackground": true,
59
60
  "theme": "dark"
60
61
  },
@@ -54,8 +54,8 @@
54
54
  "fix": "ttsc fix"
55
55
  },
56
56
  "dependencies": {
57
- "@ait-co/polyfill": "^0.1.17",
58
- "@apps-in-toss/web-framework": "3.0.2",
57
+ "@ait-co/polyfill": "^0.1.19",
58
+ "@apps-in-toss/web-framework": "3.1.1",
59
59
  "@mpgd/adapter-ait": "__MPGD_DEPENDENCY_VERSION_ADAPTER_AIT__",
60
60
  "@mpgd/adapter-browser": "__MPGD_DEPENDENCY_VERSION_ADAPTER_BROWSER__",
61
61
  "@mpgd/adapter-capacitor": "__MPGD_DEPENDENCY_VERSION_ADAPTER_CAPACITOR__",
@@ -72,7 +72,7 @@
72
72
  "phaser": "4.2.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@ait-co/console-cli": "^0.1.45",
75
+ "@ait-co/console-cli": "^0.1.49",
76
76
  "@cloudflare/workers-types": "^5.20260707.1",
77
77
  "@mpgd/cli": "__MPGD_DEPENDENCY_VERSION_CLI__",
78
78
  "@ttsc/unplugin": "0.18.4",
@@ -10,6 +10,8 @@ allowBuilds:
10
10
  protobufjs: true
11
11
  sharp: true
12
12
  workerd: true
13
+ overrides:
14
+ '@xmldom/xmldom': '0.9.12'
13
15
  peerDependencyRules:
14
16
  allowedVersions:
15
- '@ait-co/devtools>@apps-in-toss/web-framework': '3.0.2'
17
+ '@ait-co/devtools>@apps-in-toss/web-framework': '3.1.1'
@@ -8,6 +8,7 @@ import {
8
8
  getTargetConfig,
9
9
  targetConfigKeyForPlatform,
10
10
  withTargetAvailability,
11
+ type AdPlacementType,
11
12
  type TargetConfigMatrix,
12
13
  type TargetConfiguredGateway,
13
14
  } from '@mpgd/target-config';
@@ -23,7 +24,7 @@ const targetAdPlacements = adPlacements.placements.map((placement) => ({
23
24
  id: placement.id,
24
25
  type: placement.type,
25
26
  }));
26
- const adPlacementTypes = new Map<string, 'rewarded' | 'interstitial'>(
27
+ const adPlacementTypes = new Map<string, AdPlacementType>(
27
28
  targetAdPlacements.map((placement) => [placement.id, placement.type]),
28
29
  );
29
30
 
@@ -78,6 +78,7 @@ function assertTargetConfig(input: unknown, label: string): asserts input is Tar
78
78
  ['iap', 'rewardedAds', 'interstitialAds', 'leaderboard', 'localization'],
79
79
  `${label}.features`,
80
80
  );
81
+ assertOptionalBoolean(input.features.bannerAds, `${label}.features.bannerAds`);
81
82
 
82
83
  assertRecord(input.capabilities, `${label}.capabilities`);
83
84
  assertOneOf(input.capabilities.storage, storageSupportValues, `${label}.capabilities.storage`);
@@ -92,6 +93,7 @@ function assertTargetConfig(input: unknown, label: string): asserts input is Tar
92
93
  ['iap', 'rewardedAds', 'interstitialAds'],
93
94
  `${label}.monetization`,
94
95
  );
96
+ assertOptionalBoolean(input.monetization.bannerAds, `${label}.monetization.bannerAds`);
95
97
 
96
98
  assertRecord(input.leaderboard, `${label}.leaderboard`);
97
99
  assertBoolean(input.leaderboard.native, `${label}.leaderboard.native`);
@@ -145,6 +147,12 @@ function assertBoolean(input: unknown, label: string): asserts input is boolean
145
147
  }
146
148
  }
147
149
 
150
+ function assertOptionalBoolean(input: unknown, label: string): void {
151
+ if (input !== undefined) {
152
+ assertBoolean(input, label);
153
+ }
154
+ }
155
+
148
156
  function assertNonEmptyString(input: unknown, label: string): asserts input is string {
149
157
  if (typeof input !== 'string' || input.trim().length === 0) {
150
158
  throw new Error(`${label} must be a non-empty string.`);
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
2
2
  import { resolve } from 'node:path';
3
3
 
4
4
  import ttsc from '@ttsc/unplugin/vite';
5
- import type { PluginOption, UserConfig } from 'vite';
5
+ import type { PluginOption } from 'vite';
6
6
 
7
7
  import {
8
8
  assertRuntimeTargetConfigMatrix,
@@ -29,9 +29,19 @@ export interface CreateGameViteSharedConfigInput {
29
29
  readonly adPlacementsFile?: string;
30
30
  }
31
31
 
32
- export function createGameViteSharedConfig(
32
+ /** Vite-major-neutral subset shared by every generated target wrapper. */
33
+ export interface GameViteSharedConfig<SharedPluginOption> {
34
+ readonly base: string;
35
+ readonly plugins: SharedPluginOption[];
36
+ readonly resolve: {
37
+ readonly alias: Record<string, string>;
38
+ };
39
+ readonly define: Record<string, string>;
40
+ }
41
+
42
+ export function createGameViteSharedConfig<SharedPluginOption = PluginOption>(
33
43
  input: CreateGameViteSharedConfigInput,
34
- ): UserConfig {
44
+ ): GameViteSharedConfig<SharedPluginOption> {
35
45
  const isProduction = input.mode === 'production';
36
46
  const appTarget = input.appTarget ?? process.env.APP_TARGET ?? 'browser';
37
47
  const configTarget = input.configTarget ?? process.env.MPGD_CONFIG_TARGET ?? '';
@@ -56,7 +66,7 @@ export function createGameViteSharedConfig(
56
66
  ttsc({
57
67
  project: input.project,
58
68
  plugins: false,
59
- }) as unknown as PluginOption,
69
+ }) as unknown as SharedPluginOption,
60
70
  ],
61
71
  resolve: {
62
72
  alias: {