Skip to content

Commit ed6bf6f

Browse files
authored
chore: update knip config & prep for prod mode (#771)
1 parent e6754cd commit ed6bf6f

5 files changed

Lines changed: 37 additions & 25 deletions

File tree

cli/src/npm-client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const execFileAsync = promisify(execFile)
1414
/**
1515
* Validates an npm package name using the official npm validation package
1616
* @throws Error if the name is invalid
17+
* @internal
1718
*/
1819
export function validatePackageName(name: string): void {
1920
const result = v.safeParse(PackageNameSchema, name)
@@ -26,6 +27,7 @@ export function validatePackageName(name: string): void {
2627
/**
2728
* Validates an npm username
2829
* @throws Error if the username is invalid
30+
* @internal
2931
*/
3032
export function validateUsername(name: string): void {
3133
const result = v.safeParse(UsernameSchema, name)
@@ -37,6 +39,7 @@ export function validateUsername(name: string): void {
3739
/**
3840
* Validates an npm org name (without the @ prefix)
3941
* @throws Error if the org name is invalid
42+
* @internal
4043
*/
4144
export function validateOrgName(name: string): void {
4245
const result = v.safeParse(OrgNameSchema, name)
@@ -48,6 +51,7 @@ export function validateOrgName(name: string): void {
4851
/**
4952
* Validates a scope:team format (e.g., @myorg:developers)
5053
* @throws Error if the scope:team is invalid
54+
* @internal
5155
*/
5256
export function validateScopeTeam(scopeTeam: string): void {
5357
const result = v.safeParse(ScopeTeamSchema, scopeTeam)

cli/src/schemas.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const PackageNameSchema = v.pipe(
2525
/**
2626
* Validates an npm package name for new packages only
2727
* Stricter than PackageNameSchema - rejects legacy formats (uppercase, etc.)
28+
* @internal
2829
*/
2930
export const NewPackageNameSchema = v.pipe(
3031
v.string(),
@@ -76,6 +77,7 @@ export const ScopeTeamSchema = v.pipe(
7677

7778
/**
7879
* Validates org roles
80+
* @internal
7981
*/
8082
export const OrgRoleSchema = v.picklist(
8183
['developer', 'admin', 'owner'],
@@ -84,6 +86,7 @@ export const OrgRoleSchema = v.picklist(
8486

8587
/**
8688
* Validates access permissions
89+
* @internal
8790
*/
8891
export const PermissionSchema = v.picklist(
8992
['read-only', 'read-write'],
@@ -110,13 +113,15 @@ export const OperationTypeSchema = v.picklist([
110113

111114
/**
112115
* Validates OTP (6-digit code)
116+
* @internal
113117
*/
114118
export const OtpSchema = v.optional(
115119
v.pipe(v.string(), v.regex(/^\d{6}$/, 'OTP must be a 6-digit code')),
116120
)
117121

118122
/**
119123
* Validates a hex token (like session tokens and operation IDs)
124+
* @internal
120125
*/
121126
export const HexTokenSchema = v.pipe(
122127
v.string(),
@@ -126,6 +131,7 @@ export const HexTokenSchema = v.pipe(
126131

127132
/**
128133
* Validates operation ID (16-char hex)
134+
* @internal
129135
*/
130136
export const OperationIdSchema = v.pipe(
131137
v.string(),
@@ -176,6 +182,7 @@ export const BatchOperationsBodySchema = v.array(CreateOperationBodySchema)
176182
// Type-specific Operation Params Schemas
177183
// ============================================================================
178184

185+
/** @internal */
179186
export const OrgAddUserParamsSchema = v.object({
180187
org: OrgNameSchema,
181188
user: UsernameSchema,
@@ -205,6 +212,7 @@ const TeamRemoveUserParamsSchema = v.object({
205212
user: UsernameSchema,
206213
})
207214

215+
/** @internal */
208216
export const AccessGrantParamsSchema = v.object({
209217
permission: PermissionSchema,
210218
scopeTeam: ScopeTeamSchema,
@@ -226,6 +234,7 @@ const OwnerRemoveParamsSchema = v.object({
226234
pkg: PackageNameSchema,
227235
})
228236

237+
/** @internal */
229238
export const PackageInitParamsSchema = v.object({
230239
name: NewPackageNameSchema,
231240
author: v.optional(UsernameSchema),

knip.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
{
22
"$schema": "https://unpkg.com/knip@5/schema.json",
3-
"ignore": ["shared/types/lexicons/**"],
43
"workspaces": {
54
".": {
65
"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!",
1819
"i18n/**/*.ts",
1920
"lunaria.config.ts",
2021
"pwa-assets.config.ts",
2122
".lighthouserc.cjs",
2223
"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"
2726
],
2827
"project": ["**/*.{ts,vue,cjs,mjs}"],
2928
"ignoreDependencies": [
3029
"@iconify-json/*",
3130
"@vercel/kv",
3231
"@voidzero-dev/vite-plus-core",
32+
"vite-plus!",
3333
"h3",
3434
"puppeteer",
3535
"unplugin-vue-router",
@@ -39,12 +39,11 @@
3939
"ignoreUnresolved": ["#components", "#oauth/config"]
4040
},
4141
"cli": {
42-
"project": ["src/**/*.ts"]
42+
"project": ["src/**/*.ts!"]
4343
},
4444
"docs": {
4545
"entry": ["app/**/*.{ts,vue}"],
46-
"project": ["**/*.{ts,vue}"],
47-
"ignoreDependencies": ["docus", "better-sqlite3"]
46+
"ignoreDependencies": ["docus", "better-sqlite3", "nuxt!"]
4847
}
4948
}
5049
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"@vue/test-utils": "2.4.6",
107107
"axe-core": "4.11.1",
108108
"fast-npm-meta": "1.0.0",
109-
"knip": "5.82.1",
109+
"knip": "5.83.0",
110110
"lint-staged": "16.2.7",
111111
"oxfmt": "0.27.0",
112112
"oxlint": "1.42.0",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)