From 39eb39008dd3bd2ebd0d502d52ac233eca0d5052 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Thu, 21 May 2020 23:36:06 +0300 Subject: [PATCH] Rename platform/platform to index removing default (#7391) Rename platform/platform to index removing default --- src/core/core.controller.js | 2 +- src/index.js | 2 +- src/platform/index.js | 3 +++ src/platform/platforms.js | 11 ----------- test/specs/global.namespace.tests.js | 6 +++++- test/specs/platform.dom.tests.js | 2 +- 6 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 src/platform/index.js delete mode 100644 src/platform/platforms.js diff --git a/src/core/core.controller.js b/src/core/core.controller.js index cdc82748a..af83b327f 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -4,7 +4,7 @@ import defaults from './core.defaults'; import helpers from '../helpers/index'; import Interaction from './core.interaction'; import layouts from './core.layouts'; -import {BasicPlatform, DomPlatform} from '../platform/platforms'; +import {BasicPlatform, DomPlatform} from '../platform'; import plugins from './core.plugins'; import scaleService from './core.scaleService'; import {getMaximumWidth, getMaximumHeight} from '../helpers/helpers.dom'; diff --git a/src/index.js b/src/index.js index 5be7ae14a..6dcc113c6 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ import Element from './core/core.element'; import * as elements from './elements/index'; import Interaction from './core/core.interaction'; import layouts from './core/core.layouts'; -import platforms from './platform/platforms'; +import * as platforms from './platform'; import pluginsCore from './core/core.plugins'; import Scale from './core/core.scale'; import scaleService from './core/core.scaleService'; diff --git a/src/platform/index.js b/src/platform/index.js new file mode 100644 index 000000000..4d4136353 --- /dev/null +++ b/src/platform/index.js @@ -0,0 +1,3 @@ +export {default as BasePlatform} from './platform.base'; +export {default as BasicPlatform} from './platform.basic'; +export {default as DomPlatform} from './platform.dom'; diff --git a/src/platform/platforms.js b/src/platform/platforms.js deleted file mode 100644 index 8977ed452..000000000 --- a/src/platform/platforms.js +++ /dev/null @@ -1,11 +0,0 @@ -import BasePlatform from './platform.base'; -import BasicPlatform from './platform.basic'; -import DomPlatform from './platform.dom'; - -export {BasicPlatform, DomPlatform, BasePlatform}; - -/** - * @namespace Chart.platforms - * @see https://chartjs.gitbooks.io/proposals/content/Platform.html -*/ -export default {BasicPlatform, DomPlatform, BasePlatform}; diff --git a/test/specs/global.namespace.tests.js b/test/specs/global.namespace.tests.js index 36f113a5f..cb4675fc6 100644 --- a/test/specs/global.namespace.tests.js +++ b/test/specs/global.namespace.tests.js @@ -12,7 +12,11 @@ describe('Chart namespace', function() { expect(Chart.Interaction instanceof Object).toBeTruthy(); expect(Chart.layouts instanceof Object).toBeTruthy(); expect(Chart.plugins instanceof Object).toBeTruthy(); - expect(Chart.platforms instanceof Object).toBeTruthy(); + + expect(Chart.platforms.BasePlatform instanceof Function).toBeTruthy(); + expect(Chart.platforms.BasicPlatform instanceof Function).toBeTruthy(); + expect(Chart.platforms.DomPlatform instanceof Function).toBeTruthy(); + expect(Chart.Scale instanceof Object).toBeTruthy(); expect(Chart.scaleService instanceof Object).toBeTruthy(); expect(Chart.Ticks instanceof Object).toBeTruthy(); diff --git a/test/specs/platform.dom.tests.js b/test/specs/platform.dom.tests.js index 263b03168..9b97fa2be 100644 --- a/test/specs/platform.dom.tests.js +++ b/test/specs/platform.dom.tests.js @@ -1,4 +1,4 @@ -import {DomPlatform} from '../../src/platform/platforms'; +import {DomPlatform} from '../../src/platform'; describe('Platform.dom', function() { -- 2.47.2