Skip to content
Closed
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 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"@iconify-json/vscode-icons": "1.2.43",
"@intlify/shared": "11.2.8",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@904b935",
"@napi-rs/canvas": "0.1.94",
"@nuxt/a11y": "1.0.0-alpha.1",
"@nuxt/fonts": "0.14.0",
"@nuxt/scripts": "0.13.2",
Expand All @@ -83,6 +82,7 @@
"@vueuse/router": "^14.2.1",
"@vueuse/shared": "14.2.1",
"algoliasearch": "5.49.0",
"canvas": "^3.2.1",
"defu": "6.1.4",
"fast-npm-meta": "1.2.1",
"focus-trap": "^8.0.0",
Expand Down
137 changes: 12 additions & 125 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ignoredBuiltDependencies:
onlyBuiltDependencies:
- '@resvg/resvg-js'
- better-sqlite3
- canvas
- [email protected]
- [email protected]

Expand Down
6 changes: 3 additions & 3 deletions server/api/registry/badge/[type]/[...pkg].get.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as v from 'valibot'
import { createCanvas, type SKRSContext2D } from '@napi-rs/canvas'
import { createCanvas, type CanvasRenderingContext2D } from 'canvas'
import { hash } from 'ohash'
import { createError, getRouterParam, getQuery, setHeader } from 'h3'
import { PackageRouteParamsSchema } from '#shared/schemas/package'
Expand Down Expand Up @@ -45,9 +45,9 @@ const SHIELDS_LABEL_PADDING_X = 5
const BADGE_FONT_SHORTHAND = 'normal normal 400 11px Geist, system-ui, -apple-system, sans-serif'
const SHIELDS_FONT_SHORTHAND = 'normal normal 400 11px Verdana, Geneva, DejaVu Sans, sans-serif'

let cachedCanvasContext: SKRSContext2D | null | undefined
let cachedCanvasContext: CanvasRenderingContext2D | null | undefined

function getCanvasContext(): SKRSContext2D | null {
function getCanvasContext(): CanvasRenderingContext2D | null {
if (cachedCanvasContext !== undefined) {
return cachedCanvasContext
}
Expand Down
Loading