https://github.com/xyproto/ts_in_go
:monorail: Example of embedding TypeScript in a Go executable
https://github.com/xyproto/ts_in_go
docker embed go javascript typescript
Last synced: 3 months ago
JSON representation
:monorail: Example of embedding TypeScript in a Go executable
- Host: GitHub
- URL: https://github.com/xyproto/ts_in_go
- Owner: xyproto
- License: mit
- Created: 2017-10-16T11:04:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-25T17:07:34.000Z (over 6 years ago)
- Last Synced: 2025-06-15T10:07:36.967Z (4 months ago)
- Topics: docker, embed, go, javascript, typescript
- Language: Makefile
- Homepage:
- Size: 158 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TypeScript in Go
Example of embedding TypeScript in a Go executable.
## Work in progress
```
../node_modules/@types/react/index.d.ts:169:11 - error TS2559: Type 'Component' has no properties in common with type 'ComponentLifecycle
'.
169 class Componentimplements ComponentLifecycle
{
~~~~~~~~~
```There is currently an error when compiling "hello world". To be figured out. This repository is a work in progress!
## Build-time requirements
* A recent version of the `go` compiler.
* `make`
* A `tsc` command, for compiling TypeScript to JavaScript
* `go-bindata`, install with: `go get -u github.com/jteeuwen/go-bindata/...`## Run-time requirements
* None, only the built executable (that embeds TypeScript)
## Example
1. Edit `src/main.ts`
2. Build the project with `make`
3. Run `./main` and see the output generated from the embedded TypeScript file## Quick start with Docker
There is a docker image included in the `docker` folder, with all required dependencies installed.
Just build and run:
cd docker; ./build.sh; ./compile.sh; ./main
Then edit `docker/src/main.ts` and run `./compile.sh; ./main` again.