@applift/core 0.3.0 → 0.5.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/index.d.mts +181 -3
- package/dist/index.mjs +960 -17
- package/dist/{plugin-DzhwzVfu.d.mts → plugin-CTt0LO8c.d.mts} +30 -1
- package/dist/plugins/index.d.mts +1 -1
- package/package.json +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as electronAdapter, A as ReleaseConfigSchema, B as ChannelCapabilities, C as CredentialsProfile, D as ProjectConfig, E as GlobalConfigSchema, F as VersionCodeConfig, G as ReviewStatus, H as ChannelEvent, I as VersionCodeConfigSchema, J as BundleIds, K as StageResult, L as VersionConfig, M as StoreConfigSchema, N as Stores, O as ProjectConfigSchema, P as StoresSchema, Q as detectFramework, R as VersionConfigSchema, S as CredentialsFileSchema, T as GlobalConfig, U as ChannelRegistry, V as ChannelContext, W as ReleasePlanEntry, X as Platform, Y as FrameworkAdapter, Z as detectBundleIds, _ as appendEntry, a as QypubUserConfig, at as rnAdapter, b as BetaConfigSchema, c as PipelineInput, d as runStage, et as findArtifacts, f as runSubmit, g as HistoryQuery, h as HistoryEvent, i as QypubPlugin, it as nativeIosAdapter, j as StoreConfig, k as ReleaseConfig, l as PipelineSummary, m as HistoryEntry, n as PluginHookName, nt as nativeAndroidAdapter, o as defineConfig, ot as tauriAdapter, p as HISTORY_PATH, q as SubmitResult, r as PluginHost, rt as nativeHarmonyAdapter, s as resolvePlugins, t as HookContext, tt as flutterAdapter, u as PipelineSummaryEntry, v as readEntries, w as CredentialsProfileSchema, x as CredentialsFile, y as BetaConfig, z as Channel } from "./plugin-CTt0LO8c.mjs";
|
|
2
2
|
//#region src/registry.d.ts
|
|
3
3
|
export declare class DefaultChannelRegistry implements ChannelRegistry {
|
|
4
4
|
private readonly channels;
|
|
@@ -321,6 +321,7 @@ export declare class AgcHarmonyChannel implements Channel {
|
|
|
321
321
|
"1003": string;
|
|
322
322
|
"204144702": string;
|
|
323
323
|
"204144677": string;
|
|
324
|
+
"204144692": string;
|
|
324
325
|
};
|
|
325
326
|
private authHeaders;
|
|
326
327
|
/** appId 缺省时按 bundleName 查(v1 全链路 step 0,可选) */
|
|
@@ -402,7 +403,184 @@ export declare function sha256File(filePath: string): string;
|
|
|
402
403
|
*/
|
|
403
404
|
export declare function humanizeError(hints: Record<string, string> | undefined, message: string): string;
|
|
404
405
|
//#endregion
|
|
405
|
-
//#region src/version.d.ts
|
|
406
|
+
//#region src/version/project.d.ts
|
|
407
|
+
export type VersionFileKind = "gradle" | "pbxproj" | "app-json5" | "pubspec" | "package-json" | "tauri" | "expo-app-json";
|
|
408
|
+
export interface PlatformVersionInfo {
|
|
409
|
+
platform: string;
|
|
410
|
+
versionName?: string;
|
|
411
|
+
versionCode?: string;
|
|
412
|
+
file: string;
|
|
413
|
+
kind: VersionFileKind;
|
|
414
|
+
/** 非标准形态说明(读出但不代写,提示改造) */
|
|
415
|
+
problem?: string;
|
|
416
|
+
}
|
|
417
|
+
export interface VersionWrite {
|
|
418
|
+
platform: string;
|
|
419
|
+
versionName: string;
|
|
420
|
+
versionCode: number;
|
|
421
|
+
}
|
|
422
|
+
/** 各端版本实况(按框架布局;未识别框架时尝试全部标准位置) */
|
|
423
|
+
export declare function readProjectVersions(cwd: string, framework: FrameworkAdapter | null): PlatformVersionInfo[];
|
|
424
|
+
/**
|
|
425
|
+
* 写回各端版本(多端 versionName 同步、versionCode 各端独立)。
|
|
426
|
+
* 返回实际改动的文件列表(commit 范围)。problem 端跳过并在返回中列出(不阻断其他端)。
|
|
427
|
+
*/
|
|
428
|
+
export declare function writeProjectVersions(cwd: string, framework: FrameworkAdapter | null, writes: VersionWrite[]): {
|
|
429
|
+
changed: string[];
|
|
430
|
+
skipped: Array<{
|
|
431
|
+
platform: string;
|
|
432
|
+
reason: string;
|
|
433
|
+
}>;
|
|
434
|
+
};
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/version/infer.d.ts
|
|
437
|
+
export type BumpLevel = "major" | "minor" | "patch";
|
|
438
|
+
export interface InferResult {
|
|
439
|
+
level: BumpLevel;
|
|
440
|
+
/** 展示用判定说明(中文,CLI 直接输出) */
|
|
441
|
+
reason: string;
|
|
442
|
+
total: number;
|
|
443
|
+
breaking: number;
|
|
444
|
+
feat: number;
|
|
445
|
+
fix: number;
|
|
446
|
+
}
|
|
447
|
+
/** conventional commits → bump level:BREAKING > feat(minor) > fix(patch);无可识别提交 → patch */
|
|
448
|
+
export declare function inferBumpLevel(messages: string[]): InferResult;
|
|
449
|
+
export interface DecideOptions {
|
|
450
|
+
/** 显式 level:major | minor | patch | prerelease */
|
|
451
|
+
level?: string;
|
|
452
|
+
/** prerelease 标识(beta | rc…),与 level 组合或延续当前 */
|
|
453
|
+
pre?: string;
|
|
454
|
+
}
|
|
455
|
+
export interface DecideResult {
|
|
456
|
+
/** 完整 semver(可含 prerelease,tag 与 changelog 用) */
|
|
457
|
+
next: string;
|
|
458
|
+
/** 判定说明 */
|
|
459
|
+
reason: string;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* 从当前版本决定下一版本(纯函数)。
|
|
463
|
+
* - 显式 level:semver.inc;当前是 prerelease 且不带 --pre → 剥离转正式(4.0.0-beta.3 + patch → 4.0.0)
|
|
464
|
+
* - 无 level:用 infer 结果
|
|
465
|
+
* - prerelease level:当前有 pre → 同基线递进(beta.3 → beta.4);无 pre → 报错(应使用 --pre 进入)
|
|
466
|
+
* - --pre:从 level 出发挂 prerelease(4.0.0 + minor + beta → 4.1.0-beta.1)
|
|
467
|
+
* current 非 semver 时抛错(调用方要求显式指定或先手动规范化)。
|
|
468
|
+
*/
|
|
469
|
+
export declare function decideNextVersion(current: string, opts: DecideOptions, infer?: InferResult): DecideResult;
|
|
470
|
+
/** 工程文件写入用的三段数字 versionName(prerelease 只留在 tag,不进商店) */
|
|
471
|
+
export declare function storeVersionName(full: string): string;
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/version/bump.d.ts
|
|
474
|
+
export interface BumpOptions {
|
|
475
|
+
cwd: string;
|
|
476
|
+
framework: FrameworkAdapter | null;
|
|
477
|
+
/** major | minor | patch | prerelease | <semver>;缺省走推断 */
|
|
478
|
+
level?: string;
|
|
479
|
+
/** prerelease 标识(beta | rc…) */
|
|
480
|
+
pre?: string;
|
|
481
|
+
versionCode?: VersionCodeConfig;
|
|
482
|
+
/** 仅限端(缺省全端);平台名 = android/ios/harmony/flutter/js/tauri/expo */
|
|
483
|
+
platforms?: string[];
|
|
484
|
+
}
|
|
485
|
+
export interface BumpPlan {
|
|
486
|
+
anchorTag?: string;
|
|
487
|
+
/** 疑似失败重跑(HEAD 是 release commit 且锚点后无新业务提交)——CLI 在 --yes 且无显式 level 时拒绝 */
|
|
488
|
+
suspectRerun?: boolean;
|
|
489
|
+
/** 基线版本(多端中最大 semver) */
|
|
490
|
+
base: string;
|
|
491
|
+
currentVersions: PlatformVersionInfo[];
|
|
492
|
+
/** 完整 semver(tag/changelog 用,可含 prerelease) */
|
|
493
|
+
nextVersion: string;
|
|
494
|
+
/** 商店 versionName(三段数字,工程文件用) */
|
|
495
|
+
storeName: string;
|
|
496
|
+
reason: string;
|
|
497
|
+
infer?: InferResult;
|
|
498
|
+
commits: string[];
|
|
499
|
+
writes: VersionWrite[];
|
|
500
|
+
versionCodeNote: string;
|
|
501
|
+
}
|
|
502
|
+
export declare function planBump(opts: BumpOptions): BumpPlan;
|
|
503
|
+
export interface ApplyOptions {
|
|
504
|
+
/** 代 commit(默认 true;--no-commit 跳过) */
|
|
505
|
+
commit: boolean;
|
|
506
|
+
/** 代打 tag(默认 true;--no-tag 跳过) */
|
|
507
|
+
tag: boolean;
|
|
508
|
+
}
|
|
509
|
+
export interface ApplyResult {
|
|
510
|
+
changedFiles: string[];
|
|
511
|
+
skipped: Array<{
|
|
512
|
+
platform: string;
|
|
513
|
+
reason: string;
|
|
514
|
+
}>;
|
|
515
|
+
changelogFile?: string;
|
|
516
|
+
committed: boolean;
|
|
517
|
+
tagged: boolean;
|
|
518
|
+
/** commit/tag 失败原因(降级不阻断:文件已写好,提示用户手动收尾) */
|
|
519
|
+
warnings: string[];
|
|
520
|
+
}
|
|
521
|
+
export declare function applyBump(cwd: string, plan: BumpPlan, framework: FrameworkAdapter | null, opts: ApplyOptions): ApplyResult;
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/version/version-code.d.ts
|
|
524
|
+
/**
|
|
525
|
+
* versionCode 计算:默认递增 +1;可配公式(如 major*1000000+minor*1000+patch)。
|
|
526
|
+
* 实际写入 = max(公式值, 现值+1)——公式在同 versionName 重发时算出同值,
|
|
527
|
+
* +1 兜底保证单调(AGC 同版本不能重复提交 / Google Play 单调 / App Store 单调)。
|
|
528
|
+
*/
|
|
529
|
+
/** 公式白名单求值(仅支持 + - * ( ) 数字 与 major/minor/patch 变量;不 eval) */
|
|
530
|
+
export declare function evalVersionCodeFormula(formula: string, v: {
|
|
531
|
+
major: number;
|
|
532
|
+
minor: number;
|
|
533
|
+
patch: number;
|
|
534
|
+
}): number | undefined;
|
|
535
|
+
/**
|
|
536
|
+
* 下一 versionCode:max(公式值, 现值+1)。
|
|
537
|
+
* - 无现值(首接工程无该字段):公式值,否则 1
|
|
538
|
+
* - 有现值:至少现值+1(吞 3052/4000000 等任意历史值,首次 bump 即归一)
|
|
539
|
+
*/
|
|
540
|
+
export declare function nextVersionCode(current: number | undefined, formulaValue: number | undefined): number;
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region src/version/changelog.d.ts
|
|
543
|
+
export interface ChangelogEntry {
|
|
544
|
+
type: string;
|
|
545
|
+
scope?: string;
|
|
546
|
+
subject: string;
|
|
547
|
+
breaking: boolean;
|
|
548
|
+
hash?: string;
|
|
549
|
+
}
|
|
550
|
+
/** raw commit messages → 结构化条目(feat/fix/BREAKING 之外的 type 也保留,渲染时归类) */
|
|
551
|
+
export declare function toChangelogEntries(messages: string[]): ChangelogEntry[];
|
|
552
|
+
/** 渲染单个版本段落(## [4.1.0] - 2026-10-17) */
|
|
553
|
+
export declare function renderChangelogSection(version: string, date: string, entries: ChangelogEntry[]): string;
|
|
554
|
+
/**
|
|
555
|
+
* 插入/替换 CHANGELOG.md 的版本段落(幂等):
|
|
556
|
+
* - 已有 `## [version]` → 整段替换为最新渲染
|
|
557
|
+
* - 否则插到首个 # Changelog 标题之后;无标题/无文件 → 新建带标题
|
|
558
|
+
* 返回写入路径;entries 为空也写入 heading(bump 闭环保持 tag ↔ changelog 对齐)。
|
|
559
|
+
*/
|
|
560
|
+
export declare function upsertChangelog(cwd: string, version: string, section: string): string;
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/version/git.d.ts
|
|
563
|
+
export interface GitResult {
|
|
564
|
+
ok: boolean;
|
|
565
|
+
stdout: string;
|
|
566
|
+
stderr: string;
|
|
567
|
+
}
|
|
568
|
+
export declare function git(cwd: string, args: string[]): GitResult;
|
|
569
|
+
export declare function isGitRepo(cwd: string): boolean;
|
|
570
|
+
/** 宽松 semver 解析(可选 v/前缀,如 v4.1.0 / 4.1.0-beta.3 / release-4.1.0 里取 semver 部分) */
|
|
571
|
+
export declare function looseSemver(tag: string): string | undefined;
|
|
572
|
+
/**
|
|
573
|
+
* 最新 semver tag(按版本序取最大,非创建时间——修复补打旧版本 tag 的场景更稳)。
|
|
574
|
+
* 无 tag / 非 git 仓库返回 undefined。
|
|
575
|
+
*/
|
|
576
|
+
export declare function latestSemverTag(cwd: string): string | undefined;
|
|
577
|
+
/** 锚点 tag..HEAD 的完整 commit messages(%B 含 footer,NUL 分隔——body 内建换行安全) */
|
|
578
|
+
export declare function commitsSince(cwd: string, ref?: string): string[];
|
|
579
|
+
/** 工作区状态(--porcelain)。注意:不走通用 git()——其 stdout.trim() 会剥掉首行前导空格,
|
|
580
|
+
* 破坏 porcelain 的两列状态位(" M file" → "M file"),此处保留原始行仅去行尾。 */
|
|
581
|
+
export declare function statusShort(cwd: string): string[];
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region src/version/artifact.d.ts
|
|
406
584
|
export interface ArtifactVersion {
|
|
407
585
|
versionName?: string;
|
|
408
586
|
versionCode?: string;
|
|
@@ -411,4 +589,4 @@ export interface ArtifactVersion {
|
|
|
411
589
|
}
|
|
412
590
|
export declare function readArtifactVersion(artifactPath: string): ArtifactVersion | undefined;
|
|
413
591
|
//#endregion
|
|
414
|
-
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, QypubPlugin, QypubUserConfig, ReleasePlanEntry, ReviewStatus, StageResult, StoreConfig, StoreConfigSchema, Stores, StoresSchema, SubmitResult, appendEntry, defineConfig, detectBundleIds, detectFramework, electronAdapter, findArtifacts, flutterAdapter, nativeAndroidAdapter, nativeHarmonyAdapter, nativeIosAdapter, readEntries, resolvePlugins, rnAdapter, runStage, runSubmit, tauriAdapter };
|
|
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, QypubPlugin, QypubUserConfig, ReleaseConfig, ReleaseConfigSchema, ReleasePlanEntry, ReviewStatus, StageResult, StoreConfig, StoreConfigSchema, Stores, StoresSchema, SubmitResult, VersionCodeConfig, VersionCodeConfigSchema, VersionConfig, VersionConfigSchema, appendEntry, defineConfig, detectBundleIds, detectFramework, electronAdapter, findArtifacts, flutterAdapter, nativeAndroidAdapter, nativeHarmonyAdapter, nativeIosAdapter, readEntries, resolvePlugins, rnAdapter, runStage, runSubmit, tauriAdapter };
|