File tree Expand file tree Collapse file tree 5 files changed +23
-20
lines changed Expand file tree Collapse file tree 5 files changed +23
-20
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @fake-scope/fake-pkg " : patch
3
+ ---
4
+
5
+ fix: resolve circular imports in worker
Original file line number Diff line number Diff line change @@ -4,15 +4,9 @@ import path from 'node:path'
4
4
import { pathToFileURL } from 'node:url'
5
5
6
6
import type { Position } from 'acorn'
7
- import { createSyncFn } from 'synckit'
8
7
import type { Point } from 'unist'
9
8
10
- import type {
11
- NormalPosition ,
12
- WorkerOptions ,
13
- WorkerParseResult ,
14
- WorkerProcessResult ,
15
- } from './types'
9
+ import type { NormalPosition } from './types'
16
10
17
11
export const last = < T > ( items : T [ ] | readonly T [ ] ) =>
18
12
items && items [ items . length - 1 ]
@@ -221,10 +215,3 @@ export const nextCharOffsetFactory = (text: string) => {
221
215
}
222
216
}
223
217
}
224
-
225
- const workerPath = require . resolve ( './worker' )
226
-
227
- export const performSyncWork = createSyncFn ( workerPath ) as ( (
228
- options : Omit < WorkerOptions , 'process' > ,
229
- ) => WorkerParseResult ) &
230
- ( ( options : WorkerOptions & { process : true } ) => WorkerProcessResult )
Original file line number Diff line number Diff line change 1
1
export * from './helpers'
2
2
export * from './parser'
3
+ export * from './sync'
3
4
export * from './types'
Original file line number Diff line number Diff line change @@ -3,12 +3,8 @@ import path from 'node:path'
3
3
import type { Linter } from 'eslint'
4
4
import type { VFileMessage } from 'vfile-message'
5
5
6
- import {
7
- arrayify ,
8
- normalizePosition ,
9
- performSyncWork ,
10
- getPhysicalFilename ,
11
- } from './helpers'
6
+ import { arrayify , normalizePosition , getPhysicalFilename } from './helpers'
7
+ import { performSyncWork } from './sync'
12
8
import type { ParserOptions , WorkerParseResult } from './types'
13
9
14
10
export const DEFAULT_EXTENSIONS : readonly string [ ] = [ '.mdx' ]
Original file line number Diff line number Diff line change
1
+ import { createSyncFn } from 'synckit'
2
+
3
+ import type {
4
+ WorkerOptions ,
5
+ WorkerParseResult ,
6
+ WorkerProcessResult ,
7
+ } from './types'
8
+
9
+ const workerPath = require . resolve ( './worker' )
10
+
11
+ export const performSyncWork = createSyncFn ( workerPath ) as ( (
12
+ options : Omit < WorkerOptions , 'process' > ,
13
+ ) => WorkerParseResult ) &
14
+ ( ( options : WorkerOptions & { process : true } ) => WorkerProcessResult )
You can’t perform that action at this time.
0 commit comments