Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Vite integration #495

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,418 changes: 1,229 additions & 1,189 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/dev/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/solid/licences.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rollup perpetual MIT 4.24.2 Rich Harri
solid-js perpetual MIT 1.9.3 Ryan Carniato
tsx perpetual MIT 4.19.2 Hiroki Osame hiroki.osame@gmail.com
typescript perpetual Apache-2.0 5.6.3 Microsoft Corp.
vite perpetual MIT 5.4.11 Evan You
vite perpetual MIT 6.2.1 Evan You
vite-plugin-dts perpetual MIT 3.6.0 qmhc
vite-plugin-solid perpetual MIT 2.10.2 Alexandre Mouton-Brady <amoutonbrady@gmail.com>
solid-js perpetual MIT 1.9.3 Ryan Carniato
2 changes: 1 addition & 1 deletion packages/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"solid-js": "^1.9.3",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vite": "^6.2.1",
"vite-plugin-dts": "^3.5.3",
"vite-plugin-solid": "^2.10.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ts/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
declare module '*.css';
declare module '*.css?inline';
declare module 'd3-geo-projection'
declare module 'd3-interpolate-path'
84 changes: 38 additions & 46 deletions packages/ts/licences.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
name license period license type installed version author
---- -------------- ------------ ----------------- ------
@emotion/css perpetual MIT 11.10.5 Kye Hohenberger
@juggle/resize-observer perpetual Apache-2.0 3.3.1 Juggle
@types/d3 perpetual MIT 7.4.0 n/a
@types/d3-collection perpetual MIT 1.0.10 n/a
@types/d3-sankey perpetual MIT 0.11.2 n/a
@types/dagre perpetual MIT 0.7.50 n/a
@types/geojson perpetual MIT 7946.0.8 n/a
@types/leaflet perpetual MIT 1.7.6 n/a
@types/supercluster perpetual MIT 5.0.2 n/a
@types/three perpetual MIT 0.135.0 n/a
@types/throttle-debounce perpetual MIT 5.0.0 n/a
@types/topojson perpetual MIT 3.2.3 n/a
@types/topojson-client perpetual MIT 3.1.0 n/a
@types/topojson-specification perpetual MIT 1.0.2 n/a
@unovis/dagre-layout perpetual MIT 0.8.8-2 Nikita Rokotyan (nikita@f5.com)
@unovis/graphlibrary perpetual MIT 2.2.0-2 Nikita Rokotyan (nikita@f5.com)
d3 perpetual ISC 7.2.1 Mike Bostock https://bost.ocks.org/mike
d3-collection perpetual BSD-3-Clause 1.0.7 Mike Bostock http://bost.ocks.org/mike
d3-geo-projection perpetual ISC 4.0.0 Mike Bostock https://bost.ocks.org/mike
d3-interpolate-path perpetual BSD-3-Clause 2.2.3 Peter Beshai <peter.beshai@gmail.com> (http://github.com/pbeshai)
d3-sankey perpetual BSD-3-Clause 0.12.3 Mike Bostock https://bost.ocks.org/mike/
elkjs perpetual EPL-2.0 0.8.2 Ulf Rüegg uruurumail@gmail.com
geojson perpetual MIT 0.5.0 Casey Cesari
leaflet perpetual BSD-2-Clause 1.7.1 n/a
maplibre-gl perpetual BSD-3-Clause 2.1.9 n/a
striptags perpetual MIT 3.2.0 Eric Norris (https://github.com/ericnorris)
supercluster perpetual ISC 7.1.5 Vladimir Agafonkin
three perpetual MIT 0.135.0 mrdoob
throttle-debounce perpetual MIT 5.0.0 Ivan Nikolić <niksy5@gmail.com> (http://ivannikolic.com)
to-px perpetual MIT 1.1.0 Mikola Lysenko
topojson-client perpetual ISC 3.1.0 Mike Bostock https://bost.ocks.org/mike
tslib perpetual 0BSD 2.4.1 Microsoft Corp.
@rollup/plugin-json perpetual MIT 4.1.0 rollup
@types/to-px perpetual MIT 1.1.2 n/a
@zerollup/ts-transform-paths perpetual MIT 1.7.18 Stefan Zerkalica zerkalica@gmail.com
rimraf perpetual ISC 3.0.2 Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
rollup perpetual MIT 2.79.2 Rich Harris
rollup-plugin-commonjs perpetual MIT 10.1.0 Rich Harris
rollup-plugin-node-resolve perpetual MIT 5.2.0 Rich Harris <richard.a.harris@gmail.com>
rollup-plugin-postcss perpetual MIT 4.0.2 EGOIST <0x142857@gmail.com>
rollup-plugin-rename-node-modules perpetual MIT 1.3.1 Lazyuki
rollup-plugin-terser perpetual MIT 7.0.2 Bogdan Chadkin <trysound@yandex.ru>
rollup-plugin-typescript2 perpetual MIT 0.31.2 @ezolenko
rollup-plugin-visualizer perpetual MIT 4.2.2 Denis Bardadym <bardadymchik@gmail.com>
name license period license type installed version author
---- -------------- ------------ ----------------- ------
@emotion/css perpetual MIT 11.10.5 Kye Hohenberger
@juggle/resize-observer perpetual Apache-2.0 3.3.1 Juggle
@types/d3 perpetual MIT 7.4.0 n/a
@types/d3-collection perpetual MIT 1.0.10 n/a
@types/d3-sankey perpetual MIT 0.11.2 n/a
@types/dagre perpetual MIT 0.7.50 n/a
@types/geojson perpetual MIT 7946.0.8 n/a
@types/leaflet perpetual MIT 1.7.6 n/a
@types/supercluster perpetual MIT 5.0.2 n/a
@types/three perpetual MIT 0.135.0 n/a
@types/throttle-debounce perpetual MIT 5.0.0 n/a
@types/topojson perpetual MIT 3.2.3 n/a
@types/topojson-client perpetual MIT 3.1.0 n/a
@types/topojson-specification perpetual MIT 1.0.2 n/a
@unovis/dagre-layout perpetual MIT 0.8.8-2 Nikita Rokotyan (nikita@f5.com)
@unovis/graphlibrary perpetual MIT 2.2.0-2 Nikita Rokotyan (nikita@f5.com)
d3 perpetual ISC 7.2.1 Mike Bostock https://bost.ocks.org/mike
d3-collection perpetual BSD-3-Clause 1.0.7 Mike Bostock http://bost.ocks.org/mike
d3-geo-projection perpetual ISC 4.0.0 Mike Bostock https://bost.ocks.org/mike
d3-interpolate-path perpetual BSD-3-Clause 2.2.3 Peter Beshai <peter.beshai@gmail.com> (http://github.com/pbeshai)
d3-sankey perpetual BSD-3-Clause 0.12.3 Mike Bostock https://bost.ocks.org/mike/
elkjs perpetual EPL-2.0 0.8.2 Ulf Rüegg uruurumail@gmail.com
geojson perpetual MIT 0.5.0 Casey Cesari
leaflet perpetual BSD-2-Clause 1.7.1 n/a
maplibre-gl perpetual BSD-3-Clause 2.1.9 n/a
striptags perpetual MIT 3.2.0 Eric Norris (https://github.com/ericnorris)
supercluster perpetual ISC 7.1.5 Vladimir Agafonkin
three perpetual MIT 0.135.0 mrdoob
throttle-debounce perpetual MIT 5.0.0 Ivan Nikolić <niksy5@gmail.com> (http://ivannikolic.com)
to-px perpetual MIT 1.1.0 Mikola Lysenko
topojson-client perpetual ISC 3.1.0 Mike Bostock https://bost.ocks.org/mike
tslib perpetual 0BSD 2.4.1 Microsoft Corp.
@types/to-px perpetual MIT 1.1.2 n/a
lightningcss perpetual MPL-2.0 1.29.2 n/a
vite perpetual MIT 6.2.1 Evan You
vite-plugin-dts perpetual MIT 3.6.0 qmhc
19 changes: 6 additions & 13 deletions packages/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,15 @@
],
"scripts": {
"build": "sha=$(tar cf - ./src | shasum); if [[ $(echo $sha) == $(< .srcsha) ]] && [[ -d \"./lib\" ]]; then echo \"Lib Build Exists\"; else npm run forcebuild; echo $sha > .srcsha; fi",
"forcebuild": "rimraf lib; rollup -c",
"publish:dist": "rm -rf lib/.cache; cp ./{LICENSE,README.md,package.json} ./lib; cd ./lib; npm publish"
"forcebuild": "vite build",
"publish:dist": "rm -rf lib/.cache; cp ./{LICENSE,README.md,package.json} ./lib; cd ./lib; npm publish",
"type:check": "tsc --noEmit"
},
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@types/to-px": "^1.1.2",
"@zerollup/ts-transform-paths": "^1.7.18",
"rimraf": "^3.0.2",
"rollup": "^2.61.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^4.0.1",
"rollup-plugin-rename-node-modules": "^1.3.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.1",
"rollup-plugin-visualizer": "^4.2.2"
"lightningcss": "^1.28.2",
"vite": "^6.2.1",
"vite-plugin-dts": "^3.5.3"
},
"dependencies": {
"@emotion/css": "^11.7.1",
Expand Down
71 changes: 0 additions & 71 deletions packages/ts/rollup.config.js

This file was deleted.

12 changes: 6 additions & 6 deletions packages/ts/src/components.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Core
export { ComponentCore } from 'core/component'
export type { ComponentConfigInterface } from 'core/component/config'
export { XYComponentCore } from 'core/xy-component'
export type { XYComponentConfigInterface } from 'core/xy-component/config'
export { ComponentCore } from '@/core/component'
export type { ComponentConfigInterface } from '@/core/component/config'
export { XYComponentCore } from '@/core/xy-component'
export type { XYComponentConfigInterface } from '@/core/xy-component/config'

// Components
export { Tooltip } from 'components/tooltip'
export { Tooltip } from '@/components/tooltip'
export { Line } from './components/line'
export { StackedBar } from './components/stacked-bar'
export { GroupedBar } from './components/grouped-bar'
Expand All @@ -29,7 +29,7 @@ export { Donut } from './components/donut'
export { FreeBrush } from './components/free-brush'
export { XYLabels } from './components/xy-labels'
export { NestedDonut } from './components/nested-donut'
export { Annotations } from 'components/annotations'
export { Annotations } from '@/components/annotations'

// Constants
export * from './components/donut/constants'
Expand Down
2 changes: 1 addition & 1 deletion packages/ts/src/components/annotations/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'
import { ComponentConfigInterface, ComponentDefaultConfig } from '@/core/component/config'

// Types
import { AnnotationItem } from './types'
Expand Down
12 changes: 6 additions & 6 deletions packages/ts/src/components/annotations/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { select, Selection } from 'd3-selection'

// Core
import { ComponentCore } from 'core/component'
import { ComponentCore } from '@/core/component'

// Utils
import { isNumber } from 'utils/data'
import { smartTransition } from 'utils/d3'
import { renderTextIntoFrame } from 'utils/text'
import { parseUnit } from 'utils/misc'
import { UNOVIS_TEXT_DEFAULT } from 'styles'
import { isNumber } from '@/utils/data'
import { smartTransition } from '@/utils/d3'
import { renderTextIntoFrame } from '@/utils/text'
import { parseUnit } from '@/utils/misc'
import { UNOVIS_TEXT_DEFAULT } from '@/styles'

// Local Types
import { AnnotationItem, AnnotationSubject } from './types'
Expand Down
2 changes: 1 addition & 1 deletion packages/ts/src/components/annotations/style.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from '@emotion/css'

// Utils
import { getCssVarNames, injectGlobalCssVariables } from 'utils/style'
import { getCssVarNames, injectGlobalCssVariables } from '@/utils/style'

const cssVarDefaults = {
'--vis-annotations-text-color': '#282C34',
Expand Down
5 changes: 2 additions & 3 deletions packages/ts/src/components/annotations/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LengthUnit } from 'types/misc'
import { UnovisText, UnovisTextOptions } from 'types/text'
import { LengthUnit } from '@/types/misc'
import { UnovisText, UnovisTextOptions } from '@/types/text'


export type AnnotationItem = Omit<UnovisTextOptions, 'x'|'y'|'width'> & {
Expand Down Expand Up @@ -35,4 +35,3 @@ export type AnnotationSubjectStyle = {
}

export type AnnotationSubject = AnnotationSubjectStyle & AnnotationSubjectLocationXY

6 changes: 3 additions & 3 deletions packages/ts/src/components/area/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'
import { XYComponentConfigInterface, XYComponentDefaultConfig } from '@/core/xy-component/config'

// Types
import { CurveType } from 'types/curve'
import { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'
import { CurveType } from '@/types/curve'
import { ColorAccessor, NumericAccessor, StringAccessor } from '@/types/accessor'

export interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
/** Area color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */
Expand Down
12 changes: 6 additions & 6 deletions packages/ts/src/components/area/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { area, Area as AreaInterface } from 'd3-shape'
import { interpolatePath } from 'd3-interpolate-path'

// Core
import { XYComponentCore } from 'core/xy-component'
import { XYComponentCore } from '@/core/xy-component'

// Utils
import { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange } from 'utils/data'
import { smartTransition } from 'utils/d3'
import { getColor } from 'utils/color'
import { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange } from '@/utils/data'
import { smartTransition } from '@/utils/d3'
import { getColor } from '@/utils/color'

// Types
import { Curve, CurveType } from 'types/curve'
import { NumericAccessor } from 'types/accessor'
import { Curve, CurveType } from '@/types/curve'
import { NumericAccessor } from '@/types/accessor'

// Local Types
import { AreaDatum } from './types'
Expand Down
8 changes: 4 additions & 4 deletions packages/ts/src/components/axis/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'
import { XYComponentConfigInterface, XYComponentDefaultConfig } from '@/core/xy-component/config'

// Types
import { AxisType } from 'components/axis/types'
import { Position } from 'types/position'
import { FitMode, TrimMode, TextAlign } from 'types/text'
import { AxisType } from '@/components/axis/types'
import { Position } from '@/types/position'
import { FitMode, TrimMode, TextAlign } from '@/types/text'

// We extend partial XY config interface because x and y properties are optional for Axis
export interface AxisConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {
Expand Down
18 changes: 9 additions & 9 deletions packages/ts/src/components/axis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { interrupt } from 'd3-transition'
import { Axis as D3Axis, axisBottom, axisLeft, axisRight, axisTop } from 'd3-axis'

// Core
import { XYComponentCore } from 'core/xy-component'
import { XYComponentCore } from '@/core/xy-component'

// Types
import { Position } from 'types/position'
import { ContinuousScale } from 'types/scale'
import { Spacing } from 'types/spacing'
import { FitMode, TextAlign, TrimMode, UnovisText, UnovisTextOptions, VerticalAlign } from 'types/text'
import { Position } from '@/types/position'
import { ContinuousScale } from '@/types/scale'
import { Spacing } from '@/types/spacing'
import { FitMode, TextAlign, TrimMode, UnovisText, UnovisTextOptions, VerticalAlign } from '@/types/text'

// Utils
import { smartTransition } from 'utils/d3'
import { renderTextToSvgTextElement, trimSVGText } from 'utils/text'
import { isEqual } from 'utils/data'
import { rectIntersect } from 'utils/misc'
import { smartTransition } from '@/utils/d3'
import { renderTextToSvgTextElement, trimSVGText } from '@/utils/text'
import { isEqual } from '@/utils/data'
import { rectIntersect } from '@/utils/misc'

// Local Types
import { AxisType } from './types'
Expand Down
4 changes: 2 additions & 2 deletions packages/ts/src/components/brush/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { D3BrushEvent } from 'd3-brush'
import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'
import { XYComponentConfigInterface, XYComponentDefaultConfig } from '@/core/xy-component/config'

// Types
import { Arrangement } from 'types/position'
import { Arrangement } from '@/types/position'

// We extend partial XY config interface because x and y properties are optional for Brush
export interface BrushConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {
Expand Down
Loading