WIP: A simple cli for daily tangled use cases and AI integration. This is for my personal use right now, but happy if others get mileage from it! :)

Enable TypeScript strict compilation flags

Enable erasableSyntaxOnly and isolatedDeclarations for:
- Faster builds with parallel declaration generation
- Better compatibility with fast transpilers (esbuild, SWC)
- More explicit public API types

Add explicit Zod type annotations to validation schemas
to satisfy isolatedDeclarations requirements.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

markbennett.ca d9723258 46b15dbe

verified
+10 -8
+8 -8
src/utils/validation.ts
··· 4 4 * Validation schema for AT Protocol handle 5 5 * Supports standard Bluesky handles (user.bsky.social) and custom domains (example.com) 6 6 */ 7 - export const handleSchema = z 7 + export const handleSchema: z.ZodString = z 8 8 .string() 9 9 .min(1, 'Handle cannot be empty') 10 10 .regex( ··· 15 15 /** 16 16 * Validation schema for AT Protocol DID 17 17 */ 18 - export const didSchema = z 18 + export const didSchema: z.ZodString = z 19 19 .string() 20 20 .min(1, 'DID cannot be empty') 21 21 .regex( ··· 27 27 * Validation schema for app password 28 28 * AT Protocol app passwords are typically 19 characters with dashes 29 29 */ 30 - export const appPasswordSchema = z 30 + export const appPasswordSchema: z.ZodString = z 31 31 .string() 32 32 .min(1, 'Password cannot be empty') 33 33 .max(1000, 'Password is too long'); ··· 35 35 /** 36 36 * Validation schema for identifier (handle or DID) 37 37 */ 38 - export const identifierSchema = z.union([handleSchema, didSchema]); 38 + export const identifierSchema: z.ZodUnion<[typeof handleSchema, typeof didSchema]> = z.union([handleSchema, didSchema]); 39 39 40 40 /** 41 41 * Validate a handle ··· 111 111 /** 112 112 * Validation schema for Tangled-specific DID (did:plc: format only) 113 113 */ 114 - export const tangledDidSchema = z 114 + export const tangledDidSchema: z.ZodString = z 115 115 .string() 116 116 .regex(/^did:plc:[a-z0-9]+$/, 'Invalid Tangled DID format. Expected: did:plc:...'); 117 117 ··· 135 135 * Validation schema for issue title 136 136 * Titles must be 1-256 characters 137 137 */ 138 - export const issueTitleSchema = z 138 + export const issueTitleSchema: z.ZodString = z 139 139 .string() 140 140 .min(1, 'Issue title cannot be empty') 141 141 .max(256, 'Issue title must be 256 characters or less'); ··· 144 144 * Validation schema for issue body 145 145 * Body is optional but limited to 50,000 characters 146 146 */ 147 - export const issueBodySchema = z 147 + export const issueBodySchema: z.ZodOptional<z.ZodString> = z 148 148 .string() 149 149 .max(50000, 'Issue body must be 50,000 characters or less') 150 150 .optional(); ··· 153 153 * Validation schema for AT-URI 154 154 * Format: at://did:method:identifier/collection[/rkey] 155 155 */ 156 - export const atUriSchema = z 156 + export const atUriSchema: z.ZodString = z 157 157 .string() 158 158 .regex( 159 159 /^at:\/\/did:[a-z]+:[a-zA-Z0-9._:%-]+\/[a-zA-Z0-9._-]+(?:\.[a-zA-Z0-9._-]+)*(?:\/[a-zA-Z0-9._-]+)?$/,
+2
tsconfig.json
··· 13 13 "declaration": true, 14 14 "declarationMap": true, 15 15 "sourceMap": true, 16 + "erasableSyntaxOnly": true, 17 + "isolatedDeclarations": true, 16 18 "noUnusedLocals": true, 17 19 "noUnusedParameters": true, 18 20 "noImplicitReturns": true,