@@ -6,11 +6,8 @@ import { checkIndirectReferences } from './utils/checkIndirectReferences.mjs';
66import { extractExports } from './utils/extractExports.mjs' ;
77import { findDefinitions } from './utils/findDefinitions.mjs' ;
88import getConfig from '../../utils/configuration/index.mjs' ;
9- import {
10- GITHUB_BLOB_URL ,
11- populate ,
12- } from '../../utils/configuration/templates.mjs' ;
13- import { writeFile } from '../../utils/file.mjs' ;
9+ import { populate } from '../../utils/configuration/templates.mjs' ;
10+ import { withExt , writeFile } from '../../utils/file.mjs' ;
1411
1512/**
1613 * Generates the `apilinks.json` file.
@@ -33,16 +30,19 @@ export async function generate(input) {
3330 */
3431 const nameToLineNumberMap = { } ;
3532
36- // `http.js` -> `http`
37- const baseName = basename ( program . path , '.js' ) ;
33+ const fileName = basename ( program . path ) ;
34+ const baseName = withExt ( fileName ) ;
3835
3936 const exports = extractExports ( program , baseName , nameToLineNumberMap ) ;
4037
4138 findDefinitions ( program , baseName , nameToLineNumberMap , exports ) ;
4239
4340 checkIndirectReferences ( program , exports , nameToLineNumberMap ) ;
4441
45- const fullGitUrl = `${ populate ( GITHUB_BLOB_URL , config ) } lib/${ baseName } .js` ;
42+ const fullGitUrl = populate ( config . sourceURL , {
43+ ...config ,
44+ fileName,
45+ } ) ;
4646
4747 // Add the exports we found in this program to our output
4848 Object . keys ( nameToLineNumberMap ) . forEach ( key => {
0 commit comments