umberto 6.1.2 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/hexo-config.json +14 -19
- package/package.json +15 -21
- package/scripts/filter/after-post-render/time-end.js +5 -6
- package/scripts/utils/getreportissuewidgeturl.js +1 -1
- package/scripts/utils/logcrossprojectreference.js +3 -3
- package/scripts/utils/parselinks.js +12 -6
- package/src/api-builder/classes/description-parser.js +2 -2
- package/src/api-builder/utils/findtargetdoclet.js +2 -2
- package/src/data-converter/converters/typedoc/abstractparser.js +54 -50
- package/src/data-converter/converters/typedoc/accessorparser.js +7 -5
- package/src/data-converter/converters/typedoc/classparser.js +5 -3
- package/src/data-converter/converters/typedoc/computedpropertyparser.js +4 -3
- package/src/data-converter/converters/typedoc/constantparser.js +5 -3
- package/src/data-converter/converters/typedoc/constructorparser.js +4 -3
- package/src/data-converter/converters/typedoc/errorparser.js +4 -10
- package/src/data-converter/converters/typedoc/eventparser.js +4 -10
- package/src/data-converter/converters/typedoc/functionparser.js +5 -3
- package/src/data-converter/converters/typedoc/interfaceparser.js +5 -3
- package/src/data-converter/converters/typedoc/methodparser.js +6 -4
- package/src/data-converter/converters/typedoc/moduleparser.js +9 -3
- package/src/data-converter/converters/typedoc/propertyparser.js +7 -28
- package/src/data-converter/converters/typedoc/referenceparser.js +41 -0
- package/src/data-converter/converters/typedoc/reflectionkind.js +34 -0
- package/src/data-converter/converters/typedoc/typedoc.ts +215 -214
- package/src/data-converter/converters/typedoc/typedocconverter.js +130 -99
- package/src/data-converter/converters/typedoc/typeparser.js +10 -6
- package/src/data-converter/converters/typedoc2umberto.js +9 -3
- package/src/helpers/snippets.js +7 -6
- package/src/hexo/get-repo-urls.js +4 -5
- package/src/hexo-manager.js +16 -12
- package/src/index.js +4 -4
- package/src/sdk-builder/get-sdk-sources.js +3 -2
- package/src/tasks/build-documentation.js +2 -62
- package/src/tasks/cache-files.js +2 -2
- package/src/tasks/copy-files.js +4 -3
- package/src/tasks/copy-project-icons.js +10 -18
- package/src/tasks/create-sitemap-index.js +40 -0
- package/src/tasks/create-sitemap-step.js +106 -0
- package/src/tasks/create-sitemap.js +50 -29
- package/src/tasks/create-sym-links.js +7 -7
- package/src/tasks/get-project-config.js +3 -2
- package/src/tasks/overwrite-api-guides.js +2 -2
- package/src/tasks/read-doc-sources.js +2 -2
- package/src/tasks/validate-links.js +8 -5
- package/src/tasks/watcher.js +19 -16
- package/src/tasks/write-html-files.js +11 -26
- package/src/template/template-collection.js +1 -1
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_type.pug +9 -0
- package/themes/umberto/layout/umberto/_api-docs/_mixin/_type.pug +9 -0
- package/themes/umberto/src/gloria/js/_codeswitcherbuttons.js +2 -2
- package/themes/umberto/src/gloria/js/app.js +0 -5
- package/themes/umberto/src/umberto/js/_codeswitcherbuttons.js +2 -2
- package/themes/umberto/src/umberto/js/app.js +0 -5
- package/src/helpers/copy-file.js +0 -34
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [7.0.1](https://github.com/cksource/umberto/compare/v7.0.0...v7.0.1) (2025-05-14)
|
|
5
|
+
|
|
6
|
+
### Other changes
|
|
7
|
+
|
|
8
|
+
* Updated the project dependencies. Closes [#1253](https://github.com/cksource/umberto/issues/1253). ([commit](https://github.com/cksource/umberto/commit/28d74364207ab055ad76c2857d58cccb1866559b))
|
|
9
|
+
* Removed dependencies that can be replaced with native APIs or other already used dependencies. ([commit](https://github.com/cksource/umberto/commit/28d74364207ab055ad76c2857d58cccb1866559b))
|
|
10
|
+
* Sitemaps will be generated separately for each project. Closes [#1254](https://github.com/cksource/umberto/issues/1254). ([commit](https://github.com/cksource/umberto/commit/7968755b2a4b1c23768a9420292eb1d168b898b3))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [7.0.0](https://github.com/cksource/umberto/compare/v6.1.2...v7.0.0) (2025-05-05)
|
|
14
|
+
|
|
15
|
+
### BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* Rendering TypeScript-based API pages requires an input file generated by Typedoc in version `0.28.0` or later.
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* Support for rendering TypeScript API pages based on output from `typedoc@0.28`. Closes [#1188](https://github.com/cksource/umberto/issues/1188). ([commit](https://github.com/cksource/umberto/commit/561f94c6b025a0f1dbcc01c0c0e70ee5eeae387e))
|
|
22
|
+
|
|
23
|
+
|
|
4
24
|
## [6.1.2](https://github.com/cksource/umberto/compare/v6.1.1...v6.1.2) (2025-04-23)
|
|
5
25
|
|
|
6
26
|
### Bug fixes
|
package/hexo-config.json
CHANGED
|
@@ -15,16 +15,11 @@
|
|
|
15
15
|
"pug": {
|
|
16
16
|
"pretty": true
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
},
|
|
24
|
-
"markdown_it_plus": {
|
|
25
|
-
"highlight": false,
|
|
26
|
-
"html": true,
|
|
27
|
-
"breaks": true,
|
|
18
|
+
"syntax_highlighter": "",
|
|
19
|
+
"markdown_it_plus": {
|
|
20
|
+
"highlight": false,
|
|
21
|
+
"html": true,
|
|
22
|
+
"breaks": true,
|
|
28
23
|
"linkify": false,
|
|
29
24
|
"plugins": [
|
|
30
25
|
{
|
|
@@ -42,19 +37,19 @@
|
|
|
42
37
|
"plugin": {
|
|
43
38
|
"name": "markdown-it-expand-tabs",
|
|
44
39
|
"enable": true,
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
"options": {
|
|
41
|
+
"tabWidth": 4
|
|
47
42
|
}
|
|
48
43
|
}
|
|
49
44
|
}
|
|
50
45
|
]
|
|
51
46
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
"skip_render": [
|
|
48
|
+
"**/*.css",
|
|
49
|
+
"**/*.scss",
|
|
50
|
+
"**/*.html",
|
|
51
|
+
"**/*.json",
|
|
52
|
+
"**/*.js",
|
|
53
|
+
"**/*.txt"
|
|
59
54
|
]
|
|
60
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umberto",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "CKSource Documentation builder",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,42 +15,36 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/core": "^7.18.10",
|
|
18
|
-
"@babel/polyfill": "^7.12.1",
|
|
19
18
|
"@babel/preset-env": "^7.18.10",
|
|
20
19
|
"@ckeditor/jsdoc-plugins": "^43.0.0",
|
|
21
|
-
"babel-loader": "^
|
|
22
|
-
"chalk": "^4.1.0",
|
|
20
|
+
"babel-loader": "^10.0.0",
|
|
23
21
|
"cheerio": "^1.0.0",
|
|
24
|
-
"cpx": "^1.5.0",
|
|
25
|
-
"del": "^6.1.1",
|
|
26
|
-
"element-closest": "^3.0.2",
|
|
27
22
|
"escape-string-regexp": "^4.0.0",
|
|
28
23
|
"fs-extra": "^11.0.0",
|
|
29
|
-
"fuse.js": "^
|
|
30
|
-
"glob": "^
|
|
31
|
-
"hexo": "^
|
|
32
|
-
"hexo-generator-archive": "^
|
|
33
|
-
"hexo-generator-category": "^
|
|
34
|
-
"hexo-generator-index": "^
|
|
35
|
-
"hexo-generator-tag": "^
|
|
24
|
+
"fuse.js": "^7.1.0",
|
|
25
|
+
"glob": "^11.0.2",
|
|
26
|
+
"hexo": "^7.3.0",
|
|
27
|
+
"hexo-generator-archive": "^2.0.0",
|
|
28
|
+
"hexo-generator-category": "^2.0.0",
|
|
29
|
+
"hexo-generator-index": "^4.0.0",
|
|
30
|
+
"hexo-generator-tag": "^2.0.0",
|
|
36
31
|
"hexo-render-pug": "^2.1.4",
|
|
37
32
|
"hexo-renderer-markdown-it-plus": "^1.0.5",
|
|
38
33
|
"htmlparser2": "^10.0.0",
|
|
39
34
|
"javascript-stringify": "^2.1.0",
|
|
40
|
-
"jquery": "~3.
|
|
35
|
+
"jquery": "~3.7.1",
|
|
41
36
|
"js-beautify": "^1.14.4",
|
|
42
37
|
"lodash": "^4.17.21",
|
|
43
|
-
"markdown-it": "^
|
|
38
|
+
"markdown-it": "^14.1.0",
|
|
44
39
|
"markdown-it-expand-tabs": "^1.0.13",
|
|
45
40
|
"markdown-it-toc-and-anchor": "^4.2.0",
|
|
46
41
|
"medium-zoom": "^1.0.6",
|
|
47
|
-
"minimatch": "^
|
|
48
|
-
"mkdirp": "^1.0.4",
|
|
42
|
+
"minimatch": "^10.0.1",
|
|
49
43
|
"moment": "^2.29.4",
|
|
50
|
-
"nyc": "^
|
|
44
|
+
"nyc": "^17.1.0",
|
|
51
45
|
"pug": "^3.0.2",
|
|
52
46
|
"sass": "^1.54.0",
|
|
53
|
-
"sitemap": "^
|
|
47
|
+
"sitemap": "^8.0.0",
|
|
54
48
|
"tippy.js": "^6.3.7",
|
|
55
49
|
"tree-model": "^1.0.7",
|
|
56
50
|
"upath": "^2.0.1",
|
|
@@ -79,6 +73,6 @@
|
|
|
79
73
|
"packages/**"
|
|
80
74
|
],
|
|
81
75
|
"hexo": {
|
|
82
|
-
"version": "
|
|
76
|
+
"version": "7.3.0"
|
|
83
77
|
}
|
|
84
78
|
}
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const chalk = require( 'chalk' );
|
|
8
|
+
const { format, styleText } = require( 'util' );
|
|
10
9
|
|
|
11
10
|
hexo.extend.filter.register( 'after_post_render', page => {
|
|
12
11
|
if ( !hexo.projectGlobals.common || !hexo.projectGlobals.common.verbose ) {
|
|
@@ -17,11 +16,11 @@ hexo.extend.filter.register( 'after_post_render', page => {
|
|
|
17
16
|
// Log only pages, which generates for longer than 1 second.
|
|
18
17
|
if ( time[ 0 ] > 1 ) {
|
|
19
18
|
console.log(
|
|
20
|
-
|
|
19
|
+
format(
|
|
21
20
|
'Page: %s was processed in: %s.%ss.',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
styleText( 'cyanBright', page.source ),
|
|
22
|
+
styleText( 'yellow', time[ 0 ] ),
|
|
23
|
+
styleText( 'yellow', time[ 1 ] )
|
|
25
24
|
)
|
|
26
25
|
);
|
|
27
26
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const { styleText } = require( 'util' );
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Logs an error message about a cross-project reference found in the parsed expression.
|
|
@@ -19,8 +19,8 @@ const chalk = require( 'chalk' );
|
|
|
19
19
|
module.exports = function logCrossProjectReference( { expression, source } ) {
|
|
20
20
|
process.exitCode = 1;
|
|
21
21
|
|
|
22
|
-
const message = `${
|
|
23
|
-
const messageLocation = source ? ` in ${
|
|
22
|
+
const message = `${ styleText( 'red', 'Error:' ) } Failed while convert ${ styleText( 'cyanBright', expression ) } tag`;
|
|
23
|
+
const messageLocation = source ? ` in ${ styleText( 'magentaBright', source ) }.` : '.';
|
|
24
24
|
const messageDescription = ' Cross-project references are not supported.';
|
|
25
25
|
|
|
26
26
|
console.log( message + messageLocation + messageDescription );
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
+
const { styleText } = require( 'util' );
|
|
8
9
|
const upath = require( 'upath' );
|
|
9
10
|
const splitLongname = require( '../../src/helpers/split-longname' );
|
|
10
|
-
const chalk = require( 'chalk' );
|
|
11
11
|
|
|
12
12
|
const LINK_REGEXP = /\\?{(?:@linkapi|@link|@linksdk|@linkexample)\s+[^{]+?({[^}]+})?[^{}]*\\?}/g;
|
|
13
13
|
|
|
@@ -127,7 +127,7 @@ function linkToApi( str, data, hexo, { relativeUrlHelper, isSilentError } ) {
|
|
|
127
127
|
value: str,
|
|
128
128
|
source: data.source,
|
|
129
129
|
isSilent: isSilentError,
|
|
130
|
-
description: `Project ${
|
|
130
|
+
description: `Project ${ styleText( 'redBright', data.projectName ) } is not defined.`
|
|
131
131
|
} );
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -343,10 +343,16 @@ function onError( { value, source, isSilent, description } ) {
|
|
|
343
343
|
if ( !isSilent ) {
|
|
344
344
|
process.exitCode = 1;
|
|
345
345
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
346
|
+
const message = [
|
|
347
|
+
styleText( 'red', 'Error:' ),
|
|
348
|
+
`Failed to convert ${ styleText( 'cyanBright', value ) } tag`,
|
|
349
|
+
source && `in ${ styleText( 'magentaBright', source ) }`,
|
|
350
|
+
description && `because ${ styleText( 'italic', description ) }`
|
|
351
|
+
]
|
|
352
|
+
.filter( Boolean )
|
|
353
|
+
.join( ' ' );
|
|
354
|
+
|
|
355
|
+
console.log( message );
|
|
350
356
|
}
|
|
351
357
|
|
|
352
358
|
return value;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
+
const { styleText } = require( 'util' );
|
|
8
9
|
const cheerio = require( 'cheerio' );
|
|
9
10
|
const splitLongname = require( '../../helpers/split-longname' );
|
|
10
|
-
const chalk = require( 'chalk' );
|
|
11
11
|
const macroReplacer = require( '../../tasks/macro-replacer' );
|
|
12
12
|
const findTargetDoclet = require( '../utils/findtargetdoclet' );
|
|
13
13
|
const { hasDedicatedApiPages, LONG_NAME_LABEL_REGEXP, LONG_NAME_MEMBER_SEPARATOR_REGEXP } = require( '../utils/utils' );
|
|
@@ -283,7 +283,7 @@ module.exports = class DescriptionParser {
|
|
|
283
283
|
replaceToPhrase = `<a href="${ href }">${ linkContent }</a>`;
|
|
284
284
|
} else {
|
|
285
285
|
console.log(
|
|
286
|
-
`${
|
|
286
|
+
`${ styleText( 'yellow', 'Warning:' ) } Invalid link in API docs: ${ styleText( 'gray', fullMatch ) }.`,
|
|
287
287
|
'There is no doclet of the link target.'
|
|
288
288
|
);
|
|
289
289
|
|
|
@@ -79,9 +79,9 @@ module.exports = function findTargetDoclet( docletCollection, options ) {
|
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const { properties
|
|
82
|
+
const { properties } = typedefItem;
|
|
83
83
|
|
|
84
|
-
return properties.find( item => item.name === member ) ? typedefItem : null;
|
|
84
|
+
return ( properties || [] ).find( item => item.name === member ) ? typedefItem : null;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
let targetDoclet;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const TypedocConverter = require( './typedocconverter' );
|
|
9
|
+
const ReflectionKind = require( './reflectionkind' );
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* An abstract parser class providing basic utils for converting Typedoc reflection to JSDoc doclet.
|
|
@@ -14,14 +15,14 @@ module.exports = class AbstractParser {
|
|
|
14
15
|
/**
|
|
15
16
|
* @abstract
|
|
16
17
|
* @method canParse
|
|
17
|
-
* @param {
|
|
18
|
+
* @param {BaseReflection} item
|
|
18
19
|
* @returns {Boolean}
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* @abstract
|
|
23
24
|
* @method parse
|
|
24
|
-
* @param {
|
|
25
|
+
* @param {BaseReflection} item
|
|
25
26
|
* @param {String|null} [parentName=null]
|
|
26
27
|
* @returns {Object}
|
|
27
28
|
*/
|
|
@@ -29,7 +30,7 @@ module.exports = class AbstractParser {
|
|
|
29
30
|
/**
|
|
30
31
|
* Coverts the item's comment from Markdown to HTML.
|
|
31
32
|
*
|
|
32
|
-
* @param {
|
|
33
|
+
* @param {BaseReflection} item
|
|
33
34
|
* @returns {String}
|
|
34
35
|
*/
|
|
35
36
|
getComment( item ) {
|
|
@@ -41,33 +42,35 @@ module.exports = class AbstractParser {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
* @param {
|
|
45
|
+
* @param {BaseReflection} item
|
|
45
46
|
* @param {String|null} [parentName=null]
|
|
46
47
|
* @returns {String}
|
|
47
48
|
*/
|
|
48
49
|
getLongName( item, parentName = null ) {
|
|
49
50
|
let separator;
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if ( item.isCKEditor5Event ) {
|
|
53
|
+
separator = '#event:';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
switch ( item.kind ) {
|
|
57
|
+
case ReflectionKind.Module:
|
|
53
58
|
separator = ':';
|
|
54
59
|
parentName = 'module';
|
|
55
60
|
break;
|
|
56
61
|
|
|
57
|
-
case
|
|
58
|
-
case
|
|
59
|
-
case
|
|
60
|
-
case
|
|
62
|
+
case ReflectionKind.Variable:
|
|
63
|
+
case ReflectionKind.Function:
|
|
64
|
+
case ReflectionKind.Class:
|
|
65
|
+
case ReflectionKind.Interface:
|
|
66
|
+
case ReflectionKind.TypeAlias:
|
|
61
67
|
separator = '~';
|
|
62
68
|
break;
|
|
63
69
|
|
|
64
|
-
case 'Event':
|
|
65
|
-
separator = '#event:';
|
|
66
|
-
break;
|
|
67
|
-
|
|
68
70
|
default:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
if ( !separator ) {
|
|
72
|
+
separator = this.getScope( item ) === 'static' ? '.' : '#';
|
|
73
|
+
}
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
return `${ parentName }${ separator }${ item.name }`;
|
|
@@ -76,7 +79,7 @@ module.exports = class AbstractParser {
|
|
|
76
79
|
/**
|
|
77
80
|
* Prepares the name for the computed property.
|
|
78
81
|
*
|
|
79
|
-
* @param {
|
|
82
|
+
* @param {ComputedPropertyReflection} item
|
|
80
83
|
* @returns {String}
|
|
81
84
|
*/
|
|
82
85
|
getComputedName( item ) {
|
|
@@ -86,7 +89,7 @@ module.exports = class AbstractParser {
|
|
|
86
89
|
/**
|
|
87
90
|
* Returns the access type for the item.
|
|
88
91
|
*
|
|
89
|
-
* @param {
|
|
92
|
+
* @param {BaseReflection} item
|
|
90
93
|
* @returns {'public'|'internal'|'protected'|'private'}
|
|
91
94
|
*/
|
|
92
95
|
getVisibility( item ) {
|
|
@@ -110,48 +113,49 @@ module.exports = class AbstractParser {
|
|
|
110
113
|
/**
|
|
111
114
|
* Returns the item's kind.
|
|
112
115
|
*
|
|
113
|
-
* @param {
|
|
116
|
+
* @param {BaseReflection} item
|
|
114
117
|
* @returns {String}
|
|
115
118
|
*/
|
|
116
119
|
getKind( item ) {
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
if ( item.isCKEditor5Event ) {
|
|
121
|
+
return 'event';
|
|
122
|
+
}
|
|
123
|
+
if ( item.isCKEditor5Error ) {
|
|
124
|
+
return 'error';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
switch ( item.kind ) {
|
|
128
|
+
case ReflectionKind.Module:
|
|
119
129
|
return 'module';
|
|
120
130
|
|
|
121
|
-
case
|
|
131
|
+
case ReflectionKind.Class:
|
|
122
132
|
return 'class';
|
|
123
133
|
|
|
124
|
-
case
|
|
125
|
-
case
|
|
126
|
-
case
|
|
134
|
+
case ReflectionKind.Function:
|
|
135
|
+
case ReflectionKind.Method:
|
|
136
|
+
case ReflectionKind.Constructor:
|
|
127
137
|
return 'function';
|
|
128
138
|
|
|
129
|
-
case
|
|
139
|
+
case ReflectionKind.Interface:
|
|
130
140
|
return 'interface';
|
|
131
141
|
|
|
132
|
-
case
|
|
133
|
-
case
|
|
134
|
-
case
|
|
142
|
+
case ReflectionKind.Accessor:
|
|
143
|
+
case ReflectionKind.Property:
|
|
144
|
+
case ReflectionKind.IndexSignature:
|
|
135
145
|
return 'member';
|
|
136
146
|
|
|
137
|
-
case
|
|
147
|
+
case ReflectionKind.Variable:
|
|
138
148
|
return 'constant';
|
|
139
149
|
|
|
140
|
-
case
|
|
150
|
+
case ReflectionKind.TypeAlias:
|
|
141
151
|
return 'typedef';
|
|
142
|
-
|
|
143
|
-
case 'Event':
|
|
144
|
-
return 'event';
|
|
145
|
-
|
|
146
|
-
case 'Error':
|
|
147
|
-
return 'error';
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
|
|
151
155
|
/**
|
|
152
156
|
* Returns the item's scope.
|
|
153
157
|
*
|
|
154
|
-
* @param {
|
|
158
|
+
* @param {BaseReflection} item
|
|
155
159
|
* @returns {'instance'|'static'}
|
|
156
160
|
*/
|
|
157
161
|
getScope( item ) {
|
|
@@ -167,7 +171,7 @@ module.exports = class AbstractParser {
|
|
|
167
171
|
/**
|
|
168
172
|
* Returns the `extraId` combined from the item's scope, kind, name and optional variation.
|
|
169
173
|
*
|
|
170
|
-
* @param {
|
|
174
|
+
* @param {BaseReflection} item
|
|
171
175
|
* @returns {String}
|
|
172
176
|
*/
|
|
173
177
|
getExtraId( item ) {
|
|
@@ -179,7 +183,7 @@ module.exports = class AbstractParser {
|
|
|
179
183
|
/**
|
|
180
184
|
* Returns the long names of the events that are fired from the signature.
|
|
181
185
|
*
|
|
182
|
-
* @param {
|
|
186
|
+
* @param {BaseReflection} signature
|
|
183
187
|
* @param {String} parentName
|
|
184
188
|
* @returns {Array.<String>|null}
|
|
185
189
|
*/
|
|
@@ -202,7 +206,7 @@ module.exports = class AbstractParser {
|
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
/**
|
|
205
|
-
* @param {
|
|
209
|
+
* @param {BaseReflection} signature
|
|
206
210
|
* @param {String} parentName
|
|
207
211
|
* @returns {Array.<Object>|null}
|
|
208
212
|
*/
|
|
@@ -243,7 +247,7 @@ module.exports = class AbstractParser {
|
|
|
243
247
|
* Returns the URL to GitHub with selected line, where the given doclet is defined.
|
|
244
248
|
* The URL includes a commit hash which was used to build the API docs.
|
|
245
249
|
*
|
|
246
|
-
* @param {
|
|
250
|
+
* @param {BaseReflection} item
|
|
247
251
|
* @param {Number} sourceIndex
|
|
248
252
|
* @returns {Object|null}
|
|
249
253
|
*/
|
|
@@ -264,7 +268,7 @@ module.exports = class AbstractParser {
|
|
|
264
268
|
/**
|
|
265
269
|
* Returns links from the "@see" tags.
|
|
266
270
|
*
|
|
267
|
-
* @param {
|
|
271
|
+
* @param {BaseReflection} item
|
|
268
272
|
* @param {String|null} [parentName=null]
|
|
269
273
|
* @returns {Array.<String>}
|
|
270
274
|
*/
|
|
@@ -308,7 +312,7 @@ module.exports = class AbstractParser {
|
|
|
308
312
|
*
|
|
309
313
|
* The readonly state can be marked either by a TypeScript `readonly` keyword, or by the `@readonly` JSDoc keyword.
|
|
310
314
|
*
|
|
311
|
-
* @param {
|
|
315
|
+
* @param {BaseReflection} item
|
|
312
316
|
* @returns {Boolean}
|
|
313
317
|
*/
|
|
314
318
|
isReadonly( item ) {
|
|
@@ -324,7 +328,7 @@ module.exports = class AbstractParser {
|
|
|
324
328
|
*
|
|
325
329
|
* The observable state can be marked by the `@observable` JSDoc keyword.
|
|
326
330
|
*
|
|
327
|
-
* @param {
|
|
331
|
+
* @param {BaseReflection} item
|
|
328
332
|
* @returns {Boolean}
|
|
329
333
|
*/
|
|
330
334
|
isObservable( item ) {
|
|
@@ -338,7 +342,7 @@ module.exports = class AbstractParser {
|
|
|
338
342
|
/**
|
|
339
343
|
* Checks if the item is marked as an optional.
|
|
340
344
|
*
|
|
341
|
-
* @param {
|
|
345
|
+
* @param {BaseReflection} item
|
|
342
346
|
* @returns {Boolean}
|
|
343
347
|
*/
|
|
344
348
|
isOptional( item ) {
|
|
@@ -355,7 +359,7 @@ module.exports = class AbstractParser {
|
|
|
355
359
|
* The `internal` state means the same as `protected`, but with one exception: the `internal` member can be used from outside the class
|
|
356
360
|
* in which it is defined (or its derivatives), as opposed to the `protected` state.
|
|
357
361
|
*
|
|
358
|
-
* @param {
|
|
362
|
+
* @param {BaseReflection} item
|
|
359
363
|
* @returns {Boolean}
|
|
360
364
|
*/
|
|
361
365
|
isInternal( item ) {
|
|
@@ -369,7 +373,7 @@ module.exports = class AbstractParser {
|
|
|
369
373
|
/**
|
|
370
374
|
* Checks if the member is marked by the `@deprecated` JSDoc tag.
|
|
371
375
|
*
|
|
372
|
-
* @param {
|
|
376
|
+
* @param {BaseReflection} item
|
|
373
377
|
* @returns {Boolean}
|
|
374
378
|
*/
|
|
375
379
|
isDeprecated( item ) {
|
|
@@ -387,7 +391,7 @@ module.exports = class AbstractParser {
|
|
|
387
391
|
* It happens when the member has not specified `file` property. In such a case, Umberto does not know
|
|
388
392
|
* where to point to a source and decides to skip generating the "See source" button.
|
|
389
393
|
*
|
|
390
|
-
* @param {
|
|
394
|
+
* @param {BaseReflection} item
|
|
391
395
|
* @returns {Boolean}
|
|
392
396
|
*/
|
|
393
397
|
shouldSkipSource( item ) {
|
|
@@ -402,7 +406,7 @@ module.exports = class AbstractParser {
|
|
|
402
406
|
* Returns a name specified in the `@label` annotation.
|
|
403
407
|
*
|
|
404
408
|
* @protected
|
|
405
|
-
* @param {
|
|
409
|
+
* @param {BaseReflection} item
|
|
406
410
|
* @returns {String}
|
|
407
411
|
*/
|
|
408
412
|
_getLabelName( item ) {
|
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const AbstractParser = require( './abstractparser' );
|
|
9
|
+
const ReflectionKind = require( './reflectionkind' );
|
|
9
10
|
|
|
10
11
|
module.exports = class AccessorParser extends AbstractParser {
|
|
11
12
|
/**
|
|
12
|
-
* @param {
|
|
13
|
+
* @param {BaseReflection} item
|
|
13
14
|
* @returns {Boolean}
|
|
14
15
|
*/
|
|
15
16
|
canParse( item ) {
|
|
16
|
-
return item.
|
|
17
|
+
return item.kind === ReflectionKind.Accessor;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Checks if the accessor is readonly.
|
|
21
22
|
*
|
|
22
23
|
* @override
|
|
23
|
-
* @param {
|
|
24
|
+
* @param {AccessorReflection} item
|
|
24
25
|
* @returns {Boolean}
|
|
25
26
|
*/
|
|
26
27
|
isReadonly( item ) {
|
|
@@ -28,7 +29,7 @@ module.exports = class AccessorParser extends AbstractParser {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
* @param {
|
|
32
|
+
* @param {AccessorReflection} item
|
|
32
33
|
* @param {String} parentName
|
|
33
34
|
* @returns {Object}
|
|
34
35
|
*/
|
|
@@ -41,6 +42,7 @@ module.exports = class AccessorParser extends AbstractParser {
|
|
|
41
42
|
// Needed for post-processing once all project reflections are converted.
|
|
42
43
|
_signature: [ getSignature || {}, setSignature || {} ],
|
|
43
44
|
|
|
45
|
+
id: item.id,
|
|
44
46
|
name: item.name,
|
|
45
47
|
memberof: parentName,
|
|
46
48
|
longname: this.getLongName( item, parentName ),
|
|
@@ -65,7 +67,7 @@ module.exports = class AccessorParser extends AbstractParser {
|
|
|
65
67
|
/**
|
|
66
68
|
* Returns the access type for the item based on its signatures.
|
|
67
69
|
*
|
|
68
|
-
* @param {
|
|
70
|
+
* @param {AccessorReflection} item
|
|
69
71
|
* @returns {'public'|'internal'|'protected'|'private'}
|
|
70
72
|
*/
|
|
71
73
|
getVisibilityIncludingSignature( item ) {
|
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const AbstractParser = require( './abstractparser' );
|
|
9
|
+
const ReflectionKind = require( './reflectionkind' );
|
|
9
10
|
|
|
10
11
|
module.exports = class ClassParser extends AbstractParser {
|
|
11
12
|
/**
|
|
12
|
-
* @param {
|
|
13
|
+
* @param {BaseReflection} item
|
|
13
14
|
* @returns {Boolean}
|
|
14
15
|
*/
|
|
15
16
|
canParse( item ) {
|
|
16
|
-
return item.
|
|
17
|
+
return item.kind === ReflectionKind.Class;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* @param {
|
|
21
|
+
* @param {ClassReflection} item
|
|
21
22
|
* @param {String} parentName
|
|
22
23
|
* @returns {Object}
|
|
23
24
|
*/
|
|
@@ -26,6 +27,7 @@ module.exports = class ClassParser extends AbstractParser {
|
|
|
26
27
|
// Needed for post-processing once all project reflections are converted.
|
|
27
28
|
_signature: item,
|
|
28
29
|
|
|
30
|
+
id: item.id,
|
|
29
31
|
name: item.name,
|
|
30
32
|
memberof: parentName,
|
|
31
33
|
longname: this.getLongName( item, parentName ),
|
|
@@ -6,18 +6,19 @@
|
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
const PropertyParser = require( './propertyparser' );
|
|
9
|
+
const ReflectionKind = require( './reflectionkind' );
|
|
9
10
|
|
|
10
11
|
module.exports = class ComputedPropertyParser extends PropertyParser {
|
|
11
12
|
/**
|
|
12
|
-
* @param {
|
|
13
|
+
* @param {BaseReflection} item
|
|
13
14
|
* @returns {Boolean}
|
|
14
15
|
*/
|
|
15
16
|
canParse( item ) {
|
|
16
|
-
return item.
|
|
17
|
+
return item.kind === ReflectionKind.IndexSignature;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* @param {
|
|
21
|
+
* @param {ComputedPropertyReflection} item
|
|
21
22
|
* @param {String} parentName
|
|
22
23
|
* @returns {Object}
|
|
23
24
|
*/
|