Skip to content

Commit baace1b

Browse files
committed
treeshake unovis, drop CurveType enum
1 parent 575af04 commit baace1b

File tree

8 files changed

+35
-16
lines changed

8 files changed

+35
-16
lines changed

app/components/validator/LayoutDashboard.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import type { FetchedValidatorDetails } from '~~/server/utils/validators'
3-
import { CurveType } from 'vue-chrts'
43
54
const props = defineProps<{ validator: FetchedValidatorDetails }>()
65
const validatorRef = computed(() => props.validator)
@@ -68,7 +67,7 @@ const donutCategories = { 0: { name: 'Availability', color: 'var(--nq-blue)' },
6867
<AreaChart
6968
:data="scoreTrendData" :height="200" :categories="scoreCategories"
7069
:x-formatter="(t: number) => `E${t}`" :y-formatter="(t: number) => `${Math.round(t * 100)}`"
71-
:y-domain="[0, 1]" hide-legend :curve-type="CurveType.MonotoneX"
70+
:y-domain="[0, 1]" hide-legend curve-type="monotoneX"
7271
/>
7372
</div>
7473
</div>
@@ -88,7 +87,7 @@ const donutCategories = { 0: { name: 'Availability', color: 'var(--nq-blue)' },
8887
<LineChart
8988
:data="balanceData" :height="200" :categories="balanceCategories"
9089
:x-formatter="(t: number) => `E${t}`" :y-formatter="(t: number) => formatLunaAsNim(t * 1e5)"
91-
hide-legend :curve-type="CurveType.MonotoneX"
90+
hide-legend curve-type="monotoneX"
9291
/>
9392
</div>
9493
</div>

app/components/validator/LayoutDeepDive.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import type { FetchedValidatorDetails } from '~~/server/utils/validators'
3-
import { CurveType } from 'vue-chrts'
43
54
const props = defineProps<{ validator: FetchedValidatorDetails }>()
65
const validatorRef = computed(() => props.validator)
@@ -45,7 +44,7 @@ const dualLineCategories = { score: { name: 'Score', color: 'var(--nq-green)' }
4544
<AreaChart
4645
:data="scoreTrendAllData" :height="280" :categories="allScoreCategories"
4746
:x-formatter="(t: number) => `E${t}`" :y-formatter="(t: number) => `${Math.round(t * 100)}`"
48-
:y-domain="[0, 1]" :curve-type="CurveType.MonotoneX"
47+
:y-domain="[0, 1]" curve-type="monotoneX"
4948
/>
5049
</div>
5150

@@ -66,7 +65,7 @@ const dualLineCategories = { score: { name: 'Score', color: 'var(--nq-green)' }
6665
<span nq-label text="11 neutral-800" mb-8 block>Stakers</span>
6766
<LineChart
6867
:data="stakersData" :height="200" :categories="stakersCategories"
69-
:x-formatter="(t: number) => `E${t}`" hide-legend :curve-type="CurveType.MonotoneX"
68+
:x-formatter="(t: number) => `E${t}`" hide-legend curve-type="monotoneX"
7069
/>
7170
</div>
7271
<div flex="~ col gap-16">

app/components/validator/LayoutProfile.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import type { FetchedValidatorDetails } from '~~/server/utils/validators'
3-
import { CurveType } from 'vue-chrts'
43
54
const props = defineProps<{ validator: FetchedValidatorDetails }>()
65
const validatorRef = computed(() => props.validator)
@@ -54,7 +53,7 @@ const stakersCategories = { stakers: { name: 'Stakers', color: 'var(--nq-blue)'
5453
<AreaChart
5554
:data="scoreTrendData" :height="200" :categories="scoreCategories"
5655
:x-formatter="(t: number) => `E${t}`" :y-formatter="(t: number) => `${Math.round(t * 100)}`"
57-
:y-domain="[0, 1]" hide-legend :curve-type="CurveType.MonotoneX"
56+
:y-domain="[0, 1]" hide-legend curve-type="monotoneX"
5857
/>
5958
</div>
6059

@@ -88,15 +87,15 @@ const stakersCategories = { stakers: { name: 'Stakers', color: 'var(--nq-blue)'
8887
<LineChart
8988
:data="balanceData" :height="140" :categories="balanceCategories"
9089
:x-formatter="(t: number) => `E${t}`" :y-formatter="(t: number) => formatLunaAsNim(t * 1e5)"
91-
hide-legend :curve-type="CurveType.MonotoneX"
90+
hide-legend curve-type="monotoneX"
9291
/>
9392
</div>
9493

9594
<!-- Stakers chart -->
9695
<div bg-neutral-0 outline="~ 1.5 neutral/6" rounded-8 shadow f-p-md>
9796
<LineChart
9897
:data="stakersData" :height="140" :categories="stakersCategories"
99-
:x-formatter="(t: number) => `E${t}`" hide-legend :curve-type="CurveType.MonotoneX"
98+
:x-formatter="(t: number) => `E${t}`" hide-legend curve-type="monotoneX"
10099
/>
101100
</div>
102101

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default defineNuxtConfig({
157157
},
158158

159159
externals: {
160-
external: ['ws'],
160+
external: ['ws', '@unovis/ts', '@unovis/vue', 'vue-chrts', 'elkjs'],
161161
},
162162
},
163163

patches/@unovis__ts@1.5.2.patch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/index.js b/index.js
2+
index ef97708ce987e88d6db1189a2f735110fe04f6f6..f94a95101593cc1e05fb74e43b80ad6228b80cfd 100644
3+
--- a/index.js
4+
+++ b/index.js
5+
@@ -1,10 +1,5 @@
6+
-import './containers.js';
7+
-import './components.js';
8+
-import './data-models/index.js';
9+
-import './types.js';
10+
export { colors, colorsDark, getCSSColorVariable, getDarkerColor, getLighterColor } from './styles/colors.js';
11+
export { styleExtraLargeSize, styleLargeSize } from './styles/sizes.js';
12+
-import './utils/index.js';
13+
export { ContainerCore } from './core/container/index.js';
14+
export { SingleContainer } from './containers/single-container/index.js';
15+
export { XYContainer } from './containers/xy-container/index.js';

pnpm-lock.yaml

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
packages:
22
- packages/**
33

4+
patchedDependencies:
5+
'@unovis/ts@1.5.2': patches/@unovis__ts@1.5.2.patch
46
catalog:
57
'@antfu/eslint-config': ^4.19.0
68
'@antfu/ni': ^25.0.0

0 commit comments

Comments
 (0)