Skip to content

Commit

Permalink
fix a type error in bin test, and format imports
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 28, 2023
1 parent 4610b56 commit df78c1b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/bin.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import { foregroundChild } from 'foreground-child'
import { readFileSync } from 'node:fs'
import { readFile } from 'node:fs/promises'
import { resolve as pathResolve } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
import Module from 'node:module'
import { resolve as pathResolve } from 'node:path'
import { pathToFileURL } from 'node:url'

const [sMajor, sMinor] = process.versions.node.split('.')
/* c8 ignore start */
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { MessageChannel } from 'node:worker_threads'
import { DaemonClient } from './client.js'
import { getUrl } from './get-url.js'
import './hooks/require.js'
export * from './client.js'
export * from './types.js'

//@ts-ignore
Expand All @@ -22,7 +23,5 @@ if (typeof Module.register === 'function') {
port1.postMessage({ stderrIsTTY: !!process.stderr.isTTY })
}

export * from './client.js'

// the imp is a client of the daemon
export const tsimp = new DaemonClient()
2 changes: 1 addition & 1 deletion src/service/resolve-type-reference-directive-references.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ts from 'typescript'
import { getCurrentDirectory } from '../ts-sys-cached.js'
import { createModeAwareCacheKey } from './create-mode-aware-cache-key.js'
import { getCanonicalFileName } from './get-canonical-filename.js'
import { getCurrentDirectory } from '../ts-sys-cached.js'
import { tsconfig } from './tsconfig.js'

// ResolveTypeReferenceDirectiveReferences internal cache
Expand Down
2 changes: 1 addition & 1 deletion src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { SockDaemonServer } from 'sock-daemon'
import { fileURLToPath } from 'url'
import { equivalents, isTSExt, tsExts } from '../equivalents.js'
import { getUrl } from '../get-url.js'
import { fileExists } from '../ts-sys-cached.js'
import {
CompileResult,
PreloadResult,
Expand All @@ -19,7 +20,6 @@ import {
} from '../types.js'
import { getLanguageService } from './language-service.js'
import { load } from './load.js'
import { fileExists } from '../ts-sys-cached.js'

export const serviceName = 'tsimp'
export const daemonScript = fileURLToPath(
Expand Down
2 changes: 1 addition & 1 deletion test/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ t.test('help', async t => {
t.test('stop', async t => {
run(['--stop'])
t.throws(() =>
process.kill('SIGTERM', Number(readFileSync('.tsimp/daemon/pid')))
process.kill(Number(readFileSync('.tsimp/daemon/pid')), 'SIGTERM')
)
})

Expand Down

0 comments on commit df78c1b

Please sign in to comment.