1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
This commit is contained in:
Ryan Dahl 2018-05-13 23:32:01 -04:00
commit f7c5e19081
4 changed files with 66 additions and 0 deletions

31
main.go Normal file
View file

@ -0,0 +1,31 @@
// To test: make && ./out/render test_input.js
package main
//go:generate go-bindata -pkg $GOPACKAGE -o assets.go dist/
import (
"github.com/ry/v8worker2"
)
func recv(msg []byte) []byte {
println("recv cb", string(msg))
return nil
}
func main() {
indexFn := "dist/main.js"
data, err := Asset(indexFn)
if err != nil {
panic("asset not found")
}
code := string(data)
worker := v8worker2.New(recv)
// Load up index.js code.
err = worker.Load(indexFn, code)
if err != nil {
println("Problem executing Javascript.")
panic(err)
}
}

4
main.ts Normal file
View file

@ -0,0 +1,4 @@
import * as ts from "typescript";
V8Worker2.print("Hello World", ts.createProgram);

8
package.json Normal file
View file

@ -0,0 +1,8 @@
{
"name": "deno",
"dependencies": {},
"devDependencies": {
"parcel-bundler": "^1.8.1",
"typescript": "^2.8.3"
}
}

23
tsconfig.json Normal file
View file

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"sourceMap": true,
"removeComments": true,
"preserveConstEnums": true,
"declaration": true,
"target": "es5",
"lib": ["es2015", "dom"],
"noEmit": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedParameters": false,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"allowUnreachableCode": false,
"experimentalDecorators": true
},
"include": ["*.ts"]
}