Skip to content

Commit

Permalink
fix(dgeni): correctly prefix API doc link paths (#2956)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 authored Aug 8, 2024
1 parent db026e9 commit 9e95dd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/dgeni/src/transforms/daffodil-api-package/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Package } from 'dgeni';

import {
DAFF_DOC_KIND_PATH_SEGMENT_MAP,
DaffDocKind,
} from '@daffodil/docs-utils';

import { DAFF_DGENI_EXCLUDED_PACKAGES_REGEX } from '../../constants/excluded-packages';
import { AddInheritedDocsContentProcessor } from '../../processors/addInheritedDocsContent';
import { AddLinkTagToDaffodilReferencesProcessor } from '../../processors/addLinkTagToDaffodilReferences';
Expand All @@ -19,7 +24,7 @@ import { daffodilBasePackage } from '../daffodil-base-package';
const linksPackage = require('dgeni-packages/links');
const typescriptPackage = require('dgeni-packages/typescript');

export const apiDocs = new Package('checkout', [
export const apiDocs = new Package('daffodil-api', [
daffodilBasePackage,
typescriptPackage,
linksPackage,
Expand Down Expand Up @@ -56,7 +61,7 @@ export const apiDocs = new Package('checkout', [
})
.config((computePathsProcessor, EXPORT_DOC_TYPES, generateApiList) => {

const API_SEGMENT = 'api';
const API_SEGMENT = DAFF_DOC_KIND_PATH_SEGMENT_MAP[DaffDocKind.API];

generateApiList.outputFolder = API_SEGMENT;

Expand All @@ -70,7 +75,7 @@ export const apiDocs = new Package('checkout', [
});
computePathsProcessor.pathTemplates.push({
docTypes: EXPORT_DOC_TYPES,
pathTemplate: '${moduleDoc.moduleFolder}/${name}',
pathTemplate: 'docs/${moduleDoc.moduleFolder}/${name}',
outputPathTemplate: '${moduleDoc.moduleFolder}/${safeName}.json',
});
})
Expand Down
2 changes: 2 additions & 0 deletions tools/dgeni/src/transforms/daffodil-base-package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const daffodilBasePackage = new Package('daffodil-base', [

// Where do we write the output files?
.config((writeFilesProcessor) => {
// TODO: consider changing this to the parent so that the doc paths automatically include `docs/`
// we would avoid having to do things like https://github.com/graycoreio/daffodil/blob/db026e91c2e46b6ac895da86003f2f612800d917/tools/dgeni/src/transforms/daffodil-guides-package/processors/generateGuideList.ts#L15
writeFilesProcessor.outputFolder = DOCS_OUTPUT_PATH;
})

Expand Down

0 comments on commit 9e95dd3

Please sign in to comment.