Skip to content

Commit

Permalink
feat: move typedoc documentation template away from common setup (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
pevisscher authored Jan 23, 2025
1 parent 9a44d48 commit 02ee379
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

if: ${{ inputs.publish_docs == 'true' && (github.ref == 'refs/heads/next' || github.ref == 'refs/heads/main') }}
if: ${{ inputs.publish_docs == 'true' && contains(fromJSON(inputs.package_json).scripts, 'build:docs') && (github.ref == 'refs/heads/next' || github.ref == 'refs/heads/main') }}
steps:
- uses: actions/checkout@v4
- name: Create semantic-release cache file
Expand Down
1 change: 0 additions & 1 deletion examples/yargs-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"files": ["bin", ".dist", "package.json"],
"scripts": {
"build": "tsc -p tsconfig.dist.json",
"build:docs": "npx typedoc",
"check:coverage": "vitest run --coverage=true",
"check:project": "node-standards lint",
"check:types": "tsc -p tsconfig.json",
Expand Down
7 changes: 0 additions & 7 deletions examples/yargs-cli/typedoc.cjs

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"scripts": {
"build": "tsc -p tsconfig.dist.json",
"prebuild:docs": "npm ci",
"build:docs": "npx typedoc",
"check:coverage": "vitest run --coverage=true",
"check:project": "node-standards lint",
"check:types": "tsc -p tsconfig.json",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/templates/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const CommonTypescriptTemplate: ProjectTemplateBuilder = {
build: 'tsc -p tsconfig.dist.json',
'build:clean': undefined,
'prebuild:docs': 'npm ci',
'build:docs': 'npx typedoc',
'build:docs': undefined,
'check:cost': undefined,
'check:coverage': 'vitest run --coverage=true',
'check:full': undefined,
Expand Down
1 change: 1 addition & 0 deletions src/lib/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export { CommonTemplate } from './common.js'
export { LibraryTemplate } from './library.js'
export { YargsCliTemplate } from './yargs-cli.js'
export { DocusaurusTemplate } from './docusaurus.js'
export { TypedocTemplate } from './typedoc.js'
export type { ProjectTemplateBuilder, ProjectTemplate } from './types.js'
14 changes: 14 additions & 0 deletions src/lib/templates/typedoc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { ProjectTemplate } from './types.js'

import { repositoryUrl, rootDirectory } from '../constants.js'

export const TypedocTemplate: ProjectTemplate = {
type: 'typedoc',
template: {
repositoryUrl,
scripts: {
'build:docs': 'npx typedoc',
},
roots: [rootDirectory],
},
}
1 change: 1 addition & 0 deletions templates/common-typescript/-typedoc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// moved to own template
7 changes: 0 additions & 7 deletions templates/common-typescript/typedoc.cjs

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions typedoc.cjs

This file was deleted.

0 comments on commit 02ee379

Please sign in to comment.