liuqiufeng commented on PR #8207: URL: https://github.com/apache/incubator-seata/pull/8207#issuecomment-5394934837
> > > > This may be an expression issue, but you should exclude the entire console-fe directory instead of just the node directory, otherwise other source files in the console-fe directory will be packaged in. > > > > > > > > > > > > * I personally believe that the front-end code under the console-fe folder is part of the source code and therefore should not be excluded. > > > * If the front-end source code is excluded, what method should be used to publish the front-end source code? > > > > > > Only the packaged product needs to be kept in the jar. The frontend source code is packaged during release and placed in the resources folder. Do you mean you want the source-jar to include frontend source code? > > jar中只需要留存打包后的产物即可。前端源代码会在release打包时同时打包,并放入resources文件夹下。你的意思是希望source-jar中包含前端源代码? > > **中文** > > 我认为**应当保留前端源代码**,仅排除 `node` 运行时目录即可。理由如下: > > 1. **源码体积可控**:未打包的前端源码(`console-fe`)仅约 **4.7 MB**,打包后体积更小,即使保留也不会显著增加包体积。排除 `node` 目录(未打包约 101M MB)后,源码包已从 32 MB 降至 4.6 MB,完全可以接受。 > 2. **构建依赖完整**:`pom.xml` 中通过 `frontend-maven-plugin` 管理前端构建流程(如安装依赖、执行构建)。若直接删除 `console-fe` 目录,该插件将无法工作,`console` 模块的源码将不再具备自包含的构建能力,使用者或贡献者需要额外从其他渠道获取前端源码,这违背了 Maven 源码包应提供完整可构建源码的常规预期。 > 3. **历史惯例与可维护性**:此前 Seata 的源码包一直包含前端源码,保留该做法有利于保持一致性,避免给下游用户和贡献者带来困惑。同时,保留源码便于开发者直接调试、修改前端逻辑,无需额外下载或关联外部仓库,提升了开发体验。 > 4. **构建产物 vs 源码**:我们应当区分“运行时依赖”(如 Node.js 可执行文件)和“项目源码”。`node` 目录是构建工具下载的外部运行时,不属于项目自身代码,理应排除;而 `console-fe` 是项目的一部分,属于源码,应当保留。最终发布的 jar 包中仅需包含构建后的静态资源(已由前端构建生成并复制到 `resources/static`),但源码包(`sources.jar`)理应包含完整源码,供 IDE 关联和源码引用。 > > 综上,建议保持当前 PR 的修改范围,即只排除 `static/console-fe/node/`,保留 `console-fe` 下其他所有源码。这样既大幅缩减了源码包体积,又维持了模块的完整性和可维护性。 > > **English** > > I believe **the frontend source code should be retained**, and only the `node` runtime directory should be excluded. The reasons are as follows: > > 1. **Source code size is manageable**: The unpackaged frontend source (`console-fe`) is only about **4.7 MB**, and the packaged size is even smaller. Retaining it will not significantly increase the package size. After excluding the `node` directory (about 101 MB when unpackaged), the source package has already been reduced from 32 MB to 4.6 MB, which is totally acceptable. > 2. **Complete build dependencies**: The `pom.xml` uses the `frontend-maven-plugin` to manage the frontend build process (e.g., installing dependencies, executing the build). If the `console-fe` directory were deleted directly, the plugin would fail to work, and the `console` module would no longer have self-contained build capabilities. Users or contributors would need to obtain the frontend source from other channels, which goes against the general expectation that a Maven source package should provide complete and buildable source code. > 3. **Historical convention and maintainability**: Previously, Seata's source packages have always included the frontend source. Keeping this practice helps maintain consistency and avoids confusion for downstream users and contributors. Moreover, retaining the source makes it convenient for developers to debug and modify frontend logic directly, without needing to download additional assets or link to external repositories, thus improving the development experience. > 4. **Build artifacts vs. source code**: We should distinguish between "runtime dependencies" (e.g., the Node.js executable) and "project source code". The `node` directory is an external runtime downloaded by the build tool; it is not part of the project's own code and should be excluded. In contrast, `console-fe` is part of the project and belongs to the source code, so it should be retained. The final published JAR only needs to contain the built static resources (generated by the frontend build and copied to `resources/static`), but the source package (`sources.jar`) should include the full source code for IDE integration and source referencing. > > In summary, it is recommended to keep the current scope of the PR changes, i.e., only exclude `static/console-fe/node/` and retain all other source files under `console-fe`. This approach significantly reduces the source package size while preserving the module's completeness and maintainability. 携带源码也没什么影响,注意核对下不要打包node_modules即可。 Carrying the source code has no impact, just make sure to exclude the node_modules when packaging. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
