Skip to content

Commit 1c6ef5a

Browse files
authored
Merge pull request #35 from DiFuks/fix-typedoc-0-27
Support typedoc ^0.27.0 and esm
2 parents cf092ca + fa5c2d5 commit 1c6ef5a

File tree

11 files changed

+1630
-55
lines changed

11 files changed

+1630
-55
lines changed

.yarn/versions/97167835.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
releases:
2+
typedoc-theme-hierarchy: patch

packages/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"devDependencies": {
88
"http-server": "14.1.1",
9-
"typedoc": "0.26.2",
9+
"typedoc": "0.27.5",
1010
"typedoc-theme-hierarchy": "workspace:*",
1111
"typescript": "5.2.2"
1212
}

packages/plugin/.eslintrc.cjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
require(`@rushstack/eslint-patch/modern-module-resolution`);
2+
3+
module.exports = {
4+
extends: [`eslint-config-fuks`],
5+
parserOptions: {
6+
project: `./tsconfig.json`,
7+
sourceType: `module`,
8+
},
9+
rules: {
10+
'no-relative-imports/no-relative-imports': `off`,
11+
'react/no-unknown-property': `off`,
12+
'react/jsx-key': `off`,
13+
'react/display-name': `off`,
14+
'unicorn/prefer-node-protocol': `off`,
15+
'react/function-component-definition': `off`,
16+
'react/destructuring-assignment': `off`,
17+
'react/button-has-type': `off`,
18+
'react/jsx-props-no-spreading': `off`,
19+
'no-underscore-dangle': `off`,
20+
'@typescript-eslint/no-use-before-define': `off`,
21+
'jsx-a11y/control-has-associated-label': `off`,
22+
},
23+
overrides: [
24+
{
25+
files: [`*.json`],
26+
parserOptions: {
27+
project: false,
28+
},
29+
},
30+
],
31+
};

packages/plugin/.eslintrc.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The plugin supports only `expand` and `resolve` values for the `entryPointStrate
1616

1717
```bash
1818

19-
# For typedoc ^0.26.0
19+
# For typedoc ^0.26.0 || ^0.27.0
2020
npm i typedoc-theme-hierarchy@^5.0.0 -D
2121

2222
# For typedoc ^0.24.0 || ^0.25.0

packages/plugin/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
"name": "typedoc-theme-hierarchy",
33
"version": "5.0.3",
44
"license": "MIT",
5-
"main": "dist/index.js",
5+
"type": "module",
6+
"main": "dist/index.cjs",
7+
"module": "dist/index.js",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.js",
11+
"require": "./dist/index.cjs"
12+
}
13+
},
614
"repository": "[email protected]:DiFuks/typedoc-theme-hierarchy.git",
715
"homepage": "https://github.com/DiFuks/typedoc-theme-hierarchy",
816
"description": "Hierarchy theme for typedoc",
@@ -33,16 +41,17 @@
3341
"mini-css-extract-plugin": "^2.4.5",
3442
"terser-webpack-plugin": "^5.3.3",
3543
"ts-loader": "^9.4.4",
44+
"tsup": "^8.3.5",
3645
"typedoc": "0.26.2",
3746
"typescript": "5.5.2",
3847
"webpack": "5.92.1",
3948
"webpack-cli": "5.1.4"
4049
},
4150
"peerDependencies": {
42-
"typedoc": "^0.26.0"
51+
"typedoc": "^0.26.0 || ^0.27.0"
4352
},
4453
"scripts": {
45-
"build": "webpack && tsc --project tsconfig.build.json",
54+
"build": "webpack && tsup src/index.tsx --external typedoc-theme-hierarchy --dts --format esm,cjs",
4655
"lint": "eslint \"./**/*.{ts,tsx,js}\""
4756
},
4857
"dependencies": {

packages/plugin/tsconfig.build.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/plugin/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
33
"baseUrl": ".",
4-
"target": "ES2021",
5-
"module": "commonjs",
4+
"target": "ES2022",
5+
"module": "ES2022",
66
"esModuleInterop": true,
77
"forceConsistentCasingInFileNames": true,
88
"strict": true,

packages/plugin/tsup.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig } from 'tsup';
2+
3+
// eslint-disable-next-line import/no-default-export
4+
export default defineConfig([
5+
{
6+
entry: [`src/index.ts`],
7+
format: [`cjs`, `esm`],
8+
dts: true,
9+
external: [`typedoc-theme-hierarchy`, `typedoc`],
10+
banner: ({ format }) => {
11+
if (format === `esm`) {
12+
return {
13+
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
14+
};
15+
}
16+
17+
return {};
18+
},
19+
},
20+
]);
File renamed without changes.

0 commit comments

Comments
 (0)