From 679d6f16872686c98e7a9967329b0310e1cb3fd1 Mon Sep 17 00:00:00 2001 From: Sid Kapur Date: Sat, 25 Dec 2021 09:27:36 -0600 Subject: [PATCH] feat: support isolatedModules (#7870) --- src/compositemark/index.ts | 6 +++--- src/spec/base.ts | 2 +- src/spec/index.ts | 22 ++++++++++++++-------- test/jest.overrides.ts | 2 ++ tsconfig.build.json | 3 ++- tsconfig.json | 1 + 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/compositemark/index.ts b/src/compositemark/index.ts index 29ae3539ae3..d2c320d136d 100644 --- a/src/compositemark/index.ts +++ b/src/compositemark/index.ts @@ -25,9 +25,9 @@ import { normalizeErrorBar } from './errorbar'; -export {BoxPlotConfig} from './boxplot'; -export {ErrorBandConfigMixins} from './errorband'; -export {ErrorBarConfigMixins} from './errorbar'; +export type {BoxPlotConfig} from './boxplot'; +export type {ErrorBandConfigMixins} from './errorband'; +export type {ErrorBarConfigMixins} from './errorbar'; export type CompositeMarkNormalizerRun = ( spec: GenericUnitSpec, diff --git a/src/spec/base.ts b/src/spec/base.ts index f6133b0033e..3e35b1e9a86 100644 --- a/src/spec/base.ts +++ b/src/spec/base.ts @@ -12,7 +12,7 @@ import {LayoutAlign, RowCol} from '../vega.schema'; import {isConcatSpec, isVConcatSpec} from './concat'; import {isFacetMapping, isFacetSpec} from './facet'; -export {TopLevel} from './toplevel'; +export type {TopLevel} from './toplevel'; /** * Common properties for all types of specification diff --git a/src/spec/index.ts b/src/spec/index.ts index 02ceb997005..769e658a5fb 100644 --- a/src/spec/index.ts +++ b/src/spec/index.ts @@ -14,20 +14,26 @@ import {RepeatSpec} from './repeat'; import {TopLevel} from './toplevel'; import {FacetedUnitSpec, GenericUnitSpec, NormalizedUnitSpec, TopLevelUnitSpec, UnitSpecWithFrame} from './unit'; -export {BaseSpec, LayoutSizeMixins} from './base'; -export { +export type {BaseSpec, LayoutSizeMixins} from './base'; +export type { GenericHConcatSpec, GenericVConcatSpec, + NormalizedConcatSpec +} from './concat'; +export { isAnyConcatSpec, isHConcatSpec, isVConcatSpec, - NormalizedConcatSpec } from './concat'; -export {GenericFacetSpec, isFacetSpec, NormalizedFacetSpec} from './facet'; -export {GenericLayerSpec, isLayerSpec, LayerSpec, NormalizedLayerSpec} from './layer'; -export {isRepeatSpec, RepeatSpec} from './repeat'; -export {TopLevel} from './toplevel'; -export {FacetedUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec, UnitSpec} from './unit'; +export type {GenericFacetSpec, NormalizedFacetSpec} from './facet'; +export {isFacetSpec} from './facet'; +export type {GenericLayerSpec, LayerSpec, NormalizedLayerSpec} from './layer'; +export {isLayerSpec} from './layer'; +export type {RepeatSpec} from './repeat'; +export {isRepeatSpec} from './repeat'; +export type {TopLevel} from './toplevel'; +export type {FacetedUnitSpec, GenericUnitSpec, NormalizedUnitSpec, UnitSpec} from './unit'; +export {isUnitSpec} from './unit'; /** * Any specification in Vega-Lite. diff --git a/test/jest.overrides.ts b/test/jest.overrides.ts index 6538d89002d..48d98a4b2a2 100644 --- a/test/jest.overrides.ts +++ b/test/jest.overrides.ts @@ -11,3 +11,5 @@ console.warn = function (msg: string, msg2: string) { warn.apply(console, arguments); throw new Error(`${msg}: ${msg2} -- Please remove unnecessary errors or use log.wrap to consume reasonable errors`); }; + +export {}; diff --git a/tsconfig.build.json b/tsconfig.build.json index d54a04de65e..7b536e2cdb4 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,7 +5,8 @@ "noEmit": false, "declaration": true, "declarationMap": true, - "sourceMap": true + "sourceMap": true, + "isolatedModules": true }, "include": [] } diff --git a/tsconfig.json b/tsconfig.json index 187344eb4b4..f3de65a0c1a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,6 +14,7 @@ "preserveConstEnums": true, "resolveJsonModule": true, "suppressImplicitAnyIndexErrors": true, + "isolatedModules": true, "lib": ["ESNext.Array", "DOM", "DOM.Iterable"], "noEmit": true },