Skip to content

Commit 8cb7b06

Browse files
authored
Merge branch 'main' into feat/flag-git-https-dependencies
2 parents 5d5cecc + 31db8f8 commit 8cb7b06

File tree

166 files changed

+5508
-3196
lines changed

Some content is hidden

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

166 files changed

+5508
-3196
lines changed

.storybook/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const config = {
88
features: {
99
backgrounds: false,
1010
},
11-
async viteFinal(config) {
12-
config.plugins ??= []
11+
async viteFinal(newConfig) {
12+
newConfig.plugins ??= []
1313

14-
config.plugins.push({
14+
newConfig.plugins.push({
1515
name: 'ignore-internals',
1616
transform(_, id) {
1717
if (id.includes('/app/pages/blog/') && id.endsWith('.md')) {
@@ -23,7 +23,7 @@ const config = {
2323
// vue-docgen-api can crash on components that import types from other
2424
// .vue files (it tries to parse the SFC with @babel/parser as plain TS).
2525
// This wrapper catches those errors so the build doesn't fail.
26-
const docgenPlugin = config.plugins?.find(
26+
const docgenPlugin = newConfig.plugins?.find(
2727
(p): p is Extract<typeof p, { name: string }> =>
2828
!!p && typeof p === 'object' && 'name' in p && p.name === 'storybook:vue-docgen-plugin',
2929
)
@@ -48,7 +48,7 @@ const config = {
4848
}
4949
}
5050

51-
return config
51+
return newConfig
5252
},
5353
} satisfies StorybookConfig
5454

app/assets/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
--badge-blue: oklch(0.579 0.191 252);
116116
--badge-yellow: oklch(0.588 0.183 91);
117-
--badge-green: oklch(0.566 0.202 165);
117+
--badge-green: oklch(0.49 0.15 161.08);
118118
--badge-indigo: oklch(0.457 0.24 277.023);
119119
--badge-purple: oklch(0.495 0.172 295);
120120
--badge-orange: oklch(0.67 0.185 55);

app/components/Alert.vue

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<script setup lang="ts">
2+
interface Props {
3+
variant: 'warning' | 'error'
4+
title?: string
5+
}
6+
7+
defineProps<Props>()
8+
9+
const WRAPPER_CLASSES: Record<Props['variant'], string> = {
10+
warning: 'border-amber-400/20 bg-amber-500/8',
11+
error: 'border-red-400/20 bg-red-500/8',
12+
}
13+
14+
const TITLE_CLASSES: Record<Props['variant'], string> = {
15+
warning: 'text-amber-800 dark:text-amber-300',
16+
error: 'text-red-800 dark:text-red-300',
17+
}
18+
19+
const BODY_CLASSES: Record<Props['variant'], string> = {
20+
warning: 'text-amber-700 dark:text-amber-400',
21+
error: 'text-red-700 dark:text-red-400',
22+
}
23+
24+
const ROLES: Record<Props['variant'], 'status' | 'alert'> = {
25+
warning: 'status',
26+
error: 'alert',
27+
}
28+
</script>
29+
30+
<template>
31+
<div
32+
:role="ROLES[variant]"
33+
class="border rounded-md px-3 py-2.5"
34+
:class="WRAPPER_CLASSES[variant]"
35+
>
36+
<p v-if="title" class="font-semibold mb-1" :class="TITLE_CLASSES[variant]">{{ title }}</p>
37+
<div class="text-xs" :class="BODY_CLASSES[variant]">
38+
<slot />
39+
</div>
40+
</div>
41+
</template>

app/components/AppFooter.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,21 @@ const closeModal = () => modalRef.value?.close?.()
8888
</p>
8989
<ul class="mb-8 flex flex-col gap-2">
9090
<li class="flex gap-2 items-center">
91-
<kbd class="kbd">.</kbd>
92-
<span>{{ $t('shortcuts.open_code_view') }}</span>
91+
<kbd class="kbd">m</kbd>
92+
<span>{{ $t('shortcuts.open_main') }}</span>
9393
</li>
9494
<li class="flex gap-2 items-center">
9595
<kbd class="kbd">d</kbd>
9696
<span>{{ $t('shortcuts.open_docs') }}</span>
9797
</li>
98+
<li class="flex gap-2 items-center">
99+
<kbd class="kbd">.</kbd>
100+
<span>{{ $t('shortcuts.open_code_view') }}</span>
101+
</li>
102+
<li class="flex gap-2 items-center">
103+
<kbd class="kbd">f</kbd>
104+
<span>{{ $t('shortcuts.open_diff') }}</span>
105+
</li>
98106
<li class="flex gap-2 items-center">
99107
<kbd class="kbd">c</kbd>
100108
<span>{{ $t('shortcuts.compare_from_package') }}</span>

app/components/BuildEnvironment.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<script setup lang="ts">
2-
import type { BuildInfo } from '#shared/types'
3-
42
const { footer = false, buildInfo: buildInfoProp } = defineProps<{
53
footer?: boolean
64
buildInfo?: BuildInfo

app/components/Code/DirectoryListing.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import type { PackageFileTree } from '#shared/types'
32
import type { RouteLocationRaw } from 'vue-router'
43
import type { RouteNamedMap } from 'vue-router/auto-routes'
54
import { ADDITIONAL_ICONS, getFileIcon } from '~/utils/file-icons'

app/components/Code/FileTree.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import type { PackageFileTree } from '#shared/types'
32
import type { RouteLocationRaw } from 'vue-router'
43
import type { RouteNamedMap } from 'vue-router/auto-routes'
54
import { ADDITIONAL_ICONS, getFileIcon } from '~/utils/file-icons'

app/components/Code/MobileTreeDrawer.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import type { PackageFileTree } from '#shared/types'
32
import type { RouteNamedMap } from 'vue-router/auto-routes'
43
54
defineProps<{
@@ -29,7 +28,7 @@ watch(isOpen, open => (isLocked.value = open))
2928
<!-- Toggle button (mobile only) -->
3029
<ButtonBase
3130
variant="primary"
32-
class="md:hidden fixed bottom-4 inset-ie-4 z-45"
31+
class="md:hidden fixed bottom-9 inset-ie-4 z-45"
3332
:aria-label="$t('code.toggle_tree')"
3433
@click="isOpen = !isOpen"
3534
:classicon="isOpen ? 'i-lucide:x' : 'i-lucide:folder'"

app/components/Compare/ComparisonGrid.vue

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const props = defineProps<{
1717
1818
/** Total column count including the optional no-dep column */
1919
const totalColumns = computed(() => props.columns.length + (props.showNoDependency ? 1 : 0))
20+
const visibleColumns = computed(() => Math.min(totalColumns.value, 4))
2021
2122
/** Compute plain-text tooltip for a replacement column */
2223
function getReplacementTooltip(col: ComparisonGridColumn): string {
@@ -30,32 +31,43 @@ function getReplacementTooltip(col: ComparisonGridColumn): string {
3031
<div class="overflow-x-auto">
3132
<div
3233
class="comparison-grid"
33-
:class="[totalColumns === 4 ? 'min-w-[800px]' : 'min-w-[600px]', `columns-${totalColumns}`]"
34-
:style="{ '--columns': totalColumns }"
34+
:style="{
35+
'--package-count': totalColumns,
36+
'--visible-columns': visibleColumns,
37+
}"
3538
>
3639
<!-- Header row -->
3740
<div class="comparison-header">
38-
<div class="comparison-label" />
41+
<div class="comparison-label relative bg-bg" />
3942

4043
<!-- Package columns -->
41-
<div v-for="col in columns" :key="col.name" class="comparison-cell comparison-cell-header">
42-
<span class="inline-flex items-center gap-1.5 truncate">
44+
<div
45+
v-for="col in columns"
46+
:key="col.name"
47+
class="comparison-cell comparison-cell-header min-w-0"
48+
>
49+
<div class="flex items-start justify-center gap-1.5 min-w-0">
4350
<LinkBase
4451
:to="packageRoute(col.name, col.version)"
45-
class="text-sm truncate"
46-
block
52+
class="flex min-w-0 flex-col items-center text-center text-sm"
4753
:title="col.version ? `${col.name}@${col.version}` : col.name"
4854
>
49-
{{ col.name }}<template v-if="col.version">@{{ col.version }}</template>
55+
<span class="min-w-0 break-words line-clamp-1">
56+
{{ col.name }}
57+
</span>
58+
<span v-if="col.version" class="text-fg-muted line-clamp-1">
59+
@{{ col.version }}
60+
</span>
5061
</LinkBase>
62+
5163
<TooltipApp v-if="col.replacement" :text="getReplacementTooltip(col)" position="bottom">
5264
<span
53-
class="i-lucide:lightbulb w-3.5 h-3.5 text-amber-500 shrink-0 cursor-help"
65+
class="i-lucide:lightbulb mt-0.5 h-3.5 w-3.5 shrink-0 cursor-help text-amber-500"
5466
role="img"
5567
:aria-label="$t('package.replacement.title')"
5668
/>
5769
</TooltipApp>
58-
</span>
70+
</div>
5971
</div>
6072

6173
<!-- "No dep" column (always last) -->
@@ -100,29 +112,30 @@ function getReplacementTooltip(col: ComparisonGridColumn): string {
100112

101113
<style scoped>
102114
.comparison-grid {
115+
--label-column-width: 140px;
116+
--package-column-width: calc((100% - var(--label-column-width)) / var(--visible-columns));
103117
display: grid;
104118
gap: 0;
105-
}
106-
107-
.comparison-grid.columns-2 {
108-
grid-template-columns: minmax(120px, 180px) repeat(2, 1fr);
109-
}
110-
111-
.comparison-grid.columns-3 {
112-
grid-template-columns: minmax(120px, 160px) repeat(3, 1fr);
113-
}
114-
115-
.comparison-grid.columns-4 {
116-
grid-template-columns: minmax(100px, 140px) repeat(4, 1fr);
119+
grid-template-columns:
120+
var(--label-column-width)
121+
repeat(var(--package-count), minmax(var(--package-column-width), var(--package-column-width)));
117122
}
118123
119124
.comparison-header {
120125
display: contents;
121126
}
122127
123128
.comparison-header > .comparison-label {
124-
padding: 0.75rem 1rem;
125-
border-bottom: 1px solid var(--color-border);
129+
z-index: 3;
130+
}
131+
132+
.comparison-label {
133+
position: sticky;
134+
left: 0;
135+
z-index: 2;
136+
inline-size: var(--label-column-width);
137+
min-inline-size: var(--label-column-width);
138+
isolation: isolate;
126139
}
127140
128141
.comparison-header > .comparison-cell-header {

app/components/Compare/FacetBarChart.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<script setup lang="ts">
22
import { ref, computed } from 'vue'
33
import { VueUiHorizontalBar } from 'vue-data-ui/vue-ui-horizontal-bar'
4-
import type {
5-
VueUiHorizontalBarConfig,
6-
VueUiHorizontalBarDatapoint,
7-
VueUiHorizontalBarDatasetItem,
8-
} from 'vue-data-ui'
4+
import type { VueUiHorizontalBarConfig, VueUiHorizontalBarDatasetItem } from 'vue-data-ui'
95
import { getFrameworkColor, isListedFramework } from '~/utils/frameworks'
106
import { drawSmallNpmxLogoAndTaglineWatermark } from '~/composables/useChartWatermark'
117
import {
@@ -182,8 +178,8 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
182178
bold: false,
183179
color: colors.value.fg,
184180
value: {
185-
formatter: ({ config }) => {
186-
return config?.datapoint?.formattedValue ?? '0'
181+
formatter: ({ config: formatterConfig }) => {
182+
return formatterConfig?.datapoint?.formattedValue ?? '0'
187183
},
188184
},
189185
},
@@ -230,7 +226,7 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
230226
${name}
231227
</span>
232228
<span class="text-base text-[var(--fg)] font-mono tabular-nums text-end">
233-
${(datapoint as VueUiHorizontalBarDatapoint).formattedValue ?? 0}
229+
${datapoint?.formattedValue ?? 0}
234230
</span>
235231
</div>
236232
</div>

0 commit comments

Comments
 (0)