From 7b26efa60290b432f09b5c9f70b19f7d394e52bc Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Wed, 4 Aug 2021 21:01:56 +0800 Subject: [PATCH] chore: add reflect meta import --- packages/component/package.json | 1 + packages/core/package.json | 1 - packages/core/src/services/asset/FontService.ts | 1 + packages/core/src/services/asset/IconService.ts | 1 + packages/core/src/services/camera/CameraService.ts | 1 + packages/core/src/services/component/ControlService.ts | 1 + packages/core/src/services/component/MarkerService.ts | 1 + packages/core/src/services/component/PopupService.ts | 1 + packages/core/src/services/config/ConfigService.ts | 1 + .../core/src/services/coordinate/CoordinateSystemService.ts | 1 + packages/core/src/services/interaction/InteractionService.ts | 1 + packages/core/src/services/interaction/PickingService.ts | 1 + packages/core/src/services/layer/LayerService.ts | 1 + packages/core/src/services/layer/StyleAttributeService.ts | 1 + packages/core/src/services/renderer/passes/BaseNormalPass.ts | 1 + .../core/src/services/renderer/passes/BasePostProcessingPass.ts | 1 + packages/core/src/services/renderer/passes/ClearPass.ts | 1 + packages/core/src/services/renderer/passes/MultiPassRenderer.ts | 1 + packages/core/src/services/renderer/passes/PixelPickingPass.ts | 1 + packages/core/src/services/renderer/passes/PostProcessor.ts | 1 + packages/core/src/services/renderer/passes/RenderPass.ts | 1 + packages/core/src/services/renderer/passes/TAAPass.ts | 1 + .../src/services/renderer/passes/post-processing/BlurHPass.ts | 1 + .../renderer/passes/post-processing/ColorHalfTonePass.ts | 1 + .../src/services/renderer/passes/post-processing/CopyPass.ts | 1 + .../renderer/passes/post-processing/HexagonalPixelatePass.ts | 1 + .../src/services/renderer/passes/post-processing/InkPass.ts | 1 + .../src/services/renderer/passes/post-processing/NoisePass.ts | 1 + .../src/services/renderer/passes/post-processing/SepiaPass.ts | 1 + packages/core/src/services/scene/SceneService.ts | 1 + packages/core/src/services/shader/ShaderModuleService.ts | 1 + packages/layers/src/heatmap/models/heatmap.ts | 1 + packages/layers/src/plugins/DataMappingPlugin.ts | 1 + packages/layers/src/plugins/DataSourcePlugin.ts | 1 + packages/layers/src/plugins/FeatureScalePlugin.ts | 1 + packages/layers/src/plugins/LayerAnimateStylePlugin.ts | 1 + packages/layers/src/plugins/LayerModelPlugin.ts | 1 + packages/layers/src/plugins/LayerStylePlugin.ts | 1 + packages/layers/src/plugins/LightingPlugin.ts | 1 + packages/layers/src/plugins/MultiPassRendererPlugin.ts | 1 + packages/layers/src/plugins/PixelPickingPlugin.ts | 1 + packages/layers/src/plugins/RegisterStyleAttributePlugin.ts | 2 +- packages/layers/src/plugins/ShaderUniformPlugin.ts | 1 + packages/layers/src/plugins/UpdateModelPlugin.ts | 1 + packages/layers/src/plugins/UpdateStyleAttributePlugin.ts | 1 + packages/maps/package.json | 1 + packages/maps/src/amap/map.ts | 1 + packages/maps/src/amap2/map.ts | 1 + packages/maps/src/map/map.ts | 1 + packages/maps/src/mapbox/map.ts | 1 + packages/renderer/src/regl/index.ts | 1 + packages/source/package.json | 1 + packages/three/package.json | 1 + packages/three/src/core/threeRenderService.ts | 1 + 54 files changed, 53 insertions(+), 2 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index 7f785bdccc..86f7022ddb 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -30,6 +30,7 @@ "@babel/runtime": "^7.7.7", "eventemitter3": "^4.0.0", "inversify": "^5.0.1", + "reflect-metadata": "^0.1.13", "load-styles": "^2.0.0" }, "gitHead": "7eb8382ede52d803fae13a85fe6af074400260ee", diff --git a/packages/core/package.json b/packages/core/package.json index 5e40657264..19cf8e89c3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -35,7 +35,6 @@ "inversify": "^5.0.1", "inversify-inject-decorators": "^3.1.0", "lodash": "^4.17.15", - "merge-json-schemas": "^1.0.0", "probe.gl": "^3.1.1", "reflect-metadata": "^0.1.13", "viewport-mercator-project": "^6.2.1" diff --git a/packages/core/src/services/asset/FontService.ts b/packages/core/src/services/asset/FontService.ts index b1eb47ddab..6a71c22e19 100644 --- a/packages/core/src/services/asset/FontService.ts +++ b/packages/core/src/services/asset/FontService.ts @@ -2,6 +2,7 @@ import { LRUCache } from '@antv/l7-utils'; // @ts-ignore import TinySDF from '@mapbox/tiny-sdf'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { buildMapping } from '../../utils/font_util'; import { IFontAtlas, diff --git a/packages/core/src/services/asset/IconService.ts b/packages/core/src/services/asset/IconService.ts index 64af149627..8234898380 100644 --- a/packages/core/src/services/asset/IconService.ts +++ b/packages/core/src/services/asset/IconService.ts @@ -2,6 +2,7 @@ import TinySDF from '@mapbox/tiny-sdf'; import { EventEmitter } from 'eventemitter3'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { buildIconMaping } from '../../utils/font_util'; import { ITexture2D } from '../renderer/ITexture2D'; diff --git a/packages/core/src/services/camera/CameraService.ts b/packages/core/src/services/camera/CameraService.ts index 5ed1c415c3..f9d59d7315 100644 --- a/packages/core/src/services/camera/CameraService.ts +++ b/packages/core/src/services/camera/CameraService.ts @@ -1,5 +1,6 @@ import { mat4 } from 'gl-matrix'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { ICameraService, IViewport } from './ICameraService'; @injectable() diff --git a/packages/core/src/services/component/ControlService.ts b/packages/core/src/services/component/ControlService.ts index 9516ec8264..e83da65cc5 100644 --- a/packages/core/src/services/component/ControlService.ts +++ b/packages/core/src/services/component/ControlService.ts @@ -1,5 +1,6 @@ import { DOM } from '@antv/l7-utils'; import { Container, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { IMapService } from '../map/IMapService'; import { diff --git a/packages/core/src/services/component/MarkerService.ts b/packages/core/src/services/component/MarkerService.ts index c16ff85a15..c18190c9de 100644 --- a/packages/core/src/services/component/MarkerService.ts +++ b/packages/core/src/services/component/MarkerService.ts @@ -1,4 +1,5 @@ import { Container, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { IMapService } from '../map/IMapService'; import { diff --git a/packages/core/src/services/component/PopupService.ts b/packages/core/src/services/component/PopupService.ts index f5ceb32d85..47b8f4dd3f 100644 --- a/packages/core/src/services/component/PopupService.ts +++ b/packages/core/src/services/component/PopupService.ts @@ -1,4 +1,5 @@ import { Container, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { IMapService } from '../map/IMapService'; import { IPopup, IPopupService } from './IPopupService'; diff --git a/packages/core/src/services/config/ConfigService.ts b/packages/core/src/services/config/ConfigService.ts index e450237e5d..329b6f26ab 100644 --- a/packages/core/src/services/config/ConfigService.ts +++ b/packages/core/src/services/config/ConfigService.ts @@ -1,6 +1,7 @@ // import Ajv from 'ajv'; import { injectable, postConstruct } from 'inversify'; import { merge } from 'lodash'; +import 'reflect-metadata'; import { ILayerConfig } from '../layer/ILayerService'; import { IRenderConfig } from '../renderer/IRendererService'; import { IGlobalConfigService, ISceneConfig } from './IConfigService'; diff --git a/packages/core/src/services/coordinate/CoordinateSystemService.ts b/packages/core/src/services/coordinate/CoordinateSystemService.ts index cbd2f400b5..92d6e1f022 100644 --- a/packages/core/src/services/coordinate/CoordinateSystemService.ts +++ b/packages/core/src/services/coordinate/CoordinateSystemService.ts @@ -1,5 +1,6 @@ import { mat4, vec4 } from 'gl-matrix'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { getDistanceScales } from '../../utils/project'; import { ICameraService } from '../camera/ICameraService'; diff --git a/packages/core/src/services/interaction/InteractionService.ts b/packages/core/src/services/interaction/InteractionService.ts index f640d26f02..a047e197cc 100644 --- a/packages/core/src/services/interaction/InteractionService.ts +++ b/packages/core/src/services/interaction/InteractionService.ts @@ -1,6 +1,7 @@ import EventEmitter from 'eventemitter3'; import Hammer from 'hammerjs'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; // @ts-ignore import { TYPES } from '../../types'; import { ILogService } from '../log/ILogService'; diff --git a/packages/core/src/services/interaction/PickingService.ts b/packages/core/src/services/interaction/PickingService.ts index a539a1acfb..78eedc7bbe 100644 --- a/packages/core/src/services/interaction/PickingService.ts +++ b/packages/core/src/services/interaction/PickingService.ts @@ -1,5 +1,6 @@ import { decodePickingColor, DOM, encodePickingColor } from '@antv/l7-utils'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { IGlobalConfigService, ISceneConfig } from '../config/IConfigService'; import { diff --git a/packages/core/src/services/layer/LayerService.ts b/packages/core/src/services/layer/LayerService.ts index 3ddbc8467d..50da070003 100644 --- a/packages/core/src/services/layer/LayerService.ts +++ b/packages/core/src/services/layer/LayerService.ts @@ -1,4 +1,5 @@ import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { ILayer } from '../..'; import { TYPES } from '../../types'; import Clock from '../../utils/clock'; diff --git a/packages/core/src/services/layer/StyleAttributeService.ts b/packages/core/src/services/layer/StyleAttributeService.ts index b3faabd4bf..699036afd2 100644 --- a/packages/core/src/services/layer/StyleAttributeService.ts +++ b/packages/core/src/services/layer/StyleAttributeService.ts @@ -1,4 +1,5 @@ import { inject, injectable, optional } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { gl } from '../renderer/gl'; import { IAttribute } from '../renderer/IAttribute'; diff --git a/packages/core/src/services/renderer/passes/BaseNormalPass.ts b/packages/core/src/services/renderer/passes/BaseNormalPass.ts index 75c5a2ff38..ad7248236a 100644 --- a/packages/core/src/services/renderer/passes/BaseNormalPass.ts +++ b/packages/core/src/services/renderer/passes/BaseNormalPass.ts @@ -1,4 +1,5 @@ import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../../types'; import { ICameraService } from '../../camera/ICameraService'; import { IInteractionService } from '../../interaction/IInteractionService'; diff --git a/packages/core/src/services/renderer/passes/BasePostProcessingPass.ts b/packages/core/src/services/renderer/passes/BasePostProcessingPass.ts index 8c53976a1e..e896c42c09 100644 --- a/packages/core/src/services/renderer/passes/BasePostProcessingPass.ts +++ b/packages/core/src/services/renderer/passes/BasePostProcessingPass.ts @@ -1,5 +1,6 @@ import { inject, injectable } from 'inversify'; import { camelCase, isNil, upperFirst } from 'lodash'; +import 'reflect-metadata'; import { IShaderModuleService } from '../../shader/IShaderModuleService'; import { gl } from '../gl'; import { IModel } from '../IModel'; diff --git a/packages/core/src/services/renderer/passes/ClearPass.ts b/packages/core/src/services/renderer/passes/ClearPass.ts index d0207177a1..5d54170cdc 100644 --- a/packages/core/src/services/renderer/passes/ClearPass.ts +++ b/packages/core/src/services/renderer/passes/ClearPass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import { ILayer } from '../../layer/ILayerService'; import BaseNormalPass from './BaseNormalPass'; diff --git a/packages/core/src/services/renderer/passes/MultiPassRenderer.ts b/packages/core/src/services/renderer/passes/MultiPassRenderer.ts index 57f709dd19..ff461cba8e 100644 --- a/packages/core/src/services/renderer/passes/MultiPassRenderer.ts +++ b/packages/core/src/services/renderer/passes/MultiPassRenderer.ts @@ -1,4 +1,5 @@ import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../../types'; import { ILayer } from '../../layer/ILayerService'; import { diff --git a/packages/core/src/services/renderer/passes/PixelPickingPass.ts b/packages/core/src/services/renderer/passes/PixelPickingPass.ts index 17c2ca1876..a5f72e6c31 100644 --- a/packages/core/src/services/renderer/passes/PixelPickingPass.ts +++ b/packages/core/src/services/renderer/passes/PixelPickingPass.ts @@ -1,5 +1,6 @@ import { decodePickingColor, DOM, encodePickingColor } from '@antv/l7-utils'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../../types'; import { IInteractionTarget, diff --git a/packages/core/src/services/renderer/passes/PostProcessor.ts b/packages/core/src/services/renderer/passes/PostProcessor.ts index 9aa25691f7..bfb0e84827 100644 --- a/packages/core/src/services/renderer/passes/PostProcessor.ts +++ b/packages/core/src/services/renderer/passes/PostProcessor.ts @@ -1,4 +1,5 @@ import { inject, injectable, postConstruct } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../../types'; import { ILayer } from '../../layer/ILayerService'; import { gl } from '../gl'; diff --git a/packages/core/src/services/renderer/passes/RenderPass.ts b/packages/core/src/services/renderer/passes/RenderPass.ts index ccfadf4fac..50b88621ea 100644 --- a/packages/core/src/services/renderer/passes/RenderPass.ts +++ b/packages/core/src/services/renderer/passes/RenderPass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import { ILayer } from '../../layer/ILayerService'; import { PassType } from '../IMultiPassRenderer'; import BaseNormalPass from './BaseNormalPass'; diff --git a/packages/core/src/services/renderer/passes/TAAPass.ts b/packages/core/src/services/renderer/passes/TAAPass.ts index ddefc6ab64..f4c03668f5 100644 --- a/packages/core/src/services/renderer/passes/TAAPass.ts +++ b/packages/core/src/services/renderer/passes/TAAPass.ts @@ -1,4 +1,5 @@ import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import blendFS from '../../../shaders/post-processing/blend.glsl'; import copyFS from '../../../shaders/post-processing/copy.glsl'; import quadVS from '../../../shaders/post-processing/quad.glsl'; diff --git a/packages/core/src/services/renderer/passes/post-processing/BlurHPass.ts b/packages/core/src/services/renderer/passes/post-processing/BlurHPass.ts index c6cda26506..6787c815ed 100644 --- a/packages/core/src/services/renderer/passes/post-processing/BlurHPass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/BlurHPass.ts @@ -1,5 +1,6 @@ import { injectable } from 'inversify'; import { isNil } from 'lodash'; +import 'reflect-metadata'; import blur from '../../../../shaders/post-processing/blur.glsl'; import quad from '../../../../shaders/post-processing/quad.glsl'; import { IUniform } from '../../IUniform'; diff --git a/packages/core/src/services/renderer/passes/post-processing/ColorHalfTonePass.ts b/packages/core/src/services/renderer/passes/post-processing/ColorHalfTonePass.ts index eacbcfabdc..00fe6dac2b 100644 --- a/packages/core/src/services/renderer/passes/post-processing/ColorHalfTonePass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/ColorHalfTonePass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import colorHalftone from '../../../../shaders/post-processing/colorhalftone.glsl'; import quad from '../../../../shaders/post-processing/quad.glsl'; import BasePostProcessingPass from '../BasePostProcessingPass'; diff --git a/packages/core/src/services/renderer/passes/post-processing/CopyPass.ts b/packages/core/src/services/renderer/passes/post-processing/CopyPass.ts index 70af63cd8e..f10f29aa42 100644 --- a/packages/core/src/services/renderer/passes/post-processing/CopyPass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/CopyPass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import copy from '../../../../shaders/post-processing/copy.glsl'; import quad from '../../../../shaders/post-processing/quad.glsl'; import BasePostProcessingPass from '../BasePostProcessingPass'; diff --git a/packages/core/src/services/renderer/passes/post-processing/HexagonalPixelatePass.ts b/packages/core/src/services/renderer/passes/post-processing/HexagonalPixelatePass.ts index 2ce8379d4a..3c9aa395b3 100644 --- a/packages/core/src/services/renderer/passes/post-processing/HexagonalPixelatePass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/HexagonalPixelatePass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import hexagonalPixelate from '../../../../shaders/post-processing/hexagonalpixelate.glsl'; import quad from '../../../../shaders/post-processing/quad.glsl'; import BasePostProcessingPass from '../BasePostProcessingPass'; diff --git a/packages/core/src/services/renderer/passes/post-processing/InkPass.ts b/packages/core/src/services/renderer/passes/post-processing/InkPass.ts index 106c493b78..8a82f723b9 100644 --- a/packages/core/src/services/renderer/passes/post-processing/InkPass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/InkPass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import ink from '../../../../shaders/post-processing/ink.glsl'; import quad from '../../../../shaders/post-processing/quad.glsl'; import BasePostProcessingPass from '../BasePostProcessingPass'; diff --git a/packages/core/src/services/renderer/passes/post-processing/NoisePass.ts b/packages/core/src/services/renderer/passes/post-processing/NoisePass.ts index f3aec39d40..d20064f2c3 100644 --- a/packages/core/src/services/renderer/passes/post-processing/NoisePass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/NoisePass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import noise from '../../../../shaders/post-processing/noise.glsl'; import quad from '../../../../shaders/post-processing/quad.glsl'; import BasePostProcessingPass from '../BasePostProcessingPass'; diff --git a/packages/core/src/services/renderer/passes/post-processing/SepiaPass.ts b/packages/core/src/services/renderer/passes/post-processing/SepiaPass.ts index f74ed4390b..e4a54c4b9b 100644 --- a/packages/core/src/services/renderer/passes/post-processing/SepiaPass.ts +++ b/packages/core/src/services/renderer/passes/post-processing/SepiaPass.ts @@ -1,4 +1,5 @@ import { injectable } from 'inversify'; +import 'reflect-metadata'; import quad from '../../../../shaders/post-processing/quad.glsl'; import sepia from '../../../../shaders/post-processing/sepia.glsl'; import BasePostProcessingPass from '../BasePostProcessingPass'; diff --git a/packages/core/src/services/scene/SceneService.ts b/packages/core/src/services/scene/SceneService.ts index 9eb497f2bb..1650898d40 100644 --- a/packages/core/src/services/scene/SceneService.ts +++ b/packages/core/src/services/scene/SceneService.ts @@ -4,6 +4,7 @@ import { DOM } from '@antv/l7-utils'; import elementResizeEvent, { unbind } from 'element-resize-event'; import { EventEmitter } from 'eventemitter3'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { TYPES } from '../../types'; import { createRendererContainer } from '../../utils/dom'; import { IFontService } from '../asset/IFontService'; diff --git a/packages/core/src/services/shader/ShaderModuleService.ts b/packages/core/src/services/shader/ShaderModuleService.ts index 4f6ab17d3d..a89022f4da 100644 --- a/packages/core/src/services/shader/ShaderModuleService.ts +++ b/packages/core/src/services/shader/ShaderModuleService.ts @@ -1,5 +1,6 @@ import { inject, injectable } from 'inversify'; import { uniq } from 'lodash'; +import 'reflect-metadata'; import { extractUniforms } from '../../utils/shader-module'; import { IModuleParams, IShaderModuleService } from './IShaderModuleService'; diff --git a/packages/layers/src/heatmap/models/heatmap.ts b/packages/layers/src/heatmap/models/heatmap.ts index e456b9428b..3c77e048fb 100644 --- a/packages/layers/src/heatmap/models/heatmap.ts +++ b/packages/layers/src/heatmap/models/heatmap.ts @@ -10,6 +10,7 @@ import { import { generateColorRamp, IColorRamp } from '@antv/l7-utils'; import { mat4 } from 'gl-matrix'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import BaseModel from '../../core/BaseModel'; import { HeatmapTriangulation } from '../../core/triangulation'; import heatmap3DFrag from '../shaders/heatmap_3d_frag.glsl'; diff --git a/packages/layers/src/plugins/DataMappingPlugin.ts b/packages/layers/src/plugins/DataMappingPlugin.ts index b247a1b47a..67a467168c 100644 --- a/packages/layers/src/plugins/DataMappingPlugin.ts +++ b/packages/layers/src/plugins/DataMappingPlugin.ts @@ -15,6 +15,7 @@ import { import { rgb2arr, unProjectFlat } from '@antv/l7-utils'; import { inject, injectable } from 'inversify'; import { cloneDeep } from 'lodash'; +import 'reflect-metadata'; @injectable() export default class DataMappingPlugin implements ILayerPlugin { diff --git a/packages/layers/src/plugins/DataSourcePlugin.ts b/packages/layers/src/plugins/DataSourcePlugin.ts index 660de81c89..8f8fed81bd 100644 --- a/packages/layers/src/plugins/DataSourcePlugin.ts +++ b/packages/layers/src/plugins/DataSourcePlugin.ts @@ -8,6 +8,7 @@ import { import Source from '@antv/l7-source'; import { injectable } from 'inversify'; import { cloneDeep } from 'lodash'; +import 'reflect-metadata'; @injectable() export default class DataSourcePlugin implements ILayerPlugin { diff --git a/packages/layers/src/plugins/FeatureScalePlugin.ts b/packages/layers/src/plugins/FeatureScalePlugin.ts index a39667f8e7..451a44eeb1 100644 --- a/packages/layers/src/plugins/FeatureScalePlugin.ts +++ b/packages/layers/src/plugins/FeatureScalePlugin.ts @@ -18,6 +18,7 @@ import { extent, ticks } from 'd3-array'; import * as d3 from 'd3-scale'; import { inject, injectable } from 'inversify'; import { isNil, isString, uniq } from 'lodash'; +import 'reflect-metadata'; const dateRegex = /^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/; diff --git a/packages/layers/src/plugins/LayerAnimateStylePlugin.ts b/packages/layers/src/plugins/LayerAnimateStylePlugin.ts index b5f67d2564..1448fc8ff4 100644 --- a/packages/layers/src/plugins/LayerAnimateStylePlugin.ts +++ b/packages/layers/src/plugins/LayerAnimateStylePlugin.ts @@ -10,6 +10,7 @@ import { TYPES, } from '@antv/l7-core'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; @injectable() export default class LayerAnimateStylePlugin implements ILayerPlugin { diff --git a/packages/layers/src/plugins/LayerModelPlugin.ts b/packages/layers/src/plugins/LayerModelPlugin.ts index d2a5606ead..acb6624cfa 100644 --- a/packages/layers/src/plugins/LayerModelPlugin.ts +++ b/packages/layers/src/plugins/LayerModelPlugin.ts @@ -1,5 +1,6 @@ import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core'; import { injectable } from 'inversify'; +import 'reflect-metadata'; /** * Layer Model 初始化,更新,销毁 */ diff --git a/packages/layers/src/plugins/LayerStylePlugin.ts b/packages/layers/src/plugins/LayerStylePlugin.ts index 140cfb41f0..56395c1ebd 100644 --- a/packages/layers/src/plugins/LayerStylePlugin.ts +++ b/packages/layers/src/plugins/LayerStylePlugin.ts @@ -2,6 +2,7 @@ import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core'; import Source from '@antv/l7-source'; import { encodePickingColor, rgb2arr } from '@antv/l7-utils'; import { injectable } from 'inversify'; +import 'reflect-metadata'; /** * 更新图层样式,初始图层相关配置 */ diff --git a/packages/layers/src/plugins/LightingPlugin.ts b/packages/layers/src/plugins/LightingPlugin.ts index af2aa233ef..469081cfbb 100644 --- a/packages/layers/src/plugins/LightingPlugin.ts +++ b/packages/layers/src/plugins/LightingPlugin.ts @@ -9,6 +9,7 @@ import { TYPES, } from '@antv/l7-core'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; const lightTypeUniformMap = { directional: { diff --git a/packages/layers/src/plugins/MultiPassRendererPlugin.ts b/packages/layers/src/plugins/MultiPassRendererPlugin.ts index 333bc8b712..9e51e3b741 100644 --- a/packages/layers/src/plugins/MultiPassRendererPlugin.ts +++ b/packages/layers/src/plugins/MultiPassRendererPlugin.ts @@ -8,6 +8,7 @@ import { TYPES, } from '@antv/l7-core'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; /** * 'blurH' -> ['blurH', {}] diff --git a/packages/layers/src/plugins/PixelPickingPlugin.ts b/packages/layers/src/plugins/PixelPickingPlugin.ts index 31b73ccaee..a0562e3ffc 100644 --- a/packages/layers/src/plugins/PixelPickingPlugin.ts +++ b/packages/layers/src/plugins/PixelPickingPlugin.ts @@ -13,6 +13,7 @@ import { rgb2arr, } from '@antv/l7-utils'; import { injectable } from 'inversify'; +import 'reflect-metadata'; const PickingStage = { NONE: 0.0, diff --git a/packages/layers/src/plugins/RegisterStyleAttributePlugin.ts b/packages/layers/src/plugins/RegisterStyleAttributePlugin.ts index 9fdcdbf66a..1eed5727b1 100644 --- a/packages/layers/src/plugins/RegisterStyleAttributePlugin.ts +++ b/packages/layers/src/plugins/RegisterStyleAttributePlugin.ts @@ -9,7 +9,7 @@ import { TYPES, } from '@antv/l7-core'; import { inject, injectable } from 'inversify'; -import { isNumber } from 'lodash'; +import 'reflect-metadata'; /** * 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建 diff --git a/packages/layers/src/plugins/ShaderUniformPlugin.ts b/packages/layers/src/plugins/ShaderUniformPlugin.ts index e7f4e48685..e23511fe4d 100644 --- a/packages/layers/src/plugins/ShaderUniformPlugin.ts +++ b/packages/layers/src/plugins/ShaderUniformPlugin.ts @@ -11,6 +11,7 @@ import { } from '@antv/l7-core'; import { DOM } from '@antv/l7-utils'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; /** * 在渲染之前需要获取当前 Shader 所需 Uniform,例如: diff --git a/packages/layers/src/plugins/UpdateModelPlugin.ts b/packages/layers/src/plugins/UpdateModelPlugin.ts index 0c9f640dc9..eb4a75a77e 100644 --- a/packages/layers/src/plugins/UpdateModelPlugin.ts +++ b/packages/layers/src/plugins/UpdateModelPlugin.ts @@ -1,5 +1,6 @@ import { ILayer, ILayerPlugin, IMapService, TYPES } from '@antv/l7-core'; import { injectable } from 'inversify'; +import 'reflect-metadata'; /** * Model 更新 */ diff --git a/packages/layers/src/plugins/UpdateStyleAttributePlugin.ts b/packages/layers/src/plugins/UpdateStyleAttributePlugin.ts index 9ec4f14e96..16c55a6c44 100644 --- a/packages/layers/src/plugins/UpdateStyleAttributePlugin.ts +++ b/packages/layers/src/plugins/UpdateStyleAttributePlugin.ts @@ -6,6 +6,7 @@ import { TYPES, } from '@antv/l7-core'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; /** * 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建 diff --git a/packages/maps/package.json b/packages/maps/package.json index 9355d5e5e3..e38ed329ba 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -35,6 +35,7 @@ "@types/mapbox-gl": "^1.11.2", "gl-matrix": "^3.1.0", "inversify": "^5.0.1", + "reflect-metadata": "^0.1.13", "load-styles": "^2.0.0", "mapbox-gl": "^1.2.1", "viewport-mercator-project": "^6.2.1" diff --git a/packages/maps/src/amap/map.ts b/packages/maps/src/amap/map.ts index d3a90ff1da..336f0c2a38 100644 --- a/packages/maps/src/amap/map.ts +++ b/packages/maps/src/amap/map.ts @@ -23,6 +23,7 @@ import { import { DOM } from '@antv/l7-utils'; import { mat4, vec2, vec3 } from 'gl-matrix'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { IAMapEvent, IAMapInstance } from '../../typings/index'; import { toPaddingOptions } from '../utils'; import { Version } from '../version'; diff --git a/packages/maps/src/amap2/map.ts b/packages/maps/src/amap2/map.ts index c760f32f43..308d276531 100644 --- a/packages/maps/src/amap2/map.ts +++ b/packages/maps/src/amap2/map.ts @@ -24,6 +24,7 @@ import { import { DOM } from '@antv/l7-utils'; import { mat4, vec2, vec3 } from 'gl-matrix'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { IAMapEvent, IAMapInstance } from '../../typings/index'; import { toPaddingOptions } from '../utils'; import { Version } from '../version'; diff --git a/packages/maps/src/map/map.ts b/packages/maps/src/map/map.ts index e8160a556c..22293ed750 100644 --- a/packages/maps/src/map/map.ts +++ b/packages/maps/src/map/map.ts @@ -22,6 +22,7 @@ import { Map } from '@antv/l7-map'; import { DOM } from '@antv/l7-utils'; import { mat4, vec2, vec3 } from 'gl-matrix'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { Version } from '../version'; import Viewport from './Viewport'; const EventMap: { diff --git a/packages/maps/src/mapbox/map.ts b/packages/maps/src/mapbox/map.ts index c2801b6a26..95195ac1fe 100644 --- a/packages/maps/src/mapbox/map.ts +++ b/packages/maps/src/mapbox/map.ts @@ -24,6 +24,7 @@ import { inject, injectable } from 'inversify'; import mapboxgl, { IControl, Map } from 'mapbox-gl'; // tslint:disable-next-line:no-submodule-imports import 'mapbox-gl/dist/mapbox-gl.css'; +import 'reflect-metadata'; import { IMapboxInstance } from '../../typings/index'; import { Version } from '../version'; import Viewport from './Viewport'; diff --git a/packages/renderer/src/regl/index.ts b/packages/renderer/src/regl/index.ts index b550c3c5ee..d94ece9cf9 100644 --- a/packages/renderer/src/regl/index.ts +++ b/packages/renderer/src/regl/index.ts @@ -22,6 +22,7 @@ import { ITexture2DInitializationOptions, } from '@antv/l7-core'; import { injectable } from 'inversify'; +import 'reflect-metadata'; import regl from 'regl'; import ReglAttribute from './ReglAttribute'; import ReglBuffer from './ReglBuffer'; diff --git a/packages/source/package.json b/packages/source/package.json index 431fa28da5..826cd9bb38 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -37,6 +37,7 @@ "d3-hexbin": "^0.2.2", "eventemitter3": "^4.0.0", "inversify": "^5.0.1", + "reflect-metadata": "^0.1.13", "lodash": "^4.17.15", "supercluster": "^7.0.0" }, diff --git a/packages/three/package.json b/packages/three/package.json index 9c3314d8f4..1f3deedacf 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -48,6 +48,7 @@ "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "rollup": "^2.3.3", + "reflect-metadata": "^0.1.13", "rollup-plugin-less": "^1.1.2" }, "devDependencies": { diff --git a/packages/three/src/core/threeRenderService.ts b/packages/three/src/core/threeRenderService.ts index 688060163e..283dece4a1 100644 --- a/packages/three/src/core/threeRenderService.ts +++ b/packages/three/src/core/threeRenderService.ts @@ -1,5 +1,6 @@ import { IMapService, IMercator, IRendererService, TYPES } from '@antv/l7'; import { inject, injectable } from 'inversify'; +import 'reflect-metadata'; import { AnimationMixer,