Skip to content

Commit

Permalink
support typedoc 0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
DiFuks committed Jun 25, 2024
1 parent cb84fc7 commit 23c253a
Show file tree
Hide file tree
Showing 42 changed files with 4,698 additions and 5,122 deletions.
1 change: 1 addition & 0 deletions .github/LICENSE.md
1 change: 1 addition & 0 deletions .github/README.md
76 changes: 56 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,89 @@
name: Publish to npm
name: Build and Publish

on:
push:
branches:
- master
on: push

jobs:
build-and-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/plugin
env:
NPM_DIFUKS_TOKEN: ${{ secrets.NPM_DIFUKS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
fetch-depth: 0

- name: Cache yarn
uses: actions/cache@v3
# for yarn version check
- if: github.ref != 'refs/heads/main'
run: |
git fetch --unshallow origin main
- uses: actions/setup-node@v4
with:
path: |
.yarn/cache
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ github.sha }}
restore-keys: |
${{ runner.os }}-yarn-
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock

- name: Install modules
run: yarn install
run: yarn

- name: Build libs
- name: Build plugin
run: yarn build

- name: Eslint
- name: Lint plugin
run: yarn lint

- name: Check packages versions
if: github.ref != 'refs/heads/main'
run: yarn version check

- name: Apply versions
if: github.ref == 'refs/heads/main'
run: yarn version apply

- name: Publish package
if: github.ref == 'refs/heads/main'
run: yarn npm publish --tolerate-republish

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
if: github.ref == 'refs/heads/main'
with:
commit_message: |
ci: Release packages
[skip ci]
- name: Get package version
if: github.ref == 'refs/heads/main'
id: package-version
uses: martinbeentjes/[email protected]
with:
path: packages/plugin

