umberto 9.2.0 → 9.3.0

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 CHANGED
@@ -1,6 +1,21 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [9.3.0](https://github.com/cksource/umberto/compare/v9.2.0...v9.3.0) (January 27, 2026)
5
+
6
+ ### Features
7
+
8
+ * The API documentation builder now generates dedicated pages for [`Enum`](https://www.typescriptlang.org/docs/handbook/enums.html) types, presented in a format similar to object definitions.
9
+
10
+ ### Bug fixes
11
+
12
+ * Improved rendering of `typedef` pages for union types by displaying their supported values, which were previously not shown.
13
+
14
+ ### Other changes
15
+
16
+ * Improved rendering of [`templateLiteral`](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) types that reference a module. They are now rendered as clickable links pointing to the corresponding page.
17
+
18
+
4
19
  ## [9.2.0](https://github.com/cksource/umberto/compare/v9.1.3...v9.2.0) (January 7, 2026)
5
20
 
6
21
  ### Features
@@ -39,20 +54,6 @@ Changelog
39
54
 
40
55
  * Added support for the `environment` field in Sentry configuration.
41
56
 
42
-
43
- ## [9.1.0](https://github.com/cksource/umberto/compare/v9.0.0...v9.1.0) (November 24, 2025)
44
-
45
- ### Features
46
-
47
- * Introduced support for [Sentry](https://sentry.io/welcome/) in the generated documentation.
48
-
49
- Umberto configuration can now specify the `sentry` key that allows loading the Sentry SDK on production hosts: https://ckeditor.com/docs and https://ckeditor5.github.io/docs/nightly.
50
-
51
- ### Other changes
52
-
53
- * Improve performance of `api-builder` and `validate-links` scripts.
54
- * Migrate from `cheerio` to `htmlparser2` and friends.
55
-
56
57
  ---
57
58
 
58
59
  To see all releases, visit the [release page](https://github.com/cksource/umberto/releases).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "9.2.0",
3
+ "version": "9.3.0",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -76,4 +76,4 @@
76
76
  "hexo": {
77
77
  "version": "8.1.1"
78
78
  }
79
- }
79
+ }
@@ -64,6 +64,7 @@ module.exports = class AbstractParser {
64
64
  case ReflectionKind.Class:
65
65
  case ReflectionKind.Interface:
66
66
  case ReflectionKind.TypeAlias:
67
+ case ReflectionKind.Enum:
67
68
  separator = '~';
68
69
  break;
69
70
 
@@ -148,6 +149,7 @@ module.exports = class AbstractParser {
148
149
  return 'constant';
149
150
 
150
151
  case ReflectionKind.TypeAlias:
152
+ case ReflectionKind.Enum:
151
153
  return 'typedef';
152
154
  }
153
155
  }
@@ -14,7 +14,7 @@ module.exports = class TypeParser extends AbstractParser {
14
14
  * @returns {Boolean}
15
15
  */
16
16
  canParse( item ) {
17
- return item.kind === ReflectionKind.TypeAlias;
17
+ return item.kind === ReflectionKind.TypeAlias || item.kind === ReflectionKind.Enum;
18
18
  }
19
19
 
20
20
  /**
@@ -26,6 +26,35 @@ module.exports = str => {
26
26
  longnames: [ str ]
27
27
  };
28
28
 
29
+ // `templateLiteral` - simplified version - matches `${ ... }` only.
30
+ if ( str.startsWith( '`${' ) && str.endsWith( '}`' ) ) {
31
+ result.prefix = str.slice( 0, 4 ); // Backtick, dollar sign, opening bracket, space.
32
+ result.suffix = str.slice( -3 ); // Space, closing bracket, backtick.
33
+
34
+ const inner = str.slice( 3, -2 ).trim();
35
+
36
+ // Allow lists (union) separated by '|' or ',' (consistent with '.<...>' parsing)
37
+ result.longnames = inner.split( /[|,]+/ ).map( l => l.trim() );
38
+
39
+ // Build separators array in the same style as for '.<...>'
40
+ result.separators = [];
41
+
42
+ const separatorsRegex = /[,|]/g;
43
+ let separatorsMatch = separatorsRegex.exec( inner );
44
+
45
+ while ( separatorsMatch !== null ) {
46
+ if ( separatorsMatch[ 0 ] === ',' ) {
47
+ result.separators.push( `${ separatorsMatch[ 0 ] } ` );
48
+ } else {
49
+ result.separators.push( ` ${ separatorsMatch[ 0 ] } ` );
50
+ }
51
+
52
+ separatorsMatch = separatorsRegex.exec( inner );
53
+ }
54
+
55
+ return result;
56
+ }
57
+
29
58
  if ( str.indexOf( '.<' ) !== -1 ) {
30
59
  const match = /^([\w]+\.<\(*)([^)>]+)([)>]+)$/.exec( str );
31
60
 
@@ -7,4 +7,4 @@ block prepend content
7
7
  //- Make sure to add the report issue widget at the end of the page.
8
8
  block append content
9
9
  if page.reportIssueWidget
10
- // TODO: Add report issue widget.
10
+ //- TODO: Add report issue widget.
@@ -7,4 +7,4 @@ block prepend content
7
7
  //- Make sure to add the report issue widget at the end of the page.
8
8
  block append content
9
9
  if page.reportIssueWidget
10
- // TODO: Add report issue widget.
10
+ //- TODO: Add report issue widget.
@@ -7,4 +7,4 @@ block prepend content
7
7
  //- Make sure to add the report issue widget at the end of the page.
8
8
  block append content
9
9
  if page.reportIssueWidget
10
- // TODO: Add report issue widget.
10
+ //- TODO: Add report issue widget.
@@ -7,4 +7,4 @@ block prepend content
7
7
  //- Make sure to add the report issue widget at the end of the page.
8
8
  block append content
9
9
  if page.reportIssueWidget
10
- // TODO: Add report issue widget.
10
+ //- TODO: Add report issue widget.
@@ -7,4 +7,4 @@ block prepend content
7
7
  //- Make sure to add the report issue widget at the end of the page.
8
8
  block append content
9
9
  if page.reportIssueWidget
10
- // TODO: Add report issue widget.
10
+ //- TODO: Add report issue widget.
@@ -9,20 +9,29 @@ block prepend content
9
9
  +apiHeader( { iconPath: 'assets/' + umbertoVersion + '/gloria/img/data.svg', kind: 'Typedef' } )
10
10
 
11
11
  block append content
12
- if data.types.length == 1 && data.types[ 0 ] == 'function'
13
- div.typedef-callback
14
- if isNonEmptyArray( data.params )
15
- h4.b-h4 Parameters
16
- +paramsMixin( data.params )
12
+ if Array.isArray( data.types )
13
+ //- Inline callback
14
+ if data.types.length == 1 && data.types[ 0 ] == 'function'
15
+ div.typedef-callback
16
+ if isNonEmptyArray( data.params )
17
+ h4.b-h4 Parameters
18
+ +paramsMixin( data.params )
17
19
 
18
- if isNonEmptyArray( data.returns )
19
- h4.b-h4 Returns
20
- dl
21
- each ret in data.returns
22
- +return( ret )
20
+ if isNonEmptyArray( data.returns )
21
+ h4.b-h4 Returns
22
+ dl
23
+ each ret in data.returns
24
+ +return( ret )
23
25
 
24
- if isNonEmptyArray( data.see )
25
- +related( data.see )
26
+ if isNonEmptyArray( data.see )
27
+ +related( data.see )
28
+ //- Union
29
+ else if data.types.length
30
+ div( class="main-description" )
31
+ h4.b-h4 Value
32
+ p
33
+ code
34
+ +type( data.types )
26
35
 
27
36
  if data.firedBy
28
37
  h2.b-h2 Fired by
@@ -34,4 +43,4 @@ block append content
34
43
  //- Make sure to add the report issue widget at the end of the page.
35
44
  block append content
36
45
  if page.reportIssueWidget
37
- // TODO: Add report issue widget.
46
+ //- TODO: Add report issue widget.