HomeContact

Learn new skills from
The best internet marketers

Too many businesses are already generating all the leads and prospects they need but are unwittingly losing up to 95% of their sales opportunities. We write about the strategies you can use to convert those leads.

introducing ast-to-entity-definitions
Hiromi Shikata
Hiromi Shikata
November 18, 2024

introducing ast-to-entity-definitions

CircleCI code style: prettier semantic-release: angular

Welcome to ast-to-entity-definitions! 🎉 This tool allows you to easily generate EntityDefinition and EntityPropertyDefinition from your TypeScript type information. By automating this process, you can streamline the generation of source code that interacts with your domain model.

Motivation and Key Features

The motivation behind creating this library was the observation that a significant portion of domain model-driven source code can be automatically generated based on the TypeScript type definitions. Since the domain model is typically well-defined, a lot of the boilerplate code (such as repository implementations, GraphQL resolvers, and test scaffolding) can be generated from the TypeScript types.

This library works by parsing the TypeScript abstract syntax tree (AST) and converting the type information into EntityDefinition and EntityPropertyDefinition objects. These objects can then be used to generate various types of code, such as:

  • GraphQL schema and resolver code
  • Database repository implementations
  • Test fixtures and scaffolding

The key features of this library include:

  1. TypeScript AST parsing: The library can read TypeScript files and extract the necessary type information to generate the entity definitions.
  2. Flexible code generation: The generated entity definitions can be used to produce code in various languages and technologies, not just limited to TypeScript. The output is in the form of JSON, which can be easily integrated into your own code generation workflows.
  3. Extensibility: The library is designed to be extensible, allowing you to add your own custom code generators to suit your specific needs.

Getting Started

To get started, you can install the ast-to-entity-definitions package via npm or Yarn:

npm install ast-to-entity-definitions

or

yarn add ast-to-entity-definitions

Once installed, you can use the library in your project either through the provided CLI or by importing the getEntityDefinitions function directly.

We hope that ast-to-entity-definitions can help streamline your domain-driven development workflow. If you have any questions, feedback, or contributions, please don't hesitate to reach out!

I created new service https://www.upwork.com/services/product/development-it-professional-go-unit-test-creation-service-enhance-your-code-quality-1857997883148171119?ref=fl_profile

Starter Plan

Title

Go Unit Test Creation Service - Single File Testing Up To 1,000 Code Lines

Description

You will get professional unit tests for your Go source file. This basic plan is perfect for developers starting with testing or having simple test requirements.

What's included:

  • Analysis and test case design for a single file (up to 1,000 lines of code)
  • Implementation of basic unit tests
  • Test documentation with usage examples
  • Basic test coverage report
  • 2 revision rounds
  • Delivery within 2-3 business days

Note: This plan does not include mock creation. Ideal for simple classes or when mocks are already available.

Standard Plan

Title

Go Unit Testing Service - Multi-File Testing Up To 5,000 Code Lines with Mocks

Description

You will get comprehensive unit test coverage for multiple Go files with professional mock implementations and layer-specific testing strategies.

What's included:

  • Full test coverage for multiple files (up to 5,000 lines of code total)
  • Custom mock object creation and implementation
  • Layer-specific test strategies
  • Detailed coverage analysis and report
  • Integration test examples
  • Test architecture documentation
  • 3 revision rounds
  • Delivery within 5-7 business days

Perfect for projects requiring thorough testing across different layers with mock dependencies.

Advanced Plan

Title

Enterprise Go Testing Service - Large Project Testing Up To 50,000 Code Lines

Description

You will get enterprise-level test implementation with comprehensive coverage, security review, and architectural recommendations for your large-scale Go project.

What's included:

  • Complete test suite for large codebases (up to 50,000 lines of code)
  • Architectural review and recommendations
  • Security testing considerations and implementation
  • Performance test examples
  • Custom test utilities and helpers
  • Comprehensive testing strategy documentation
  • Code quality and security recommendations
  • Weekly progress updates
  • 4 revision rounds
  • Delivery within 10-15 business days

Add-on Options:

  • GitHub Actions CI/CD Setup (+$10)
  • Additional consultation sessions
  • Custom test framework development (Quote based on requirements)

Perfect for enterprise applications requiring comprehensive testing strategy with security considerations.

Search Tags

golang, unit-testing, test-automation, mock-testing, security-testing, test-coverage, enterprise-testing

© 2026, All Rights Reserved.
Powered By

Quick Links

Advertise with usAbout UsContact Us

Social Media