Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/generators/api-links/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import { basename, dirname, join } from 'node:path';
import { writeFile } from 'node:fs/promises';
import {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete these utils if they're not used anywhere else?

getBaseGitHubUrl,
getCurrentGitHash,
} from './utils/getBaseGitHubUrl.mjs';
import { extractExports } from './utils/extractExports.mjs';
import { findDefinitions } from './utils/findDefinitions.mjs';
import { checkIndirectReferences } from './utils/checkIndirectReferences.mjs';
Expand Down Expand Up @@ -54,9 +50,9 @@ export default {
if (input.length > 0) {
const repositoryDirectory = dirname(input[0].path);

const repository = getBaseGitHubUrl(repositoryDirectory);
const repository = 'https://github.com/nodejs/node';

const tag = getCurrentGitHash(repositoryDirectory);
const tag = 'HEAD';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it fine for us to assume HEAD?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dev it shouldn't really matter, but for releases it needs to be a hash since the line numbers referenced are going to change eventually.

I.e. for the latest v20 release, https://github.com/nodejs/node/blob/bb1a61d8737feff534bb85368dab3b7c554c863d/lib/_http_client.js#L869 is correct vs https://github.com/nodejs/node/blob/HEAD/lib/_http_client.js#L869 points to something else.


baseGithubLink = `${repository}/blob/${tag}`;
}
Expand Down
Loading