cpnode-front/README.md

89 lines
3.0 KiB
Markdown
Raw Normal View History

2021-12-27 14:09:26 +00:00
# Internet of Data - Control Panel - Frontend
2021-12-26 09:14:46 +00:00
2021-12-27 14:09:26 +00:00
Upstream template: [@daotl/fes-starter](https://github.com/daotl/fes-starter).
2021-12-27 07:34:51 +00:00
2021-12-27 15:33:58 +00:00
## Commit changes
Setup VS Code as the Git editor:
```shell
git config --global core.editor "code --wait"
```
Commit with [Commitizen](https://commitizen.github.io/cz-cli/):
```shell
npx cz
```
Or still use `git commit` and follow [the Conventional Commits spec](https://www.conventionalcommits.org/en/v1.0.0/#summary), your commits will be linted before accepted.
2021-12-27 07:34:51 +00:00
## Technology stack
Basic:
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
- [TypeScript](https://www.typescriptlang.org/)
- [fes.js](https://github.com/WeBankFinTech/fes.js) based on [Vue 3](https://v3.vuejs.org/) and [Webpack](https://webpack.js.org/)
- [JSX](https://v3.vuejs.org/guide/render-function.html#jsx) (optional, to replace Vue's template syntax)
- [SASS](https://sass-lang.com/) with [SCSS](https://sass-lang.com/documentation/syntax#scss) syntax for styling
2021-12-27 09:41:26 +00:00
- [ESLint](https://eslint.org/) with [@daotl/eslint-config-vue](https://github.com/daotl/web-style-configs#using-eslint-config) for linting
2021-12-27 07:34:51 +00:00
- [Prettier](https://prettier.io/) with [@daotl/prettier-config](https://github.com/daotl/web-style-configs#using-prettier-config) for code formatting
- [Stylelint](https://stylelint.io/) for linting CSS and SCSS
`master` branch:
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
- [Element Plus](https://element-plus.org/): component library
- [Iconify](https://iconify.design/) icons with [unplugin-icons](https://github.com/antfu/unplugin-icons)
2021-12-27 07:34:51 +00:00
`antd` branch:
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
- [Ant Design Vue](https://www.antdv.com/): component library
## Project setup
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
```shell
2021-12-27 09:31:15 +00:00
npm install -g @fesjs/create-fes-app
2021-12-27 07:34:51 +00:00
npm install
```
### Compiles and hot-reloads for development
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
```shell
2021-12-27 09:31:15 +00:00
npm run dev
2021-12-27 07:34:51 +00:00
```
### Compiles and minifies for production
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
```shell
2021-12-27 09:31:15 +00:00
npm run prod
2021-12-27 07:34:51 +00:00
```
### Lint & fix
2021-12-27 09:31:15 +00:00
2021-12-27 07:34:51 +00:00
```shell
npm run lint
npm run lint:fix
```
2021-12-27 09:31:15 +00:00
See [Fes.js CLI docs](https://winixt.gitee.io/fesjs/zh/reference/cli/) and [package.json](./package.json) for more.
2021-12-27 07:34:51 +00:00
## Guides & References
### Must-read
Read the following must-read to understand the technology stack of this template.
- [Fes.js Docs](https://winixt.gitee.io/fesjs/zh/guide/)
- [\<script setup> RFC](https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md)
- [Vue 3 Reactivity](https://v3.vuejs.org/guide/reactivity.html#what-is-reactivity)
- [Vue 3 Composition API](https://v3.vuejs.org/guide/composition-api-introduction.html#reactive-variables-with-ref)
- [Vue 3 TypeScript Support](https://v3.vuejs.org/guide/typescript-support.html#annotating-props)
- [Using Vue 3 with JSX and TypeScript](https://bypaulshen.com/posts/vue-3-jsx-typescript)
- [Vue Style Guide](https://v3.vuejs.org/style-guide/)
### Recommended
- [Explaining The New script setup Type in Vue 3 Major Takeaways from the RFC](https://learnvue.co/2021/05/explaining-the-new-script-setup-type-in-vue-3-major-takeaways-from-the-rfc/)
- [New script setup (without ref sugar)](https://github.com/vuejs/rfcs/pull/227)
- [探索 Vue 3 中的 JSX](https://juejin.cn/post/6965057432544346143)