@d5render/cli 0.1.44 → 0.1.49

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/bin/d5cli CHANGED
@@ -2,7 +2,7 @@
2
2
  import { execSync, spawn } from "node:child_process";
3
3
  import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, 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 copilot/server/config.ts
@@ -108,7 +108,7 @@ function installCopilot() {
108
108
  //#endregion
109
109
  //#region package.json
110
110
  var name = "@d5render/cli";
111
- var version = "0.1.44";
111
+ var version = "0.1.49";
112
112
 
113
113
  //#endregion
114
114
  //#region packages/gitlab/url.ts
@@ -198,17 +198,16 @@ async function deploy() {
198
198
  console.log("removed config cache.");
199
199
  }
200
200
  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
201
- const versiono = readFileSync(join(RUNTIME_CWD, ".skills/code-review/version"), "utf8");
202
201
  const changelog = readFileSync(join(RUNTIME_CWD, "CHANGELOG.md"), "utf8");
203
202
  const cachepath = join(TEMP, "CHANGELOG-" + env.CI_RUNNER_ID || "0");
204
203
  if (changelog !== (existsSync(cachepath) ? readFileSync(cachepath, "utf8") : "")) {
205
204
  if (!existsSync(TEMP)) mkdirSync(TEMP, { recursive: true });
206
205
  writeFileSync(cachepath, changelog, "utf8");
207
206
  console.log("updated CHANGELOG cache.");
208
- await dingding("NOTICE", `code-review/SKILL.md 更新到${versiono}\n\n请参考[线上文档内容](https://www.npmjs.com/package/@d5render/cli?activeTab=readme)`);
207
+ await dingding("NOTICE", `code-review/SKILL.md 更新到${VERSION}\n\n请参考[线上文档内容](https://www.npmjs.com/package/@d5render/cli?activeTab=readme)`);
209
208
  }
210
209
  const versionnPath = join(dir, "version");
211
- if ((existsSync(versionnPath) ? readFileSync(versionnPath, "utf8") : "") === versiono) return;
210
+ if ((existsSync(versionnPath) ? readFileSync(versionnPath, "utf8") : "") === VERSION) return;
212
211
  if (existsSync(dir)) rmSync(dir, {
213
212
  recursive: true,
214
213
  force: true
@@ -259,12 +258,10 @@ async function need() {
259
258
 
260
259
  //#endregion
261
260
  //#region copilot/bin/index.ts
262
- try {
263
- codereview();
264
- } catch (error) {
261
+ codereview().catch((error) => {
265
262
  dingding("CRITICAL", "CI ERROR: 未知错误,请自行检查日志");
266
263
  throw error;
267
- }
264
+ });
268
265
  async function codereview() {
269
266
  await deploy();
270
267
  if (!await need()) {
@@ -292,9 +289,11 @@ Otherwise, use chinese as default language to call the mcp tool '${name$1}-${rep
292
289
  });
293
290
  copilot.stdout.on("data", (chunk) => console.log(String(chunk)));
294
291
  copilot.stderr.on("data", (chunk) => console.error(String(chunk)));
295
- copilot.on("close", (code) => {
296
- if (!code) dingding("CRITICAL", "CI ERROR: 代码审查任务失败,请自行检查日志");
297
- exit(code);
292
+ return new Promise((res, rej) => {
293
+ copilot.on("close", (code) => {
294
+ if (!code) rej(/* @__PURE__ */ new Error("CI ERROR: 代码审查任务失败,请自行检查日志"));
295
+ else res();
296
+ });
298
297
  });
299
298
  }
300
299
  function findCopilopt() {
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.44",
7
+ "version": "0.1.49",
8
8
  "devDependencies": {
9
9
  "@modelcontextprotocol/sdk": "^1.25.1",
10
10
  "@types/node": "^25.0.3",
@@ -1 +0,0 @@
1
- 0.0.1