@d5render/cli 0.1.3 → 0.1.4

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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.1.4 (2026-01-08)
2
+ 评审流程转移至skills内 codereview 0.0.1
3
+ 增加去重功能
4
+
5
+
1
6
  ## 0.1.3 (2026-01-08)
2
7
  skills:review 0.0.0
3
8
 
package/bin/CHANGELOG.md CHANGED
@@ -1,4 +1,2 @@
1
- skills:review 0.0.0
2
-
3
- 评审流程转移至skills内
1
+ 评审流程转移至skills codereview 0.0.1
4
2
  增加去重功能
package/bin/d5cli CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { execSync, spawn } from "node:child_process";
3
- import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
3
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
- import { argv, env, exit, platform } from "node:process";
5
+ import { argv, env, platform } from "node:process";
6
6
  import { fileURLToPath } from "node:url";
7
7
 
8
8
  //#region package.json
9
9
  var name = "@d5render/cli";
10
- var version = "0.1.3";
10
+ var version = "0.1.4";
11
11
 
12
12
  //#endregion
13
13
  //#region copilot/server/config.ts
@@ -122,10 +122,15 @@ const root = () => {
122
122
  };
123
123
  const cwd = join(dirname(fileURLToPath(import.meta.url)), "../");
124
124
  function deploy() {
125
- const cl = join(cwd, "bin/CHANGELOG.md");
126
- if (existsSync(cl)) {
127
- let clt = readFileSync(cl, "utf8");
128
- if (env.DINGTALK_WEBHOOK) send("NOTICE", `#### cli upgrade\n\n${clt}\n\n##### [HISTORY CHANGELOG](https://www.npmjs.com/package/${name}/v/${version}?activeTab=code)`).then(() => rmSync(cl)).catch(() => {});
125
+ if (env.CI) {
126
+ const cl = join(cwd, "bin/CHANGELOG.md");
127
+ const clt = existsSync(cl) ? readFileSync(cl, "utf8") : "";
128
+ const clr = join(cwd, name.split("/").map(() => "..").join("/"), `${name.replaceAll("/", "-")}-notice`);
129
+ let need = !!clt;
130
+ if (existsSync(clr)) {
131
+ if (readFileSync(clr, "utf8") === version) need = false;
132
+ }
133
+ if (need && env.DINGTALK_WEBHOOK) send("NOTICE", `#### cli upgrade\n\n${clt}\n\n##### [HISTORY CHANGELOG](https://www.npmjs.com/package/${name}/v/${version}?activeTab=code)`).then(() => writeFileSync(clr, version)).catch(() => {});
129
134
  }
130
135
  const dir = join(root(), ".copilot/skills/codereview");
131
136
  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
@@ -226,20 +231,24 @@ function installCopilot() {
226
231
 
227
232
  //#endregion
228
233
  //#region copilot/bin/index.ts
229
- function review() {
234
+ const prompt = `call the mcp tool '${name$1}-${getHash}' to load review commits, if the task encounters an error, throw that, otherwise, you can decide for yourself which tools to use to enrich context and determine whether a specific commit needs to be reviewed.
235
+ Then, use chinese as default language to organize the report into JSON format and call the mcp tool '${name$1}-${report}', please ignore error encountered when calling this and report title should not contain words such as MCP or "中文".`;
236
+ deploy();
237
+ if (canireview()) {
230
238
  install();
231
239
  const copilot = spawn("node", [
232
240
  findCopilopt(),
233
241
  ...tools,
242
+ "--stream",
243
+ "off",
234
244
  "-p",
235
245
  prompt
236
246
  ], {
237
247
  cwd: env.CI_PROJECT_DIR,
238
248
  ...platform === "win32" && { windowsHide: true }
239
249
  });
240
- copilot.stdout.on("data", (data) => console.log(String(data)));
241
- copilot.stderr.on("data", (data) => console.error(String(data)));
242
- copilot.on("close", (code) => exit(code));
250
+ copilot.stdout.on("data", (data) => console.log(data.toString()));
251
+ copilot.stderr.on("data", (data) => console.error(data.toString()));
243
252
  }
244
253
  function findCopilopt() {
245
254
  let copilot = execSync("npm list @github/copilot -g -p").toString().trim();
@@ -264,9 +273,5 @@ copilot:
264
273
  path: ${copilotPath}`);
265
274
  return copilotPath;
266
275
  }
267
- const prompt = `call the mcp tool '${name$1}-${getHash}' to load review commits, if the task encounters an error, throw that, otherwise, you can decide for yourself which tools to use to enrich context and determine whether a specific commit needs to be reviewed.
268
- Then, use chinese as default language to organize the report into JSON format and call the mcp tool '${name$1}-${report}', please ignore error encountered when calling this and report title should not contain words such as MCP or "中文".`;
269
- deploy();
270
- if (canireview()) review();
271
276
 
272
277
  //#endregion
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "license": "MIT",
5
5
  "author": "jasirou",
6
6
  "main": "./bin/d5cli",
7
- "version": "0.1.3",
7
+ "version": "0.1.4",
8
8
  "devDependencies": {
9
9
  "@modelcontextprotocol/sdk": "^1.25.1",
10
10
  "@types/node": "^25.0.3",