Skip to content

Commit 29069e0

Browse files
authored
Merge pull request #2210 from TypeStrong/beta
v0.24
2 parents bef64cc + 27f550f commit 29069e0

File tree

187 files changed

+14104
-5284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+14104
-5284
lines changed

.config/typedoc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"MeaningKeywords"
1313
],
1414
"sort": ["kind", "instance-first", "required-first", "alphabetical"],
15-
"entryPoints": ["../src"],
16-
"entryPointStrategy": "resolve",
15+
"entryPoints": ["../src/index.ts"],
1716
"excludeExternals": true,
1817
"excludeInternal": false,
1918
"excludePrivate": true,
19+
"excludeReferences": true,
2020
"treatWarningsAsErrors": false,
2121
"validation": {
2222
"notExported": true,
@@ -36,6 +36,6 @@
3636
"Enumerations": 2.0,
3737
"Type Aliases": 2.0
3838
},
39-
"searchInComments": true,
39+
"includeVersion": true,
4040
"logLevel": "Verbose"
4141
}

.eslintrc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
// Would be nice to lint these, but they shouldn't be included in the project,
3131
// so we need a second eslint config file.
3232
"example",
33-
"src/codegen",
3433
"src/test/converter",
3534
"src/test/converter2",
3635
"src/test/module",
@@ -41,33 +40,34 @@
4140
"bin"
4241
],
4342
"rules": {
44-
"@typescript-eslint/no-floating-promises": 1,
43+
"@typescript-eslint/no-floating-promises": "error",
44+
"@typescript-eslint/await-thenable": "error",
4545

4646
// This one is just annoying since it complains at incomplete code
47-
"no-empty": 0,
47+
"no-empty": "off",
4848

4949
// This rule is factually incorrect. Interfaces which extend some type alias can be used to introduce
5050
// new type names. This is useful particularly when dealing with mixins.
51-
"@typescript-eslint/no-empty-interface": 0,
51+
"@typescript-eslint/no-empty-interface": "off",
5252

5353
// We still use `any` fairly frequently...
54-
"@typescript-eslint/ban-types": 0,
55-
"@typescript-eslint/no-explicit-any": 0,
54+
"@typescript-eslint/ban-types": "off",
55+
"@typescript-eslint/no-explicit-any": "off",
5656

5757
// Really annoying, doesn't provide any value.
58-
"@typescript-eslint/no-empty-function": 0,
58+
"@typescript-eslint/no-empty-function": "off",
5959

6060
// Declaration merging with a namespace is a necessary tool when working with enums.
61-
"@typescript-eslint/no-namespace": 0,
61+
"@typescript-eslint/no-namespace": "off",
6262

6363
// Reported by TypeScript
64-
"@typescript-eslint/no-unused-vars": 0,
64+
"@typescript-eslint/no-unused-vars": "off",
6565

66-
"no-console": 1,
66+
"no-console": "warn",
6767

6868
// Feel free to turn one of these back on and submit a PR!
69-
"@typescript-eslint/no-non-null-assertion": 0,
70-
"@typescript-eslint/explicit-module-boundary-types": 0,
69+
"@typescript-eslint/no-non-null-assertion": "off",
70+
"@typescript-eslint/explicit-module-boundary-types": "off",
7171

7272
"no-restricted-syntax": [
7373
"warn",

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
- name: Lint
3030
run: npm run lint -- --max-warnings 0
3131
- name: Circular dependency check
32-
uses: gerrit0/circular-dependency-check@v1
32+
uses: gerrit0/circular-dependency-check@v2
3333
with:
3434
entry: dist/index.js

.github/workflows/publish-beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout repository
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
- id: check
1414
uses: EndBug/version-check@v1
1515
with:

.github/workflows/publish-lts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout repository
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
- id: check
1414
uses: EndBug/version-check@v1
1515
with:
1616
diff-search: true
1717
- name: Set up Node
1818
if: steps.check.outputs.changed == 'true'
19-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v3
2020
with:
2121
node-version: "16"
2222
- name: Upgrade npm

.github/workflows/visual-regression.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout repository
8-
uses: actions/checkout@v2
8+
uses: actions/checkout@v3
99
- name: Set up Node
10-
uses: actions/setup-node@v1
10+
uses: actions/setup-node@v3
1111
with:
1212
node-version: 16
1313
- name: Upgrade npm

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ yarn-error.log
1414
/coverage/
1515
/dist/
1616
/docs
17+
/td*.json
1718

1819
typedoc*.tgz
1920
tmp

.vscode/launch.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"configurations": [
77
{
88
"args": [
9+
"-r",
10+
"ts-node/register",
911
"--timeout",
1012
"0",
1113
"--config",
12-
"${workspaceFolder}/.config/mocha.fast.json",
13-
"-g",
14-
"2200"
14+
"${workspaceFolder}/.config/mocha.fast.json"
1515
],
1616
"internalConsoleOptions": "openOnSessionStart",
1717
"name": "Debug Tests",
18-
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
18+
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha.js",
1919
"request": "launch",
2020
"skipFiles": ["<node_internals>/**"],
2121
"type": "node"
@@ -24,6 +24,7 @@
2424
"name": "Attach",
2525
"port": 9229,
2626
"request": "attach",
27+
"internalConsoleOptions": "openOnSessionStart",
2728
"skipFiles": ["<node_internals>/**"],
2829
"type": "node",
2930
"sourceMaps": true

.vscode/settings.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,14 @@
3939

4040
"eslint.workingDirectories": [".", "./example"],
4141
"mochaExplorer.configFile": ".config/mocha.test-explorer.json",
42-
"cSpell.words": ["cname", "tsbuildinfo", "tsdoc"]
42+
"cSpell.words": [
43+
"cname",
44+
"deserializers",
45+
"linkcode",
46+
"linkplain",
47+
"shiki",
48+
"tsbuildinfo",
49+
"tsdoc",
50+
"typestrong"
51+
]
4352
}

CHANGELOG.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1+
# Beta
2+
3+
### Breaking Changes
4+
5+
- `@link`, `@linkcode` and `@linkplain` tags will now be resolved with TypeScript's link resolution by default. The `useTsLinkResolution` option
6+
can be used to turn this behavior off, but be aware that doing so will mean your links will be resolved differently by editor tooling and TypeDoc.
7+
- TypeDoc will no longer automatically load plugins from `node_modules`. Specify the `--plugin` option to indicate which modules should be loaded.
8+
- The `packages` entry point strategy will now run TypeDoc in each provided package directory and then merge the results together.
9+
The previous `packages` strategy has been preserved under `legacy-packages` and will be removed in 0.25. If the new strategy does not work
10+
for your use case, please open an issue.
11+
- Removed `--logger` option, to disable all logging, set the `logLevel` option to `none`.
12+
- Dropped support for legacy `[[link]]`s, removed deprecated `Reflection.findReflectionByName`.
13+
- Added `@overload` to default ignored tags.
14+
15+
### API Breaking Changes
16+
17+
- The `label` property on `Reflection` has moved to `Comment`.
18+
- The default value of the `out` option has been changed from `""` to `"./docs"`, #2195.
19+
- Renamed `DeclarationReflection#version` to `DeclarationReflection#projectVersion` to match property on `ProjectReflection`.
20+
- Removed unused `Reflection#originalName`.
21+
- Removed `Reflection#kindString`, use `ReflectionKind.singularString(reflection.kind)` or `ReflectionKind.pluralString(reflection.kind)` instead.
22+
- The `named-tuple-member` and `template-literal` type kind have been replaced with `namedTupleMember` and `templateLiteral`, #2100.
23+
- Properties related to rendering are no longer stored on `Reflection`, including `url`, `anchor`, `hasOwnDocument`, and `cssClasses`.
24+
- `Application.bootstrap` will no longer load plugins. If you want to load plugins, use `Application.bootstrapWithPlugins` instead, #1635.
25+
- The options passed to `Application.bootstrap` will now be applied both before _and_ after reading options files, which may cause a change in configuration
26+
if using a custom script to run TypeDoc that includes some options, but other options are set in config files.
27+
- Moved `sources` property previously declared on base `Reflection` class to `DeclarationReflection` and `SignatureReflection`.
28+
- Moved `relevanceBoost` from `ContainerReflection` to `DeclarationReflection` since setting it on the parent class has no effect.
29+
- Removed internal `ReferenceType.getSymbol`, reference types no longer reference the `ts.Symbol` to enable generation from serialized JSON.
30+
- `OptionsReader.priority` has been renamed to `OptionsReader.order` to more accurately reflect how it works.
31+
- `ReferenceType`s which point to type parameters will now always be intentionally broken since they were never linked and should not be warned about when validating exports.
32+
- `ReferenceType`s now longer include an `id` property for their target. They now instead include a `target` property.
33+
- Removed `Renderer.addExternalSymbolResolver`, use `Converter.addExternalSymbolResolver` instead.
34+
- Removed `CallbackLogger`.
35+
- Removed `SerializeEventData` from serialization events.
36+
- A `PageEvent` is now required for `getRenderContext`. If caching the context object, `page` must be updated when `getRenderContext` is called.
37+
- `PageEvent` no longer includes the `template` property. The `Theme.render` method is now expected to take the template to render the page with as its second argument.
38+
- Removed `secondaryNavigation` member on `DefaultThemeRenderContext`.
39+
- Renamed `navigation` to `sidebar` on `DefaultThemeRenderContext` and `navigation.begin`/`navigation.end` hooks to `sidebar.begin`/`sidebar.end`.
40+
41+
### Features
42+
43+
- Added `--useTsLinkResolution` option (on by default) which tells TypeDoc to use TypeScript's `@link` resolution.
44+
- Added `--jsDocCompatibility` option (on by default) which controls TypeDoc's automatic detection of code blocks in `@example` and `@default` tags.
45+
- Reworked default theme navigation to add support for a page table of contents, #1478, #2189.
46+
- Added support for `@interface` on type aliases to tell TypeDoc to convert the fully resolved type as an interface, #1519
47+
- Added support for `@namespace` on variable declarations to tell TypeDoc to convert the variable as a namespace, #2055.
48+
- Added support for `@prop`/`@property` to specify documentation for a child property of a symbol, intended for use with `@interface`.
49+
- TypeDoc will now produce more informative error messages for options which cannot be set from the cli, #2022.
50+
- TypeDoc will now attempt to guess what option you may have meant if given an invalid option name.
51+
- Plugins may now return a `Promise<void>` from their `load` function, #185.
52+
- TypeDoc now supports plugins written with ESM, #1635.
53+
- Added `Renderer.preRenderAsyncJobs` and `Renderer.postRenderAsyncJobs`, which may be used by plugins to perform async processing for rendering, #185.
54+
Note: Conversion is still intentionally a synchronous process to ensure stability of converted projects between runs.
55+
- TypeDoc options may now be set under the `typedocOptions` key in `package.json`, #2112.
56+
- Added `--cacheBust` option to tell TypeDoc to include include the generation time in files, #2124.
57+
- Added `--excludeReferences` option to tell TypeDoc to omit re-exports of a symbol already included from the documentation.
58+
- Introduced new render hooks `pageSidebar.begin` and `pageSidebar.end`.
59+
60+
### Bug Fixes
61+
62+
- TypeDoc will now ignore package.json files not containing a `name` field, #2190.
63+
- Fixed `@inheritDoc` on signatures (functions, methods, constructors, getters, setters) being unable to inherit from a non-signature.
64+
- Interfaces/classes created via extending a module will no longer contain variables/functions where the member should have been converted as properties/methods, #2150.
65+
- TypeDoc will now ignore a leading `v` in versions, #2212.
66+
- Category titles now render with the same format in the page index and heading title, #2196.
67+
- Fixed crash when using `typeof` on a reference with type arguments, #2220.
68+
- Fixed broken anchor links generated to signatures nested within objects.
69+
70+
### Thanks!
71+
72+
- @bodil
73+
- @futurGH
74+
- @jm4rtinez
75+
- @muratgozel
76+
177
# Unreleased
278

379
## v0.23.28 (2023-03-19)

README.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm install typedoc --save-dev
1919

2020
## Usage
2121

22-
To generate documentation TypeDoc needs to know your project entry point, and TypeScript
22+
To generate documentation TypeDoc needs to know your project entry point and TypeScript
2323
compiler options. It will automatically try to find your `tsconfig.json` file, so you can
2424
just specify the entry point of your library:
2525

@@ -38,37 +38,10 @@ By default, TypeDoc will search for a file called `index` under the directory.
3838

3939
### Monorepos / Workspaces
4040

41-
If your codebase is comprised of one or more npm packages, you can pass the paths to these
42-
packages and TypeDoc will attempt to determine entry points based on `package.json`'s `main`
43-
property (with default value `index.js`) and if it wasn't found, based on `types` property.
44-
If any of the packages given are the root of an [npm Workspace](https://docs.npmjs.com/cli/v7/using-npm/workspaces)
45-
or a [Yarn Workspace](https://classic.yarnpkg.com/en/docs/workspaces/) TypeDoc will find all
46-
the `workspaces` defined in the `package.json`. In order to find your entry points, TypeDoc requires
47-
either that you turn on sourcemaps so that it can discover the original TS file, or that you
48-
specify `"typedocMain": "src/index.ts"` to explicitly state where the package entry point is.
49-
Supports wildcard paths in the same fashion as those found in npm or Yarn workspaces.
50-
51-
#### Single npm module
52-
53-
```bash
54-
typedoc --entryPointStrategy packages .
55-
```
56-
57-
#### Monorepo with npm/Yarn workspace at the root
58-
59-
```bash
60-
typedoc --entryPointStrategy packages .
61-
```
62-
63-
#### Monorepo with manually specified sub-packages to document
64-
65-
This can be useful if you do not want all your workspaces to be processed.
66-
Accepts the same paths as would go in the `package.json`'s workspaces
67-
68-
```bash
69-
# Note the single quotes prevent shell wildcard expansion, allowing typedoc to do the expansion
70-
typedoc --entryPointStrategy packages a-package 'some-more-packages/*' 'some-other-packages/*'
71-
```
41+
If your codebase is comprised of one or more npm packages, you can build documentation for each of them individually
42+
and merge the results together into a single site by setting `entryPointStrategy` to `packages`. In this mode TypeDoc
43+
requires configuration to be present in each directory to specify the entry points. For an example setup, see
44+
https://github.com/Gerrit0/typedoc-packages-example
7245

7346
### Arguments
7447

0 commit comments

Comments
 (0)