Skip to content

Commit 56517ef

Browse files
authored
Merge pull request #1760 from TypeStrong/beta
2 parents 95a7155 + f38ad6f commit 56517ef

File tree

304 files changed

+20642
-11064
lines changed

Some content is hidden

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

304 files changed

+20642
-11064
lines changed

.config/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
../.nyc_output
22
../coverage
33
../dist
4+
../docs
45
**/package-lock.json
56
../src/test/**/specs*.json
67
../src/test/packages/**/*.js
78
../src/test/renderer/specs
89
../src/test/renderer/testProject
10+
../src/test/utils/options/readers/data/invalid2.json
911
../static/main.js
1012
../example/docs/
13+
**/tmp
14+
**/.vs
1115

1216
# Turn this back on once supported by Prettier
1317
../src/test/converter2/behavior/instantiationExpressions.ts

.config/typedoc.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,27 @@
66
"ConverterComponent",
77
"RendererComponent",
88
"SORT_STRATEGIES",
9-
"_ModelToObject"
9+
"_ModelToObject",
10+
"EventHooksMomento",
11+
"MarkedPlugin"
1012
],
1113
"entryPoints": ["../src"],
1214
"entryPointStrategy": "Resolve",
1315
"excludeExternals": true,
16+
"excludeInternal": false,
1417
"excludePrivate": true,
15-
"excludeInternal": true,
1618
"treatWarningsAsErrors": false,
17-
"validation": true,
19+
"validation": {
20+
"notExported": true,
21+
"invalidLink": true,
22+
"notDocumented": false
23+
},
24+
"visibilityFilters": {
25+
"protected": false,
26+
"private": false,
27+
"inherited": true,
28+
"external": false,
29+
"@internal": false
30+
},
1831
"logLevel": "Verbose"
1932
}

