From 2791013e89dd7f65a9e3c7af4c69fae881768db8 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Fri, 20 Mar 2020 19:06:19 +0100 Subject: [PATCH] Set the compiled file in dist as the main file This lets people just import @mapbox/mapbox-gl-draw instead of having to import @mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js. It's standard practise to set the compiled file in main, and most other packages including mapbox-gl does so. --- package.json | 2 +- test/api.test.js | 2 +- test/direct_select.test.js | 2 +- test/draw_line_string.test.js | 2 +- test/draw_point.test.js | 2 +- test/draw_polygon.test.js | 2 +- test/interaction_events.test.js | 2 +- test/line_string.test.js | 2 +- test/options.test.js | 2 +- test/point.test.js | 2 +- test/polygon.test.js | 2 +- test/simple_select.test.js | 2 +- test/static.test.js | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index da52b084c..f5d1aa84f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "homepage": "https://github.com/mapbox/mapbox-gl-draw", "author": "mapbox", "license": "ISC", - "main": "index.js", + "main": "dist/mapbox-gl-draw.js", "style": "dist/mapbox-gl-draw.css", "browserify": { "transform": [ diff --git a/test/api.test.js b/test/api.test.js index a67732f37..db0f3101d 100644 --- a/test/api.test.js +++ b/test/api.test.js @@ -2,7 +2,7 @@ import test from 'tape'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy import * as Constants from '../src/constants'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import createMap from './utils/create_map'; import getGeoJSON from './utils/get_geojson'; import setupAfterNextRender from './utils/after_next_render'; diff --git a/test/direct_select.test.js b/test/direct_select.test.js index 3758bc1e1..985bf6d47 100644 --- a/test/direct_select.test.js +++ b/test/direct_select.test.js @@ -1,7 +1,7 @@ /* eslint no-shadow:[0] */ import turfCentroid from '@turf/centroid'; import test from 'tape'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import click from './utils/mouse_click'; import tap from './utils/touch_tap'; import getGeoJSON from './utils/get_geojson'; diff --git a/test/draw_line_string.test.js b/test/draw_line_string.test.js index 5c9be8d76..4325bbd82 100644 --- a/test/draw_line_string.test.js +++ b/test/draw_line_string.test.js @@ -1,6 +1,6 @@ import test from 'tape'; import xtend from 'xtend'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import mouseClick from './utils/mouse_click'; import touchTap from './utils/touch_tap'; import createMap from './utils/create_map'; diff --git a/test/draw_point.test.js b/test/draw_point.test.js index 946d88258..d0e329f21 100644 --- a/test/draw_point.test.js +++ b/test/draw_point.test.js @@ -1,6 +1,6 @@ import test from 'tape'; import xtend from 'xtend'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import mouseClick from './utils/mouse_click'; import touchTap from './utils/touch_tap'; import createMap from './utils/create_map'; diff --git a/test/draw_polygon.test.js b/test/draw_polygon.test.js index 792e96dba..e056de034 100644 --- a/test/draw_polygon.test.js +++ b/test/draw_polygon.test.js @@ -1,6 +1,6 @@ import test from 'tape'; import xtend from 'xtend'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import createMap from './utils/create_map'; import mouseClick from './utils/mouse_click'; import touchTap from './utils/touch_tap'; diff --git a/test/interaction_events.test.js b/test/interaction_events.test.js index d44857c94..afd50217a 100644 --- a/test/interaction_events.test.js +++ b/test/interaction_events.test.js @@ -3,7 +3,7 @@ import test from 'tape'; import xtend from 'xtend'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import click from './utils/mouse_click'; import createMap from './utils/create_map'; import createAfterNextRender from './utils/after_next_render'; diff --git a/test/line_string.test.js b/test/line_string.test.js index 4fa25e62e..1ca8ce4e7 100644 --- a/test/line_string.test.js +++ b/test/line_string.test.js @@ -2,7 +2,7 @@ import test from 'tape'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy import Feature from '../src/feature_types/feature'; import LineString from '../src/feature_types/line_string'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import createFeature from './utils/create_feature'; import getPublicMemberKeys from './utils/get_public_member_keys'; import createMockCtx from './utils/create_mock_feature_context'; diff --git a/test/options.test.js b/test/options.test.js index c4669eb67..42e94fcaa 100644 --- a/test/options.test.js +++ b/test/options.test.js @@ -1,6 +1,6 @@ /* eslint no-shadow:[0] */ import test from 'tape'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import modes from '../src/modes/index'; import styleWithSourcesFixture from './fixtures/style_with_sources.json'; diff --git a/test/point.test.js b/test/point.test.js index 77b953c97..294000baa 100644 --- a/test/point.test.js +++ b/test/point.test.js @@ -2,7 +2,7 @@ import test from 'tape'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy import Feature from '../src/feature_types/feature'; import Point from '../src/feature_types/point'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import createFeature from './utils/create_feature'; import getPublicMemberKeys from './utils/get_public_member_keys'; import createMockCtx from './utils/create_mock_feature_context'; diff --git a/test/polygon.test.js b/test/polygon.test.js index 98b82bb39..b915a25a0 100644 --- a/test/polygon.test.js +++ b/test/polygon.test.js @@ -2,7 +2,7 @@ import test from 'tape'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy import Feature from '../src/feature_types/feature'; import Polygon from '../src/feature_types/polygon'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import createFeature from './utils/create_feature'; import getPublicMemberKeys from './utils/get_public_member_keys'; import createMockCtx from './utils/create_mock_feature_context'; diff --git a/test/simple_select.test.js b/test/simple_select.test.js index 3be4a0da0..2797f47c0 100644 --- a/test/simple_select.test.js +++ b/test/simple_select.test.js @@ -1,6 +1,6 @@ /* eslint no-shadow:[0] */ import test from 'tape'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy import setupAfterNextRender from './utils/after_next_render'; import makeMouseEvent from './utils/make_mouse_event'; diff --git a/test/static.test.js b/test/static.test.js index be7e6f775..b74002b6c 100644 --- a/test/static.test.js +++ b/test/static.test.js @@ -1,6 +1,6 @@ /* eslint no-shadow:[0] */ import test from 'tape'; -import MapboxDraw from '../'; +import MapboxDraw from '../index'; import spy from 'sinon/lib/sinon/spy'; // avoid babel-register-related error by importing only spy import setupAfterNextRender from './utils/after_next_render'; import makeMouseEvent from './utils/make_mouse_event';