Skip to content

Commit a559140

Browse files
committed
fix number format
1 parent 8bd19bc commit a559140

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

src/locales/en.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
export default {
22
updateNotifier:
33
'Run `{updateCommand}` to update the CLI to get continuous improvements in features, performance, and security.',
4-
loginFirst: 'Not logged in.\nPlease run `cresc login` in the project directory to login.',
4+
loginFirst:
5+
'Not logged in.\nPlease run `cresc login` in the project directory to login.',
6+
lockNotFound:
7+
'No lock file detected, which may cause inconsistent dependencies and hot-updating issues.',
8+
multipleLocksFound:
9+
'Multiple lock files detected ({lockFiles}), which may cause inconsistent dependencies and hot-updating issues.',
10+
lockBestPractice: `
11+
Best practices for lock files:
12+
1. All members of the development team should use the same package manager to maintain a single lock file.
13+
2. Add the lock file to version control (but do not commit multiple lock files of different formats).
14+
3. Pay attention to changes in the lock file during code review.
15+
This can reduce the risk of inconsistent dependencies and supply chain attacks.
16+
`,
517
};

src/locales/zh.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@ export default {
22
updateNotifier:
33
'建议运行 `{updateCommand}` 来更新命令行工具以获得功能、性能和安全性的持续改进',
44
loginFirst: '尚未登录。\n请在项目目录中运行`pushy login`命令来登录',
5+
lockNotFound:
6+
'没有检测到任何 lock 文件,这可能导致依赖关系不一致而使热更异常。',
7+
lockBestPractice: `
8+
关于 lock 文件的最佳实践:
9+
1. 开发团队中的所有成员应该使用相同的包管理器,维护同一份 lock 文件。
10+
2. 将 lock 文件添加到版本控制中(但不要同时提交多种不同格式的 lock 文件)。
11+
3. 代码审核时应关注 lock 文件的变化。
12+
这样可以最大限度避免因依赖关系不一致而导致的热更异常,也降低供应链攻击等安全隐患。
13+
`,
14+
multipleLocksFound:
15+
'检测到多种不同格式的锁文件({lockFiles}),这可能导致依赖关系不一致而使热更异常。',
516
};

src/utils/git.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface CommitInfo {
66
hash: string;
77
message: string;
88
author: string;
9-
date: number;
9+
date: string;
1010
origin: string;
1111
}
1212

@@ -40,7 +40,7 @@ export async function getCommitInfo(): Promise<CommitInfo | undefined> {
4040
hash: oid,
4141
message: commit.message,
4242
author: commit.author.name || commit.committer.name,
43-
date: commit.committer.timestamp,
43+
date: String(commit.committer.timestamp),
4444
origin: origin.url,
4545
};
4646
} catch (error) {

src/utils/lock-checker.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,3 @@ const lockFiles = [
55
'bun.lockb',
66
'bun.lock',
77
];
8-
9-
const lockNotFound = `
10-
没有检测到任何 lock 文件,这可能导致依赖关系不一致而使热更异常。
11-
`;
12-
13-
const multipleLocksFound = `
14-
检测到多个锁文件(),这可能导致依赖关系不一致而使热更异常。
15-
`;
16-
17-
18-
const lockBestPractice = `
19-
关于 lock 文件的最佳实践:
20-
1. 开发团队中的所有成员应该使用相同的包管理器,维护同一份 lock 文件。
21-
2. 将 lock 文件添加到版本控制中(但不要同时提交多种不同格式的 lock 文件)。
22-
3. 代码审核时应关注 lock 文件的变化。
23-
这样可以最大限度避免因依赖关系不一致而导致的热更异常,也降低供应链攻击等安全隐患。
24-
`;

0 commit comments

Comments
 (0)