@dsh-workbench/shared 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/protocol/bundle-install.d.ts +9 -1
- package/dist/contract/protocol/market-index.d.ts +1 -0
- package/dist/contract/protocol/market-index.js +1 -0
- package/dist/contract/unit-declaration.d.ts +11 -5
- package/dist/contract/unit-declaration.js +43 -17
- package/dist/contract/unit.d.ts +18 -3
- package/dist/contract/unit.js +8 -0
- package/dist/contract/workbench-contract.d.ts +1 -1
- package/dist/host/provision.d.ts +1 -1
- package/dist/host/provision.js +8 -2
- package/dist/host/supply-index.d.ts +4 -1
- package/dist/host/supply-index.js +18 -12
- package/dist/i18n/en.js +54 -32
- package/dist/i18n/index.d.ts +56 -34
- package/dist/i18n/zh.d.ts +55 -33
- package/dist/i18n/zh.js +55 -33
- package/dist/lib/dsh-client.d.ts +3 -1
- package/dist/testing/needs.js +5 -2
- package/package.json +1 -1
- package/src/contract/__tests__/unit-declaration.test.ts +34 -1
- package/src/contract/__tests__/unit.test.ts +1 -1
- package/src/contract/protocol/bundle-install.ts +11 -1
- package/src/contract/protocol/market-index.ts +1 -0
- package/src/contract/unit-declaration.ts +53 -22
- package/src/contract/unit.ts +22 -3
- package/src/contract/workbench-contract.ts +3 -1
- package/src/host/__tests__/provision.test.ts +2 -0
- package/src/host/__tests__/supply-index.test.ts +42 -6
- package/src/host/provision.ts +6 -2
- package/src/host/supply-index.ts +40 -11
- package/src/i18n/en.ts +54 -32
- package/src/i18n/zh.ts +55 -33
- package/src/lib/dsh-client.ts +3 -1
- package/src/testing/__tests__/declaration.test.ts +7 -3
- package/src/testing/needs.ts +5 -2
package/dist/i18n/zh.d.ts
CHANGED
|
@@ -137,15 +137,14 @@ export declare const zh: {
|
|
|
137
137
|
readonly 'panels.market.update': "更新";
|
|
138
138
|
readonly 'panels.market.swapSlow': "还没换上:可能网慢或没装上。再点一次「更新」;一直这样就把 dsh 重启一遍。";
|
|
139
139
|
readonly 'panels.market.removeSlow': "还没卸掉:可能网慢或卸载没走完。等一下再看;一直这样就把 dsh 重启一遍。";
|
|
140
|
-
readonly 'panels.market.updateNoChange': "
|
|
140
|
+
readonly 'panels.market.updateNoChange': "更新失败:还是 {from};源上最新是 {latest},可以再点一次「更新」。";
|
|
141
141
|
readonly 'panels.market.updateUnknownVersion': "(问不到)";
|
|
142
|
-
readonly 'panels.market.updateGone': "
|
|
143
|
-
readonly 'panels.market.updateRestored': "
|
|
142
|
+
readonly 'panels.market.updateGone': "更新失败:更新后找不到这个模块。";
|
|
143
|
+
readonly 'panels.market.updateRestored': "更新失败:更新后找不到新版本,已把 {version} 装回去。";
|
|
144
144
|
readonly 'panels.market.updateBehind': "装上了 {installed},但源上最新是 {latest} —— 没更到最新,可以再点一次。";
|
|
145
|
-
readonly 'panels.market.selfUpdateFailed': "
|
|
145
|
+
readonly 'panels.market.selfUpdateFailed': "工作台更新失败:{reason}";
|
|
146
146
|
readonly 'panels.market.selfUpdateUnknown': "外部进程没留下原因(看 ~/.dsh/workbench/self-update.log)";
|
|
147
|
-
readonly 'panels.market.selfUpdateRolledBack': "
|
|
148
|
-
readonly 'panels.market.selfUpdateNeedsMigrate': "工作台已更新。旧会话 / 项目不会自动并:先退出所有 dsh,再运行 dsh-workbench migrate(--force 可补并)。";
|
|
147
|
+
readonly 'panels.market.selfUpdateRolledBack': "工作台更新失败,已回滚到 {version}。";
|
|
149
148
|
readonly 'panels.market.uninstall': "卸载";
|
|
150
149
|
readonly 'panels.market.uninstallLabel': "卸载 {name}";
|
|
151
150
|
readonly 'panels.market.installing': "正在安装…";
|
|
@@ -167,9 +166,27 @@ export declare const zh: {
|
|
|
167
166
|
readonly 'panels.market.empty': "暂无可用模块";
|
|
168
167
|
readonly 'panels.market.sectionPlugins': "已安装 opencli 插件";
|
|
169
168
|
readonly 'panels.market.moduleOutdated': "有新版";
|
|
169
|
+
readonly 'panels.market.updateNeedsWorkbench': "新版本要先把工作台升级才能用";
|
|
170
|
+
readonly 'panels.market.updateIncompatible': "新版本和当前的工作台不匹配,暂时不能更新";
|
|
170
171
|
readonly 'panels.market.moduleRefused': "模块版本与工作台不匹配,暂时无法使用";
|
|
171
172
|
readonly 'panels.market.moduleRestartHint': "重启后生效";
|
|
172
173
|
readonly 'panels.market.pendingRestart': "重启后生效";
|
|
174
|
+
readonly 'panels.market.pendingFollowUp': "旧数据待迁移";
|
|
175
|
+
readonly 'panels.market.migrationHint': "旧会话和项目还没搬过来";
|
|
176
|
+
readonly 'panels.market.migrateAction': "迁移旧数据";
|
|
177
|
+
readonly 'panels.market.migrating': "正在迁移…";
|
|
178
|
+
readonly 'panels.market.migrateConfirmTitle': "迁移旧数据?";
|
|
179
|
+
readonly 'panels.market.migrateConfirmDetail': "先退出 dsh web / Desktop。迁移只补缺、不覆盖;旧目录保留。";
|
|
180
|
+
readonly 'panels.market.migrateConfirmAck': "我已经退出 dsh web / Desktop";
|
|
181
|
+
readonly 'panels.market.migrateConfirmYes': "开始迁移";
|
|
182
|
+
readonly 'panels.market.migrateDone': "迁移完成:补了 {added} 个项目;重启工作台和 dsh web 后出现。";
|
|
183
|
+
readonly 'panels.market.dismissFollowUp': "不再提醒";
|
|
184
|
+
readonly 'panels.market.dismissing': "正在收起…";
|
|
185
|
+
readonly 'panels.market.dismissFollowUpTitle': "不再提醒这件事?";
|
|
186
|
+
readonly 'panels.market.dismissFollowUpDetail': "提示会从模块市场收起,但不会迁移或删除旧数据。旧会话和项目仍留在旧目录,新版本里看不到;以后需要时仍可运行 dsh-workbench migrate。";
|
|
187
|
+
readonly 'panels.market.dismissFollowUpAck': "我知道旧数据不会自动出现";
|
|
188
|
+
readonly 'panels.market.dismissFollowUpYes': "不再提醒";
|
|
189
|
+
readonly 'panels.market.dismissed': "已不再提醒;旧数据仍在旧目录,需要时仍可运行 dsh-workbench migrate。";
|
|
173
190
|
readonly 'panels.market.workbenchName': "工作台";
|
|
174
191
|
readonly 'panels.market.pluginBroken': "这份插件装坏了:认不出它是什么。可以先卸载,再让 agent 按包名重装一次。";
|
|
175
192
|
readonly 'panels.market.restartNeeded': "新版装好了,重启一次才生效。";
|
|
@@ -253,7 +270,7 @@ export declare const zh: {
|
|
|
253
270
|
readonly 'panels.market.add.exampleTitle': "示例";
|
|
254
271
|
readonly 'panels.market.add.exampleFill': "填入示例";
|
|
255
272
|
readonly 'panels.market.add.registryLabel': "安装源";
|
|
256
|
-
readonly 'panels.market.add.registryProfile': "
|
|
273
|
+
readonly 'panels.market.add.registryProfile': "这份工作台配的源";
|
|
257
274
|
readonly 'panels.market.add.registryPnpm': "pnpm 自己配的源";
|
|
258
275
|
readonly 'panels.market.add.check': "预检";
|
|
259
276
|
readonly 'panels.market.add.checking': "正在预检…";
|
|
@@ -274,14 +291,19 @@ export declare const zh: {
|
|
|
274
291
|
readonly 'panels.market.tabs': "模块市场的两个面";
|
|
275
292
|
readonly 'panels.tab.discover': "发现";
|
|
276
293
|
readonly 'panels.discover.loading': "正在读取索引";
|
|
294
|
+
readonly 'panels.discover.slowHint': "读取较慢:如有授权提示,先完成它,或换一个索引源。";
|
|
277
295
|
readonly 'panels.discover.lead': "从索引源浏览模块;装上就能用。";
|
|
278
296
|
readonly 'panels.discover.addSource': "添加";
|
|
279
297
|
readonly 'panels.discover.addingSource': "正在添加…";
|
|
280
298
|
readonly 'panels.discover.addFirstSource': "添加索引源";
|
|
281
299
|
readonly 'panels.discover.removeSource': "移除";
|
|
282
300
|
readonly 'panels.discover.removeSourceNamed': "移除 {url}";
|
|
301
|
+
readonly 'panels.discover.useSource': "使用";
|
|
302
|
+
readonly 'panels.discover.useSourceNamed': "使用 {label}";
|
|
303
|
+
readonly 'panels.discover.sourceCurrent': "当前使用";
|
|
283
304
|
readonly 'panels.discover.refresh': "刷新";
|
|
284
305
|
readonly 'panels.discover.search': "搜索模块";
|
|
306
|
+
readonly 'panels.discover.clearSearch': "清除搜索";
|
|
285
307
|
readonly 'panels.discover.all': "全部";
|
|
286
308
|
readonly 'panels.discover.sourceLabel': "名字";
|
|
287
309
|
readonly 'panels.discover.sourceKind': "类型";
|
|
@@ -291,8 +313,8 @@ export declare const zh: {
|
|
|
291
313
|
readonly 'panels.discover.sourcePlaceholder': "https://example.com/index.json 或 git@git.example.com:wb/market.git";
|
|
292
314
|
readonly 'panels.discover.sourceRef': "分支";
|
|
293
315
|
readonly 'panels.discover.sourcePath': "索引文件";
|
|
294
|
-
readonly 'panels.discover.sourceLocal': "
|
|
295
|
-
readonly 'panels.discover.sourceLocalHint': "
|
|
316
|
+
readonly 'panels.discover.sourceLocal': "本地副本目录(可选)";
|
|
317
|
+
readonly 'panels.discover.sourceLocalHint': "不填就放到 ~/.dsh/workbench/market-index/。";
|
|
296
318
|
readonly 'panels.discover.save': "保存并刷新";
|
|
297
319
|
readonly 'panels.discover.cancel': "取消";
|
|
298
320
|
readonly 'panels.discover.retry': "重试";
|
|
@@ -305,9 +327,9 @@ export declare const zh: {
|
|
|
305
327
|
readonly 'panels.discover.missingIndex': "仓库里还没有索引文件 {path}";
|
|
306
328
|
readonly 'panels.discover.initTitle': "把这个仓库初始化成模块市场索引?";
|
|
307
329
|
readonly 'panels.discover.initCta': "初始化成市场索引";
|
|
308
|
-
readonly 'panels.discover.initWhat': "会在 {branch} 分支写 market.json 与 README.md
|
|
330
|
+
readonly 'panels.discover.initWhat': "会在 {branch} 分支写 market.json 与 README.md,提交一次并推上去;之后从这个工作台发布的模块会把打包好的文件提交到 packages/<unit>/。仓库的写权限归它的所有者。";
|
|
309
331
|
readonly 'panels.discover.initBranch': "分支";
|
|
310
|
-
readonly 'panels.discover.initBranchHint': "
|
|
332
|
+
readonly 'panels.discover.initBranchHint': "索引和打包文件都发到这个分支;空仓库会新建它。";
|
|
311
333
|
readonly 'panels.discover.initBranchBad': "分支名只能用字母、数字、点、下划线、斜杠或短横线";
|
|
312
334
|
readonly 'panels.discover.initOk': "初始化";
|
|
313
335
|
readonly 'panels.discover.initBusy': "正在初始化…";
|
|
@@ -411,11 +433,11 @@ export declare const zh: {
|
|
|
411
433
|
readonly 'panels.market.add.doneApplied': "装好了,已经生效。";
|
|
412
434
|
readonly 'panels.market.add.doneRestart': "装好了,重启一次才生效。";
|
|
413
435
|
readonly 'panels.market.add.restartWhy': "为什么这一版要重启:{reason}";
|
|
414
|
-
readonly 'panels.market.add.restartWhy.no-hmr': "
|
|
436
|
+
readonly 'panels.market.add.restartWhy.no-hmr': "这份配置只在启动时读一次,改了得重启";
|
|
415
437
|
readonly 'panels.market.add.restartWhy.package-moved': "某个已经装着的包换到了新的目录,或者这一下换掉了 dsh 自己提供的那份";
|
|
416
438
|
readonly 'panels.market.add.restartWhy.host-module': "这一下动到了 dsh 自己加载的模块";
|
|
417
|
-
readonly 'panels.market.add.restartWhy.unmanaged-plugin': "
|
|
418
|
-
readonly 'panels.market.add.restartWhy.module-comparison': "dsh
|
|
439
|
+
readonly 'panels.market.add.restartWhy.unmanaged-plugin': "这一下动到了没登记过、正在运行的插件";
|
|
440
|
+
readonly 'panels.market.add.restartWhy.module-comparison': "dsh 没法确认正在跑的插件就是这台机器上装好的那一份";
|
|
419
441
|
readonly 'panels.market.add.cancelled': "已取消。";
|
|
420
442
|
readonly 'panels.market.add.failed': "没成功:{reason}";
|
|
421
443
|
readonly 'panels.market.add.removed': "已经移除了。";
|
|
@@ -425,10 +447,10 @@ export declare const zh: {
|
|
|
425
447
|
readonly 'panels.market.add.removedRestart': "卸掉了,重启一次才彻底生效。";
|
|
426
448
|
readonly 'panels.market.add.remove': "移除它";
|
|
427
449
|
readonly 'panels.market.add.problem.invalidSpec': "这个写法不认:不能是空的,也不能以横杠开头。";
|
|
428
|
-
readonly 'panels.market.add.problem.alreadyInstalled': "
|
|
450
|
+
readonly 'panels.market.add.problem.alreadyInstalled': "这个包已经在这份工作台里了(要换版本请带上 @版本)。";
|
|
429
451
|
readonly 'panels.market.add.problem.notFound': "源上没有这个包。换个包名或版本再试。";
|
|
430
452
|
readonly 'panels.market.add.problem.notAPackage': "这个位置没有包。选一个包含 package.json 的目录。";
|
|
431
|
-
readonly 'panels.market.add.problem.notABundle': "它是一个 npm 包,但不是 dsh
|
|
453
|
+
readonly 'panels.market.add.problem.notABundle': "它是一个 npm 包,但不是 dsh 插件包(dsh 在里面找不到该加载什么)。";
|
|
432
454
|
readonly 'panels.market.add.problem.network': "源连不上。检查网络后重试。";
|
|
433
455
|
readonly 'panels.market.add.problem.unknown': "预检没通过(原因未知)。展开安装详情看原始输出,或重试。";
|
|
434
456
|
readonly 'panels.market.add.reason.invalidSpec': "写法不认";
|
|
@@ -436,7 +458,7 @@ export declare const zh: {
|
|
|
436
458
|
readonly 'panels.market.add.reason.notBundle': "它不是一个 dsh 插件包";
|
|
437
459
|
readonly 'panels.market.add.reason.notRemovable': "它是安装自带的组合包,不能卸";
|
|
438
460
|
readonly 'panels.market.add.reason.bundleInUse': "还有东西在用它,卸不掉";
|
|
439
|
-
readonly 'panels.market.add.reason.stopProfile': "
|
|
461
|
+
readonly 'panels.market.add.reason.stopProfile': "这份配置改了要重启,得先停掉工作台";
|
|
440
462
|
readonly 'panels.market.add.reason.staleApproval': "要允许的安装脚本已经变了,重新来一次";
|
|
441
463
|
readonly 'panels.market.add.reason.operationError': "pnpm 执行出错(详情见安装输出)";
|
|
442
464
|
readonly 'panels.market.add.reason.buildBlocked': "pnpm 拦下了安装脚本";
|
|
@@ -459,15 +481,15 @@ export declare const zh: {
|
|
|
459
481
|
readonly 'blocker.market.open': "去模块市场";
|
|
460
482
|
readonly 'blocker.login.title': "需要登录 {platform}";
|
|
461
483
|
readonly 'blocker.login.titleGeneric': "需要登录";
|
|
462
|
-
readonly 'blocker.login.hint': "
|
|
484
|
+
readonly 'blocker.login.hint': "工作台借你浏览器里的登录状态;登录一次就行,之后不用再登。";
|
|
463
485
|
readonly 'blocker.login.go': "去登录";
|
|
464
486
|
readonly 'blocker.login.manual': "在终端执行该插件的登录命令(见插件的文档),按提示完成登录后重试。";
|
|
465
487
|
readonly 'blocker.forbidden.title': "没有权限访问 {platform}";
|
|
466
488
|
readonly 'blocker.forbidden.titleGeneric': "没有权限";
|
|
467
489
|
readonly 'blocker.forbidden.hint': "账号已登录,但没有这个项目/仓库的权限;申请之后再试。";
|
|
468
490
|
readonly 'blocker.forbidden.open': "打开权限页";
|
|
469
|
-
readonly 'blocker.timeout.hint': "
|
|
470
|
-
readonly 'blocker.exec.hint': "确认 opencli
|
|
491
|
+
readonly 'blocker.timeout.hint': "后台浏览器没起来,重试一次通常就好。";
|
|
492
|
+
readonly 'blocker.exec.hint': "确认 opencli 已经装好、在终端里能直接运行(which opencli)。";
|
|
471
493
|
readonly 'blocker.unknown.title': "出了点问题";
|
|
472
494
|
readonly 'panels.reading': "正在读取面板配置…";
|
|
473
495
|
readonly 'panels.cardBroken': "这个模块起不来:{unit}({reason})";
|
|
@@ -481,7 +503,7 @@ export declare const zh: {
|
|
|
481
503
|
readonly 'env.elapsed': "已等待 {seconds} 秒";
|
|
482
504
|
readonly 'env.stepFailed.install': "装不上";
|
|
483
505
|
readonly 'env.stepFailed.path': "装了但还找不到";
|
|
484
|
-
readonly 'env.stepFailed.shell': "
|
|
506
|
+
readonly 'env.stepFailed.shell': "连不上命令行";
|
|
485
507
|
readonly 'env.toolchain.ok': "正常";
|
|
486
508
|
readonly 'env.toolchain.warn': "还没完全准备好";
|
|
487
509
|
readonly 'env.opencli.ok': "已就绪";
|
|
@@ -498,10 +520,10 @@ export declare const zh: {
|
|
|
498
520
|
readonly 'env.fix.title': "怎么解决";
|
|
499
521
|
readonly 'env.fix.why': "工作台用它自己那份后台工具(与你在终端里那套分开装,互不影响),这台机器上还没装好它。";
|
|
500
522
|
readonly 'env.fix.whyPath': "后台工具装上了,但当前环境还找不到它 —— 通常是 PATH 或终端会话的问题。";
|
|
501
|
-
readonly 'env.fix.whyShell': "
|
|
523
|
+
readonly 'env.fix.whyShell': "工作台拿不到这台机器的命令行,所以取不了数据 —— 这一步你装不了,需要有人处理后台环境。";
|
|
502
524
|
readonly 'env.fix.step': "在终端里运行下面这条命令,装好之后点「重试」:";
|
|
503
525
|
readonly 'env.fix.stepPath': "新开一个终端窗口(或确认 npm 的全局 bin 目录在 PATH 里),然后点「重试」。";
|
|
504
|
-
readonly 'env.fix.stepShell': "重启一次工作台(或 dsh
|
|
526
|
+
readonly 'env.fix.stepShell': "重启一次工作台(或 dsh);如果反复出现,说明工作台还是拿不到命令行。";
|
|
505
527
|
readonly 'env.fix.permission': "权限不够:在命令前加 sudo 重跑,或先把 npm 的全局目录配到你的用户目录。";
|
|
506
528
|
readonly 'env.fix.network': "网络不通:检查网络或代理设置后重试。";
|
|
507
529
|
readonly 'env.fix.details': "详细输出(排障用)";
|
|
@@ -530,9 +552,9 @@ export declare const zh: {
|
|
|
530
552
|
readonly 'env.warm.done': "已就绪({n} 个站点)";
|
|
531
553
|
readonly 'env.warm.short': "这次没提前连上 —— 不影响用,第一次取数会自己补";
|
|
532
554
|
readonly 'env.unit.failed': "这个模块起不来";
|
|
533
|
-
readonly 'env.unit.failedHint': "
|
|
534
|
-
readonly 'env.unit.unchecked': "
|
|
535
|
-
readonly 'env.unit.uncheckedHint': "
|
|
555
|
+
readonly 'env.unit.failedHint': "它自己启动时报了错,别的模块不受影响。";
|
|
556
|
+
readonly 'env.unit.unchecked': "检测不了:拿不到命令行";
|
|
557
|
+
readonly 'env.unit.uncheckedHint': "不是这个模块的问题,是工作台拿不到命令行 —— 重启一次工作台再试。";
|
|
536
558
|
readonly 'adapterSet.not-configured': "没配置适配器集合,用默认的。";
|
|
537
559
|
readonly 'adapterSet.no-profile': "找不到 profile,没法加载适配器集合;先用默认的。";
|
|
538
560
|
readonly 'adapterSet.malformed': "适配器集合要写包名(如 @acme/adapters-set);先用默认的。";
|
|
@@ -575,7 +597,7 @@ export declare const zh: {
|
|
|
575
597
|
readonly 'sidebarEdition.official': "官方";
|
|
576
598
|
readonly 'sidebarEdition.officialHint': "跟 dsh 官方一致、最稳:搜索、视图选项、显示更多、归档、添加工作区都齐,升级也不等我们适配。想省心就选它。";
|
|
577
599
|
readonly 'sidebarEdition.custom': "自定义";
|
|
578
|
-
readonly 'sidebarEdition.customHint': "
|
|
600
|
+
readonly 'sidebarEdition.customHint': "为多项目工作流做的:项目下拉一屏一个项目,会话按最近更新排,名字自动滚动、两侧渐隐,工坊 DIY 新会话。项目多时更顺手。";
|
|
579
601
|
readonly 'sidebarEdition.saving': "配置中…";
|
|
580
602
|
readonly 'sidebarEdition.reloadRequired': "已写入。刷新页面后生效(不用重启工作台)。";
|
|
581
603
|
readonly 'sidebarEdition.reload': "刷新页面";
|
|
@@ -604,25 +626,25 @@ export declare const zh: {
|
|
|
604
626
|
readonly 'record.act.halt': "停";
|
|
605
627
|
readonly 'approval.record.site': "站点";
|
|
606
628
|
readonly 'approval.record.what': "录制功能";
|
|
607
|
-
readonly 'approval.record.lands': "
|
|
629
|
+
readonly 'approval.record.lands': "保存到";
|
|
608
630
|
readonly 'approval.record.noUrl': "没给站点地址(这次会被当场拒)";
|
|
609
631
|
readonly 'approval.record.oneAction': "一次操作";
|
|
610
632
|
readonly 'approval.record.noSwitch': "录完不会替你切回来(左栏底部会亮一条状态)";
|
|
611
|
-
readonly 'approval.longTask.what': "
|
|
612
|
-
readonly 'approval.longTask.signal': "停了只是让工作台发出中断信号 ——
|
|
633
|
+
readonly 'approval.longTask.what': "要停的那次任务";
|
|
634
|
+
readonly 'approval.longTask.signal': "停了只是让工作台发出中断信号 —— 这次任务怎么收尾由模块自己负责";
|
|
613
635
|
readonly 'approval.publish.module': "模块";
|
|
614
636
|
readonly 'approval.publish.target': "目标";
|
|
615
637
|
readonly 'approval.publish.version': "版本";
|
|
616
638
|
readonly 'approval.publish.author': "作者";
|
|
617
|
-
readonly 'approval.publish.authorMissing': "
|
|
639
|
+
readonly 'approval.publish.authorMissing': "未署名";
|
|
618
640
|
readonly 'approval.publish.registry': "源";
|
|
619
641
|
readonly 'approval.publish.repo': "仓库";
|
|
620
642
|
readonly 'approval.publish.branch': "分支";
|
|
621
643
|
readonly 'approval.publish.defaultBranch': "默认分支";
|
|
622
|
-
readonly 'approval.publish.artifacts': "
|
|
644
|
+
readonly 'approval.publish.artifacts': "打包文件";
|
|
623
645
|
readonly 'approval.publish.index': "索引";
|
|
624
646
|
readonly 'approval.publish.commits': "提交";
|
|
625
|
-
readonly 'approval.publish.twoCommits': "
|
|
647
|
+
readonly 'approval.publish.twoCommits': "打包文件 + market.json 两次提交,一次推送";
|
|
626
648
|
readonly 'approval.publish.reading': "读取中…";
|
|
627
649
|
readonly 'approval.publish.changelog': "{version} 的更新日志";
|
|
628
650
|
readonly 'approval.publish.changelogMissing': "这一版还没有更新日志({version}),发布会被拦下";
|
package/dist/i18n/zh.js
CHANGED
|
@@ -129,15 +129,14 @@ export const zh = {
|
|
|
129
129
|
'panels.market.update': '更新',
|
|
130
130
|
'panels.market.swapSlow': '还没换上:可能网慢或没装上。再点一次「更新」;一直这样就把 dsh 重启一遍。',
|
|
131
131
|
'panels.market.removeSlow': '还没卸掉:可能网慢或卸载没走完。等一下再看;一直这样就把 dsh 重启一遍。',
|
|
132
|
-
'panels.market.updateNoChange': '
|
|
132
|
+
'panels.market.updateNoChange': '更新失败:还是 {from};源上最新是 {latest},可以再点一次「更新」。',
|
|
133
133
|
'panels.market.updateUnknownVersion': '(问不到)',
|
|
134
|
-
'panels.market.updateGone': '
|
|
135
|
-
'panels.market.updateRestored': '
|
|
134
|
+
'panels.market.updateGone': '更新失败:更新后找不到这个模块。',
|
|
135
|
+
'panels.market.updateRestored': '更新失败:更新后找不到新版本,已把 {version} 装回去。',
|
|
136
136
|
'panels.market.updateBehind': '装上了 {installed},但源上最新是 {latest} —— 没更到最新,可以再点一次。',
|
|
137
|
-
'panels.market.selfUpdateFailed': '
|
|
137
|
+
'panels.market.selfUpdateFailed': '工作台更新失败:{reason}',
|
|
138
138
|
'panels.market.selfUpdateUnknown': '外部进程没留下原因(看 ~/.dsh/workbench/self-update.log)',
|
|
139
|
-
'panels.market.selfUpdateRolledBack': '
|
|
140
|
-
'panels.market.selfUpdateNeedsMigrate': '工作台已更新。旧会话 / 项目不会自动并:先退出所有 dsh,再运行 dsh-workbench migrate(--force 可补并)。',
|
|
139
|
+
'panels.market.selfUpdateRolledBack': '工作台更新失败,已回滚到 {version}。',
|
|
141
140
|
'panels.market.uninstall': '卸载',
|
|
142
141
|
'panels.market.uninstallLabel': '卸载 {name}',
|
|
143
142
|
'panels.market.installing': '正在安装…',
|
|
@@ -159,9 +158,27 @@ export const zh = {
|
|
|
159
158
|
'panels.market.empty': '暂无可用模块',
|
|
160
159
|
'panels.market.sectionPlugins': '已安装 opencli 插件',
|
|
161
160
|
'panels.market.moduleOutdated': '有新版',
|
|
161
|
+
'panels.market.updateNeedsWorkbench': '新版本要先把工作台升级才能用',
|
|
162
|
+
'panels.market.updateIncompatible': '新版本和当前的工作台不匹配,暂时不能更新',
|
|
162
163
|
'panels.market.moduleRefused': '模块版本与工作台不匹配,暂时无法使用',
|
|
163
164
|
'panels.market.moduleRestartHint': '重启后生效',
|
|
164
165
|
'panels.market.pendingRestart': '重启后生效',
|
|
166
|
+
'panels.market.pendingFollowUp': '旧数据待迁移',
|
|
167
|
+
'panels.market.migrationHint': '旧会话和项目还没搬过来',
|
|
168
|
+
'panels.market.migrateAction': '迁移旧数据',
|
|
169
|
+
'panels.market.migrating': '正在迁移…',
|
|
170
|
+
'panels.market.migrateConfirmTitle': '迁移旧数据?',
|
|
171
|
+
'panels.market.migrateConfirmDetail': '先退出 dsh web / Desktop。迁移只补缺、不覆盖;旧目录保留。',
|
|
172
|
+
'panels.market.migrateConfirmAck': '我已经退出 dsh web / Desktop',
|
|
173
|
+
'panels.market.migrateConfirmYes': '开始迁移',
|
|
174
|
+
'panels.market.migrateDone': '迁移完成:补了 {added} 个项目;重启工作台和 dsh web 后出现。',
|
|
175
|
+
'panels.market.dismissFollowUp': '不再提醒',
|
|
176
|
+
'panels.market.dismissing': '正在收起…',
|
|
177
|
+
'panels.market.dismissFollowUpTitle': '不再提醒这件事?',
|
|
178
|
+
'panels.market.dismissFollowUpDetail': '提示会从模块市场收起,但不会迁移或删除旧数据。旧会话和项目仍留在旧目录,新版本里看不到;以后需要时仍可运行 dsh-workbench migrate。',
|
|
179
|
+
'panels.market.dismissFollowUpAck': '我知道旧数据不会自动出现',
|
|
180
|
+
'panels.market.dismissFollowUpYes': '不再提醒',
|
|
181
|
+
'panels.market.dismissed': '已不再提醒;旧数据仍在旧目录,需要时仍可运行 dsh-workbench migrate。',
|
|
165
182
|
'panels.market.workbenchName': '工作台',
|
|
166
183
|
'panels.market.pluginBroken': '这份插件装坏了:认不出它是什么。可以先卸载,再让 agent 按包名重装一次。',
|
|
167
184
|
'panels.market.restartNeeded': '新版装好了,重启一次才生效。',
|
|
@@ -245,7 +262,7 @@ export const zh = {
|
|
|
245
262
|
'panels.market.add.exampleTitle': '示例',
|
|
246
263
|
'panels.market.add.exampleFill': '填入示例',
|
|
247
264
|
'panels.market.add.registryLabel': '安装源',
|
|
248
|
-
'panels.market.add.registryProfile': '
|
|
265
|
+
'panels.market.add.registryProfile': '这份工作台配的源',
|
|
249
266
|
'panels.market.add.registryPnpm': 'pnpm 自己配的源',
|
|
250
267
|
'panels.market.add.check': '预检',
|
|
251
268
|
'panels.market.add.checking': '正在预检…',
|
|
@@ -266,14 +283,19 @@ export const zh = {
|
|
|
266
283
|
'panels.market.tabs': '模块市场的两个面',
|
|
267
284
|
'panels.tab.discover': '发现',
|
|
268
285
|
'panels.discover.loading': '正在读取索引',
|
|
286
|
+
'panels.discover.slowHint': '读取较慢:如有授权提示,先完成它,或换一个索引源。',
|
|
269
287
|
'panels.discover.lead': '从索引源浏览模块;装上就能用。',
|
|
270
288
|
'panels.discover.addSource': '添加',
|
|
271
289
|
'panels.discover.addingSource': '正在添加…',
|
|
272
290
|
'panels.discover.addFirstSource': '添加索引源',
|
|
273
291
|
'panels.discover.removeSource': '移除',
|
|
274
292
|
'panels.discover.removeSourceNamed': '移除 {url}',
|
|
293
|
+
'panels.discover.useSource': '使用',
|
|
294
|
+
'panels.discover.useSourceNamed': '使用 {label}',
|
|
295
|
+
'panels.discover.sourceCurrent': '当前使用',
|
|
275
296
|
'panels.discover.refresh': '刷新',
|
|
276
297
|
'panels.discover.search': '搜索模块',
|
|
298
|
+
'panels.discover.clearSearch': '清除搜索',
|
|
277
299
|
'panels.discover.all': '全部',
|
|
278
300
|
'panels.discover.sourceLabel': '名字',
|
|
279
301
|
'panels.discover.sourceKind': '类型',
|
|
@@ -283,8 +305,8 @@ export const zh = {
|
|
|
283
305
|
'panels.discover.sourcePlaceholder': 'https://example.com/index.json 或 git@git.example.com:wb/market.git',
|
|
284
306
|
'panels.discover.sourceRef': '分支',
|
|
285
307
|
'panels.discover.sourcePath': '索引文件',
|
|
286
|
-
'panels.discover.sourceLocal': '
|
|
287
|
-
'panels.discover.sourceLocalHint': '
|
|
308
|
+
'panels.discover.sourceLocal': '本地副本目录(可选)',
|
|
309
|
+
'panels.discover.sourceLocalHint': '不填就放到 ~/.dsh/workbench/market-index/。',
|
|
288
310
|
'panels.discover.save': '保存并刷新',
|
|
289
311
|
'panels.discover.cancel': '取消',
|
|
290
312
|
'panels.discover.retry': '重试',
|
|
@@ -297,9 +319,9 @@ export const zh = {
|
|
|
297
319
|
'panels.discover.missingIndex': '仓库里还没有索引文件 {path}',
|
|
298
320
|
'panels.discover.initTitle': '把这个仓库初始化成模块市场索引?',
|
|
299
321
|
'panels.discover.initCta': '初始化成市场索引',
|
|
300
|
-
'panels.discover.initWhat': '会在 {branch} 分支写 market.json 与 README.md
|
|
322
|
+
'panels.discover.initWhat': '会在 {branch} 分支写 market.json 与 README.md,提交一次并推上去;之后从这个工作台发布的模块会把打包好的文件提交到 packages/<unit>/。仓库的写权限归它的所有者。',
|
|
301
323
|
'panels.discover.initBranch': '分支',
|
|
302
|
-
'panels.discover.initBranchHint': '
|
|
324
|
+
'panels.discover.initBranchHint': '索引和打包文件都发到这个分支;空仓库会新建它。',
|
|
303
325
|
'panels.discover.initBranchBad': '分支名只能用字母、数字、点、下划线、斜杠或短横线',
|
|
304
326
|
'panels.discover.initOk': '初始化',
|
|
305
327
|
'panels.discover.initBusy': '正在初始化…',
|
|
@@ -403,11 +425,11 @@ export const zh = {
|
|
|
403
425
|
'panels.market.add.doneApplied': '装好了,已经生效。',
|
|
404
426
|
'panels.market.add.doneRestart': '装好了,重启一次才生效。',
|
|
405
427
|
'panels.market.add.restartWhy': '为什么这一版要重启:{reason}',
|
|
406
|
-
'panels.market.add.restartWhy.no-hmr': '
|
|
428
|
+
'panels.market.add.restartWhy.no-hmr': '这份配置只在启动时读一次,改了得重启',
|
|
407
429
|
'panels.market.add.restartWhy.package-moved': '某个已经装着的包换到了新的目录,或者这一下换掉了 dsh 自己提供的那份',
|
|
408
430
|
'panels.market.add.restartWhy.host-module': '这一下动到了 dsh 自己加载的模块',
|
|
409
|
-
'panels.market.add.restartWhy.unmanaged-plugin': '
|
|
410
|
-
'panels.market.add.restartWhy.module-comparison': 'dsh
|
|
431
|
+
'panels.market.add.restartWhy.unmanaged-plugin': '这一下动到了没登记过、正在运行的插件',
|
|
432
|
+
'panels.market.add.restartWhy.module-comparison': 'dsh 没法确认正在跑的插件就是这台机器上装好的那一份',
|
|
411
433
|
'panels.market.add.cancelled': '已取消。',
|
|
412
434
|
'panels.market.add.failed': '没成功:{reason}',
|
|
413
435
|
'panels.market.add.removed': '已经移除了。',
|
|
@@ -417,10 +439,10 @@ export const zh = {
|
|
|
417
439
|
'panels.market.add.removedRestart': '卸掉了,重启一次才彻底生效。',
|
|
418
440
|
'panels.market.add.remove': '移除它',
|
|
419
441
|
'panels.market.add.problem.invalidSpec': '这个写法不认:不能是空的,也不能以横杠开头。',
|
|
420
|
-
'panels.market.add.problem.alreadyInstalled': '
|
|
442
|
+
'panels.market.add.problem.alreadyInstalled': '这个包已经在这份工作台里了(要换版本请带上 @版本)。',
|
|
421
443
|
'panels.market.add.problem.notFound': '源上没有这个包。换个包名或版本再试。',
|
|
422
444
|
'panels.market.add.problem.notAPackage': '这个位置没有包。选一个包含 package.json 的目录。',
|
|
423
|
-
'panels.market.add.problem.notABundle': '它是一个 npm 包,但不是 dsh
|
|
445
|
+
'panels.market.add.problem.notABundle': '它是一个 npm 包,但不是 dsh 插件包(dsh 在里面找不到该加载什么)。',
|
|
424
446
|
'panels.market.add.problem.network': '源连不上。检查网络后重试。',
|
|
425
447
|
'panels.market.add.problem.unknown': '预检没通过(原因未知)。展开安装详情看原始输出,或重试。',
|
|
426
448
|
'panels.market.add.reason.invalidSpec': '写法不认',
|
|
@@ -428,7 +450,7 @@ export const zh = {
|
|
|
428
450
|
'panels.market.add.reason.notBundle': '它不是一个 dsh 插件包',
|
|
429
451
|
'panels.market.add.reason.notRemovable': '它是安装自带的组合包,不能卸',
|
|
430
452
|
'panels.market.add.reason.bundleInUse': '还有东西在用它,卸不掉',
|
|
431
|
-
'panels.market.add.reason.stopProfile': '
|
|
453
|
+
'panels.market.add.reason.stopProfile': '这份配置改了要重启,得先停掉工作台',
|
|
432
454
|
'panels.market.add.reason.staleApproval': '要允许的安装脚本已经变了,重新来一次',
|
|
433
455
|
'panels.market.add.reason.operationError': 'pnpm 执行出错(详情见安装输出)',
|
|
434
456
|
'panels.market.add.reason.buildBlocked': 'pnpm 拦下了安装脚本',
|
|
@@ -451,15 +473,15 @@ export const zh = {
|
|
|
451
473
|
'blocker.market.open': '去模块市场',
|
|
452
474
|
'blocker.login.title': '需要登录 {platform}',
|
|
453
475
|
'blocker.login.titleGeneric': '需要登录',
|
|
454
|
-
'blocker.login.hint': '
|
|
476
|
+
'blocker.login.hint': '工作台借你浏览器里的登录状态;登录一次就行,之后不用再登。',
|
|
455
477
|
'blocker.login.go': '去登录',
|
|
456
478
|
'blocker.login.manual': '在终端执行该插件的登录命令(见插件的文档),按提示完成登录后重试。',
|
|
457
479
|
'blocker.forbidden.title': '没有权限访问 {platform}',
|
|
458
480
|
'blocker.forbidden.titleGeneric': '没有权限',
|
|
459
481
|
'blocker.forbidden.hint': '账号已登录,但没有这个项目/仓库的权限;申请之后再试。',
|
|
460
482
|
'blocker.forbidden.open': '打开权限页',
|
|
461
|
-
'blocker.timeout.hint': '
|
|
462
|
-
'blocker.exec.hint': '确认 opencli
|
|
483
|
+
'blocker.timeout.hint': '后台浏览器没起来,重试一次通常就好。',
|
|
484
|
+
'blocker.exec.hint': '确认 opencli 已经装好、在终端里能直接运行(which opencli)。',
|
|
463
485
|
'blocker.unknown.title': '出了点问题',
|
|
464
486
|
'panels.reading': '正在读取面板配置…',
|
|
465
487
|
'panels.cardBroken': '这个模块起不来:{unit}({reason})',
|
|
@@ -473,7 +495,7 @@ export const zh = {
|
|
|
473
495
|
'env.elapsed': '已等待 {seconds} 秒',
|
|
474
496
|
'env.stepFailed.install': '装不上',
|
|
475
497
|
'env.stepFailed.path': '装了但还找不到',
|
|
476
|
-
'env.stepFailed.shell': '
|
|
498
|
+
'env.stepFailed.shell': '连不上命令行',
|
|
477
499
|
'env.toolchain.ok': '正常',
|
|
478
500
|
'env.toolchain.warn': '还没完全准备好',
|
|
479
501
|
'env.opencli.ok': '已就绪',
|
|
@@ -490,10 +512,10 @@ export const zh = {
|
|
|
490
512
|
'env.fix.title': '怎么解决',
|
|
491
513
|
'env.fix.why': '工作台用它自己那份后台工具(与你在终端里那套分开装,互不影响),这台机器上还没装好它。',
|
|
492
514
|
'env.fix.whyPath': '后台工具装上了,但当前环境还找不到它 —— 通常是 PATH 或终端会话的问题。',
|
|
493
|
-
'env.fix.whyShell': '
|
|
515
|
+
'env.fix.whyShell': '工作台拿不到这台机器的命令行,所以取不了数据 —— 这一步你装不了,需要有人处理后台环境。',
|
|
494
516
|
'env.fix.step': '在终端里运行下面这条命令,装好之后点「重试」:',
|
|
495
517
|
'env.fix.stepPath': '新开一个终端窗口(或确认 npm 的全局 bin 目录在 PATH 里),然后点「重试」。',
|
|
496
|
-
'env.fix.stepShell': '重启一次工作台(或 dsh
|
|
518
|
+
'env.fix.stepShell': '重启一次工作台(或 dsh);如果反复出现,说明工作台还是拿不到命令行。',
|
|
497
519
|
'env.fix.permission': '权限不够:在命令前加 sudo 重跑,或先把 npm 的全局目录配到你的用户目录。',
|
|
498
520
|
'env.fix.network': '网络不通:检查网络或代理设置后重试。',
|
|
499
521
|
'env.fix.details': '详细输出(排障用)',
|
|
@@ -522,9 +544,9 @@ export const zh = {
|
|
|
522
544
|
'env.warm.done': '已就绪({n} 个站点)',
|
|
523
545
|
'env.warm.short': '这次没提前连上 —— 不影响用,第一次取数会自己补',
|
|
524
546
|
'env.unit.failed': '这个模块起不来',
|
|
525
|
-
'env.unit.failedHint': '
|
|
526
|
-
'env.unit.unchecked': '
|
|
527
|
-
'env.unit.uncheckedHint': '
|
|
547
|
+
'env.unit.failedHint': '它自己启动时报了错,别的模块不受影响。',
|
|
548
|
+
'env.unit.unchecked': '检测不了:拿不到命令行',
|
|
549
|
+
'env.unit.uncheckedHint': '不是这个模块的问题,是工作台拿不到命令行 —— 重启一次工作台再试。',
|
|
528
550
|
'adapterSet.not-configured': '没配置适配器集合,用默认的。',
|
|
529
551
|
'adapterSet.no-profile': '找不到 profile,没法加载适配器集合;先用默认的。',
|
|
530
552
|
'adapterSet.malformed': '适配器集合要写包名(如 @acme/adapters-set);先用默认的。',
|
|
@@ -567,7 +589,7 @@ export const zh = {
|
|
|
567
589
|
'sidebarEdition.official': '官方',
|
|
568
590
|
'sidebarEdition.officialHint': '跟 dsh 官方一致、最稳:搜索、视图选项、显示更多、归档、添加工作区都齐,升级也不等我们适配。想省心就选它。',
|
|
569
591
|
'sidebarEdition.custom': '自定义',
|
|
570
|
-
'sidebarEdition.customHint': '
|
|
592
|
+
'sidebarEdition.customHint': '为多项目工作流做的:项目下拉一屏一个项目,会话按最近更新排,名字自动滚动、两侧渐隐,工坊 DIY 新会话。项目多时更顺手。',
|
|
571
593
|
'sidebarEdition.saving': '配置中…',
|
|
572
594
|
'sidebarEdition.reloadRequired': '已写入。刷新页面后生效(不用重启工作台)。',
|
|
573
595
|
'sidebarEdition.reload': '刷新页面',
|
|
@@ -596,25 +618,25 @@ export const zh = {
|
|
|
596
618
|
'record.act.halt': '停',
|
|
597
619
|
'approval.record.site': '站点',
|
|
598
620
|
'approval.record.what': '录制功能',
|
|
599
|
-
'approval.record.lands': '
|
|
621
|
+
'approval.record.lands': '保存到',
|
|
600
622
|
'approval.record.noUrl': '没给站点地址(这次会被当场拒)',
|
|
601
623
|
'approval.record.oneAction': '一次操作',
|
|
602
624
|
'approval.record.noSwitch': '录完不会替你切回来(左栏底部会亮一条状态)',
|
|
603
|
-
'approval.longTask.what': '
|
|
604
|
-
'approval.longTask.signal': '停了只是让工作台发出中断信号 ——
|
|
625
|
+
'approval.longTask.what': '要停的那次任务',
|
|
626
|
+
'approval.longTask.signal': '停了只是让工作台发出中断信号 —— 这次任务怎么收尾由模块自己负责',
|
|
605
627
|
'approval.publish.module': '模块',
|
|
606
628
|
'approval.publish.target': '目标',
|
|
607
629
|
'approval.publish.version': '版本',
|
|
608
630
|
'approval.publish.author': '作者',
|
|
609
|
-
'approval.publish.authorMissing': '
|
|
631
|
+
'approval.publish.authorMissing': '未署名',
|
|
610
632
|
'approval.publish.registry': '源',
|
|
611
633
|
'approval.publish.repo': '仓库',
|
|
612
634
|
'approval.publish.branch': '分支',
|
|
613
635
|
'approval.publish.defaultBranch': '默认分支',
|
|
614
|
-
'approval.publish.artifacts': '
|
|
636
|
+
'approval.publish.artifacts': '打包文件',
|
|
615
637
|
'approval.publish.index': '索引',
|
|
616
638
|
'approval.publish.commits': '提交',
|
|
617
|
-
'approval.publish.twoCommits': '
|
|
639
|
+
'approval.publish.twoCommits': '打包文件 + market.json 两次提交,一次推送',
|
|
618
640
|
'approval.publish.reading': '读取中…',
|
|
619
641
|
'approval.publish.changelog': '{version} 的更新日志',
|
|
620
642
|
'approval.publish.changelogMissing': '这一版还没有更新日志({version}),发布会被拦下',
|
package/dist/lib/dsh-client.d.ts
CHANGED
|
@@ -121,11 +121,13 @@ export interface DshSlots {
|
|
|
121
121
|
onMutate?(callback: (name: string) => void): () => void;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* dsh
|
|
124
|
+
* dsh 的语言服务:按命名空间注册字典,再取回那个命名空间的文案函数;
|
|
125
|
+
* `resolveText` 按当前语言取一份字面量(字符串原样返回,映射按语言回退链取)。
|
|
125
126
|
*/
|
|
126
127
|
export interface DshLocale {
|
|
127
128
|
register(namespace: string, dictionaries: Record<string, Record<string, string>>): () => void;
|
|
128
129
|
bind(namespace: string): Translate;
|
|
130
|
+
resolveText?(text: string | Readonly<Record<string, string | undefined>>): string;
|
|
129
131
|
}
|
|
130
132
|
/**
|
|
131
133
|
* dsh 的布局服务:选面板、开关左栏、开合右栏;右栏宽度经可选的 panels 写。
|
package/dist/testing/needs.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unitTitleKey } from '../contract/unit.js';
|
|
1
2
|
export const fakeNpmSource = {
|
|
2
3
|
kind: 'npm',
|
|
3
4
|
registryEnv: 'WB_TEST_REGISTRY',
|
|
@@ -23,9 +24,11 @@ export function envNeedOf(name, extra = {}) {
|
|
|
23
24
|
return { kind: 'env', name, purpose: '测试', ...extra };
|
|
24
25
|
}
|
|
25
26
|
export function manifestOf(options = {}) {
|
|
27
|
+
const id = options.id ?? 'fixture';
|
|
26
28
|
return {
|
|
27
|
-
id
|
|
28
|
-
|
|
29
|
+
id,
|
|
30
|
+
titleKey: unitTitleKey(id),
|
|
31
|
+
card: options.card === undefined ? { order: 10 } : options.card,
|
|
29
32
|
tools: [],
|
|
30
33
|
host: { inject: [] },
|
|
31
34
|
...(options.needs === undefined ? {} : { needs: options.needs }),
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { unitTitleKey } from '../unit.js';
|
|
2
3
|
import { declarationProblemsOf, readDeclaration } from '../unit-declaration.js';
|
|
3
4
|
|
|
4
5
|
const declared = (tools: unknown) => ({
|
|
5
|
-
apiVersion:
|
|
6
|
+
apiVersion: 3,
|
|
6
7
|
unit: 'demo',
|
|
8
|
+
title: { zh: '演示', en: 'Demo' },
|
|
7
9
|
card: null,
|
|
8
10
|
tools,
|
|
9
11
|
host: { inject: [] },
|
|
@@ -50,3 +52,34 @@ describe('清单里的工具声明', () => {
|
|
|
50
52
|
expect(read.manifest?.tools).toEqual([{ name: 'workbench_demo_sync', writes: true }]);
|
|
51
53
|
});
|
|
52
54
|
});
|
|
55
|
+
|
|
56
|
+
describe('清单里的名字(v3 起名字在顶层,是字面量)', () => {
|
|
57
|
+
it('中英各一份,都有就过', () => {
|
|
58
|
+
expect(declarationProblemsOf('@t/demo', declared([]))).toEqual([]);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('少一门 / 空串 → 红,点名那一门', () => {
|
|
62
|
+
expect(declarationProblemsOf('@t/demo', { ...declared([]), title: { zh: '演示' } }).join('\n')).toMatch(
|
|
63
|
+
/title\.en/,
|
|
64
|
+
);
|
|
65
|
+
expect(
|
|
66
|
+
declarationProblemsOf('@t/demo', { ...declared([]), title: { zh: '演示', en: ' ' } }).join('\n'),
|
|
67
|
+
).toMatch(/title\.en 要是非空字符串/);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('★ v2 的老写法(card.titleKey)被点名,并给出迁移提示', () => {
|
|
71
|
+
const v2 = { ...declared([]), apiVersion: 2, card: { titleKey: 'demo.cardTitle', order: 7 } };
|
|
72
|
+
expect(declarationProblemsOf('@t/demo', v2).join('\n')).toMatch(/v3 把卡片标题挪成了顶层/);
|
|
73
|
+
const keyOnly = { ...declared([]), card: { titleKey: 'demo.cardTitle', order: 7 } };
|
|
74
|
+
expect(declarationProblemsOf('@t/demo', keyOnly).join('\n')).toMatch(/不认的键/);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('★ 清单里的名字键由外壳合成:模块不用写、也别想写', () => {
|
|
78
|
+
const read = readDeclaration('@t/demo', { ...declared([]), card: { order: 7 } });
|
|
79
|
+
|
|
80
|
+
expect(read.problems).toEqual([]);
|
|
81
|
+
expect(read.manifest?.title).toEqual({ zh: '演示', en: 'Demo' });
|
|
82
|
+
expect(read.manifest?.titleKey).toBe(unitTitleKey('demo'));
|
|
83
|
+
expect(read.manifest?.card).toEqual({ order: 7 });
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -5,7 +5,7 @@ import { needsOf, provisionableNeedsOf, type UnitManifest } from '../unit.js';
|
|
|
5
5
|
function manifest(needs?: readonly Need[]): UnitManifest {
|
|
6
6
|
return {
|
|
7
7
|
id: 'issues',
|
|
8
|
-
|
|
8
|
+
titleKey: 'issues.mine', card: { order: 10 },
|
|
9
9
|
tools: [],
|
|
10
10
|
host: { inject: [] },
|
|
11
11
|
...(needs === undefined ? {} : { needs }),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UnitTitle } from '../unit.js';
|
|
2
|
+
|
|
1
3
|
export const BUNDLE_REGISTRIES_ROUTE = 'bundle-registries';
|
|
2
4
|
|
|
3
5
|
export const BUNDLE_INSPECT_ROUTE = 'bundle-inspect';
|
|
@@ -80,7 +82,6 @@ export interface WorkbenchSelfUpdate {
|
|
|
80
82
|
readonly version?: string;
|
|
81
83
|
readonly at?: string;
|
|
82
84
|
readonly tail?: string;
|
|
83
|
-
readonly migration?: 'needed';
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export const RESTART_REASONS = [
|
|
@@ -175,11 +176,15 @@ export interface BundleCancellationPayload {
|
|
|
175
176
|
readonly cancellation: BundleCancellation | null;
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
export type ModuleUpdateBlock = 'needs-workbench' | 'incompatible';
|
|
180
|
+
|
|
178
181
|
export interface ModuleVersion {
|
|
179
182
|
readonly unit: string;
|
|
180
183
|
readonly pkg: string;
|
|
181
184
|
readonly installed: string;
|
|
185
|
+
readonly title?: UnitTitle;
|
|
182
186
|
readonly latest?: string;
|
|
187
|
+
readonly latestBlocked?: ModuleUpdateBlock;
|
|
183
188
|
readonly local?: boolean;
|
|
184
189
|
readonly refused?: readonly string[];
|
|
185
190
|
}
|
|
@@ -190,6 +195,11 @@ export interface WorkbenchVersion {
|
|
|
190
195
|
readonly latest?: string;
|
|
191
196
|
readonly running?: string;
|
|
192
197
|
readonly local?: boolean;
|
|
198
|
+
readonly followUp?: {
|
|
199
|
+
readonly id: string;
|
|
200
|
+
readonly kind: 'data-migration';
|
|
201
|
+
readonly hard: boolean;
|
|
202
|
+
};
|
|
193
203
|
}
|
|
194
204
|
|
|
195
205
|
export interface ModuleVersionsPayload {
|