Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 13ba7f1

Browse files
committed
refactor(config): mv other config to config.json & resolve warnings
1 parent 631f8fa commit 13ba7f1

File tree

11 files changed

+64
-114
lines changed

11 files changed

+64
-114
lines changed

config/assets.js

-10
This file was deleted.

config/config.json

+52-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"//--- endpoint configs ---//": "",
3-
"ASSETS_ENDPOINT": "https://cps-oss.oss-cn-shanghai.aliyuncs.com",
4-
"GRAPHQL_ENDPOINT": "https://api.coderplanets.com/graphiql",
52
"//--- general configs ---//": "",
63
"DEFAULT_THEME": "cyan",
74
"SENIOR_AMOUNT_THRESHOLD": 51.2,
@@ -12,6 +9,58 @@
129
"M": 30,
1310
"L": 40
1411
},
12+
"WORD_LIMIT": {
13+
"COMMENT": 300
14+
},
15+
"ATATARS_LIST_LENGTH": {
16+
"POSTS": 4,
17+
"COMMENTS": 5
18+
},
19+
"TAG_COLORS": [
20+
"red",
21+
"orange",
22+
"yellow",
23+
"green",
24+
"cyan",
25+
"blue",
26+
"purple",
27+
"dodgerblue",
28+
"yellowgreen",
29+
"brown",
30+
"cadetblue",
31+
"grey"
32+
],
33+
"TAG_COLOR_ORDER": {
34+
"red": 0,
35+
"orange": 1,
36+
"yellow": 2,
37+
"green": 3,
38+
"cyan": 4,
39+
"blue": 5,
40+
"purple": 6,
41+
"dodgerblue": 7,
42+
"yellowgreen": 8,
43+
"brown": 9,
44+
"cadetblue": 10,
45+
"grey": 11
46+
},
47+
"//--- endpoint configs ---//": "",
48+
"ASSETS_ENDPOINT": "https://cps-oss.oss-cn-shanghai.aliyuncs.com",
49+
"ICON_BASE": "https://cps-oss.oss-cn-shanghai.aliyuncs.com/icons",
50+
"ICON_CMD": "https://cps-oss.oss-cn-shanghai.aliyuncs.com/icons/cmd",
51+
"DEFAULT_ICON": "https://cps-oss.oss-cn-shanghai.aliyuncs.com/icons/cmd/cheatsheet.svg",
52+
"DEFAULT_USER_AVATAR": "https://cps-oss.oss-cn-shanghai.aliyuncs.com/icons/cmd/alien_user3.svg",
53+
"GRAPHQL_ENDPOINT": "https://api.coderplanets.com/graphiql",
54+
"SITE_URL": "https://coderplanets.com",
55+
"GITHUB_WEB_ADDR": "https://github.com/coderplanets/coderplanets_web",
56+
"GITHUB_SERVER_ADDR": "https://github.com/coderplanets/coderplanets_server",
57+
"API_SERVER_ADDR": "http://api.coderplanets.com/graphiql",
58+
"GITHUB_ME": "https://github.com/mydearxym",
59+
"GITHUB_CPS_TEAM": "https://github.com/orgs/coderplanets/people",
60+
"ISSUE_ADDR": "https://github.com/coderplanets/coderplanets_web/issues",
61+
"MENTION_USER_ADDR": "https://coderplanets.com/users/",
62+
"COMMUNITY_WIKI": "https://github.com/coderplanets/cps_wiki/blob/master",
63+
"COMMUNITY_CHEATSHEET": "https://github.com/coderplanets/cps_cheatsheets/blob/master",
1564
"//--- contact configs ---//": "",
1665
"EMAIL_CLUB": "club@group.coderplanets.com",
1766
"EMAIL_SUPPORT": "support@group.coderplanets.com",

config/endpoint.js

-26
This file was deleted.

config/general.js

-43
This file was deleted.

config/index.js

+1-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,3 @@
1-
import * as CONFIG from './config.json'
1+
export * from './config.json'
22

3-
export const { EMAIL_CLUB, EMAIL_SUPPORT, EMAIL_HELLO, EMAIL_BUSINESS } = CONFIG
4-
export const {
5-
DEFAULT_THEME,
6-
SENIOR_AMOUNT_THRESHOLD,
7-
SPONSOR_AMOUNT_THRESHOLD,
8-
PAGE_SIZE,
9-
} = CONFIG
10-
11-
export { WORD_LIMIT, TAG_COLORS, TAG_COLOR_ORDER } from './general'
12-
13-
export {
14-
SITE_URL,
15-
GRAPHQL_ENDPOINT,
16-
ISSUE_ADDR,
17-
GITHUB_WEB_ADDR,
18-
GITHUB_SERVER_ADDR,
19-
API_SERVER_ADDR,
20-
GITHUB_ME,
21-
GITHUB_CPS_TEAM,
22-
MENTION_USER_ADDR,
23-
COMMUNITY_WIKI,
24-
COMMUNITY_CHEATSHEET,
25-
DEFAULT_USER_AVATAR,
26-
} from './endpoint'
27-
28-
export { ASSETS_ENDPOINT, ICON_BASE, ICON_CMD, DEFAULT_ICON } from './assets'
293
export { default as LABEL_POOL } from './label_pool'

config/label_pool.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { ICON_CMD } from './assets'
1+
import * as CONFIG from './config.json'
2+
3+
const { ICON_CMD } = CONFIG
24

35
const LABEL_POOL = {
46
default: {

src/components/AvatarsRow/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import React from 'react'
88
import T from 'prop-types'
99
import R from 'ramda'
1010

11-
import { ATATARS_LIST_LENGTH } from '@config/general'
11+
// eslint-disable-next-line import/named
12+
import { ATATARS_LIST_LENGTH } from '@config'
1213
import { buildLog, prettyNum } from '@utils'
1314

1415
import Tooltip from '@components/Tooltip'

src/containers/Header/UserAccount.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22

3-
import { ICON_CMD } from '@config/assets'
3+
// eslint-disable-next-line import/named
4+
import { ICON_CMD } from '@config'
45
import Popover from '@components/Popover'
56

67
import { onLogin, onLogout, previewAccount } from './logic'

src/containers/MailBox/MailsPanel.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from 'react'
22
import R from 'ramda'
33

4+
// eslint-disable-next-line import/named
5+
import { ICON_CMD } from '@config'
46
import TabSelector from '@components/TabSelector'
5-
import { ICON_CMD } from '@config/assets'
67

78
import { Wrapper, SeeAllMessages } from './styles/mails_panel'
89
import MailLists from './MailLists'

src/containers/MailsViewer/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
import React from 'react'
88

9-
import { ICON_CMD } from '@config/assets'
9+
// eslint-disable-next-line import/named
10+
import { ICON_CMD } from '@config'
1011
import { connectStore, buildLog } from '@utils'
1112

1213
import TabSelector from '@components/TabSelector'

utils/bin/jq-mac

100644100755
File mode changed.

0 commit comments

Comments
 (0)