Skip to content

Commit

Permalink
Merge pull request #472 from 2taesung/refactor/view-type
Browse files Browse the repository at this point in the history
refactor(view): engine과 공통되는 temp 타입 정리 및 주석
  • Loading branch information
2taesung committed Sep 19, 2023
2 parents 8646e82 + a565cea commit aac0311
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 52 deletions.
14 changes: 14 additions & 0 deletions packages/view/src/types/Commit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { DiffStatistics } from "./DiffStatistics";
import type { GitHubUser } from "./GitHubUser";

export type Commit = {
id: string;
parentIds: string[];
author: GitHubUser;
committer: GitHubUser;
authorDate: string;
commitDate: string;
diffStatistics: DiffStatistics;
message: string;
// fill necessary properties...
};
22 changes: 22 additions & 0 deletions packages/view/src/types/CommitMessageType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// This file here is all identical to 'types/CommitMessageType.ts' in 'analysis-engine'.
// Since the commit is originally imported from b, this file can be changed when b changes.
// You can create types derived from this code.
// However, design so that errors do not occur even if this code is changed.
export const CommitMessageTypeList = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"pert",
"refactor",
"revert",
"style",
"test",
"", // default - 명시된 타입이 없거나 commitLint rule을 따르지 않은 경우
];

const COMMIT_MESSAGE_TYPE = [...CommitMessageTypeList] as const;

export type CommitMessageType = (typeof COMMIT_MESSAGE_TYPE)[number];
51 changes: 0 additions & 51 deletions packages/view/src/types/CommitTypes.temp.ts

This file was deleted.

11 changes: 11 additions & 0 deletions packages/view/src/types/DiffStatistics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type DiffStatistics = {
changedFileCount: number;
insertions: number;
deletions: number;
files: {
[id: string]: {
insertions: number;
deletions: number;
};
};
};
5 changes: 5 additions & 0 deletions packages/view/src/types/GitHubUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type GitHubUser = {
id: string;
names: string[];
emails: string[];
};
2 changes: 1 addition & 1 deletion packages/view/src/types/Nodes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NODE_TYPES } from "constants/constants";

import type { Commit } from "./CommitTypes.temp";
import type { Commit } from "./Commit";

export type NodeTypeName = (typeof NODE_TYPES)[number];

Expand Down

0 comments on commit aac0311

Please sign in to comment.