refactor: consolidate monorepo packages (12 -> 8) - #2885
Merged
Conversation
将能合并的包并入上游消费包以减少包数量、简化依赖图: - map -> maps (src/__tests__ 迁入 maps/src/mapbase, maps 直出 map 原语) - renderer -> scene (DeviceRendererService 并入 scene/src/renderer) - component -> scene (Popup/Logo/Zoom/Scale 等 UI 控件并入 scene/src/component; scene 切到 babel transformer 以复用 transform-import-css-l7 内联样式, 并补 style.d.ts) - source -> layers (数据源并入 layers/src/source, Source 通过 layers 再导出) 统一改动: - packages/l7: 删除对 component/source 的直接依赖与 re-export, 改由 scene/layers 透传 - tsconfig.json: 移除 component/source 路径映射 - site/.dumirc.ts: 修正 map/renderer/component/source 的 alias 指向合并后位置 - 删除零引用的 maps/legacy (旧 mapbox-gl v1 fork, 已被 mapbase 取代) 构建验证: maps(92) / scene(66) / layers(255) / l7(umbrella+UMD) 全部通过, UMD bundle 含全部 component 控件、Source 及 source side-effect 注册串。 测试: 364 pass; 31 个 TestScene 套件失败为既有问题(headless-gl 在 Node22 下 gl() 返回 null),与本次合并无关(未改动的 scene/__tests__/index.spec.ts 同样失败)。
|
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
master 的 @antv/l7-source 渐进式重构(#2882)与本分支搬运(source→layers)冲突,逐类解决: - layers/src/source 与 __tests__/source 完整采用 master 新结构 (tile-source/、parser/ndi.ts、base-source.ts、create-source.ts 等) - relative-coordinates 已由 master 上移至 @antv/l7-utils,保留 utils 版本 - maps 底图迁移:采用 master 的 BaseMap/MapboxBaseMap 新结构, @antv/l7-map 引用改 ../mapbase(map 包已并入 maps/src/mapbase) - BaseLayer: @antv/l7-source → ../source,保留 master 的 processRelativeCoordinates - 删除被合并包(source/component/map/renderer)残留,版本号同步 master 2.30.0-beta.0 - l7/layers/scene 顶部元数据冲突取 master 版本号;test-utils 保留 peerDependencies - __tests__/source 测试相对路径同步调整(../src → ../../src/source) 构建验证:layers(271) / maps(88) / scene(66) / l7(UMD 1.4M < 1.7Mb) 全部通过
合并 master 后两处 CI 失败: 1. lint: @antv/l7-scene 的 sideEffects: false 与合并 component 后的样式导入 冲突(tree-shaking 会丢样式)。参照原 component 包改为 ["*.css","*.less","*.js","*/iconfont/*"],check-deps 0 error。 2. unit-test: camera.spec.ts 在 __tests__/mapbase/(两层深), ../src/map/ 只解析到 __tests__/src(少一级 ../)。 改为 ../../src/mapbase/map/(并修正 map 包合并后的 mapbase 路径)。 本地 158 tests pass。
7 个合并引入的文件未通过 format-check:
- maps/src/mapbase/map/handler/{drag_move_state_manager,two_fingers_touch}.ts
- scene/src/component/control/{baseControl/control,baseControl/popperControl,fullscreen}.ts
- scene/src/component/utils/screenfull.ts
- scene/src/renderer/device/utils/typedarray.ts
prettier --write 修复,format-check 全部通过。
lzxue
added a commit
that referenced
this pull request
Jul 24, 2026
Remove 20 changeset files left stale by the 12->8 package consolidation (#2885 / 18156ea): - 18 x refactor-source-*.md reference @antv/l7-source, which was merged into @antv/l7-layers by #2885 and no longer exists as a workspace package. - 2 x fix-maps-bmap-tmap-types.md / fix-test-utils-redundant-peerdeps.md reference live packages (@antv/l7-maps / @antv/l7-test-utils) but are likewise already consumed. All 20 are already consumed: recorded in .changeset/pre.json (changesets[]) and released to CHANGELOGs as 2.30.0-beta.0 (commit 471662a). In changeset pre-release mode the .md files are retained on disk until 'pre exit', but the 18 referencing the merged-away @antv/l7-source broke tooling: changeset status / version -> Error: Found changeset refactor-source-01 for package @antv/l7-source which is not in the workspace Purging restores .changeset/ to pending-only + infra state and unblocks changeset status/version for follow-on P1/P2 entries. Content history is preserved in CHANGELOGs and pre.json (ids retained). No version bumps; no runtime change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
将能合并的包并入上游消费包,以减少包数量、简化依赖图:12 个子包合并为 8 个。
合并方案
@antv/l7-map@antv/l7-mapssrc/__tests__迁入maps/src/mapbase,maps 直出 map 原语@antv/l7-renderer@antv/l7-sceneDeviceRendererService并入scene/src/renderer@antv/l7-component@antv/l7-scenescene/src/component;scene 切到 babel transformer 以复用transform-import-css-l7内联样式,并补style.d.ts@antv/l7-source@antv/l7-layerslayers/src/source,Source通过 layers 再导出合并后保留的 8 个包:
```
@antv/l7 (聚合入口)
@antv/l7-core
@antv/l7-utils
@antv/l7-maps (吸收 map)
@antv/l7-scene (吸收 renderer + component)
@antv/l7-layers (吸收 source)
@antv/l7-three
@antv/l7-test-utils (私有)
```
统一改动
验证
影响