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

Commit 437a352

Browse files
authored
docs: update convention.md
1 parent da31045 commit 437a352

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/architecture/convention.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Component file files are named with a capital hump, such as PostEditor.js, and t
88
#### sr71
99

1010
Sr71.js is the asynchronous module of the project (utils/aysnc/sr71.js), which is mainly responsible for network request/event response and so on.
11-
The name of the sr71 comes from the US military's sr71 blackbird reconnaissance plane. See the ansyc documentation for details.
11+
The name of the sr71 comes from the US military's sr71 blackbird reconnaissance plane. See the [ansyc documentation](https://github.com/coderplanets/coderplanets_web/blob/docs/docs/js/async.md) for details.
1212

1313
#### Doramon
1414

@@ -29,6 +29,33 @@ Mentioned:
2929
- Synchronous or asynchronous logic should be extracted into the same directory's logic.js, React only does the view layer
3030
- All styles should be in the styles/ folder under the same directory, and the style file is named after stake_style
3131

32+
33+
### module import
34+
35+
based on [babel-resolver][https://github.com/tleunen/babel-plugin-module-resolver] 's config:
36+
37+
```js
38+
"alias": {
39+
"containers":"./containers",
40+
"components":"./components",
41+
"config":"./config",
42+
"stores":"./stores",
43+
"schemas":"./containers/schemas",
44+
"utils":"./utils",
45+
"Img": "./components/Img",
46+
"SvgIcons": "./components/SvgIcons"
47+
}
48+
```
49+
we can easily import files like:
50+
51+
```js
52+
import { ISSUE_WEB } from 'config'
53+
import { makeDebugger, storePlug } from 'utils'
54+
55+
import ArticleEditFooter from 'components/ArticleEditFooter'
56+
...
57+
```
58+
3259
### Module reference order
3360

3461
Container components please follow the following reference order (1-8):

0 commit comments

Comments
 (0)