@mpgd/cli 0.35.0 → 0.36.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.
- package/dist/android-bundle-signer.d.ts +2 -0
- package/dist/android-bundle-signer.js +38 -0
- package/dist/android-signing-session.d.ts +22 -0
- package/dist/android-signing-session.js +198 -0
- package/dist/artifact-inspection-environment.d.ts +2 -0
- package/dist/artifact-inspection-environment.js +31 -0
- package/dist/asc-pin.json +26 -0
- package/dist/capacitor-shell-starter.d.ts +22 -0
- package/dist/capacitor-shell-starter.js +130 -7
- package/dist/deploy-planning.d.ts +64 -0
- package/dist/deploy-planning.js +471 -0
- package/dist/deploy-process.d.ts +28 -0
- package/dist/deploy-process.js +197 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +409 -10
- package/dist/ios-ipa-inspection.js +151 -0
- package/dist/ios-keychain-import.swift +92 -0
- package/dist/ios-plist.d.ts +2 -0
- package/dist/ios-plist.js +75 -0
- package/dist/ios-signing-profile.d.ts +12 -0
- package/dist/ios-signing-profile.js +60 -0
- package/dist/ios-signing-session.d.ts +22 -0
- package/dist/ios-signing-session.js +256 -0
- package/dist/kit-upgrade-target-readiness.d.ts +8 -0
- package/dist/kit-upgrade-target-readiness.js +119 -0
- package/dist/kit-upgrade.d.ts +2 -0
- package/dist/kit-upgrade.js +3 -0
- package/dist/native-build-info.json +5 -0
- package/dist/native-build-target.js +12121 -0
- package/dist/native-deploy-run.d.ts +35 -0
- package/dist/native-deploy-run.js +462 -0
- package/dist/native-deploy-submission.d.ts +40 -0
- package/dist/native-deploy-submission.js +244 -0
- package/dist/native-deploy-workflow.d.ts +11 -0
- package/dist/native-deploy-workflow.js +328 -0
- package/dist/play-internal-submission.d.ts +32 -0
- package/dist/play-internal-submission.js +247 -0
- package/dist/play-publisher-port.d.ts +30 -0
- package/dist/play-publisher-port.js +1 -0
- package/dist/play-sdk-adapter.js +78 -0
- package/dist/release-state.d.ts +140 -0
- package/dist/release-state.js +1046 -0
- package/dist/release-workspace.d.ts +61 -0
- package/dist/release-workspace.js +504 -0
- package/dist/testflight-submission.d.ts +49 -0
- package/dist/testflight-submission.js +462 -0
- package/package.json +18 -13
- package/templates/phaser-game/README.md +30 -8
- package/templates/phaser-game/apps/target-devvit/README.md +12 -0
- package/templates/phaser-game/apps/target-devvit/src/server/bridge.ts +513 -0
- package/templates/phaser-game/apps/target-devvit/src/server/index.ts +8 -291
- package/templates/phaser-game/src/main.ts +34 -33
- package/templates/phaser-game/vite.shared.ts +5 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface KitUpgradeTargetAdvisory {
|
|
2
|
+
readonly target: string;
|
|
3
|
+
readonly kind: 'missing-product-id' | 'missing-placement-id' | 'not-assessed';
|
|
4
|
+
readonly logicalId?: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
/** Read-only hints, not a substitute for target validation after an upgrade. */
|
|
8
|
+
export declare function inspectKitUpgradeTargetReadiness(gameRoot: string, targetsFile: string): readonly KitUpgradeTargetAdvisory[];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { assertAdPlacements, assertProductCatalog } from '@mpgd/catalog';
|
|
5
|
+
import { assertTargetConfigMatrix, createEffectiveTargetConfig } from '@mpgd/target-config';
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
/** Read-only hints, not a substitute for target validation after an upgrade. */
|
|
8
|
+
export function inspectKitUpgradeTargetReadiness(gameRoot, targetsFile) {
|
|
9
|
+
if (!existsSync(targetsFile)) {
|
|
10
|
+
return [notAssessed('*', 'No game-owned targets file is available.')];
|
|
11
|
+
}
|
|
12
|
+
if (process.env.MPGD_PRODUCT_CATALOG_FILE?.trim()
|
|
13
|
+
|| process.env.MPGD_AD_PLACEMENTS_FILE?.trim()) {
|
|
14
|
+
const message = 'Custom catalog or placement paths are not inspected; '
|
|
15
|
+
+ 'validate targets after upgrading.';
|
|
16
|
+
return [notAssessed('*', message)];
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const configured = asRecord(readGameOwnedJsonFile(gameRoot, targetsFile), 'targets file');
|
|
20
|
+
const targets = asRecord(configured.targets, 'targets');
|
|
21
|
+
const baseFile = require.resolve('@mpgd/target-config/targets.json');
|
|
22
|
+
const base = assertTargetConfigMatrix(JSON.parse(readFileSync(baseFile, 'utf8')));
|
|
23
|
+
const catalogFile = path.join(gameRoot, 'mpgd.catalog.json');
|
|
24
|
+
const placementsFile = path.join(gameRoot, 'mpgd.ad-placements.json');
|
|
25
|
+
if (existsSync(catalogFile) !== existsSync(placementsFile)) {
|
|
26
|
+
return [notAssessed('*', 'Default mpgd.catalog.json and mpgd.ad-placements.json must be present together; '
|
|
27
|
+
+ 'custom paths are not assessed.')];
|
|
28
|
+
}
|
|
29
|
+
const catalog = existsSync(catalogFile)
|
|
30
|
+
? assertProductCatalog(readGameOwnedJsonFile(gameRoot, catalogFile))
|
|
31
|
+
: assertProductCatalog({ version: 'none', products: [] });
|
|
32
|
+
const placements = existsSync(placementsFile)
|
|
33
|
+
? assertAdPlacements(readGameOwnedJsonFile(gameRoot, placementsFile))
|
|
34
|
+
: assertAdPlacements({ version: 'none', placements: [] });
|
|
35
|
+
const advisories = [];
|
|
36
|
+
for (const target of Object.keys(targets).sort()) {
|
|
37
|
+
const policy = base.targets[target];
|
|
38
|
+
if (policy === undefined) {
|
|
39
|
+
const message = 'No built-in runtime policy is available; '
|
|
40
|
+
+ 'validate this custom target after upgrading.';
|
|
41
|
+
advisories.push(notAssessed(target, message));
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const platform = asRecord(targets[target], `target ${target}`);
|
|
46
|
+
const effective = createEffectiveTargetConfig({
|
|
47
|
+
target,
|
|
48
|
+
targetConfigVersion: base.version,
|
|
49
|
+
config: policy,
|
|
50
|
+
catalog,
|
|
51
|
+
adPlacements: placements,
|
|
52
|
+
platformTarget: {
|
|
53
|
+
kind: String(platform.kind ?? ''),
|
|
54
|
+
adapter: String(platform.adapter ?? ''),
|
|
55
|
+
...(platform.authoritativeGameServices === false
|
|
56
|
+
? { authoritativeGameServices: false }
|
|
57
|
+
: {}),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
// Devvit validates product SKUs against its wrapper contract, not catalog platform IDs.
|
|
61
|
+
if (effective.runtime !== 'devvit-web') {
|
|
62
|
+
for (const product of effective.monetization.products) {
|
|
63
|
+
if (product.reason === 'missing-platform-id') {
|
|
64
|
+
advisories.push({
|
|
65
|
+
target,
|
|
66
|
+
kind: 'missing-product-id',
|
|
67
|
+
logicalId: product.id,
|
|
68
|
+
message: `Product ${product.id} needs platformProductIds.${target}.`,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (const placement of effective.ads.placements) {
|
|
74
|
+
if (placement.reason === 'missing-platform-id') {
|
|
75
|
+
advisories.push({
|
|
76
|
+
target,
|
|
77
|
+
kind: 'missing-placement-id',
|
|
78
|
+
logicalId: placement.id,
|
|
79
|
+
message: `Ad placement ${placement.id} needs platformPlacementIds.${target}.`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
advisories.push(notAssessed(target, `Could not inspect target: ${formatError(error)}`));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return advisories;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
return [notAssessed('*', `Target readiness could not be assessed: ${formatError(error)}`)];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function readGameOwnedJsonFile(gameRoot, file) {
|
|
95
|
+
if (!existsSync(file)) {
|
|
96
|
+
throw new Error(`Missing game-owned ${path.basename(file)}.`);
|
|
97
|
+
}
|
|
98
|
+
if (lstatSync(file).isSymbolicLink() || !inside(gameRoot, realpathSync(file))) {
|
|
99
|
+
throw new Error(`Refusing to inspect a linked or external ${path.basename(file)}.`);
|
|
100
|
+
}
|
|
101
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
102
|
+
}
|
|
103
|
+
function asRecord(value, label) {
|
|
104
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
105
|
+
throw new Error(`${label} must be a JSON object`);
|
|
106
|
+
}
|
|
107
|
+
return value;
|
|
108
|
+
}
|
|
109
|
+
function inside(root, candidate) {
|
|
110
|
+
const relative = path.relative(root, candidate);
|
|
111
|
+
return relative === '' || (relative !== '..' && !relative.startsWith(`..${path.sep}`)
|
|
112
|
+
&& !path.isAbsolute(relative));
|
|
113
|
+
}
|
|
114
|
+
function notAssessed(target, message) {
|
|
115
|
+
return { target, kind: 'not-assessed', message };
|
|
116
|
+
}
|
|
117
|
+
function formatError(error) {
|
|
118
|
+
return error instanceof Error ? error.message : String(error);
|
|
119
|
+
}
|
package/dist/kit-upgrade.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type KitUpgradeTargetAdvisory } from './kit-upgrade-target-readiness.js';
|
|
1
2
|
declare const dependencySections: readonly ['dependencies', 'devDependencies', 'optionalDependencies'];
|
|
2
3
|
type DependencySection = (typeof dependencySections)[number];
|
|
3
4
|
export interface PublishedKitPackage {
|
|
@@ -19,6 +20,7 @@ export interface KitUpgradePlan {
|
|
|
19
20
|
readonly updates: readonly KitUpgradeUpdate[];
|
|
20
21
|
readonly blockers: readonly string[];
|
|
21
22
|
readonly notes: readonly string[];
|
|
23
|
+
readonly targetAdvisories: readonly KitUpgradeTargetAdvisory[];
|
|
22
24
|
readonly manifestDigests: Readonly<Record<string, string>>;
|
|
23
25
|
readonly targetConfigDigest: {
|
|
24
26
|
readonly file: string;
|
package/dist/kit-upgrade.js
CHANGED
|
@@ -4,6 +4,7 @@ import { existsSync, lstatSync, readFileSync, realpathSync, writeFileSync } from
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import { compare, intersects, minVersion, satisfies, valid, validRange } from 'semver';
|
|
7
|
+
import { inspectKitUpgradeTargetReadiness, } from './kit-upgrade-target-readiness.js';
|
|
7
8
|
const execFile = promisify(execFileCallback);
|
|
8
9
|
const dependencySections = ['dependencies', 'devDependencies', 'optionalDependencies'];
|
|
9
10
|
export async function planKitUpgrade(gameDirectory, lookup = lookupPublishedKitPackage, targetsFileName) {
|
|
@@ -18,6 +19,7 @@ export async function planKitUpgrade(gameDirectory, lookup = lookupPublishedKitP
|
|
|
18
19
|
const notes = [];
|
|
19
20
|
const blockers = [];
|
|
20
21
|
const { manifests, targetConfigDigest } = discoverGameManifests(gameRoot, notes, blockers, targetsFileName);
|
|
22
|
+
const targetAdvisories = inspectKitUpgradeTargetReadiness(gameRoot, targetConfigDigest.file);
|
|
21
23
|
const manifestDigests = {};
|
|
22
24
|
const requested = new Set();
|
|
23
25
|
const parsedManifests = new Map();
|
|
@@ -124,6 +126,7 @@ export async function planKitUpgrade(gameDirectory, lookup = lookupPublishedKitP
|
|
|
124
126
|
updates,
|
|
125
127
|
blockers,
|
|
126
128
|
notes: [...new Set(notes)],
|
|
129
|
+
targetAdvisories,
|
|
127
130
|
manifestDigests,
|
|
128
131
|
targetConfigDigest,
|
|
129
132
|
lockfileDigests,
|