Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Oct 17, 2024
1 parent 35d193f commit 7672e85
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions scripts/generate-output.ts
Original file line number Diff line number Diff line change
@@ -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')
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { config } from './config'
export * from './extract'
export * from './generate'
export * from './types'
export * from './utils'
3 changes: 1 addition & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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 */`
})
Expand Down

0 comments on commit 7672e85

Please sign in to comment.