Improve README

* Update links
* Update table of contents
* Improve the design
* Improve formatting
* Fix abbreviations and proper names
* Fix tables
* Fix indentation in code snippets
* Fix typos
This commit is contained in:
Pavel Moiseenko
2021-07-25 13:08:34 -05:00
committed by Umputun
parent f093d6a07a
commit 50b3776d2a
3 changed files with 360 additions and 365 deletions
+326 -332
View File
File diff suppressed because it is too large Load Diff
+19 -18
View File
@@ -1,36 +1,37 @@
# Frontend guide
### Code Style
- project uses typescript to statically analyze code
- project uses `eslint` and `stylelint` to check frontend code. You can manually run via `npm run lint`.
- git hooks (via husky) installed automatically on `npm install` and check and try to fix code style if possible, otherwise commit will be rejected
- if you want IDE integration, you need `eslint` and `stylelint` plugin to be installed.
* project uses TypeScript to statically analyze code
* project uses `eslint` and `stylelint` to check frontend code. You can manually run via `npm run lint`
* Git Hooks (via husky) installed automatically on `npm install` and check and try to fix code style if possible, otherwise commit will be rejected
* if you want IDE integration, you need `eslint` and `stylelint` plugin to be installed
### CSS Styles
- now we are migrating to css-modules and this is recomended way to stylization. A file with styles should be named like `component.module.css`
- old component styles use BEM notation (at least it should): `block__element_modifier`. Also there are `mix` classes: `block_modifier`.
- new way to naming CSS selectors is camel-case like `blockElemenModifier` and use `classnames` to combine it
- component base style resides in the component's root directory with name of component converted to kebab-case. For example `ListComments` style is located in `./app/components/list-comments/list-component.tsx`
- any other files should be named also in kebab-case. For example `./app/utils/get-param.ts`
* now we are migrating to CSS Modules and this is a recommended way to stylization. A file with styles should be named like `component.module.css`
* old component styles use BEM notation (at least it should): `block__element_modifier`. Also, there are `mix` classes: `block_modifier`
* new way to naming CSS selectors is camel-case like `blockElemenModifier` and use `classnames` to combine it
* component base style resides in the component's root directory with a name of component converted to kebab-case. For example, `ListComments` style is located in `./app/components/list-comments/list-component.tsx`
* any other files should be named also in kebab-case. For example, `./app/utils/get-param.ts`
### Imports
- imports for typescript, javascript files should be without extension: `./index`, not `./index.ts`
- if file resides in the same directory or in subdirectory import should be relative: `./types/something`
- otherwise it should be imported by absolute path relative to `src` folder like `common/store` which mapped to `./app/common/store.ts` in webpack, tsconfig and jest
* imports for TypeScript, JavaScript files should be without extension: `./index`, not `./index.ts`
* if the file resides in the same directory or subdirectory import should be relative: `./types/something`
* otherwise it should be imported by absolute path relative to `src` folder like `common/store` which mapped to `./app/common/store.ts` in webpack, tsconfig and Jest
### Testing
- project uses `jest` as test harness.
- jest check files that match regex `\.(test|spec)\.ts(x?)$`, i.e `comment.test.tsx`, `comment.spec.ts`
- tests are running on push attempt
- example tests can be found in `./app/store/user/reducers.test.ts`, `./app/components/auth-panel/auth-panel.test.tsx`
* project uses `jest` as test harness
* Jest checks files that match regex `\.(test|spec)\.ts(x?)$`, i.e. `comment.test.tsx`, `comment.spec.ts`
* tests are running on push attempt
* example tests can be found in `./app/store/user/reducers.test.ts`, `./app/components/auth-panel/auth-panel.test.tsx`
### How to add new locale
Please see [this documentation](https://github.com/umputun/remark42/blob/master/docs/translation.md).
Please see [this documentation](/site/src/docs/contributing/translations/index.md).
### Notes
- Frontend part being bundled on docker env gets placed on `/src/web` and is available via `http://{host}/web`. for example `embed.js` entry point will be available at `http://{host}/web/embed.js`
* frontend part being bundled on docker env gets placed on `/src/web` and is available via `http://{host}/web`. For example, `embed.js` entry point will be available at `http://{host}/web/embed.js`
+15 -15
View File
@@ -1,25 +1,25 @@
# Reamark42 Website
# Remark42 site
## Work on Your Local Environment
## Work on your local environment
Requirements:
- [Node.js v14](https://nodejs.org/en/) or higher - Install from package or with Homebrew
- Yarn 1.22 or higher - once you have Node.js run `npm i -g yarn`
* [Node.js v14](https://nodejs.org/en/) or higher - install from package or with Homebrew
* Yarn 1.22 or higher - once you have Node.js, run `npm i -g yarn`
### Development
Install dependencies and start development server:
Install dependencies and start the development server:
```
$ yarn
$ yarn dev
```shell
yarn
yarn dev
```
### Build
```
$ yarn build
```shell
yarn build
```
## Work with Docker Compose
@@ -28,17 +28,17 @@ $ yarn build
Install dependencies and run development server inside Docker:
```
$ docker-compose build
$ docker-compose up server
```shell
docker-compose build
docker-compose up server
```
Then serve files from `./build` with your favorite server
### Development
```
$ docker-compose up --build server
```shell
docker-compose up --build server
```
Then head to http://localhost:8080