Skip to content

Commit 5a1aa3e

Browse files
committed
fixup!
1 parent 40018a5 commit 5a1aa3e

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

src/generators/metadata/generate.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
import { parseApiDoc } from './utils/parse.mjs';
4+
import { parseTypeMap } from '../../parsers/json.mjs';
45
import getConfig from '../../utils/configuration/index.mjs';
5-
import { importFromURL } from '../../utils/url.mjs';
66

77
/**
88
* Process a chunk of API doc files in a worker thread.
@@ -28,7 +28,7 @@ export async function processChunk(fullInput, itemIndices, typeMap) {
2828
export async function* generate(inputs, worker) {
2929
const { metadata: config } = getConfig();
3030

31-
const typeMap = await importFromURL(config.typeMap);
31+
const typeMap = await parseTypeMap(config.typeMap);
3232

3333
// Stream chunks as they complete - allows dependent generators
3434
// to start collecting/preparing while we're still processing

src/generators/metadata/index.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,5 @@ export default createLazyGenerator({
1616

1717
dependsOn: 'ast',
1818

19-
defaultConfiguration: {
20-
typeMap: import.meta.resolve('./maps/hardcoded.json'),
21-
},
22-
2319
hasParallelProcessor: true,
2420
});

src/generators/metadata/types.d.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1-
import type {
2-
Root,
3-
Position,
4-
Node,
5-
Data,
6-
Parent,
7-
Blockquote,
8-
Heading,
9-
} from 'mdast';
1+
import type { Root, Position, Node, Data, Blockquote, Heading } from 'mdast';
102

113
export type Generator = GeneratorMetadata<
12-
{
13-
/** Type mapping configuration for AST node processing */
14-
typeMap: string | URL;
15-
},
4+
{},
165
Generate<Array<Root>, AsyncGenerator<MetadataEntry>>,
176
ProcessChunk<Root, MetadataEntry, Record<string, string>>
187
>;

0 commit comments

Comments
 (0)