@open-feishu-card/cli 0.1.1 → 0.1.3
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/cli.cjs +120 -0
- package/dist/cli.js +95 -113
- package/dist/index.cjs +120 -0
- package/dist/index.js +118 -2
- package/package.json +11 -8
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var fs = require('fs');
|
|
5
|
+
var parser = require('@open-feishu-card/parser');
|
|
6
|
+
var validator = require('@open-feishu-card/validator');
|
|
7
|
+
var linter = require('@open-feishu-card/linter');
|
|
8
|
+
var compiler = require('@open-feishu-card/compiler');
|
|
9
|
+
|
|
10
|
+
function parseArgs(argv) {
|
|
11
|
+
const [command, ...rest] = argv;
|
|
12
|
+
const files = [];
|
|
13
|
+
const args = { command: command ?? "", files };
|
|
14
|
+
for (let i = 0; i < rest.length; i++) {
|
|
15
|
+
const a = rest[i];
|
|
16
|
+
if (a === "--out") args.out = rest[++i];
|
|
17
|
+
else if (a === "--check") args.check = true;
|
|
18
|
+
else files.push(a);
|
|
19
|
+
}
|
|
20
|
+
return args;
|
|
21
|
+
}
|
|
22
|
+
function fmtPos(p) {
|
|
23
|
+
return `${p.line}:${p.column}`;
|
|
24
|
+
}
|
|
25
|
+
function loadSource(file) {
|
|
26
|
+
return fs.readFileSync(file, "utf8");
|
|
27
|
+
}
|
|
28
|
+
function cmdLint(files, schemaOnly) {
|
|
29
|
+
let hasError = false;
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
const src = loadSource(file);
|
|
32
|
+
const parsed = parser.parse(src);
|
|
33
|
+
const vdiags = validator.validateAst(parsed);
|
|
34
|
+
const { ast } = parsed;
|
|
35
|
+
const ldiags = schemaOnly ? [] : linter.lintAst(ast);
|
|
36
|
+
const all = [
|
|
37
|
+
...vdiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: d.message })),
|
|
38
|
+
...ldiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: `[${d.rule}] ${d.message}` }))
|
|
39
|
+
].sort((a, b) => a.line - b.line || a.col - b.col);
|
|
40
|
+
for (const d of all) {
|
|
41
|
+
const tag = d.sev === "error" ? "error" : d.sev === "warning" ? "warn" : "info";
|
|
42
|
+
console.error(`${file}:${fmtPos({ line: d.line, column: d.col })} ${tag} ${d.msg}`);
|
|
43
|
+
if (d.sev === "error") hasError = true;
|
|
44
|
+
}
|
|
45
|
+
console.error(`\u2714 ${file}: ${all.filter((d) => d.sev === "error").length} errors, ${all.length} diagnostics`);
|
|
46
|
+
}
|
|
47
|
+
return hasError ? 1 : 0;
|
|
48
|
+
}
|
|
49
|
+
function cmdClean(file, out, check) {
|
|
50
|
+
const src = loadSource(file);
|
|
51
|
+
const { data } = parser.parse(src);
|
|
52
|
+
const { card, stripped } = compiler.sanitize(data, { mode: "strip" });
|
|
53
|
+
if (check) {
|
|
54
|
+
if (stripped.length > 0) {
|
|
55
|
+
console.error(`${file}: \u53D1\u73B0 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027:`);
|
|
56
|
+
for (const p of stripped) console.error(` - ${p}`);
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
console.error(`${file}: \u5E72\u51C0\uFF0C\u65E0\u975E\u6807\u5C5E\u6027`);
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
const target = out ?? file;
|
|
63
|
+
fs.writeFileSync(target, JSON.stringify(card, null, 2) + "\n");
|
|
64
|
+
console.error(`\u5DF2\u51C0\u5316 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027 \u2192 ${target}`);
|
|
65
|
+
for (const p of stripped) console.error(` - \u5265\u79BB ${p}`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
function cmdFormat(file, out) {
|
|
69
|
+
const { data, errors } = parser.parse(loadSource(file));
|
|
70
|
+
if (errors.length) {
|
|
71
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
const target = out ?? file;
|
|
75
|
+
fs.writeFileSync(target, JSON.stringify(data, null, 2) + "\n");
|
|
76
|
+
console.error(`\u5DF2\u683C\u5F0F\u5316 \u2192 ${target}`);
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
function cmdBuild(file, out) {
|
|
80
|
+
const { data, errors } = parser.parse(loadSource(file));
|
|
81
|
+
if (errors.length) {
|
|
82
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
83
|
+
return 1;
|
|
84
|
+
}
|
|
85
|
+
const { raw } = compiler.compile(data);
|
|
86
|
+
if (out) {
|
|
87
|
+
fs.writeFileSync(out, JSON.stringify(raw, null, 2) + "\n");
|
|
88
|
+
console.error(`\u5DF2\u7F16\u8BD1 RAW \u2192 ${out}`);
|
|
89
|
+
} else {
|
|
90
|
+
console.log(JSON.stringify(raw, null, 2));
|
|
91
|
+
}
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
function run(argv = process.argv.slice(2)) {
|
|
95
|
+
const { command, files, out, check } = parseArgs(argv);
|
|
96
|
+
if (!command || files.length === 0) {
|
|
97
|
+
console.error("\u7528\u6CD5: open-feishu-card <lint|validate|clean|format|build> <file...> [--out file] [--check]");
|
|
98
|
+
return 2;
|
|
99
|
+
}
|
|
100
|
+
switch (command) {
|
|
101
|
+
case "lint":
|
|
102
|
+
return cmdLint(files, false);
|
|
103
|
+
case "validate":
|
|
104
|
+
return cmdLint(files, true);
|
|
105
|
+
case "clean":
|
|
106
|
+
return cmdClean(files[0], out, check);
|
|
107
|
+
case "format":
|
|
108
|
+
return cmdFormat(files[0], out);
|
|
109
|
+
case "build":
|
|
110
|
+
return cmdBuild(files[0], out);
|
|
111
|
+
default:
|
|
112
|
+
console.error(`\u672A\u77E5\u547D\u4EE4: ${command}`);
|
|
113
|
+
return 2;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (process.argv[1] && process.argv[1].endsWith("cli.js")) {
|
|
117
|
+
process.exit(run());
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
exports.run = run;
|
package/dist/cli.js
CHANGED
|
@@ -1,136 +1,118 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
* open-feishu-card CLI
|
|
4
|
-
*
|
|
5
|
-
* 用法:
|
|
6
|
-
* open-feishu-card lint <file...> 校验(Schema + 最佳实践)
|
|
7
|
-
* open-feishu-card validate <file...> 仅 Schema 校验
|
|
8
|
-
* open-feishu-card clean <file> [--out <file>] [--check] 剥离非标属性并写回
|
|
9
|
-
* open-feishu-card format <file> 格式化(2 空格 JSON)
|
|
10
|
-
* open-feishu-card build <file> [--out <file>] 编译为渲染器 RAW JSON
|
|
11
|
-
*/
|
|
12
|
-
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { writeFileSync, readFileSync } from 'fs';
|
|
13
3
|
import { parse } from '@open-feishu-card/parser';
|
|
14
4
|
import { validateAst } from '@open-feishu-card/validator';
|
|
15
5
|
import { lintAst } from '@open-feishu-card/linter';
|
|
16
|
-
import {
|
|
6
|
+
import { compile, sanitize } from '@open-feishu-card/compiler';
|
|
7
|
+
|
|
17
8
|
function parseArgs(argv) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
files.push(a);
|
|
29
|
-
}
|
|
30
|
-
return args;
|
|
9
|
+
const [command, ...rest] = argv;
|
|
10
|
+
const files = [];
|
|
11
|
+
const args = { command: command ?? "", files };
|
|
12
|
+
for (let i = 0; i < rest.length; i++) {
|
|
13
|
+
const a = rest[i];
|
|
14
|
+
if (a === "--out") args.out = rest[++i];
|
|
15
|
+
else if (a === "--check") args.check = true;
|
|
16
|
+
else files.push(a);
|
|
17
|
+
}
|
|
18
|
+
return args;
|
|
31
19
|
}
|
|
32
20
|
function fmtPos(p) {
|
|
33
|
-
|
|
21
|
+
return `${p.line}:${p.column}`;
|
|
34
22
|
}
|
|
35
23
|
function loadSource(file) {
|
|
36
|
-
|
|
24
|
+
return readFileSync(file, "utf8");
|
|
37
25
|
}
|
|
38
26
|
function cmdLint(files, schemaOnly) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
hasError = true;
|
|
55
|
-
}
|
|
56
|
-
console.error(`✔ ${file}: ${all.filter((d) => d.sev === 'error').length} errors, ${all.length} diagnostics`);
|
|
27
|
+
let hasError = false;
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
const src = loadSource(file);
|
|
30
|
+
const parsed = parse(src);
|
|
31
|
+
const vdiags = validateAst(parsed);
|
|
32
|
+
const { ast } = parsed;
|
|
33
|
+
const ldiags = schemaOnly ? [] : lintAst(ast);
|
|
34
|
+
const all = [
|
|
35
|
+
...vdiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: d.message })),
|
|
36
|
+
...ldiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: `[${d.rule}] ${d.message}` }))
|
|
37
|
+
].sort((a, b) => a.line - b.line || a.col - b.col);
|
|
38
|
+
for (const d of all) {
|
|
39
|
+
const tag = d.sev === "error" ? "error" : d.sev === "warning" ? "warn" : "info";
|
|
40
|
+
console.error(`${file}:${fmtPos({ line: d.line, column: d.col })} ${tag} ${d.msg}`);
|
|
41
|
+
if (d.sev === "error") hasError = true;
|
|
57
42
|
}
|
|
58
|
-
|
|
43
|
+
console.error(`\u2714 ${file}: ${all.filter((d) => d.sev === "error").length} errors, ${all.length} diagnostics`);
|
|
44
|
+
}
|
|
45
|
+
return hasError ? 1 : 0;
|
|
59
46
|
}
|
|
60
47
|
function cmdClean(file, out, check) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return 1;
|
|
70
|
-
}
|
|
71
|
-
console.error(`${file}: 干净,无非标属性`);
|
|
72
|
-
return 0;
|
|
48
|
+
const src = loadSource(file);
|
|
49
|
+
const { data } = parse(src);
|
|
50
|
+
const { card, stripped } = sanitize(data, { mode: "strip" });
|
|
51
|
+
if (check) {
|
|
52
|
+
if (stripped.length > 0) {
|
|
53
|
+
console.error(`${file}: \u53D1\u73B0 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027:`);
|
|
54
|
+
for (const p of stripped) console.error(` - ${p}`);
|
|
55
|
+
return 1;
|
|
73
56
|
}
|
|
74
|
-
|
|
75
|
-
writeFileSync(target, JSON.stringify(card, null, 2) + '\n');
|
|
76
|
-
console.error(`已净化 ${stripped.length} 个非标属性 → ${target}`);
|
|
77
|
-
for (const p of stripped)
|
|
78
|
-
console.error(` - 剥离 ${p}`);
|
|
57
|
+
console.error(`${file}: \u5E72\u51C0\uFF0C\u65E0\u975E\u6807\u5C5E\u6027`);
|
|
79
58
|
return 0;
|
|
59
|
+
}
|
|
60
|
+
const target = out ?? file;
|
|
61
|
+
writeFileSync(target, JSON.stringify(card, null, 2) + "\n");
|
|
62
|
+
console.error(`\u5DF2\u51C0\u5316 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027 \u2192 ${target}`);
|
|
63
|
+
for (const p of stripped) console.error(` - \u5265\u79BB ${p}`);
|
|
64
|
+
return 0;
|
|
80
65
|
}
|
|
81
66
|
function cmdFormat(file, out) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return 0;
|
|
67
|
+
const { data, errors } = parse(loadSource(file));
|
|
68
|
+
if (errors.length) {
|
|
69
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
const target = out ?? file;
|
|
73
|
+
writeFileSync(target, JSON.stringify(data, null, 2) + "\n");
|
|
74
|
+
console.error(`\u5DF2\u683C\u5F0F\u5316 \u2192 ${target}`);
|
|
75
|
+
return 0;
|
|
92
76
|
}
|
|
93
77
|
function cmdBuild(file, out) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
return 0;
|
|
78
|
+
const { data, errors } = parse(loadSource(file));
|
|
79
|
+
if (errors.length) {
|
|
80
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
const { raw } = compile(data);
|
|
84
|
+
if (out) {
|
|
85
|
+
writeFileSync(out, JSON.stringify(raw, null, 2) + "\n");
|
|
86
|
+
console.error(`\u5DF2\u7F16\u8BD1 RAW \u2192 ${out}`);
|
|
87
|
+
} else {
|
|
88
|
+
console.log(JSON.stringify(raw, null, 2));
|
|
89
|
+
}
|
|
90
|
+
return 0;
|
|
109
91
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
92
|
+
function run(argv = process.argv.slice(2)) {
|
|
93
|
+
const { command, files, out, check } = parseArgs(argv);
|
|
94
|
+
if (!command || files.length === 0) {
|
|
95
|
+
console.error("\u7528\u6CD5: open-feishu-card <lint|validate|clean|format|build> <file...> [--out file] [--check]");
|
|
96
|
+
return 2;
|
|
97
|
+
}
|
|
98
|
+
switch (command) {
|
|
99
|
+
case "lint":
|
|
100
|
+
return cmdLint(files, false);
|
|
101
|
+
case "validate":
|
|
102
|
+
return cmdLint(files, true);
|
|
103
|
+
case "clean":
|
|
104
|
+
return cmdClean(files[0], out, check);
|
|
105
|
+
case "format":
|
|
106
|
+
return cmdFormat(files[0], out);
|
|
107
|
+
case "build":
|
|
108
|
+
return cmdBuild(files[0], out);
|
|
109
|
+
default:
|
|
110
|
+
console.error(`\u672A\u77E5\u547D\u4EE4: ${command}`);
|
|
111
|
+
return 2;
|
|
112
|
+
}
|
|
131
113
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
process.exit(run());
|
|
114
|
+
if (process.argv[1] && process.argv[1].endsWith("cli.js")) {
|
|
115
|
+
process.exit(run());
|
|
135
116
|
}
|
|
136
|
-
|
|
117
|
+
|
|
118
|
+
export { run };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fs = require('fs');
|
|
4
|
+
var parser = require('@open-feishu-card/parser');
|
|
5
|
+
var validator = require('@open-feishu-card/validator');
|
|
6
|
+
var linter = require('@open-feishu-card/linter');
|
|
7
|
+
var compiler = require('@open-feishu-card/compiler');
|
|
8
|
+
|
|
9
|
+
// src/cli.ts
|
|
10
|
+
function parseArgs(argv) {
|
|
11
|
+
const [command, ...rest] = argv;
|
|
12
|
+
const files = [];
|
|
13
|
+
const args = { command: command ?? "", files };
|
|
14
|
+
for (let i = 0; i < rest.length; i++) {
|
|
15
|
+
const a = rest[i];
|
|
16
|
+
if (a === "--out") args.out = rest[++i];
|
|
17
|
+
else if (a === "--check") args.check = true;
|
|
18
|
+
else files.push(a);
|
|
19
|
+
}
|
|
20
|
+
return args;
|
|
21
|
+
}
|
|
22
|
+
function fmtPos(p) {
|
|
23
|
+
return `${p.line}:${p.column}`;
|
|
24
|
+
}
|
|
25
|
+
function loadSource(file) {
|
|
26
|
+
return fs.readFileSync(file, "utf8");
|
|
27
|
+
}
|
|
28
|
+
function cmdLint(files, schemaOnly) {
|
|
29
|
+
let hasError = false;
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
const src = loadSource(file);
|
|
32
|
+
const parsed = parser.parse(src);
|
|
33
|
+
const vdiags = validator.validateAst(parsed);
|
|
34
|
+
const { ast } = parsed;
|
|
35
|
+
const ldiags = schemaOnly ? [] : linter.lintAst(ast);
|
|
36
|
+
const all = [
|
|
37
|
+
...vdiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: d.message })),
|
|
38
|
+
...ldiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: `[${d.rule}] ${d.message}` }))
|
|
39
|
+
].sort((a, b) => a.line - b.line || a.col - b.col);
|
|
40
|
+
for (const d of all) {
|
|
41
|
+
const tag = d.sev === "error" ? "error" : d.sev === "warning" ? "warn" : "info";
|
|
42
|
+
console.error(`${file}:${fmtPos({ line: d.line, column: d.col })} ${tag} ${d.msg}`);
|
|
43
|
+
if (d.sev === "error") hasError = true;
|
|
44
|
+
}
|
|
45
|
+
console.error(`\u2714 ${file}: ${all.filter((d) => d.sev === "error").length} errors, ${all.length} diagnostics`);
|
|
46
|
+
}
|
|
47
|
+
return hasError ? 1 : 0;
|
|
48
|
+
}
|
|
49
|
+
function cmdClean(file, out, check) {
|
|
50
|
+
const src = loadSource(file);
|
|
51
|
+
const { data } = parser.parse(src);
|
|
52
|
+
const { card, stripped } = compiler.sanitize(data, { mode: "strip" });
|
|
53
|
+
if (check) {
|
|
54
|
+
if (stripped.length > 0) {
|
|
55
|
+
console.error(`${file}: \u53D1\u73B0 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027:`);
|
|
56
|
+
for (const p of stripped) console.error(` - ${p}`);
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
console.error(`${file}: \u5E72\u51C0\uFF0C\u65E0\u975E\u6807\u5C5E\u6027`);
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
const target = out ?? file;
|
|
63
|
+
fs.writeFileSync(target, JSON.stringify(card, null, 2) + "\n");
|
|
64
|
+
console.error(`\u5DF2\u51C0\u5316 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027 \u2192 ${target}`);
|
|
65
|
+
for (const p of stripped) console.error(` - \u5265\u79BB ${p}`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
function cmdFormat(file, out) {
|
|
69
|
+
const { data, errors } = parser.parse(loadSource(file));
|
|
70
|
+
if (errors.length) {
|
|
71
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
const target = out ?? file;
|
|
75
|
+
fs.writeFileSync(target, JSON.stringify(data, null, 2) + "\n");
|
|
76
|
+
console.error(`\u5DF2\u683C\u5F0F\u5316 \u2192 ${target}`);
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
function cmdBuild(file, out) {
|
|
80
|
+
const { data, errors } = parser.parse(loadSource(file));
|
|
81
|
+
if (errors.length) {
|
|
82
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
83
|
+
return 1;
|
|
84
|
+
}
|
|
85
|
+
const { raw } = compiler.compile(data);
|
|
86
|
+
if (out) {
|
|
87
|
+
fs.writeFileSync(out, JSON.stringify(raw, null, 2) + "\n");
|
|
88
|
+
console.error(`\u5DF2\u7F16\u8BD1 RAW \u2192 ${out}`);
|
|
89
|
+
} else {
|
|
90
|
+
console.log(JSON.stringify(raw, null, 2));
|
|
91
|
+
}
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
function run(argv = process.argv.slice(2)) {
|
|
95
|
+
const { command, files, out, check } = parseArgs(argv);
|
|
96
|
+
if (!command || files.length === 0) {
|
|
97
|
+
console.error("\u7528\u6CD5: open-feishu-card <lint|validate|clean|format|build> <file...> [--out file] [--check]");
|
|
98
|
+
return 2;
|
|
99
|
+
}
|
|
100
|
+
switch (command) {
|
|
101
|
+
case "lint":
|
|
102
|
+
return cmdLint(files, false);
|
|
103
|
+
case "validate":
|
|
104
|
+
return cmdLint(files, true);
|
|
105
|
+
case "clean":
|
|
106
|
+
return cmdClean(files[0], out, check);
|
|
107
|
+
case "format":
|
|
108
|
+
return cmdFormat(files[0], out);
|
|
109
|
+
case "build":
|
|
110
|
+
return cmdBuild(files[0], out);
|
|
111
|
+
default:
|
|
112
|
+
console.error(`\u672A\u77E5\u547D\u4EE4: ${command}`);
|
|
113
|
+
return 2;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (process.argv[1] && process.argv[1].endsWith("cli.js")) {
|
|
117
|
+
process.exit(run());
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
exports.run = run;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,118 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { writeFileSync, readFileSync } from 'fs';
|
|
2
|
+
import { parse } from '@open-feishu-card/parser';
|
|
3
|
+
import { validateAst } from '@open-feishu-card/validator';
|
|
4
|
+
import { lintAst } from '@open-feishu-card/linter';
|
|
5
|
+
import { compile, sanitize } from '@open-feishu-card/compiler';
|
|
6
|
+
|
|
7
|
+
// src/cli.ts
|
|
8
|
+
function parseArgs(argv) {
|
|
9
|
+
const [command, ...rest] = argv;
|
|
10
|
+
const files = [];
|
|
11
|
+
const args = { command: command ?? "", files };
|
|
12
|
+
for (let i = 0; i < rest.length; i++) {
|
|
13
|
+
const a = rest[i];
|
|
14
|
+
if (a === "--out") args.out = rest[++i];
|
|
15
|
+
else if (a === "--check") args.check = true;
|
|
16
|
+
else files.push(a);
|
|
17
|
+
}
|
|
18
|
+
return args;
|
|
19
|
+
}
|
|
20
|
+
function fmtPos(p) {
|
|
21
|
+
return `${p.line}:${p.column}`;
|
|
22
|
+
}
|
|
23
|
+
function loadSource(file) {
|
|
24
|
+
return readFileSync(file, "utf8");
|
|
25
|
+
}
|
|
26
|
+
function cmdLint(files, schemaOnly) {
|
|
27
|
+
let hasError = false;
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
const src = loadSource(file);
|
|
30
|
+
const parsed = parse(src);
|
|
31
|
+
const vdiags = validateAst(parsed);
|
|
32
|
+
const { ast } = parsed;
|
|
33
|
+
const ldiags = schemaOnly ? [] : lintAst(ast);
|
|
34
|
+
const all = [
|
|
35
|
+
...vdiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: d.message })),
|
|
36
|
+
...ldiags.map((d) => ({ sev: d.severity, line: d.range.start.line, col: d.range.start.column, msg: `[${d.rule}] ${d.message}` }))
|
|
37
|
+
].sort((a, b) => a.line - b.line || a.col - b.col);
|
|
38
|
+
for (const d of all) {
|
|
39
|
+
const tag = d.sev === "error" ? "error" : d.sev === "warning" ? "warn" : "info";
|
|
40
|
+
console.error(`${file}:${fmtPos({ line: d.line, column: d.col })} ${tag} ${d.msg}`);
|
|
41
|
+
if (d.sev === "error") hasError = true;
|
|
42
|
+
}
|
|
43
|
+
console.error(`\u2714 ${file}: ${all.filter((d) => d.sev === "error").length} errors, ${all.length} diagnostics`);
|
|
44
|
+
}
|
|
45
|
+
return hasError ? 1 : 0;
|
|
46
|
+
}
|
|
47
|
+
function cmdClean(file, out, check) {
|
|
48
|
+
const src = loadSource(file);
|
|
49
|
+
const { data } = parse(src);
|
|
50
|
+
const { card, stripped } = sanitize(data, { mode: "strip" });
|
|
51
|
+
if (check) {
|
|
52
|
+
if (stripped.length > 0) {
|
|
53
|
+
console.error(`${file}: \u53D1\u73B0 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027:`);
|
|
54
|
+
for (const p of stripped) console.error(` - ${p}`);
|
|
55
|
+
return 1;
|
|
56
|
+
}
|
|
57
|
+
console.error(`${file}: \u5E72\u51C0\uFF0C\u65E0\u975E\u6807\u5C5E\u6027`);
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
const target = out ?? file;
|
|
61
|
+
writeFileSync(target, JSON.stringify(card, null, 2) + "\n");
|
|
62
|
+
console.error(`\u5DF2\u51C0\u5316 ${stripped.length} \u4E2A\u975E\u6807\u5C5E\u6027 \u2192 ${target}`);
|
|
63
|
+
for (const p of stripped) console.error(` - \u5265\u79BB ${p}`);
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
function cmdFormat(file, out) {
|
|
67
|
+
const { data, errors } = parse(loadSource(file));
|
|
68
|
+
if (errors.length) {
|
|
69
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
const target = out ?? file;
|
|
73
|
+
writeFileSync(target, JSON.stringify(data, null, 2) + "\n");
|
|
74
|
+
console.error(`\u5DF2\u683C\u5F0F\u5316 \u2192 ${target}`);
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
function cmdBuild(file, out) {
|
|
78
|
+
const { data, errors } = parse(loadSource(file));
|
|
79
|
+
if (errors.length) {
|
|
80
|
+
for (const e of errors) console.error(`${file}:${fmtPos(e.range.start)} error ${e.message}`);
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
const { raw } = compile(data);
|
|
84
|
+
if (out) {
|
|
85
|
+
writeFileSync(out, JSON.stringify(raw, null, 2) + "\n");
|
|
86
|
+
console.error(`\u5DF2\u7F16\u8BD1 RAW \u2192 ${out}`);
|
|
87
|
+
} else {
|
|
88
|
+
console.log(JSON.stringify(raw, null, 2));
|
|
89
|
+
}
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
function run(argv = process.argv.slice(2)) {
|
|
93
|
+
const { command, files, out, check } = parseArgs(argv);
|
|
94
|
+
if (!command || files.length === 0) {
|
|
95
|
+
console.error("\u7528\u6CD5: open-feishu-card <lint|validate|clean|format|build> <file...> [--out file] [--check]");
|
|
96
|
+
return 2;
|
|
97
|
+
}
|
|
98
|
+
switch (command) {
|
|
99
|
+
case "lint":
|
|
100
|
+
return cmdLint(files, false);
|
|
101
|
+
case "validate":
|
|
102
|
+
return cmdLint(files, true);
|
|
103
|
+
case "clean":
|
|
104
|
+
return cmdClean(files[0], out, check);
|
|
105
|
+
case "format":
|
|
106
|
+
return cmdFormat(files[0], out);
|
|
107
|
+
case "build":
|
|
108
|
+
return cmdBuild(files[0], out);
|
|
109
|
+
default:
|
|
110
|
+
console.error(`\u672A\u77E5\u547D\u4EE4: ${command}`);
|
|
111
|
+
return 2;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (process.argv[1] && process.argv[1].endsWith("cli.js")) {
|
|
115
|
+
process.exit(run());
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export { run };
|
package/package.json
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-feishu-card/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "飞书卡片命令行工具:lint 校验、validate、clean 净化非标属性、format 格式化",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"open-feishu-card": "./dist/cli.js"
|
|
8
8
|
},
|
|
9
|
-
"main": "./dist/index.
|
|
9
|
+
"main": "./dist/index.cjs",
|
|
10
|
+
"module": "./dist/index.js",
|
|
10
11
|
"types": "./dist/index.d.ts",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
14
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.js"
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
15
17
|
}
|
|
16
18
|
},
|
|
17
19
|
"files": [
|
|
18
20
|
"dist"
|
|
19
21
|
],
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"@open-feishu-card/compiler": "0.1.
|
|
22
|
-
"@open-feishu-card/linter": "0.1.
|
|
23
|
-
"@open-feishu-card/parser": "0.1.
|
|
24
|
-
"@open-feishu-card/validator": "0.1.
|
|
23
|
+
"@open-feishu-card/compiler": "0.1.3",
|
|
24
|
+
"@open-feishu-card/linter": "0.1.2",
|
|
25
|
+
"@open-feishu-card/parser": "0.1.2",
|
|
26
|
+
"@open-feishu-card/validator": "0.1.2"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
29
|
+
"tsup": "^8.3.5",
|
|
27
30
|
"tsx": "^4.19.3",
|
|
28
31
|
"typescript": "^7.0.2",
|
|
29
32
|
"@types/node": "^22.20.1"
|
|
@@ -38,7 +41,7 @@
|
|
|
38
41
|
"directory": "packages/cli"
|
|
39
42
|
},
|
|
40
43
|
"scripts": {
|
|
41
|
-
"build": "tsc -p tsconfig.json && chmod +x dist/cli.js",
|
|
44
|
+
"build": "tsup && tsc -p tsconfig.json --emitDeclarationOnly && chmod +x dist/cli.js",
|
|
42
45
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
43
46
|
"test": "tsx --test test/*.test.ts"
|
|
44
47
|
}
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D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