Skip to content

Commit f05fa9d

Browse files
authored
Merge pull request #4 from cnodejs/feat/init
feat: init
2 parents 568ad3f + d916f65 commit f05fa9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2062
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/npm-debug.log*
6+
/yarn-error.log
7+
/yarn.lock
8+
/package-lock.json
9+
10+
# production
11+
/dist
12+
13+
# misc
14+
.DS_Store
15+
16+
# umi
17+
/src/.umi
18+
/src/.umi-production
19+
/src/.umi-test
20+
/.env.local

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.html
5+
package.json
6+
.umi
7+
.umi-production
8+
.umi-test

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 80,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

.vscode/react.code-snippets

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"React-TypeScript Function Component": {
3+
"prefix": "rfct",
4+
"body": [
5+
"import React from 'react';",
6+
"",
7+
"const ${0:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}: React.FC<Props> = (props) => {",
8+
" return null;",
9+
"};",
10+
"",
11+
"export default ${0:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}};",
12+
"",
13+
"interface Props {",
14+
"};"
15+
],
16+
"description": "React-TypeScript Function Component"
17+
}
18+
}

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# react-cnode
2+
23
CNode 社区 React 版本
4+
5+
## Getting Started
6+
7+
Install dependencies,
8+
9+
```bash
10+
$ yarn
11+
```
12+
13+
Start the dev server,
14+
15+
```bash
16+
$ yarn start
17+
```

config/basic.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
logo: '/images/cnodejs.svg',
3+
title: 'CNode.js',
4+
description: 'Node.js 专业中文社区',
5+
};

config/config.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import routes from './routes';
2+
3+
import { defineConfig } from 'umi';
4+
5+
export default defineConfig({
6+
singular: true,
7+
fastRefresh: {},
8+
// mfsu: {},
9+
10+
nodeModulesTransform: {
11+
type: 'none',
12+
},
13+
14+
antd: {},
15+
16+
theme: {
17+
'@primary-color': '#1DA57A',
18+
},
19+
20+
dva: {
21+
immer: true,
22+
},
23+
24+
layout: {},
25+
26+
qiankun: {
27+
master: {
28+
apps: [],
29+
},
30+
},
31+
32+
routes,
33+
});

config/routes.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { IRoute } from 'umi';
2+
3+
const routes: IRoute[] = [
4+
{
5+
path: '/auth',
6+
exact: true,
7+
layout: false,
8+
component: '@/page/auth',
9+
},
10+
{
11+
path: '/',
12+
exact: false,
13+
component: '@/layout/index',
14+
routes: [
15+
{
16+
path: '/',
17+
exact: true,
18+
icon: 'home',
19+
name: '主页',
20+
component: '@/page/topic',
21+
},
22+
23+
{
24+
path: '/api',
25+
exact: true,
26+
icon: 'api',
27+
name: 'API',
28+
component: '@/page/api',
29+
},
30+
{
31+
path: '/topic/create',
32+
exact: true,
33+
title: '新建话题',
34+
component: '@/page/topic/create',
35+
access: 'canPostTopic',
36+
},
37+
{
38+
path: '/topic/:id',
39+
exact: true,
40+
component: '@/page/topic/detail',
41+
},
42+
],
43+
},
44+
45+
{ component: '@/page/404' },
46+
];
47+
48+
export default routes;

mock/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)