Skip to content

Commit c5fce83

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/version-copy-button
2 parents 676e301 + cb1b4a4 commit c5fce83

10 files changed

Lines changed: 116 additions & 9 deletions

File tree

i18n/locales/es.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@
221221
"title": "Empezar",
222222
"pm_label": "Gestor de paquetes",
223223
"copy_command": "Copiar comando de instalación",
224+
"copy_dev_command": "Copiar comando de instalación como dependencia de desarrollo",
225+
"dev_dependency_hint": "Instalar como dependencia de desarrollo",
224226
"view_types": "Ver {package}"
225227
},
226228
"create": {
@@ -298,7 +300,13 @@
298300
"show_low_usage": "Mostrar versiones de bajo uso",
299301
"show_low_usage_tooltip": "Incluir grupos de versiones con menos del 1% de las descargas totales.",
300302
"date_range_tooltip": "Solo la última semana de distribución de versiones",
301-
"y_axis_label": "Descargas"
303+
"y_axis_label": "Descargas",
304+
"filter_placeholder": "Filtrar versiones (ej: ^1.0.0, >2.0)...",
305+
"filter_invalid": "Rango semver inválido",
306+
"filter_help": "Usa sintaxis semver estándar",
307+
"filter_tooltip": "Filtra versiones usando rangos semver. Ejemplos:",
308+
"filter_tooltip_link": "Calculadora Semver",
309+
"no_matches": "Ninguna versión coincide con el filtro"
302310
},
303311
"dependencies": {
304312
"title": "Dependencias ({count})",
@@ -808,6 +816,14 @@
808816
"managers": "geniales"
809817
}
810818
},
819+
"team": {
820+
"title": "Equipo",
821+
"governance": "Gobernanza",
822+
"role_steward": "Administrador",
823+
"role_maintainer": "Mantenedor",
824+
"sponsor": "Patrocinar",
825+
"sponsor_aria": "Patrocinar a {name} en GitHub"
826+
},
811827
"contributors": {
812828
"title": "{count} Colaborador | {count} Colaboradores",
813829
"description": "npmx es completamente de código abierto, construido por una increíble comunidad de colaboradores. Únete a nosotros y construyamos juntos la experiencia de navegación de npm que siempre quisimos.",

i18n/locales/zh-CN.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@
221221
"title": "开始使用",
222222
"pm_label": "包管理器",
223223
"copy_command": "复制安装命令",
224+
"copy_dev_command": "复制开发依赖安装命令",
225+
"dev_dependency_hint": "通常作为开发依赖项安装",
224226
"view_types": "查看 {package}"
225227
},
226228
"create": {
@@ -297,7 +299,14 @@
297299
"recent_versions_only_tooltip": "仅显示在过去一年内发布的版本。",
298300
"show_low_usage": "显示低使用率版本",
299301
"show_low_usage_tooltip": "包括下载量低于 1% 的版本组。",
300-
"date_range_tooltip": "仅显示最近一周的版本分布情况"
302+
"date_range_tooltip": "仅显示最近一周的版本分布情况",
303+
"y_axis_label": "下载量",
304+
"filter_placeholder": "按语义化版本过滤(例如 ^3.0.0)",
305+
"filter_invalid": "无效的语义化版本范围",
306+
"filter_help": "语义化版本范围过滤帮助",
307+
"filter_tooltip": "使用 {link} 过滤版本。例如,^3.0.0 显示所有 3.x 版本。",
308+
"filter_tooltip_link": "语义化版本范围",
309+
"no_matches": "没有匹配此范围的版本"
301310
},
302311
"dependencies": {
303312
"title": "依赖({count} 个)",
@@ -807,6 +816,14 @@
807816
"managers": "管理器"
808817
}
809818
},
819+
"team": {
820+
"title": "团队",
821+
"governance": "治理",
822+
"role_steward": "管理者",
823+
"role_maintainer": "维护者",
824+
"sponsor": "赞助者",
825+
"sponsor_aria": "在 GitHub 上赞助 {name}"
826+
},
810827
"contributors": {
811828
"title": "{count} 位贡献者",
812829
"description": "npmx 是完全开源的,由令人惊叹的社区贡献者们共同构建。",

lunaria/files/es-419.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@
220220
"title": "Empezar",
221221
"pm_label": "Gestor de paquetes",
222222
"copy_command": "Copiar comando de instalación",
223+
"copy_dev_command": "Copiar comando de instalación como dependencia de desarrollo",
224+
"dev_dependency_hint": "Instalar como dependencia de desarrollo",
223225
"view_types": "Ver {package}"
224226
},
225227
"create": {
@@ -297,7 +299,13 @@
297299
"show_low_usage": "Mostrar versiones de bajo uso",
298300
"show_low_usage_tooltip": "Incluir grupos de versiones con menos del 1% de las descargas totales.",
299301
"date_range_tooltip": "Solo la última semana de distribución de versiones",
300-
"y_axis_label": "Descargas"
302+
"y_axis_label": "Descargas",
303+
"filter_placeholder": "Filtrar versiones (ej: ^1.0.0, >2.0)...",
304+
"filter_invalid": "Rango semver inválido",
305+
"filter_help": "Usa sintaxis semver estándar",
306+
"filter_tooltip": "Filtra versiones usando rangos semver. Ejemplos:",
307+
"filter_tooltip_link": "Calculadora Semver",
308+
"no_matches": "Ninguna versión coincide con el filtro"
301309
},
302310
"dependencies": {
303311
"title": "Dependencias ({count})",
@@ -807,6 +815,14 @@
807815
"managers": "geniales"
808816
}
809817
},
818+
"team": {
819+
"title": "Equipo",
820+
"governance": "Gobernanza",
821+
"role_steward": "Administrador",
822+
"role_maintainer": "Mantenedor",
823+
"sponsor": "Patrocinar",
824+
"sponsor_aria": "Patrocinar a {name} en GitHub"
825+
},
810826
"contributors": {
811827
"title": "{count} Colaborador | {count} Colaboradores",
812828
"description": "npmx es completamente de código abierto, construido por una increíble comunidad de colaboradores. Únete a nosotros y construyamos juntos la experiencia de navegación de npm que siempre quisimos.",

lunaria/files/es-ES.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@
220220
"title": "Empezar",
221221
"pm_label": "Gestor de paquetes",
222222
"copy_command": "Copiar comando de instalación",
223+
"copy_dev_command": "Copiar comando de instalación como dependencia de desarrollo",
224+
"dev_dependency_hint": "Instalar como dependencia de desarrollo",
223225
"view_types": "Ver {package}"
224226
},
225227
"create": {
@@ -297,7 +299,13 @@
297299
"show_low_usage": "Mostrar versiones de bajo uso",
298300
"show_low_usage_tooltip": "Incluir grupos de versiones con menos del 1% de las descargas totales.",
299301
"date_range_tooltip": "Solo la última semana de distribución de versiones",
300-
"y_axis_label": "Descargas"
302+
"y_axis_label": "Descargas",
303+
"filter_placeholder": "Filtrar versiones (ej: ^1.0.0, >2.0)...",
304+
"filter_invalid": "Rango semver inválido",
305+
"filter_help": "Usa sintaxis semver estándar",
306+
"filter_tooltip": "Filtra versiones usando rangos semver. Ejemplos:",
307+
"filter_tooltip_link": "Calculadora Semver",
308+
"no_matches": "Ninguna versión coincide con el filtro"
301309
},
302310
"dependencies": {
303311
"title": "Dependencias ({count})",
@@ -807,6 +815,14 @@
807815
"managers": "geniales"
808816
}
809817
},
818+
"team": {
819+
"title": "Equipo",
820+
"governance": "Gobernanza",
821+
"role_steward": "Administrador",
822+
"role_maintainer": "Mantenedor",
823+
"sponsor": "Patrocinar",
824+
"sponsor_aria": "Patrocinar a {name} en GitHub"
825+
},
810826
"contributors": {
811827
"title": "{count} Colaborador | {count} Colaboradores",
812828
"description": "npmx es completamente de código abierto, construido por una increíble comunidad de colaboradores. Únete a nosotros y construyamos juntos la experiencia de navegación de npm que siempre quisimos.",

lunaria/files/zh-CN.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@
220220
"title": "开始使用",
221221
"pm_label": "包管理器",
222222
"copy_command": "复制安装命令",
223+
"copy_dev_command": "复制开发依赖安装命令",
224+
"dev_dependency_hint": "通常作为开发依赖项安装",
223225
"view_types": "查看 {package}"
224226
},
225227
"create": {
@@ -296,7 +298,14 @@
296298
"recent_versions_only_tooltip": "仅显示在过去一年内发布的版本。",
297299
"show_low_usage": "显示低使用率版本",
298300
"show_low_usage_tooltip": "包括下载量低于 1% 的版本组。",
299-
"date_range_tooltip": "仅显示最近一周的版本分布情况"
301+
"date_range_tooltip": "仅显示最近一周的版本分布情况",
302+
"y_axis_label": "下载量",
303+
"filter_placeholder": "按语义化版本过滤(例如 ^3.0.0)",
304+
"filter_invalid": "无效的语义化版本范围",
305+
"filter_help": "语义化版本范围过滤帮助",
306+
"filter_tooltip": "使用 {link} 过滤版本。例如,^3.0.0 显示所有 3.x 版本。",
307+
"filter_tooltip_link": "语义化版本范围",
308+
"no_matches": "没有匹配此范围的版本"
300309
},
301310
"dependencies": {
302311
"title": "依赖({count} 个)",
@@ -806,6 +815,14 @@
806815
"managers": "管理器"
807816
}
808817
},
818+
"team": {
819+
"title": "团队",
820+
"governance": "治理",
821+
"role_steward": "管理者",
822+
"role_maintainer": "维护者",
823+
"sponsor": "赞助者",
824+
"sponsor_aria": "在 GitHub 上赞助 {name}"
825+
},
809826
"contributors": {
810827
"title": "{count} 位贡献者",
811828
"description": "npmx 是完全开源的,由令人惊叹的社区贡献者们共同构建。",

nuxt.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ export default defineNuxtConfig({
158158
'/_v/view': { proxy: 'https://npmx.dev/_vercel/insights/view' },
159159
'/_v/event': { proxy: 'https://npmx.dev/_vercel/insights/event' },
160160
'/_v/session': { proxy: 'https://npmx.dev/_vercel/insights/session' },
161+
// lunaria status.json
162+
'/lunaria/status.json': {
163+
headers: {
164+
'Cache-Control': 'public, max-age=0, must-revalidate',
165+
},
166+
},
161167
},
162168

163169
experimental: {

server/utils/readme.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,15 @@ ${html}
415415
renderer.link = function ({ href, title, tokens }: Tokens.Link) {
416416
const text = this.parser.parseInline(tokens)
417417
const titleAttr = title ? ` title="${title}"` : ''
418-
const plainText = text.replace(/<[^>]*>/g, '').trim()
418+
let plainText = text.replace(/<[^>]*>/g, '').trim()
419+
420+
// If plain text is empty, check if we have an image with alt text
421+
if (!plainText && tokens.length === 1 && tokens[0]?.type === 'image') {
422+
plainText = tokens[0].text
423+
}
419424

420-
const intermediateTitleAttr = `${` data-title-intermediate="${plainText || title}"`}`
425+
const intermediateTitleAttr =
426+
plainText || title ? ` data-title-intermediate="${plainText || title}"` : ''
421427

422428
return `<a href="${href}"${titleAttr}${intermediateTitleAttr}>${text}</a>`
423429
}

test/unit/server/utils/readme.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ describe('Playground Link Extraction', () => {
6262
expect(result.playgroundLinks).toHaveLength(1)
6363
expect(result.playgroundLinks[0]!.provider).toBe('codesandbox')
6464
})
65+
66+
it('extracts label from image link', async () => {
67+
const markdown = `[![Edit CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/example-abc123)`
68+
const result = await renderReadmeHtml(markdown, 'test-pkg')
69+
70+
expect(result.playgroundLinks).toHaveLength(1)
71+
expect(result.playgroundLinks[0]).toMatchObject({
72+
provider: 'codesandbox',
73+
providerName: 'CodeSandbox',
74+
label: 'Edit CodeSandbox',
75+
url: 'https://codesandbox.io/s/example-abc123',
76+
})
77+
})
6578
})
6679

6780
describe('Other Providers', () => {

uno-preset-a11y.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Preset } from 'unocss'
22

3-
export type CollectorChecker = (warning: string, rule: string) => void
3+
type CollectorChecker = (warning: string, rule: string) => void
44

55
// Track warnings to avoid duplicates
66
const warnedClasses = new Set<string>()

uno-preset-rtl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CSSEntries, DynamicMatcher, Preset, RuleContext } from 'unocss'
22
import { cornerMap, directionSize, h } from '@unocss/preset-wind4/utils'
33

4-
export type CollectorChecker = (warning: string, rule: string) => void
4+
type CollectorChecker = (warning: string, rule: string) => void
55

66
// Track warnings to avoid duplicates
77
const warnedClasses = new Set<string>()

0 commit comments

Comments
 (0)