Comparing version 0.0.3 to 0.0.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const validator_1 = require("@lbu/validator"); | ||
const fs_1 = require("fs"); | ||
const path_1 = require("path"); | ||
@@ -15,6 +13,3 @@ const lint_1 = require("./lint"); | ||
} | ||
if (!ctx.config || | ||
!ctx.config.generate || | ||
!ctx.config.generate.inputFile || | ||
!ctx.config.generate.outputDir) { | ||
if (!ctx.config || !ctx.config.generate || !ctx.config.generate.inputFile) { | ||
ctx.logger.error("Top-level key 'generate' is required in the lbu.json file"); | ||
@@ -25,3 +20,2 @@ return; | ||
inputFile: ctx.config.generate.inputFile, | ||
outputDir: ctx.config.generate.outputDir, | ||
}); | ||
@@ -35,13 +29,7 @@ }; | ||
} | ||
async function executeCodegen(logger, { inputFile, outputDir }) { | ||
async function executeCodegen(logger, { inputFile }) { | ||
require("@lbu/register"); | ||
require(path_1.join(process.cwd(), inputFile)); | ||
const outDir = path_1.join(process.cwd(), outputDir); | ||
if (!fs_1.existsSync(outDir)) { | ||
fs_1.mkdirSync(outDir, { recursive: true }); | ||
} | ||
const validationOutput = path_1.join(outDir, "validator.ts"); | ||
validator_1.runGenerators(validationOutput); | ||
await lint_1.lintCommand({ logger }, []); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZ2VuZXJhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSw4Q0FBeUU7QUFDekUsMkJBQTJDO0FBQzNDLCtCQUE0QjtBQUM1QixpQ0FBcUM7QUFFckMsbUNBQXFEO0FBRXJELE1BQU0sVUFBVSxHQUFZO0lBQzFCLElBQUksRUFBRSxtQkFBbUI7Q0FDMUIsQ0FBQztBQUVXLFFBQUEsZUFBZSxHQUFZLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxFQUFFO0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yxHQUFHLENBQUMsTUFBTSxJQUFJLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxRQUFRLElBQUksQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxTQUFTLEVBQUU7UUFDekUsR0FBRyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQ2QsMkRBQTJELENBQzVELENBQUM7UUFDRixPQUFPO0tBQ1I7SUFFRCxPQUFPLGNBQWMsQ0FBQyxHQUFHLENBQUMsTUFBTSxFQUFFO1FBQ2hDLFNBQVMsRUFBRSxHQUFHLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxTQUFTO0tBQ3pDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQztBQUVGLEtBQUssVUFBVSxtQkFBbUIsQ0FBQyxFQUFFLE1BQU0sRUFBYztJQUN2RCxNQUFNLEdBQUcsR0FBRztrQkFDSSxxQkFBYSxFQUFFOzBCQUNQLENBQUM7SUFFekIsTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNuQixDQUFDO0FBRUQsS0FBSyxVQUFVLGNBQWMsQ0FDM0IsTUFBYyxFQUNkLEVBQUUsU0FBUyxFQUF5QjtJQUVwQyxPQUFPLENBQUMsZUFBZSxDQUFDLENBQUM7SUFDekIsT0FBTyxDQUFDLFdBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsU0FBUyxDQUFDLENBQUMsQ0FBQztJQUV4QyxNQUFNLGtCQUFXLENBQUMsRUFBRSxNQUFNLEVBQUUsRUFBRSxFQUFFLENBQUMsQ0FBQztBQUNwQyxDQUFDIn0= |
{ | ||
"name": "@lbu/cli", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Lightbase backend utilities CLI", | ||
@@ -24,6 +24,5 @@ "bin": { | ||
"dependencies": { | ||
"@lbu/insight": "^0.0.3", | ||
"@lbu/register": "^0.0.3", | ||
"@lbu/stdlib": "^0.0.3", | ||
"@lbu/validator": "^0.0.3" | ||
"@lbu/insight": "^0.0.4", | ||
"@lbu/register": "^0.0.4", | ||
"@lbu/stdlib": "^0.0.4" | ||
}, | ||
@@ -44,3 +43,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "a193a6c8c4ae8fa52465e239ecbfdbf22041c47a" | ||
"gitHead": "efcd5097edec95c80c2b7f1e637f6a4f401e26f5" | ||
} |
# @lbu/cli | ||
Helps you use the Lightbase backend utilities | ||
Collection of Lightbase backend utilities | ||
## Why | ||
Here at [lightbase](https://lightbase.nl) we had a constantly growing | ||
boilerplate for new projects. To facilitate our needs more and to stop copying | ||
and pasting things around this project was born. This project is for now | ||
tailored at smaller & monolithic projects. | ||
## Docs | ||
## Development | ||
See [CONTRIBUTING.md](/CONTRIBUTING.md). |
{ | ||
"generate": { | ||
"inputFile": "./src/gen/index.ts", | ||
"outputDir": "./src/generated" | ||
"inputFile": "./src/gen/index.ts" | ||
} | ||
} |
@@ -14,10 +14,11 @@ { | ||
"dependencies": { | ||
"@lbu/insight": "0.0.3", | ||
"@lbu/register": "0.0.3", | ||
"@lbu/stdlib": "0.0.3" | ||
"@lbu/insight": "0.0.4", | ||
"@lbu/koa": "0.0.4", | ||
"@lbu/register": "0.0.4", | ||
"@lbu/stdlib": "0.0.4" | ||
}, | ||
"devDependencies": { | ||
"@lbu/cli": "0.0.3", | ||
"@lbu/lint-config": "0.0.3", | ||
"@lbu/validator": "0.0.3", | ||
"@lbu/cli": "0.0.4", | ||
"@lbu/code-gen": "0.0.4", | ||
"@lbu/lint-config": "0.0.4", | ||
"@types/node": "13.1.8", | ||
@@ -24,0 +25,0 @@ "eslint": "6.8.0", |
@@ -1,5 +0,12 @@ | ||
import { createValidator } from "@lbu/validator"; | ||
import { createApp, V } from "@lbu/code-gen"; | ||
import { join } from "path"; | ||
createValidator("TestInterfaceValidation", { | ||
foo: { type: "string", oneOf: ["bar"] }, | ||
}); | ||
const app = createApp(); | ||
app.validator( | ||
V("TestType").object({ | ||
myKey: V.string(), | ||
}), | ||
); | ||
app.build(join(process.cwd(), "src/generated")); |
import { log } from "@lbu/insight"; | ||
import { getApp } from "@lbu/koa"; | ||
log.info("Hi!"); | ||
const app = getApp({ | ||
enableHealthRoute: true, | ||
}); | ||
app.listen(3001); |
Sorry, the diff of this file is not supported yet
3
17
3
27718
36
349
+ Added@lbu/insight@0.0.4(transitive)
+ Added@lbu/stdlib@0.0.4(transitive)
- Removed@lbu/validator@^0.0.3
- Removed@lbu/insight@0.0.3(transitive)
- Removed@lbu/stdlib@0.0.3(transitive)
Updated@lbu/insight@^0.0.4
Updated@lbu/register@^0.0.4
Updated@lbu/stdlib@^0.0.4