chore(cli): 导入工具函数

This commit is contained in:
roymondchen 2023-03-14 21:28:35 +08:00
parent b16c1fa5fc
commit 763038cc11
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
import type Core from './Core'; import type Core from './Core';
export type App = Core;
export enum EntryType { export enum EntryType {
CONFIG = 'config', CONFIG = 'config',
VALUE = 'value', VALUE = 'value',

View File

@ -67,14 +67,14 @@ const generateContent = (
`); `);
}; };
const prettyCode = (code: string) => export const prettyCode = (code: string) =>
recast.prettyPrint(recast.parse(code.replace(/\\/g, '/'), { parser: require('recast/parsers/typescript') }), { recast.prettyPrint(recast.parse(code.replace(/\\/g, '/'), { parser: require('recast/parsers/typescript') }), {
tabWidth: 2, tabWidth: 2,
trailingComma: true, trailingComma: true,
quote: 'single', quote: 'single',
}).code; }).code;
const makeCamelCase = function (name: string): string { export const makeCamelCase = function (name: string): string {
if (typeof name !== 'string') { if (typeof name !== 'string') {
return ''; return '';
} }