From abf1952b46efb970477b1101fce39a05c9c41156 Mon Sep 17 00:00:00 2001 From: odan Date: Thu, 29 Aug 2024 00:55:07 +0900 Subject: [PATCH 1/3] add ext for lodash --- packages/annotations/src/AnnotationNote.tsx | 2 +- packages/annotations/src/compute.ts | 6 +++--- packages/bar/src/compute/legends.ts | 2 +- packages/boxplot/src/compute/legends.ts | 4 ++-- packages/calendar/src/compute/calendar.ts | 6 +++--- packages/calendar/src/compute/timeRange.ts | 2 +- packages/circle-packing/src/hooks.ts | 4 ++-- packages/colors/src/inheritedColor.ts | 4 ++-- packages/colors/src/scales/ordinalColorScale.ts | 4 ++-- packages/core/src/lib/colors/index.js | 6 +++--- packages/core/src/lib/colors/quantize.js | 6 +++--- packages/core/src/lib/defs.js | 12 ++++++------ packages/core/src/lib/propertiesConverters.js | 4 ++-- packages/core/src/motion/context.js | 2 +- packages/core/src/props/curve.js | 2 +- packages/core/src/theming/extend.js | 6 +++--- packages/core/tests/lib/defs.test.js | 2 +- packages/express/src/index.ts | 2 +- packages/express/src/validation.ts | 2 +- packages/generators/src/bullet.ts | 4 ++-- packages/generators/src/chord.ts | 4 ++-- packages/generators/src/index.ts | 6 +++--- packages/generators/src/network.ts | 2 +- packages/generators/src/parallelCoordinates.ts | 2 +- packages/generators/src/sankey.ts | 6 +++--- packages/generators/src/swarmplot.ts | 6 +++--- packages/geo/src/hooks.js | 4 ++-- packages/line/src/hooks.js | 2 +- packages/line/tests/Line.test.js | 2 +- packages/marimekko/src/hooks.ts | 2 +- packages/sankey/src/Sankey.tsx | 2 +- packages/sankey/src/hooks.ts | 2 +- packages/scales/src/compute.ts | 10 +++++----- packages/scatterplot/src/compute.ts | 8 ++++---- packages/static/src/renderer.ts | 2 +- packages/sunburst/src/hooks.ts | 4 ++-- packages/swarmplot/src/SwarmPlotCanvas.tsx | 2 +- packages/swarmplot/src/compute.ts | 8 ++++---- packages/treemap/src/hooks.ts | 6 +++--- storybook/stories/bump/AreaBump.stories.tsx | 4 ++-- storybook/stories/bump/Bump.stories.tsx | 4 ++-- storybook/stories/line/Line.stories.tsx | 4 ++-- .../stories/scatterplot/ScatterPlot.stories.tsx | 2 +- .../scatterplot/ScatterPlotCanvas.stories.tsx | 2 +- storybook/stories/stream/Stream.stories.tsx | 4 ++-- website/src/components/controls/ControlsGroup.tsx | 4 ++-- .../controls/colors/InheritedColorControl.tsx | 4 ++-- .../components/controls/colors/colorSchemeSelect.tsx | 2 +- .../components/controls/generics/RangeControl.tsx | 2 +- .../controls/generics/SwitchableRangeControl.tsx | 2 +- .../controls/specialized/AnnotationsControl.tsx | 2 +- website/src/components/controls/ui/Control.tsx | 2 +- .../src/components/controls/ui/PropertyHeader.tsx | 12 ++++++------ .../src/components/guides/legends/LegendPosition.tsx | 2 +- website/src/components/home/HomeAreaBumpDemo.tsx | 4 ++-- website/src/components/home/HomeBumpDemo.tsx | 4 ++-- website/src/components/home/HomeMarimekkoDemo.tsx | 2 +- website/src/components/home/HomeStreamDemo.tsx | 4 ++-- website/src/components/home/HomeVoronoiDemo.tsx | 2 +- website/src/components/icons/CalendarIcon.tsx | 2 +- website/src/data/components/line/generator.ts | 2 +- website/src/data/components/radial-bar/mapper.ts | 2 +- website/src/data/components/scatterplot/generator.ts | 4 ++-- website/src/data/components/stream/generator.ts | 4 ++-- website/src/data/components/treemap/generator.ts | 4 ++-- website/src/lib/chart-properties/axes.ts | 2 +- website/src/lib/componentProperties.ts | 2 +- website/src/lib/generateChartCode.ts | 12 ++++++------ website/src/lib/settings.ts | 4 ++-- website/src/pages/area-bump/index.tsx | 4 ++-- website/src/pages/bullet/index.js | 2 +- website/src/pages/bump/index.tsx | 4 ++-- website/src/pages/choropleth/index.tsx | 2 +- website/src/pages/circle-packing/canvas.js | 4 ++-- website/src/pages/funnel/index.tsx | 4 ++-- website/src/pages/geomap/canvas.js | 2 +- website/src/pages/geomap/index.js | 2 +- website/src/pages/line/api.tsx | 2 +- website/src/pages/line/canvas.js | 2 +- website/src/pages/line/index.js | 2 +- website/src/pages/parallel-coordinates/canvas.tsx | 2 +- website/src/pages/parallel-coordinates/index.tsx | 2 +- website/src/pages/sankey/index.tsx | 2 +- website/src/pages/voronoi/index.js | 2 +- 84 files changed, 153 insertions(+), 153 deletions(-) diff --git a/packages/annotations/src/AnnotationNote.tsx b/packages/annotations/src/AnnotationNote.tsx index 07cb942df..93558eec0 100644 --- a/packages/annotations/src/AnnotationNote.tsx +++ b/packages/annotations/src/AnnotationNote.tsx @@ -1,5 +1,5 @@ import { createElement } from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { useSpring, animated } from '@react-spring/web' import { useTheme, useMotionConfig } from '@nivo/core' import { NoteSvg } from './types' diff --git a/packages/annotations/src/compute.ts b/packages/annotations/src/compute.ts index c359ac0b5..ca83d2a9f 100644 --- a/packages/annotations/src/compute.ts +++ b/packages/annotations/src/compute.ts @@ -1,6 +1,6 @@ -import filter from 'lodash/filter' -import isNumber from 'lodash/isNumber' -import omit from 'lodash/omit' +import filter from 'lodash/filter.js' +import isNumber from 'lodash/isNumber.js' +import omit from 'lodash/omit.js' import { radiansToDegrees, absoluteAngleDegrees, diff --git a/packages/bar/src/compute/legends.ts b/packages/bar/src/compute/legends.ts index 7099b0894..ad1a1c400 100644 --- a/packages/bar/src/compute/legends.ts +++ b/packages/bar/src/compute/legends.ts @@ -7,7 +7,7 @@ import { LegendLabelDatum, } from '../types' import { getPropertyAccessor } from '@nivo/core' -import uniqBy from 'lodash/uniqBy' +import uniqBy from 'lodash/uniqBy.js' export const getLegendDataForKeys = ( bars: BarsWithHidden, diff --git a/packages/boxplot/src/compute/legends.ts b/packages/boxplot/src/compute/legends.ts index cd9923823..ee731f3fd 100644 --- a/packages/boxplot/src/compute/legends.ts +++ b/packages/boxplot/src/compute/legends.ts @@ -1,7 +1,7 @@ import { BoxPlotDatum, BoxPlotCommonProps, ComputedBoxPlotSummary, LegendData } from '../types' import { getPropertyAccessor } from '@nivo/core' -import uniqBy from 'lodash/uniqBy' -import sortBy from 'lodash/sortBy' +import uniqBy from 'lodash/uniqBy.js' +import sortBy from 'lodash/sortBy.js' export const getLegendData = ({ boxPlots, diff --git a/packages/calendar/src/compute/calendar.ts b/packages/calendar/src/compute/calendar.ts index 248b22961..207c8a398 100644 --- a/packages/calendar/src/compute/calendar.ts +++ b/packages/calendar/src/compute/calendar.ts @@ -1,6 +1,6 @@ -import isDate from 'lodash/isDate' -import memoize from 'lodash/memoize' -import range from 'lodash/range' +import isDate from 'lodash/isDate.js' +import memoize from 'lodash/memoize.js' +import range from 'lodash/range.js' import { alignBox } from '@nivo/core' import { timeFormat } from 'd3-time-format' import { timeDays, timeWeek, timeWeeks, timeMonths, timeYear } from 'd3-time' diff --git a/packages/calendar/src/compute/timeRange.ts b/packages/calendar/src/compute/timeRange.ts index 7dfe7a3a1..40a9c863f 100644 --- a/packages/calendar/src/compute/timeRange.ts +++ b/packages/calendar/src/compute/timeRange.ts @@ -11,7 +11,7 @@ import { } from 'd3-time' import { timeFormat } from 'd3-time-format' import { DateOrString, Weekday } from '../types' -import isDate from 'lodash/isDate' +import isDate from 'lodash/isDate.js' // Interfaces interface ComputeBaseProps { diff --git a/packages/circle-packing/src/hooks.ts b/packages/circle-packing/src/hooks.ts index 42ab46481..608d57a1b 100644 --- a/packages/circle-packing/src/hooks.ts +++ b/packages/circle-packing/src/hooks.ts @@ -1,7 +1,7 @@ import { useMemo, MouseEvent, MutableRefObject, useCallback } from 'react' import { pack as d3Pack, hierarchy as d3Hierarchy } from 'd3-hierarchy' -import cloneDeep from 'lodash/cloneDeep' -import sortBy from 'lodash/sortBy' +import cloneDeep from 'lodash/cloneDeep.js' +import sortBy from 'lodash/sortBy.js' import { usePropertyAccessor, useValueFormatter, diff --git a/packages/colors/src/inheritedColor.ts b/packages/colors/src/inheritedColor.ts index c79a169c5..3f9eb9f67 100644 --- a/packages/colors/src/inheritedColor.ts +++ b/packages/colors/src/inheritedColor.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import get from 'lodash/get' -import isPlainObject from 'lodash/isPlainObject' +import get from 'lodash/get.js' +import isPlainObject from 'lodash/isPlainObject.js' import { rgb, RGBColor } from 'd3-color' import { Theme } from '@nivo/core' diff --git a/packages/colors/src/scales/ordinalColorScale.ts b/packages/colors/src/scales/ordinalColorScale.ts index 6d71bedb4..2c897b181 100644 --- a/packages/colors/src/scales/ordinalColorScale.ts +++ b/packages/colors/src/scales/ordinalColorScale.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import get from 'lodash/get' -import isPlainObject from 'lodash/isPlainObject' +import get from 'lodash/get.js' +import isPlainObject from 'lodash/isPlainObject.js' import { scaleOrdinal } from 'd3-scale' import { ColorSchemeId, diff --git a/packages/core/src/lib/colors/index.js b/packages/core/src/lib/colors/index.js index 936cf2281..600daa745 100644 --- a/packages/core/src/lib/colors/index.js +++ b/packages/core/src/lib/colors/index.js @@ -6,9 +6,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -import last from 'lodash/last' -import isArray from 'lodash/isArray' -import isString from 'lodash/isString' +import last from 'lodash/last.js' +import isArray from 'lodash/isArray.js' +import isString from 'lodash/isString.js' import { scaleOrdinal, scaleSequential } from 'd3-scale' import { // categorical diff --git a/packages/core/src/lib/colors/quantize.js b/packages/core/src/lib/colors/quantize.js index 424367398..cec7d9f92 100644 --- a/packages/core/src/lib/colors/quantize.js +++ b/packages/core/src/lib/colors/quantize.js @@ -6,9 +6,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -import last from 'lodash/last' -import isArray from 'lodash/isArray' -import isFunction from 'lodash/isFunction' +import last from 'lodash/last.js' +import isArray from 'lodash/isArray.js' +import isFunction from 'lodash/isFunction.js' import { scaleQuantize } from 'd3-scale' import { // Diverging diff --git a/packages/core/src/lib/defs.js b/packages/core/src/lib/defs.js index 770c2c755..d269b2d4c 100644 --- a/packages/core/src/lib/defs.js +++ b/packages/core/src/lib/defs.js @@ -1,9 +1,9 @@ -import isFunction from 'lodash/isFunction' -import isPlainObject from 'lodash/isPlainObject' -import pick from 'lodash/pick' -import isEqual from 'lodash/isEqual' -import get from 'lodash/get' -import set from 'lodash/set' +import isFunction from 'lodash/isFunction.js' +import isPlainObject from 'lodash/isPlainObject.js' +import pick from 'lodash/pick.js' +import isEqual from 'lodash/isEqual.js' +import get from 'lodash/get.js' +import set from 'lodash/set.js' import { gradientTypes, patternTypes } from '../components/defs' const gradientKeys = Object.keys(gradientTypes) diff --git a/packages/core/src/lib/propertiesConverters.js b/packages/core/src/lib/propertiesConverters.js index 4f9ea3fb1..87bb29005 100644 --- a/packages/core/src/lib/propertiesConverters.js +++ b/packages/core/src/lib/propertiesConverters.js @@ -1,5 +1,5 @@ -import isFunction from 'lodash/isFunction' -import get from 'lodash/get' +import isFunction from 'lodash/isFunction.js' +import get from 'lodash/get.js' import { format } from 'd3-format' import { useMemo } from 'react' diff --git a/packages/core/src/motion/context.js b/packages/core/src/motion/context.js index e917d72b2..2ca063054 100644 --- a/packages/core/src/motion/context.js +++ b/packages/core/src/motion/context.js @@ -1,5 +1,5 @@ import { createContext, useMemo } from 'react' -import isString from 'lodash/isString' +import isString from 'lodash/isString.js' import PropTypes from 'prop-types' import { config as presets } from '@react-spring/web' diff --git a/packages/core/src/props/curve.js b/packages/core/src/props/curve.js index a858ce1f8..f9653d5c0 100644 --- a/packages/core/src/props/curve.js +++ b/packages/core/src/props/curve.js @@ -1,4 +1,4 @@ -import without from 'lodash/without' +import without from 'lodash/without.js' import { curveBasis, curveBasisClosed, diff --git a/packages/core/src/theming/extend.js b/packages/core/src/theming/extend.js index 4b4d915db..7ca60a171 100644 --- a/packages/core/src/theming/extend.js +++ b/packages/core/src/theming/extend.js @@ -6,9 +6,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -import merge from 'lodash/merge' -import get from 'lodash/get' -import set from 'lodash/set' +import merge from 'lodash/merge.js' +import get from 'lodash/get.js' +import set from 'lodash/set.js' const textPropsWithInheritance = [ 'axis.ticks.text', diff --git a/packages/core/tests/lib/defs.test.js b/packages/core/tests/lib/defs.test.js index 1f0fd2411..72569cbe2 100644 --- a/packages/core/tests/lib/defs.test.js +++ b/packages/core/tests/lib/defs.test.js @@ -6,7 +6,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -import partial from 'lodash/partial' +import partial from 'lodash/partial.js' import { isMatchingDef, bindDefs } from '../../src/lib/defs' describe('isMatchingDef()', () => { diff --git a/packages/express/src/index.ts b/packages/express/src/index.ts index eb6f5a753..708f97630 100644 --- a/packages/express/src/index.ts +++ b/packages/express/src/index.ts @@ -1,6 +1,6 @@ import { Router } from 'express' import * as uuid from 'uuid' -import forOwn from 'lodash/forOwn' +import forOwn from 'lodash/forOwn.js' import { chartsMapping, ChartType, renderChart, samples } from '@nivo/static' import { validate } from './validation' import * as storage from './memory-storage' diff --git a/packages/express/src/validation.ts b/packages/express/src/validation.ts index d3b4034e1..10d1eee76 100644 --- a/packages/express/src/validation.ts +++ b/packages/express/src/validation.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from 'express' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import Joi from 'joi' export const validate = ( diff --git a/packages/generators/src/bullet.ts b/packages/generators/src/bullet.ts index 8de8961d4..e0e0fbc55 100644 --- a/packages/generators/src/bullet.ts +++ b/packages/generators/src/bullet.ts @@ -1,5 +1,5 @@ -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' type Options = Partial<{ float: boolean diff --git a/packages/generators/src/chord.ts b/packages/generators/src/chord.ts index f8e0adcc9..127f5f0f2 100644 --- a/packages/generators/src/chord.ts +++ b/packages/generators/src/chord.ts @@ -1,5 +1,5 @@ -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' import { names } from './sets' export const generateChordData = ({ diff --git a/packages/generators/src/index.ts b/packages/generators/src/index.ts index 1ec5195a6..3e5a4807c 100644 --- a/packages/generators/src/index.ts +++ b/packages/generators/src/index.ts @@ -1,6 +1,6 @@ -import range from 'lodash/range' -import random from 'lodash/random' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import random from 'lodash/random.js' +import shuffle from 'lodash/shuffle.js' import { timeDays } from 'd3-time' import { timeFormat } from 'd3-time-format' import * as color from './color' diff --git a/packages/generators/src/network.ts b/packages/generators/src/network.ts index ff77c3576..1c34c2250 100644 --- a/packages/generators/src/network.ts +++ b/packages/generators/src/network.ts @@ -1,4 +1,4 @@ -import random from 'lodash/random' +import random from 'lodash/random.js' type Link = { source: string diff --git a/packages/generators/src/parallelCoordinates.ts b/packages/generators/src/parallelCoordinates.ts index af731393e..fbc2566f1 100644 --- a/packages/generators/src/parallelCoordinates.ts +++ b/packages/generators/src/parallelCoordinates.ts @@ -1,4 +1,4 @@ -import random from 'lodash/random' +import random from 'lodash/random.js' interface Id { id: string diff --git a/packages/generators/src/sankey.ts b/packages/generators/src/sankey.ts index ca998e4fc..8c26840fe 100644 --- a/packages/generators/src/sankey.ts +++ b/packages/generators/src/sankey.ts @@ -1,6 +1,6 @@ -import range from 'lodash/range' -import random from 'lodash/random' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import random from 'lodash/random.js' +import shuffle from 'lodash/shuffle.js' import { randColor } from './color' import { names } from './sets' diff --git a/packages/generators/src/swarmplot.ts b/packages/generators/src/swarmplot.ts index ef8e4b0b7..caf5c7094 100644 --- a/packages/generators/src/swarmplot.ts +++ b/packages/generators/src/swarmplot.ts @@ -1,6 +1,6 @@ -import range from 'lodash/range' -import random from 'lodash/random' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import random from 'lodash/random.js' +import shuffle from 'lodash/shuffle.js' type SwarmPlotDatum = { id: string diff --git a/packages/geo/src/hooks.js b/packages/geo/src/hooks.js index 11ba092c2..f7da4061d 100644 --- a/packages/geo/src/hooks.js +++ b/packages/geo/src/hooks.js @@ -7,8 +7,8 @@ * file that was distributed with this source code. */ import { useMemo } from 'react' -import isFunction from 'lodash/isFunction' -import get from 'lodash/get' +import isFunction from 'lodash/isFunction.js' +import get from 'lodash/get.js' import { format } from 'd3-format' import { geoPath, diff --git a/packages/line/src/hooks.js b/packages/line/src/hooks.js index 38cd2d31c..5005c394a 100644 --- a/packages/line/src/hooks.js +++ b/packages/line/src/hooks.js @@ -3,7 +3,7 @@ import { area, line } from 'd3-shape' import { curveFromProp, useTheme, useValueFormatter } from '@nivo/core' import { useOrdinalColorScale, useInheritedColor } from '@nivo/colors' import { computeXYScalesForSeries } from '@nivo/scales' -import uniqueId from 'lodash/uniqueId' +import uniqueId from 'lodash/uniqueId.js' import { LineDefaultProps } from './props' export const useLineGenerator = ({ curve }) => { diff --git a/packages/line/tests/Line.test.js b/packages/line/tests/Line.test.js index b6c133d7a..623e92251 100644 --- a/packages/line/tests/Line.test.js +++ b/packages/line/tests/Line.test.js @@ -14,7 +14,7 @@ beforeEach(() => { }) const generateId = () => `${LINE_UNIQUE_ID_PREFIX}${++id}` -jest.mock('lodash/uniqueId', () => generateId) +jest.mock('lodash/uniqueId.js', () => generateId) it('should render a basic line chart', () => { const data = [ diff --git a/packages/marimekko/src/hooks.ts b/packages/marimekko/src/hooks.ts index 94fc8af0f..6a7365c48 100644 --- a/packages/marimekko/src/hooks.ts +++ b/packages/marimekko/src/hooks.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import get from 'lodash/get' +import get from 'lodash/get.js' import { stack as d3Stack, Stack, Series } from 'd3-shape' import { useValueFormatter, useTheme } from '@nivo/core' import { InheritedColorConfig, useInheritedColor, useOrdinalColorScale } from '@nivo/colors' diff --git a/packages/sankey/src/Sankey.tsx b/packages/sankey/src/Sankey.tsx index db7382bf2..342ffd50b 100644 --- a/packages/sankey/src/Sankey.tsx +++ b/packages/sankey/src/Sankey.tsx @@ -1,5 +1,5 @@ import { createElement, Fragment, ReactNode } from 'react' -import uniq from 'lodash/uniq' +import uniq from 'lodash/uniq.js' import { SvgWrapper, useDimensions, Container } from '@nivo/core' import { BoxLegendSvg } from '@nivo/legends' import { svgDefaultProps } from './props' diff --git a/packages/sankey/src/hooks.ts b/packages/sankey/src/hooks.ts index 868fab6cf..71d21e120 100644 --- a/packages/sankey/src/hooks.ts +++ b/packages/sankey/src/hooks.ts @@ -1,5 +1,5 @@ import { useState, useMemo } from 'react' -import cloneDeep from 'lodash/cloneDeep' +import cloneDeep from 'lodash/cloneDeep.js' import { sankey as d3Sankey } from 'd3-sankey' import { useTheme, usePropertyAccessor, useValueFormatter } from '@nivo/core' import { useOrdinalColorScale, useInheritedColor } from '@nivo/colors' diff --git a/packages/scales/src/compute.ts b/packages/scales/src/compute.ts index 2559dfa2c..579c3019d 100644 --- a/packages/scales/src/compute.ts +++ b/packages/scales/src/compute.ts @@ -1,8 +1,8 @@ -import uniq from 'lodash/uniq' -import uniqBy from 'lodash/uniqBy' -import sortBy from 'lodash/sortBy' -import last from 'lodash/last' -import isDate from 'lodash/isDate' +import uniq from 'lodash/uniq.js' +import uniqBy from 'lodash/uniqBy.js' +import sortBy from 'lodash/sortBy.js' +import last from 'lodash/last.js' +import isDate from 'lodash/isDate.js' import { createDateNormalizer } from './timeHelpers' import { ScaleAxis, ScaleSpec, ScaleValue, SerieAxis, ComputedSerieAxis } from './types' import { createLinearScale } from './linearScale' diff --git a/packages/scatterplot/src/compute.ts b/packages/scatterplot/src/compute.ts index 22bab5841..7f4db1430 100644 --- a/packages/scatterplot/src/compute.ts +++ b/packages/scatterplot/src/compute.ts @@ -1,7 +1,7 @@ -import get from 'lodash/get' -import isString from 'lodash/isString' -import isNumber from 'lodash/isNumber' -import isPlainObject from 'lodash/isPlainObject' +import get from 'lodash/get.js' +import isString from 'lodash/isString.js' +import isNumber from 'lodash/isNumber.js' +import isPlainObject from 'lodash/isPlainObject.js' import { scaleLinear } from 'd3-scale' import { ComputedSerie } from '@nivo/scales' import { diff --git a/packages/static/src/renderer.ts b/packages/static/src/renderer.ts index bd315696b..edd51c0fe 100644 --- a/packages/static/src/renderer.ts +++ b/packages/static/src/renderer.ts @@ -1,4 +1,4 @@ -import pick from 'lodash/pick' +import pick from 'lodash/pick.js' import { createElement } from 'react' import { renderToStaticMarkup } from 'react-dom/server' import { ChartProps, chartsMapping, ChartType } from './mappings' diff --git a/packages/sunburst/src/hooks.ts b/packages/sunburst/src/hooks.ts index f0318c9dc..874b7c666 100644 --- a/packages/sunburst/src/hooks.ts +++ b/packages/sunburst/src/hooks.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' import { partition as d3Partition, hierarchy as d3Hierarchy } from 'd3-hierarchy' -import cloneDeep from 'lodash/cloneDeep' -import sortBy from 'lodash/sortBy' +import cloneDeep from 'lodash/cloneDeep.js' +import sortBy from 'lodash/sortBy.js' import { usePropertyAccessor, useTheme, useValueFormatter } from '@nivo/core' import { Arc, useArcGenerator } from '@nivo/arcs' import { useOrdinalColorScale, useInheritedColor, InheritedColorConfig } from '@nivo/colors' diff --git a/packages/swarmplot/src/SwarmPlotCanvas.tsx b/packages/swarmplot/src/SwarmPlotCanvas.tsx index 9af72e1ce..685d43222 100644 --- a/packages/swarmplot/src/SwarmPlotCanvas.tsx +++ b/packages/swarmplot/src/SwarmPlotCanvas.tsx @@ -1,6 +1,6 @@ import { createElement, useCallback, useEffect, useRef, useState } from 'react' import * as React from 'react' -import isNumber from 'lodash/isNumber' +import isNumber from 'lodash/isNumber.js' import { Container, getRelativeCursor, isCursorInRect, useDimensions, useTheme } from '@nivo/core' import { InheritedColorConfig, OrdinalColorScaleConfig, useInheritedColor } from '@nivo/colors' import { AnyScale } from '@nivo/scales' diff --git a/packages/swarmplot/src/compute.ts b/packages/swarmplot/src/compute.ts index 393991af9..2019c7eb6 100644 --- a/packages/swarmplot/src/compute.ts +++ b/packages/swarmplot/src/compute.ts @@ -1,7 +1,7 @@ -import isNumber from 'lodash/isNumber' -import isPlainObject from 'lodash/isPlainObject' -import isString from 'lodash/isString' -import get from 'lodash/get' +import isNumber from 'lodash/isNumber.js' +import isPlainObject from 'lodash/isPlainObject.js' +import isString from 'lodash/isString.js' +import get from 'lodash/get.js' import { scaleLinear, ScaleOrdinal, scaleOrdinal } from 'd3-scale' import { forceSimulation, forceX, forceY, forceCollide, ForceX, ForceY } from 'd3-force' import { diff --git a/packages/treemap/src/hooks.ts b/packages/treemap/src/hooks.ts index 6f43605b7..7d825631b 100644 --- a/packages/treemap/src/hooks.ts +++ b/packages/treemap/src/hooks.ts @@ -1,7 +1,7 @@ import { createElement, useCallback, useMemo, MouseEvent } from 'react' -import omit from 'lodash/omit' -import cloneDeep from 'lodash/cloneDeep' -import startCase from 'lodash/startCase' +import omit from 'lodash/omit.js' +import cloneDeep from 'lodash/cloneDeep.js' +import startCase from 'lodash/startCase.js' import { treemap as d3Treemap, hierarchy, diff --git a/storybook/stories/bump/AreaBump.stories.tsx b/storybook/stories/bump/AreaBump.stories.tsx index 80c39b683..eb8277be8 100644 --- a/storybook/stories/bump/AreaBump.stories.tsx +++ b/storybook/stories/bump/AreaBump.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import range from 'lodash/range' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import shuffle from 'lodash/shuffle.js' import { AreaBump, AreaBumpSvgProps } from '@nivo/bump' const meta: Meta = { diff --git a/storybook/stories/bump/Bump.stories.tsx b/storybook/stories/bump/Bump.stories.tsx index cdd53f67c..0595efdee 100644 --- a/storybook/stories/bump/Bump.stories.tsx +++ b/storybook/stories/bump/Bump.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import range from 'lodash/range' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import shuffle from 'lodash/shuffle.js' import { Bump, BumpPoint, BumpSvgProps, BumpComputedSerie } from '@nivo/bump' const meta: Meta = { diff --git a/storybook/stories/line/Line.stories.tsx b/storybook/stories/line/Line.stories.tsx index 27d8cb355..6c4b1a61f 100644 --- a/storybook/stories/line/Line.stories.tsx +++ b/storybook/stories/line/Line.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react' import { Component, useState, useEffect } from 'react' -import range from 'lodash/range' -import last from 'lodash/last' +import range from 'lodash/range.js' +import last from 'lodash/last.js' import { generateDrinkStats } from '@nivo/generators' import { Defs, linearGradientDef } from '@nivo/core' import { area, curveMonotoneX } from 'd3-shape' diff --git a/storybook/stories/scatterplot/ScatterPlot.stories.tsx b/storybook/stories/scatterplot/ScatterPlot.stories.tsx index bd06d7aa2..2729bbff9 100644 --- a/storybook/stories/scatterplot/ScatterPlot.stories.tsx +++ b/storybook/stories/scatterplot/ScatterPlot.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' import { useState, useCallback, useMemo } from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { area, curveMonotoneX } from 'd3-shape' import { ScatterPlot, diff --git a/storybook/stories/scatterplot/ScatterPlotCanvas.stories.tsx b/storybook/stories/scatterplot/ScatterPlotCanvas.stories.tsx index 54d197bbc..1014ba487 100644 --- a/storybook/stories/scatterplot/ScatterPlotCanvas.stories.tsx +++ b/storybook/stories/scatterplot/ScatterPlotCanvas.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' import { useCallback, useMemo, useRef, useState } from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { ResponsiveScatterPlotCanvas, ScatterPlotCanvas, diff --git a/storybook/stories/stream/Stream.stories.tsx b/storybook/stories/stream/Stream.stories.tsx index f8b5a9262..98bfc1f6f 100644 --- a/storybook/stories/stream/Stream.stories.tsx +++ b/storybook/stories/stream/Stream.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' import { areaCurvePropKeys } from '@nivo/core' import { Stream } from '@nivo/stream' diff --git a/website/src/components/controls/ControlsGroup.tsx b/website/src/components/controls/ControlsGroup.tsx index 473d93ccf..8cfe4325d 100644 --- a/website/src/components/controls/ControlsGroup.tsx +++ b/website/src/components/controls/ControlsGroup.tsx @@ -1,6 +1,6 @@ import React, { memo, useCallback } from 'react' -import get from 'lodash/get' -import snakeCase from 'lodash/snakeCase' +import get from 'lodash/get.js' +import snakeCase from 'lodash/snakeCase.js' import { ChartProperty, Flavor } from '../../types' import { ControlContext } from './types' import { diff --git a/website/src/components/controls/colors/InheritedColorControl.tsx b/website/src/components/controls/colors/InheritedColorControl.tsx index b53196220..65c523986 100644 --- a/website/src/components/controls/colors/InheritedColorControl.tsx +++ b/website/src/components/controls/colors/InheritedColorControl.tsx @@ -1,6 +1,6 @@ import React, { useState, useCallback } from 'react' -import isString from 'lodash/isString' -import isPlainObject from 'lodash/isPlainObject' +import isString from 'lodash/isString.js' +import isPlainObject from 'lodash/isPlainObject.js' import styled from 'styled-components' import { InheritedColorConfig } from '@nivo/colors' import { ChartProperty, Flavor } from '../../../types' diff --git a/website/src/components/controls/colors/colorSchemeSelect.tsx b/website/src/components/controls/colors/colorSchemeSelect.tsx index 99aadc303..4f4cd8076 100644 --- a/website/src/components/controls/colors/colorSchemeSelect.tsx +++ b/website/src/components/controls/colors/colorSchemeSelect.tsx @@ -1,5 +1,5 @@ import React, { useMemo } from 'react' -import range from 'lodash/range' +import range from 'lodash/range.js' import { startCase } from 'lodash' // @ts-ignore import { components } from 'react-select' diff --git a/website/src/components/controls/generics/RangeControl.tsx b/website/src/components/controls/generics/RangeControl.tsx index 1b6f17112..0f28cbfb6 100644 --- a/website/src/components/controls/generics/RangeControl.tsx +++ b/website/src/components/controls/generics/RangeControl.tsx @@ -1,6 +1,6 @@ import React, { memo, useCallback } from 'react' import styled from 'styled-components' -import pick from 'lodash/pick' +import pick from 'lodash/pick.js' import { Flavor } from '../../../types' import { ControlContext, RangeControlConfig } from '../types' import { Control, PropertyHeader, Help, TextInput } from '../ui' diff --git a/website/src/components/controls/generics/SwitchableRangeControl.tsx b/website/src/components/controls/generics/SwitchableRangeControl.tsx index 5614c0dbd..5af611dd1 100644 --- a/website/src/components/controls/generics/SwitchableRangeControl.tsx +++ b/website/src/components/controls/generics/SwitchableRangeControl.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useState, ChangeEvent } from 'react' import styled from 'styled-components' -import pick from 'lodash/pick' +import pick from 'lodash/pick.js' import { ControlContext, SwitchableRangeControlConfig } from '../types' import { ChartProperty, Flavor } from '../../../types' import { Control, PropertyHeader, Help, TextInput, Switch } from '../ui' diff --git a/website/src/components/controls/specialized/AnnotationsControl.tsx b/website/src/components/controls/specialized/AnnotationsControl.tsx index b5f4f64ac..d0fcbf3d9 100644 --- a/website/src/components/controls/specialized/AnnotationsControl.tsx +++ b/website/src/components/controls/specialized/AnnotationsControl.tsx @@ -1,5 +1,5 @@ import React, { memo, useCallback, useMemo } from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { AnnotationMatcher } from '@nivo/annotations' import { ChartProperty, Flavor } from '../../../types' import { AnnotationsControlConfig, ArrayControlConfig, ControlContext } from '../types' diff --git a/website/src/components/controls/ui/Control.tsx b/website/src/components/controls/ui/Control.tsx index 988736885..78b3773d3 100644 --- a/website/src/components/controls/ui/Control.tsx +++ b/website/src/components/controls/ui/Control.tsx @@ -1,5 +1,5 @@ import React, { useState, useCallback, PropsWithChildren } from 'react' -import intersection from 'lodash/intersection' +import intersection from 'lodash/intersection.js' import styled from 'styled-components' import { MdKeyboardArrowRight, MdKeyboardArrowDown } from 'react-icons/md' import { Flavor, FlavorAwareChartPropertyAttribute } from '../../../types' diff --git a/website/src/components/controls/ui/PropertyHeader.tsx b/website/src/components/controls/ui/PropertyHeader.tsx index c485999d3..58c2c69df 100644 --- a/website/src/components/controls/ui/PropertyHeader.tsx +++ b/website/src/components/controls/ui/PropertyHeader.tsx @@ -1,10 +1,10 @@ import React, { ReactNode } from 'react' -import isPlainObject from 'lodash/isPlainObject' -import isArray from 'lodash/isArray' -import isString from 'lodash/isString' -import isNumber from 'lodash/isNumber' -import isBoolean from 'lodash/isBoolean' -import isFunction from 'lodash/isFunction' +import isPlainObject from 'lodash/isPlainObject.js' +import isArray from 'lodash/isArray.js' +import isString from 'lodash/isString.js' +import isNumber from 'lodash/isNumber.js' +import isBoolean from 'lodash/isBoolean.js' +import isFunction from 'lodash/isFunction.js' import styled from 'styled-components' import { ChartProperty, Flavor } from '../../../types' import { ControlContext } from '../types' diff --git a/website/src/components/guides/legends/LegendPosition.tsx b/website/src/components/guides/legends/LegendPosition.tsx index b9a557a21..48cf56ef4 100644 --- a/website/src/components/guides/legends/LegendPosition.tsx +++ b/website/src/components/guides/legends/LegendPosition.tsx @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { useTheme } from 'styled-components' import { BoxLegendSvg } from '@nivo/legends' diff --git a/website/src/components/home/HomeAreaBumpDemo.tsx b/website/src/components/home/HomeAreaBumpDemo.tsx index e47092947..f3a24afa9 100644 --- a/website/src/components/home/HomeAreaBumpDemo.tsx +++ b/website/src/components/home/HomeAreaBumpDemo.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from 'react' -import random from 'lodash/random' +import random from 'lodash/random.js' import { AreaBump } from '@nivo/bump' import { useHomeTheme } from './theme' import { dimensions } from './dimensions' -import range from 'lodash/range' +import range from 'lodash/range.js' const serieIds = ['JavaScript', 'ReasonML', 'TypeScript', 'Elm'] const generateData = () => { diff --git a/website/src/components/home/HomeBumpDemo.tsx b/website/src/components/home/HomeBumpDemo.tsx index 202720828..aa1f997de 100644 --- a/website/src/components/home/HomeBumpDemo.tsx +++ b/website/src/components/home/HomeBumpDemo.tsx @@ -2,8 +2,8 @@ import React, { useMemo } from 'react' import { Bump } from '@nivo/bump' import { useHomeTheme } from './theme' import { dimensions } from './dimensions' -import range from 'lodash/range' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import shuffle from 'lodash/shuffle.js' interface Datum { x: number diff --git a/website/src/components/home/HomeMarimekkoDemo.tsx b/website/src/components/home/HomeMarimekkoDemo.tsx index 6ada24547..2b1aca3e0 100644 --- a/website/src/components/home/HomeMarimekkoDemo.tsx +++ b/website/src/components/home/HomeMarimekkoDemo.tsx @@ -1,5 +1,5 @@ import React, { useMemo } from 'react' -import random from 'lodash/random' +import random from 'lodash/random.js' import { Marimekko } from '@nivo/marimekko' import { useHomeTheme } from './theme' import { dimensions } from './dimensions' diff --git a/website/src/components/home/HomeStreamDemo.tsx b/website/src/components/home/HomeStreamDemo.tsx index 0e51c3afd..14de1f897 100644 --- a/website/src/components/home/HomeStreamDemo.tsx +++ b/website/src/components/home/HomeStreamDemo.tsx @@ -1,6 +1,6 @@ import React from 'react' -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' import { Stream } from '@nivo/stream' import { useHomeTheme } from './theme' import { dimensions } from './dimensions' diff --git a/website/src/components/home/HomeVoronoiDemo.tsx b/website/src/components/home/HomeVoronoiDemo.tsx index 92af68d21..00299c315 100644 --- a/website/src/components/home/HomeVoronoiDemo.tsx +++ b/website/src/components/home/HomeVoronoiDemo.tsx @@ -1,5 +1,5 @@ import React from 'react' -import range from 'lodash/range' +import range from 'lodash/range.js' import { Voronoi } from '@nivo/voronoi' import { useHomeTheme } from './theme' import { dimensions } from './dimensions' diff --git a/website/src/components/icons/CalendarIcon.tsx b/website/src/components/icons/CalendarIcon.tsx index 037e252f1..e45ca4d73 100644 --- a/website/src/components/icons/CalendarIcon.tsx +++ b/website/src/components/icons/CalendarIcon.tsx @@ -1,5 +1,5 @@ import React from 'react' -import range from 'lodash/range' +import range from 'lodash/range.js' import calendarLightNeutralImg from '../../assets/icons/calendar-light-neutral.png' import calendarLightColoredImg from '../../assets/icons/calendar-light-colored.png' import calendarDarkNeutralImg from '../../assets/icons/calendar-dark-neutral.png' diff --git a/website/src/data/components/line/generator.ts b/website/src/data/components/line/generator.ts index dbb189d71..271f176b5 100644 --- a/website/src/data/components/line/generator.ts +++ b/website/src/data/components/line/generator.ts @@ -1,4 +1,4 @@ -import range from 'lodash/range' +import range from 'lodash/range.js' import { generateSeries } from '@nivo/generators' export const generateLightDataSet = () => { diff --git a/website/src/data/components/radial-bar/mapper.ts b/website/src/data/components/radial-bar/mapper.ts index a883068b8..0d0408478 100644 --- a/website/src/data/components/radial-bar/mapper.ts +++ b/website/src/data/components/radial-bar/mapper.ts @@ -1,4 +1,4 @@ -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { settingsMapper, mapFormat } from '../../../lib/settings' export const mapAxis = (key: string) => (value: any, settings: any) => diff --git a/website/src/data/components/scatterplot/generator.ts b/website/src/data/components/scatterplot/generator.ts index 95108111f..ee74e13d8 100644 --- a/website/src/data/components/scatterplot/generator.ts +++ b/website/src/data/components/scatterplot/generator.ts @@ -1,5 +1,5 @@ -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' const keys = ['group A', 'group B', 'group C', 'group D', 'group E'] const ageRange = [0, 100] diff --git a/website/src/data/components/stream/generator.ts b/website/src/data/components/stream/generator.ts index b3800faa1..b4066a5c6 100644 --- a/website/src/data/components/stream/generator.ts +++ b/website/src/data/components/stream/generator.ts @@ -1,5 +1,5 @@ -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' const names = [ 'Raoul', diff --git a/website/src/data/components/treemap/generator.ts b/website/src/data/components/treemap/generator.ts index cc861fdbe..e28126909 100644 --- a/website/src/data/components/treemap/generator.ts +++ b/website/src/data/components/treemap/generator.ts @@ -1,6 +1,6 @@ import { generateLibTree } from '@nivo/generators' -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' export const generateLightDataSet = () => generateLibTree() diff --git a/website/src/lib/chart-properties/axes.ts b/website/src/lib/chart-properties/axes.ts index abf45fc3a..ecb8ba2a7 100644 --- a/website/src/lib/chart-properties/axes.ts +++ b/website/src/lib/chart-properties/axes.ts @@ -1,4 +1,4 @@ -import upperFirst from 'lodash/upperFirst' +import upperFirst from 'lodash/upperFirst.js' import { ChartProperty, Flavor } from '../../types' const positions = [ diff --git a/website/src/lib/componentProperties.ts b/website/src/lib/componentProperties.ts index 7b152b2b2..f6217180b 100644 --- a/website/src/lib/componentProperties.ts +++ b/website/src/lib/componentProperties.ts @@ -1,4 +1,4 @@ -import uniq from 'lodash/uniq' +import uniq from 'lodash/uniq.js' import { defaultAnimate } from '@nivo/core' import { TooltipPosition, TooltipAnchor } from '@nivo/tooltip' import { Flavor, ChartProperty } from '../types' diff --git a/website/src/lib/generateChartCode.ts b/website/src/lib/generateChartCode.ts index b27c89f5d..1151b82b5 100644 --- a/website/src/lib/generateChartCode.ts +++ b/website/src/lib/generateChartCode.ts @@ -1,9 +1,9 @@ -import forOwn from 'lodash/forOwn' -import isPlainObject from 'lodash/isPlainObject' -import isArray from 'lodash/isArray' -import isString from 'lodash/isString' -import isNumber from 'lodash/isNumber' -import isBoolean from 'lodash/isBoolean' +import forOwn from 'lodash/forOwn.js' +import isPlainObject from 'lodash/isPlainObject.js' +import isArray from 'lodash/isArray.js' +import isString from 'lodash/isString.js' +import isNumber from 'lodash/isNumber.js' +import isBoolean from 'lodash/isBoolean.js' import dedent from 'dedent-js' const indent = (content: string, spaces: number = 8) => diff --git a/website/src/lib/settings.ts b/website/src/lib/settings.ts index a16d878c8..f7ef6e4e8 100644 --- a/website/src/lib/settings.ts +++ b/website/src/lib/settings.ts @@ -1,5 +1,5 @@ -import omit from 'lodash/omit' -import upperFirst from 'lodash/upperFirst' +import omit from 'lodash/omit.js' +import upperFirst from 'lodash/upperFirst.js' import { AxisProps, CanvasAxisProps } from '@nivo/axes' export const settingsMapper = diff --git a/website/src/pages/area-bump/index.tsx b/website/src/pages/area-bump/index.tsx index e0a0e955e..f24881684 100644 --- a/website/src/pages/area-bump/index.tsx +++ b/website/src/pages/area-bump/index.tsx @@ -1,6 +1,6 @@ import React from 'react' -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' import { useStaticQuery, graphql } from 'gatsby' import { patternDotsDef, patternLinesDef } from '@nivo/core' import { ResponsiveAreaBump, areaBumpSvgDefaultProps as defaults } from '@nivo/bump' diff --git a/website/src/pages/bullet/index.js b/website/src/pages/bullet/index.js index be93fde5c..48a2a00fb 100644 --- a/website/src/pages/bullet/index.js +++ b/website/src/pages/bullet/index.js @@ -1,5 +1,5 @@ import React from 'react' -import shuffle from 'lodash/shuffle' +import shuffle from 'lodash/shuffle.js' import { ResponsiveBullet, defaultProps } from '@nivo/bullet' import { generateBulletData } from '@nivo/generators' import { ComponentTemplate } from '../../components/components/ComponentTemplate' diff --git a/website/src/pages/bump/index.tsx b/website/src/pages/bump/index.tsx index 5e3f7f935..1b3b6d808 100644 --- a/website/src/pages/bump/index.tsx +++ b/website/src/pages/bump/index.tsx @@ -1,6 +1,6 @@ import React from 'react' -import range from 'lodash/range' -import shuffle from 'lodash/shuffle' +import range from 'lodash/range.js' +import shuffle from 'lodash/shuffle.js' import { graphql, useStaticQuery } from 'gatsby' import { ResponsiveBump, diff --git a/website/src/pages/choropleth/index.tsx b/website/src/pages/choropleth/index.tsx index 82a74886d..ccb9d1ea2 100644 --- a/website/src/pages/choropleth/index.tsx +++ b/website/src/pages/choropleth/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { patternDotsDef, patternLinesDef, linearGradientDef } from '@nivo/core' import { ResponsiveChoropleth, ChoroplethDefaultProps } from '@nivo/geo' import { ComponentTemplate } from '../../components/components/ComponentTemplate' diff --git a/website/src/pages/circle-packing/canvas.js b/website/src/pages/circle-packing/canvas.js index 4a6be241f..ee1cbafdd 100644 --- a/website/src/pages/circle-packing/canvas.js +++ b/website/src/pages/circle-packing/canvas.js @@ -1,6 +1,6 @@ import React from 'react' -import range from 'lodash/range' -import random from 'lodash/random' +import range from 'lodash/range.js' +import random from 'lodash/random.js' import { ResponsiveCirclePackingCanvas, defaultProps } from '@nivo/circle-packing' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/circle-packing/meta.yml' diff --git a/website/src/pages/funnel/index.tsx b/website/src/pages/funnel/index.tsx index 5dacb9da2..917cd7112 100644 --- a/website/src/pages/funnel/index.tsx +++ b/website/src/pages/funnel/index.tsx @@ -1,6 +1,6 @@ import React from 'react' -import omit from 'lodash/omit' -import merge from 'lodash/merge' +import omit from 'lodash/omit.js' +import merge from 'lodash/merge.js' import { ResponsiveFunnel, svgDefaultProps } from '@nivo/funnel' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/funnel/meta.yml' diff --git a/website/src/pages/geomap/canvas.js b/website/src/pages/geomap/canvas.js index 4070eb043..0cfb9cdd0 100644 --- a/website/src/pages/geomap/canvas.js +++ b/website/src/pages/geomap/canvas.js @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { ResponsiveGeoMapCanvas, GeoMapCanvasDefaultProps } from '@nivo/geo' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/geomap/meta.yml' diff --git a/website/src/pages/geomap/index.js b/website/src/pages/geomap/index.js index 3eb60e8a7..8745756e6 100644 --- a/website/src/pages/geomap/index.js +++ b/website/src/pages/geomap/index.js @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { ResponsiveGeoMap, GeoMapDefaultProps } from '@nivo/geo' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/geomap/meta.yml' diff --git a/website/src/pages/line/api.tsx b/website/src/pages/line/api.tsx index a36a7aaa0..a9d22bb1f 100644 --- a/website/src/pages/line/api.tsx +++ b/website/src/pages/line/api.tsx @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { Seo } from '../../components/Seo' import { ApiClient } from '../../components/components/api-client/ApiClient' import { groups } from '../../data/components/line/props' diff --git a/website/src/pages/line/canvas.js b/website/src/pages/line/canvas.js index 4476eb8e7..f7f1224d4 100644 --- a/website/src/pages/line/canvas.js +++ b/website/src/pages/line/canvas.js @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { ResponsiveLineCanvas, LineCanvasDefaultProps } from '@nivo/line' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/line/meta.yml' diff --git a/website/src/pages/line/index.js b/website/src/pages/line/index.js index 46f4e8e95..5d8dc2eb9 100644 --- a/website/src/pages/line/index.js +++ b/website/src/pages/line/index.js @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { ResponsiveLine, LineDefaultProps } from '@nivo/line' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/line/meta.yml' diff --git a/website/src/pages/parallel-coordinates/canvas.tsx b/website/src/pages/parallel-coordinates/canvas.tsx index b9040b22e..34818542b 100644 --- a/website/src/pages/parallel-coordinates/canvas.tsx +++ b/website/src/pages/parallel-coordinates/canvas.tsx @@ -1,6 +1,6 @@ import React from 'react' import { graphql, useStaticQuery } from 'gatsby' -import merge from 'lodash/merge' +import merge from 'lodash/merge.js' import { ResponsiveParallelCoordinatesCanvas, commonDefaultProps, diff --git a/website/src/pages/parallel-coordinates/index.tsx b/website/src/pages/parallel-coordinates/index.tsx index 7000f1e98..aebc36273 100644 --- a/website/src/pages/parallel-coordinates/index.tsx +++ b/website/src/pages/parallel-coordinates/index.tsx @@ -1,6 +1,6 @@ import React from 'react' import { graphql, useStaticQuery } from 'gatsby' -import merge from 'lodash/merge' +import merge from 'lodash/merge.js' import { ResponsiveParallelCoordinates, commonDefaultProps } from '@nivo/parallel-coordinates' import { generateParallelCoordinatesData } from '@nivo/generators' import { ComponentTemplate } from '../../components/components/ComponentTemplate' diff --git a/website/src/pages/sankey/index.tsx b/website/src/pages/sankey/index.tsx index e7e8e4c6a..85476160b 100644 --- a/website/src/pages/sankey/index.tsx +++ b/website/src/pages/sankey/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import omit from 'lodash/omit' +import omit from 'lodash/omit.js' import { generateSankeyData } from '@nivo/generators' import { ResponsiveSankey, diff --git a/website/src/pages/voronoi/index.js b/website/src/pages/voronoi/index.js index c5ae9c5e7..513e0a88b 100644 --- a/website/src/pages/voronoi/index.js +++ b/website/src/pages/voronoi/index.js @@ -1,5 +1,5 @@ import React from 'react' -import range from 'lodash/range' +import range from 'lodash/range.js' import { ResponsiveVoronoi, defaultVoronoiProps } from '@nivo/voronoi' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/voronoi/meta.yml' From 49cb899597a4629f7ee34c62d5b0c8de72050b65 Mon Sep 17 00:00:00 2001 From: odan Date: Thu, 29 Aug 2024 00:55:36 +0900 Subject: [PATCH 2/3] use .mjs for esm files --- conf/rollup.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/rollup.config.mjs b/conf/rollup.config.mjs index b85071fdd..3edbd8a56 100644 --- a/conf/rollup.config.mjs +++ b/conf/rollup.config.mjs @@ -61,7 +61,7 @@ const configs = [ { ...common, output: { - file: `./packages/${pkg}/dist/nivo-${pkg}.es.js`, + file: `./packages/${pkg}/dist/nivo-${pkg}.mjs`, format: 'es', name: `@nivo/${pkg}`, sourcemap: true, From bb937d2a89145b5d34312e584e96c9a7e562acb3 Mon Sep 17 00:00:00 2001 From: odan Date: Thu, 29 Aug 2024 00:57:13 +0900 Subject: [PATCH 3/3] add exports field --- packages/annotations/package.json | 9 ++++++++- packages/arcs/package.json | 9 ++++++++- packages/axes/package.json | 9 ++++++++- packages/bar/package.json | 9 ++++++++- packages/boxplot/package.json | 9 ++++++++- packages/bullet/package.json | 9 ++++++++- packages/bump/package.json | 9 ++++++++- packages/calendar/package.json | 9 ++++++++- packages/canvas/package.json | 9 ++++++++- packages/chord/package.json | 9 ++++++++- packages/circle-packing/package.json | 9 ++++++++- packages/colors/package.json | 9 ++++++++- packages/core/package.json | 9 ++++++++- packages/express/package.json | 9 ++++++++- packages/funnel/package.json | 9 ++++++++- packages/generators/package.json | 9 ++++++++- packages/geo/package.json | 8 +++++++- packages/grid/package.json | 9 ++++++++- packages/heatmap/package.json | 9 ++++++++- packages/legends/package.json | 9 ++++++++- packages/line/package.json | 9 ++++++++- packages/marimekko/package.json | 9 ++++++++- packages/network/package.json | 9 ++++++++- packages/parallel-coordinates/package.json | 9 ++++++++- packages/pie/package.json | 9 ++++++++- packages/polar-axes/package.json | 9 ++++++++- packages/radar/package.json | 9 ++++++++- packages/radial-bar/package.json | 9 ++++++++- packages/sankey/package.json | 9 ++++++++- packages/scales/package.json | 9 ++++++++- packages/scatterplot/package.json | 9 ++++++++- packages/static/package.json | 9 ++++++++- packages/stream/package.json | 9 ++++++++- packages/sunburst/package.json | 9 ++++++++- packages/swarmplot/package.json | 9 ++++++++- packages/text/package.json | 9 ++++++++- packages/tooltip/package.json | 9 ++++++++- packages/tree/package.json | 9 ++++++++- packages/treemap/package.json | 9 ++++++++- packages/voronoi/package.json | 9 ++++++++- packages/waffle/package.json | 9 ++++++++- 41 files changed, 327 insertions(+), 41 deletions(-) diff --git a/packages/annotations/package.json b/packages/annotations/package.json index a6754d829..f542e0397 100644 --- a/packages/annotations/package.json +++ b/packages/annotations/package.json @@ -19,7 +19,7 @@ "annotations" ], "main": "./dist/nivo-annotations.cjs.js", - "module": "./dist/nivo-annotations.es.js", + "module": "./dist/nivo-annotations.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -38,5 +38,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-annotations.mjs", + "require": "./dist/nivo-annotations.cjs.js" + } } } diff --git a/packages/arcs/package.json b/packages/arcs/package.json index 1ce7f1165..64d04109b 100644 --- a/packages/arcs/package.json +++ b/packages/arcs/package.json @@ -19,7 +19,7 @@ "arcs" ], "main": "./dist/nivo-arcs.cjs.js", - "module": "./dist/nivo-arcs.es.js", + "module": "./dist/nivo-arcs.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -39,5 +39,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-arcs.mjs", + "require": "./dist/nivo-arcs.cjs.js" + } } } diff --git a/packages/axes/package.json b/packages/axes/package.json index 04491803c..4275915c1 100644 --- a/packages/axes/package.json +++ b/packages/axes/package.json @@ -18,7 +18,7 @@ "axes" ], "main": "./dist/nivo-axes.cjs.js", - "module": "./dist/nivo-axes.es.js", + "module": "./dist/nivo-axes.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -40,5 +40,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-axes.mjs", + "require": "./dist/nivo-axes.cjs.js" + } } } diff --git a/packages/bar/package.json b/packages/bar/package.json index 82573fd09..8453cfe1c 100644 --- a/packages/bar/package.json +++ b/packages/bar/package.json @@ -20,7 +20,7 @@ "bar-chart" ], "main": "./dist/nivo-bar.cjs.js", - "module": "./dist/nivo-bar.es.js", + "module": "./dist/nivo-bar.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -48,5 +48,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-bar.mjs", + "require": "./dist/nivo-bar.cjs.js" + } } } diff --git a/packages/boxplot/package.json b/packages/boxplot/package.json index e4dff2de7..52f9cdc31 100644 --- a/packages/boxplot/package.json +++ b/packages/boxplot/package.json @@ -25,7 +25,7 @@ "stats" ], "main": "./dist/nivo-boxplot.cjs.js", - "module": "./dist/nivo-boxplot.es.js", + "module": "./dist/nivo-boxplot.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -53,5 +53,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-boxplot.mjs", + "require": "./dist/nivo-boxplot.cjs.js" + } } } diff --git a/packages/bullet/package.json b/packages/bullet/package.json index 3a0488bc9..0f8907cbf 100644 --- a/packages/bullet/package.json +++ b/packages/bullet/package.json @@ -20,7 +20,7 @@ "bullet-chart" ], "main": "./dist/nivo-bullet.cjs.js", - "module": "./dist/nivo-bullet.es.js", + "module": "./dist/nivo-bullet.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -42,5 +42,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-bullet.mjs", + "require": "./dist/nivo-bullet.cjs.js" + } } } diff --git a/packages/bump/package.json b/packages/bump/package.json index afe7b272d..7a65a64f4 100644 --- a/packages/bump/package.json +++ b/packages/bump/package.json @@ -21,7 +21,7 @@ "area-bump-chart" ], "main": "./dist/nivo-bump.cjs.js", - "module": "./dist/nivo-bump.es.js", + "module": "./dist/nivo-bump.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -48,5 +48,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-bump.mjs", + "require": "./dist/nivo-bump.cjs.js" + } } } diff --git a/packages/calendar/package.json b/packages/calendar/package.json index db52532cb..087697508 100644 --- a/packages/calendar/package.json +++ b/packages/calendar/package.json @@ -20,7 +20,7 @@ "calendar" ], "main": "./dist/nivo-calendar.cjs.js", - "module": "./dist/nivo-calendar.es.js", + "module": "./dist/nivo-calendar.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -45,5 +45,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-calendar.mjs", + "require": "./dist/nivo-calendar.cjs.js" + } } } diff --git a/packages/canvas/package.json b/packages/canvas/package.json index cbac2cb7a..973a0a098 100644 --- a/packages/canvas/package.json +++ b/packages/canvas/package.json @@ -19,7 +19,7 @@ "canvas" ], "main": "./dist/nivo-canvas.cjs.js", - "module": "./dist/nivo-canvas.es.js", + "module": "./dist/nivo-canvas.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -29,5 +29,12 @@ ], "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-canvas.mjs", + "require": "./dist/nivo-canvas.cjs.js" + } } } diff --git a/packages/chord/package.json b/packages/chord/package.json index aabecb228..6cef8d648 100644 --- a/packages/chord/package.json +++ b/packages/chord/package.json @@ -20,7 +20,7 @@ "chord-diagram" ], "main": "./dist/nivo-chord.cjs.js", - "module": "./dist/nivo-chord.es.js", + "module": "./dist/nivo-chord.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -45,5 +45,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-chord.mjs", + "require": "./dist/nivo-chord.cjs.js" + } } } diff --git a/packages/circle-packing/package.json b/packages/circle-packing/package.json index 06ed8c8ee..d6d82ad83 100644 --- a/packages/circle-packing/package.json +++ b/packages/circle-packing/package.json @@ -20,7 +20,7 @@ "circle-packing" ], "main": "./dist/nivo-circle-packing.cjs.js", - "module": "./dist/nivo-circle-packing.es.js", + "module": "./dist/nivo-circle-packing.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -42,5 +42,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-circle-packing.mjs", + "require": "./dist/nivo-circle-packing.cjs.js" + } } } diff --git a/packages/colors/package.json b/packages/colors/package.json index 8f96f6cff..2333035b8 100644 --- a/packages/colors/package.json +++ b/packages/colors/package.json @@ -12,7 +12,7 @@ "directory": "packages/colors" }, "main": "./dist/nivo-colors.cjs.js", - "module": "./dist/nivo-colors.es.js", + "module": "./dist/nivo-colors.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -37,5 +37,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-colors.mjs", + "require": "./dist/nivo-colors.cjs.js" + } } } diff --git a/packages/core/package.json b/packages/core/package.json index d3507883a..01e676a9d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -12,7 +12,7 @@ "directory": "packages/core" }, "main": "./dist/nivo-core.cjs.js", - "module": "./dist/nivo-core.es.js", + "module": "./dist/nivo-core.mjs", "types": "./index.d.ts", "files": [ "README.md", @@ -43,5 +43,12 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/nivo/donate" + }, + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./dist/nivo-core.mjs", + "require": "./dist/nivo-core.cjs.js" + } } } diff --git a/packages/express/package.json b/packages/express/package.json index fdba8f70b..cb94bdf65 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -12,7 +12,7 @@ "directory": "packages/express" }, "main": "./dist/nivo-express.cjs.js", - "module": "./dist/nivo-express.es.js", + "module": "./dist/nivo-express.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -35,5 +35,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-express.mjs", + "require": "./dist/nivo-express.cjs.js" + } } } diff --git a/packages/funnel/package.json b/packages/funnel/package.json index 6d83c154c..6df92ad9d 100644 --- a/packages/funnel/package.json +++ b/packages/funnel/package.json @@ -20,7 +20,7 @@ "funnel" ], "main": "./dist/nivo-funnel.cjs.js", - "module": "./dist/nivo-funnel.es.js", + "module": "./dist/nivo-funnel.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -44,5 +44,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-funnel.mjs", + "require": "./dist/nivo-funnel.cjs.js" + } } } diff --git a/packages/generators/package.json b/packages/generators/package.json index a593f534a..2821f4288 100644 --- a/packages/generators/package.json +++ b/packages/generators/package.json @@ -18,7 +18,7 @@ "directory": "packages/generators" }, "main": "./dist/nivo-generators.cjs.js", - "module": "./dist/nivo-generators.es.js", + "module": "./dist/nivo-generators.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -37,5 +37,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-generators.mjs", + "require": "./dist/nivo-generators.cjs.js" + } } } diff --git a/packages/geo/package.json b/packages/geo/package.json index 423e3c722..d67c55f08 100644 --- a/packages/geo/package.json +++ b/packages/geo/package.json @@ -21,7 +21,7 @@ "map" ], "main": "./dist/nivo-geo.cjs.js", - "module": "./dist/nivo-geo.es.js", + "module": "./dist/nivo-geo.mjs", "files": [ "README.md", "LICENSE.md", @@ -43,5 +43,11 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "import": "./dist/nivo-geo.mjs", + "require": "./dist/nivo-geo.cjs.js" + } } } diff --git a/packages/grid/package.json b/packages/grid/package.json index 1581587af..95da326ff 100644 --- a/packages/grid/package.json +++ b/packages/grid/package.json @@ -14,7 +14,7 @@ }, "sideEffects": false, "main": "./dist/nivo-grid.cjs.js", - "module": "./dist/nivo-grid.es.js", + "module": "./dist/nivo-grid.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -24,5 +24,12 @@ ], "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-grid.mjs", + "require": "./dist/nivo-grid.cjs.js" + } } } diff --git a/packages/heatmap/package.json b/packages/heatmap/package.json index 585695f90..37a702f8c 100644 --- a/packages/heatmap/package.json +++ b/packages/heatmap/package.json @@ -20,7 +20,7 @@ "heatmap" ], "main": "./dist/nivo-heatmap.cjs.js", - "module": "./dist/nivo-heatmap.es.js", + "module": "./dist/nivo-heatmap.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -45,5 +45,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-heatmap.mjs", + "require": "./dist/nivo-heatmap.cjs.js" + } } } diff --git a/packages/legends/package.json b/packages/legends/package.json index 5b88a8307..cb121f017 100644 --- a/packages/legends/package.json +++ b/packages/legends/package.json @@ -13,7 +13,7 @@ "directory": "packages/legends" }, "main": "./dist/nivo-legends.cjs.js", - "module": "./dist/nivo-legends.es.js", + "module": "./dist/nivo-legends.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -32,5 +32,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-legends.mjs", + "require": "./dist/nivo-legends.cjs.js" + } } } diff --git a/packages/line/package.json b/packages/line/package.json index 5c61c4da4..892afe1be 100644 --- a/packages/line/package.json +++ b/packages/line/package.json @@ -20,7 +20,7 @@ "line-chart" ], "main": "./dist/nivo-line.cjs.js", - "module": "./dist/nivo-line.es.js", + "module": "./dist/nivo-line.mjs", "types": "./index.d.ts", "files": [ "README.md", @@ -45,5 +45,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./dist/nivo-line.mjs", + "require": "./dist/nivo-line.cjs.js" + } } } diff --git a/packages/marimekko/package.json b/packages/marimekko/package.json index d0cfd7ac0..e35cb58f2 100644 --- a/packages/marimekko/package.json +++ b/packages/marimekko/package.json @@ -12,7 +12,7 @@ "directory": "packages/marimekko" }, "main": "./dist/nivo-marimekko.cjs.js", - "module": "./dist/nivo-marimekko.es.js", + "module": "./dist/nivo-marimekko.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -37,5 +37,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-marimekko.mjs", + "require": "./dist/nivo-marimekko.cjs.js" + } } } diff --git a/packages/network/package.json b/packages/network/package.json index 330a0911e..f23411519 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -22,7 +22,7 @@ "network" ], "main": "./dist/nivo-network.cjs.js", - "module": "./dist/nivo-network.es.js", + "module": "./dist/nivo-network.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -44,5 +44,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-network.mjs", + "require": "./dist/nivo-network.cjs.js" + } } } diff --git a/packages/parallel-coordinates/package.json b/packages/parallel-coordinates/package.json index d6c66f35c..86d310986 100644 --- a/packages/parallel-coordinates/package.json +++ b/packages/parallel-coordinates/package.json @@ -21,7 +21,7 @@ ], "sideEffects": false, "main": "./dist/nivo-parallel-coordinates.cjs.js", - "module": "./dist/nivo-parallel-coordinates.es.js", + "module": "./dist/nivo-parallel-coordinates.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -47,5 +47,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-parallel-coordinates.mjs", + "require": "./dist/nivo-parallel-coordinates.cjs.js" + } } } diff --git a/packages/pie/package.json b/packages/pie/package.json index 5d8d0fe79..dfd22e0a4 100644 --- a/packages/pie/package.json +++ b/packages/pie/package.json @@ -20,7 +20,7 @@ "pie-chart" ], "main": "./dist/nivo-pie.cjs.js", - "module": "./dist/nivo-pie.es.js", + "module": "./dist/nivo-pie.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -42,5 +42,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-pie.mjs", + "require": "./dist/nivo-pie.cjs.js" + } } } diff --git a/packages/polar-axes/package.json b/packages/polar-axes/package.json index 916acdfcc..872797dcb 100644 --- a/packages/polar-axes/package.json +++ b/packages/polar-axes/package.json @@ -19,7 +19,7 @@ "polar" ], "main": "./dist/nivo-polar-axes.cjs.js", - "module": "./dist/nivo-polar-axes.es.js", + "module": "./dist/nivo-polar-axes.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -38,5 +38,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-polar-axes.mjs", + "require": "./dist/nivo-polar-axes.cjs.js" + } } } diff --git a/packages/radar/package.json b/packages/radar/package.json index 2adc0ee24..104c3f1ab 100644 --- a/packages/radar/package.json +++ b/packages/radar/package.json @@ -20,7 +20,7 @@ "radar-chart" ], "main": "./dist/nivo-radar.cjs.js", - "module": "./dist/nivo-radar.es.js", + "module": "./dist/nivo-radar.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -44,5 +44,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-radar.mjs", + "require": "./dist/nivo-radar.cjs.js" + } } } diff --git a/packages/radial-bar/package.json b/packages/radial-bar/package.json index 75f911713..36b19d9e9 100644 --- a/packages/radial-bar/package.json +++ b/packages/radial-bar/package.json @@ -20,7 +20,7 @@ "radial-bar-chart" ], "main": "./dist/nivo-radial-bar.cjs.js", - "module": "./dist/nivo-radial-bar.es.js", + "module": "./dist/nivo-radial-bar.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -47,5 +47,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-radial-bar.mjs", + "require": "./dist/nivo-radial-bar.cjs.js" + } } } diff --git a/packages/sankey/package.json b/packages/sankey/package.json index beecb8244..3a3476076 100644 --- a/packages/sankey/package.json +++ b/packages/sankey/package.json @@ -20,7 +20,7 @@ "sankey-diagram" ], "main": "./dist/nivo-sankey.cjs.js", - "module": "./dist/nivo-sankey.es.js", + "module": "./dist/nivo-sankey.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -45,5 +45,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-sankey.mjs", + "require": "./dist/nivo-sankey.cjs.js" + } } } diff --git a/packages/scales/package.json b/packages/scales/package.json index 099324a04..2db491311 100644 --- a/packages/scales/package.json +++ b/packages/scales/package.json @@ -12,7 +12,7 @@ "directory": "packages/scales" }, "main": "./dist/nivo-scales.cjs.js", - "module": "./dist/nivo-scales.es.js", + "module": "./dist/nivo-scales.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -31,5 +31,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-scales.mjs", + "require": "./dist/nivo-scales.cjs.js" + } } } diff --git a/packages/scatterplot/package.json b/packages/scatterplot/package.json index 9fb75836d..2d60f1dfd 100644 --- a/packages/scatterplot/package.json +++ b/packages/scatterplot/package.json @@ -20,7 +20,7 @@ "scatterplot" ], "main": "./dist/nivo-scatterplot.cjs.js", - "module": "./dist/nivo-scatterplot.es.js", + "module": "./dist/nivo-scatterplot.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -49,5 +49,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-scatterplot.mjs", + "require": "./dist/nivo-scatterplot.cjs.js" + } } } diff --git a/packages/static/package.json b/packages/static/package.json index 88b9bd5ef..2f7cd286e 100644 --- a/packages/static/package.json +++ b/packages/static/package.json @@ -12,7 +12,7 @@ "directory": "packages/static" }, "main": "./dist/nivo-static.cjs.js", - "module": "./dist/nivo-static.es.js", + "module": "./dist/nivo-static.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -46,5 +46,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-static.mjs", + "require": "./dist/nivo-static.cjs.js" + } } } diff --git a/packages/stream/package.json b/packages/stream/package.json index af7dd91f4..3603c1c7a 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -20,7 +20,7 @@ "stream-chart" ], "main": "./dist/nivo-stream.cjs.js", - "module": "./dist/nivo-stream.es.js", + "module": "./dist/nivo-stream.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -44,5 +44,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-stream.mjs", + "require": "./dist/nivo-stream.cjs.js" + } } } diff --git a/packages/sunburst/package.json b/packages/sunburst/package.json index 4161a26ee..4b68cc46e 100644 --- a/packages/sunburst/package.json +++ b/packages/sunburst/package.json @@ -20,7 +20,7 @@ "sunburst-chart" ], "main": "./dist/nivo-sunburst.cjs.js", - "module": "./dist/nivo-sunburst.es.js", + "module": "./dist/nivo-sunburst.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -42,5 +42,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-sunburst.mjs", + "require": "./dist/nivo-sunburst.cjs.js" + } } } diff --git a/packages/swarmplot/package.json b/packages/swarmplot/package.json index d3abf442d..c06f87394 100644 --- a/packages/swarmplot/package.json +++ b/packages/swarmplot/package.json @@ -21,7 +21,7 @@ "swarmplot" ], "main": "./dist/nivo-swarmplot.cjs.js", - "module": "./dist/nivo-swarmplot.es.js", + "module": "./dist/nivo-swarmplot.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -50,5 +50,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-swarmplot.mjs", + "require": "./dist/nivo-swarmplot.cjs.js" + } } } diff --git a/packages/text/package.json b/packages/text/package.json index 5ea810d90..3418d9e47 100644 --- a/packages/text/package.json +++ b/packages/text/package.json @@ -13,7 +13,7 @@ }, "sideEffects": false, "main": "./dist/nivo-text.cjs.js", - "module": "./dist/nivo-text.es.js", + "module": "./dist/nivo-text.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -30,5 +30,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-text.mjs", + "require": "./dist/nivo-text.cjs.js" + } } } diff --git a/packages/tooltip/package.json b/packages/tooltip/package.json index 66a65db58..e072c0bc7 100644 --- a/packages/tooltip/package.json +++ b/packages/tooltip/package.json @@ -12,7 +12,7 @@ "directory": "packages/tooltip" }, "main": "./dist/nivo-tooltip.cjs.js", - "module": "./dist/nivo-tooltip.es.js", + "module": "./dist/nivo-tooltip.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -29,5 +29,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-tooltip.mjs", + "require": "./dist/nivo-tooltip.cjs.js" + } } } diff --git a/packages/tree/package.json b/packages/tree/package.json index ab7f5b9c2..2f7a5342a 100644 --- a/packages/tree/package.json +++ b/packages/tree/package.json @@ -21,7 +21,7 @@ "tree" ], "main": "./dist/nivo-tree.cjs.js", - "module": "./dist/nivo-tree.es.js", + "module": "./dist/nivo-tree.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -48,5 +48,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-tree.mjs", + "require": "./dist/nivo-tree.cjs.js" + } } } diff --git a/packages/treemap/package.json b/packages/treemap/package.json index 7bad62a48..785341268 100644 --- a/packages/treemap/package.json +++ b/packages/treemap/package.json @@ -20,7 +20,7 @@ "treemap-chart" ], "main": "./dist/nivo-treemap.cjs.js", - "module": "./dist/nivo-treemap.es.js", + "module": "./dist/nivo-treemap.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -42,5 +42,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-treemap.mjs", + "require": "./dist/nivo-treemap.cjs.js" + } } } diff --git a/packages/voronoi/package.json b/packages/voronoi/package.json index 5b0a29004..0c383a790 100644 --- a/packages/voronoi/package.json +++ b/packages/voronoi/package.json @@ -20,7 +20,7 @@ "voronoi" ], "main": "./dist/nivo-voronoi.cjs.js", - "module": "./dist/nivo-voronoi.es.js", + "module": "./dist/nivo-voronoi.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -41,5 +41,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-voronoi.mjs", + "require": "./dist/nivo-voronoi.cjs.js" + } } } diff --git a/packages/waffle/package.json b/packages/waffle/package.json index 0d0da134b..cb65bac80 100644 --- a/packages/waffle/package.json +++ b/packages/waffle/package.json @@ -21,7 +21,7 @@ ], "sideEffects": false, "main": "./dist/nivo-waffle.cjs.js", - "module": "./dist/nivo-waffle.es.js", + "module": "./dist/nivo-waffle.mjs", "types": "./dist/types/index.d.ts", "files": [ "README.md", @@ -45,5 +45,12 @@ }, "publishConfig": { "access": "public" + }, + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/nivo-waffle.mjs", + "require": "./dist/nivo-waffle.cjs.js" + } } }