Skip to content

v0.24 #2210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 103 commits into from
Apr 8, 2023
Merged

v0.24 #2210

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
feafd98
Clean up some properties
Gerrit0 Jul 11, 2022
fc31e7d
Remove cssClasses
Gerrit0 Jul 11, 2022
9aa61bb
Merge branch 'master' into beta
Gerrit0 Jul 25, 2022
6ba7e26
Remove "none" special case for plugins
Gerrit0 Jul 25, 2022
3d63da6
Add support for ESM based plugins
Gerrit0 Jul 25, 2022
5ddbbf6
Add hooks for async code in plugins
Gerrit0 Jul 25, 2022
d248684
Decide a ReferenceType's package name by looking for a package.json.
bodil Jul 26, 2022
65dfba3
Try looking for a node_modules path first, and cache expensive lookups.
bodil Jul 27, 2022
04f67f0
pathToFileUrl
Gerrit0 Jul 31, 2022
2b05c26
Disallow complex options from being set via cli
Gerrit0 Jul 31, 2022
44da2de
Update changelog
Gerrit0 Jul 31, 2022
ac4c4e8
Merge branch 'master' into beta
Gerrit0 Jul 31, 2022
1be726c
Fix failing tests
Gerrit0 Aug 6, 2022
2625cd0
Merge branch 'bodil/master' into beta
Gerrit0 Aug 6, 2022
22a3dda
Be smarter about when to serialize a qualifiedName
Gerrit0 Aug 6, 2022
1226330
Remove `ReferenceType.getSymbol`
Gerrit0 Aug 6, 2022
ecbccc5
Drop support for `[[link]]`
Gerrit0 Aug 6, 2022
731cc3c
WIP: Remove getSymbolFromReflection
Gerrit0 Aug 6, 2022
ade4272
Avoid storing TS state on models
Gerrit0 Aug 6, 2022
4008c89
WIP: Add JSON deserialization
Gerrit0 Aug 7, 2022
167f7a8
Break references to type parameters
Gerrit0 Aug 7, 2022
dba71b5
Merge branch 'master' into beta
Gerrit0 Oct 16, 2022
325cb62
Closer to working deserialization
Gerrit0 Oct 17, 2022
d67a482
Remove logger option
Gerrit0 Oct 17, 2022
688ca5e
Fix deserialization of reference reflections
Gerrit0 Oct 18, 2022
6bce9e2
Review some serialization code
Gerrit0 Oct 18, 2022
130dfc7
Finish review of serialized props
Gerrit0 Oct 18, 2022
a0f033b
Merge remote-tracking branch 'origin/master' into beta
Gerrit0 Oct 18, 2022
1f62695
Edit distance options
Gerrit0 Oct 18, 2022
14f98b6
Remove build dependency
Gerrit0 Oct 18, 2022
fb7c616
Merge branch 'master' into beta
Gerrit0 Oct 23, 2022
20237b9
Merge branch 'master' into beta
Gerrit0 Nov 14, 2022
2b296f6
BREAKING: Unify type kind naming
Gerrit0 Nov 22, 2022
5a0117b
Fix circular dep
Gerrit0 Nov 22, 2022
f988ccf
Working toward packages
Gerrit0 Dec 11, 2022
7ec2138
Merge branch 'master' into beta
Gerrit0 Dec 18, 2022
e27e5c4
'package' mode is far future
Gerrit0 Dec 18, 2022
512c11d
WIP: Merge previously created json files
Gerrit0 Dec 28, 2022
91194e2
Tests pass again
Gerrit0 Dec 28, 2022
c203352
Working merge!
Gerrit0 Dec 28, 2022
467e669
Merging actually seems to properly work somehow
Gerrit0 Dec 29, 2022
f21270c
Correct deserialization code
Gerrit0 Jan 2, 2023
6dc4563
Rename id.ts to ReflectionSymbolId.ts
Gerrit0 Mar 4, 2023
e824e4b
Deserialization actually properly works
Gerrit0 Mar 4, 2023
387d214
Fix failing test
Gerrit0 Mar 5, 2023
63a521c
Handle package versions when merging
Gerrit0 Mar 5, 2023
1b80ff4
Fix CI
Gerrit0 Mar 5, 2023
7eefb69
Add check for skipErrorChecking in CLI
Gerrit0 Mar 5, 2023
f93ae61
Packages mode actually works
Gerrit0 Mar 5, 2023
4e01867
Fix failing test
Gerrit0 Mar 5, 2023
768d9bb
more tests
Gerrit0 Mar 5, 2023
8bba9dd
CI
Gerrit0 Mar 5, 2023
aa218d1
Bump version to 0.24.0-beta.1
Gerrit0 Mar 5, 2023
a68f157
Revert changes to includeVersion
Gerrit0 Mar 6, 2023
b6c345c
Merge remote-tracking branch 'origin/master' into beta
Gerrit0 Mar 6, 2023
cfa9152
Bump version to 0.24.0-beta.2
Gerrit0 Mar 6, 2023
4bb407a
Make build happy
Gerrit0 Mar 6, 2023
f2cb491
Introduce an options reader for `package.json` files (#2129)
jmartinezmaes Mar 11, 2023
7e7e270
Update changelog for #2112
Gerrit0 Mar 11, 2023
a47fce0
Move sidebar to the left of content (#2192)
futurGH Mar 11, 2023
a4660a8
Update changelog
Gerrit0 Mar 11, 2023
fd2493e
Change default value of out option
Gerrit0 Mar 11, 2023
95ca7fb
Add warning if legacy config is detected
Gerrit0 Mar 11, 2023
798e30f
Update old actions
Gerrit0 Mar 11, 2023
04a5ef8
Fix lint
Gerrit0 Mar 12, 2023
0a2d0b0
Update docs
Gerrit0 Mar 12, 2023
64af95d
Bump version to 0.24.0-beta.3
Gerrit0 Mar 12, 2023
b9e2a85
Add packages example to readme
Gerrit0 Mar 12, 2023
f82463f
Better handling of modules.html in packages mode
Gerrit0 Mar 12, 2023
ebf1b7b
Merge remote-tracking branch 'origin/master' into beta
Gerrit0 Mar 19, 2023
015de24
Use getCheckFlags, closes #2203
Gerrit0 Mar 19, 2023
1487f67
Add overload to ignored tags
Gerrit0 Mar 19, 2023
fb1658f
Fix inheritDoc from signature to non-signature
Gerrit0 Mar 25, 2023
e1dc6a7
Use TS link resolution by default
Gerrit0 Mar 25, 2023
ce7cda4
Bump version to 0.24.0-beta.4
Gerrit0 Mar 25, 2023
a41ac2d
Correctly set kind for class/interface children
Gerrit0 Mar 25, 2023
6a7323f
Always link to the first line of a file if it creates a module declar…
Gerrit0 Mar 25, 2023
929949e
Introduce cacheBust option
Gerrit0 Mar 25, 2023
e370aab
Add support for `@namespace` tag
Gerrit0 Mar 25, 2023
41721f9
Add support for `@interface`
Gerrit0 Mar 25, 2023
145af51
Bump version to 0.24.0-beta.5
Gerrit0 Mar 25, 2023
f0d1e92
Beta 6
Gerrit0 Mar 25, 2023
1175431
Correctly handle scoped TS links
Gerrit0 Mar 26, 2023
28f6cfc
Bump version to 0.24.0-beta.7
Gerrit0 Mar 26, 2023
36c9bd2
the --includeVersion flag now checks if the prefix "v" already exists…
muratgozel Mar 27, 2023
546d235
Merge branch 'muratgozel/master' into beta
Gerrit0 Apr 1, 2023
02bbf2f
Update changelog
Gerrit0 Apr 1, 2023
6ab1123
Fix missed edge case for #2212
Gerrit0 Apr 1, 2023
22482c1
Cleanup a few review comments
Gerrit0 Apr 1, 2023
5f1ea73
More review comments
Gerrit0 Apr 1, 2023
a87b197
Fix missed todo
Gerrit0 Apr 2, 2023
ad73e37
Fix circular dependency
Gerrit0 Apr 2, 2023
0fe6955
Make category titles render consistently
Gerrit0 Apr 2, 2023
0b9ed4f
WIP: Improve navigation
Gerrit0 Apr 2, 2023
d9c3abf
Add table of contents rendering
Gerrit0 Apr 3, 2023
b9ab8c2
Prettier
Gerrit0 Apr 3, 2023
ad480a4
Bump version to 0.24.0-beta.8
Gerrit0 Apr 3, 2023
234899d
Fix #2220
Gerrit0 Apr 7, 2023
7fdb0aa
Refactor tests to play better with Mocha test explorer
Gerrit0 Apr 7, 2023
14c325b
Remove unused import
Gerrit0 Apr 7, 2023
864db57
Add jsDocCompatibility option
Gerrit0 Apr 7, 2023
0c105ec
One last bugfix
Gerrit0 Apr 7, 2023
27f550f
Fix broken links in example
Gerrit0 Apr 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .config/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"MeaningKeywords"
],
"sort": ["kind", "instance-first", "required-first", "alphabetical"],
"entryPoints": ["../src"],
"entryPointStrategy": "resolve",
"entryPoints": ["../src/index.ts"],
"excludeExternals": true,
"excludeInternal": false,
"excludePrivate": true,
"excludeReferences": true,
"treatWarningsAsErrors": false,
"validation": {
"notExported": true,
Expand All @@ -36,6 +36,6 @@
"Enumerations": 2.0,
"Type Aliases": 2.0
},
"searchInComments": true,
"includeVersion": true,
"logLevel": "Verbose"
}
24 changes: 12 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// Would be nice to lint these, but they shouldn't be included in the project,
// so we need a second eslint config file.
"example",
"src/codegen",
"src/test/converter",
"src/test/converter2",
"src/test/module",
Expand All @@ -41,33 +40,34 @@
"bin"
],
"rules": {
"@typescript-eslint/no-floating-promises": 1,
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/await-thenable": "error",

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

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

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

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

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

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

"no-console": 1,
"no-console": "warn",

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

"no-restricted-syntax": [
"warn",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
- name: Lint
run: npm run lint -- --max-warnings 0
- name: Circular dependency check
uses: gerrit0/circular-dependency-check@v1
uses: gerrit0/circular-dependency-check@v2
with:
entry: dist/index.js
2 changes: 1 addition & 1 deletion .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- id: check
uses: EndBug/version-check@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-lts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- id: check
uses: EndBug/version-check@v1
with:
diff-search: true
- name: Set up Node
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Upgrade npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/visual-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16
- name: Upgrade npm
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ yarn-error.log
/coverage/
/dist/
/docs
/td*.json

typedoc*.tgz
tmp
Expand Down
9 changes: 5 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"configurations": [
{
"args": [
"-r",
"ts-node/register",
"--timeout",
"0",
"--config",
"${workspaceFolder}/.config/mocha.fast.json",
"-g",
"2200"
"${workspaceFolder}/.config/mocha.fast.json"
],
"internalConsoleOptions": "openOnSessionStart",
"name": "Debug Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha.js",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"type": "node"
Expand All @@ -24,6 +24,7 @@
"name": "Attach",
"port": 9229,
"request": "attach",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"sourceMaps": true
Expand Down
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,14 @@

"eslint.workingDirectories": [".", "./example"],
"mochaExplorer.configFile": ".config/mocha.test-explorer.json",
"cSpell.words": ["cname", "tsbuildinfo", "tsdoc"]
"cSpell.words": [
"cname",
"deserializers",
"linkcode",
"linkplain",
"shiki",
"tsbuildinfo",
"tsdoc",
"typestrong"
]
}
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
# Beta

### Breaking Changes

- `@link`, `@linkcode` and `@linkplain` tags will now be resolved with TypeScript's link resolution by default. The `useTsLinkResolution` option
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.
- TypeDoc will no longer automatically load plugins from `node_modules`. Specify the `--plugin` option to indicate which modules should be loaded.
- The `packages` entry point strategy will now run TypeDoc in each provided package directory and then merge the results together.
The previous `packages` strategy has been preserved under `legacy-packages` and will be removed in 0.25. If the new strategy does not work
for your use case, please open an issue.
- Removed `--logger` option, to disable all logging, set the `logLevel` option to `none`.
- Dropped support for legacy `[[link]]`s, removed deprecated `Reflection.findReflectionByName`.
- Added `@overload` to default ignored tags.

### API Breaking Changes

- The `label` property on `Reflection` has moved to `Comment`.
- The default value of the `out` option has been changed from `""` to `"./docs"`, #2195.
- Renamed `DeclarationReflection#version` to `DeclarationReflection#projectVersion` to match property on `ProjectReflection`.
- Removed unused `Reflection#originalName`.
- Removed `Reflection#kindString`, use `ReflectionKind.singularString(reflection.kind)` or `ReflectionKind.pluralString(reflection.kind)` instead.
- The `named-tuple-member` and `template-literal` type kind have been replaced with `namedTupleMember` and `templateLiteral`, #2100.
- Properties related to rendering are no longer stored on `Reflection`, including `url`, `anchor`, `hasOwnDocument`, and `cssClasses`.
- `Application.bootstrap` will no longer load plugins. If you want to load plugins, use `Application.bootstrapWithPlugins` instead, #1635.
- The options passed to `Application.bootstrap` will now be applied both before _and_ after reading options files, which may cause a change in configuration
if using a custom script to run TypeDoc that includes some options, but other options are set in config files.
- Moved `sources` property previously declared on base `Reflection` class to `DeclarationReflection` and `SignatureReflection`.
- Moved `relevanceBoost` from `ContainerReflection` to `DeclarationReflection` since setting it on the parent class has no effect.
- Removed internal `ReferenceType.getSymbol`, reference types no longer reference the `ts.Symbol` to enable generation from serialized JSON.
- `OptionsReader.priority` has been renamed to `OptionsReader.order` to more accurately reflect how it works.
- `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.
- `ReferenceType`s now longer include an `id` property for their target. They now instead include a `target` property.
- Removed `Renderer.addExternalSymbolResolver`, use `Converter.addExternalSymbolResolver` instead.
- Removed `CallbackLogger`.
- Removed `SerializeEventData` from serialization events.
- A `PageEvent` is now required for `getRenderContext`. If caching the context object, `page` must be updated when `getRenderContext` is called.
- `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.
- Removed `secondaryNavigation` member on `DefaultThemeRenderContext`.
- Renamed `navigation` to `sidebar` on `DefaultThemeRenderContext` and `navigation.begin`/`navigation.end` hooks to `sidebar.begin`/`sidebar.end`.

### Features

- Added `--useTsLinkResolution` option (on by default) which tells TypeDoc to use TypeScript's `@link` resolution.
- Added `--jsDocCompatibility` option (on by default) which controls TypeDoc's automatic detection of code blocks in `@example` and `@default` tags.
- Reworked default theme navigation to add support for a page table of contents, #1478, #2189.
- Added support for `@interface` on type aliases to tell TypeDoc to convert the fully resolved type as an interface, #1519
- Added support for `@namespace` on variable declarations to tell TypeDoc to convert the variable as a namespace, #2055.
- Added support for `@prop`/`@property` to specify documentation for a child property of a symbol, intended for use with `@interface`.
- TypeDoc will now produce more informative error messages for options which cannot be set from the cli, #2022.
- TypeDoc will now attempt to guess what option you may have meant if given an invalid option name.
- Plugins may now return a `Promise<void>` from their `load` function, #185.
- TypeDoc now supports plugins written with ESM, #1635.
- Added `Renderer.preRenderAsyncJobs` and `Renderer.postRenderAsyncJobs`, which may be used by plugins to perform async processing for rendering, #185.
Note: Conversion is still intentionally a synchronous process to ensure stability of converted projects between runs.
- TypeDoc options may now be set under the `typedocOptions` key in `package.json`, #2112.
- Added `--cacheBust` option to tell TypeDoc to include include the generation time in files, #2124.
- Added `--excludeReferences` option to tell TypeDoc to omit re-exports of a symbol already included from the documentation.
- Introduced new render hooks `pageSidebar.begin` and `pageSidebar.end`.

### Bug Fixes

- TypeDoc will now ignore package.json files not containing a `name` field, #2190.
- Fixed `@inheritDoc` on signatures (functions, methods, constructors, getters, setters) being unable to inherit from a non-signature.
- Interfaces/classes created via extending a module will no longer contain variables/functions where the member should have been converted as properties/methods, #2150.
- TypeDoc will now ignore a leading `v` in versions, #2212.
- Category titles now render with the same format in the page index and heading title, #2196.
- Fixed crash when using `typeof` on a reference with type arguments, #2220.
- Fixed broken anchor links generated to signatures nested within objects.

### Thanks!

- @bodil
- @futurGH
- @jm4rtinez
- @muratgozel

# Unreleased

## v0.23.28 (2023-03-19)
Expand Down
37 changes: 5 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install typedoc --save-dev

## Usage

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

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

### Monorepos / Workspaces

If your codebase is comprised of one or more npm packages, you can pass the paths to these
packages and TypeDoc will attempt to determine entry points based on `package.json`'s `main`
property (with default value `index.js`) and if it wasn't found, based on `types` property.
If any of the packages given are the root of an [npm Workspace](https://docs.npmjs.com/cli/v7/using-npm/workspaces)
or a [Yarn Workspace](https://classic.yarnpkg.com/en/docs/workspaces/) TypeDoc will find all
the `workspaces` defined in the `package.json`. In order to find your entry points, TypeDoc requires
either that you turn on sourcemaps so that it can discover the original TS file, or that you
specify `"typedocMain": "src/index.ts"` to explicitly state where the package entry point is.
Supports wildcard paths in the same fashion as those found in npm or Yarn workspaces.

#### Single npm module

```bash
typedoc --entryPointStrategy packages .
```

#### Monorepo with npm/Yarn workspace at the root

```bash
typedoc --entryPointStrategy packages .
```

#### Monorepo with manually specified sub-packages to document

This can be useful if you do not want all your workspaces to be processed.
Accepts the same paths as would go in the `package.json`'s workspaces

```bash
# Note the single quotes prevent shell wildcard expansion, allowing typedoc to do the expansion
typedoc --entryPointStrategy packages a-package 'some-more-packages/*' 'some-other-packages/*'
```
If your codebase is comprised of one or more npm packages, you can build documentation for each of them individually
and merge the results together into a single site by setting `entryPointStrategy` to `packages`. In this mode TypeDoc
requires configuration to be present in each directory to specify the entry points. For an example setup, see
https://github.com/Gerrit0/typedoc-packages-example

### Arguments

Expand Down
Loading