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

FEATURE: 关于结合Git子模块的想法以及想要获取更好的建议 #4798

Closed
3 tasks done
eamd-wq opened this issue Nov 2, 2024 · 1 comment
Closed
3 tasks done

Comments

@eamd-wq
Copy link
Contributor

eamd-wq commented Nov 2, 2024

Version

Vben Admin V5

Description

想要请教一下我应该如何优雅地结合Git子模块来拆分apps中的项目
我目前的做法:
复制了ele项目提交到了一个新的仓库,并且使用 git submodule 关联了这个子项目;目前已经改造完毕,只是不清楚做法是否足够优雅;因为我是自己团队用,默认大仓是每个人都需要拉取的,只是apps中的项目不同的人有不同的权限去拉取;也就是说我目前改造完毕的子项目不能脱离大仓(我觉得这个做法没问题,因为毕竟是大仓项目,就是避免频繁发布npm包)
遇到的问题:

  1. 第一个问题就是commitlint的问题,直接复制出来的子项目在单独提交子项目代码是没有commitlint;后来我通过在子项目添加husky,将.commitlintrc.js也添加到子项目目录,并且添加了prepare声明周期中运行husky,.husky中的三个脚本文件也复制到了子项目的.husky;此时子项目已经可以使用commitlint;(不知道这种做法是否优雅,也是搜了很久没有找到什么好的方案,如果作者或者哪位大佬有好的方案跪请赐教)
  2. 第二个问题就是子项目提交报错,只要改了ts文件或者新增了ts文件提交时就会报错:
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src\views\monitor\store.ts` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.node.json

store.ts就是我新增的一个ts文件,提交代码时无法通过,后来通过修改internal\lint-configs\eslint-config\src\configs\typescript.ts文件; 删除parserOptions.project并添加属性parserOptions.projectService:true解决此问题
(同样不知道这种方式是否优雅,跪请赐教)

over~~

Proposed Solution

跪请赐教

Alternatives Considered

No response

Additional Context

No response

Validations

  • Read the docs
  • Ensure the code is up to date. (Some issues have been fixed in the latest version)
  • I have searched the existing issues and checked that my issue does not duplicate any existing issues.
@vince292007
Copy link
Collaborator

  • commitlint 可以每个子项目app维护一个,是能生效的。
  • tsconfig依赖大仓内的包,目前单独的app基本是开发不了,需要依赖仓库。

@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants