@leonxin/meetgames 0.1.17 → 0.1.19
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/README.md +5 -4
- package/dist/cache.d.ts +16 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +21 -0
- package/dist/cache.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +24 -26
- package/dist/cli.js.map +1 -1
- package/dist/config/meetSdkDefaultConfig.d.ts +7 -11
- package/dist/config/meetSdkDefaultConfig.d.ts.map +1 -1
- package/dist/config/meetSdkDefaultConfig.js +216 -53
- package/dist/config/meetSdkDefaultConfig.js.map +1 -1
- package/dist/config/meetSdkIosConfig.d.ts +4 -5
- package/dist/config/meetSdkIosConfig.d.ts.map +1 -1
- package/dist/config/meetSdkIosConfig.js +19 -19
- package/dist/config/meetSdkIosConfig.js.map +1 -1
- package/dist/contracts/types.d.ts +4 -0
- package/dist/contracts/types.d.ts.map +1 -1
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +3 -1
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/previewPatches.d.ts +2 -2
- package/dist/core/previewPatches.d.ts.map +1 -1
- package/dist/core/previewPatches.js +3 -3
- package/dist/core/previewPatches.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +1 -0
- package/dist/core/workspace.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/ios/integrate.d.ts.map +1 -1
- package/dist/ios/integrate.js +11 -9
- package/dist/ios/integrate.js.map +1 -1
- package/dist/mcp/service.d.ts +2 -0
- package/dist/mcp/service.d.ts.map +1 -1
- package/dist/mcp/service.js +8 -5
- package/dist/mcp/service.js.map +1 -1
- package/dist/ops/handlers.d.ts.map +1 -1
- package/dist/ops/handlers.js +4 -0
- package/dist/ops/handlers.js.map +1 -1
- package/dist/remote/sdkHomeDownload.d.ts +6 -5
- package/dist/remote/sdkHomeDownload.d.ts.map +1 -1
- package/dist/remote/sdkHomeDownload.js +73 -11
- package/dist/remote/sdkHomeDownload.js.map +1 -1
- package/docs/API.md +13 -13
- package/docs/CLI.md +28 -16
- package/docs/INTEGRATION.md +7 -6
- package/package.json +1 -1
- package/src/cache.ts +37 -0
- package/src/cli.ts +28 -27
- package/src/config/meetSdkDefaultConfig.ts +243 -59
- package/src/config/meetSdkIosConfig.ts +17 -21
- package/src/contracts/types.ts +4 -0
- package/src/core/doctor.ts +3 -1
- package/src/core/previewPatches.ts +3 -3
- package/src/core/workspace.ts +1 -0
- package/src/index.ts +5 -3
- package/src/ios/integrate.ts +12 -10
- package/src/mcp/service.ts +15 -5
- package/src/ops/handlers.ts +4 -0
- package/src/remote/sdkHomeDownload.ts +82 -15
- package/config/meetsdk-android.json +0 -171
- package/config/meetsdk-ios.json +0 -15
- package/tests/assemble.test.ts +0 -12
- package/tests/doctor.test.ts +0 -131
- package/tests/downloadGoogleServicesJson.test.ts +0 -47
- package/tests/fetch-remote.test.ts +0 -23
- package/tests/fetchConfigOverrides.test.ts +0 -28
- package/tests/fetchConfigWrite.test.ts +0 -54
- package/tests/fixtures-hosts.test.ts +0 -78
- package/tests/gradle.test.ts +0 -33
- package/tests/integration-json.test.ts +0 -29
- package/tests/ios.codeUtils.test.ts +0 -23
- package/tests/ios.sdkBundle.test.ts +0 -21
- package/tests/loadManifest.test.ts +0 -15
- package/tests/manifest-xml.test.ts +0 -30
- package/tests/mcp.e2e.ts +0 -214
- package/tests/mcp.service.test.ts +0 -53
- package/tests/meetSdkRemoteConfig.test.ts +0 -482
- package/tests/meetSdkRemoteGradle.test.ts +0 -414
- package/tests/pipeline.android.test.ts +0 -149
- package/tests/pipeline.integration-json.test.ts +0 -58
- package/tests/pipeline.ios.test.ts +0 -608
- package/tests/pipeline.preview.patch.test.ts +0 -85
- package/tests/platformSelection.test.ts +0 -77
- package/tests/sdkHomeDownload.test.ts +0 -224
- package/tests/sdkVersionConfig.test.ts +0 -131
- package/tests/topsdk.test.ts +0 -53
- package/tests/topsdkDownloadSdkConfig.test.ts +0 -81
- package/tests/topsdkFeatureModules.test.ts +0 -116
package/src/ios/integrate.ts
CHANGED
|
@@ -220,26 +220,27 @@ async function downloadIosFirebaseConfig(
|
|
|
220
220
|
pbx: PbxContext,
|
|
221
221
|
dryRun: boolean,
|
|
222
222
|
relTo: string
|
|
223
|
-
): Promise<{ remoteSources: Map<string, string>; warnings: string[]; errors: string[] }> {
|
|
223
|
+
): Promise<{ remoteSources: Map<string, string>; warnings: string[]; logs: string[]; errors: string[] }> {
|
|
224
224
|
const remoteSources = new Map<string, string>();
|
|
225
225
|
const warnings: string[] = [];
|
|
226
|
+
const logs: string[] = [];
|
|
226
227
|
const errors: string[] = [];
|
|
227
228
|
const firebase = remote?.sdkModules.analytics.firebase;
|
|
228
229
|
if (typeof firebase !== "object" || firebase === null) {
|
|
229
|
-
return { remoteSources, warnings, errors };
|
|
230
|
+
return { remoteSources, warnings, logs, errors };
|
|
230
231
|
}
|
|
231
232
|
|
|
232
233
|
const url = firebase.firebase_file_url?.trim();
|
|
233
234
|
if (!url) {
|
|
234
235
|
errors.push("iOS Firebase config requires sdkModules.analytics.firebase.firebaseUrl");
|
|
235
|
-
return { remoteSources, warnings, errors };
|
|
236
|
+
return { remoteSources, warnings, logs, errors };
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
remoteSources.set(`FirebaseManager:${IOS_FIREBASE_CONFIG_FILE}`, relTo);
|
|
239
240
|
|
|
240
241
|
if (dryRun) {
|
|
241
|
-
|
|
242
|
-
return { remoteSources, warnings, errors };
|
|
242
|
+
logs.push(`INFO: would download ${IOS_FIREBASE_CONFIG_FILE} to ${relTo}`);
|
|
243
|
+
return { remoteSources, warnings, logs, errors };
|
|
243
244
|
}
|
|
244
245
|
|
|
245
246
|
let res: Response;
|
|
@@ -248,18 +249,18 @@ async function downloadIosFirebaseConfig(
|
|
|
248
249
|
} catch (e) {
|
|
249
250
|
const msg = e instanceof Error ? e.message : String(e);
|
|
250
251
|
errors.push(`iOS Firebase config download failed: ${msg}`);
|
|
251
|
-
return { remoteSources, warnings, errors };
|
|
252
|
+
return { remoteSources, warnings, logs, errors };
|
|
252
253
|
}
|
|
253
254
|
if (!res.ok) {
|
|
254
255
|
errors.push(`iOS Firebase config download failed: HTTP ${res.status} ${res.statusText}`);
|
|
255
|
-
return { remoteSources, warnings, errors };
|
|
256
|
+
return { remoteSources, warnings, logs, errors };
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
const abs = path.join(pbx.srcRoot, relTo);
|
|
259
260
|
fs.mkdirSync(path.dirname(abs), { recursive: true });
|
|
260
261
|
fs.writeFileSync(abs, Buffer.from(await res.arrayBuffer()));
|
|
261
|
-
|
|
262
|
-
return { remoteSources, warnings, errors };
|
|
262
|
+
logs.push(`INFO: downloaded ${IOS_FIREBASE_CONFIG_FILE} to ${relTo}`);
|
|
263
|
+
return { remoteSources, warnings, logs, errors };
|
|
263
264
|
}
|
|
264
265
|
|
|
265
266
|
function iosFirebaseConfigRelPath(plistDocs: PlistDocument[]): string {
|
|
@@ -571,7 +572,7 @@ export async function runIosIntegrateTopSdk(
|
|
|
571
572
|
for (const folder of pluginFolders) {
|
|
572
573
|
const p = findPluginByFolder(sdkRoot, folder);
|
|
573
574
|
if (p) pluginConfigs.push(p);
|
|
574
|
-
else warnings.push(`iOS
|
|
575
|
+
else warnings.push(`iOS config enables ${folder}, but current SDK package does not include plugins/${folder}; skipped`);
|
|
575
576
|
}
|
|
576
577
|
|
|
577
578
|
const xcodeprojPath = ctx.ios.xcodeprojPath!;
|
|
@@ -591,6 +592,7 @@ export async function runIosIntegrateTopSdk(
|
|
|
591
592
|
|
|
592
593
|
const firebaseDownload = await downloadIosFirebaseConfig(remote, pbx, dryRun, iosFirebaseConfigRelPath(plistDocs));
|
|
593
594
|
warnings.push(...firebaseDownload.warnings);
|
|
595
|
+
logs.push(...firebaseDownload.logs);
|
|
594
596
|
if (firebaseDownload.errors.length) return fail(firebaseDownload.errors, warnings, logs);
|
|
595
597
|
|
|
596
598
|
const resourceErrors = [...coreConfigs, ...pluginConfigs].flatMap(validateLoadedPluginResourcesForIos);
|
package/src/mcp/service.ts
CHANGED
|
@@ -21,7 +21,10 @@ import {
|
|
|
21
21
|
} from "../core/platform.js";
|
|
22
22
|
import { buildWorkspaceContext, resolvePackageRoot } from "../core/workspace.js";
|
|
23
23
|
import { defaultTopSdkBaseUrl, fetchTopSdkDownloadSdkConfig, type TopSdkApiEnv } from "../remote/topsdkDownloadSdkConfig.js";
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
downloadIosSdkToBundled,
|
|
26
|
+
defaultSdkHomeApiBaseUrl,
|
|
27
|
+
} from "../remote/sdkHomeDownload.js";
|
|
25
28
|
import { resolveRemoteConfigCachePath, writeRemoteConfigCache } from "../cache.js";
|
|
26
29
|
|
|
27
30
|
const DEFAULT_MANIFEST_REL = "recipes/integrate-default.yaml";
|
|
@@ -67,12 +70,13 @@ function ensureSinglePlatformContext(
|
|
|
67
70
|
projectRoot: string,
|
|
68
71
|
packageRoot: string,
|
|
69
72
|
appTarget?: string,
|
|
70
|
-
remoteConfigPath?: string
|
|
73
|
+
remoteConfigPath?: string,
|
|
74
|
+
cacheRoot?: string
|
|
71
75
|
): {
|
|
72
76
|
platform: DetectedPlatform;
|
|
73
77
|
ctx: ReturnType<typeof buildWorkspaceContext>;
|
|
74
78
|
} {
|
|
75
|
-
const detectedCtx = buildWorkspaceContext(projectRoot, packageRoot, { appTarget, remoteConfigPath });
|
|
79
|
+
const detectedCtx = buildWorkspaceContext(projectRoot, packageRoot, { appTarget, remoteConfigPath, cacheRoot });
|
|
76
80
|
const detected = detectSinglePlatform(detectedCtx);
|
|
77
81
|
if (!detected.ok) throw new Error(detected.error);
|
|
78
82
|
const platformCtx = platformContext(detectedCtx, detected.platform);
|
|
@@ -182,6 +186,7 @@ export async function meetgamesIntegrate(params: {
|
|
|
182
186
|
env?: TopSdkApiEnv;
|
|
183
187
|
appId?: string;
|
|
184
188
|
channelType?: string;
|
|
189
|
+
cacheRoot?: string;
|
|
185
190
|
dryRun: boolean;
|
|
186
191
|
}): Promise<{
|
|
187
192
|
dryRun: boolean;
|
|
@@ -199,7 +204,8 @@ export async function meetgamesIntegrate(params: {
|
|
|
199
204
|
projectRoot,
|
|
200
205
|
packageRoot,
|
|
201
206
|
resolveAppTarget(params),
|
|
202
|
-
resolveCachedRemoteConfigPath(params)
|
|
207
|
+
resolveCachedRemoteConfigPath(params),
|
|
208
|
+
params.cacheRoot
|
|
203
209
|
);
|
|
204
210
|
const { report, patch, binaryCopies } = await runPipeline(ctx, manifestForPlatform(manifest, platform), { dryRun: params.dryRun });
|
|
205
211
|
return {
|
|
@@ -220,6 +226,7 @@ export async function meetgamesSetup(params: {
|
|
|
220
226
|
appId?: string;
|
|
221
227
|
appSecret?: string;
|
|
222
228
|
channelType?: string;
|
|
229
|
+
cacheRoot?: string;
|
|
223
230
|
dryRun: boolean;
|
|
224
231
|
}): Promise<{
|
|
225
232
|
fetch: Awaited<ReturnType<typeof meetgamesFetchConfig>>;
|
|
@@ -228,7 +235,7 @@ export async function meetgamesSetup(params: {
|
|
|
228
235
|
const projectRoot = ensureProjectRoot(params.projectRoot);
|
|
229
236
|
const packageRoot = resolvePackageRoot();
|
|
230
237
|
const appTarget = resolveAppTarget(params);
|
|
231
|
-
const { platform } = ensureSinglePlatformContext(projectRoot, packageRoot, appTarget);
|
|
238
|
+
const { platform } = ensureSinglePlatformContext(projectRoot, packageRoot, appTarget, undefined, params.cacheRoot);
|
|
232
239
|
const fetch = await meetgamesFetchConfig({
|
|
233
240
|
projectRoot,
|
|
234
241
|
env: params.env,
|
|
@@ -239,6 +246,8 @@ export async function meetgamesSetup(params: {
|
|
|
239
246
|
if (platform === "ios") {
|
|
240
247
|
await downloadIosSdkToBundled(packageRoot, {
|
|
241
248
|
baseUrl: process.env.MEETGAMES_SDK_HOME_API_BASE_URL?.trim() || defaultSdkHomeApiBaseUrl,
|
|
249
|
+
remoteConfigPath: fetch.outputPath,
|
|
250
|
+
cacheRoot: params.cacheRoot,
|
|
242
251
|
});
|
|
243
252
|
}
|
|
244
253
|
const integrate = await meetgamesIntegrate({
|
|
@@ -247,6 +256,7 @@ export async function meetgamesSetup(params: {
|
|
|
247
256
|
env: params.env,
|
|
248
257
|
appId: params.appId,
|
|
249
258
|
channelType: params.channelType,
|
|
259
|
+
cacheRoot: params.cacheRoot,
|
|
250
260
|
dryRun: params.dryRun,
|
|
251
261
|
});
|
|
252
262
|
return { fetch, integrate };
|
package/src/ops/handlers.ts
CHANGED
|
@@ -146,6 +146,8 @@ export const opHandlers: Record<string, OpHandler> = {
|
|
|
146
146
|
await loadMeetSdkDefaultConfigWithLatestAndroidVersion({
|
|
147
147
|
sdkHomeApiBaseUrl: ctx.sdkHomeApiBaseUrl,
|
|
148
148
|
packageRoot: ctx.packageRoot,
|
|
149
|
+
cacheRoot: ctx.cacheRoot,
|
|
150
|
+
channelType: parsed.channel,
|
|
149
151
|
})
|
|
150
152
|
);
|
|
151
153
|
|
|
@@ -302,6 +304,8 @@ export const opHandlers: Record<string, OpHandler> = {
|
|
|
302
304
|
await loadMeetSdkDefaultConfigWithLatestAndroidVersion({
|
|
303
305
|
sdkHomeApiBaseUrl: ctx.sdkHomeApiBaseUrl,
|
|
304
306
|
packageRoot: ctx.packageRoot,
|
|
307
|
+
cacheRoot: ctx.cacheRoot,
|
|
308
|
+
channelType: parsed.channel,
|
|
305
309
|
})
|
|
306
310
|
);
|
|
307
311
|
const firebase = resolved.sdkModules.analytics.firebase;
|
|
@@ -2,12 +2,37 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { syncMeetSdkIosVersionToConfig } from "../config/meetSdkIosConfig.js";
|
|
5
|
+
import {
|
|
6
|
+
MEETSDK_REMOTE_CONFIG_FILENAME,
|
|
7
|
+
hasSdkModuleKey,
|
|
8
|
+
tryParseAsMeetSdkRemoteConfig,
|
|
9
|
+
type MeetSdkRemoteConfig,
|
|
10
|
+
} from "../config/meetSdkRemoteConfig.js";
|
|
5
11
|
import { resolveIosSdkCacheLayout, withCacheLock, writeIosSdkCacheMetadata } from "../cache.js";
|
|
6
12
|
|
|
7
13
|
export const defaultSdkHomeApiBaseUrl = "https://business-api.meetgames.com";
|
|
8
|
-
export const DEFAULT_IOS_SDK_PLUGINS = ["guest", "facebook", "google", "apple", "apple_pay", "dataAppsFlyer"] as const;
|
|
9
14
|
export const DEFAULT_IOS_SDK_PACKAGE_TYPE = "native";
|
|
10
15
|
|
|
16
|
+
const IOS_SDK_DOWNLOAD_PLUGIN_BY_SUBKEY: Record<string, string> = {
|
|
17
|
+
guest: "guest",
|
|
18
|
+
email: "email",
|
|
19
|
+
facebook: "facebook",
|
|
20
|
+
google: "google",
|
|
21
|
+
snapchat: "snapchat",
|
|
22
|
+
discord: "discord",
|
|
23
|
+
line: "line",
|
|
24
|
+
naver: "naver",
|
|
25
|
+
kakao: "kakao",
|
|
26
|
+
tiktok: "tiktok",
|
|
27
|
+
apple: "apple",
|
|
28
|
+
googleIap: "google_pay",
|
|
29
|
+
appleIap: "apple_pay",
|
|
30
|
+
appsflyer: "dataAppsFlyer",
|
|
31
|
+
firebase: "dataFirebase",
|
|
32
|
+
adjust: "dataAdjust",
|
|
33
|
+
facebookdata: "dataFacebook",
|
|
34
|
+
};
|
|
35
|
+
|
|
11
36
|
const SDK_HOME_VERSION_PATH = "sdk/home/version";
|
|
12
37
|
const SDK_HOME_DOWNLOAD_URL_PATH = "sdk/home/sdk-download/getDownLoadUrl";
|
|
13
38
|
|
|
@@ -26,14 +51,14 @@ export interface SdkHomeVersions {
|
|
|
26
51
|
export interface SdkHomeDownloadUrlRequest {
|
|
27
52
|
baseUrl: string;
|
|
28
53
|
version: string;
|
|
29
|
-
platform?: "ios";
|
|
30
|
-
plugins
|
|
54
|
+
platform?: "ios" | "android";
|
|
55
|
+
plugins: readonly string[] | string;
|
|
31
56
|
packageType?: string;
|
|
32
57
|
}
|
|
33
58
|
|
|
34
59
|
export interface DownloadIosSdkOptions {
|
|
35
60
|
baseUrl?: string;
|
|
36
|
-
|
|
61
|
+
remoteConfigPath: string;
|
|
37
62
|
packageType?: string;
|
|
38
63
|
cacheRoot?: string;
|
|
39
64
|
signal?: AbortSignal;
|
|
@@ -62,16 +87,58 @@ function joinBaseAndPath(baseUrl: string, subPath: string): URL {
|
|
|
62
87
|
return new URL(subPath, base);
|
|
63
88
|
}
|
|
64
89
|
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
90
|
+
function normalizeDownloadPlugins(plugins: readonly string[] | string): string[] {
|
|
91
|
+
const list = (typeof plugins === "string" ? plugins.split(",") : plugins)
|
|
92
|
+
.map((s) => String(s).trim())
|
|
93
|
+
.filter(Boolean);
|
|
94
|
+
if (!list.length) {
|
|
95
|
+
throw new Error(`SDK download plugins must be resolved before requesting sdk-home`);
|
|
96
|
+
}
|
|
97
|
+
return list;
|
|
68
98
|
}
|
|
69
99
|
|
|
70
|
-
function
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
100
|
+
function pluginsToCsv(plugins: readonly string[] | string): string {
|
|
101
|
+
return normalizeDownloadPlugins(plugins).join(",");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function pluginsToList(plugins: readonly string[] | string): string[] {
|
|
105
|
+
return normalizeDownloadPlugins(plugins);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function resolveIosSdkDownloadPluginsFromRemoteConfig(config: MeetSdkRemoteConfig): string[] {
|
|
109
|
+
const plugins: string[] = [];
|
|
110
|
+
for (const bucket of Object.values(config.sdkModules)) {
|
|
111
|
+
if (!bucket || typeof bucket !== "object") continue;
|
|
112
|
+
const scopeRecord = bucket as Record<string, unknown>;
|
|
113
|
+
for (const subKey of Object.keys(scopeRecord)) {
|
|
114
|
+
if (!hasSdkModuleKey(scopeRecord, subKey)) continue;
|
|
115
|
+
const plugin = IOS_SDK_DOWNLOAD_PLUGIN_BY_SUBKEY[subKey];
|
|
116
|
+
if (plugin) plugins.push(plugin);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return [...new Set(plugins)];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function readIosSdkDownloadPluginsFromRemoteConfigFile(configPath: string): string[] {
|
|
123
|
+
if (!configPath || !fs.existsSync(configPath)) {
|
|
124
|
+
throw new Error(`iOS ${MEETSDK_REMOTE_CONFIG_FILENAME} not found: ${configPath || MEETSDK_REMOTE_CONFIG_FILENAME}`);
|
|
125
|
+
}
|
|
126
|
+
let raw: unknown;
|
|
127
|
+
try {
|
|
128
|
+
raw = JSON.parse(fs.readFileSync(configPath, "utf8")) as unknown;
|
|
129
|
+
} catch {
|
|
130
|
+
throw new Error(`failed to parse iOS ${MEETSDK_REMOTE_CONFIG_FILENAME}: ${configPath}`);
|
|
131
|
+
}
|
|
132
|
+
const remote = tryParseAsMeetSdkRemoteConfig(raw);
|
|
133
|
+
if (!remote) throw new Error(`not a ${MEETSDK_REMOTE_CONFIG_FILENAME} document: ${configPath}`);
|
|
134
|
+
if (remote.devicePlatform !== "ios") {
|
|
135
|
+
throw new Error(`iOS SDK download requires an iOS ${MEETSDK_REMOTE_CONFIG_FILENAME}: ${configPath}`);
|
|
136
|
+
}
|
|
137
|
+
const plugins = resolveIosSdkDownloadPluginsFromRemoteConfig(remote);
|
|
138
|
+
if (!plugins.length) {
|
|
139
|
+
throw new Error(`iOS ${MEETSDK_REMOTE_CONFIG_FILENAME} does not enable any sdk-home iOS plugins: ${configPath}`);
|
|
140
|
+
}
|
|
141
|
+
return plugins;
|
|
75
142
|
}
|
|
76
143
|
|
|
77
144
|
export function buildSdkHomeVersionUrl(baseUrl: string): string {
|
|
@@ -294,11 +361,11 @@ export async function extractZip(zipPath: string, destDir: string): Promise<void
|
|
|
294
361
|
|
|
295
362
|
export async function downloadIosSdkToBundled(
|
|
296
363
|
packageRoot: string,
|
|
297
|
-
options: DownloadIosSdkOptions
|
|
364
|
+
options: DownloadIosSdkOptions
|
|
298
365
|
): Promise<DownloadIosSdkResult> {
|
|
299
366
|
const baseUrl = options.baseUrl || defaultSdkHomeApiBaseUrl;
|
|
300
367
|
const packageType = options.packageType || DEFAULT_IOS_SDK_PACKAGE_TYPE;
|
|
301
|
-
const plugins =
|
|
368
|
+
const plugins = readIosSdkDownloadPluginsFromRemoteConfigFile(options.remoteConfigPath);
|
|
302
369
|
const versionResult = await fetchSdkHomeIosVersion({ baseUrl, signal: options.signal });
|
|
303
370
|
const serverVersion = versionResult.ios.ver;
|
|
304
371
|
const reusableCache = findReusableCachedIosSdk({
|
|
@@ -335,7 +402,7 @@ export async function downloadIosSdkToBundled(
|
|
|
335
402
|
};
|
|
336
403
|
await withCacheLock(cacheLayout.lockDir, downloadAndExtract);
|
|
337
404
|
const iosConfigPath = syncMeetSdkIosVersionToConfig({
|
|
338
|
-
|
|
405
|
+
cacheRoot: options.cacheRoot,
|
|
339
406
|
version,
|
|
340
407
|
date: versionResult.ios.date,
|
|
341
408
|
packageType,
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"topsdk": {
|
|
3
|
-
"version": "1.6.1.3",
|
|
4
|
-
"date": "2026-05-25",
|
|
5
|
-
"groupId": "com.sino.topsdk",
|
|
6
|
-
"repositories": [
|
|
7
|
-
"https://storage-sdk-gameplus.meetsocial.com/repository/TopSdk/"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"sdkModules": {
|
|
11
|
-
"login": {
|
|
12
|
-
"guest": {
|
|
13
|
-
"dependencies": [
|
|
14
|
-
{
|
|
15
|
-
"implementation": "$groupId:guest:$topsdk_version"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"email": {
|
|
20
|
-
"dependencies": [
|
|
21
|
-
{
|
|
22
|
-
"implementation": "$groupId:email:$topsdk_version"
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"facebook": {
|
|
27
|
-
"dependencies": [
|
|
28
|
-
{
|
|
29
|
-
"implementation": "$groupId:facebook:$topsdk_version"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"google": {
|
|
34
|
-
"dependencies": [
|
|
35
|
-
{
|
|
36
|
-
"implementation": "$groupId:google:$topsdk_version"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
"twitter": {
|
|
41
|
-
"dependencies": [
|
|
42
|
-
{
|
|
43
|
-
"implementation": "$groupId:twitter:$topsdk_version"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"snapchat": {
|
|
48
|
-
"dependencies": [
|
|
49
|
-
{
|
|
50
|
-
"implementation": "$groupId:snapchat:$topsdk_version"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
"line": {
|
|
55
|
-
"dependencies": [
|
|
56
|
-
{
|
|
57
|
-
"implementation": "$groupId:line:$topsdk_version"
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"naver": {
|
|
62
|
-
"dependencies": [
|
|
63
|
-
{
|
|
64
|
-
"implementation": "$groupId:naver:$topsdk_version"
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
"kakao": {
|
|
69
|
-
"repositories": [
|
|
70
|
-
"https://devrepo.kakao.com/nexus/content/groups/public/"
|
|
71
|
-
],
|
|
72
|
-
"dependencies": [
|
|
73
|
-
{
|
|
74
|
-
"implementation": "$groupId:kakao:$topsdk_version"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
"tiktok": {
|
|
79
|
-
"repositories": [
|
|
80
|
-
"https://artifact.bytedance.com/repository/AwemeOpenSDK"
|
|
81
|
-
],
|
|
82
|
-
"dependencies": [
|
|
83
|
-
{
|
|
84
|
-
"implementation": "$groupId:tiktok:$topsdk_version"
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"discord": {
|
|
89
|
-
"dependencies": [
|
|
90
|
-
{
|
|
91
|
-
"implementation": "$groupId:discord:$topsdk_version"
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"payment": {
|
|
97
|
-
"googleIap": {
|
|
98
|
-
"dependencies": [
|
|
99
|
-
{
|
|
100
|
-
"implementation": "$groupId:google-iap:$topsdk_version"
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
},
|
|
104
|
-
"onestoreIap": {
|
|
105
|
-
"repositories": [
|
|
106
|
-
"https://repo.onestore.co.kr/repository/onestore-sdk-public/"
|
|
107
|
-
],
|
|
108
|
-
"dependencies": [
|
|
109
|
-
{
|
|
110
|
-
"implementation": "$groupId:onestore-iap:$topsdk_version"
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
"huaweiIap": {
|
|
115
|
-
"repositories": [
|
|
116
|
-
"https://developer.huawei.com/repo/"
|
|
117
|
-
],
|
|
118
|
-
"dependencies": [
|
|
119
|
-
{
|
|
120
|
-
"implementation": "$groupId:huawei-iap:$topsdk_version"
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
"xiaomiIap": {
|
|
125
|
-
"dependencies": [
|
|
126
|
-
{
|
|
127
|
-
"implementation": "$groupId:xiaomi-iap:$topsdk_version"
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
"analytics": {
|
|
133
|
-
"appsflyer": {
|
|
134
|
-
"repositories": [
|
|
135
|
-
"mavenCentral"
|
|
136
|
-
],
|
|
137
|
-
"dependencies": [
|
|
138
|
-
{
|
|
139
|
-
"implementation": "$groupId:appsflyer:$topsdk_version"
|
|
140
|
-
}
|
|
141
|
-
]
|
|
142
|
-
},
|
|
143
|
-
"facebookdata": {
|
|
144
|
-
"dependencies": [
|
|
145
|
-
{
|
|
146
|
-
"implementation": "$groupId:facebook-data:$topsdk_version"
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
},
|
|
150
|
-
"firebase": {
|
|
151
|
-
"repositories": [
|
|
152
|
-
"google"
|
|
153
|
-
],
|
|
154
|
-
"classpath": "com.google.gms:google-services:4.4.4",
|
|
155
|
-
"applyplugin": "com.google.gms.google-services",
|
|
156
|
-
"dependencies": [
|
|
157
|
-
{
|
|
158
|
-
"implementation": "$groupId:firebase:$topsdk_version"
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
"adjust": {
|
|
163
|
-
"dependencies": [
|
|
164
|
-
{
|
|
165
|
-
"implementation": "$groupId:adjust:$topsdk_version"
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
package/config/meetsdk-ios.json
DELETED
package/tests/assemble.test.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { unwrapRemoteIntegrationPayload } from "../src/android/assembleIntegrationJson.js";
|
|
3
|
-
|
|
4
|
-
describe("assembleIntegrationJson", () => {
|
|
5
|
-
it("unwraps common envelopes", () => {
|
|
6
|
-
const inner = { version: 1, steps: [{ op: "gradle.insertRepositories", args: { urls: ["mavenCentral"] } }] };
|
|
7
|
-
expect(unwrapRemoteIntegrationPayload(inner)).toBe(inner);
|
|
8
|
-
expect(unwrapRemoteIntegrationPayload({ data: inner })).toEqual(inner);
|
|
9
|
-
expect(unwrapRemoteIntegrationPayload({ config: inner })).toEqual(inner);
|
|
10
|
-
expect(unwrapRemoteIntegrationPayload({ android: inner })).toEqual(inner);
|
|
11
|
-
});
|
|
12
|
-
});
|
package/tests/doctor.test.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { loadManifestFile } from "../src/config/loadManifest.js";
|
|
6
|
-
import { runDoctor } from "../src/core/doctor.js";
|
|
7
|
-
import { detectSinglePlatform, platformContext } from "../src/core/platform.js";
|
|
8
|
-
import { runPipeline } from "../src/core/pipeline.js";
|
|
9
|
-
import { buildWorkspaceContext } from "../src/core/workspace.js";
|
|
10
|
-
import { resolveIosSdkRootFromDirectory } from "../src/remote/sdkHomeDownload.js";
|
|
11
|
-
|
|
12
|
-
const pkgRoot = path.resolve(__dirname, "..");
|
|
13
|
-
const androidLatestRoot = path.join(pkgRoot, "fixtures", "android-test-project", "android-latest-project");
|
|
14
|
-
const iosProjectRoot = path.join(pkgRoot, "fixtures", "ios-test-project", "native-sample");
|
|
15
|
-
const hasIosProjectFixture = fs.existsSync(iosProjectRoot);
|
|
16
|
-
const fixtureIosSdkRoot = resolveIosSdkRootFromDirectory(path.join(pkgRoot, "fixtures", "ios-sdk", "topSDK-ios--V1.6.0.5"));
|
|
17
|
-
|
|
18
|
-
function copyIosProjectToTemp(): string {
|
|
19
|
-
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "meet-ios-doctor-"));
|
|
20
|
-
fs.cpSync(iosProjectRoot, tmp, { recursive: true });
|
|
21
|
-
fs.writeFileSync(
|
|
22
|
-
path.join(tmp, "meetsdk-remote-config.json"),
|
|
23
|
-
JSON.stringify(
|
|
24
|
-
{
|
|
25
|
-
packageName: "com.meetgames.topsdk.demo",
|
|
26
|
-
channel: "APPLE",
|
|
27
|
-
devicePlatform: "ios",
|
|
28
|
-
topsdk: {
|
|
29
|
-
appId: "mock-ios-native-sample-app-id",
|
|
30
|
-
appSecret: "mock-ios-native-sample-app-secret-do-not-use-in-production",
|
|
31
|
-
},
|
|
32
|
-
sdkModules: {
|
|
33
|
-
login: {
|
|
34
|
-
guest: {},
|
|
35
|
-
facebook: {
|
|
36
|
-
clientId: "883695101201170",
|
|
37
|
-
scheme: "fb883695101201170",
|
|
38
|
-
secret: "f840b8663b1351ddcb8f6a640cee18c6",
|
|
39
|
-
name: "top-demo",
|
|
40
|
-
openMessenger: "0",
|
|
41
|
-
},
|
|
42
|
-
google: {
|
|
43
|
-
clientId: "396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql.apps.googleusercontent.com",
|
|
44
|
-
scheme: "com.googleusercontent.apps.396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql",
|
|
45
|
-
},
|
|
46
|
-
apple: {},
|
|
47
|
-
},
|
|
48
|
-
payment: { googleIap: {} },
|
|
49
|
-
analytics: {
|
|
50
|
-
appsflyer: {
|
|
51
|
-
devKey: "af-dev-key",
|
|
52
|
-
appleAppId: "123456789",
|
|
53
|
-
enableDebugLog: true,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
null,
|
|
59
|
-
2
|
|
60
|
-
),
|
|
61
|
-
"utf8"
|
|
62
|
-
);
|
|
63
|
-
return tmp;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function stubSdkHomeVersion(): void {
|
|
67
|
-
vi.stubGlobal(
|
|
68
|
-
"fetch",
|
|
69
|
-
vi.fn(async () => ({
|
|
70
|
-
ok: true,
|
|
71
|
-
status: 200,
|
|
72
|
-
text: async () =>
|
|
73
|
-
JSON.stringify({
|
|
74
|
-
code: 200,
|
|
75
|
-
data: {
|
|
76
|
-
result: {
|
|
77
|
-
android: { ver: "1.6.1.3", date: "2026-05-25" },
|
|
78
|
-
ios: { ver: "1.6.0.5", date: "2026-06-09" },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
})) as unknown as typeof fetch
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
describe("doctor", () => {
|
|
87
|
-
beforeEach(() => {
|
|
88
|
-
stubSdkHomeVersion();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
afterEach(() => {
|
|
92
|
-
vi.unstubAllGlobals();
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it("checks Android integration details from project-root config", async () => {
|
|
96
|
-
const ctx = buildWorkspaceContext(androidLatestRoot, pkgRoot);
|
|
97
|
-
const detected = detectSinglePlatform(ctx);
|
|
98
|
-
expect(detected.ok && detected.platform).toBe("android");
|
|
99
|
-
|
|
100
|
-
const report = await runDoctor(platformContext(ctx, "android"), "android");
|
|
101
|
-
|
|
102
|
-
expect(report.platform).toBe("android");
|
|
103
|
-
expect(report.checks.map((c) => c.name)).toContain("android.repositories");
|
|
104
|
-
expect(report.checks.map((c) => c.name)).toContain("android.dependencies");
|
|
105
|
-
expect(report.checks.map((c) => c.name)).toContain("android.resValues");
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it.skipIf(!hasIosProjectFixture)("checks iOS integration details from project-root config", async () => {
|
|
109
|
-
const tmp = copyIosProjectToTemp();
|
|
110
|
-
try {
|
|
111
|
-
const manifest = loadManifestFile(path.join(pkgRoot, "recipes", "ios-default.yaml"));
|
|
112
|
-
const applyCtx = buildWorkspaceContext(tmp, pkgRoot, { iosSdkRoot: fixtureIosSdkRoot });
|
|
113
|
-
const { report: applyReport } = await runPipeline(applyCtx, manifest, { dryRun: false });
|
|
114
|
-
expect(applyReport.errors).toEqual([]);
|
|
115
|
-
|
|
116
|
-
const ctx = buildWorkspaceContext(tmp, pkgRoot, { iosSdkRoot: fixtureIosSdkRoot });
|
|
117
|
-
const detected = detectSinglePlatform(ctx);
|
|
118
|
-
expect(detected.ok && detected.platform).toBe("ios");
|
|
119
|
-
|
|
120
|
-
const report = await runDoctor(platformContext(ctx, "ios"), "ios");
|
|
121
|
-
|
|
122
|
-
expect(report.platform).toBe("ios");
|
|
123
|
-
expect(report.checks.map((c) => c.name)).toContain("ios.frameworkFiles");
|
|
124
|
-
expect(report.checks.map((c) => c.name)).toContain("ios.urlSchemes.present");
|
|
125
|
-
expect(report.checks.map((c) => c.name)).toContain("ios.appDelegateInjection");
|
|
126
|
-
expect(report.errors).toEqual([]);
|
|
127
|
-
} finally {
|
|
128
|
-
fs.rmSync(tmp, { recursive: true, force: true });
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
});
|