@mpgd/cli 0.33.2 → 0.34.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 +40 -0
- package/dist/capacitor-shell-starter.js +2130 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -5
- package/dist/native-shell-identity.d.ts +19 -0
- package/dist/native-shell-identity.js +490 -0
- package/dist/production-target-readiness.d.ts +1 -0
- package/dist/production-target-readiness.js +1 -1
- package/package.json +14 -13
- package/templates/phaser-game/package.json +1 -0
- package/templates/phaser-game/src/styles.css +6 -4
- package/templates/phaser-game/vite.runtime-target-config.ts +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { renderGameAcceptanceMarkdown, resolveGameAcceptanceReleaseManifestFile, runGameAcceptance, defaultGameAcceptanceCommandTimeoutMs, maximumGameplayE2EReportBytes, type GameAcceptanceCommandResult, type GameAcceptanceCommandRunner, type GameAcceptanceReport, type GameAcceptanceStatus, type GameAcceptanceStep, type GameAcceptanceStepResult, type GameAcceptanceStepStatus, type RunGameAcceptanceInput, type RunGameAcceptanceResult, } from './game-acceptance.js';
|
|
2
|
+
export { applyCapacitorShellStarter, materializeCapacitorShellStarter, planCapacitorShellStarter, type CapacitorShellCommandRunner, type CapacitorShellStarterInput, type CapacitorShellStarterPlan, } from './capacitor-shell-starter.js';
|
|
2
3
|
export { createBrowserGameplayE2EDriver, type BrowserGameplayE2EInspectInput, type BrowserGameplayE2EPage, type BrowserGameplayE2EScreenshotOptions, type BrowserGameplayE2EViewport, type CreateBrowserGameplayE2EDriverInput, } from './browser-gameplay-e2e.js';
|
|
3
4
|
export { collectGameplayE2EPathEvidence, defaultGameplayE2EReportFile, maximumGameplayE2EStates, parseGameplayE2EPlan, readGameplayE2EPlan, renderGameplayE2EMarkdown, resolveGameplayE2EReportFile, runGameplayE2E, type GameplayE2EAction, type GameplayE2EActionResult, type GameplayE2EDriver, type GameplayE2EHashLimits, type GameplayE2EInputAction, type GameplayE2EObservation, type GameplayE2EPauseResumeAction, type GameplayE2EPathEvidence, type GameplayE2EPlan, type GameplayE2EReport, type GameplayE2EResultStatus, type GameplayE2EState, type GameplayE2EStateResult, type GameplayE2EStatus, type RunGameplayE2EInput, type RunGameplayE2EResult, } from './gameplay-e2e.js';
|
|
4
5
|
export { cloudflarePagesDeploymentProfiles, hostedPwaDeploymentHosts, isSupportedHostedPwaProfile, verifyHostedPwaDeployment, type CloudflarePagesDeploymentProfile, type HostedPwaDeploymentHost, type HostedPwaDeploymentVerification, type VerifyHostedPwaDeploymentInput, } from './hosted-pwa-deployment.js';
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import resources from '@gunshi/resources';
|
|
|
8
8
|
import { cli } from 'gunshi';
|
|
9
9
|
import { buildAssetPacks } from './asset-pack-build.js';
|
|
10
10
|
import { verifyAssetPackDelivery } from './asset-pack-verify.js';
|
|
11
|
+
import { materializeCapacitorShellStarter, planCapacitorShellStarter, } from './capacitor-shell-starter.js';
|
|
11
12
|
import { normalizeConfiguredBuildTargets, normalizeBuildTarget as normalizeConfiguredTargetName, supportedBuildTargets, } from './build-targets.js';
|
|
12
13
|
import { escapeMarkdownInline as escapeEvidenceMarkdownInline, writeEvidenceReportFiles, } from './evidence-io.js';
|
|
13
14
|
import { defaultGameAcceptanceCommandTimeoutMs, resolveGameAcceptanceReleaseManifestFile, runGameAcceptance, } from './game-acceptance.js';
|
|
@@ -20,6 +21,7 @@ import { runMicrosoftStoreSubmissionPreflight } from './microsoft-store-submissi
|
|
|
20
21
|
import { defaultOfflinePlaytestArtifactDir, defaultOfflinePlaytestMaximumBytes, defaultOfflinePlaytestOutputDir, runOfflinePlaytestPackaging, } from './offline-playtest.js';
|
|
21
22
|
import { targetConfigExtensionsFileEnv } from './target-config-env.js';
|
|
22
23
|
export { renderGameAcceptanceMarkdown, resolveGameAcceptanceReleaseManifestFile, runGameAcceptance, defaultGameAcceptanceCommandTimeoutMs, maximumGameplayE2EReportBytes, } from './game-acceptance.js';
|
|
24
|
+
export { applyCapacitorShellStarter, materializeCapacitorShellStarter, planCapacitorShellStarter, } from './capacitor-shell-starter.js';
|
|
23
25
|
export { createBrowserGameplayE2EDriver, } from './browser-gameplay-e2e.js';
|
|
24
26
|
export { collectGameplayE2EPathEvidence, defaultGameplayE2EReportFile, maximumGameplayE2EStates, parseGameplayE2EPlan, readGameplayE2EPlan, renderGameplayE2EMarkdown, resolveGameplayE2EReportFile, runGameplayE2E, } from './gameplay-e2e.js';
|
|
25
27
|
export { cloudflarePagesDeploymentProfiles, hostedPwaDeploymentHosts, isSupportedHostedPwaProfile, verifyHostedPwaDeployment, } from './hosted-pwa-deployment.js';
|
|
@@ -1117,8 +1119,8 @@ const targetCommand = defineI18n({
|
|
|
1117
1119
|
ko: '충돌 파일을 덮어쓰지 않고 기존 게임에 선택적 타깃 워크플로를 초기화합니다.',
|
|
1118
1120
|
}, {
|
|
1119
1121
|
target: {
|
|
1120
|
-
en: 'Target to initialize
|
|
1121
|
-
ko: '초기화할
|
|
1122
|
+
en: 'Target to initialize: microsoft-store or capacitor.',
|
|
1123
|
+
ko: '초기화할 타깃: microsoft-store 또는 capacitor.',
|
|
1122
1124
|
},
|
|
1123
1125
|
game: {
|
|
1124
1126
|
en: 'Existing game root. Defaults to the current directory.',
|
|
@@ -1132,12 +1134,32 @@ const targetCommand = defineI18n({
|
|
|
1132
1134
|
en: 'Validate and print planned file changes without writing them.',
|
|
1133
1135
|
ko: '파일을 쓰지 않고 예정 변경을 검증하고 출력합니다.',
|
|
1134
1136
|
},
|
|
1137
|
+
'app-id': {
|
|
1138
|
+
en: 'Game-owned Android package ID and iOS bundle ID.',
|
|
1139
|
+
ko: '게임 소유 Android 패키지 ID 및 iOS 번들 ID.',
|
|
1140
|
+
},
|
|
1141
|
+
'display-name': {
|
|
1142
|
+
en: 'Native application display name.',
|
|
1143
|
+
ko: '네이티브 앱 표시 이름.',
|
|
1144
|
+
},
|
|
1145
|
+
'icon-source': {
|
|
1146
|
+
en: 'Game-owned native icon source file.',
|
|
1147
|
+
ko: '게임 소유 네이티브 아이콘 원본 파일.',
|
|
1148
|
+
},
|
|
1149
|
+
'backend-url': {
|
|
1150
|
+
en: 'Production HTTPS Game Services base URL.',
|
|
1151
|
+
ko: '프로덕션 HTTPS Game Services 기본 URL.',
|
|
1152
|
+
},
|
|
1153
|
+
providers: {
|
|
1154
|
+
en: 'Comma-separated requested provider IDs; this does not install SDKs.',
|
|
1155
|
+
ko: '쉼표로 구분한 요청 provider ID. SDK를 설치하지는 않습니다.',
|
|
1156
|
+
},
|
|
1135
1157
|
}),
|
|
1136
1158
|
args: {
|
|
1137
1159
|
target: {
|
|
1138
1160
|
type: 'positional',
|
|
1139
1161
|
required: true,
|
|
1140
|
-
description: 'Target to initialize
|
|
1162
|
+
description: 'Target to initialize: microsoft-store or capacitor.',
|
|
1141
1163
|
},
|
|
1142
1164
|
game: {
|
|
1143
1165
|
type: 'string',
|
|
@@ -1155,15 +1177,86 @@ const targetCommand = defineI18n({
|
|
|
1155
1177
|
required: false,
|
|
1156
1178
|
description: 'Validate and print planned file changes without writing them.',
|
|
1157
1179
|
},
|
|
1180
|
+
'app-id': {
|
|
1181
|
+
type: 'string',
|
|
1182
|
+
required: false,
|
|
1183
|
+
description: 'Game-owned Android package ID and iOS bundle ID.',
|
|
1184
|
+
},
|
|
1185
|
+
'display-name': {
|
|
1186
|
+
type: 'string',
|
|
1187
|
+
required: false,
|
|
1188
|
+
description: 'Native application display name.',
|
|
1189
|
+
},
|
|
1190
|
+
'icon-source': {
|
|
1191
|
+
type: 'string',
|
|
1192
|
+
required: false,
|
|
1193
|
+
description: 'Game-owned native icon source file.',
|
|
1194
|
+
},
|
|
1195
|
+
'backend-url': {
|
|
1196
|
+
type: 'string',
|
|
1197
|
+
required: false,
|
|
1198
|
+
description: 'Production HTTPS Game Services base URL.',
|
|
1199
|
+
},
|
|
1200
|
+
providers: {
|
|
1201
|
+
type: 'string',
|
|
1202
|
+
required: false,
|
|
1203
|
+
description: 'Comma-separated requested provider IDs; this does not install SDKs.',
|
|
1204
|
+
},
|
|
1158
1205
|
},
|
|
1159
1206
|
run: (ctx) => {
|
|
1160
1207
|
const positionals = readLocalPositionals(ctx.positionals, ['target', 'init']);
|
|
1161
1208
|
const requestedTarget = readRequiredPositional(positionals, 0, 'target');
|
|
1209
|
+
const gameRoot = path.resolve(readOptionalString(ctx.values.game) ?? '.');
|
|
1210
|
+
const dryRun = ctx.values['dry-run'] === true;
|
|
1211
|
+
if (requestedTarget === 'capacitor') {
|
|
1212
|
+
if (ctx.values['kit-path'] !== undefined) {
|
|
1213
|
+
throw new Error('--kit-path is not used by the game-owned Capacitor initializer.');
|
|
1214
|
+
}
|
|
1215
|
+
const appId = readOptionalString(ctx.values['app-id']);
|
|
1216
|
+
const displayName = readOptionalString(ctx.values['display-name']);
|
|
1217
|
+
if (appId === undefined || displayName === undefined) {
|
|
1218
|
+
throw new Error('Capacitor initialization requires --app-id and --display-name.');
|
|
1219
|
+
}
|
|
1220
|
+
const iconSource = readOptionalString(ctx.values['icon-source']);
|
|
1221
|
+
const backendUrl = readOptionalString(ctx.values['backend-url']);
|
|
1222
|
+
const selectedProviders = readOptionalString(ctx.values.providers);
|
|
1223
|
+
const plan = planCapacitorShellStarter({
|
|
1224
|
+
gameRoot,
|
|
1225
|
+
appId,
|
|
1226
|
+
displayName,
|
|
1227
|
+
...(iconSource === undefined ? {} : { iconSource }),
|
|
1228
|
+
...(backendUrl === undefined ? {} : { backendUrl }),
|
|
1229
|
+
...(selectedProviders === undefined ? {} : {
|
|
1230
|
+
providerIds: selectedProviders.split(',').map((id) => id.trim()),
|
|
1231
|
+
}),
|
|
1232
|
+
});
|
|
1233
|
+
if (!dryRun) {
|
|
1234
|
+
materializeCapacitorShellStarter(plan);
|
|
1235
|
+
}
|
|
1236
|
+
console.info(`${dryRun ? 'Would update' : 'Updated'} game-owned Capacitor shell: ${plan.changedFiles.length} file(s).`);
|
|
1237
|
+
for (const file of plan.changedFiles) {
|
|
1238
|
+
console.info(`- ${file}`);
|
|
1239
|
+
}
|
|
1240
|
+
for (const platform of plan.nativePlatformsToAdd) {
|
|
1241
|
+
console.info(`${dryRun ? 'Would add' : 'Added'} native platform: ${platform}`);
|
|
1242
|
+
}
|
|
1243
|
+
console.info('File count covers managed shell files only; pnpm may also update root or shell lockfiles.');
|
|
1244
|
+
if (!dryRun) {
|
|
1245
|
+
console.info('Production native builds still require release identity and signing checks.');
|
|
1246
|
+
}
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1162
1249
|
const target = normalizeConfiguredBuildTarget(requestedTarget);
|
|
1163
1250
|
if (target !== 'microsoft-store') {
|
|
1164
1251
|
throw new Error(`Target initialization is only available for microsoft-store; received: ${requestedTarget}`);
|
|
1165
1252
|
}
|
|
1166
|
-
const
|
|
1253
|
+
for (const option of [
|
|
1254
|
+
'app-id', 'display-name', 'icon-source', 'backend-url', 'providers',
|
|
1255
|
+
]) {
|
|
1256
|
+
if (ctx.values[option] !== undefined) {
|
|
1257
|
+
throw new Error(`--${option} is only available for capacitor initialization.`);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1167
1260
|
const configuredKitPath = readOptionalString(ctx.values['kit-path']);
|
|
1168
1261
|
const resolvedKitPath = configuredKitPath === undefined
|
|
1169
1262
|
? detectedKitRoot
|
|
@@ -1172,7 +1265,6 @@ const targetCommand = defineI18n({
|
|
|
1172
1265
|
const defaultKitPath = resolvedKitPath === undefined
|
|
1173
1266
|
? defaultMpgdKitPath
|
|
1174
1267
|
: toTemplatePath(path.relative(canonicalGameRoot, resolvedKitPath) || '.');
|
|
1175
|
-
const dryRun = ctx.values['dry-run'] === true;
|
|
1176
1268
|
const adapterDependencyVersion = resolveMicrosoftStoreAdapterDependencyVersion(requireMpgdDependencyVersion(resolveMpgdDependencyVersionReplacements({
|
|
1177
1269
|
workspace: false,
|
|
1178
1270
|
...(resolvedKitPath === undefined ? {} : { kitPath: resolvedKitPath }),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Inspect only the effective App target, not unrelated Xcode extensions. */
|
|
2
|
+
export declare function assertNativeShellIdentity(platform: 'android' | 'ios', source: string, expectedAppId: string): void;
|
|
3
|
+
export declare function assertAndroidSettingsAppProject(source: string): void;
|
|
4
|
+
export declare function assertAndroidSettingsNoAppRemap(source: string): void;
|
|
5
|
+
export declare function stripGradleComments(source: string): string;
|
|
6
|
+
export declare function hasGradleIdentityMutation(source: string): boolean;
|
|
7
|
+
export declare function hasGradleBracketIdentityWrite(source: string): boolean;
|
|
8
|
+
export declare function hasAndroidDisplayNameResourceOverride(source: string): boolean;
|
|
9
|
+
export declare function hasAndroidResourceSourceSetOverride(source: string): boolean;
|
|
10
|
+
export declare function hasAndroidManifestSourceSetOverride(source: string): boolean;
|
|
11
|
+
export declare function hasGradleTaskAction(source: string): boolean;
|
|
12
|
+
export declare function hasGradlePropertySetter(source: string): boolean;
|
|
13
|
+
export declare function countGradleIdentityWrites(source: string, key: string): number;
|
|
14
|
+
export declare function maskGradleStrings(clean: string): string;
|
|
15
|
+
export declare function readIosReleaseInfoPlist(source: string): string;
|
|
16
|
+
export declare function assertIosReleaseProductName(source: string): void;
|
|
17
|
+
export declare function assertIosReleaseInfoPlistExpansion(source: string): void;
|
|
18
|
+
export declare function assertIosReleasePackagingSettings(source: string): void;
|
|
19
|
+
export declare function readIosAppTargetId(source: string): string;
|