This repository was archived by the owner on Nov 8, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork37
refactor(types): enhance type system#1299
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions.eslintrc.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
31 changes: 26 additions & 5 deletionspackage-lock.json
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
1 change: 1 addition & 0 deletionspackage.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionssrc/spec/article.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletionssrc/spec/enhance.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// see: https://github.com/sindresorhus/type-fest#template-literal-types | ||
export type { ScreamingSnakeCase as SnakeUpperCase } from 'type-fest' | ||
export type holder = 1 |
3 changes: 3 additions & 0 deletionssrc/spec/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletionssrc/spec/utils.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletionsutils/constant/GTD.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import type { TGtdType, TGtdState } from '@/spec' | ||
export const GTD_TYPE = { | ||
FEATURE: 'FEATURE', | ||
BUG: 'BUG', | ||
DEFAULT:'DEFAULT', | ||
} as Record<Uppercase<TGtdType>, Uppercase<TGtdType>> | ||
export const GTD_STATE = { | ||
TODO: 'TODO', | ||
WIP: 'WIP', | ||
DONE: 'DONE', | ||
DEFAULT:'DEFAULT', | ||
} as Record<Uppercase<TGtdState>, Uppercase<TGtdState>> |
14 changes: 7 additions & 7 deletionsutils/constant/emotion.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import type { TEmotionType } from '@/spec' | ||
const EMOTION = { | ||
DOWNVOTE: 'downvote', | ||
BEER: 'beer', | ||
HEART: 'heart', | ||
CONFUSED: 'confused', | ||
POPCORN: 'popcorn', | ||
PILL: 'pill', | ||
} as Record<Uppercase<TEmotionType>, TEmotionType> | ||
export default EMOTION |
20 changes: 10 additions & 10 deletionsutils/constant/layout.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import type { TUpvoteLayout, SnakeUpperCase } from '@/spec' | ||
export const UPVOTE_LAYOUT = { | ||
DEFAULT: 'default', | ||
COMMENT: 'comment', | ||
ARTICLE: 'article', | ||
POST_LIST: 'post-list', | ||
BLOG_LIST: 'blog-list', | ||
WORKS_ARTICLE: 'works-article', | ||
WORKS_CARD: 'works-card', | ||
GUIDE_LIST: 'guide-list', | ||
} as Record<SnakeUpperCase<TUpvoteLayout>, TUpvoteLayout> | ||
export const holder = 1 |
44 changes: 22 additions & 22 deletionsutils/constant/metric.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletionsutils/constant/payment.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import type { TPaymentUsage, TPaymentMethod } from '@/spec' | ||
export const PAYMENT_USAGE = { | ||
SENIOR: 'SENIOR', | ||
GIRLS_CODE_TOO_PLAN: 'GIRLS_CODE_TOO_PLAN', | ||
DONATE: 'DONATE', | ||
SPONSOR: 'SPONSOR', | ||
} as Record<Uppercase<TPaymentUsage>, Uppercase<TPaymentUsage>> | ||
export const PAYMENT_METHOD = { | ||
ALIPAY: 'ALIPAY', | ||
WECHAT: 'WECHAT', | ||
} as Record<Uppercase<TPaymentMethod>, Uppercase<TPaymentMethod>> |
22 changes: 11 additions & 11 deletionsutils/constant/tab.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletionsutils/constant/tag.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import type { TTagMode } from '@/spec' | ||
const TAG_MODE = { | ||
DEFAULT: 'default', | ||
LABEL: 'label', | ||
} as Record<Uppercase<TTagMode>, TTagMode> | ||
export default TAG_MODE |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.