diff --git a/scripts/generate-output.ts b/scripts/generate-output.ts new file mode 100644 index 0000000..4977c0f --- /dev/null +++ b/scripts/generate-output.ts @@ -0,0 +1,14 @@ +import path from 'path' +import { generate } from '../src' + +console.log('Generating output...', path.join(__dirname, '..')) + +generate({ + cwd: path.join(__dirname, '..'), + root: path.join(__dirname, '..', 'fixtures/input'), + outdir: path.join(__dirname, '..', 'fixtures/output'), + clean: true, + tsconfigPath: path.join(__dirname, '..', 'tsconfig.json'), +}) + +console.log('Generated') diff --git a/src/index.ts b/src/index.ts index 998677e..e829207 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ export { config } from './config' +export * from './extract' export * from './generate' export * from './types' export * from './utils' diff --git a/src/utils.ts b/src/utils.ts index 9f5735f..fba8a1b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,5 @@ import { readdir, readFile } from 'node:fs/promises' import { extname, join } from 'node:path' -import { formatComment } from './utils' import { config } from './config' import { type DtsGenerationConfig } from './types' @@ -62,7 +61,7 @@ export function formatDeclarations(declarations: string): string { result = result.replace(/\/\*\*\n([^*]*)(\n \*\/)/g, (match, content) => { const formattedContent = content .split('\n') - .map(line => ` *${line.trim() ? ' ' + line.trim() : ''}`) + .map((line: string) => ` *${line.trim() ? ' ' + line.trim() : ''}`) .join('\n') return `/**\n${formattedContent}\n */` })