.eslintrc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"ignorePatterns": [
1818
"src/test/renderer/specs",
1919
"dist",
20+
"docs",
2021
"coverage",
2122
"static/main.js",
2223
"src/lib/output/themes/default/assets",
@@ -37,6 +38,9 @@
3738
"rules": {
3839
"@typescript-eslint/no-floating-promises": 1,
3940

41+
// This one is just annoying since it complains at incomplete code
42+
"no-empty": 0,
43+
4044
// This rule is factually incorrect. Interfaces which extend some type alias can be used to introduce
4145
// new type names. This is useful particularly when dealing with mixins.
4246
"@typescript-eslint/no-empty-interface": 0,
@@ -45,15 +49,28 @@
4549
"@typescript-eslint/ban-types": 0,
4650
"@typescript-eslint/no-explicit-any": 0,
4751

52+
// Really annoying, doesn't provide any value.
53+
"@typescript-eslint/no-empty-function": 0,
54+
4855
// Declaration merging with a namespace is a necessary tool when working with enums.
4956
"@typescript-eslint/no-namespace": 0,
5057

5158
// Reported by TypeScript
5259
"@typescript-eslint/no-unused-vars": 0,
5360

61+
"no-console": 1,
62+
5463
// Feel free to turn one of these back on and submit a PR!
5564
"@typescript-eslint/no-non-null-assertion": 0,
56-
"@typescript-eslint/explicit-module-boundary-types": 0
65+
"@typescript-eslint/explicit-module-boundary-types": 0,
66+
67+
"no-restricted-syntax": [
68+
"warn",
69+
{
70+
"selector": "ImportDeclaration[source.value=/.*perf$/]",
71+
"message": "Benchmark calls must be removed before committing."
72+
}
73+
]
5774
},
5875
"overrides": [
5976
{

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
# ESLint doesn't support Node 12.10 anymore. Test on the oldest available
9-
# node that our tools support.
10-
node: ["12.22", "12", "14", "16"]
8+
node: ["14.14", "14", "16", "18"]
119
name: Node ${{ matrix.node }}
1210
steps:
1311
- name: Checkout repository
@@ -29,7 +27,7 @@ jobs:
2927
# For other test runs, skip so we don't have to go build the regression screenshots.
3028
SKIP_VISUAL_TEST: true
3129
- name: Lint
32-
run: npm run lint
30+
run: npm run lint -- --max-warnings 0
3331
- name: Circular dependency check
3432
uses: gerrit0/circular-dependency-check@v1
3533
with:

.github/workflows/visual-regression.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ jobs:
2828
npm run build
2929
node dist/test/capture-screenshots.js
3030
- name: Test
31-
run: npx reg-suit run --test
31+
run: npx reg-suit run -c .config/regconfig.json --test
32+
- name: Upload Results
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: visual-regression
36+
path: dist/tmp/.reg

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ yarn-error.log
1313
**/node_modules/
1414
/coverage/
1515
/dist/
16+
/docs
1617

1718
typedoc*.tgz
1819
tmp

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"args": [
9+
"--timeout",
10+
"0",
11+
"--config",
12+
"${workspaceFolder}/.config/mocha.fast.json",
13+
"-g",
14+
"1734"
15+
],
16+
"internalConsoleOptions": "openOnSessionStart",
17+
"name": "Debug Tests",
18+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
19+
"request": "launch",
20+
"skipFiles": ["<node_internals>/**"],
21+
"type": "pwa-node"
22+
},
723
{
824
"name": "Attach",
925
"port": 9229,

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"prettier.configPath": ".config/.prettierrc.json",
1111
"prettier.ignorePath": ".config/.prettierignore",
1212
"eslint.workingDirectories": [".", "./example"],
13-
"mochaExplorer.configFile": ".config/mocha.test-explorer.json"
13+
"mochaExplorer.configFile": ".config/mocha.test-explorer.json",
14+
"cSpell.words": ["cname", "tsbuildinfo", "tsdoc"]
1415
}

CHANGELOG.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
11
# Unreleased
22

3+
### Breaking Changes
4+
5+
- Node 12 is no longer officially supported as it has gone end of life as of 2022-04-30. It might still work, but may stop working at any time.
6+
- Dropped support for TypeScript before 4.6.
7+
- `{@link}` tags in comments will now be resolved as declaration references similar to TSDoc's declaration references.
8+
For most cases, this will just work. See [the documentation](https://typedoc.org/guides/link-resolution/) for details on how link resolution works.
9+
- TypeDoc will now produce warnings for bracketed links (`[[ target ]]`). Use `{@link target}` instead. The `{@link}` syntax will be recognized by [TypeScript 4.3](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-3.html#editor-support-for-link-tags) and later and used to provide better intellisense. TypeDoc version 0.24.0 will remove support for `[[ target ]]` style links.
10+
- `extends` in typedoc.json is now resolved using NodeJS module resolution, so a local path must begin with `./`.
11+
- In the JSON output for `DeclarationReflection`s, `getSignature` is no longer a one-tuple.
12+
- In the JSON output for `DeclarationReflection`s, `setSignature` is no longer a one-tuple.
13+
- In the JSON output for `DeclarationReflection`s, `typeParameter` has been renamed to `typeParameters`
14+
- The `searchGroupBoosts` option must now be given the rendered group name rather than reflection kind names, and can be given custom group names.
15+
- `@inheritDoc` now follows the behavior specified by TSDoc when copying comments with a reference.
16+
- The `gaSite` option has been removed since Google Analytics now infers the site automatically, updated Google Analytics script to latest version, #1846.
17+
- Comments on export declarations will only overrides comments for references and namespaces, #1901.
18+
- The deprecated `listInvalidSymbolLinks` option has been removed. Use `validation.invalidLink` instead.
19+
- The deprecated `true` and `false` values have been removed from `--emit`, to migrate replace `true` with `"both"` and `false` with `"docs"` (the default).
20+
- Links are no longer be resolved against a global list of all symbols. See [the documentation](https://typedoc.org/guides/link-resolution/) for details on link resolution.
21+
- The `validation.invalidLink` option is now on by default.
22+
- `reflection.decorates`, `reflection.decorators`, and their corresponding interfaces have been removed as no code in TypeDoc used them.
23+
- The shape of the `Comment` class has changed significantly to support multiple tag kinds.
24+
- Listeners to `Converter.EVENT_CREATE_TYPE_PARAMETER` and `Converter.EVENT_CREATE_DECLARATION` will now never be passed a `ts.Node` as their third argument.
25+
- Constant variables which are interpreted as functions will no longer have the `ReflectionFlag.Const` flag set.
26+
- `reflection.defaultValue` is no longer set for enum members. The same information is available on `reflection.type` with more precision.
27+
- Removed deprecated `removeReaderByName`, `addDeclarations` and `removeDeclarationByName` methods on `Options`.
28+
- Removed `ProjectReflection.directory`, it was unused by TypeDoc and not properly tested.
29+
- Removed `ProjectReflection.files`, this was an internal cache that should not have been exposed, and shouldn't have existed in the first place, since removing it made TypeDoc faster.
30+
- Removed `ReflectionGroup.kind` since groups can now be created with the `@group` tag.
31+
- Removed `ReflectionKind.Event`, the `@event` tag is now an alias for `@group Events`. Note: This changes the value of `ReflectionKind.Reference` from `16777216` to `8388608`.
32+
- Themes are now set on the document element rather than on body, #1706.
33+
34+
### Features
35+
36+
- TypeDoc now supports the `@group` tag to group reflections in a page. If no `@group` tag is specified, reflections will be grouped according to their kind, #1652.
37+
- TypeDoc will now search for `typedoc.js(on)` in the `.config` folder in the current working directory.
38+
- Entry point strategies `Resolve` and `Expand` may now specify globs, #1926.
39+
- `typedoc.json` now supports comments like `tsconfig.json`.
40+
- TypeDoc will now read the `blockTags`, `inlineTags`, and `modifierTags` out of `tsdoc.json` in the same directory as `tsconfig.json` if it exists.
41+
It is recommended to add `"extends": ["typedoc/tsdoc.json"]`, which defines TypeDoc specific tags to your `tsdoc.json` if you create one.
42+
- If an exported symbol has multiple declarations, TypeDoc will now check all appropriate declarations for comments, and warn if more than one declaration contains a comment, #1855.
43+
- Improved support for JSDoc style `@example` tags. If the tag content does not include a code block, TypeDoc now follows VSCode's behavior of treating the entire block as a code block, #135.
44+
- TypeDoc will now render members marked with `@deprecated` with a line through their name, #1381.
45+
- Added new `commentStyle` option which can be used to control what comments TypeDoc will parse.
46+
47+
| Value | Behavior |
48+
| ----- | -------------------------------------- |
49+
| JSDoc | Use block comments starting with `/**` |
50+
| Block | Use all block comments |
51+
| Line | Use `//` comments |
52+
| All | Use both block and line comments |
53+
54+
- TypeDoc will now warn if part of a comment will be overwritten due to use of `@inheritDoc` instead of silently dropping part of the comment.
55+
- Added support for inline `@inheritDoc` tags, #1480.
56+
- It is now possible to link directly to a specific overload, #1326.
57+
- The JSON output will now include URLs to the file on the remote repository if possible.
58+
- Added a new `visibilityFilters` option which controls the available filters on a page.
59+
- TypeDoc will now try to place block elements on a new line in HTML output, resulting in less overwhelming diffs when rebuilding docs, #1923.
60+
- Added `blockTags`, `inlineTags`, `modifierTags` to control which tags TypeDoc will allow when parsing comments.
61+
If a tag not in in one of these options is encountered, TypeDoc will produce a warning and use context clues to determine how to parse the tag.
62+
63+
### Bug Fixes
64+
65+
- Fixed off by one error in warnings for types referenced but not included in the documentation.
66+
- TypeDoc will no longer render a `Type Parameters` heading if there are no type parameters in some cases.
67+
- Improved source location detection for constructors.
68+
- Improved comment discovery on destructured exported functions, #1770.
69+
- Links which refer to members within a reference reflection will now correctly resolve to the referenced reflection's member, #1770.
70+
- Correctly detect optional parameters in JavaScript projects using JSDoc, #1804.
71+
- Fixed identical anchor links for reflections with the same name, #1845.
72+
- TypeDoc will now automatically inherit documentation from classes `implements` by other interfaces/classes.
73+
- Fixed `@inheritDoc` on accessors, #1927.
74+
- JS exports defined as `exports.foo = ...` will now be converted as variables rather than properties.
75+
- `searchCategoryBoosts` are now correctly computed for all categories, #1960.
76+
- The `excludeNotDocumented` option will no longer hide a module if it has a documentation comment, #1948.
77+
- Prevent `--excludeNotDocumented` from hiding properties of type literals (`a` in `function fn(p: { a: string })`), #1752.
78+
- Allow `cts` and `mts` extensions in packages resolution mode, #1952.
79+
- Corrected schema generation for https://typedoc.org/schema.json
80+
81+
### Thanks!
82+
83+
- @aqumus
84+
- @fb55
85+
- @futurGH
86+
- @Shane4368
87+
- @shmax
88+
389
## v0.22.18 (2022-06-25)
490

591
### Features
@@ -864,7 +950,7 @@
864950
- Missing comments on variable functions, closes #1421
865951
- Resolve type parameters in concrete subclasses
866952
- Use entryPoints to search for readme
867-
- Only create extra programs when dealing with solution style tsconfigs
953+
- Only create extra programs when dealing with solution style tsconfig.json files
868954
- A typo in description of DefaultTheme.getMapping (#1416)
869955
- Correct handling of arrays in generic constraints, closes #1408
870956
- Type converters threw on older TS versions

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,17 @@ For a complete list of the command line arguments run `typedoc --help` or visit
7979
Specifies the location the documentation should be written to. Defaults to `./docs`
8080
- `--json <path/to/output.json>`<br>
8181
Specifies the location and file name a json file describing the project is
82-
written to. When specified no documentation will be generated.
82+
written to. When specified no documentation will be generated unless `--out` is also
83+
specified.
8384
- `--options`<br>
8485
Specify a json option file that should be loaded. If not specified TypeDoc
8586
will look for 'typedoc.json' in the current directory.
8687
- `--tsconfig <path/to/tsconfig.json>`<br>
8788
Specify a typescript config file that should be loaded. If not
8889
specified TypeDoc will look for 'tsconfig.json' in the current directory.
89-
90-
#### Source file handling
91-
9290
- `--exclude <pattern>`<br>
9391
Exclude files by the given pattern when a path is provided as source.
9492
Supports standard minimatch patterns.
95-
- `--excludeNotDocumented`<br>
96-
Only document items which have a doc comment. This option is useful, if you
97-
want to document only small part of your symbols and do not show the
98-
remaining ones in the documentation.
9993

10094
#### Theming
10195

@@ -109,8 +103,6 @@ For a complete list of the command line arguments run `typedoc --help` or visit
109103

110104
#### Miscellaneous
111105

112-
- `--listInvalidSymbolLinks`<br>
113-
Display the list of links that don't point to actual code symbols.
114106
- `--version`<br>
115107
Display the version number of TypeDoc.
116108
- `--help`<br>
@@ -123,9 +115,3 @@ You can find TypeDoc on GitHub; feel free to open an issue or create a pull requ
123115
https://github.com/TypeStrong/typedoc
124116

125117
For more information, read the [contribution guide](https://github.com/TypeStrong/typedoc/blob/master/.github/CONTRIBUTING.md).
126-
127-
## License
128-
129-
Copyright (c) 2015 [Sebastian Lenz](https://typedoc.org).<br>
130-
Copyright (c) 2016-2021 [TypeDoc Contributors](https://github.com/TypeStrong/typedoc/graphs/contributors).<br>
131-
Licensed under the Apache License 2.0.

example/typedoc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"Model": 1.2
1010
},
1111
"searchGroupBoosts": {
12-
"Class": 1.5
12+
"Classes": 1.5
1313
}
1414
}

internal-docs/custom-themes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class MyThemeContext extends DefaultThemeRenderContext {
2626
// to destructure the context object to only grab what they care about.
2727
override analytics = () => {
2828
// Reusing existing option rather than declaring our own for brevity
29-
if (!this.options.isSet("gaSite")) return;
29+
if (!this.options.isSet("gaId")) return;
3030

31-
const site = this.options.getValue("gaSite");
31+
const site = this.options.getValue("gaId");
3232

3333
const script = `
3434
(function() {

0 commit comments

Comments
 (0)