@moneko/core 4.6.8 → 4.6.10

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.
@@ -1,10 +1,11 @@
1
1
  export interface GitInfo {
2
2
  /** 当前分支名 */ branch: string;
3
- /** commit ID */ commitId: string;
3
+ /** 提交链接 */ commit: string;
4
4
  /** 提交信息 */ message: string;
5
5
  /** 提交用户名 */ author: string;
6
6
  /** 提交用户邮箱 */ email: string;
7
7
  /** 提交日期 */ date: string;
8
+ /** Git 远程地址 */ url: string;
8
9
  }
9
10
  /**
10
11
  * 获取 Git 信息
@@ -1 +1 @@
1
- import{execSync as r}from"node:child_process";let t=null;export const getGitInfo=e=>{let i=!1!==e;if(i&&null!==t)return t;let l=null;try{let t=r('git rev-parse --abbrev-ref HEAD && git log -1 --pretty=format:"%h%x00%B%x00%an%x00%ae%x00%ai"',{encoding:"utf-8",stdio:["pipe","pipe","ignore"],maxBuffer:1048576}).trim();if(t){let r=t.indexOf("\n");if(-1===r)throw l=null,Error("Git 信息格式不正确");{let e=t.substring(0,r).trim(),i=t.substring(r+1).split("\0");if(i.length<5)throw l=null,Error(`Git 提交信息格式不正确,字段数量: ${i.length}`);{let r=i[0].trim(),t=i[1],n=i[2].trim(),o=i[3].trim(),u=i[4].trim();if(e&&r)l={branch:e,commitId:r,message:t,author:n,email:o,date:u};else throw l=null,Error("Git 信息不完整")}}}else throw l=null,Error("无法获取 Git 信息")}catch(r){throw l=null,Error(`获取 Git 信息失败: ${r}`)}return i&&(t=l),l};
1
+ import{execSync as t}from"node:child_process";let i=null;export const getGitInfo=e=>{let r=!1!==e;if(r&&null!==i)return i;let n=null;try{let i=t('git remote get-url origin && git rev-parse --abbrev-ref HEAD && git log -1 --pretty=format:"%h%x00%B%x00%an%x00%ae%x00%ai"',{encoding:"utf-8",stdio:["pipe","pipe","ignore"],maxBuffer:1048576}).trim();if(i){let t=i.indexOf("\n");if(-1!==t){let e=i.substring(0,t).trim().trim().replace(/^git@([^:]+):(.+?)(\.git)?$/,"https://$1/$2"),r=i.indexOf("\n",t+1),l=i.substring(t+1,r).trim(),m=i.substring(r+1).split("\0");if(m.length>=5){let t=m[0].trim(),i=e.includes("github")?`${e}/commit/${t}`:`${e}/-/commit/${t}`,r=m[1],o=m[2].trim(),g=m[3].trim(),s=m[4].trim();n={branch:l,commit:i,message:r,author:o,email:g,date:s,url:e}}}}}catch{}return r&&(i=n),n};
@@ -1,5 +1,5 @@
1
1
  import { type AppType, type Framework } from './index.mjs';
2
- type PackageJson = typeof import('../package.json');
2
+ type PackageJson = typeof import('package.json');
3
3
  export declare const packageJson: Omit<PackageJson, 'scripts'> & {
4
4
  scripts?: Record<string, string>;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "4.6.8",
3
+ "version": "4.6.10",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -149,7 +149,7 @@
149
149
  "marked-completed": "1.2.15",
150
150
  "swc-loader": "0.2.7",
151
151
  "typescript": "5.9.3",
152
- "webpack": "5.105.0",
152
+ "webpack": "5.105.1",
153
153
  "webpack-hot-middleware": "2.26.1",
154
154
  "webpack-merge": "6.0.1"
155
155
  },
@@ -170,5 +170,5 @@
170
170
  "lib",
171
171
  "typings"
172
172
  ],
173
- "packageManager": "pnpm@10.29.2"
173
+ "packageManager": "pnpm@10.29.3"
174
174
  }