0.0.8 • Published 2 years ago

projen-ts-morph v0.0.8

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

release npm version

projen-ts-morph

Generate and navigate typescript files with a Projen component.

Implementation

The sole exported class of this project, TypescriptMorpher, acts as a wrapper around the excellent ts-morph.

A few convenience methods are added to that class to aid in codegen, and during the synth() phase of your project all creations/updates/deletes will be saved to disk.

See https://github.com/dsherret/ts-morph and https://ts-morph.com for more details on the API. I take no credit for that amazing project.

Gettings Started

Make sure to add ts-morph as a dependency and make sure it's actually installed before attempting to use this component. See examples below to get started.

Stability

Consider this library unstable.

Examples

Create an example snippet for your README

See this project's .projenrc.ts for usage of createTemporaryTypescriptFile and renderFencedTypescript

Create a simple empty class

import { TypescriptMorpher } from 'projen-ts-morph';
const morpher = new TypescriptMorpher(project);
const source = morpher.createTypescriptFile('src/cool_generated.ts');
source.addClass({
    name: 'CoolGenerated',
    isDefaultExport: true,
});

Typedocs

0.0.8

2 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago