Skip to content

Commit

Permalink
feat(dgeni)!: move design examples under design/ subpath
Browse files Browse the repository at this point in the history
BREAKING CHANGE: design examples have moved from `/docs/design-examples` to `/docs/design/examples` (#2968)
  • Loading branch information
griest024 committed Aug 14, 2024
1 parent 3a3df2a commit 887a515
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Package } from 'dgeni';


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

import { DesignExampleConvertToJsonProcessor } from './processors/convertToJson';
import { DesignExampleDocumentCreatorProcessor } from './processors/designExampleDocumentCreator';
Expand All @@ -16,8 +21,6 @@ import {
} from '../config';
import { daffodilBasePackage } from '../daffodil-base-package';

const typescriptPackage = require('dgeni-packages/typescript');

export const designExamplePackage = new Package('daffodil-design-examples', [daffodilBasePackage])
.factory('designExampleReader', designExampleReaderFactory)
.processor('convertToJson', (log, createDocMessage) => new DesignExampleConvertToJsonProcessor(log, createDocMessage))
Expand All @@ -38,11 +41,10 @@ export const designExamplePackage = new Package('daffodil-design-examples', [daf
convertToJson.docTypes = convertToJson.docTypes.concat(['design-example']);
})
.config((computePathsProcessor) => {
const DOCS_SEGMENT = 'design-examples';
computePathsProcessor.pathTemplates.push({
docTypes: ['design-example'],
getPath: (doc) => {
doc.moduleFolder = `${DAFF_DOCS_PATH}/${DOCS_SEGMENT}/${doc.id}`;
doc.moduleFolder = `${DAFF_DOCS_PATH}/${DAFF_DOCS_DESIGN_PATH}/${DAFF_DOC_KIND_PATH_SEGMENT_MAP[DaffDocKind.EXAMPLE]}/${doc.id}`;
return doc.moduleFolder;
},
outputPathTemplate: '${moduleFolder}.json',
Expand Down

0 comments on commit 887a515

Please sign in to comment.