feat: add pack script

Fixes #4
This commit is contained in:
Karl-Philipp Wulfert
2019-01-14 17:57:18 +01:00
parent 5194c0fb11
commit 7438465149
6 changed files with 582 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 StApps
* Copyright (C) 2018-2019 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
@@ -15,7 +15,8 @@
import * as commander from 'commander';
import {existsSync, readFileSync, writeFileSync} from 'fs';
import {join, resolve} from 'path';
import {getProjectReflection, logger, mkdirPromisified, readFilePromisifed} from './common';
import {getProjectReflection, logger, mkdirPromisified, readFilePromisified} from './common';
import {pack} from './pack';
import {gatherRouteInformation, generateDocumentationForRoute, getNodeMetaInformationMap} from './routes';
import {Converter, getValidatableTypesFromReflection} from './schema';
import {validateFiles, writeReport} from './validate';
@@ -91,7 +92,7 @@ commander
logger.info(`Using ${corePackageJsonPath} to determine version for schemas.`);
const buffer = await readFilePromisifed(corePackageJsonPath);
const buffer = await readFilePromisified(corePackageJsonPath);
const corePackageJson = JSON.parse(buffer.toString());
const coreVersion = corePackageJson.version;
@@ -141,6 +142,12 @@ commander
}
});
commander
.command('pack')
.action(async () => {
await pack();
});
commander
.parse(process.argv);