Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeDoc ignore sourceLinkTemplate and gitRevision #2828

Open
its-dibo opened this issue Jan 8, 2025 · 2 comments
Open

TypeDoc ignore sourceLinkTemplate and gitRevision #2828

its-dibo opened this issue Jan 8, 2025 · 2 comments
Labels
bug Functionality does not match expectation

Comments

@its-dibo
Copy link

its-dibo commented Jan 8, 2025

This is the output of typedoc --show-config

"gitRevision": "main",
"sourceLinkTemplate": "https://github.com/AMK-LLC/mashrouk/blob/main/{path}#L1{line}",
$ typedoc --show-config
{
  options: '',
  tsconfig: '',
  compilerOptions: undefined,
  lang: 'en',
  locales: {},
  packageOptions: {},
  entryPoints: [ '/workspaces/mashrouk/apps/*', '/workspaces/mashrouk/packages/*' ],
  entryPointStrategy: 'packages',
  alwaysCreateEntryPointModule: false,
  projectDocuments: [],
  exclude: [ '**/*.spec.ts', '**/node_modules/**', '**/dist/**' ],
  externalPattern: [ '**/node_modules/**' ],
  excludeExternals: false,
  excludeNotDocumented: false,
  excludeNotDocumentedKinds: [
    'Module',               'Namespace',
    'Enum',                 'Variable',
    'Function',             'Class',
    'Interface',            'Constructor',
    'Property',             'Method',
    'CallSignature',        'IndexSignature',
    'ConstructorSignature', 'Accessor',
    'GetSignature',         'SetSignature',
    'TypeAlias',            'Reference'
  ],
  excludeInternal: false,
  excludeCategories: [],
  excludePrivate: true,
  excludeProtected: false,
  excludeReferences: false,
  externalSymbolLinkMappings: {},
  outputs: undefined,
  out: '/workspaces/mashrouk/docs',
  html: '',
  json: '',
  pretty: true,
  emit: 'docs',
  theme: 'default',
  lightHighlightTheme: 'light-plus',
  darkHighlightTheme: 'dark-plus',
  highlightLanguages: [
    'bash',       'console',
    'css',        'html',
    'javascript', 'json',
    'jsonc',      'json5',
    'yaml',       'tsx',
    'typescript'
  ],
  ignoredHighlightLanguages: [],
  typePrintWidth: 80,
  customCss: '',
  customJs: '',
  markdownItOptions: { html: true, linkify: true },
  markdownItLoader: [Function: defaultValue],
  maxTypeConversionDepth: 10,
  name: '',
  includeVersion: true,
  disableSources: false,
  sourceLinkTemplate: 'https://github.com/AMK-LLC/mashrouk/blob/main/{path}#L1{line}',
  gitRevision: 'main',
  gitRemote: 'origin',
  disableGit: false,
  basePath: '',
  readme: '',
  cname: '',
  favicon: '',
  sourceLinkExternal: true,
  markdownLinkExternal: true,
  githubPages: true,
  hostedBaseUrl: '',
  useHostedBaseUrlForAbsoluteLinks: false,
  hideGenerator: true,
  customFooterHtml: '',
  customFooterHtmlDisableWrapper: false,
  cacheBust: false,
  searchInComments: false,
  searchInDocuments: false,
  cleanOutputDir: true,
  titleLink: '',
  navigationLinks: {},
  sidebarLinks: {},
  navigationLeaves: [],
  navigation: {
    includeCategories: false,
    includeGroups: false,
    includeFolders: true,
    compactFolders: true,
    excludeReferences: false
  },
  headings: { readme: true, document: false },
  sluggerConfiguration: { lowercase: true },
  includeHierarchySummary: true,
  visibilityFilters: {
    protected: false,
    private: false,
    inherited: true,
    external: false
  },
  searchCategoryBoosts: {},
  searchGroupBoosts: {},
  useFirstParagraphOfCommentAsSummary: false,
  jsDocCompatibility: {
    defaultTag: true,
    exampleTag: true,
    inheritDocTag: true,
    ignoreUnescapedBraces: true
  },
  suppressCommentWarningsInDeclarationFiles: true,
  commentStyle: 'jsdoc',
  useTsLinkResolution: true,
  preserveLinkText: true,
  blockTags: [
    '@defaultValue',     '@deprecated',
    '@example',          '@param',
    '@privateRemarks',   '@remarks',
    '@returns',          '@see',
    '@throws',           '@typeParam',
    '@author',           '@callback',
    '@category',         '@categoryDescription',
    '@default',          '@document',
    '@extends',          '@augments',
    '@yields',           '@group',
    '@groupDescription', '@import',
    '@inheritDoc',       '@jsx',
    '@license',          '@module',
    '@mergeModuleWith',  '@prop',
    '@property',         '@return',
    '@satisfies',        '@since',
    '@template',         '@type',
    '@typedef',          '@summary'
  ],
  inlineTags: [
    '@link',
    '@inheritDoc',
    '@label',
    '@linkcode',
    '@linkplain',
    '@include',
    '@includeCode'
  ],
  modifierTags: [
    '@alpha',                '@beta',
    '@eventProperty',        '@experimental',
    '@internal',             '@override',
    '@packageDocumentation', '@public',
    '@readonly',             '@sealed',
    '@virtual',              '@abstract',
    '@class',                '@enum',
    '@event',                '@expand',
    '@hidden',               '@hideCategories',
    '@hideconstructor',      '@hideGroups',
    '@ignore',               '@inline',
    '@interface',            '@namespace',
    '@overload',             '@private',
    '@protected',            '@showCategories',
    '@showGroups',           '@useDeclaredType'
  ],
  excludeTags: [
    '@override',
    '@virtual',
    '@privateRemarks',
    '@satisfies',
    '@overload',
    '@inline'
  ],
  notRenderedTags: [
    '@showCategories',
    '@showGroups',
    '@hideCategories',
    '@hideGroups',
    '@expand',
    '@summary',
    '@group',
    '@groupDescription',
    '@category',
    '@categoryDescription'
  ],
  cascadedModifierTags: [ '@alpha', '@beta', '@experimental' ],
  categorizeByGroup: false,
  groupReferencesByType: false,
  defaultCategory: 'Other',
  categoryOrder: [],
  groupOrder: [],
  sort: [ 'kind', 'instance-first', 'alphabetical-ignoring-documents' ],
  sortEntryPoints: true,
  kindSortOrder: [],
  watch: false,
  preserveWatchOutput: false,
  skipErrorChecking: false,
  help: false,
  version: false,
  showConfig: true,
  plugin: [],
  logLevel: 1,
  treatWarningsAsErrors: false,
  treatValidationWarningsAsErrors: false,
  intentionallyNotExported: [],
  requiredToBeDocumented: [
    'Enum',     'EnumMember',
    'Variable', 'Function',
    'Class',    'Interface',
    'Property', 'Method',
    'Accessor', 'TypeAlias'
  ],
  validation: {
    notExported: true,
    invalidLink: true,
    rewrittenLink: true,
    notDocumented: false,
    unusedMergeModuleWith: true
  }
}

when running typedoc in github actions the generated link for defined in, uses commit hash, resulting in generating new files on each merge, like this

https://github.com/AMK-LLC/mashrouk/blob/68b9fb46ab60e113b66d4a4959646f1d45d4dd89/apps/auth/src/api/auth/auth.controller.ts#L14

I expected the generated link is free of the commit hash, either by using gitRevision or sourceLinkTemplate

even when running typedoc locally, relative links are generated, sourceLinkTemplate is not used at all

Env

node: v22.12.0
typedoc: 0.27.6

@its-dibo its-dibo added the bug Functionality does not match expectation label Jan 8, 2025
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 9, 2025

Both of those options are conversion-time options, which means that in packages mode they need to be set within the child projects, not at the top level.

// typedoc.jsonc
{
  "packageOptions": {
     // set in here, or within each package
  }
}

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 9, 2025

TypeDoc really probably ought to check for options which are set at the packages level when running in packages mode and produce a warning if they will not have any effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants