* docs: translate README to English in homepage * feat(docs): update hero-text in README * docs: add readme_en * feat(docs): add language jump in readme * docs: update readme layout * feat(docs): add CONTRIBUTION_EN and jump link * docs: translate theme introduction * docs: upgrade version to 135 , create 2 file * docs: add icon, fix translation errors in intro, translate quick-start * docs: translate quick start - write * docs: fix jump link in write * docs: translate document in quick start * docs: translate international in quick start * docs: translate deployment in quick start * docs: translate optimize-build in quick start --------- Co-authored-by: pengzhanbo <volodymyr@foxmail.com>
70 lines
2.8 KiB
Markdown
70 lines
2.8 KiB
Markdown
# Contribution Guide
|
|
|
|
## Overview
|
|
|
|
The project repository uses [pnpm workspaces](https://pnpm.io/zh/workspaces) to implement a [Monorepo](https://en.wikipedia.org/wiki/Monorepo), which stores multiple interrelated independent Packages.
|
|
|
|
- The theme is developed and maintained in the `theme` directory.
|
|
- Plugins are developed and maintained in the `plugins` directory.
|
|
- Documentation is developed and maintained in the `docs` directory.
|
|
|
|
In the `plugins` directory:
|
|
|
|
- `plugin-content-update`: Rewrites the `Content` component and provides the `onContentUpdated` hook.
|
|
- `plugin-search`: Provides full-text fuzzy search functionality for the theme.
|
|
- `plugin-shikiji`: A code highlighting plugin that supports highlight, diff, focus, and error level.
|
|
- `plugin-md-power`: Provides enhanced markdown features.
|
|
|
|
## Development Configuration
|
|
|
|
Development requirements:
|
|
|
|
- [Node.js](http://nodejs.org/) version 18.16.0+
|
|
- [pnpm](https://pnpm.io/zh/) version 9+
|
|
|
|
Clone the repository and install dependencies:
|
|
|
|
```sh
|
|
pnpm install
|
|
```
|
|
|
|
Before starting the development service for the first time, build the source code:
|
|
|
|
```sh
|
|
pnpm build
|
|
```
|
|
|
|
### Main Tools
|
|
|
|
- [TypeScript](https://www.typescriptlang.org/) as the development language.
|
|
- [ESLint](https://eslint.org/) for code checking and formatting.
|
|
- [StyleLint](https://stylelint.io/) for code checking and formatting.
|
|
|
|
### Scripts
|
|
|
|
#### `pnpm build`
|
|
|
|
The `build` command uses `tsc` to compile the source code into `.js` files in the `lib` directory. It also copies resources that do not need to be compiled to the corresponding `lib` directory.
|
|
|
|
After cloning the repository, you need to run this command first to ensure that the project code can run smoothly, as the compiled output directory is excluded from the repository by `.gitignore`.
|
|
|
|
#### `pnpm dev`
|
|
|
|
The `dev` command starts two services locally. One runs the `tsup:watch & copy:watch` for the `theme` directory, and the other runs the `vuepress` development service for the example `docs` directory.
|
|
|
|
By default, all plugins under the `plugins` directory do not have a `dev` command. Therefore, changes to the `plugins` directory may require running the `pnpm build` command to rebuild. Some changes to the `plugins/**/node` directory require re-running `pnpm dev` to take effect.
|
|
|
|
#### `pnpm lint`
|
|
|
|
The `lint` command uses ESLint to check all source files.
|
|
|
|
When `lint` reports errors, you can manually modify the source code to fix the ESLint errors, or run `pnpm lint:fix` to automatically fix them.
|
|
|
|
#### `pnpm test`
|
|
|
|
The `test` command uses Vitest to run all tests.
|
|
|
|
### IDE Support
|
|
|
|
It is recommended to use `vs code` for development. This repository is configured with the recommended `vs code` extensions for developing this theme. When you import this repository, `vs code` may recommend that you install some extensions.
|