Skip to content

Commit

Permalink
Support typedoc ^0.27.0 and esm
Browse files Browse the repository at this point in the history
  • Loading branch information
DiFuks committed Dec 19, 2024
1 parent cf092ca commit f595016
Show file tree
Hide file tree
Showing 10 changed files with 1,629 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .yarn/versions/97167835.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
typedoc-theme-hierarchy: patch
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"devDependencies": {
"http-server": "14.1.1",
"typedoc": "0.26.2",
"typedoc": "0.27.5",
"typedoc-theme-hierarchy": "workspace:*",
"typescript": "5.2.2"
}
Expand Down
31 changes: 31 additions & 0 deletions packages/plugin/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require(`@rushstack/eslint-patch/modern-module-resolution`);

module.exports = {
extends: [`eslint-config-fuks`],
parserOptions: {
project: `./tsconfig.json`,
sourceType: `module`,
},
rules: {
'no-relative-imports/no-relative-imports': `off`,
'react/no-unknown-property': `off`,
'react/jsx-key': `off`,
'react/display-name': `off`,
'unicorn/prefer-node-protocol': `off`,
'react/function-component-definition': `off`,
'react/destructuring-assignment': `off`,
'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: [
{
files: [`*.json`],
parserOptions: {
project: false,
},
},
],
};
31 changes: 0 additions & 31 deletions packages/plugin/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The plugin supports only `expand` and `resolve` values for the `entryPointStrate

```bash

# For typedoc ^0.26.0
# For typedoc ^0.26.0 || ^0.27.0
npm i typedoc-theme-hierarchy@^5.0.0 -D

# For typedoc ^0.24.0 || ^0.25.0
Expand Down
15 changes: 12 additions & 3 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
"name": "typedoc-theme-hierarchy",
"version": "5.0.3",
"license": "MIT",
"main": "dist/index.js",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"repository": "[email protected]:DiFuks/typedoc-theme-hierarchy.git",
"homepage": "https://github.com/DiFuks/typedoc-theme-hierarchy",
"description": "Hierarchy theme for typedoc",
Expand Down Expand Up @@ -33,16 +41,17 @@
"mini-css-extract-plugin": "^2.4.5",
"terser-webpack-plugin": "^5.3.3",
"ts-loader": "^9.4.4",
"tsup": "^8.3.5",
"typedoc": "0.26.2",
"typescript": "5.5.2",
"webpack": "5.92.1",
"webpack-cli": "5.1.4"
},
"peerDependencies": {
"typedoc": "^0.26.0"
"typedoc": "^0.26.0 || ^0.27.0"
},
"scripts": {
"build": "webpack && tsc --project tsconfig.build.json",
"build": "webpack && tsup src/index.tsx --external typedoc-theme-hierarchy --dts --format esm,cjs",
"lint": "eslint \"./**/*.{ts,tsx,js}\""
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "ES2021",
"module": "commonjs",
"target": "ES2022",
"module": "ES2022",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
Expand Down
20 changes: 20 additions & 0 deletions packages/plugin/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'tsup';

// eslint-disable-next-line import/no-default-export
export default defineConfig([
{
entry: [`src/index.ts`],
format: [`cjs`, `esm`],
dts: true,
external: [`typedoc-theme-hierarchy`, `typedoc`],
banner: ({ format }) => {
if (format === `esm`) {
return {
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
};
}

return {};
},
},
]);
File renamed without changes.
Loading

0 comments on commit f595016

Please sign in to comment.