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

Commit 6be408a

Browse files
committed
chore: Merge branch 'infra' into dev
2 parents 0a0e373 + 842d7a6 commit 6be408a

File tree

16 files changed

+86
-73
lines changed

16 files changed

+86
-73
lines changed

.babelrc

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
2-
"presets": [
3-
["next/babel"]
4-
],
2+
"presets": [["next/babel"]],
53
"env": {
6-
"development": {
7-
"plugins": ["inline-dotenv"]
4+
"development": {
5+
"plugins": ["inline-dotenv"]
86
},
97
"production": {
108
"presets": [
11-
["next/babel", {
12-
"preset-env": {
13-
"targets": {
14-
"ie": "11"
15-
},
16-
"debug": false
9+
[
10+
"next/babel",
11+
{
12+
"preset-env": {
13+
"targets": {
14+
"ie": "11"
15+
},
16+
"debug": false
17+
}
1718
}
18-
}]
19+
]
1920
]
2021
},
2122
"test": {
@@ -47,20 +48,24 @@
4748
}
4849
],
4950
"ramda",
50-
["module-resolver", {
51-
"root": ["./"],
52-
"alias": {
53-
"@containers":"./containers",
54-
"@components":"./components",
55-
"@hooks":"./components/Hooks",
56-
"@config":"./config",
57-
"@stores":"./stores",
58-
"@model":"./stores/SharedModel",
59-
"@utils":"./utils",
60-
"@schemas":"./containers/schemas",
61-
"@Img": "./components/Img",
62-
"@SvgIcons": "./components/SvgIcons"
51+
[
52+
"module-resolver",
53+
{
54+
"root": ["./"],
55+
"alias": {
56+
"@containers": "./containers",
57+
"@components": "./components",
58+
"@services": "./services",
59+
"@hooks": "./components/Hooks",
60+
"@config": "./config",
61+
"@stores": "./stores",
62+
"@model": "./stores/SharedModel",
63+
"@utils": "./utils",
64+
"@schemas": "./containers/schemas",
65+
"@Img": "./components/Img",
66+
"@SvgIcons": "./components/SvgIcons"
67+
}
6368
}
64-
}]
69+
]
6570
]
6671
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ yarn-error.log
1212
schema.graphql
1313
cypress//integration/examples
1414
cypress/videos/
15+
.vscode/

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"clean": "shjs ./utils/scripts/clean.js",
2424
"gen": "plop --plopfile ./utils/scripts/generators/index.js",
2525
"analyze": "cross-env ANALYZE=true next build",
26-
"lint": "eslint --fix pages/**/*.js components/**/*.js containers/**/*.js stores/**/*.js utils/**/*.js",
26+
"lint": "eslint ./pages/**/*.js ./components/**/*.js ./containers/**/*.js ./stores/**/*.js ./utils/**/*.js ./services/**/*.js",
2727
"lint:staged": "git diff --cached --name-only --diff-filter=ACRM | grep \".js$\" | xargs eslint",
2828
"test": "cross-env NODE_ENV=test jest --config .jest.config.js",
2929
"test:dev": "cross-env NODE_ENV=test jest --config .jest.config.js",
@@ -129,7 +129,8 @@
129129
"@babel/plugin-proposal-decorators": "^7.1.0",
130130
"@commitlint/cli": "^7.0.0",
131131
"@commitlint/config-conventional": "^8.0.0",
132-
"@groupher/eslint-config-web": "^1.0.0",
132+
"@groupher/eslint-config-web": "1.1.1",
133+
"babel-eslint": "^10.0.2",
133134
"babel-jest": "^23.6.0",
134135
"babel-plugin-add-react-displayname": "^0.0.5",
135136
"babel-plugin-import": "1.9.1",
@@ -150,6 +151,7 @@
150151
"enzyme-adapter-react-16": "1.9.1",
151152
"enzyme-to-json": "^3.3.4",
152153
"eslint": "5.14.0",
154+
"eslint-plugin-prettier": "^3.1.0",
153155
"husky": "^2.1.0",
154156
"jest": "23.4.2",
155157
"npm-run-all": "^4.1.1",

pages/_error.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react'
22
import { Provider } from 'mobx-react'
33

4+
import AnalysisService from '@services/Analysis'
45
import ThemeWrapper from '@containers/ThemeWrapper'
5-
import GAWraper from '@components/GAWraper'
66
import ErrorPage from '@components/ErrorPage'
77

88
import initRootStore from '@stores/init'
@@ -25,11 +25,11 @@ export default class TheErrorPage extends React.Component {
2525

2626
return (
2727
<Provider store={this.store}>
28-
<GAWraper>
28+
<AnalysisService>
2929
<ThemeWrapper>
3030
<ErrorPage errorCode={statusCode} page={page} target={target} />
3131
</ThemeWrapper>
32-
</GAWraper>
32+
</AnalysisService>
3333
</Provider>
3434
)
3535
}

pages/communities.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import React from 'react'
55
import { Provider } from 'mobx-react'
66
import R from 'ramda'
77

8+
import AnalysisService from '@services/Analysis'
9+
810
import GlobalLayout from '@containers/GlobalLayout'
911
import ThemeWrapper from '@containers/ThemeWrapper'
1012
import MultiLanguage from '@containers/MultiLanguage'
@@ -18,7 +20,7 @@ import CommunitiesContent from '@containers/CommunitiesContent'
1820
import Footer from '@containers/Footer'
1921

2022
import { P } from '@schemas'
21-
import GAWraper from '@components/GAWraper'
23+
2224
import {
2325
getJwtToken,
2426
makeGQClient,
@@ -125,7 +127,7 @@ export default class CommunitiesPage extends React.Component {
125127
render() {
126128
return (
127129
<Provider store={this.store}>
128-
<GAWraper>
130+
<AnalysisService>
129131
<ThemeWrapper>
130132
<Route />
131133
<MultiLanguage>
@@ -140,7 +142,7 @@ export default class CommunitiesPage extends React.Component {
140142
</GlobalLayout>
141143
</MultiLanguage>
142144
</ThemeWrapper>
143-
</GAWraper>
145+
</AnalysisService>
144146
</Provider>
145147
)
146148
}

pages/community.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import NextSeo from 'next-seo'
66
import { PAGE_SIZE, SITE_URL } from '@config'
77
import initRootStore from '@stores/init'
88

9+
import AnalysisService from '@services/Analysis'
910
import GlobalLayout from '@containers/GlobalLayout'
1011
import ThemeWrapper from '@containers/ThemeWrapper'
1112
import MultiLanguage from '@containers/MultiLanguage'
@@ -18,8 +19,6 @@ import CommunityBanner from '@containers/CommunityBanner'
1819
import CommunityContent from '@containers/CommunityContent'
1920
import Footer from '@containers/Footer'
2021
import ErrorBox from '@containers/ErrorBox'
21-
22-
import GAWraper from '@components/GAWraper'
2322
import ErrorPage from '@components/ErrorPage'
2423

2524
import {
@@ -185,12 +184,12 @@ export default class CommunityPage extends React.Component {
185184

186185
const seoTitle =
187186
community.raw === 'home'
188-
? `coderplanets 社区`
187+
? 'coderplanets 社区'
189188
: `coderplanets ${community.raw}社区`
190189

191190
return (
192191
<Provider store={this.store}>
193-
<GAWraper>
192+
<AnalysisService>
194193
<ThemeWrapper>
195194
{statusCode ? (
196195
<ErrorPage
@@ -223,7 +222,7 @@ export default class CommunityPage extends React.Component {
223222
</React.Fragment>
224223
)}
225224
</ThemeWrapper>
226-
</GAWraper>
225+
</AnalysisService>
227226
</Provider>
228227
)
229228
}

pages/home/posts.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import NextSeo from 'next-seo'
66
import { PAGE_SIZE, SITE_URL } from '@config'
77
import initRootStore from '@stores/init'
88

9+
import AnalysisService from '@services/Analysis'
10+
911
import GlobalLayout from '@containers/GlobalLayout'
1012
import ThemeWrapper from '@containers/ThemeWrapper'
1113
import MultiLanguage from '@containers/MultiLanguage'
@@ -19,7 +21,6 @@ import CommunityContent from '@containers/CommunityContent'
1921
import Footer from '@containers/Footer'
2022
import ErrorBox from '@containers/ErrorBox'
2123

22-
import GAWraper from '@components/GAWraper'
2324
import ErrorPage from '@components/ErrorPage'
2425

2526
import {
@@ -190,7 +191,7 @@ export default class HomePage extends React.Component {
190191

191192
return (
192193
<Provider store={this.store}>
193-
<GAWraper>
194+
<AnalysisService>
194195
<ThemeWrapper>
195196
{statusCode ? (
196197
<ErrorPage
@@ -223,7 +224,7 @@ export default class HomePage extends React.Component {
223224
</React.Fragment>
224225
)}
225226
</ThemeWrapper>
226-
</GAWraper>
227+
</AnalysisService>
227228
</Provider>
228229
)
229230
}

pages/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React from 'react'
22
import { Provider } from 'mobx-react'
33
import R from 'ramda'
44

5+
import AnalysisService from '@services/Analysis'
6+
57
import GlobalLayout from '@containers/GlobalLayout'
68
import ThemeWrapper from '@containers/ThemeWrapper'
79
import MultiLanguage from '@containers/MultiLanguage'
@@ -15,10 +17,9 @@ import Content from '@containers/Content'
1517
import Footer from '@containers/Footer'
1618
import ErrorBox from '@containers/ErrorBox'
1719

18-
import GAWraper from '@components/GAWraper'
1920
import ErrorPage from '@components/ErrorPage'
2021
import initRootStore from '@stores/init'
21-
// import { GAWraper, ErrorPage } from '@components'
22+
// import { AnalysisService, ErrorPage } from '@components'
2223

2324
import { buildLog, getMainPath, ROUTE } from '@utils'
2425

@@ -67,7 +68,7 @@ export default class PageCommunity extends React.Component {
6768

6869
return (
6970
<Provider store={this.store}>
70-
<GAWraper>
71+
<AnalysisService>
7172
<ThemeWrapper>
7273
{statusCode ? (
7374
<ErrorPage
@@ -93,7 +94,7 @@ export default class PageCommunity extends React.Component {
9394
</React.Fragment>
9495
)}
9596
</ThemeWrapper>
96-
</GAWraper>
97+
</AnalysisService>
9798
</Provider>
9899
)
99100
}

pages/job.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { BlogJsonLd } from 'next-seo'
55

66
import { PAGE_SIZE, SITE_URL } from '@config'
77

8+
import AnalysisService from '@services/Analysis'
9+
810
import GlobalLayout from '@containers/GlobalLayout'
911
import ThemeWrapper from '@containers/ThemeWrapper'
1012
import MultiLanguage from '@containers/MultiLanguage'
@@ -18,10 +20,9 @@ import Footer from '@containers/Footer'
1820
import ErrorBox from '@containers/ErrorBox'
1921

2022
import { P } from '@schemas'
21-
import GAWraper from '@components/GAWraper'
2223
import ErrorPage from '@components/ErrorPage'
2324

24-
// import { GAWraper, ErrorPage } from '@components'
25+
// import { AnalysisService, ErrorPage } from '@components'
2526

2627
import {
2728
getJwtToken,
@@ -130,7 +131,7 @@ export default class JobPage extends React.Component {
130131

131132
return (
132133
<Provider store={this.store}>
133-
<GAWraper>
134+
<AnalysisService>
134135
<ThemeWrapper>
135136
{statusCode ? (
136137
<ErrorPage errorCode={statusCode} page="job" target={target} />
@@ -160,7 +161,7 @@ export default class JobPage extends React.Component {
160161
</React.Fragment>
161162
)}
162163
</ThemeWrapper>
163-
</GAWraper>
164+
</AnalysisService>
164165
</Provider>
165166
)
166167
}

pages/oauth.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Provider } from 'mobx-react'
33

44
import ThemeWrapper from '@containers/ThemeWrapper'
55

6-
import GAWraper from '@components/GAWraper'
6+
import AnalysisService from '@services/Analysis'
77
import OauthHinter from '@components/OauthHinter'
88

99
import initRootStore from '@stores/init'
@@ -21,11 +21,11 @@ export default class Index extends React.Component {
2121
render() {
2222
return (
2323
<Provider store={this.store}>
24-
<GAWraper>
24+
<AnalysisService>
2525
<ThemeWrapper>
2626
<OauthHinter />
2727
</ThemeWrapper>
28-
</GAWraper>
28+
</AnalysisService>
2929
</Provider>
3030
)
3131
}

0 commit comments

Comments
 (0)