Comparing version 0.0.3-23 to 0.0.3-24
@@ -13,2 +13,3 @@ #!/usr/bin/env ts-node | ||
const repl_1 = require("./cli/repl"); | ||
const template_1 = require("./cli/template"); | ||
const testing_1 = require("./cli/testing"); | ||
@@ -37,2 +38,4 @@ const utils_1 = require("./cli/utils"); | ||
return result_1.Ok("format"); | ||
case "template": | ||
return result_1.Ok("template"); | ||
default: { | ||
@@ -92,2 +95,6 @@ return result_1.Err(`Unknown command \`${process.argv[2]}\``); | ||
} | ||
case "template": { | ||
await template_1.template(isInPackageDirectory, argv); | ||
return 0; | ||
} | ||
} | ||
@@ -94,0 +101,0 @@ } |
@@ -70,3 +70,3 @@ "use strict"; | ||
function generateProperty(syntax) { | ||
return `${syntax.name}: ${generateType(syntax.type)}`; | ||
return `${syntax.name}: ${generateTopLevelType(syntax.type)}`; | ||
} | ||
@@ -73,0 +73,0 @@ function generateTypeAlias(syntax) { |
{ | ||
"name": "derw", | ||
"version": "0.0.3-23", | ||
"version": "0.0.3-24", | ||
"description": "An Elm-inspired language that transpiles to TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -507,2 +507,8 @@ # derw | ||
- [x] Template generation | ||
``` | ||
derw template --path src/Main.derw --template web | ||
``` | ||
# 2.0.0 | ||
@@ -509,0 +515,0 @@ |
@@ -10,2 +10,3 @@ #!/usr/bin/env ts-node | ||
import { repl } from "./cli/repl"; | ||
import { template } from "./cli/template"; | ||
import { runTests } from "./cli/testing"; | ||
@@ -22,3 +23,4 @@ import { fileExists } from "./cli/utils"; | ||
| "bundle" | ||
| "format"; | ||
| "format" | ||
| "template"; | ||
@@ -47,2 +49,4 @@ function parseCliCommand(): Result<string, CliCommand> { | ||
return Ok("format"); | ||
case "template": | ||
return Ok("template"); | ||
default: { | ||
@@ -107,2 +111,6 @@ return Err(`Unknown command \`${process.argv[2]}\``); | ||
} | ||
case "template": { | ||
await template(isInPackageDirectory, argv); | ||
return 0; | ||
} | ||
} | ||
@@ -109,0 +117,0 @@ } |
@@ -145,3 +145,3 @@ import { exportTests } from "../blocks"; | ||
function generateProperty(syntax: Property): string { | ||
return `${syntax.name}: ${generateType(syntax.type)}`; | ||
return `${syntax.name}: ${generateTopLevelType(syntax.type)}`; | ||
} | ||
@@ -148,0 +148,0 @@ |
804348
117
23122
550
13