Skip to content

Commit 2939177

Browse files
committed
cleanup
Signed-off-by: flakey5 <[email protected]>
1 parent a3d4182 commit 2939177

File tree

10 files changed

+12
-93
lines changed

10 files changed

+12
-93
lines changed

package-lock.json

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"acorn": "^8.14.0",
3333
"commander": "^13.1.0",
3434
"estree-util-visit": "^2.0.0",
35-
"gitconfiglocal": "^2.1.0",
3635
"dedent": "^1.5.3",
3736
"github-slugger": "^2.0.0",
3837
"glob": "^11.0.1",

src/generators.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import availableGenerators from './generators/index.mjs';
55
/**
66
* @typedef {{ ast: import('./generators/types.d.ts').GeneratorMetadata<ApiDocMetadataEntry, ApiDocMetadataEntry>}} AstGenerator The AST "generator" is a facade for the AST tree and it isn't really a generator
77
* @typedef {import('./generators/types.d.ts').AvailableGenerators & AstGenerator} AllGenerators A complete set of the available generators, including the AST one
8+
* @param markdownInput
9+
* @param jsInput
810
*
911
* This method creates a system that allows you to register generators
1012
* and then execute them in a specific order, keeping track of the
@@ -18,7 +20,7 @@ import availableGenerators from './generators/index.mjs';
1820
* Generators can also write to files. These would usually be considered
1921
* the final generators in the chain.
2022
*
21-
* @param {ApiDocMetadataEntry} input The parsed API doc metadata entries
23+
* @param {ApiDocMetadataEntry} markdownInput The parsed API doc metadata entries
2224
* @param {Array<import('acorn').Program>} parsedJsFiles
2325
*/
2426
const createGenerator = (markdownInput, jsInput) => {
@@ -30,8 +32,8 @@ const createGenerator = (markdownInput, jsInput) => {
3032
* @type {{ [K in keyof AllGenerators]: ReturnType<AllGenerators[K]['generate']> }}
3133
*/
3234
const cachedGenerators = {
33-
ast: Promise.resolve(input),
34-
'ast-js': Promise.resolve(parsedJsFiles),
35+
ast: Promise.resolve(markdownInput),
36+
'ast-js': Promise.resolve(jsInput),
3537
};
3638

3739
/**

src/generators/api-links/utils/extractExports.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,13 @@ export function extractExports(program, basename, nameToLineNumberMap) {
228228

229229
const TYPE_TO_HANDLER_MAP = {
230230
/**
231-
*
232-
* @param node
231+
* @param {import('acorn').Node} node
233232
*/
234233
ExpressionStatement: node =>
235234
handleExpression(node, basename, nameToLineNumberMap),
236235

237236
/**
238-
*
239-
* @param node
237+
* @param {import('acorn').Node} node
240238
*/
241239
VariableDeclaration: node =>
242240
handleVariableDeclaration(node, basename, nameToLineNumberMap),

src/generators/api-links/utils/findDefinitions.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-check
21
'use strict';
32

43
import { visit } from 'estree-util-visit';
@@ -153,22 +152,19 @@ export function findDefinitions(
153152
) {
154153
const TYPE_TO_HANDLER_MAP = {
155154
/**
156-
*
157-
* @param node
155+
* @param {import('acorn').Node} node
158156
*/
159157
ExpressionStatement: node =>
160158
handleAssignmentExpression(node, nameToLineNumberMap, exports),
161159

162160
/**
163-
*
164-
* @param node
161+
* @param {import('acorn').Node} node
165162
*/
166163
FunctionDeclaration: node =>
167164
handleFunctionDeclaration(node, basename, nameToLineNumberMap, exports),
168165

169166
/**
170-
*
171-
* @param node
167+
* @param {import('acorn').Node} node
172168
*/
173169
ClassDeclaration: node =>
174170
handleClassDeclaration(node, nameToLineNumberMap, exports),

src/generators/legacy-html/assets/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ code,
137137
.pre,
138138
span.type,
139139
a.type {
140-
font-family: SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'Courier New',
141-
monospace;
140+
font-family: SFMono-Regular, Menlo, Consolas, 'Liberation Mono',
141+
'Courier New', monospace;
142142
font-size: 0.9em;
143143
}
144144

src/metadata.mjs

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

3-
import { join } from 'node:path';
4-
53
import { u as createTree } from 'unist-builder';
64

75
import { compare } from 'semver';
@@ -149,9 +147,6 @@ const createMetadata = slugger => {
149147
api: apiDoc.stem,
150148
slug: sectionSlug,
151149
source_link,
152-
source_link_local: source_link
153-
? join(apiDoc.history[0], '..', '..', '..', source_link)
154-
: undefined,
155150
api_doc_source: `doc/api/${apiDoc.basename}`,
156151
added_in: added,
157152
deprecated_in: deprecated,

src/parser.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-check
21
'use strict';
32

43
import { u as createTree } from 'unist-builder';

src/types.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ declare global {
7171
slug: string;
7272
// The GitHub URL to the source of the API entry
7373
source_link: string | Array<string> | undefined;
74-
// The path to the JavaScript source for the API entry relative to its location locally (ex. `../node/lib/zlib.js`)
75-
source_link_local: string | undefined;
7674
// Path to the api doc file relative to the root of the nodejs repo root (ex/ `doc/api/addons.md`)
7775
api_doc_source: string;
7876
// When a said API section got added (in which version(s) of Node.js)

src/utils/git.mjs

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)