@zwa73/dev-utils 1.0.36 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ const CmdGenSchema = (program) => program
|
|
12
12
|
.option("-p, --project <path>", "tsconfig路径 默认tsconfig.json", "tsconfig.json")
|
13
13
|
.option("-o, --outDir <dir>", "schema输出路径目录 默认 ./schema/")
|
14
14
|
.action(async (opt) => {
|
15
|
-
await UtilDevTool_1.UtilDT.
|
15
|
+
await UtilDevTool_1.UtilDT.generateSchema(process.cwd(), {
|
16
16
|
include: opt.include,
|
17
17
|
exclude: opt.ignore,
|
18
18
|
project: opt.project,
|
package/dist/UtilDevTool.d.ts
CHANGED
@@ -29,7 +29,7 @@ export declare namespace UtilDT {
|
|
29
29
|
* @param opt.project - tsconfig路径
|
30
30
|
* @param opt.outDir - schema输出路径目录 默认 ./schema/
|
31
31
|
*/
|
32
|
-
export function
|
32
|
+
export function generateSchema(dir: string, opt?: BuildSchemaOpt): Promise<void>;
|
33
33
|
/**运行所有匹配的的js/ts文件
|
34
34
|
* @async
|
35
35
|
* @param dir - 基础目录
|
package/dist/UtilDevTool.js
CHANGED
@@ -40,7 +40,7 @@ var UtilDT;
|
|
40
40
|
* @param opt.project - tsconfig路径
|
41
41
|
* @param opt.outDir - schema输出路径目录 默认 ./schema/
|
42
42
|
*/
|
43
|
-
async function
|
43
|
+
async function generateSchema(dir, opt) {
|
44
44
|
//生成
|
45
45
|
const settings = {
|
46
46
|
required: true,
|
@@ -60,7 +60,7 @@ var UtilDT;
|
|
60
60
|
//进行预处理并展开
|
61
61
|
await expandSchema(schemasPath, schema, opt?.coverDefine ?? {});
|
62
62
|
}
|
63
|
-
UtilDT.
|
63
|
+
UtilDT.generateSchema = generateSchema;
|
64
64
|
/**展开schema以供使用 */
|
65
65
|
async function expandSchema(schemasPath, schema, coverDefine) {
|
66
66
|
//覆盖
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
package/src/Command/GenSchema.ts
CHANGED
@@ -11,7 +11,7 @@ export const CmdGenSchema = (program:Command) => program
|
|
11
11
|
.option("-p, --project <path>", "tsconfig路径 默认tsconfig.json","tsconfig.json")
|
12
12
|
.option("-o, --outDir <dir>", "schema输出路径目录 默认 ./schema/")
|
13
13
|
.action(async (opt) => {
|
14
|
-
await UtilDT.
|
14
|
+
await UtilDT.generateSchema(process.cwd(), {
|
15
15
|
include: opt.include,
|
16
16
|
exclude: opt.ignore,
|
17
17
|
project: opt.project,
|
package/src/UtilDevTool.ts
CHANGED
@@ -39,7 +39,7 @@ type BuildSchemaOpt = Partial<{
|
|
39
39
|
* @param opt.project - tsconfig路径
|
40
40
|
* @param opt.outDir - schema输出路径目录 默认 ./schema/
|
41
41
|
*/
|
42
|
-
export async function
|
42
|
+
export async function generateSchema(dir:string,opt?:BuildSchemaOpt){
|
43
43
|
//生成
|
44
44
|
const settings: TJS.PartialArgs = {
|
45
45
|
required: true,
|
package/schema/schemas.json
DELETED