@xiangyang9999/folib-server-scan-export-sync 0.0.0-stage → 1.0.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/README.md +79 -2
- package/bin/folib-scan-export-sync.js +77 -0
- package/package.json +22 -4
- package/payload//345/206/205/347/275/221/346/211/213/345/267/245/345/220/214/346/255/245/344/277/256/346/224/271/350/257/264/346/230/216.docx +0 -0
- package/payload//345/256/214/346/225/264/345/217/230/346/233/264/350/241/245/344/270/201_/344/276/233/346/240/270/345/257/271.patch +6934 -0
- package/payload//346/266/211/345/217/212/346/226/207/344/273/266_/346/214/211/345/216/237/350/267/257/345/276/204.zip +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @xiangyang9999/folib-server-scan-export-sync
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`folib-server` 扫描报告异步/定时导出功能的**离线手工同步资料包**,用于受网络限制、只能手工输入代码的环境。**不是可直接加载到 folib-server 的业务功能插件**。
|
|
4
|
+
|
|
5
|
+
- 来源 Git 提交:`a28ada525f48cf8b6ea3024d4f3eda83cc6d358a`
|
|
6
|
+
- 仅包含该提交的相关变更;已排除 `tools/scan-export/` 全目录。
|
|
7
|
+
- 涉及 50 个文件,保留原目录结构。
|
|
8
|
+
- 安装或运行此包不会修改 `folib-server` 项目文件。
|
|
9
|
+
|
|
10
|
+
## 包内文件
|
|
11
|
+
|
|
12
|
+
| 包内路径 | 说明 |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `payload/内网手工同步修改说明.docx` | Word 逐文件手敲说明:新增文件完整代码、现有文件的精确差异、同步顺序及检查项 |
|
|
15
|
+
| `payload/涉及文件_按原路径.zip` | 50 个提交版本文件,另附文件清单;保持原有项目路径 |
|
|
16
|
+
| `payload/完整变更补丁_供核对.patch` | 该提交相对父提交的完整变更,用于差异比对 |
|
|
17
|
+
|
|
18
|
+
## 安装和提取
|
|
19
|
+
|
|
20
|
+
使用 npm 包内命令,将三个资料文件复制到任意输出目录。**只复制资料,不直接把代码覆盖到项目中。**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 已发布到可访问的 npm 仓库后:
|
|
24
|
+
npx --yes --package @xiangyang9999/folib-server-scan-export-sync folib-scan-export-sync extract ./folib-sync
|
|
25
|
+
|
|
26
|
+
# 或先安装,再执行:
|
|
27
|
+
npm install @xiangyang9999/folib-server-scan-export-sync
|
|
28
|
+
npx folib-scan-export-sync list
|
|
29
|
+
npx folib-scan-export-sync extract ./folib-sync
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
命令默认不覆盖目标目录中已经存在的文件。如果需要覆盖,请显式加 `--force`:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx folib-scan-export-sync extract ./folib-sync --force
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
在不能联网的机器上,也可将生成的 `.tgz` 拷贝进去,然后:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install ./xiangyang9999-folib-server-scan-export-sync-1.0.0.tgz
|
|
42
|
+
npx folib-scan-export-sync extract ./folib-sync
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 发布到 npm 仓库(需要拥有对应 scope 的发布权限)
|
|
46
|
+
|
|
47
|
+
在 **`npm-package` 目录** 内执行:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm pack --dry-run
|
|
51
|
+
npm pack
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**优先使用内网私有 npm Registry**(例如公司已有的 npm 仓库,示例 URL 请替换):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm login --registry=https://npm.example.internal/
|
|
58
|
+
npm publish --registry=https://npm.example.internal/
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
如果已经取得源码公开分发授权、确实打算发布到公开的 npmjs.com,才运行:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm login --registry=https://registry.npmjs.org/
|
|
65
|
+
npm publish --access public --registry=https://registry.npmjs.org/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**重要提醒:本包包含项目源码及其修改差异。发布到公开 npm Registry 后,包内容可被任何人下载。发布前请确认源码授权、内部地址、凭据及其他敏感信息均允许分发。** 不要把 `--access public` 当作普通内网发布参数。
|
|
69
|
+
|
|
70
|
+
更新源代码资料后,应同步更新 `payload/` 文件,修改 `package.json` 的 `version`,再重新打包发布;npm 不能覆盖已发布的同名同版本。
|
|
71
|
+
|
|
72
|
+
## 手工同步顺序
|
|
73
|
+
|
|
74
|
+
1. 按 Word 文档先处理数据库 Liquibase 变更和后端 Repository/Adapter。
|
|
75
|
+
2. 录入后端 `export/`、Mapper、Controller 等新增文件及原代码修改。
|
|
76
|
+
3. 录入前端 API、组件、国际化和页面修改。
|
|
77
|
+
4. 对照 `.patch` 和 ZIP 源文件,核查手敲代码。
|
|
78
|
+
5. 在内网独立进行编译、数据库迁移、权限和导出功能验证。
|
|
79
|
+
|
|
80
|
+
本包只对源提交内容作离线整理,**不保证内网目标代码版本兼容,也不代表已经通过项目集成测试**。
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
|
|
7
|
+
const files = [
|
|
8
|
+
'内网手工同步修改说明.docx',
|
|
9
|
+
'涉及文件_按原路径.zip',
|
|
10
|
+
'完整变更补丁_供核对.patch',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const sourceDir = path.resolve(__dirname, '..', 'payload');
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
|
|
16
|
+
function usage() {
|
|
17
|
+
process.stdout.write(
|
|
18
|
+
'用法:\n' +
|
|
19
|
+
' folib-scan-export-sync list\n' +
|
|
20
|
+
' folib-scan-export-sync extract <输出目录> [--force]\n' +
|
|
21
|
+
' folib-scan-export-sync --help\n\n' +
|
|
22
|
+
'extract 只复制手工同步资料,默认拒绝覆盖已有文件。\n'
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function main() {
|
|
27
|
+
const command = args[0] || '--help';
|
|
28
|
+
if (command === '--help' || command === '-h' || command === 'help') {
|
|
29
|
+
usage();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
for (const file of files) {
|
|
34
|
+
const src = path.join(sourceDir, file);
|
|
35
|
+
if (!fs.statSync(src).isFile()) {
|
|
36
|
+
throw new Error('缺少包内文件: ' + src);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (command === 'list') {
|
|
41
|
+
for (const file of files) {
|
|
42
|
+
const bytes = fs.statSync(path.join(sourceDir, file)).size;
|
|
43
|
+
process.stdout.write(file + ' (' + bytes + ' bytes)\n');
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (command !== 'extract' || !args[1] || args.some((a, i) => i >= 2 && a !== '--force')) {
|
|
49
|
+
usage();
|
|
50
|
+
process.exitCode = 2;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const force = args.includes('--force');
|
|
55
|
+
const outDir = path.resolve(args[1]);
|
|
56
|
+
const targets = files.map((file) => ({ src: path.join(sourceDir, file), dst: path.join(outDir, file) }));
|
|
57
|
+
|
|
58
|
+
if (!force) {
|
|
59
|
+
const existing = targets.filter(({ dst }) => fs.existsSync(dst));
|
|
60
|
+
if (existing.length > 0) {
|
|
61
|
+
throw new Error('为避免覆盖,已停止。目标文件已存在: ' + existing.map(({ dst }) => dst).join(', ') + ';需要覆盖时加 --force');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
66
|
+
for (const { src, dst } of targets) {
|
|
67
|
+
fs.copyFileSync(src, dst, force ? 0 : fs.constants.COPYFILE_EXCL);
|
|
68
|
+
process.stdout.write('已复制: ' + dst + '\n');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
main();
|
|
74
|
+
} catch (err) {
|
|
75
|
+
process.stderr.write('错误: ' + err.message + '\n');
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiangyang9999/folib-server-scan-export-sync",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Offline manual-sync bundle for folib-server artifact scan report export commit a28ada52 (Word, source archive and diff).",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"bin": {
|
|
7
|
+
"folib-scan-export-sync": "./bin/folib-scan-export-sync.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"payload/",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=16"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"folib-server",
|
|
19
|
+
"scan-export",
|
|
20
|
+
"offline-sync",
|
|
21
|
+
"manual-migration",
|
|
22
|
+
"internal-code"
|
|
23
|
+
]
|
|
24
|
+
}
|