- uses: stefanzweifel/git-auto-commit-action@v5
if: github.ref == 'refs/heads/main'
with:
tagging_message: v${{ steps.package-version.outputs.current-version }}
commit_message: |
ci: Release packages
[skip ci]
- name: Get pull request info
if: github.ref == 'refs/heads/main'
id: pull-request-info
uses: actions-ecosystem/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: ncipollo/release-action@v1
id: create-release
if: github.ref == 'refs/heads/main'
with:
skipIfReleaseExists: true
makeLatest: true
name: Release ${{ steps.package-version.outputs.current-version }}
body: ${{ steps.pull-request-info.outputs.body }}
tag: v${{ steps.package-version.outputs.current-version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ docs
.idea/
.pnp.*
.yarn/*
node_modules
!.yarn/patches
!.yarn/plugins
!.yarn/releases
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.13.0
550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarn/versions/2ce8f543.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
typedoc-theme-hierarchy: major
16 changes: 10 additions & 6 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
enableGlobalCache: true

nodeLinker: pnp

npmAuthToken: "${NPM_DIFUKS_TOKEN:-}"
Expand All @@ -6,10 +8,12 @@ npmPublishAccess: public

npmRegistryServer: "https://registry.npmjs.com/"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
packageExtensions:
typedoc@*:
peerDependencies:
typedoc-theme-hierarchy: "*"
eslint-module-utils@*:
dependencies:
eslint-import-resolver-typescript: "3.6.1"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-4.3.1.cjs
56 changes: 4 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,7 @@
{
"name": "typedoc-theme-hierarchy",
"version": "4.1.3",
"license": "MIT",
"main": "dist/index.js",
"repository": "[email protected]:DiFuks/typedoc-theme-hierarchy.git",
"homepage": "https://github.com/DiFuks/typedoc-theme-hierarchy",
"description": "Hierarchy theme for typedoc",
"keywords": [
"typedoc-theme",
"typedocplugin"
"name": "root",
"workspaces": [
"packages/*"
],
"files": [
"dist",
"readme.md"
],
"publishConfig": {
"registry": "https://registry.npmjs.com"
},
"author": {
"name": "Dmitry Fuks",
"email": "[email protected]",
"url": "https://github.com/DiFuks"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
"@types/fs-extra": "^9.0.13",
"@types/mini-css-extract-plugin": "^2.4.0",
"@types/webpack": "^5.28.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.3.1",
"eslint": "^8.18.0",
"eslint-config-fuks": "^1.6.7",
"mini-css-extract-plugin": "^2.4.5",
"terser-webpack-plugin": "^5.3.3",
"ts-loader": "^9.4.4",
"typedoc": "0.25.0",
"typescript": "5.0.4",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
},
"peerDependencies": {
"typedoc": "^0.24.0 || ^0.25.0 || ^0.26.0"
},
"scripts": {
"build": "webpack && tsc --project tsconfig.build.json",
"lint": "eslint \"./**/*.{ts,tsx,js}\"",
"prepublishOnly": "yarn lint && yarn build"
},
"dependencies": {
"fs-extra": "11.1.1"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
13 changes: 13 additions & 0 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "example",
"scripts": {
"build": "tsc",
"doc": "typedoc && http-server public/docs"
},
"devDependencies": {
"http-server": "14.1.1",
"typedoc": "0.26.2",
"typedoc-theme-hierarchy": "workspace:*",
"typescript": "5.2.2"
}
}
6 changes: 6 additions & 0 deletions packages/example/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Main interface
*/
export interface Main {
getDate(date: any): string;
}
5 changes: 5 additions & 0 deletions packages/example/src/user/Admin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { User } from './User';

export interface Admin extends User {
role: 'admin';
}
4 changes: 4 additions & 0 deletions packages/example/src/user/User.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface User {
name: string;
age: number;
}
9 changes: 9 additions & 0 deletions packages/example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"module": "ESNext",
"outDir": "./dist",
"strict": false,
"noEmit": false,
"skipLibCheck": true,
},
}
9 changes: 9 additions & 0 deletions packages/example/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entryPoints": ["src"],
"entryPointStrategy": "expand",
"out": "public/docs",
"plugin": ["typedoc-theme-hierarchy"],
"theme": "hierarchy",
"tsconfig": "./tsconfig.json",
"name": "Project name"
}
File renamed without changes.
2 changes: 2 additions & 0 deletions .eslintrc.js → packages/plugin/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports = {
'react/button-has-type': 'off',
'react/jsx-props-no-spreading': 'off',
'no-underscore-dangle': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'jsx-a11y/control-has-associated-label': 'off',
},
overrides: [
{
Expand Down
File renamed without changes.
16 changes: 10 additions & 6 deletions readme.md → packages/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ Hierarchy theme for [typedoc](https://typedoc.org/)
---

```bash
# For typedoc >=0.22.0 <=0.23.4
npm i typedoc-theme-hierarchy@^1.3.5 -D

# For typedoc 0.23.5
npm i typedoc-theme-hierarchy@^2.0.0 -D
# For typedoc >=0.25.0
npm i typedoc-theme-hierarchy@^5.0.0 -D

# For typedoc >=0.24.0 <0.25.0
npm i typedoc-theme-hierarchy@^4.0.0 -D

# For typedoc ^0.23.6
npm i typedoc-theme-hierarchy@^3.0.0 -D

# For typedoc >=0.24.0
npm i typedoc-theme-hierarchy@^4.0.0 -D
# For typedoc 0.23.5
npm i typedoc-theme-hierarchy@^2.0.0 -D

# For typedoc >=0.22.0 <=0.23.4
npm i typedoc-theme-hierarchy@^1.3.5 -D
```

## Usage
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "typedoc-theme-hierarchy",
"version": "4.1.3",
"license": "MIT",
"main": "dist/index.js",
"repository": "[email protected]:DiFuks/typedoc-theme-hierarchy.git",
"homepage": "https://github.com/DiFuks/typedoc-theme-hierarchy",
"description": "Hierarchy theme for typedoc",
"keywords": [
"typedoc-theme",
"typedocplugin"
],
"files": [
"dist",
"LICENSE.MD",
"README.md"
],
"publishConfig": {
"registry": "https://registry.npmjs.com"
},
"author": {
"name": "Dmitry Fuks",
"email": "[email protected]",
"url": "https://github.com/DiFuks"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
"@types/fs-extra": "^9.0.13",
"@types/mini-css-extract-plugin": "^2.4.0",
"@types/webpack": "^5.28.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.3.1",
"eslint": "^8.18.0",
"eslint-config-fuks": "2.0.0",
"mini-css-extract-plugin": "^2.4.5",
"terser-webpack-plugin": "^5.3.3",
"ts-loader": "^9.4.4",
"typedoc": "0.26.2",
"typescript": "5.5.2",
"webpack": "5.92.1",
"webpack-cli": "5.1.4"
},
"peerDependencies": {
"typedoc": "^0.24.0 || ^0.25.0 || ^0.26.0"
},
"scripts": {
"build": "webpack && tsc --project tsconfig.build.json",
"lint": "eslint \"./**/*.{ts,tsx,js}\"",
"prepublishOnly": "yarn lint && yarn build"
},
"dependencies": {
"fs-extra": "11.1.1"
},
"packageManager": "[email protected]"
}
20 changes: 20 additions & 0 deletions packages/plugin/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { type Application, JSX } from 'typedoc';

import { OverrideTheme } from './themes/OverrideTheme';

/**
* Инициализирует плагин с темой.
*/
export const load = (app: Application): void => {
app.renderer.hooks.on(
`head.end`,
(context): JSX.Element => <link rel='stylesheet' href={context.relativeURL(`assets/hierarchy.css`)} />,
);

app.renderer.hooks.on(
`body.end`,
(context): JSX.Element => <script src={context.relativeURL(`assets/hierarchy.js`)} />,
);

app.renderer.defineTheme(`hierarchy`, OverrideTheme);
};
Loading

0 comments on commit 23c253a

Please sign in to comment.