-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Implemented nextra and further refactoring
- Loading branch information
Showing
172 changed files
with
11,120 additions
and
17,893 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI [typedoc-plugin-frontmatter] | ||
on: | ||
push: | ||
paths: | ||
- packages/typedoc-plugin-frontmatter/** | ||
pull_request: | ||
paths: | ||
- packages/typedoc-plugin-frontmatter/** | ||
jobs: | ||
lint-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: ['18'] | ||
name: Node ${{ matrix.node }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'npm' | ||
- name: Install | ||
run: npm install | ||
- name: Lint | ||
run: npm run lint --workspace typedoc-plugin-frontmatter | ||
- name: Build | ||
run: npm run build --workspace typedoc-plugin-markdown --workspace typedoc-plugin-frontmatter | ||
- name: Test | ||
run: npm run test --workspace typedoc-plugin-frontmatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI [typedoc-plugin-remark] | ||
on: | ||
push: | ||
paths: | ||
- packages/typedoc-plugin-remark/** | ||
pull_request: | ||
paths: | ||
- packages/typedoc-plugin-remark/** | ||
jobs: | ||
lint-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: ['18'] | ||
name: Node ${{ matrix.node }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'npm' | ||
- name: Install | ||
run: npm install | ||
- name: Lint | ||
run: npm run lint --workspace typedoc-plugin-remark | ||
- name: Build | ||
run: npm run build --workspace typedoc-plugin-markdown --workspace typedoc-plugin-remark | ||
- name: Test | ||
run: npm run test --workspace typedoc-plugin-remark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# Packages | ||
|
||
| Package | Version | Downloads | Changelog | | ||
| :---| :---| :--- | --- | | ||
[typedoc-plugin-markdown](./packages/typedoc-plugin-markdown#readme) | ![npm](https://img.shields.io/npm/v/typedoc-plugin-markdown%2Fnext?style=flat-square&logo=npm) | ![Downloads](https://img.shields.io/npm/dm/typedoc-plugin-markdown) | [Changelog](./packages/typedoc-plugin-markdown/CHANGELOG.md) | | ||
[docusaurus-plugin-typedoc](./packages/docusaurus-plugin-typedoc#readme) | ![npm](https://img.shields.io/npm/v/docusaurus-plugin-typedoc%2Fnext?style=flat-square&logo=npm) | ![Downloads](https://img.shields.io/npm/dm/docusaurus-plugin-typedoc) | [Changelog](./packages/docusaurus-plugin-typedoc/CHANGELOG.md) | | ||
[typedoc-github-wiki-theme](./packages/typedoc-github-wiki-theme#readme) | ![npm](https://img.shields.io/npm/v/typedoc-github-wiki-theme%2Fnext?style=flat-square&logo=npm) | ![Downloads](https://img.shields.io/npm/dm/typedoc-github-wiki-theme) | [Changelog](./packages/typedoc-github-wiki-theme/CHANGELOG.md) | | ||
[typedoc-gitlab-wiki-theme](./packages/typedoc-gitlab-wiki-theme#readme) | ![npm](https://img.shields.io/npm/v/typedoc-gitlab-wiki-theme%2Fnext?style=flat-square&logo=npm) | ![Downloads](https://img.shields.io/npm/dm/typedoc-gitlab-wiki-theme) | [Changelog](./packages/typedoc-gitlab-wiki-theme/CHANGELOG.md) | | ||
[typedoc-vitepress-theme](./packages/typedoc-vitepress-theme#readme) | ![npm](https://img.shields.io/npm/v/typedoc-vitepress-theme%2Fnext?style=flat-square&logo=npm) | ![Downloads](https://img.shields.io/npm/dm/typedoc-vitepress-theme) | [Changelog](./packages/typedoc-vitepress-theme/CHANGELOG.md) | | ||
| Package | Description | | ||
| :---| :---| | ||
[typedoc-plugin-markdown](./packages/typedoc-plugin-markdown#readme) | A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown. | | ||
[typedoc-plugin-frontmatter](./packages/typedoc-plugin-frontmatter#readme) | A plugin for TypeDoc that prepends configurable frontmatter to page content. | | ||
[typedoc-plugin-remark](./packages/typedoc-plugin-remark#readme) | A plugin for TypeDoc that enables additional markdown transformations with remark. | | ||
[typedoc-github-wiki-theme](./packages/typedoc-github-wiki-theme#readme) | A TypeDoc theme that publishes Markdown pages compatible with Github Wiki. | | ||
[typedoc-gitlab-wiki-theme](./packages/typedoc-gitlab-wiki-theme#readme) | A TypeDoc theme that publishes Markdown pages compatible with Gitlab Wiki. | | ||
[typedoc-vitepress-theme](./packages/typedoc-vitepress-theme#readme) | A TypeDoc theme that publishes Markdown pages compatible with VitePress. | | ||
[docusaurus-plugin-typedoc](./packages/docusaurus-plugin-typedoc#readme) | A Docusaurus plugin to integrate API docs generated by TypeDoc into a Docusaurus project. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/usr/bin/env ts-node | ||
|
||
import { DOCS_CONFIG } from '@dev-packages/helpers'; | ||
import { consola } from 'consola'; | ||
import * as fs from 'fs'; | ||
|
||
main(); | ||
|
||
async function main() { | ||
const packagesPromises = [ | ||
'typedoc-plugin-markdown', | ||
'typedoc-plugin-frontmatter', | ||
'typedoc-plugin-remark', | ||
'typedoc-github-wiki-theme', | ||
'typedoc-gitlab-wiki-theme', | ||
'typedoc-vitepress-theme', | ||
'docusaurus-plugin-typedoc', | ||
].map(async (packageName) => { | ||
const packageJson = await import( | ||
`../../packages/${packageName}/package.json` | ||
); | ||
return { | ||
name: packageName, | ||
description: packageJson.description, | ||
}; | ||
}); | ||
const packages = await Promise.all(packagesPromises); | ||
|
||
writeRepositoryReadme(packages); | ||
packages.forEach((packageItem) => writePackageReadme(packageItem)); | ||
consola.success(`Generate readmes complete`); | ||
} | ||
|
||
function writeRepositoryReadme(packages: any) { | ||
const readme = ['# Packages\n']; | ||
const headers: string[] = []; | ||
headers.push('| Package | Description | '); | ||
headers.push('| :---| :---|'); | ||
|
||
const rows = packages.map((packageItem) => { | ||
return ( | ||
[ | ||
`[${packageItem.name}](./packages/${packageItem.name}#readme)`, | ||
packageItem.description, | ||
].join(' | ') + ' | ' | ||
); | ||
}); | ||
|
||
readme.push(...headers, ...rows); | ||
|
||
fs.writeFileSync('README.md', readme.join('\n')); | ||
} | ||
|
||
function writePackageReadme(packageItem: any) { | ||
const readme = [`# ${packageItem.name}`]; | ||
const badges = [ | ||
`![npm](https://img.shields.io/npm/v/${packageItem.name}%2Fnext?\&logo=npm)`, | ||
`![Downloads](https://img.shields.io/npm/dm/${packageItem.name})`, | ||
`[![Build Status](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml/badge.svg?branch=next)](https://github.com/tgreyuk/typedoc-plugin-markdown/actions/workflows/ci.yml)`, | ||
]; | ||
|
||
readme.push(badges.join(' ')); | ||
readme.push(`${packageItem.description}`); | ||
const docLink = `https://typedoc-plugin-markdown.org${ | ||
DOCS_CONFIG[packageItem.name].docsPath | ||
}`; | ||
|
||
readme.push('## Installation'); | ||
readme.push(`\`\`\`shell | ||
npm install ${packageItem.name} --save-dev | ||
\`\`\``); | ||
|
||
readme.push('## Documentation'); | ||
const resources = [`Please visit ${docLink}.`]; | ||
readme.push(resources.join('\n')); | ||
readme.push('## License'); | ||
readme.push(`Released under the [MIT License](./CHANGELOG.md).`); | ||
|
||
fs.writeFileSync( | ||
`./packages/${packageItem.name}/README.md`, | ||
readme.join('\n\n'), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "@dev-packages/generate-readmes", | ||
"private": true, | ||
"files": [ | ||
"/" | ||
], | ||
"bin": { | ||
"generate-readmes": "cli.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@dev-packages/helpers", | ||
"private": true, | ||
"main": "src/index.ts", | ||
"files": [ | ||
"/" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { DocsConfig } from './models'; | ||
|
||
export const DECLARATIONS_PATH = `${process.cwd()}/src/options/declarations.ts`; | ||
|
||
export const PRESETS_PATH = `${process.cwd()}/src/options/presets.ts`; | ||
|
||
export const DOCS_CONFIG: Record<string, DocsConfig> = { | ||
['typedoc-plugin-markdown']: { | ||
optionsPath: 'options', | ||
docsPath: '', | ||
declarations: true, | ||
presets: false, | ||
}, | ||
['typedoc-plugin-frontmatter']: { | ||
optionsPath: 'utilities/frontmatter', | ||
docsPath: '/utilities/frontmatter', | ||
declarations: true, | ||
presets: false, | ||
}, | ||
['typedoc-plugin-remark']: { | ||
optionsPath: 'utilities/remark', | ||
docsPath: '/utilities/remark', | ||
declarations: true, | ||
presets: false, | ||
}, | ||
['typedoc-github-wiki-theme']: { | ||
optionsPath: 'themes/github-wiki', | ||
docsPath: '/themes/github-wiki', | ||
declarations: false, | ||
presets: true, | ||
}, | ||
['typedoc-gitlab-wiki-theme']: { | ||
optionsPath: 'themes/gitlab-wiki', | ||
docsPath: '/themes/gitlab-wiki', | ||
declarations: false, | ||
presets: true, | ||
}, | ||
['typedoc-vitepress-theme']: { | ||
optionsPath: 'themes/vitepress', | ||
docsPath: '/themes/vitepress', | ||
declarations: true, | ||
presets: false, | ||
}, | ||
['docusaurus-plugin-typedoc']: { | ||
optionsPath: '/integrations/docusaurus/options', | ||
docsPath: '/integrations/docusaurus', | ||
declarations: false, | ||
presets: false, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './constants'; | ||
export * from './methods'; | ||
export * from './models'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import * as path from 'path'; | ||
|
||
export function getPackageName() { | ||
const cwdParts = process.cwd().split(path.sep); | ||
return cwdParts[cwdParts.length - 1]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export interface DocsConfig { | ||
optionsPath: string; | ||
docsPath: string; | ||
declarations: boolean; | ||
presets: boolean; | ||
} | ||
|
||
export interface OptionDocument { | ||
name: string; | ||
comments: string; | ||
tags: { name: string; comments: string }[]; | ||
example: string; | ||
category: string; | ||
help: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env ts-node | ||
|
||
import { DOCS_CONFIG, DocsConfig, getPackageName } from '@dev-packages/helpers'; | ||
import { consola } from 'consola'; | ||
import { generateDocs } from './tasks/generate-docs'; | ||
import { generateModels } from './tasks/generate-models'; | ||
|
||
main(); | ||
|
||
async function main() { | ||
const docsConfig: DocsConfig = DOCS_CONFIG[getPackageName()]; | ||
if (docsConfig.declarations) { | ||
await generateModels(); | ||
} | ||
await generateDocs(docsConfig); | ||
consola.success(`[${getPackageName()}] Prebuild options complete`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "@dev-packages/prebuild-options", | ||
"private": true, | ||
"files": [ | ||
"/" | ||
], | ||
"bin": { | ||
"prebuild-options": "cli.ts" | ||
} | ||
} |
Oops, something went wrong.