0.0.27 • Published 10 months ago

projen-type-generator v0.0.27

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
10 months ago

TypeScript Type Generator for AWS CDK Projects

This TypeScript package generates TypeScript types based on input files (JSON, YAML) and is designed specifically for use in AWS CDK projects with projen. It allows you to easily generate TypeScript types for configuration files, which can then be used in your infrastructure scripts.

Usage

Imagine you have a config file config.yaml that looks like:

---
server: http://testserver.com
port: 8080

You rename your config file to config.generate.yaml and modifies you .projenrc.js like this( const project is only an example, you need TypeGenerator of course).

import { TypeGenerator } from './TypeGenerator';
import { AwsCdkTypeScriptApp } from 'projen/lib/awscdk';

const dependencies = ['projen-type-generator']; //this is mandatory

const project = new AwsCdkTypeScriptApp({
  cdkVersion: '1.110.0',
  deps: dependencies,
  defaultReleaseBranch: 'main',
  name: 'my-project',
  authorName: 'My Name',
  authorEmail: 'my.email@example.com',
});

new TypeGenerator(project, { extension: '.generate.yaml' });

This will configure the TypeGenerator to search for files with the .generate.yaml extension in your project's src directory, and generate corresponding TypeScript type files.

When you run:

npx projen

the TypeGenerator will automatically search for input files with the specified extension in the src directory, generate TypeScript types for each file, and save the generated TypeScript files in the same directory as the input files. For example, if the input file is named config.generate.yaml, the generated TypeScript type file will be named config.generate.ts.

Contributing

This project is open for contributions! Feel free to submit a pull request or create an issue if you find any bugs or have any suggestions for improvement.

0.0.20

11 months ago

0.0.21

11 months ago

0.0.22

11 months ago

0.0.23

11 months ago

0.0.24

10 months ago

0.0.25

10 months ago

0.0.15

12 months ago

0.0.16

12 months ago

0.0.17

11 months ago

0.0.18

11 months ago

0.0.19

11 months ago

0.0.26

10 months ago

0.0.27

10 months ago

0.0.14

12 months ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago