https://github.com/florianrappl/ts-transform-sample
Sample code for using TypeScript transforms.
https://github.com/florianrappl/ts-transform-sample
code-generation example generation sample transformers typescript
Last synced: 9 months ago
JSON representation
Sample code for using TypeScript transforms.
- Host: GitHub
- URL: https://github.com/florianrappl/ts-transform-sample
- Owner: FlorianRappl
- License: mit
- Created: 2018-12-19T12:16:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T21:03:28.000Z (over 4 years ago)
- Last Synced: 2025-03-31T21:27:46.075Z (10 months ago)
- Topics: code-generation, example, generation, sample, transformers, typescript
- Language: TypeScript
- Size: 7.81 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TypeScript Transforms Example
A simple example illustrating the possibility of transforming source code during compile-time in TypeScript. The example tries to implement a very simple system for retrieving runtime-type information (RTTI).
## Status
The example is currently only consisting of a method to store trivial type information. The scope was limited to only interfaces, even though some other types (e.g., primitives such as `string`) would work as well. Recursive type references will not work in this implementation.
## Running
Clone the repository, `npm install` to resolve the dependencies. A sample file (*sample.ts*) can be found in the root directory. Running `npm start` will "build" this file. Viewing the generated file (see *dist/sample.js*) shows how the result of transformation looks like.