dsh-cite 0.4.0 → 0.4.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/CHANGELOG.md +4 -0
- package/docs/CHANGELOG.en.md +4 -0
- package/docs/VALIDATION.md +2 -2
- package/lib/citation-worker.js +5 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/docs/CHANGELOG.en.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
These English notes preserve the earlier translations. The main changelog contains the consolidated version history.
|
|
6
6
|
|
|
7
|
+
## 0.4.1 (2026-10-03)
|
|
8
|
+
|
|
9
|
+
Fixes re-importing exported BibTeX containing publisher lists. Publisher names and original sources remain intact. All 41 Windows tests and re-importing the actual browser download pass.
|
|
10
|
+
|
|
7
11
|
## 0.4.0 (2026-10-03)
|
|
8
12
|
|
|
9
13
|
Adds a Chinese / English citation workbench and `cite_batch` for offline DOI / BibTeX preview, selective import, duplicate review, search and basic citation exports. Explicit Crossref enrichment fills empty fields, retains local differences and supports progress, cancellation and retry. Original input is preserved in full backups; revision checks protect concurrent changes. The existing five tools remain available.
|
package/docs/VALIDATION.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
本页整理原 README 的历史验证说明,保留当时的版本、日期与范围。自动测试、启动检查、浏览器操作和真实服务验收分别记录,不能相互替代。更详细的版本验收文件仍保留在仓库中。
|
|
4
4
|
|
|
5
|
-
## 0.4.0
|
|
5
|
+
## 0.4.1(含 0.4.0 功能,2026-10-03)
|
|
6
6
|
|
|
7
|
-
- Windows:
|
|
7
|
+
- Windows:41 项自动测试全部通过,无跳过。覆盖嵌套 BibTeX、宏、机构作者、复合姓氏、出版社列表的导出再导入、畸形输入、容量边界、精确与候选重复、并发修订冲突、部分失败重试、取消不写入、元数据差异保留和英文错误信息。
|
|
8
8
|
- 宿主契约:官方源码构建的 RC2(639ed015)和公开 npm 包 `0.2.1-alpha.1` 均在 E 盘隔离环境测试;18 插件共同注册 110 工具、35 技能,19 输出样例通过 schema 检查。未配置真实账号的健康检查可返回未配置,这不表示真实服务连接通过。
|
|
9
9
|
- 可见浏览器操作:官方 alpha 的设置页中实际上传 `.bib`、本地预览、选择保存、关闭 / 重开设置保留输入、搜索、引文预览及三种下载。DOI 大小写与链接形式的重复被跳过,错误行不可保存。中英文切换使用同一份两条题录的文献库,修订与原始资料未改变;390px 布局另作可见检查。
|
|
10
10
|
- 真实 Crossref:显式查询 `10.1038/nature12345`,作者、年份等空字段已补全;本地测试标题被保留,实际提供者标题作为差异显示。曾出现网络请求失败,重试后成功;不把网络波动当作已定位或修复的代理问题。没有 DOI 的条目显示单独失败。
|
package/lib/citation-worker.js
CHANGED
|
@@ -2,13 +2,16 @@ import { parentPort, workerData } from 'node:worker_threads';
|
|
|
2
2
|
import { Cite } from '@citation-js/core';
|
|
3
3
|
import '@citation-js/plugin-bibtex';
|
|
4
4
|
import { assertDoi } from './crossref.js';
|
|
5
|
-
import { MAX_BATCH, normalizeWork, workWarnings } from './citation-model.js';
|
|
5
|
+
import { MAX_BATCH, normalizeWork, plainText, workWarnings } from './citation-model.js';
|
|
6
6
|
const types = { 'article-journal': 'journal-article', book: 'book', chapter: 'book-chapter', 'paper-conference': 'proceedings-article', thesis: 'dissertation', report: 'report', dataset: 'dataset', patent: 'patent', standard: 'standard' };
|
|
7
|
+
// Citation.js treats BibTeX's publisher "and" separator as a list. The local
|
|
8
|
+
// Work model is plain text; preserve these names and retain the original source.
|
|
9
|
+
const cslText = (value) => Array.isArray(value) ? value.map(plainText).join(' and ') : plainText(value);
|
|
7
10
|
function workOf(csl) {
|
|
8
11
|
return normalizeWork({
|
|
9
12
|
doi: csl.DOI, type: types[csl.type] || 'other', title: csl.title,
|
|
10
13
|
authors: (csl.author || []).map(a => { const family = [a['non-dropping-particle'], a.family, a.suffix].filter(Boolean).join(' '); const given = [a.given, a['dropping-particle']].filter(Boolean).join(' '); return a.literal || !given ? { name: a.literal || family, family: '', given: '' } : { name: '', family, given }; }),
|
|
11
|
-
containerTitle: csl['container-title'], publisher: csl.publisher, year: Number(csl.issued?.['date-parts']?.[0]?.[0] || 0), language: csl.language, volume: csl.volume, issue: csl.issue, page: csl.page, url: csl.URL, isbn: csl.ISBN,
|
|
14
|
+
containerTitle: cslText(csl['container-title']), publisher: cslText(csl.publisher), year: Number(csl.issued?.['date-parts']?.[0]?.[0] || 0), language: csl.language, volume: csl.volume, issue: csl.issue, page: csl.page, url: csl.URL, isbn: csl.ISBN,
|
|
12
15
|
});
|
|
13
16
|
}
|
|
14
17
|
try {
|