Skip to content

Commit 5888849

Browse files
committed
feat: unique temp dir
1 parent c5116b2 commit 5888849

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/emit.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { createRequire } from 'node:module'
44
import { emitDts } from 'svelte2tsx'
55
import { existsSync } from 'node:fs'
66
import glob from 'tiny-glob'
7-
import { r } from './utils/log'
87

98
const require = createRequire(import.meta.url)
109

1110
const DEBUG_MODE = typeof process.env['DEBUG'] == 'string'
12-
const TEMP_DIR = resolve('.extractinator/dts')
1311

1412
export async function emit_dts(input: string) {
13+
//? Generate a unique TEMP_DIR for this instance of extractinator
14+
const TEMP_DIR = resolve(`.extractinator/dts-${DEBUG_MODE ? 'debug' : Date.now()}`)
15+
1516
if (!DEBUG_MODE || !existsSync(TEMP_DIR)) {
1617
//? Cleanup & Create the TEMP_DIR
1718
await rm(TEMP_DIR, { force: true, recursive: true })

src/extractinator.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ export async function extractinator(input: string, output: string, tsdocConfigPa
2020
project.addSourceFileAtPath(dts_path)
2121
}
2222

23-
// project.addSourceFilesAtPaths(`${dts.location}/**/*?(.svelte).d.ts`)
24-
2523
//? Make sure the output directory exists
2624
await mkdir(output, { recursive: true })
2725

0 commit comments

Comments
 (0)