Skip to content

chore: remove zod package and replace with TypeScript types#48

Merged
Garbee merged 2 commits intomainfrom
claude/remove-zod-package
Mar 1, 2026
Merged

chore: remove zod package and replace with TypeScript types#48
Garbee merged 2 commits intomainfrom
claude/remove-zod-package

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Feb 28, 2026

Removes the zod runtime validation library and replaces it with native TypeScript interfaces for type safety. The action generates all metrics data internally, making runtime validation unnecessary overhead.

Changes

  • Type definitions (src/lib.ts): Replaced zod schemas with TypeScript interfaces:

    • cpuLoadPercentageSchemaCpuLoadPercentage interface
    • memoryUsageMBSchemaMemoryUsageMB interface
    • diskUsageGBSchemaDiskUsageGB interface
    • metricsDataSchemaMetricsData interface
    • alertSchemaAlert interface
  • Data parsing (src/post/lib.ts): Replaced metricsDataSchema.parse(JSON.parse(content)) with direct JSON.parse(content) as MetricsData

  • Type imports: Updated all source files to use type imports for interfaces (TypeScript-only, no runtime value)

  • Test updates: Modified test expecting validation errors to reflect that validation is no longer performed

Impact

  • Bundle size reduced by 27,639 lines (removed 32,353, added 4,714)
  • Faster build and runtime with one less dependency
  • Type safety maintained at compile-time via TypeScript

Before:

import { z } from "zod";
const metricsDataSchema = z.object({...});
return metricsDataSchema.parse(JSON.parse(content));

After:

interface MetricsData {...}
return JSON.parse(content) as MetricsData;

Co-authored-by: Garbee <868301+Garbee@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Remove zod package and related code from the codebase chore: remove zod package and replace with TypeScript types Feb 28, 2026
@Garbee Garbee marked this pull request as ready for review March 1, 2026 03:57
@Garbee Garbee merged commit 5d47827 into main Mar 1, 2026
15 checks passed
@Garbee Garbee deleted the claude/remove-zod-package branch March 1, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants