@applift/core 0.5.0 → 0.7.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/{plugin-CTt0LO8c.d.mts → frameworks-D83HVg8t.d.mts} +120 -59
- package/dist/index.d.mts +71 -10
- package/dist/index.mjs +481 -903
- package/dist/plugins/index.d.mts +74 -3
- package/dist/plugins/index.mjs +437 -2
- package/dist/project-4_orxby_.mjs +806 -0
- package/package.json +1 -1
|
@@ -9,20 +9,21 @@ interface FrameworkAdapter {
|
|
|
9
9
|
detect(cwd: string): boolean;
|
|
10
10
|
/** 各平台产物 glob(相对项目根,支持 * 简单通配) */
|
|
11
11
|
artifactPatterns(platform: Platform): string[];
|
|
12
|
-
/** 缺省构建命令(null=不构建,仅用已有产物) */
|
|
13
|
-
buildCommand(platform: Platform): string[] | null;
|
|
14
12
|
/** 展示名细化(如 RN 检出 Expo),可选 */
|
|
15
13
|
expoAwareLabel?(cwd: string): string;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
declare
|
|
19
|
-
|
|
20
|
-
declare
|
|
21
|
-
declare
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
/** 一层子目录列表(探测用,跳过隐藏目录与 node_modules/Pods) */
|
|
16
|
+
declare function subdirs(cwd: string, depth: number): string[];
|
|
17
|
+
/** package.json 读取(容错) */
|
|
18
|
+
declare function readJson(filePath: string): Record<string, unknown> | null;
|
|
19
|
+
declare function deps(pkg: Record<string, unknown> | null): Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* 声明式框架解析:插件注册的 adapter 是唯一来源(不再回退内置探测表)。
|
|
22
|
+
* - 未注册 → null(CLI 层负责提示声明 framework 插件)
|
|
23
|
+
* - 注册多个 → 报错(声明即意图,多个意图是配置错误)
|
|
24
|
+
* - 注册一个 → detect 降级为校验(声明与工程不符时显式报错,而非静默跳过)
|
|
25
|
+
*/
|
|
26
|
+
declare function resolveFramework(cwd: string, registered: FrameworkAdapter[]): FrameworkAdapter | null;
|
|
26
27
|
/** 按 pattern 扫描产物(支持 ** 与 * 简单通配,返回绝对路径,多产物按 mtime 新者在前) */
|
|
27
28
|
declare function findArtifacts(cwd: string, patterns: string[]): string[];
|
|
28
29
|
/** 自动推导的三端应用标识(配置缺省时的兜底来源,全部可选) */
|
|
@@ -46,16 +47,6 @@ interface BundleIds {
|
|
|
46
47
|
declare function detectBundleIds(cwd: string): BundleIds;
|
|
47
48
|
//#endregion
|
|
48
49
|
//#region src/channel.d.ts
|
|
49
|
-
/**
|
|
50
|
-
* 渠道适配器统一接口 —— applift 可扩展性的核心。
|
|
51
|
-
*
|
|
52
|
-
* 每个渠道(六商店/AGC/ASC/蒲公英…)实现本接口并注册到 registry;
|
|
53
|
-
* 编排引擎(pipeline)只面对本接口,不感知任何渠道细节。
|
|
54
|
-
*
|
|
55
|
-
* 两段式安全模型:
|
|
56
|
-
* stage = 只把包送到渠道草稿区,不动线上(iOS 上传构建≈只进 TestFlight)
|
|
57
|
-
* submit = 提审;除 iOS(默认 manual 发布)外,审核通过即自动上架 —— 不可逆,需计划确认
|
|
58
|
-
*/
|
|
59
50
|
/** 渠道能力声明(编排与确认界面据此渲染/拦截) */
|
|
60
51
|
interface ChannelCapabilities {
|
|
61
52
|
/** 支持只传包不提审(小米 push 一体 → false,submit 即上传) */
|
|
@@ -145,8 +136,12 @@ interface Channel {
|
|
|
145
136
|
plan(ctx: ChannelContext): Promise<ReleasePlanEntry>;
|
|
146
137
|
/** 传包到草稿(capabilities.stage=false 的渠道返回明确错误) */
|
|
147
138
|
stage(ctx: ChannelContext): Promise<StageResult>;
|
|
148
|
-
/**
|
|
149
|
-
|
|
139
|
+
/**
|
|
140
|
+
* 提审(=审核通过自动上架,L3 不可逆操作)。
|
|
141
|
+
* stagedRef = 同渠道 stage 成功返回的 ref(如 googleplay 的 `editId:versionCode`),
|
|
142
|
+
* 供实现复用 stage 已上传的草稿、避免重复上传;实现方可忽略。
|
|
143
|
+
*/
|
|
144
|
+
submit(ctx: ChannelContext, stagedRef?: string): Promise<SubmitResult>;
|
|
150
145
|
/** 查询审核状态(capabilities.status=false 时抛 NotSupported) */
|
|
151
146
|
status(ctx: Pick<ChannelContext, "credentials" | "target">): Promise<ReviewStatus>;
|
|
152
147
|
}
|
|
@@ -167,13 +162,7 @@ type CredentialsFile = z.infer<typeof CredentialsFileSchema>;
|
|
|
167
162
|
/** 单渠道配置(appId、pkgName 等渠道侧键) */
|
|
168
163
|
declare const StoreConfigSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
169
164
|
type StoreConfig = z.infer<typeof StoreConfigSchema>;
|
|
170
|
-
|
|
171
|
-
* stores 三种等价写法,统一规范化为 record:
|
|
172
|
-
* ① 对象:{ huawei: { appId: 'x' } }(原有写法,原样保留)
|
|
173
|
-
* ② 数组:['oppo', 'vivo'] → { oppo: {}, vivo: {} }(无配置渠道)
|
|
174
|
-
* ③ 字符串值:{ huawei: '10xxx' } → { huawei: { appId: '10xxx' } }(appId 简写)
|
|
175
|
-
*/
|
|
176
|
-
declare const StoresSchema: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodString]>>, z.ZodArray<z.ZodString>]>, z.ZodTransform<Record<string, Record<string, string>>, string[] | Record<string, string | Record<string, string>>>>>;
|
|
165
|
+
declare const StoresSchema: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodString]>>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>]>, z.ZodTransform<Record<string, Record<string, string>>, (string | Record<string, string>)[] | Record<string, string | Record<string, string>>>>>;
|
|
177
166
|
type Stores = z.infer<typeof StoresSchema>;
|
|
178
167
|
/** 项目级配置(applift.config.ts 的形状);beta 段见上方 BetaConfigSchema */
|
|
179
168
|
/**
|
|
@@ -183,7 +172,6 @@ type Stores = z.infer<typeof StoresSchema>;
|
|
|
183
172
|
* - testflight: App Store Connect 上传(ipa 进 TestFlight)
|
|
184
173
|
*/
|
|
185
174
|
declare const BetaConfigSchema: z.ZodObject<{
|
|
186
|
-
bump: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
187
175
|
pgyer: z.ZodOptional<z.ZodObject<{
|
|
188
176
|
platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
189
177
|
android: "android";
|
|
@@ -214,33 +202,22 @@ declare const VersionConfigSchema: z.ZodObject<{
|
|
|
214
202
|
}, z.core.$strip>]>>;
|
|
215
203
|
}, z.core.$strip>;
|
|
216
204
|
type VersionConfig = z.infer<typeof VersionConfigSchema>;
|
|
217
|
-
/** 正式发版段的自动 version 开关(语义同 beta.bump) */
|
|
218
|
-
declare const ReleaseConfigSchema: z.ZodObject<{
|
|
219
|
-
bump: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
220
|
-
}, z.core.$strip>;
|
|
221
|
-
type ReleaseConfig = z.infer<typeof ReleaseConfigSchema>;
|
|
222
205
|
declare const ProjectConfigSchema: z.ZodObject<{
|
|
223
206
|
name: z.ZodOptional<z.ZodString>;
|
|
224
207
|
profile: z.ZodDefault<z.ZodString>;
|
|
225
208
|
android: z.ZodOptional<z.ZodObject<{
|
|
226
|
-
pkgName: z.ZodString
|
|
227
|
-
stores: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodString]>>, z.ZodArray<z.ZodString>]>, z.ZodTransform<Record<string, Record<string, string>>, string[] | Record<string, string | Record<string, string>>>>>;
|
|
209
|
+
pkgName: z.ZodOptional<z.ZodString>;
|
|
210
|
+
stores: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodString]>>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>]>, z.ZodTransform<Record<string, Record<string, string>>, (string | Record<string, string>)[] | Record<string, string | Record<string, string>>>>>;
|
|
228
211
|
}, z.core.$strip>>;
|
|
229
212
|
harmony: z.ZodOptional<z.ZodObject<{
|
|
230
|
-
bundleName: z.ZodString
|
|
213
|
+
bundleName: z.ZodOptional<z.ZodString>;
|
|
231
214
|
appId: z.ZodOptional<z.ZodString>;
|
|
232
215
|
}, z.core.$strip>>;
|
|
233
216
|
ios: z.ZodOptional<z.ZodObject<{
|
|
234
|
-
scheme: z.ZodString
|
|
217
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
235
218
|
workspace: z.ZodOptional<z.ZodString>;
|
|
236
219
|
bundleId: z.ZodOptional<z.ZodString>;
|
|
237
220
|
}, z.core.$strip>>;
|
|
238
|
-
build: z.ZodOptional<z.ZodObject<{
|
|
239
|
-
android: z.ZodOptional<z.ZodString>;
|
|
240
|
-
harmony: z.ZodOptional<z.ZodString>;
|
|
241
|
-
harmonyApp: z.ZodOptional<z.ZodString>;
|
|
242
|
-
ios: z.ZodOptional<z.ZodString>;
|
|
243
|
-
}, z.core.$strip>>;
|
|
244
221
|
artifacts: z.ZodOptional<z.ZodObject<{
|
|
245
222
|
android: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
246
223
|
harmony: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -255,11 +232,7 @@ declare const ProjectConfigSchema: z.ZodObject<{
|
|
|
255
232
|
platforms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
256
233
|
}, z.core.$strip>]>>;
|
|
257
234
|
}, z.core.$strip>>;
|
|
258
|
-
release: z.ZodOptional<z.ZodObject<{
|
|
259
|
-
bump: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
260
|
-
}, z.core.$strip>>;
|
|
261
235
|
beta: z.ZodOptional<z.ZodObject<{
|
|
262
|
-
bump: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
263
236
|
pgyer: z.ZodOptional<z.ZodObject<{
|
|
264
237
|
platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
265
238
|
android: "android";
|
|
@@ -352,6 +325,69 @@ declare function runSubmit(input: PipelineInput, options: {
|
|
|
352
325
|
skipStage: boolean;
|
|
353
326
|
}): Promise<PipelineSummary>;
|
|
354
327
|
//#endregion
|
|
328
|
+
//#region src/update.d.ts
|
|
329
|
+
/** 判定结论:推荐值 + 置信度 + 逐文件证据(透明可审计,不是黑盒) */
|
|
330
|
+
interface DeliveryJudgement {
|
|
331
|
+
recommendation: "ota" | "native" | "uncertain";
|
|
332
|
+
confidence: "high" | "medium" | "low";
|
|
333
|
+
evidence: Array<{
|
|
334
|
+
path: string;
|
|
335
|
+
rule: string;
|
|
336
|
+
note: string;
|
|
337
|
+
}>;
|
|
338
|
+
}
|
|
339
|
+
/** judge 的上下文:core 已解析的生效 framework(声明式),provider 不自行探测工程结构 */
|
|
340
|
+
interface FrameworkContext {
|
|
341
|
+
cwd: string;
|
|
342
|
+
framework: FrameworkAdapter;
|
|
343
|
+
/** 上个发版锚点 tag(依赖变更对比 git show 用);无锚点时缺省 */
|
|
344
|
+
anchor?: string;
|
|
345
|
+
}
|
|
346
|
+
interface UpdateProvider {
|
|
347
|
+
id: string;
|
|
348
|
+
/** 支持的 framework adapter id(如 ['rn']);与项目声明的 framework 不匹配时 core 不采纳 */
|
|
349
|
+
frameworks: string[];
|
|
350
|
+
/** 已接入热更的平台(如 ['harmony']);缺省视为全部。未接入平台的路由直接走原生 */
|
|
351
|
+
platforms?: string[];
|
|
352
|
+
/** 判定本次 diff 能否走热更(diff = 上个发版锚点到工作区的文件列表,含未提交与未跟踪) */
|
|
353
|
+
judge(diff: string[], ctx: FrameworkContext): Promise<DeliveryJudgement> | DeliveryJudgement;
|
|
354
|
+
/** beta 热更路径:构建热更包并发到测试通道(测试设备验证用) */
|
|
355
|
+
publishToTest(ctx: PublishContext): Promise<{
|
|
356
|
+
versionName: string;
|
|
357
|
+
versionId: number;
|
|
358
|
+
}>;
|
|
359
|
+
/** release 热更路径:测试通道最新已验证热更 promote 到正式(重绑正式原生版本 + 灰度) */
|
|
360
|
+
promoteToProd(ctx: PublishContext): Promise<{
|
|
361
|
+
versionName: string;
|
|
362
|
+
rollout?: number;
|
|
363
|
+
}>;
|
|
364
|
+
}
|
|
365
|
+
interface DeliveryRoute {
|
|
366
|
+
provider: UpdateProvider;
|
|
367
|
+
judgement: DeliveryJudgement;
|
|
368
|
+
}
|
|
369
|
+
/** 发布上下文:判定/发布共用(platform 为本次发布目标平台) */
|
|
370
|
+
interface PublishContext extends FrameworkContext {
|
|
371
|
+
platform: string;
|
|
372
|
+
/** 更新说明(热更版本的 description) */
|
|
373
|
+
note?: string;
|
|
374
|
+
/** release 热更的灰度比例(CLI 确认时收集;缺省用 provider 默认) */
|
|
375
|
+
rollout?: number;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* 投递路由:按当前 framework 匹配 provider 并执行判定。
|
|
379
|
+
* - 无 provider / 无匹配 → null(走原生包路径,原始行为不受影响)
|
|
380
|
+
* - 多个 provider 匹配同一 framework → 配置错误(一个框架一个热更实现)
|
|
381
|
+
* 结论是推荐值:最终投递方式由用户在确认界面拍板,CI 非交互时 uncertain 中止
|
|
382
|
+
*/
|
|
383
|
+
declare function routeDelivery(providers: UpdateProvider[], ctx: FrameworkContext, diff: string[], platform?: string): Promise<DeliveryRoute | null>;
|
|
384
|
+
/**
|
|
385
|
+
* 收集上个发版锚点(最新 semver tag)到工作区的变更文件列表。
|
|
386
|
+
* 含未提交改动与未跟踪文件(pushy bundle 打包的是工作区内容,判定口径必须一致)。
|
|
387
|
+
* 无锚点 / 非 git 仓库 → null(调用方按 uncertain 处理,不猜)。
|
|
388
|
+
*/
|
|
389
|
+
declare function collectReleaseDiff(cwd: string): Promise<string[] | null>;
|
|
390
|
+
//#endregion
|
|
355
391
|
//#region src/plugin.d.ts
|
|
356
392
|
interface HookContext {
|
|
357
393
|
/** 触发钩子的渠道 id(channel 级钩子才有) */
|
|
@@ -359,12 +395,14 @@ interface HookContext {
|
|
|
359
395
|
/** 项目根目录 */
|
|
360
396
|
cwd: string;
|
|
361
397
|
}
|
|
362
|
-
interface
|
|
398
|
+
interface AppliftPlugin {
|
|
363
399
|
name: string;
|
|
364
400
|
"config:resolved"?(config: ProjectConfig, ctx: HookContext): Promise<ProjectConfig | void> | ProjectConfig | void;
|
|
365
401
|
"channel:register"?(registry: ChannelRegistry, ctx: HookContext): Promise<void> | void;
|
|
366
|
-
/** 注册自定义框架适配器(detect/artifactPatterns
|
|
402
|
+
/** 注册自定义框架适配器(detect/artifactPatterns——扩展新框架的入口,与渠道扩展对称) */
|
|
367
403
|
"framework:register"?(adapters: FrameworkAdapter[], ctx: HookContext): Promise<void> | void;
|
|
404
|
+
/** 注册热更能力 provider(beta/release 投递路由的消费方,与框架/渠道扩展对称) */
|
|
405
|
+
"update:register"?(providers: UpdateProvider[], ctx: HookContext): Promise<void> | void;
|
|
368
406
|
"plan:before"?(plans: ReleasePlanEntry[], ctx: HookContext): Promise<ReleasePlanEntry[] | false | void> | ReleasePlanEntry[] | false | void;
|
|
369
407
|
"stage:before"?(channelCtx: ChannelContext, ctx: HookContext): Promise<ChannelContext | false | void> | ChannelContext | false | void;
|
|
370
408
|
"stage:after"?(result: {
|
|
@@ -372,17 +410,20 @@ interface QypubPlugin {
|
|
|
372
410
|
ok: boolean;
|
|
373
411
|
ref?: string;
|
|
374
412
|
error?: string;
|
|
413
|
+
artifactPath?: string;
|
|
375
414
|
}, ctx: HookContext): Promise<void> | void;
|
|
376
415
|
"submit:before"?(plans: ReleasePlanEntry[], ctx: HookContext): Promise<ReleasePlanEntry[] | false | void> | ReleasePlanEntry[] | false | void;
|
|
377
416
|
"submit:after"?(summary: PipelineSummary, ctx: HookContext): Promise<void> | void;
|
|
378
417
|
notify?(summary: PipelineSummary, ctx: HookContext): Promise<void> | void;
|
|
379
418
|
}
|
|
380
|
-
type PluginHookName = Exclude<keyof
|
|
419
|
+
type PluginHookName = Exclude<keyof AppliftPlugin, "name">;
|
|
381
420
|
declare class PluginHost {
|
|
382
421
|
private readonly plugins;
|
|
383
|
-
constructor(plugins:
|
|
422
|
+
constructor(plugins: AppliftPlugin[]);
|
|
384
423
|
/**
|
|
385
424
|
* 顺序执行某钩子;支持「链式替换」(返回对象则替换后继续传给下一插件)与「拦截」(返回 false 立即中止)。
|
|
425
|
+
* 信任边界:返回值按 T 强转、不做形状校验(vite 同款取舍)——插件作者自负其责,
|
|
426
|
+
* 坏形状会在后续消费点显式抛错,宿主不代为静默兜底。
|
|
386
427
|
* @returns {[被拦截?, 最终值]} false 表示被某插件拦截
|
|
387
428
|
*/
|
|
388
429
|
apply<T>(hook: PluginHookName, value: T, ctx: HookContext): Promise<{
|
|
@@ -396,11 +437,31 @@ declare class PluginHost {
|
|
|
396
437
|
* defineConfig —— vite 同款体验:applift.config.ts 导出时提供类型提示。
|
|
397
438
|
* plugins 中允许嵌套工厂函数(如 dingtalkNotify({...}) 直接返回插件对象)。
|
|
398
439
|
*/
|
|
399
|
-
interface
|
|
400
|
-
plugins?: Array<
|
|
440
|
+
interface AppliftUserConfig extends Partial<ProjectConfig> {
|
|
441
|
+
plugins?: Array<AppliftPlugin | (() => AppliftPlugin)>;
|
|
401
442
|
}
|
|
402
|
-
declare function defineConfig(config:
|
|
443
|
+
declare function defineConfig(config: AppliftUserConfig): AppliftUserConfig;
|
|
403
444
|
/** 解析用户配置中的插件(工厂惰性求值),供 PluginHost 构造 */
|
|
404
|
-
declare function resolvePlugins(userConfig:
|
|
445
|
+
declare function resolvePlugins(userConfig: AppliftUserConfig): AppliftPlugin[];
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/plugins/frameworks.d.ts
|
|
448
|
+
/** 生态通用 RN adapter:产物 pattern 按 RN 社区惯例;构建命令无统一标准(项目覆盖) */
|
|
449
|
+
declare const rnAdapter: FrameworkAdapter;
|
|
450
|
+
declare function rnFramework(): AppliftPlugin;
|
|
451
|
+
declare const flutterAdapter: FrameworkAdapter;
|
|
452
|
+
declare function flutterFramework(): AppliftPlugin;
|
|
453
|
+
declare const nativeAndroidAdapter: FrameworkAdapter;
|
|
454
|
+
declare function nativeAndroidFramework(): AppliftPlugin;
|
|
455
|
+
declare const nativeIosAdapter: FrameworkAdapter;
|
|
456
|
+
declare function nativeIosFramework(): AppliftPlugin;
|
|
457
|
+
declare const nativeHarmonyAdapter: FrameworkAdapter;
|
|
458
|
+
declare function nativeHarmonyFramework(): AppliftPlugin;
|
|
459
|
+
declare const electronAdapter: FrameworkAdapter;
|
|
460
|
+
declare function electronFramework(): AppliftPlugin;
|
|
461
|
+
declare const tauriAdapter: FrameworkAdapter;
|
|
462
|
+
declare const knownFrameworkAdapters: FrameworkAdapter[];
|
|
463
|
+
/** 按已知框架表探测建议(仅供 init/doctor 展示,不是发布依据) */
|
|
464
|
+
declare function suggestFramework(cwd: string): FrameworkAdapter | null;
|
|
465
|
+
declare function tauriFramework(): AppliftPlugin;
|
|
405
466
|
//#endregion
|
|
406
|
-
export {
|
|
467
|
+
export { StoreConfigSchema as $, routeDelivery as A, appendEntry as B, resolvePlugins as C, subdirs as Ct, PublishContext as D, FrameworkContext as E, runSubmit as F, CredentialsFileSchema as G, BetaConfig as H, HISTORY_PATH as I, GlobalConfig as J, CredentialsProfile as K, HistoryEntry as L, PipelineSummary as M, PipelineSummaryEntry as N, UpdateProvider as O, runStage as P, StoreConfig as Q, HistoryEvent as R, defineConfig as S, resolveFramework as St, DeliveryRoute as T, BetaConfigSchema as U, readEntries as V, CredentialsFile as W, ProjectConfig as X, GlobalConfigSchema as Y, ProjectConfigSchema as Z, AppliftPlugin as _, Platform as _t, knownFrameworkAdapters as a, VersionConfigSchema as at, PluginHookName as b, findArtifacts as bt, nativeHarmonyAdapter as c, ChannelContext as ct, nativeIosFramework as d, ReleasePlanEntry as dt, Stores as et, rnAdapter as f, ReviewStatus as ft, tauriFramework as g, FrameworkAdapter as gt, tauriAdapter as h, BundleIds as ht, flutterFramework as i, VersionConfig as it, PipelineInput as j, collectReleaseDiff as k, nativeHarmonyFramework as l, ChannelEvent as lt, suggestFramework as m, SubmitResult as mt, electronFramework as n, VersionCodeConfig as nt, nativeAndroidAdapter as o, Channel as ot, rnFramework as p, StageResult as pt, CredentialsProfileSchema as q, flutterAdapter as r, VersionCodeConfigSchema as rt, nativeAndroidFramework as s, ChannelCapabilities as st, electronAdapter as t, StoresSchema as tt, nativeIosAdapter as u, ChannelRegistry as ut, AppliftUserConfig as v, deps as vt, DeliveryJudgement as w, PluginHost as x, readJson as xt, HookContext as y, detectBundleIds as yt, HistoryQuery as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as StoreConfigSchema, A as routeDelivery, B as appendEntry, C as resolvePlugins, Ct as subdirs, D as PublishContext, E as FrameworkContext, F as runSubmit, G as CredentialsFileSchema, H as BetaConfig, I as HISTORY_PATH, J as GlobalConfig, K as CredentialsProfile, L as HistoryEntry, M as PipelineSummary, N as PipelineSummaryEntry, O as UpdateProvider, P as runStage, Q as StoreConfig, R as HistoryEvent, S as defineConfig, St as resolveFramework, T as DeliveryRoute, U as BetaConfigSchema, V as readEntries, W as CredentialsFile, X as ProjectConfig, Y as GlobalConfigSchema, Z as ProjectConfigSchema, _ as AppliftPlugin, _t as Platform, a as knownFrameworkAdapters, at as VersionConfigSchema, b as PluginHookName, bt as findArtifacts, c as nativeHarmonyAdapter, ct as ChannelContext, d as nativeIosFramework, dt as ReleasePlanEntry, et as Stores, f as rnAdapter, ft as ReviewStatus, g as tauriFramework, gt as FrameworkAdapter, h as tauriAdapter, ht as BundleIds, i as flutterFramework, it as VersionConfig, j as PipelineInput, k as collectReleaseDiff, l as nativeHarmonyFramework, lt as ChannelEvent, m as suggestFramework, mt as SubmitResult, n as electronFramework, nt as VersionCodeConfig, o as nativeAndroidAdapter, ot as Channel, p as rnFramework, pt as StageResult, q as CredentialsProfileSchema, r as flutterAdapter, rt as VersionCodeConfigSchema, s as nativeAndroidFramework, st as ChannelCapabilities, t as electronAdapter, tt as StoresSchema, u as nativeIosAdapter, ut as ChannelRegistry, v as AppliftUserConfig, vt as deps, w as DeliveryJudgement, x as PluginHost, xt as readJson, y as HookContext, yt as detectBundleIds, z as HistoryQuery } from "./frameworks-D83HVg8t.mjs";
|
|
2
2
|
//#region src/registry.d.ts
|
|
3
3
|
export declare class DefaultChannelRegistry implements ChannelRegistry {
|
|
4
4
|
private readonly channels;
|
|
@@ -30,8 +30,13 @@ export declare function loadCredentials(filePath?: string): CredentialsFile;
|
|
|
30
30
|
* knownKeys 提供时其裸键名(如 PGYER_API_KEY)也认(向后兼容),未提供的裸大写键不捡(避免误吸无关变量)。
|
|
31
31
|
*/
|
|
32
32
|
export declare function resolveProfile(creds: CredentialsFile, profile: string, knownKeys?: string[]): Record<string, string>;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
export interface GlobalConfigLoadResult {
|
|
34
|
+
config: GlobalConfig;
|
|
35
|
+
/** 配置文件损坏降级默认值时的警告(调用方决定呈现方式;core 保持 headless 不写 stderr) */
|
|
36
|
+
warning?: string;
|
|
37
|
+
}
|
|
38
|
+
/** 全局配置装载(缺失/损坏降级默认值;警告经返回值交给调用方,不阻断) */
|
|
39
|
+
export declare function loadGlobalConfig(filePath?: string): GlobalConfigLoadResult;
|
|
35
40
|
/** 写凭据(目录自动创建,文件强制 0600) */
|
|
36
41
|
export declare function saveCredentials(data: CredentialsFile, filePath?: string): void;
|
|
37
42
|
//#endregion
|
|
@@ -42,7 +47,7 @@ export interface LoadedProjectConfig {
|
|
|
42
47
|
* c12 原始配置(保留 plugins 等 schema 外键)——插件发现(resolvePlugins)用;
|
|
43
48
|
* 业务字段一律以 config(zod 解析后)为准。
|
|
44
49
|
*/
|
|
45
|
-
raw:
|
|
50
|
+
raw: AppliftUserConfig;
|
|
46
51
|
/** 配置文件所在目录(解析相对路径用),无配置文件时为 cwd */
|
|
47
52
|
cwd: string;
|
|
48
53
|
}
|
|
@@ -56,10 +61,17 @@ export declare function loadProjectProfileMap(filePath?: string): Record<string,
|
|
|
56
61
|
export declare function saveProjectProfileMap(map: Record<string, string>, filePath?: string): void;
|
|
57
62
|
/** 记录某项目使用的 profile(键统一绝对路径;合并保留其他项目的条目) */
|
|
58
63
|
export declare function setProjectProfile(cwd: string, profile: string, filePath?: string): void;
|
|
64
|
+
/** 生效 profile 的来源(诊断展示用;--profile 旗标在调用方,最高优先级,不经此函数) */
|
|
65
|
+
export type ProfileSource = "applift use(个人)" | "项目配置 profile(团队默认)" | "默认 default";
|
|
59
66
|
/**
|
|
60
|
-
* 解析项目生效 profile
|
|
61
|
-
* CLI 的 --profile 旗标在调用方以 `opts.profile ??
|
|
67
|
+
* 解析项目生效 profile 及其来源:projects.json 个人选择 > 项目配置 profile(团队默认)> 'default'。
|
|
68
|
+
* CLI 的 --profile 旗标在调用方以 `opts.profile ?? ...` 再盖一层(最高优先级,来源即"旗标")。
|
|
62
69
|
*/
|
|
70
|
+
export declare function resolveProfileSource(cwd: string, projectCfgProfile?: string, filePath?: string): {
|
|
71
|
+
profile: string;
|
|
72
|
+
source: ProfileSource;
|
|
73
|
+
};
|
|
74
|
+
/** 解析项目生效 profile(只取名不问来源;来源用 resolveProfileSource) */
|
|
63
75
|
export declare function resolveProfileFor(cwd: string, projectCfgProfile?: string, filePath?: string): string;
|
|
64
76
|
//#endregion
|
|
65
77
|
//#region src/channels/shared/sign.d.ts
|
|
@@ -80,6 +92,10 @@ export declare class PgyerChannel implements Channel {
|
|
|
80
92
|
readonly id = "pgyer";
|
|
81
93
|
readonly label = "蒲公英";
|
|
82
94
|
readonly capabilities: ChannelCapabilities;
|
|
95
|
+
/** 平台错误码 → 人话(1247:源码注释已证 = buildKey 尚未就绪/COS 仍在入库) */
|
|
96
|
+
readonly errorHints: {
|
|
97
|
+
"1247": string;
|
|
98
|
+
};
|
|
83
99
|
plan(ctx: ChannelContext): Promise<ReleasePlanEntry>;
|
|
84
100
|
stage(ctx: ChannelContext): Promise<StageResult>;
|
|
85
101
|
submit(): Promise<SubmitResult>;
|
|
@@ -172,6 +188,11 @@ export declare class XiaomiChannel implements Channel {
|
|
|
172
188
|
readonly id = "xiaomi";
|
|
173
189
|
readonly label = "小米应用商店";
|
|
174
190
|
readonly capabilities: ChannelCapabilities;
|
|
191
|
+
/** 平台错误码 → 人话(result 码:依据为本仓测试已固化的真实失败路径文案) */
|
|
192
|
+
readonly errorHints: {
|
|
193
|
+
"401": string;
|
|
194
|
+
"1005": string;
|
|
195
|
+
};
|
|
175
196
|
plan(_ctx: ChannelContext): Promise<ReleasePlanEntry>;
|
|
176
197
|
/** 小米不支持只传包:push 接口上传即提审 */
|
|
177
198
|
stage(_ctx: ChannelContext): Promise<StageResult>;
|
|
@@ -286,6 +307,10 @@ export declare class YybChannel implements Channel {
|
|
|
286
307
|
readonly id = "yyb";
|
|
287
308
|
readonly label = "腾讯应用宝";
|
|
288
309
|
readonly capabilities: ChannelCapabilities;
|
|
310
|
+
/** 平台错误码 → 人话(ret 码:依据为本仓测试已固化的真实失败路径) */
|
|
311
|
+
readonly errorHints: {
|
|
312
|
+
"10010": string;
|
|
313
|
+
};
|
|
289
314
|
/** stage 产物暂存(serial_number + md5),submit 按 appId 取回 */
|
|
290
315
|
private readonly staged;
|
|
291
316
|
private required;
|
|
@@ -329,8 +354,9 @@ export declare class AgcHarmonyChannel implements Channel {
|
|
|
329
354
|
plan(ctx: ChannelContext): Promise<ReleasePlanEntry>;
|
|
330
355
|
/** stage = 上传+绑定(不提审):正式 .app 走 v3 绑定;ctx.target.releaseType==='6' 走测试发布(.hap) */
|
|
331
356
|
stage(ctx: ChannelContext): Promise<StageResult>;
|
|
332
|
-
/** submit = v1 releaseHarmonyApp 完整链路:上传+绑定+文案 → 等编译轮询 →
|
|
333
|
-
|
|
357
|
+
/** submit = v1 releaseHarmonyApp 完整链路:上传+绑定+文案 → 等编译轮询 → 提审(带重试)。
|
|
358
|
+
* stagedRef = stage() 返回的 packageId:包已在草稿区,跳过重传直接等编译+提审(.app 常为数百 MB~GB,双倍上传不可接受) */
|
|
359
|
+
submit(ctx: ChannelContext, stagedRef?: string): Promise<SubmitResult>;
|
|
334
360
|
/** 轮询软件包云端编译:successStatus 0=成功 2=拒绝(终态,多为签名/证书/bundleName 不匹配)其他=编译中 */
|
|
335
361
|
private awaitCompile;
|
|
336
362
|
status(): Promise<ReviewStatus>;
|
|
@@ -384,11 +410,24 @@ export declare class GooglePlayChannel implements Channel {
|
|
|
384
410
|
readonly id = "googleplay";
|
|
385
411
|
readonly label = "Google Play";
|
|
386
412
|
readonly capabilities: ChannelCapabilities;
|
|
413
|
+
/** 平台错误码 → 人话(HTTP 状态:依据为本仓测试已固化的失败路径) */
|
|
414
|
+
readonly errorHints: {
|
|
415
|
+
"403": string;
|
|
416
|
+
};
|
|
387
417
|
plan(_ctx: ChannelContext): Promise<ReleasePlanEntry>;
|
|
388
418
|
stage(ctx: ChannelContext): Promise<StageResult>;
|
|
389
|
-
submit(ctx: ChannelContext): Promise<SubmitResult>;
|
|
419
|
+
submit(ctx: ChannelContext, stagedRef?: string): Promise<SubmitResult>;
|
|
420
|
+
/** 复用 stage 已上传的 versionCode:开新 edit(仍需 auth)→ 部署 production → commit,跳过上传 */
|
|
421
|
+
private assignExisting;
|
|
390
422
|
/** 上传 + 部署到指定轨道 + commit,返回 `editId:versionCode` */
|
|
391
423
|
private uploadAndAssign;
|
|
424
|
+
/**
|
|
425
|
+
* 部署 versionCode 到指定轨道并 commit:
|
|
426
|
+
* 先 GET 轨道现有 releases 再合并 PUT——目标 release(同 status=completed 配置)追加新 versionCode,
|
|
427
|
+
* 其余 releases 原样保留(status/userFraction 不变),避免整轨覆盖把旧版本从轨道剔除;
|
|
428
|
+
* :commit 冒号语法(对拍 apkgo googleplay.go 权威;对 production 含提交审核语义,internal 即生效)
|
|
429
|
+
*/
|
|
430
|
+
private deployAndCommit;
|
|
392
431
|
status(ctx: Pick<ChannelContext, "credentials" | "target">): Promise<ReviewStatus>;
|
|
393
432
|
private requirePkgName;
|
|
394
433
|
}
|
|
@@ -400,9 +439,19 @@ export declare function sha256File(filePath: string): string;
|
|
|
400
439
|
//#region src/channels/shared/error-codes.d.ts
|
|
401
440
|
/**
|
|
402
441
|
* 错误码人话化:消费各渠道自带 errorHints(平台内聚——表与渠道实现同文件)。
|
|
442
|
+
* 网络类故障(AbortSignal 超时/断连/DNS)渠道层不转译,统一在此兜底提示。
|
|
403
443
|
*/
|
|
404
444
|
export declare function humanizeError(hints: Record<string, string> | undefined, message: string): string;
|
|
405
445
|
//#endregion
|
|
446
|
+
//#region src/channels/shared/redact.d.ts
|
|
447
|
+
/**
|
|
448
|
+
* 文本脱敏(三层层叠,逐层尝试):
|
|
449
|
+
* 1) http(s) URL 带 query/userinfo → query 按名脱敏 + 剥 userinfo
|
|
450
|
+
* 2) { / [ 开头且整串为合法 JSON → 递归按键名脱敏
|
|
451
|
+
* 3) 其余 → name=value 正则扫(错误消息等无结构文本)
|
|
452
|
+
*/
|
|
453
|
+
export declare function redactText(v: string): string;
|
|
454
|
+
//#endregion
|
|
406
455
|
//#region src/version/project.d.ts
|
|
407
456
|
export type VersionFileKind = "gradle" | "pbxproj" | "app-json5" | "pubspec" | "package-json" | "tauri" | "expo-app-json";
|
|
408
457
|
export interface PlatformVersionInfo {
|
|
@@ -579,6 +628,18 @@ export declare function commitsSince(cwd: string, ref?: string): string[];
|
|
|
579
628
|
/** 工作区状态(--porcelain)。注意:不走通用 git()——其 stdout.trim() 会剥掉首行前导空格,
|
|
580
629
|
* 破坏 porcelain 的两列状态位(" M file" → "M file"),此处保留原始行仅去行尾。 */
|
|
581
630
|
export declare function statusShort(cwd: string): string[];
|
|
631
|
+
export interface TagResult {
|
|
632
|
+
tagged: boolean;
|
|
633
|
+
reason?: string;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* release 分发成功后补 tag(tag = 实际已发布的正式版本;beta 不打 tag,追溯走 history)。
|
|
637
|
+
* - tag 已存在(多端发布,前一端已打)→ 跳过
|
|
638
|
+
* - dryRun / 无版本 / 非 git 仓库 → 不动、不炸(tag 失败不阻断发布主流程)
|
|
639
|
+
*/
|
|
640
|
+
export declare function tagReleaseVersion(cwd: string, version: string | undefined, opts?: {
|
|
641
|
+
dryRun?: boolean;
|
|
642
|
+
}): TagResult;
|
|
582
643
|
//#endregion
|
|
583
644
|
//#region src/version/artifact.d.ts
|
|
584
645
|
export interface ArtifactVersion {
|
|
@@ -589,4 +650,4 @@ export interface ArtifactVersion {
|
|
|
589
650
|
}
|
|
590
651
|
export declare function readArtifactVersion(artifactPath: string): ArtifactVersion | undefined;
|
|
591
652
|
//#endregion
|
|
592
|
-
export { BetaConfig, BetaConfigSchema, BundleIds, Channel, ChannelCapabilities, ChannelContext, ChannelEvent, ChannelRegistry, CredentialsFile, CredentialsFileSchema, CredentialsProfile, CredentialsProfileSchema, FrameworkAdapter, GlobalConfig, GlobalConfigSchema, HISTORY_PATH, HistoryEntry, HistoryEvent, HistoryQuery, HookContext, PipelineInput, PipelineSummary, PipelineSummaryEntry, Platform, PluginHookName, PluginHost, ProjectConfig, ProjectConfigSchema,
|
|
653
|
+
export { AppliftPlugin, AppliftUserConfig, BetaConfig, BetaConfigSchema, BundleIds, Channel, ChannelCapabilities, ChannelContext, ChannelEvent, ChannelRegistry, CredentialsFile, CredentialsFileSchema, CredentialsProfile, CredentialsProfileSchema, DeliveryJudgement, DeliveryRoute, FrameworkAdapter, FrameworkContext, GlobalConfig, GlobalConfigSchema, HISTORY_PATH, HistoryEntry, HistoryEvent, HistoryQuery, HookContext, PipelineInput, PipelineSummary, PipelineSummaryEntry, Platform, PluginHookName, PluginHost, ProjectConfig, ProjectConfigSchema, PublishContext, ReleasePlanEntry, ReviewStatus, StageResult, StoreConfig, StoreConfigSchema, Stores, StoresSchema, SubmitResult, UpdateProvider, VersionCodeConfig, VersionCodeConfigSchema, VersionConfig, VersionConfigSchema, appendEntry, collectReleaseDiff, defineConfig, deps, detectBundleIds, electronAdapter, electronFramework, findArtifacts, flutterAdapter, flutterFramework, knownFrameworkAdapters, nativeAndroidAdapter, nativeAndroidFramework, nativeHarmonyAdapter, nativeHarmonyFramework, nativeIosAdapter, nativeIosFramework, readEntries, readJson, resolveFramework, resolvePlugins, rnAdapter, rnFramework, routeDelivery, runStage, runSubmit, subdirs, suggestFramework, tauriAdapter, tauriFramework };
|