Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: project engineering transformation, using pnpm unified management module, adding some scripts. #840

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chufan443
Copy link

@chufan443 chufan443 commented Nov 16, 2023

The client and server are placed in the root directory in the warehouse, so it is necessary to switch to the corresponding directory when developing. Personally, it is not very optimized, so the project has been reformed based on pnpm package management:

-treat the whole chat2DB as a project, the front end depends on the root directory management, package.json is promoted to the root directory, and the scripts inside are consistent with those of the client.
-Rename the script directory, add ci and lint scripts, and support the locking of dependent versions, while locking the versions of node and pnpm.
-eslint, prettier and other code formatting rules refer to the root directory, which can provide constraints for the subsequent entire repo code style.

The transformation of this PR is mainly an engineering change of the project, which does not involve business, nor does it move the scripts, commands, configurations, etc. of the original client. It is an early demo.

You can pull down the branch and execute the command at the root directory to confirm whether this transformation is feasible.

When the front end needs to be developed:

# Delete the node_modules dependency in all levels of directories.
pnpm clean 

# Download dependencies in the root directory (note: there is a dependency version lock)
./scripts/ci

If the script permission does not support it, you can execute:

chmod +x ./scripts/*

You can try to execute the command that needs to be executed in the client at the root directory to confirm whether the build and package are available normally.

If the transformation of this PR can enable the daily iterative development of Chat2DB project, the follow-up can be considered to expand on this basis:

-Delete the dependency configuration, verification configuration, etc. in the client directory and adopt the root directory uniformly.
-use npm command for tag iteration, including version iteration, for example, npm version path.
-A new script is added to support automatic filling, tag and push of CHANGELOG based on Git records.
-After the engineering-level scripts are perfected, some CI and CD configurations are accessed by using github's actions, and some efforts are made for continuous integration and continuous delivery.

  • ...

The project is very good and has perfect functions, but it still needs to be engineered in iterative development. Code Review, code verification, document verification, automatic deployment, release publishing and packaging pipeline, etc. can all be considered and tried with only one purpose:

make business development more focused on business, reduce the difficulty of getting started on the project, attract more bosses to PR, and build Chat2DB together.

@JerryFan626
Copy link
Contributor

JerryFan626 commented Nov 17, 2023

It is not recommended to carry it out alone. This project is not a simple front-end project.
The content of the front end is best placed in the folder of the front end.

@chufan443
Copy link
Author

chufan443 commented Nov 17, 2023

It is not recommended to carry it out alone. This project is not a simple front-end project.
The content of the front end is best placed in the folder of the front end.

The business is placed in the front-end folder, and the scripts are all in the root directory. The front-end directory focuses on the front-end business. You can pull down the front-end running root script to see if it will affect daily development; Nothing in the original front folder has moved.

@miahemu miahemu changed the title feat: 项目工程化改造,使用pnpm统一管理模块,新增一些脚本 Feat: project engineering transformation, using pnpm unified management module, adding some scripts. Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants