Skip to content

Commit

Permalink
chore: move to extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Jun 5, 2024
1 parent b443a94 commit 45466e1
Show file tree
Hide file tree
Showing 40 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ LICENSE
packages/*/es/**
packages/*/lib/**
packages/*/dist/**
extensions/*/es/**
extensions/*/lib/**
extensions/*/dist/**

# legacy
legacy/
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default tseslint.config(
'packages/*/es/*',
'packages/*/lib/*',
'packages/*/dist/*',
'extensions/*/es/*',
'extensions/*/lib/*',
'extensions/*/dist/*',

// Website static files
'site/public/*',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@ export default class MapboxService extends BaseMapService<Map> {
*/

// 判断全局 mapboxgl 对象的加载
if (!mapInstance && !window.mapboxgl) {
if (!mapInstance && window?.mapboxgl) {
// 用户有时传递进来的实例是继承于 mapbox 实例化的,不一定是 mapboxgl 对象。
console.error(this.configService.getSceneWarninfo('SDK'));
}

if (
token === MAPBOX_API_KEY &&
style !== 'blank' &&
!window.mapboxgl.accessToken &&
window?.mapboxgl?.accessToken &&
!mapInstance // 如果用户传递了 mapInstance,应该不去干预实例的 accessToken。
) {
console.warn(this.configService.getSceneWarninfo('MapToken'));
}

// 判断是否设置了 accessToken
if (!mapInstance && !window.mapboxgl.accessToken) {
if (!mapInstance && window?.mapboxgl?.accessToken) {
// 用户有时传递进来的实例是继承于 mapbox 实例化的,不一定是 mapboxgl 对象。
window.mapboxgl.accessToken = token;
}
Expand All @@ -74,7 +74,7 @@ export default class MapboxService extends BaseMapService<Map> {
this.mapContainer = this.map.getContainer();
} else {
this.mapContainer = this.creatMapContainer(id);
this.map = new (window.mapboxgl || mapboxgl).Map({
this.map = new (window?.mapboxgl || mapboxgl).Map({
container: this.mapContainer,
style: this.getMapStyleValue(style),
attributionControl,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
packages:
# all packages
- 'packages/*'
- 'extensions/*'
# website
- 'site'
2 changes: 1 addition & 1 deletion site/.dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,6 @@ export default defineConfig({
'@antv/l7-scene': path.resolve(__dirname, '../packages/scene/src'),
'@antv/l7-source': path.resolve(__dirname, '../packages/source/src'),
'@antv/l7-utils': path.resolve(__dirname, '../packages/utils/src'),
'@antv/l7-extension-maps': path.resolve(__dirname, '../packages/extension-maps/src'),
'@antv/l7-extension-maps': path.resolve(__dirname, '../extensions/extension-maps/src'),
},
});
2 changes: 2 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"./*.?*.ts",
"packages",
"packages/*/.?*.ts",
"extensions",
"extensions/*/.?*.ts",
// examples workspace lint
"examples",
// test workspace lint
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@antv/l7-source": ["packages/source/src"],
"@antv/l7-utils": ["packages/utils/src"],
"@antv/l7-test-utils": ["packages/test-utils/src"],
"@antv/l7-extension-maps": ["packages/extension-maps/src"]
"@antv/l7-extension-maps": ["extensions/extension-maps/src"]
},

// Interop Constraints
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
'@antv/l7-scene': path.resolve(__dirname, './packages/scene/src'),
'@antv/l7-source': path.resolve(__dirname, './packages/source/src'),
'@antv/l7-utils': path.resolve(__dirname, './packages/utils/src'),
'@antv/l7-extension-maps': path.resolve(__dirname, './packages/extension-maps/src'),
'@antv/l7-extension-maps': path.resolve(__dirname, './extensions/extension-maps/src'),
},
},
plugins: [
Expand Down

0 comments on commit 45466e1

Please sign in to comment.