@maptiler/sdk 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.husky/pre-commit +2 -0
- package/{readme.md → README.md} +26 -6
- package/dist/eslint.config.d.mts +2 -0
- package/dist/maptiler-sdk.css +1 -1
- package/dist/maptiler-sdk.mjs +1583 -1597
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +1 -1
- package/dist/src/Map.d.ts +7 -1
- package/dist/src/config.d.ts +2 -2
- package/dist/src/{MaptilerGeolocateControl.d.ts → controls/MaptilerGeolocateControl.d.ts} +1 -1
- package/dist/src/{MaptilerLogoControl.d.ts → controls/MaptilerLogoControl.d.ts} +2 -2
- package/dist/src/{MaptilerNavigationControl.d.ts → controls/MaptilerNavigationControl.d.ts} +1 -1
- package/dist/src/{MaptilerProjectionControl.d.ts → controls/MaptilerProjectionControl.d.ts} +1 -1
- package/dist/src/{MaptilerTerrainControl.d.ts → controls/MaptilerTerrainControl.d.ts} +1 -1
- package/dist/src/{Minimap.d.ts → controls/Minimap.d.ts} +1 -1
- package/dist/src/controls/index.d.ts +6 -0
- package/dist/src/helpers/index.d.ts +3 -13
- package/dist/src/helpers/stylehelper.d.ts +1 -1
- package/dist/src/helpers/vectorlayerhelpers.d.ts +1 -1
- package/dist/src/index.d.ts +9 -12
- package/dist/src/tools.d.ts +3 -7
- package/dist/src/utils/dom.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/vite.config-test.d.ts +2 -0
- package/dist/vitest-setup-tests.d.ts +1 -0
- package/eslint.config.mjs +61 -0
- package/package.json +32 -16
- package/tsconfig.json +13 -6
- package/vite.config-dev.ts +7 -0
- package/vite.config-es.ts +4 -0
- package/vite.config-test.ts +7 -0
- package/vite.config-umd.ts +4 -0
- package/vitest-setup-tests.ts +4 -0
- package/biome.json +0 -50
- /package/dist/src/{colorramp.d.ts → ColorRamp.d.ts} +0 -0
- /package/dist/src/{defaults.d.ts → constants/defaults.d.ts} +0 -0
- /package/dist/src/{unit.d.ts → types.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
2
|
import { Map as SDKMap } from '../Map';
|
|
3
3
|
export declare class MapMouseEvent extends maplibregl.MapMouseEvent {
|
|
4
|
-
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?:
|
|
4
|
+
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?: Record<string, unknown>);
|
|
5
5
|
}
|
package/dist/src/Map.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { default as maplibregl, StyleSpecification, MapOptions as MapOptionsML,
|
|
|
2
2
|
import { ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
|
|
3
3
|
import { SdkConfig } from './config';
|
|
4
4
|
import { LanguageInfo } from './language';
|
|
5
|
-
import { MinimapOptionsInput } from './Minimap';
|
|
5
|
+
import { MinimapOptionsInput } from './controls/Minimap';
|
|
6
6
|
import { Telemetry } from './Telemetry';
|
|
7
7
|
export type LoadWithTerrainEvent = {
|
|
8
8
|
type: "loadWithTerrain";
|
|
@@ -130,6 +130,7 @@ export type MapOptions = Omit<MapOptionsML, "style" | "maplibreLogo"> & {
|
|
|
130
130
|
* The Map class can be instanciated to display a map in a `<div>`
|
|
131
131
|
*/
|
|
132
132
|
export declare class Map extends maplibregl.Map {
|
|
133
|
+
private options;
|
|
133
134
|
readonly telemetry: Telemetry;
|
|
134
135
|
private isTerrainEnabled;
|
|
135
136
|
private terrainExaggeration;
|
|
@@ -148,6 +149,11 @@ export declare class Map extends maplibregl.Map {
|
|
|
148
149
|
private isStyleLocalized;
|
|
149
150
|
private languageIsUpdated;
|
|
150
151
|
constructor(options: MapOptions);
|
|
152
|
+
/**
|
|
153
|
+
* Recreates the map instance with the same options.
|
|
154
|
+
* Useful for WebGL context loss.
|
|
155
|
+
*/
|
|
156
|
+
recreate(): void;
|
|
151
157
|
/**
|
|
152
158
|
* Set the duration (millisec) of the terrain animation for growing or flattening.
|
|
153
159
|
* Must be positive. (Built-in default: `1000` milliseconds)
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as EventEmitter } from 'events';
|
|
2
2
|
import { LanguageInfo } from './language';
|
|
3
3
|
import { FetchFunction } from '@maptiler/client';
|
|
4
|
-
import { Unit } from './
|
|
4
|
+
import { Unit } from './types';
|
|
5
5
|
export declare const MAPTILER_SESSION_ID: string;
|
|
6
6
|
/**
|
|
7
7
|
* Configuration class for the SDK
|
|
@@ -45,7 +45,7 @@ declare class SdkConfig extends EventEmitter {
|
|
|
45
45
|
* - if terrain is activated at initialization [boolean]
|
|
46
46
|
* - if globe projection is activated at initialization [boolean]
|
|
47
47
|
*
|
|
48
|
-
* In addition, each official module will be
|
|
48
|
+
* In addition, each official module will be added to a list, alongside its version number.
|
|
49
49
|
*/
|
|
50
50
|
telemetry: boolean;
|
|
51
51
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeolocateControl } from '
|
|
1
|
+
import { GeolocateControl } from '../MLAdapters/GeolocateControl';
|
|
2
2
|
/**
|
|
3
3
|
* The MaptilerGeolocateControl is an extension of the original GeolocateControl
|
|
4
4
|
* with a few changes. In this version, the active mode persists as long as the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogoControlOptions as LogoControlOptionsML } from 'maplibre-gl';
|
|
2
|
-
import { LogoControl } from '
|
|
3
|
-
import { Map as SDKMap } from '
|
|
2
|
+
import { LogoControl } from '../MLAdapters/LogoControl';
|
|
3
|
+
import { Map as SDKMap } from '../Map';
|
|
4
4
|
type LogoControlOptions = LogoControlOptionsML & {
|
|
5
5
|
logoURL?: string;
|
|
6
6
|
linkURL?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NavigationControlOptions } from 'maplibre-gl';
|
|
2
|
-
import { NavigationControl } from '
|
|
2
|
+
import { NavigationControl } from '../MLAdapters/NavigationControl';
|
|
3
3
|
type HTMLButtonElementPlus = HTMLButtonElement & {
|
|
4
4
|
clickFunction: (e?: Event) => unknown;
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Map as SDKMap, MapOptions } from '
|
|
1
|
+
import { Map as SDKMap, MapOptions } from '../Map';
|
|
2
2
|
import { ControlPosition, CustomLayerInterface, FillLayerSpecification, FilterSpecification, IControl, LayerSpecification, LineLayerSpecification, SourceSpecification, StyleOptions, StyleSetterOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
|
|
3
3
|
import { MapStyleVariant, ReferenceMapStyle } from '@maptiler/client';
|
|
4
4
|
export interface ParentRect {
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* Helpers are a set of functions to facilitate the creation of sources and layers
|
|
6
|
-
*/
|
|
7
|
-
export declare const helpers: {
|
|
8
|
-
addPolyline: typeof addPolyline;
|
|
9
|
-
addPolygon: typeof addPolygon;
|
|
10
|
-
addPoint: typeof addPoint;
|
|
11
|
-
addHeatmap: typeof addHeatmap;
|
|
12
|
-
takeScreenshot: typeof takeScreenshot;
|
|
13
|
-
};
|
|
1
|
+
export * from './screenshot';
|
|
2
|
+
export * from './vectorlayerhelpers';
|
|
3
|
+
export * from './stylehelper';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataDrivenPropertyValueSpecification, ExpressionSpecification } from 'maplibre-gl';
|
|
2
|
-
import { ColorRamp } from '../
|
|
2
|
+
import { ColorRamp } from '../ColorRamp';
|
|
3
3
|
import { DataDrivenStyle, PropertyValues, ZoomNumberValues, ZoomStringValues } from './vectorlayerhelpers';
|
|
4
4
|
export type ColorPalette = [string, string, string, string];
|
|
5
5
|
export declare const colorPalettes: Array<ColorPalette>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as maplibregl } from 'maplibre-gl';
|
|
2
2
|
export type * from 'maplibre-gl';
|
|
3
3
|
/**
|
|
4
|
-
* Get the version of MapTiler SDK
|
|
4
|
+
* Get the version of MapTiler SDK, this is declared in the vite config
|
|
5
|
+
* to avoid importing the entire package.json
|
|
5
6
|
*/
|
|
6
7
|
export declare function getVersion(): string;
|
|
7
8
|
declare const MapMLGL: typeof maplibregl.Map;
|
|
@@ -73,18 +74,14 @@ export { TwoFingersTouchPitchHandler } from './MLAdapters/TwoFingersTouchPitchHa
|
|
|
73
74
|
export { MapWheelEvent } from './MLAdapters/MapWheelEvent';
|
|
74
75
|
export { MapTouchEvent } from './MLAdapters/MapTouchEvent';
|
|
75
76
|
export { MapMouseEvent } from './MLAdapters/MapMouseEvent';
|
|
76
|
-
export { Map, GeolocationType, type MapOptions, type LoadWithTerrainEvent
|
|
77
|
-
export * from './
|
|
78
|
-
export * from './MaptilerLogoControl';
|
|
79
|
-
export * from './MaptilerTerrainControl';
|
|
80
|
-
export * from './MaptilerNavigationControl';
|
|
81
|
-
export * from './MaptilerProjectionControl';
|
|
77
|
+
export { Map, GeolocationType, type MapOptions, type LoadWithTerrainEvent } from './Map';
|
|
78
|
+
export * from './controls';
|
|
82
79
|
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, type LanguageGeocodingOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, } from '@maptiler/client';
|
|
83
|
-
export { getWebGLSupportError } from './tools';
|
|
80
|
+
export { getWebGLSupportError, displayWebGLContextLostWarning } from './tools';
|
|
84
81
|
export { config, SdkConfig } from './config';
|
|
85
82
|
export * from './language';
|
|
86
|
-
export type { Unit } from './
|
|
87
|
-
export * from './Minimap';
|
|
83
|
+
export type { Unit } from './types';
|
|
88
84
|
export * from './converters';
|
|
89
|
-
export * from './
|
|
90
|
-
export * from './
|
|
85
|
+
export * as helpers from './helpers';
|
|
86
|
+
export * from './ColorRamp';
|
|
87
|
+
export * from './utils';
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { default as maplibregl, RequestParameters, ResourceType, RequestTransfor
|
|
|
2
2
|
import { Map as MapSDK } from './Map';
|
|
3
3
|
export declare function enableRTL(): void;
|
|
4
4
|
export declare function bindAll(fns: Array<string>, context: any): void;
|
|
5
|
-
export declare function DOMcreate<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
|
|
6
|
-
export declare function DOMremove(node: HTMLElement): void;
|
|
7
5
|
/**
|
|
8
6
|
* This function is meant to be used as transformRequest by any Map instance created.
|
|
9
7
|
* It adds the session ID as well as the MapTiler Cloud key from the config to all the requests
|
|
@@ -45,9 +43,9 @@ export declare function getWebGLSupportError(): string | null;
|
|
|
45
43
|
*/
|
|
46
44
|
export declare function displayNoWebGlWarning(container: HTMLElement | string): void;
|
|
47
45
|
/**
|
|
48
|
-
* Display
|
|
46
|
+
* Display a warning message in the Map div if the WebGL context was lost
|
|
49
47
|
*/
|
|
50
|
-
export declare function displayWebGLContextLostWarning(
|
|
48
|
+
export declare function displayWebGLContextLostWarning(map: MapSDK): void;
|
|
51
49
|
/**
|
|
52
50
|
* In a text-field style property (as an object, not a string) the languages that are specified as
|
|
53
51
|
* ["get", "name:XX"] are replaced by the proved replacer (also an object).
|
|
@@ -82,7 +80,5 @@ export declare function findLanguageStr(str: string): Array<string | null>;
|
|
|
82
80
|
export declare function findLanguageObj(origExpr: maplibregl.ExpressionSpecification): Array<string | null>;
|
|
83
81
|
export declare function computeLabelsLocalizationMetrics(layers: maplibregl.LayerSpecification[], map: MapSDK): {
|
|
84
82
|
unlocalized: number;
|
|
85
|
-
localized:
|
|
86
|
-
[k: string]: number;
|
|
87
|
-
};
|
|
83
|
+
localized: Record<string, number>;
|
|
88
84
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
|
5
|
+
|
|
6
|
+
export default tseslint.config(
|
|
7
|
+
// https://typescript-eslint.io/getting-started/typed-linting/
|
|
8
|
+
tseslint.configs.strictTypeChecked,
|
|
9
|
+
tseslint.configs.stylisticTypeChecked,
|
|
10
|
+
tseslint.configs.recommendedTypeChecked,
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parserOptions: {
|
|
14
|
+
projectService: true,
|
|
15
|
+
tsconfigRootDir: import.meta.dirname,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
// https://github.com/prettier/eslint-plugin-prettier
|
|
20
|
+
eslintPluginPrettierRecommended,
|
|
21
|
+
//
|
|
22
|
+
{
|
|
23
|
+
rules: {
|
|
24
|
+
"@typescript-eslint/array-type": "off",
|
|
25
|
+
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
26
|
+
"@typescript-eslint/consistent-type-definitions": "off",
|
|
27
|
+
"@typescript-eslint/no-base-to-string": "warn",
|
|
28
|
+
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
29
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
30
|
+
"@typescript-eslint/no-empty-function": "warn", // this is to satisfy maplibre-gl custom layer interface
|
|
31
|
+
"@typescript-eslint/no-floating-promises": "warn",
|
|
32
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
33
|
+
"@typescript-eslint/no-misused-promises": "warn",
|
|
34
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
|
|
35
|
+
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
36
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "off",
|
|
37
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
|
38
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "warn",
|
|
39
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
40
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
41
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
42
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
43
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
|
44
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
45
|
+
"@typescript-eslint/no-unsafe-return": "warn",
|
|
46
|
+
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
47
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
|
|
48
|
+
"@typescript-eslint/prefer-for-of": "off",
|
|
49
|
+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
|
|
50
|
+
"@typescript-eslint/prefer-optional-chain": "off",
|
|
51
|
+
"@typescript-eslint/prefer-return-this-type": "off",
|
|
52
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
53
|
+
"@typescript-eslint/restrict-plus-operands": "warn",
|
|
54
|
+
"@typescript-eslint/restrict-template-expressions": "warn",
|
|
55
|
+
"@typescript-eslint/related-getter-setter-pairs": "off",
|
|
56
|
+
"@typescript-eslint/unbound-method": "warn",
|
|
57
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "warn",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
//
|
|
61
|
+
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
|
+
"author": "MapTiler",
|
|
5
6
|
"module": "dist/maptiler-sdk.mjs",
|
|
6
7
|
"types": "dist/maptiler-sdk.d.ts",
|
|
7
8
|
"style": "dist/maptiler-sdk.css",
|
|
@@ -34,38 +35,53 @@
|
|
|
34
35
|
"url": "https://github.com/maptiler/maptiler-sdk-js.git"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
|
-
"
|
|
38
|
-
"biome:fix": "npx @biomejs/biome check --max-diagnostics=1000 --write",
|
|
38
|
+
"prepare": "husky",
|
|
39
39
|
"doc": "rm -rf docs/* && typedoc --out docs && cp -r images docs/",
|
|
40
|
-
"
|
|
40
|
+
"ncu": "npx npm-check-updates",
|
|
41
|
+
"lint": "eslint src",
|
|
42
|
+
"lint:fix": "eslint src --fix",
|
|
43
|
+
"test:watch": "vitest watch -c vite.config-test.ts --dom",
|
|
44
|
+
"test": "vitest run -c vite.config-test.ts --dom",
|
|
45
|
+
"install:clean": "rm -rf build/ dist/ node_modules/ && npm ci",
|
|
46
|
+
"dev": "concurrently \"vite -c vite.config-dev.ts\" \"npm run dev-umd\"",
|
|
47
|
+
"dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts",
|
|
41
48
|
"build-css": "mkdir -p dist build && node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css",
|
|
42
49
|
"build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts",
|
|
43
50
|
"build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts",
|
|
44
51
|
"build": "npm run build-es; npm run build-umd; npm run build-css",
|
|
45
|
-
"make": "npm run
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
52
|
+
"make": "npm run install:clean && npm run build"
|
|
53
|
+
},
|
|
54
|
+
"lint-staged": {
|
|
55
|
+
"*.ts": "npm run lint:fix"
|
|
49
56
|
},
|
|
50
|
-
"author": "MapTiler",
|
|
51
57
|
"devDependencies": {
|
|
52
|
-
"@
|
|
58
|
+
"@canvas/image-data": "^1.0.0",
|
|
59
|
+
"@eslint/js": "^9.21.0",
|
|
53
60
|
"@types/uuid": "^10.0.0",
|
|
54
61
|
"@types/xmldom": "^0.1.31",
|
|
62
|
+
"@vitest/web-worker": "^3.0.9",
|
|
55
63
|
"@xmldom/xmldom": "^0.8.10",
|
|
56
64
|
"concurrently": "^9.1.2",
|
|
65
|
+
"eslint": "^9.21.0",
|
|
66
|
+
"eslint-config-prettier": "^10.0.2",
|
|
67
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
68
|
+
"happy-dom": "^17.4.4",
|
|
69
|
+
"husky": "^8.0.0",
|
|
70
|
+
"lint-staged": "^15.4.3",
|
|
71
|
+
"prettier": "3.5.2",
|
|
57
72
|
"typedoc": "^0.27.6",
|
|
58
|
-
"typescript": "^5.7.
|
|
73
|
+
"typescript": "^5.7.3",
|
|
74
|
+
"typescript-eslint": "^8.25.0",
|
|
59
75
|
"vite": "^6.0.7",
|
|
60
|
-
"vite-plugin-dts": "^4.
|
|
61
|
-
"vitest": "^
|
|
76
|
+
"vite-plugin-dts": "^4.5.0",
|
|
77
|
+
"vitest": "^3.0.9"
|
|
62
78
|
},
|
|
63
79
|
"dependencies": {
|
|
64
|
-
"@maplibre/maplibre-gl-style-spec": "^
|
|
80
|
+
"@maplibre/maplibre-gl-style-spec": "^23.0.0",
|
|
65
81
|
"@maptiler/client": "^2.2.0",
|
|
66
82
|
"events": "^3.3.0",
|
|
67
83
|
"js-base64": "^3.7.7",
|
|
68
|
-
"maplibre-gl": "^5.0.
|
|
69
|
-
"uuid": "^11.0.
|
|
84
|
+
"maplibre-gl": "^5.0.1",
|
|
85
|
+
"uuid": "^11.0.5"
|
|
70
86
|
}
|
|
71
87
|
}
|
package/tsconfig.json
CHANGED
|
@@ -5,23 +5,30 @@
|
|
|
5
5
|
"target": "es2021",
|
|
6
6
|
"useDefineForClassFields": true,
|
|
7
7
|
"module": "ESNext",
|
|
8
|
-
"lib": [
|
|
8
|
+
"lib": [
|
|
9
|
+
"es2021",
|
|
10
|
+
"DOM",
|
|
11
|
+
"DOM.Iterable"
|
|
12
|
+
],
|
|
9
13
|
"skipLibCheck": true,
|
|
10
|
-
|
|
11
14
|
/* Bundler mode */
|
|
12
15
|
"resolveJsonModule": true,
|
|
13
16
|
"isolatedModules": true,
|
|
14
17
|
"noEmit": true,
|
|
15
|
-
|
|
16
18
|
/* Linting */
|
|
17
19
|
"strict": true,
|
|
18
20
|
"noUnusedLocals": true,
|
|
19
21
|
"noUnusedParameters": true,
|
|
20
22
|
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
|
|
22
|
-
|
|
23
23
|
"declaration": true,
|
|
24
24
|
"allowSyntheticDefaultImports": true,
|
|
25
|
+
"allowJs": true,
|
|
25
26
|
},
|
|
26
|
-
"include": [
|
|
27
|
+
"include": [
|
|
28
|
+
"src",
|
|
29
|
+
"./eslint.config.mjs",
|
|
30
|
+
"test",
|
|
31
|
+
"./vite.config-test.ts",
|
|
32
|
+
"./vitest-setup-tests.ts"
|
|
33
|
+
],
|
|
27
34
|
}
|
package/vite.config-dev.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config";
|
|
2
|
+
import packagejson from "./package.json";
|
|
2
3
|
|
|
3
4
|
export default defineConfig({
|
|
5
|
+
server: {
|
|
6
|
+
port: 3000,
|
|
7
|
+
},
|
|
8
|
+
define: {
|
|
9
|
+
__MT_SDK_VERSION__: JSON.stringify(packagejson.version),
|
|
10
|
+
},
|
|
4
11
|
plugins: [
|
|
5
12
|
{
|
|
6
13
|
name: 'url-override',
|
package/vite.config-es.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
2
|
import { defineConfig } from 'vite';
|
|
3
3
|
import dts from 'vite-plugin-dts';
|
|
4
|
+
import packagejson from "./package.json";
|
|
4
5
|
|
|
5
6
|
const isProduction = process.env.NODE_ENV === "production";
|
|
6
7
|
|
|
@@ -43,6 +44,9 @@ export default defineConfig({
|
|
|
43
44
|
globals: {},
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
},
|
|
48
|
+
define: {
|
|
49
|
+
__MT_SDK_VERSION__: JSON.stringify(packagejson.version),
|
|
46
50
|
},
|
|
47
51
|
plugins,
|
|
48
52
|
})
|
package/vite.config-test.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config";
|
|
2
|
+
import packagejson from "./package.json";
|
|
2
3
|
|
|
3
4
|
export default defineConfig({
|
|
4
5
|
test: {
|
|
@@ -6,5 +7,11 @@ export default defineConfig({
|
|
|
6
7
|
typecheck: {
|
|
7
8
|
tsconfig: "./tsconfig.json",
|
|
8
9
|
},
|
|
10
|
+
// environment: "jsdom",
|
|
11
|
+
globals: true,
|
|
12
|
+
setupFiles: ["@vitest/web-worker", "./vitest-setup-tests.ts"],
|
|
13
|
+
},
|
|
14
|
+
define: {
|
|
15
|
+
__MT_SDK_VERSION__: JSON.stringify(packagejson.version),
|
|
9
16
|
},
|
|
10
17
|
});
|
package/vite.config-umd.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
2
|
import { defineConfig } from 'vite';
|
|
3
|
+
import packagejson from "./package.json";
|
|
3
4
|
|
|
4
5
|
const isProduction = process.env.NODE_ENV === "production";
|
|
5
6
|
|
|
@@ -17,5 +18,8 @@ export default defineConfig({
|
|
|
17
18
|
formats: ['umd'],
|
|
18
19
|
}
|
|
19
20
|
},
|
|
21
|
+
define: {
|
|
22
|
+
__MT_SDK_VERSION__: JSON.stringify(packagejson.version),
|
|
23
|
+
},
|
|
20
24
|
plugins: [],
|
|
21
25
|
});
|
package/biome.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": {
|
|
3
|
-
"include": ["./src/**/*.js", "./src/**/*.ts"],
|
|
4
|
-
"ignore": ["dist", "build"]
|
|
5
|
-
},
|
|
6
|
-
"organizeImports": {
|
|
7
|
-
"enabled": false
|
|
8
|
-
},
|
|
9
|
-
"formatter": {
|
|
10
|
-
"indentStyle": "space",
|
|
11
|
-
"indentWidth": 2,
|
|
12
|
-
"lineWidth": 120
|
|
13
|
-
},
|
|
14
|
-
"javascript": {
|
|
15
|
-
"formatter": {
|
|
16
|
-
"arrowParentheses": "always",
|
|
17
|
-
"bracketSameLine": false,
|
|
18
|
-
"bracketSpacing": true,
|
|
19
|
-
"jsxQuoteStyle": "double",
|
|
20
|
-
"quoteProperties": "asNeeded",
|
|
21
|
-
"semicolons": "always",
|
|
22
|
-
"trailingCommas": "all"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"json": {
|
|
26
|
-
"formatter": {
|
|
27
|
-
"trailingCommas": "none"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"linter": {
|
|
31
|
-
"rules": {
|
|
32
|
-
"style": {
|
|
33
|
-
"noInferrableTypes": "off"
|
|
34
|
-
},
|
|
35
|
-
"suspicious": {
|
|
36
|
-
"noExplicitAny": {
|
|
37
|
-
"level": "off"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"complexity": {
|
|
41
|
-
"noUselessTernary": {
|
|
42
|
-
"level": "off"
|
|
43
|
-
},
|
|
44
|
-
"useOptionalChain": {
|
|
45
|
-
"level": "off"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|