@longzai-intelligence-dependencies/repository-plugin 0.0.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/README.md +27 -0
- package/dist/index.d.ts +579 -0
- package/dist/index.js +8 -0
- package/dist/rolldown-runtime-BqT_7tdF.js +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @longzai-intelligence-dependencies/repository-plugin
|
|
2
|
+
|
|
3
|
+
Longzai Intelligence 依赖升级流仓插件:命令贡献 `dependencies:upgrade`。
|
|
4
|
+
|
|
5
|
+
## 能力
|
|
6
|
+
|
|
7
|
+
在目标仓呈现可升级清单(依赖名、当前版本、目标版本、所属依赖段与差异级别),交互勾选或全量执行升级写入;升级后经目标仓 root script 执行 `version:check` 一致性复核并入报告,`--sync` 时读目标仓根 `package.json` 当前版本执行 `version:sync` 写回;结束时提示衔接发版准备流。
|
|
8
|
+
|
|
9
|
+
## 命令
|
|
10
|
+
|
|
11
|
+
`dependencies:upgrade [mode] [--write] [--dry-run] [--sync] [--repo <repo>]`
|
|
12
|
+
|
|
13
|
+
- mode 透传六枚举:default/major/minor/patch/latest/newest,缺省 default
|
|
14
|
+
- `--dry-run` 只读预览零写入;`--write` 全量执行(跳过勾选,仍需写前确认)
|
|
15
|
+
- 非交互环境写路径回退拒绝(零意外写入)
|
|
16
|
+
|
|
17
|
+
## 契约
|
|
18
|
+
|
|
19
|
+
- manifest 能力:`spawn` 与 `network` 必需,`network` 可降级(引擎 30 分钟 TTL 磁盘缓存即降级形态)
|
|
20
|
+
- 结果:core 报告模型 `PluginCommandResult`(report 为逐包升级结果与复核写回项,data 为结构化升级清单,见 `DependenciesUpgradeDataSchema`)
|
|
21
|
+
- UI 槽位:`workbench-page`(依赖升级面板)与 `action-entry`(仓库详情页检查依赖升级动作)为 M3 期契约面
|
|
22
|
+
|
|
23
|
+
## 治理
|
|
24
|
+
|
|
25
|
+
- 门禁:`bun run lint`、`bun run typecheck`、`bun test`
|
|
26
|
+
- changelog 仅经 `bun run changelog:add`
|
|
27
|
+
- 版本发布留用户执行
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
import { CheckEventCallbacks, CheckOptions, CheckOptions as CheckOptions$1, DepType, DiffType, PackageMeta, PackageMeta as PackageMeta$1, RangeMode } from "@longzai-intelligence-dependencies/version-upgrade";
|
|
4
|
+
import { CheckReportItem, PluginCommandResult, PluginContext } from "@longzai-intelligence-plugin/core";
|
|
5
|
+
import { VersionUpgradeConfig } from "@longzai-intelligence-dependencies/core";
|
|
6
|
+
//#region src/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* 子进程执行入参(结构同构 kit 的 `ExecSpec`)
|
|
9
|
+
*/
|
|
10
|
+
type DependenciesExecSpec = {
|
|
11
|
+
/**
|
|
12
|
+
* 命令名(如 `bun`)
|
|
13
|
+
*/
|
|
14
|
+
command: string;
|
|
15
|
+
/**
|
|
16
|
+
* 参数数组
|
|
17
|
+
*/
|
|
18
|
+
args: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* 工作目录(通常为目标仓根)
|
|
21
|
+
*/
|
|
22
|
+
cwd: string;
|
|
23
|
+
/**
|
|
24
|
+
* 超时毫秒数
|
|
25
|
+
*/
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 子进程执行产物(结构同构 kit 的 `ExecOutcome`)
|
|
30
|
+
*/
|
|
31
|
+
type DependenciesExecOutcome = {
|
|
32
|
+
/**
|
|
33
|
+
* 退出码(超时被杀为非零)
|
|
34
|
+
*/
|
|
35
|
+
code: number;
|
|
36
|
+
/**
|
|
37
|
+
* 耗时毫秒数
|
|
38
|
+
*/
|
|
39
|
+
durationMs: number;
|
|
40
|
+
/**
|
|
41
|
+
* 标准输出尾部摘录
|
|
42
|
+
*/
|
|
43
|
+
stdoutExcerpt: string;
|
|
44
|
+
/**
|
|
45
|
+
* 标准错误尾部摘录
|
|
46
|
+
*/
|
|
47
|
+
stderrExcerpt: string;
|
|
48
|
+
/**
|
|
49
|
+
* 是否因超时被终止
|
|
50
|
+
*/
|
|
51
|
+
timedOut: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 子进程执行服务端口(宿主注入,结构同构 kit 的 `ExecService`)
|
|
55
|
+
*/
|
|
56
|
+
type DependenciesExecService = {
|
|
57
|
+
/**
|
|
58
|
+
* 同步执行一条命令
|
|
59
|
+
*
|
|
60
|
+
* @param spec - 执行入参
|
|
61
|
+
* @returns 执行产物
|
|
62
|
+
*/
|
|
63
|
+
run(spec: DependenciesExecSpec): DependenciesExecOutcome;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* 宿主服务集合(载运能力件命令 handler 的 services 面)
|
|
67
|
+
*/
|
|
68
|
+
type DependenciesHostServices = {
|
|
69
|
+
/**
|
|
70
|
+
* 子进程执行服务
|
|
71
|
+
*/
|
|
72
|
+
exec: DependenciesExecService;
|
|
73
|
+
/**
|
|
74
|
+
* 升级引擎端口(可选注入,缺省绑定本仓 version-upgrade 真实现;测试注入 fake)
|
|
75
|
+
*/
|
|
76
|
+
engine?: DependenciesEnginePort;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* 升级引擎端口(缺省绑定真引擎,测试注入 fake)
|
|
80
|
+
*/
|
|
81
|
+
type DependenciesEnginePort = {
|
|
82
|
+
/**
|
|
83
|
+
* 批量检查依赖更新
|
|
84
|
+
*
|
|
85
|
+
* @param options - 检查配置选项
|
|
86
|
+
* @param callbacks - 事件回调集合
|
|
87
|
+
* @returns 包含所有包信息的对象
|
|
88
|
+
*/
|
|
89
|
+
checkPackages(options: CheckOptions$1, callbacks?: CheckEventCallbacks): Promise<{
|
|
90
|
+
packages: PackageMeta$1[];
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* 将解析后的依赖变更写回包清单文件
|
|
94
|
+
*
|
|
95
|
+
* @param pkg - 包元信息
|
|
96
|
+
* @param options - 通用配置选项
|
|
97
|
+
*/
|
|
98
|
+
writePackage(pkg: PackageMeta$1, options: CheckOptions$1): Promise<void>;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* 升级清单条目(呈现与勾选的最小单元)
|
|
102
|
+
*/
|
|
103
|
+
type DependenciesChecklistEntry = {
|
|
104
|
+
/**
|
|
105
|
+
* 勾选键(包名、依赖名与依赖段的复合键,列表内唯一)
|
|
106
|
+
*/
|
|
107
|
+
key: string;
|
|
108
|
+
/**
|
|
109
|
+
* 所属包名
|
|
110
|
+
*/
|
|
111
|
+
packageName: string;
|
|
112
|
+
/**
|
|
113
|
+
* 依赖名
|
|
114
|
+
*/
|
|
115
|
+
name: string;
|
|
116
|
+
/**
|
|
117
|
+
* 当前版本
|
|
118
|
+
*/
|
|
119
|
+
currentVersion: string;
|
|
120
|
+
/**
|
|
121
|
+
* 目标版本
|
|
122
|
+
*/
|
|
123
|
+
targetVersion: string;
|
|
124
|
+
/**
|
|
125
|
+
* 所属依赖段(dependencies、devDependencies 等)
|
|
126
|
+
*/
|
|
127
|
+
source: DepType;
|
|
128
|
+
/**
|
|
129
|
+
* 版本差异级别(major、minor、patch)
|
|
130
|
+
*/
|
|
131
|
+
diff: DiffType;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* 依赖解析失败统计(引擎 resolve 后仍无目标版本的条目)
|
|
135
|
+
*/
|
|
136
|
+
type DependenciesResolveFailure = {
|
|
137
|
+
/**
|
|
138
|
+
* 所属包名
|
|
139
|
+
*/
|
|
140
|
+
packageName: string;
|
|
141
|
+
/**
|
|
142
|
+
* 依赖名
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
/**
|
|
146
|
+
* 失败原因文本
|
|
147
|
+
*/
|
|
148
|
+
reason: string;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* version 一致性复核结果
|
|
152
|
+
*/
|
|
153
|
+
type DependenciesVersionCheckOutcome = {
|
|
154
|
+
/**
|
|
155
|
+
* 复核结论(脚本缺失记 skip,一致记 pass,不一致或执行失败记 fail)
|
|
156
|
+
*/
|
|
157
|
+
status: 'pass' | 'fail' | 'skip';
|
|
158
|
+
/**
|
|
159
|
+
* 一句话结论(并入报告项的 detail)
|
|
160
|
+
*/
|
|
161
|
+
summary: string;
|
|
162
|
+
/**
|
|
163
|
+
* 命令输出摘录(失败排查用)
|
|
164
|
+
*/
|
|
165
|
+
outputExcerpt?: string;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* version 写回结果
|
|
169
|
+
*/
|
|
170
|
+
type DependenciesVersionSyncOutcome = {
|
|
171
|
+
/**
|
|
172
|
+
* 写回结论(版本缺失或脚本缺失记 skip,成功记 pass,失败记 fail)
|
|
173
|
+
*/
|
|
174
|
+
status: 'pass' | 'fail' | 'skip';
|
|
175
|
+
/**
|
|
176
|
+
* 一句话结论
|
|
177
|
+
*/
|
|
178
|
+
summary: string;
|
|
179
|
+
/**
|
|
180
|
+
* 命令输出摘录
|
|
181
|
+
*/
|
|
182
|
+
outputExcerpt?: string;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* 命令结果 data 形态(宿主结果校验与 M3 期 UI 消费)
|
|
186
|
+
*/
|
|
187
|
+
type DependenciesUpgradeData = {
|
|
188
|
+
/**
|
|
189
|
+
* 生效的升级模式
|
|
190
|
+
*/
|
|
191
|
+
mode: RangeMode;
|
|
192
|
+
/**
|
|
193
|
+
* 可升级清单
|
|
194
|
+
*/
|
|
195
|
+
checklist: readonly DependenciesChecklistEntry[];
|
|
196
|
+
/**
|
|
197
|
+
* 勾选执行条目键集(dry-run 与取消形态为实际选中面)
|
|
198
|
+
*/
|
|
199
|
+
selected: readonly string[];
|
|
200
|
+
/**
|
|
201
|
+
* 已写入的包名列表
|
|
202
|
+
*/
|
|
203
|
+
writtenPackages: readonly string[];
|
|
204
|
+
/**
|
|
205
|
+
* version 一致性复核结果(未执行为 null)
|
|
206
|
+
*/
|
|
207
|
+
versionCheck: DependenciesVersionCheckOutcome | null;
|
|
208
|
+
/**
|
|
209
|
+
* version 写回结果(未执行为 null)
|
|
210
|
+
*/
|
|
211
|
+
versionSync: DependenciesVersionSyncOutcome | null;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* 命令 handler 入参(载运能力件命令 handler 结构)
|
|
215
|
+
*/
|
|
216
|
+
type DependenciesUpgradeHandlerInput = {
|
|
217
|
+
/**
|
|
218
|
+
* 校验后的选项对象(write、dryRun、sync、repo 经 optionsSchema 归一)
|
|
219
|
+
*/
|
|
220
|
+
readonly opts: Record<string, unknown>;
|
|
221
|
+
/**
|
|
222
|
+
* 位置参数数组(第一位为 mode)
|
|
223
|
+
*/
|
|
224
|
+
readonly positionals: readonly string[];
|
|
225
|
+
/**
|
|
226
|
+
* 目标仓根绝对路径(宿主解析产物)
|
|
227
|
+
*/
|
|
228
|
+
readonly repoRoot: string;
|
|
229
|
+
/**
|
|
230
|
+
* 宿主服务集合
|
|
231
|
+
*/
|
|
232
|
+
readonly services: DependenciesHostServices;
|
|
233
|
+
};
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/upgrade.command.d.ts
|
|
236
|
+
/**
|
|
237
|
+
* `dependencies:upgrade` 命令 handler
|
|
238
|
+
*
|
|
239
|
+
* @param input - handler 入参(opts、positionals、repoRoot、services)
|
|
240
|
+
* @returns core 报告模型的命令结果
|
|
241
|
+
*/
|
|
242
|
+
declare function dependenciesUpgradeCommand(input: DependenciesUpgradeHandlerInput): Promise<PluginCommandResult>;
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/dependencies-repository-plugin.plugin.d.ts
|
|
245
|
+
/**
|
|
246
|
+
* dependencies 仓级插件模块
|
|
247
|
+
*/
|
|
248
|
+
declare const dependenciesRepositoryPluginModule: {
|
|
249
|
+
/**
|
|
250
|
+
* 插件 manifest(core 契约输入态)
|
|
251
|
+
*/
|
|
252
|
+
manifest: {
|
|
253
|
+
id: string;
|
|
254
|
+
version: string;
|
|
255
|
+
display: string;
|
|
256
|
+
engine: string;
|
|
257
|
+
engines: {
|
|
258
|
+
cli: string;
|
|
259
|
+
};
|
|
260
|
+
capabilities: string[];
|
|
261
|
+
negotiation: {
|
|
262
|
+
degradable: string[];
|
|
263
|
+
};
|
|
264
|
+
permissions: {
|
|
265
|
+
fs: string;
|
|
266
|
+
};
|
|
267
|
+
entry: {
|
|
268
|
+
cli: string;
|
|
269
|
+
};
|
|
270
|
+
contributions: {
|
|
271
|
+
commands: {
|
|
272
|
+
id: string;
|
|
273
|
+
title: string;
|
|
274
|
+
invocation: string;
|
|
275
|
+
description: string;
|
|
276
|
+
arguments: {
|
|
277
|
+
signature: string;
|
|
278
|
+
description: string;
|
|
279
|
+
}[];
|
|
280
|
+
options: {
|
|
281
|
+
flags: string;
|
|
282
|
+
description: string;
|
|
283
|
+
}[];
|
|
284
|
+
optionsSchema: z.ZodObject<{
|
|
285
|
+
write: z.ZodDefault<z.ZodBoolean>;
|
|
286
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
287
|
+
sync: z.ZodDefault<z.ZodBoolean>;
|
|
288
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
289
|
+
}, z.core.$loose>;
|
|
290
|
+
keywords: string[];
|
|
291
|
+
}[];
|
|
292
|
+
ui: ({
|
|
293
|
+
slot: string;
|
|
294
|
+
component: string;
|
|
295
|
+
route: string;
|
|
296
|
+
title: string;
|
|
297
|
+
commandId?: undefined;
|
|
298
|
+
} | {
|
|
299
|
+
route?: undefined;
|
|
300
|
+
slot: string;
|
|
301
|
+
component: string;
|
|
302
|
+
commandId: string;
|
|
303
|
+
title: string;
|
|
304
|
+
})[];
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* 装载函数(命令面物化——handler 映射键命中 manifest 命令贡献点 id)
|
|
309
|
+
*
|
|
310
|
+
* @param _context - 载运插件上下文(本插件无上下文依赖,可选收受、命名弃用声明)
|
|
311
|
+
* @returns 命令 handler 映射产物
|
|
312
|
+
*/
|
|
313
|
+
load(_context?: PluginContext): {
|
|
314
|
+
commands: Map<string, typeof dependenciesUpgradeCommand>;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/checklist.utils.d.ts
|
|
319
|
+
/**
|
|
320
|
+
* 清单构建产物(可升级清单与解析失败统计)
|
|
321
|
+
*/
|
|
322
|
+
type ChecklistBuildResult = {
|
|
323
|
+
/**
|
|
324
|
+
* 可升级清单条目
|
|
325
|
+
*/
|
|
326
|
+
checklist: DependenciesChecklistEntry[];
|
|
327
|
+
/**
|
|
328
|
+
* 解析失败统计(引擎 resolve 后仍无目标版本的条目)
|
|
329
|
+
*/
|
|
330
|
+
resolveFailures: DependenciesResolveFailure[];
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* 从引擎检查产物构建可升级清单与解析失败统计
|
|
334
|
+
*
|
|
335
|
+
* @param packages - 引擎 `CheckPackages` 返回的包列表
|
|
336
|
+
* @returns 清单条目数组与解析失败统计
|
|
337
|
+
*/
|
|
338
|
+
declare function buildChecklist(packages: readonly PackageMeta[]): ChecklistBuildResult;
|
|
339
|
+
/**
|
|
340
|
+
* 把勾选子集应用回引擎包产物(未勾选条目 update 置假)并返回被触达的包
|
|
341
|
+
*
|
|
342
|
+
* @param packages - 引擎 `CheckPackages` 返回的包列表(将被就地改写)
|
|
343
|
+
* @param selectedKeys - 勾选条目键集
|
|
344
|
+
* @returns 含勾选条目的包列表(仅这些包需要写入)
|
|
345
|
+
*/
|
|
346
|
+
declare function applySelectionToPackages(packages: readonly PackageMeta[], selectedKeys: ReadonlySet<string>): PackageMeta[];
|
|
347
|
+
/**
|
|
348
|
+
* 渲染清单条目的单行展示文本
|
|
349
|
+
*
|
|
350
|
+
* @param entry - 清单条目
|
|
351
|
+
* @returns 展示文本(依赖名、当前版本到目标版本、依赖段与差异级别)
|
|
352
|
+
*/
|
|
353
|
+
declare function formatChecklistEntry(entry: DependenciesChecklistEntry): string;
|
|
354
|
+
/**
|
|
355
|
+
* 逐包写入勾选子集(写入前须已完成 applySelectionToPackages 的标志改写)
|
|
356
|
+
*
|
|
357
|
+
* @param engine - 升级引擎端口
|
|
358
|
+
* @param touchedPackages - 含勾选条目的包列表
|
|
359
|
+
* @param options - 引擎检查选项(depFields 等写入过滤面沿用检查时配置)
|
|
360
|
+
* @returns 已写入的包名列表与逐包失败信息
|
|
361
|
+
*/
|
|
362
|
+
declare function writeSelectedPackages(engine: DependenciesEnginePort, touchedPackages: readonly PackageMeta[], options: CheckOptions): Promise<{
|
|
363
|
+
/**
|
|
364
|
+
* 已写入的包名列表
|
|
365
|
+
*/
|
|
366
|
+
writtenPackages: string[];
|
|
367
|
+
/**
|
|
368
|
+
* 逐包失败信息(包名到原因文本)
|
|
369
|
+
*/
|
|
370
|
+
failures: {
|
|
371
|
+
packageName: string;
|
|
372
|
+
reason: string;
|
|
373
|
+
}[];
|
|
374
|
+
}>;
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/interactive/multiselect.utils.d.ts
|
|
377
|
+
/**
|
|
378
|
+
* 终端多选组件(IO 注入式)
|
|
379
|
+
*
|
|
380
|
+
* 支持 j/k 或方向键移动、空格切换勾选、a 全选切换、回车确认、q 或 Esc 取消。
|
|
381
|
+
* 输入输出经入参注入(stdin/stdout 均为流接口),核心逻辑可在测试中以 fake IO 驱动;
|
|
382
|
+
* 输入流不可设 raw mode 时按全选直接确认(调用方仍须自行做写前确认)。
|
|
383
|
+
*/
|
|
384
|
+
/**
|
|
385
|
+
* 多选组件 IO 面
|
|
386
|
+
*/
|
|
387
|
+
type MultiselectIo = {
|
|
388
|
+
/**
|
|
389
|
+
* 输入流(须支持 raw mode 切换)
|
|
390
|
+
*/
|
|
391
|
+
stdin: NodeJS.ReadableStream & {
|
|
392
|
+
setRawMode?(mode: boolean): void;
|
|
393
|
+
isTTY?: boolean;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* 输出流(渲染目标)
|
|
397
|
+
*/
|
|
398
|
+
stdout: NodeJS.WritableStream;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* 呈现多选清单并等待用户勾选
|
|
402
|
+
*
|
|
403
|
+
* @param labels - 条目展示文本列表
|
|
404
|
+
* @param io - IO 面
|
|
405
|
+
* @returns 选中条目的下标数组;用户取消或无法进入 raw mode 时返回 null(调用方以零写收场)
|
|
406
|
+
*/
|
|
407
|
+
declare function multiselectEntries(labels: readonly string[], io: MultiselectIo): Promise<readonly number[] | null>;
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/interactive/tty.utils.d.ts
|
|
410
|
+
/**
|
|
411
|
+
* TTY 交互环境检测
|
|
412
|
+
*/
|
|
413
|
+
/**
|
|
414
|
+
* 检测当前标准输入是否为交互终端
|
|
415
|
+
*
|
|
416
|
+
* @returns 是否为 TTY(非 TTY 环境下写路径调用方须回退拒写)
|
|
417
|
+
*/
|
|
418
|
+
declare function isInteractiveTty(): boolean;
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/result-model.schema.d.ts
|
|
421
|
+
/**
|
|
422
|
+
* 升级清单条目 schema
|
|
423
|
+
*/
|
|
424
|
+
declare const DependenciesChecklistEntrySchema: z.ZodObject<{
|
|
425
|
+
key: z.ZodString;
|
|
426
|
+
packageName: z.ZodString;
|
|
427
|
+
name: z.ZodString;
|
|
428
|
+
currentVersion: z.ZodString;
|
|
429
|
+
targetVersion: z.ZodString;
|
|
430
|
+
source: z.ZodString;
|
|
431
|
+
diff: z.ZodNullable<z.ZodEnum<{
|
|
432
|
+
error: "error";
|
|
433
|
+
major: "major";
|
|
434
|
+
minor: "minor";
|
|
435
|
+
patch: "patch";
|
|
436
|
+
}>>;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
/**
|
|
439
|
+
* 命令结果 data schema
|
|
440
|
+
*/
|
|
441
|
+
declare const DependenciesUpgradeDataSchema: z.ZodObject<{
|
|
442
|
+
mode: z.ZodEnum<{
|
|
443
|
+
default: "default";
|
|
444
|
+
latest: "latest";
|
|
445
|
+
major: "major";
|
|
446
|
+
minor: "minor";
|
|
447
|
+
newest: "newest";
|
|
448
|
+
patch: "patch";
|
|
449
|
+
}>;
|
|
450
|
+
checklist: z.ZodArray<z.ZodObject<{
|
|
451
|
+
key: z.ZodString;
|
|
452
|
+
packageName: z.ZodString;
|
|
453
|
+
name: z.ZodString;
|
|
454
|
+
currentVersion: z.ZodString;
|
|
455
|
+
targetVersion: z.ZodString;
|
|
456
|
+
source: z.ZodString;
|
|
457
|
+
diff: z.ZodNullable<z.ZodEnum<{
|
|
458
|
+
error: "error";
|
|
459
|
+
major: "major";
|
|
460
|
+
minor: "minor";
|
|
461
|
+
patch: "patch";
|
|
462
|
+
}>>;
|
|
463
|
+
}, z.core.$strip>>;
|
|
464
|
+
selected: z.ZodArray<z.ZodString>;
|
|
465
|
+
writtenPackages: z.ZodArray<z.ZodString>;
|
|
466
|
+
versionCheck: z.ZodNullable<z.ZodObject<{
|
|
467
|
+
status: z.ZodEnum<{
|
|
468
|
+
fail: "fail";
|
|
469
|
+
pass: "pass";
|
|
470
|
+
skip: "skip";
|
|
471
|
+
}>;
|
|
472
|
+
summary: z.ZodString;
|
|
473
|
+
outputExcerpt: z.ZodOptional<z.ZodString>;
|
|
474
|
+
}, z.core.$strip>>;
|
|
475
|
+
versionSync: z.ZodNullable<z.ZodObject<{
|
|
476
|
+
status: z.ZodEnum<{
|
|
477
|
+
fail: "fail";
|
|
478
|
+
pass: "pass";
|
|
479
|
+
skip: "skip";
|
|
480
|
+
}>;
|
|
481
|
+
summary: z.ZodString;
|
|
482
|
+
outputExcerpt: z.ZodOptional<z.ZodString>;
|
|
483
|
+
}, z.core.$strip>>;
|
|
484
|
+
}, z.core.$strip>;
|
|
485
|
+
/**
|
|
486
|
+
* 命令结果构造入参
|
|
487
|
+
*/
|
|
488
|
+
type BuildDependenciesUpgradeResultInput = {
|
|
489
|
+
/**
|
|
490
|
+
* 生效的升级模式
|
|
491
|
+
*/
|
|
492
|
+
mode: 'default' | 'major' | 'minor' | 'patch' | 'latest' | 'newest';
|
|
493
|
+
/**
|
|
494
|
+
* 可升级清单
|
|
495
|
+
*/
|
|
496
|
+
checklist: readonly DependenciesChecklistEntry[];
|
|
497
|
+
/**
|
|
498
|
+
* 勾选执行条目键集
|
|
499
|
+
*/
|
|
500
|
+
selected: readonly string[];
|
|
501
|
+
/**
|
|
502
|
+
* 检查报告项列表(逐包升级结果、复核与写回项的并集,顺序即展示顺序)
|
|
503
|
+
*/
|
|
504
|
+
items: readonly CheckReportItem[];
|
|
505
|
+
/**
|
|
506
|
+
* version 一致性复核结果(未执行为 null)
|
|
507
|
+
*/
|
|
508
|
+
versionCheck: DependenciesVersionCheckOutcome | null;
|
|
509
|
+
/**
|
|
510
|
+
* version 写回结果(未执行为 null)
|
|
511
|
+
*/
|
|
512
|
+
versionSync: DependenciesVersionSyncOutcome | null;
|
|
513
|
+
/**
|
|
514
|
+
* 结果摘要(一句话)
|
|
515
|
+
*/
|
|
516
|
+
summary: string;
|
|
517
|
+
/**
|
|
518
|
+
* 结果状态(命令执行三态)
|
|
519
|
+
*/
|
|
520
|
+
status: 'ok' | 'warn' | 'fail';
|
|
521
|
+
/**
|
|
522
|
+
* 已写入的包名列表
|
|
523
|
+
*/
|
|
524
|
+
writtenPackages: readonly string[];
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* 构造依赖升级命令结果
|
|
528
|
+
*
|
|
529
|
+
* @param input - 构造入参
|
|
530
|
+
* @returns core 报告模型的 `PluginCommandResult`
|
|
531
|
+
*/
|
|
532
|
+
declare function buildDependenciesUpgradeResult(input: BuildDependenciesUpgradeResultInput): PluginCommandResult;
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/target-config.loader.d.ts
|
|
535
|
+
/**
|
|
536
|
+
* 装载目标仓的依赖版本升级配置
|
|
537
|
+
*
|
|
538
|
+
* @param repoRoot - 目标仓根绝对路径(配置查找起点)
|
|
539
|
+
* @returns 版本升级域配置(配置缺失时为空对象,走引擎默认值)
|
|
540
|
+
*/
|
|
541
|
+
declare function loadTargetVersionUpgradeConfig(repoRoot: string): Promise<VersionUpgradeConfig>;
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/version-check.utils.d.ts
|
|
544
|
+
/**
|
|
545
|
+
* 探测目标仓是否存在指定 root script
|
|
546
|
+
*
|
|
547
|
+
* @param repoRoot - 目标仓根绝对路径
|
|
548
|
+
* @param scriptName - 脚本名
|
|
549
|
+
* @returns 是否存在
|
|
550
|
+
*/
|
|
551
|
+
declare function probeRootScript(repoRoot: string, scriptName: string): Promise<boolean>;
|
|
552
|
+
/**
|
|
553
|
+
* 执行目标仓的 version 一致性复核
|
|
554
|
+
*
|
|
555
|
+
* @param services - 宿主服务集合
|
|
556
|
+
* @param repoRoot - 目标仓根绝对路径
|
|
557
|
+
* @returns 复核结果(脚本缺失记 skip)
|
|
558
|
+
*/
|
|
559
|
+
declare function runVersionCheck(services: DependenciesHostServices, repoRoot: string): Promise<DependenciesVersionCheckOutcome>;
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/version-sync.utils.d.ts
|
|
562
|
+
/**
|
|
563
|
+
* 读取目标仓根 package.json 的当前版本号
|
|
564
|
+
*
|
|
565
|
+
* @param repoRoot - 目标仓根绝对路径
|
|
566
|
+
* @returns 版本号字符串(字段缺失或读取失败为 null)
|
|
567
|
+
*/
|
|
568
|
+
declare function readRootVersion(repoRoot: string): Promise<string | null>;
|
|
569
|
+
/**
|
|
570
|
+
* 执行目标仓的 version 写回
|
|
571
|
+
*
|
|
572
|
+
* @param services - 宿主服务集合
|
|
573
|
+
* @param repoRoot - 目标仓根绝对路径
|
|
574
|
+
* @param version - 写回的目标版本号(取目标仓根 package.json 当前 version)
|
|
575
|
+
* @returns 写回结果(版本缺失记 skip)
|
|
576
|
+
*/
|
|
577
|
+
declare function runVersionSync(services: DependenciesHostServices, repoRoot: string, version: string): DependenciesVersionSyncOutcome;
|
|
578
|
+
//#endregion
|
|
579
|
+
export { type BuildDependenciesUpgradeResultInput, type DependenciesChecklistEntry, DependenciesChecklistEntrySchema, type DependenciesEnginePort, type DependenciesExecOutcome, type DependenciesExecService, type DependenciesExecSpec, type DependenciesHostServices, type DependenciesResolveFailure, type DependenciesUpgradeData, DependenciesUpgradeDataSchema, type DependenciesUpgradeHandlerInput, type DependenciesVersionCheckOutcome, type DependenciesVersionSyncOutcome, type MultiselectIo, applySelectionToPackages, buildChecklist, buildDependenciesUpgradeResult, dependenciesRepositoryPluginModule as default, dependenciesUpgradeCommand, formatChecklistEntry, isInteractiveTty, loadTargetVersionUpgradeConfig, multiselectEntries, probeRootScript, readRootVersion, runVersionCheck, runVersionSync, writeSelectedPackages };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import*as e from"zod";import{confirm as t}from"@longzai-intelligence-cli/core";import{CheckPackages as n,writePackage as r}from"@longzai-intelligence-dependencies/version-upgrade";import{summarizeCheckReport as i}from"@longzai-intelligence-plugin/core";import{loadUnifiedConfig as a}from"@longzai-intelligence-shared-config/core";import{readFile as o}from"node:fs/promises";import{join as s}from"node:path";function c(e,t,n){return`${e}\n${t}\n${n}`}function l(e){return e.name||e.relative}function u(e){let t=[],n=[];for(let r of e){let e=l(r);for(let i of r.resolved){let r=i.resolveError;if(r!=null&&i.update===!1){n.push({packageName:e,name:i.name,reason:typeof r==`string`?r:r.message});continue}i.update===!0&&t.push({key:c(e,i.name,i.source),packageName:e,name:i.name,currentVersion:i.currentVersion,targetVersion:i.targetVersion,source:i.source,diff:i.diff})}}return{checklist:t,resolveFailures:n}}function d(e,t){let n=[];for(let r of e){let e=l(r),i=!1;for(let n of r.resolved)n.update===!0&&(t.has(c(e,n.name,n.source))?i=!0:n.update=!1);i&&n.push(r)}return n}function f(e){let t=e.diff??``;return`${e.name}: ${e.currentVersion} -> ${e.targetVersion} (${e.source}${t===``?``:` ${t}`})`}async function p(e,t,n){let r=[],i=[];for(let a of t)try{await e.writePackage(a,n),r.push(l(a))}catch(e){i.push({packageName:l(a),reason:e instanceof Error?e.message:String(e)})}return{writtenPackages:r,failures:i}}const m=`\x1B[2K\r`,h=e=>`\x1b[${e}A`;function g(e,t,n,r,i){if(t>0){e.stdout.write(`${h(t)}${m}`);for(let n=1;n<t;n+=1)e.stdout.write(`${m}\n`);e.stdout.write(h(t-1>0?t-1:0))}return n.forEach((t,n)=>{let a=n===i?`>`:` `,o=r[n]===!0?`[x]`:`[ ]`;e.stdout.write(`${m}${a} ${o} ${t}\n`)}),e.stdout.write(`${m}空格切换勾选,a 全选切换,回车确认,q 取消\n`),n.length+1}function _(e,t){return new Promise(n=>{let r=e.length;if(r===0){n([]);return}let i=e.map(()=>!0),a=0,o=0;if(typeof t.stdin.setRawMode!=`function`){t.stdout.write(`非交互环境无法勾选,已取消执行
|
|
2
|
+
`),n(null);return}let s=e=>{t.stdin.removeListener(`data`,c),t.stdin.setRawMode?.(!1),n(e)},c=n=>{let c=typeof n==`string`?n:n.toString(`utf8`);if(c===`\r`||c===`
|
|
3
|
+
`){s(i.map((e,t)=>e?t:-1).filter(e=>e>=0));return}if(c===`q`||c===`\x1B`||c===``){s(null);return}if(c===`j`||c===`\x1B[B`){a=(a+1)%r,o=g(t,o,e,i,a);return}if(c===`k`||c===`\x1B[A`){a=(a-1+r)%r,o=g(t,o,e,i,a);return}if(c===` `){i[a]=i[a]!==!0,o=g(t,o,e,i,a);return}if(c===`a`){let n=i.some(e=>e!==!0);for(let e=0;e<r;e+=1)i[e]=n;o=g(t,o,e,i,a)}};t.stdin.setRawMode(!0),t.stdin.on(`data`,c),o=g(t,0,e,i,a)})}function v(){return process.stdin.isTTY===!0}const y=e.object({key:e.string().min(1),packageName:e.string().min(1),name:e.string().min(1),currentVersion:e.string(),targetVersion:e.string(),source:e.string(),diff:e.enum([`major`,`minor`,`patch`,`error`]).nullable()}),b=e.object({status:e.enum([`pass`,`fail`,`skip`]),summary:e.string(),outputExcerpt:e.string().optional()}),x=e.object({status:e.enum([`pass`,`fail`,`skip`]),summary:e.string(),outputExcerpt:e.string().optional()}),S=e.object({mode:e.enum([`default`,`major`,`minor`,`patch`,`latest`,`newest`]),checklist:e.array(y),selected:e.array(e.string()),writtenPackages:e.array(e.string()),versionCheck:b.nullable(),versionSync:x.nullable()});function C(e){let t={items:[...e.items],totals:i(e.items)};return{pluginId:`dependencies-repository-plugin`,commandId:`upgrade`,invocation:`dependencies:upgrade`,status:e.status,summary:e.summary,report:t,data:{mode:e.mode,checklist:e.checklist,selected:e.selected,writtenPackages:e.writtenPackages,versionCheck:e.versionCheck,versionSync:e.versionSync}}}async function w(e){let t=await a({cwd:e,standaloneFile:`lzi-dev.config.ts`,unifiedField:`devTools`});return t.success?t.config.versionUpgrade??{}:{}}function T(e){return typeof e==`object`&&!!e}async function E(e){try{let t=JSON.parse(await o(s(e,`package.json`),`utf-8`));if(T(t)&&T(t.scripts)){let e={};for(let[n,r]of Object.entries(t.scripts))typeof r==`string`&&(e[n]=r);return e}}catch{return{}}return{}}async function D(e,t){return typeof(await E(e))[t]==`string`}async function O(e,t){if(!await D(t,`version:check`))return{status:`skip`,summary:"目标仓缺少 `version:check` 脚本,跳过一致性复核"};let n=e.exec.run({command:`bun`,args:[`run`,`version:check`],cwd:t}),r=n.stdoutExcerpt.trim()||n.stderrExcerpt.trim();return n.code===0&&r.includes(`所有包版本一致`)?{status:`pass`,summary:r}:r.includes(`版本号不一致`)||r.includes(`缺少 version 字段`)?{status:`fail`,summary:`版本一致性复核未通过`,outputExcerpt:r}:{status:`fail`,summary:`version:check 退出码 ${n.code}${n.timedOut?`(超时被终止)`:``}`,outputExcerpt:r}}async function k(e){try{let t=JSON.parse(await o(s(e,`package.json`),`utf-8`));return typeof t==`object`&&t&&`version`in t&&typeof t.version==`string`?t.version:null}catch{return null}}function A(e,t,n){let r=e.exec.run({command:`bun`,args:[`run`,`version:sync`,n],cwd:t}),i=r.stdoutExcerpt.trim()||r.stderrExcerpt.trim();return r.code===0?{status:`pass`,summary:`version:sync ${n} 执行成功`,outputExcerpt:i}:{status:`fail`,summary:`version:sync ${n} 退出码 ${r.code}${r.timedOut?`(超时被终止)`:``}`,outputExcerpt:i}}const j=[`default`,`major`,`minor`,`patch`,`latest`,`newest`],M=e.enum(j).default(`default`);function N(e){process.stdout.write(`${e}\n`)}const P={checkPackages:n,writePackage:r};function F(){return{afterPackagesLoaded:e=>{N(`扫描到 ${e.length} 个包,正在检查依赖更新...`)},beforePackageStart:e=>{N(`正在检查 ${e.name||e.relative}...`)}}}function I(e,t,n){return{cwd:e,mode:t,write:!1,recursive:n.recursive??!0,timeout:n.timeout??3e4,retries:n.retries??3,exclude:n.exclude??[],include:n.include??[],depFields:n.depFields,ignorePaths:n.ignorePaths??[],concurrency:n.concurrency??10,force:!1,all:!1,install:!1,update:!1,interactive:!1,group:!0,includeLocked:!1,timediff:!0,nodecompat:!0,loglevel:`info`,silent:!1,failOnOutdated:!1}}function L(e,t){N(`
|
|
4
|
+
--- 可升级清单 ---`);let n=/* @__PURE__ */ new Map;e.forEach((e,t)=>{let r=n.get(e.packageName)??[];r.push(t),n.set(e.packageName,r)});for(let[t,r]of n){N(`${t}:`);for(let t of r){let n=e.at(t);n!==void 0&&N(` ${f(n)}`)}}t>0&&N(`另有 ${t} 条依赖解析失败,已计入警告项`)}async function R(e,t){if(e.write)return N(`\n全量执行:${t.length} 条`),{keys:t.map(e=>e.key),rejected:!1};if(!v())return N(`
|
|
5
|
+
非交互环境无法勾选,写路径已拒绝(使用 --dry-run 预览或在交互终端执行)`),{keys:null,rejected:!0};let n=await _(t.map(e=>f(e)),{stdin:process.stdin,stdout:process.stdout});return n===null||n.length===0?(N(`
|
|
6
|
+
已取消执行,未写入任何变更`),{keys:null,rejected:!1}):{keys:n.flatMap(e=>{let n=t.at(e);return n===void 0?[]:[n.key]}),rejected:!1}}async function z(e,n,r,i){if(!e.sync)return null;let a=await k(r),o;return o=a===null?{status:`skip`,summary:`目标仓根 package.json 缺少 version 字段,跳过写回`}:await t(`确认执行 version:sync ${a} 写回全部包版本?`)?A(n,r,a):{status:`skip`,summary:`用户取消 version:sync 写回`},i.push({id:`version-sync`,label:`版本写回`,status:o.status,detail:o.summary,...o.outputExcerpt===void 0?{}:{outputExcerpt:o.outputExcerpt}}),o}async function B(e){let n=e.services.engine??P,r=M.safeParse(e.positionals[0]??void 0);if(!r.success)return C({mode:`default`,checklist:[],selected:[],items:[{id:`mode-validation`,label:`升级模式校验`,status:`fail`,detail:`非法升级模式:${String(e.positionals[0])}(合法值 ${j.join(` / `)})`}],versionCheck:null,versionSync:null,summary:`升级模式非法,命令未执行`,status:`fail`,writtenPackages:[]});let i=r.data,a={write:e.opts.write===!0&&e.opts.dryRun!==!0,dryRun:e.opts.dryRun===!0,sync:e.opts.sync===!0},o=[],s=await w(e.repoRoot),c=I(e.repoRoot,i,s),{packages:l}=await n.checkPackages(c,F()),{checklist:f,resolveFailures:m}=u(l);if(m.length>0&&o.push({id:`resolve-failures`,label:`依赖解析失败统计`,status:`warn`,detail:m.map(e=>`${e.packageName} 的 ${e.name}:${e.reason}`).join(`;`)}),f.length===0)return C({mode:i,checklist:f,selected:[],items:[...o,{id:`upgrade-result`,label:`依赖升级结果`,status:`pass`,detail:`所有依赖已是最新版本`}],versionCheck:null,versionSync:null,summary:`所有依赖已是最新版本`,status:m.length>0?`warn`:`ok`,writtenPackages:[]});if(L(f,m.length),a.dryRun)return N(`
|
|
7
|
+
dry-run 预览模式:未写入任何变更`),C({mode:i,checklist:f,selected:f.map(e=>e.key),items:[...o,{id:`upgrade-result`,label:`依赖升级结果`,status:m.length>0?`warn`:`pass`,detail:`dry-run 预览,共 ${f.length} 条可升级,未写入`}],versionCheck:null,versionSync:null,summary:`dry-run 预览完成,共 ${f.length} 条可升级,零写入`,status:m.length>0?`warn`:`ok`,writtenPackages:[]});let h=await R(a,f);if(h.keys===null||h.keys.length===0)return C({mode:i,checklist:f,selected:[],items:[...o,{id:`upgrade-result`,label:`依赖升级结果`,status:h.rejected?`warn`:`skip`,detail:h.rejected?`非交互环境拒绝写入`:`用户取消执行`}],versionCheck:null,versionSync:null,summary:h.rejected?`非交互环境拒绝写入,命令零写收场`:`已取消依赖升级,命令零写收场`,status:h.rejected?`warn`:`ok`,writtenPackages:[]});let g=h.keys;if(!await t(`确认执行选中的 ${g.length} 条依赖升级并写入 package.json?`))return N(`
|
|
8
|
+
已取消写入,未产生任何变更`),C({mode:i,checklist:f,selected:[],items:[...o,{id:`upgrade-result`,label:`依赖升级结果`,status:`skip`,detail:`用户取消写入`}],versionCheck:null,versionSync:null,summary:`已取消依赖升级写入`,status:`ok`,writtenPackages:[]});let{writtenPackages:_,failures:v}=await p(n,d(l,new Set(g)),c);o.push({id:`upgrade-result`,label:`依赖升级结果`,status:v.length>0?`fail`:`pass`,detail:v.length>0?`已写入 ${_.length} 包,失败 ${v.length} 包:${v.map(e=>`${e.packageName}(${e.reason})`).join(`;`)}(失败包不回滚,如实保留半成品状态)`:`已写入 ${_.length} 包共 ${g.length} 条升级`}),N(`\n已写入 ${_.length} 个包`);let y=await O(e.services,e.repoRoot);o.push({id:`version-check`,label:`版本一致性复核`,status:y.status,detail:y.summary,...y.outputExcerpt===void 0?{}:{outputExcerpt:y.outputExcerpt}});let b=await z(a,e.services,e.repoRoot,o);N("\n依赖升级完成。后续可执行发版准备流命令 `release:cut` 完成发版准备(不自动触发)");let x=v.length>0||y.status===`fail`||b?.status===`fail`?`fail`:o.some(e=>e.status===`warn`)?`warn`:`ok`;return C({mode:i,checklist:f,selected:g,items:o,versionCheck:y,versionSync:b,summary:`依赖升级完成:写入 ${_.length} 包 ${g.length} 条,复核 ${y.status},写回 ${b===null?`未执行`:b.status}`,status:x,writtenPackages:_})}const V={manifest:{id:`dependencies-repository-plugin`,version:`0.0.1`,display:`依赖升级`,engine:`>=0.0.1`,engines:{cli:`>=0.0.1`},capabilities:[`spawn`,`network`],negotiation:{degradable:[`network`]},permissions:{fs:`declared`},entry:{cli:`./dist/index.js`},contributions:{commands:[{id:`upgrade`,title:`依赖升级`,invocation:`dependencies:upgrade`,description:`呈现可升级清单并交互勾选执行,附一致性复核与可选版本写回`,arguments:[{signature:`[mode]`,description:`升级模式(default/major/minor/patch/latest/newest,缺省 default)`}],options:[{flags:`--write`,description:`全量执行(跳过勾选等价全选,仍需写前确认)`},{flags:`--dry-run`,description:`仅预览,零写入`},{flags:`--sync`,description:`升级后执行 version:sync 版本写回`},{flags:`--repo <repo>`,description:`目标仓(缺省当前目录)`}],optionsSchema:e.looseObject({write:e.boolean().default(!1),dryRun:e.boolean().default(!1),sync:e.boolean().default(!1),repo:e.string().optional()}),keywords:[`dependencies`,`upgrade`,`version`,`checklist`,`repository`]}],ui:[{slot:`workbench-page`,component:`DependenciesUpgradePanel`,route:`/plugins/dependencies-upgrade`,title:`依赖升级`},{slot:`action-entry`,component:`CheckDependenciesUpgradesAction`,commandId:`upgrade`,title:`检查依赖升级`}]}},load(e){return{commands:/* @__PURE__ */ new Map([[`upgrade`,B]])}}};export{y as DependenciesChecklistEntrySchema,S as DependenciesUpgradeDataSchema,d as applySelectionToPackages,u as buildChecklist,C as buildDependenciesUpgradeResult,V as default,B as dependenciesUpgradeCommand,f as formatChecklistEntry,v as isInteractiveTty,w as loadTargetVersionUpgradeConfig,_ as multiselectEntries,D as probeRootScript,k as readRootVersion,O as runVersionCheck,A as runVersionSync,p as writeSelectedPackages};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"node:module";export{};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@longzai-intelligence-dependencies/repository-plugin",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Longzai Intelligence dependencies 仓级插件(repository 场景的依赖升级流)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dependencies",
|
|
7
|
+
"longzai-intelligence",
|
|
8
|
+
"lzi",
|
|
9
|
+
"plugin",
|
|
10
|
+
"repository",
|
|
11
|
+
"upgrade"
|
|
12
|
+
],
|
|
13
|
+
"license": "UNLICENSED",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "lzi-builder",
|
|
28
|
+
"build:prod": "NODE_ENV=production bun run build",
|
|
29
|
+
"prepublishOnly": "bun run build:prod",
|
|
30
|
+
"typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
|
|
31
|
+
"typecheck:app": "lzi-tsgo typecheck tsconfig/app.json",
|
|
32
|
+
"typecheck:node": "lzi-tsgo typecheck tsconfig/node.json",
|
|
33
|
+
"typecheck:test": "lzi-tsgo typecheck tsconfig/test.json",
|
|
34
|
+
"lint": "oxlint && oxfmt --check",
|
|
35
|
+
"lint:fix": "oxlint --fix && oxfmt",
|
|
36
|
+
"test": "bun test",
|
|
37
|
+
"test:watch": "bun test --watch",
|
|
38
|
+
"test:coverage": "bun test --coverage",
|
|
39
|
+
"clean": "lzi-dev-cli clean"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@longzai-intelligence-cli/core": "^0.0.10",
|
|
43
|
+
"@longzai-intelligence-dependencies/core": "0.0.1",
|
|
44
|
+
"@longzai-intelligence-dependencies/version-upgrade": "0.0.1",
|
|
45
|
+
"@longzai-intelligence-plugin/core": "^0.0.2",
|
|
46
|
+
"@longzai-intelligence-shared-config/core": "^0.0.7",
|
|
47
|
+
"zod": "^4.4.3"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/bun": "^1.4.2"
|
|
51
|
+
}
|
|
52
|
+
}
|