diff --git a/cli/src/npm-client.ts b/cli/src/npm-client.ts index f21169eaf..77ebcccf9 100644 --- a/cli/src/npm-client.ts +++ b/cli/src/npm-client.ts @@ -14,6 +14,7 @@ const execFileAsync = promisify(execFile) /** * Validates an npm package name using the official npm validation package * @throws Error if the name is invalid + * @internal */ export function validatePackageName(name: string): void { const result = v.safeParse(PackageNameSchema, name) @@ -26,6 +27,7 @@ export function validatePackageName(name: string): void { /** * Validates an npm username * @throws Error if the username is invalid + * @internal */ export function validateUsername(name: string): void { const result = v.safeParse(UsernameSchema, name) @@ -37,6 +39,7 @@ export function validateUsername(name: string): void { /** * Validates an npm org name (without the @ prefix) * @throws Error if the org name is invalid + * @internal */ export function validateOrgName(name: string): void { const result = v.safeParse(OrgNameSchema, name) @@ -48,6 +51,7 @@ export function validateOrgName(name: string): void { /** * Validates a scope:team format (e.g., @myorg:developers) * @throws Error if the scope:team is invalid + * @internal */ export function validateScopeTeam(scopeTeam: string): void { const result = v.safeParse(ScopeTeamSchema, scopeTeam) diff --git a/cli/src/schemas.ts b/cli/src/schemas.ts index eb3facba6..95ee4c1ca 100644 --- a/cli/src/schemas.ts +++ b/cli/src/schemas.ts @@ -25,6 +25,7 @@ export const PackageNameSchema = v.pipe( /** * Validates an npm package name for new packages only * Stricter than PackageNameSchema - rejects legacy formats (uppercase, etc.) + * @internal */ export const NewPackageNameSchema = v.pipe( v.string(), @@ -76,6 +77,7 @@ export const ScopeTeamSchema = v.pipe( /** * Validates org roles + * @internal */ export const OrgRoleSchema = v.picklist( ['developer', 'admin', 'owner'], @@ -84,6 +86,7 @@ export const OrgRoleSchema = v.picklist( /** * Validates access permissions + * @internal */ export const PermissionSchema = v.picklist( ['read-only', 'read-write'], @@ -110,6 +113,7 @@ export const OperationTypeSchema = v.picklist([ /** * Validates OTP (6-digit code) + * @internal */ export const OtpSchema = v.optional( v.pipe(v.string(), v.regex(/^\d{6}$/, 'OTP must be a 6-digit code')), @@ -117,6 +121,7 @@ export const OtpSchema = v.optional( /** * Validates a hex token (like session tokens and operation IDs) + * @internal */ export const HexTokenSchema = v.pipe( v.string(), @@ -126,6 +131,7 @@ export const HexTokenSchema = v.pipe( /** * Validates operation ID (16-char hex) + * @internal */ export const OperationIdSchema = v.pipe( v.string(), @@ -176,6 +182,7 @@ export const BatchOperationsBodySchema = v.array(CreateOperationBodySchema) // Type-specific Operation Params Schemas // ============================================================================ +/** @internal */ export const OrgAddUserParamsSchema = v.object({ org: OrgNameSchema, user: UsernameSchema, @@ -205,6 +212,7 @@ const TeamRemoveUserParamsSchema = v.object({ user: UsernameSchema, }) +/** @internal */ export const AccessGrantParamsSchema = v.object({ permission: PermissionSchema, scopeTeam: ScopeTeamSchema, @@ -226,6 +234,7 @@ const OwnerRemoveParamsSchema = v.object({ pkg: PackageNameSchema, }) +/** @internal */ export const PackageInitParamsSchema = v.object({ name: NewPackageNameSchema, author: v.optional(UsernameSchema), diff --git a/knip.json b/knip.json index aa76f1bd6..a7df11184 100644 --- a/knip.json +++ b/knip.json @@ -1,35 +1,35 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", - "ignore": ["shared/types/lexicons/**"], "workspaces": { ".": { "entry": [ - "app/app.vue", - "app/error.vue", - "app/pages/**/*.vue", - "app/components/**/*.vue", - "app/composables/**/*.ts", - "app/middleware/**/*.ts", - "app/plugins/**/*.ts", - "app/utils/**/*.ts", - "server/**/*.ts", - "modules/**/*.ts", - "config/**/*.ts", + "app/app.vue!", + "app/error.vue!", + "app/pages/**/*.vue!", + "app/components/**/*.vue!", + "app/composables/**/*.ts!", + "app/middleware/**/*.ts!", + "app/plugins/**/*.ts!", + "app/utils/**/*.ts!", + "server/**/*.ts!", + "modules/**/*.ts!", + "config/**/*.ts!", + "lunaria/**/*.ts!", + "shared/**/*.ts!", "i18n/**/*.ts", "lunaria.config.ts", "pwa-assets.config.ts", ".lighthouserc.cjs", "lighthouse-setup.cjs", - "uno-preset-rtl.ts", - "scripts/**/*.ts", - "lunaria/**/*.ts", - "shared/**/*.ts" + "uno-preset-rtl.ts!", + "scripts/**/*.ts" ], "project": ["**/*.{ts,vue,cjs,mjs}"], "ignoreDependencies": [ "@iconify-json/*", "@vercel/kv", "@voidzero-dev/vite-plus-core", + "vite-plus!", "h3", "puppeteer", "unplugin-vue-router", @@ -39,12 +39,11 @@ "ignoreUnresolved": ["#components", "#oauth/config"] }, "cli": { - "project": ["src/**/*.ts"] + "project": ["src/**/*.ts!"] }, "docs": { "entry": ["app/**/*.{ts,vue}"], - "project": ["**/*.{ts,vue}"], - "ignoreDependencies": ["docus", "better-sqlite3"] + "ignoreDependencies": ["docus", "better-sqlite3", "nuxt!"] } } } diff --git a/package.json b/package.json index 331c391da..d9210d99b 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "@vue/test-utils": "2.4.6", "axe-core": "4.11.1", "fast-npm-meta": "1.0.0", - "knip": "5.82.1", + "knip": "5.83.0", "lint-staged": "16.2.7", "playwright-core": "1.58.0", "schema-dts": "1.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27f9dacd8..284ee053e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -226,8 +226,8 @@ importers: specifier: 1.0.0 version: 1.0.0 knip: - specifier: 5.82.1 - version: 5.82.1(@types/node@24.10.9)(typescript@5.9.3) + specifier: 5.83.0 + version: 5.83.0(@types/node@24.10.9)(typescript@5.9.3) lint-staged: specifier: 16.2.7 version: 16.2.7 @@ -6584,8 +6584,8 @@ packages: resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} engines: {node: '>= 8'} - knip@5.82.1: - resolution: {integrity: sha512-1nQk+5AcnkqL40kGQXfouzAEXkTR+eSrgo/8m1d0BMei4eAzFwghoXC4gOKbACgBiCof7hE8wkBVDsEvznf85w==} + knip@5.83.0: + resolution: {integrity: sha512-FfmaHMntpZB13B1oJQMSs1hTOZxd0TOn+FYB3oWEI02XlxTW3RH4H7d8z5Us3g0ziHCYyl7z0B1xi8ENP3QEKA==} engines: {node: '>=18.18.0'} hasBin: true peerDependencies: @@ -16879,7 +16879,7 @@ snapshots: klona@2.0.6: {} - knip@5.82.1(@types/node@24.10.9)(typescript@5.9.3): + knip@5.83.0(@types/node@24.10.9)(typescript@5.9.3): dependencies: '@nodelib/fs.walk': 1.2.8 '@types/node': 24.10.9