Skip to content

refactor: migrate cvgen cli to TypeScript - #14

Open
sha-io wants to merge 4 commits into
CymbolTech:mainfrom
sha-io:refactor/ts-migration
Open

sha-io wants to merge 4 commits into
CymbolTech:mainfrom
sha-io:refactor/ts-migration

Conversation

@sha-io

@sha-io sha-io commented Jan 6, 2026

Copy link
Copy Markdown

Summary

This PR migrates the CLI portion of the project from JS to TS to improve type safety, developer experience, and support future expansion.

Key Changes

  • Added a tsconfig.json with strict mode enabled.
  • Converted all files in /src from .js to .ts.
  • Integrated generate:schema and compile:schema into the build pipeline to automate schema generation.
  • Modularised the codebase to make future changes easier to manage.
  • Added index.ts as the new entry point for the CLI.
  • Refactored generator.ts from a class-based implementation to a functional approach.

Notes

  • The way the CLI is used remains unchanged.
  • This is my first contribution. The project has been quite helpful to me, thanks.

Related to #5

sha.io added 4 commits January 2, 2026 00:08
- Convert project from JavaScript to TypeScript
- Add tsconfig to initialise the TypeScript environment
- Modularise the codebase for future feature expansion
- Refactor generator.ts to use functions instead of class methods
- Add TypeScript types and interfaces to describe the schema
- Update AJV schema to explicitly declare nullable fields
- Introduce index.ts as the new application entry point
… easier future configuration

- Change tsconfig.json module to 'esnext' to support newer json import syntax
- Add generate:schema scripts in package.json and integrate into build script
- Switch AJV validator interface to AnySchema for higher flexiblity with schema
- Integrate 'compile:schema' script into build pipeline for automated schema generation
- Remove git tracking from generated validator and schema files
- Remove runtime compile step from generate.ts to optimise performance
- Enable code generation options in AJV configuration for standalone use

This branch has not been deployed

No deployments
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.

1 participant