Skip to content

Commit 20b2da5

Browse files
committed
Modification - Build - Implement treeshaking #252
1 parent 4bbf070 commit 20b2da5

File tree

146 files changed

+1703
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+1703
-475
lines changed

TestingArena/ArenaVueUiSparkbar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ const showTitleSlot = ref(false);
230230
</div>
231231
</template>
232232

233-
<template #data-label="{ bar }">
233+
<!-- <template #data-label="{ bar }">
234234
<div style="width:100%">
235235
{{ bar.name }}: {{ bar.valueLabel }} to {{ bar.targetLabel }}
236236
</div>
237-
</template>
237+
</template> -->
238238
</VueUiSparkbar>
239239
</template>
240240

@@ -247,11 +247,11 @@ const showTitleSlot = ref(false);
247247
</div>
248248
</template>
249249

250-
<template #data-label="{ bar }">
250+
<!-- <template #data-label="{ bar }">
251251
<div style="width:100%">
252252
{{ bar.name }}: {{ bar.valueLabel }} to {{ bar.targetLabel }}
253253
</div>
254-
</template>
254+
</template> -->
255255
</VueDataUi>
256256
</template>
257257

TestingArena/ArenaVueUiWheel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function alterDataset() {
4444
4545
const model = ref([
4646
{ key: 'debug', def: true, type: 'checkbox'},
47-
{ key: 'loading', def: true, type: 'checkbox'},
47+
{ key: 'loading', def: false, type: 'checkbox'},
4848
{ key: 'responsive', def: false, type: 'checkbox'},
4949
{ key: 'userOptions.show', def: true, type: 'checkbox'},
5050
{ key: 'userOptions.buttons.pdf', def: true, type: 'checkbox'},

TestingArena/ArenaVueUiXy.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import Box from "./Box.vue";
66
import convertArrayToObject from "./convertModel";
77
import { useArena } from "../src/useArena";
88
9+
const xyLoader = () => import('vue-data-ui/vue-ui-xy')
10+
911
const { local, build, vduiLocal, vduiBuild, toggleTable, toggleLabels, toggleStack } = useArena()
1012
1113
const dates = [
@@ -1398,7 +1400,7 @@ onMounted(async () => {
13981400
</template>
13991401

14001402
<template #VDUI-local>
1401-
<LocalVueDataUi component="VueUiXy" :dataset="isPropsToggled ? alternateDataset : dataset"
1403+
<LocalVueDataUi :loader="xyLoader" :dataset="isPropsToggled ? alternateDataset : dataset"
14021404
:config="isPropsToggled ? alternateConfig : config" :key="`VDUI-lodal_${step}`"
14031405
:selectedXIndex="selectedIndex"
14041406
@selectLegend="selectLegend" @selectX="selectX" ref="vduiLocal">
@@ -1494,7 +1496,7 @@ onMounted(async () => {
14941496
</template>
14951497

14961498
<template #VDUI-build>
1497-
<VueDataUi component="VueUiXy" :dataset="isPropsToggled ? alternateDataset : dataset" :config="isPropsToggled ? alternateConfig : config" :key="`VDUI-build_${step}`"
1499+
<VueDataUi :loader="xyLoader" :dataset="isPropsToggled ? alternateDataset : dataset" :config="isPropsToggled ? alternateConfig : config" :key="`VDUI-build_${step}`"
14981500
@selectLegend="selectLegend" @selectX="selectX" ref="vduiBuild">
14991501
<template #time-label="{x, y, fontSize, fill, transform, absoluteIndex, content, textAnchor }">
15001502
<g @click="() => selectTimeLabel({x, y, fontSize, absoluteIndex })">

copy-types.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fs.readdirSync(typesDir).forEach((file) => {
2727
const distFile = path.join(distTypesDir, file);
2828

2929
fs.copyFileSync(srcFile, distFile);
30-
fs.copyFileSync(srcFile, distFile.replace(/\.d\.ts$/, ".d.cts"));
30+
// fs.copyFileSync(srcFile, distFile.replace(/\.d\.ts$/, ".d.cts"));
3131
});
3232

3333
console.log("Types copied successfully.");

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,25 @@
6464
],
6565
"exports": {
6666
".": {
67-
"import": {
68-
"types": "./dist/types/vue-data-ui.d.ts",
69-
"default": "./dist/vue-data-ui.js"
70-
},
71-
"default": {
72-
"types": "./dist/types/vue-data-ui.d.cts",
73-
"default": "./dist/vue-data-ui.cjs"
74-
}
67+
"types": "./dist/types/vue-data-ui.d.ts",
68+
"import": "./dist/vue-data-ui.js",
69+
"default": "./dist/vue-data-ui.js"
70+
},
71+
"./*": {
72+
"types": "./dist/types/*.d.ts",
73+
"import": "./dist/components/*.js",
74+
"default": "./dist/components/*.js"
75+
},
76+
"./universal": {
77+
"types": "./dist/types/universal.d.ts",
78+
"import": "./dist/universal.js",
79+
"default": "./dist/universal.js"
7580
},
7681
"./style.css": "./dist/style.css"
7782
},
83+
"sideEffects": [
84+
"**/*.css"
85+
],
7886
"module": "dist/vue-data-ui.js",
7987
"types": "dist/types/vue-data-ui.d.ts",
8088
"scripts": {
@@ -111,4 +119,4 @@
111119
"vitest": "^3.2.4",
112120
"vue": "^3.5.21"
113121
}
114-
}
122+
}

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const mapping = ref({
127127
})
128128
129129
const options = computed(() => Object.keys(mapping.value));
130-
const selectedComponent = ref('VueUiDashboard');
130+
const selectedComponent = ref('VueUiXy');
131131
132132
/**
133133
* Legacy testing arena where some non chart components can be tested
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
export const fallbackLoaders = {
2+
VueUi3dBar: () => import('./vue-ui-3d-bar.vue'),
3+
VueUiAgePyramid: () => import('./vue-ui-age-pyramid.vue'),
4+
VueUiAnnotator: () => import('./vue-ui-annotator.vue'),
5+
VueUiCandlestick: () => import('./vue-ui-candlestick.vue'),
6+
VueUiChestnut: () => import('./vue-ui-chestnut.vue'),
7+
VueUiDashboard: () => import('./vue-ui-dashboard.vue'),
8+
VueUiDigits: () => import('./vue-ui-digits.vue'),
9+
VueUiDonut: () => import('./vue-ui-donut.vue'),
10+
VueUiDonutEvolution: () => import('./vue-ui-donut-evolution.vue'),
11+
VueUiGalaxy: () => import('./vue-ui-galaxy.vue'),
12+
VueUiGauge: () => import('./vue-ui-gauge.vue'),
13+
VueUiHeatmap: () => import('./vue-ui-heatmap.vue'),
14+
VueUiKpi: () => import('./vue-ui-kpi.vue'),
15+
VueUiMiniLoader: () => import('./vue-ui-mini-loader.vue'),
16+
VueUiMolecule: () => import('./vue-ui-molecule.vue'),
17+
VueUiMoodRadar: () => import('./vue-ui-mood-radar.vue'),
18+
VueUiNestedDonuts: () => import('./vue-ui-nested-donuts.vue'),
19+
VueUiOnion: () => import('./vue-ui-onion.vue'),
20+
VueUiQuadrant: () => import('./vue-ui-quadrant.vue'),
21+
VueUiRadar: () => import('./vue-ui-radar.vue'),
22+
VueUiRating: () => import('./vue-ui-rating.vue'),
23+
VueUiRelationCircle: () => import('./vue-ui-relation-circle.vue'),
24+
VueUiRings: () => import('./vue-ui-rings.vue'),
25+
VueUiScatter: () => import('./vue-ui-scatter.vue'),
26+
VueUiSkeleton: () => import('./vue-ui-skeleton.vue'),
27+
VueUiSmiley: () => import('./vue-ui-smiley.vue'),
28+
VueUiSparkbar: () => import('./vue-ui-sparkbar.vue'),
29+
VueUiSparkgauge: () => import('./vue-ui-sparkgauge.vue'),
30+
VueUiSparkHistogram: () => import('./vue-ui-sparkhistogram.vue'),
31+
VueUiSparkline: () => import('./vue-ui-sparkline.vue'),
32+
VueUiSparkStackbar: () => import('./vue-ui-sparkstackbar.vue'),
33+
VueUiTable: () => import('./vue-ui-table.vue'),
34+
VueUiTableSparkline: () => import('./vue-ui-table-sparkline.vue'),
35+
VueUiThermometer: () => import('./vue-ui-thermometer.vue'),
36+
VueUiTiremarks: () => import('./vue-ui-tiremarks.vue'),
37+
VueUiTreemap: () => import('./vue-ui-treemap.vue'),
38+
VueUiVerticalBar: () => import('./vue-ui-vertical-bar.vue'), // delete in v4
39+
VueUiHorizontalBar: () => import('./vue-ui-vertical-bar.vue'), // v3 renaming
40+
VueUiWaffle: () => import('./vue-ui-waffle.vue'),
41+
VueUiWheel: () => import('./vue-ui-wheel.vue'),
42+
VueUiXy: () => import('./vue-ui-xy.vue'),
43+
VueUiTableHeatmap: () => import('./vue-ui-table-heatmap.vue'),
44+
VueUiAccordion: () => import('./vue-ui-accordion.vue'),
45+
VueUiQuickChart: () => import('./vue-ui-quick-chart.vue'),
46+
VueUiCursor: () => import('./vue-ui-cursor.vue'),
47+
VueUiSparkTrend: () => import('./vue-ui-spark-trend.vue'),
48+
VueUiStripPlot: () => import('./vue-ui-strip-plot.vue'),
49+
VueUiDumbbell: () => import('./vue-ui-dumbbell.vue'),
50+
VueUiWordCloud: () => import('./vue-ui-word-cloud.vue'),
51+
VueUiXyCanvas: () => import('./vue-ui-xy-canvas.vue'),
52+
VueUiFlow: () => import('./vue-ui-flow.vue'),
53+
VueUiParallelCoordinatePlot: () => import('./vue-ui-parallel-coordinate-plot.vue'),
54+
VueUiTimer: () => import('./vue-ui-timer.vue'),
55+
VueUiCarouselTable: () => import('./vue-ui-carousel-table.vue'),
56+
VueUiGizmo: () => import('./vue-ui-gizmo.vue'),
57+
VueUiStackbar: () => import('./vue-ui-stackbar.vue'),
58+
VueUiBullet: () => import('./vue-ui-bullet.vue'),
59+
VueUiFunnel: () => import('./vue-ui-funnel.vue'),
60+
VueUiHistoryPlot: () => import('./vue-ui-history-plot.vue'),
61+
VueUiCirclePack: () => import('./vue-ui-circle-pack.vue'),
62+
VueUiWorld: () => import('./vue-ui-world.vue'),
63+
VueUiRidgeline: () => import('./vue-ui-ridgeline.vue'),
64+
VueUiChord: () => import('./vue-ui-chord.vue'),
65+
};
66+
67+
export const supportedNames = Object.keys(fallbackLoaders);

0 commit comments

Comments
 (0)