[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: update knip config & prep for prod mode (#771)

authored by

Lars Kappert and committed by
GitHub
ed6bf6f2 e6754cdf

+37 -25
+4
cli/src/npm-client.ts
··· 14 14 /** 15 15 * Validates an npm package name using the official npm validation package 16 16 * @throws Error if the name is invalid 17 + * @internal 17 18 */ 18 19 export function validatePackageName(name: string): void { 19 20 const result = v.safeParse(PackageNameSchema, name) ··· 26 27 /** 27 28 * Validates an npm username 28 29 * @throws Error if the username is invalid 30 + * @internal 29 31 */ 30 32 export function validateUsername(name: string): void { 31 33 const result = v.safeParse(UsernameSchema, name) ··· 37 39 /** 38 40 * Validates an npm org name (without the @ prefix) 39 41 * @throws Error if the org name is invalid 42 + * @internal 40 43 */ 41 44 export function validateOrgName(name: string): void { 42 45 const result = v.safeParse(OrgNameSchema, name) ··· 48 51 /** 49 52 * Validates a scope:team format (e.g., @myorg:developers) 50 53 * @throws Error if the scope:team is invalid 54 + * @internal 51 55 */ 52 56 export function validateScopeTeam(scopeTeam: string): void { 53 57 const result = v.safeParse(ScopeTeamSchema, scopeTeam)
+9
cli/src/schemas.ts
··· 25 25 /** 26 26 * Validates an npm package name for new packages only 27 27 * Stricter than PackageNameSchema - rejects legacy formats (uppercase, etc.) 28 + * @internal 28 29 */ 29 30 export const NewPackageNameSchema = v.pipe( 30 31 v.string(), ··· 76 77 77 78 /** 78 79 * Validates org roles 80 + * @internal 79 81 */ 80 82 export const OrgRoleSchema = v.picklist( 81 83 ['developer', 'admin', 'owner'], ··· 84 86 85 87 /** 86 88 * Validates access permissions 89 + * @internal 87 90 */ 88 91 export const PermissionSchema = v.picklist( 89 92 ['read-only', 'read-write'], ··· 110 113 111 114 /** 112 115 * Validates OTP (6-digit code) 116 + * @internal 113 117 */ 114 118 export const OtpSchema = v.optional( 115 119 v.pipe(v.string(), v.regex(/^\d{6}$/, 'OTP must be a 6-digit code')), ··· 117 121 118 122 /** 119 123 * Validates a hex token (like session tokens and operation IDs) 124 + * @internal 120 125 */ 121 126 export const HexTokenSchema = v.pipe( 122 127 v.string(), ··· 126 131 127 132 /** 128 133 * Validates operation ID (16-char hex) 134 + * @internal 129 135 */ 130 136 export const OperationIdSchema = v.pipe( 131 137 v.string(), ··· 176 182 // Type-specific Operation Params Schemas 177 183 // ============================================================================ 178 184 185 + /** @internal */ 179 186 export const OrgAddUserParamsSchema = v.object({ 180 187 org: OrgNameSchema, 181 188 user: UsernameSchema, ··· 205 212 user: UsernameSchema, 206 213 }) 207 214 215 + /** @internal */ 208 216 export const AccessGrantParamsSchema = v.object({ 209 217 permission: PermissionSchema, 210 218 scopeTeam: ScopeTeamSchema, ··· 226 234 pkg: PackageNameSchema, 227 235 }) 228 236 237 + /** @internal */ 229 238 export const PackageInitParamsSchema = v.object({ 230 239 name: NewPackageNameSchema, 231 240 author: v.optional(UsernameSchema),
+18 -19
knip.json
··· 1 1 { 2 2 "$schema": "https://unpkg.com/knip@5/schema.json", 3 - "ignore": ["shared/types/lexicons/**"], 4 3 "workspaces": { 5 4 ".": { 6 5 "entry": [ 7 - "app/app.vue", 8 - "app/error.vue", 9 - "app/pages/**/*.vue", 10 - "app/components/**/*.vue", 11 - "app/composables/**/*.ts", 12 - "app/middleware/**/*.ts", 13 - "app/plugins/**/*.ts", 14 - "app/utils/**/*.ts", 15 - "server/**/*.ts", 16 - "modules/**/*.ts", 17 - "config/**/*.ts", 6 + "app/app.vue!", 7 + "app/error.vue!", 8 + "app/pages/**/*.vue!", 9 + "app/components/**/*.vue!", 10 + "app/composables/**/*.ts!", 11 + "app/middleware/**/*.ts!", 12 + "app/plugins/**/*.ts!", 13 + "app/utils/**/*.ts!", 14 + "server/**/*.ts!", 15 + "modules/**/*.ts!", 16 + "config/**/*.ts!", 17 + "lunaria/**/*.ts!", 18 + "shared/**/*.ts!", 18 19 "i18n/**/*.ts", 19 20 "lunaria.config.ts", 20 21 "pwa-assets.config.ts", 21 22 ".lighthouserc.cjs", 22 23 "lighthouse-setup.cjs", 23 - "uno-preset-rtl.ts", 24 - "scripts/**/*.ts", 25 - "lunaria/**/*.ts", 26 - "shared/**/*.ts" 24 + "uno-preset-rtl.ts!", 25 + "scripts/**/*.ts" 27 26 ], 28 27 "project": ["**/*.{ts,vue,cjs,mjs}"], 29 28 "ignoreDependencies": [ 30 29 "@iconify-json/*", 31 30 "@vercel/kv", 32 31 "@voidzero-dev/vite-plus-core", 32 + "vite-plus!", 33 33 "h3", 34 34 "puppeteer", 35 35 "unplugin-vue-router", ··· 39 39 "ignoreUnresolved": ["#components", "#oauth/config"] 40 40 }, 41 41 "cli": { 42 - "project": ["src/**/*.ts"] 42 + "project": ["src/**/*.ts!"] 43 43 }, 44 44 "docs": { 45 45 "entry": ["app/**/*.{ts,vue}"], 46 - "project": ["**/*.{ts,vue}"], 47 - "ignoreDependencies": ["docus", "better-sqlite3"] 46 + "ignoreDependencies": ["docus", "better-sqlite3", "nuxt!"] 48 47 } 49 48 } 50 49 }
+1 -1
package.json
··· 106 106 "@vue/test-utils": "2.4.6", 107 107 "axe-core": "4.11.1", 108 108 "fast-npm-meta": "1.0.0", 109 - "knip": "5.82.1", 109 + "knip": "5.83.0", 110 110 "lint-staged": "16.2.7", 111 111 "oxfmt": "0.27.0", 112 112 "oxlint": "1.42.0",
+5 -5
pnpm-lock.yaml
··· 226 226 specifier: 1.0.0 227 227 version: 1.0.0 228 228 knip: 229 - specifier: 5.82.1 230 - version: 5.82.1(@types/node@24.10.9)(typescript@5.9.3) 229 + specifier: 5.83.0 230 + version: 5.83.0(@types/node@24.10.9)(typescript@5.9.3) 231 231 lint-staged: 232 232 specifier: 16.2.7 233 233 version: 16.2.7 ··· 6590 6590 resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} 6591 6591 engines: {node: '>= 8'} 6592 6592 6593 - knip@5.82.1: 6594 - resolution: {integrity: sha512-1nQk+5AcnkqL40kGQXfouzAEXkTR+eSrgo/8m1d0BMei4eAzFwghoXC4gOKbACgBiCof7hE8wkBVDsEvznf85w==} 6593 + knip@5.83.0: 6594 + resolution: {integrity: sha512-FfmaHMntpZB13B1oJQMSs1hTOZxd0TOn+FYB3oWEI02XlxTW3RH4H7d8z5Us3g0ziHCYyl7z0B1xi8ENP3QEKA==} 6595 6595 engines: {node: '>=18.18.0'} 6596 6596 hasBin: true 6597 6597 peerDependencies: ··· 16885 16885 16886 16886 klona@2.0.6: {} 16887 16887 16888 - knip@5.82.1(@types/node@24.10.9)(typescript@5.9.3): 16888 + knip@5.83.0(@types/node@24.10.9)(typescript@5.9.3): 16889 16889 dependencies: 16890 16890 '@nodelib/fs.walk': 1.2.8 16891 16891 '@types/node': 24.10.9