@progress/kendo-typescript-tasks 10.0.21-ng12.54 → 10.0.21-ng12.59
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/package.json +3 -3
- package/src/api/comment.js +3 -2
- package/src/api/generator.js +1 -1
- package/src/api/map-props.js +7 -5
- package/src/api/type-utils.js +6 -2
- package/src/api/utils.js +1 -4
- package/test/api.js +2 -2
- package/test/intersection.json +2 -2
- package/test/type-union.json +2 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@progress/kendo-typescript-tasks",
|
|
3
3
|
"description": "Kendo UI TypeScript package gulp tasks",
|
|
4
4
|
"main": "gulp-tasks.js",
|
|
5
|
-
"version": "10.0.21-ng12.
|
|
5
|
+
"version": "10.0.21-ng12.59+6ecedfd",
|
|
6
6
|
"author": "Telerik",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"typescript": "^4.3.4"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@progress/kendo-common-tasks": "7.9.5-ng12.
|
|
21
|
+
"@progress/kendo-common-tasks": "7.9.5-ng12.59+6ecedfd",
|
|
22
22
|
"@typescript-eslint/eslint-plugin": "4.28.2",
|
|
23
23
|
"@typescript-eslint/parser": "4.28.2",
|
|
24
24
|
"core-js": "^3.18.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6ecedfddda739a6ff44b87570e892da1a5ef56b6"
|
|
52
52
|
}
|
package/src/api/comment.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const template = require('./template-utils.js');
|
|
4
4
|
const slug = require('./slug.js');
|
|
5
5
|
const warn = require('./warn.js');
|
|
6
|
-
const utils = require('./utils.js');
|
|
7
6
|
|
|
8
7
|
const commentTemplate = template.compileFrom('comment-tags.hbs');
|
|
9
8
|
|
|
@@ -28,7 +27,9 @@ const commentTags = (comment, member) =>
|
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
const formatComment = (member, parentName, memberKind) => {
|
|
31
|
-
const
|
|
30
|
+
const signatures = member.type?.declaration?.signatures;
|
|
31
|
+
const comment = member.comment || signatures && signatures[0]?.comment;
|
|
32
|
+
|
|
32
33
|
if (!comment) {
|
|
33
34
|
warn(member, parentName, memberKind);
|
|
34
35
|
|
package/src/api/generator.js
CHANGED
|
@@ -155,7 +155,7 @@ const extractMembers = (packageName, modules, config) => {
|
|
|
155
155
|
id: child.id,
|
|
156
156
|
module: moduleRoot(module.name, rootModules),
|
|
157
157
|
name: child.name,
|
|
158
|
-
comment:
|
|
158
|
+
comment: child.comment,
|
|
159
159
|
children: child.children,
|
|
160
160
|
decorators: child.decorators,
|
|
161
161
|
type: child.type,
|
package/src/api/map-props.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const getComment = require('./comment');
|
|
4
4
|
const types = require('./type-utils');
|
|
5
5
|
const isConstructor = require('./is-constructor');
|
|
6
6
|
const isEvent = require('./is-event');
|
|
@@ -21,6 +21,7 @@ const isProp = (prop) => isPublic(prop) && !isConstructor(prop) && !isMethod(pro
|
|
|
21
21
|
const mapProps = (children, parentName) =>
|
|
22
22
|
children.filter(isProp).map(prop => {
|
|
23
23
|
let type;
|
|
24
|
+
let comment = getComment(prop, parentName);
|
|
24
25
|
if (prop.type) {
|
|
25
26
|
type = types.typeString(prop);
|
|
26
27
|
} else if (prop.kindString === 'Accessor') {
|
|
@@ -28,12 +29,13 @@ const mapProps = (children, parentName) =>
|
|
|
28
29
|
const setter = prop.setSignature;
|
|
29
30
|
|
|
30
31
|
// Fingers crossed
|
|
31
|
-
type = types.typeString(
|
|
32
|
-
accessor(
|
|
33
|
-
accessor(
|
|
32
|
+
type = types.typeString(setter ?
|
|
33
|
+
accessor(setter).parameters[0] :
|
|
34
|
+
accessor(getter)
|
|
34
35
|
);
|
|
35
36
|
} else if (prop.kindString === 'Method') {
|
|
36
37
|
type = types.callType(prop.signatures[0]);
|
|
38
|
+
comment = getComment(prop.signatures[0], parentName);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
let name = prop.name;
|
|
@@ -53,7 +55,7 @@ const mapProps = (children, parentName) =>
|
|
|
53
55
|
name: name,
|
|
54
56
|
type: type,
|
|
55
57
|
defaultValue: defaultValue(prop),
|
|
56
|
-
comment: comment
|
|
58
|
+
comment: comment
|
|
57
59
|
};
|
|
58
60
|
});
|
|
59
61
|
|
package/src/api/type-utils.js
CHANGED
|
@@ -92,6 +92,10 @@ const INTERSECTION = ' [intersected](https://www.typescriptlang.org/docs/handboo
|
|
|
92
92
|
const singleTypeString = (type) => {
|
|
93
93
|
let suffix = '';
|
|
94
94
|
|
|
95
|
+
if (type.type === 'literal') {
|
|
96
|
+
return type.value;
|
|
97
|
+
}
|
|
98
|
+
|
|
95
99
|
if (type.type === 'intersection') {
|
|
96
100
|
return unionTypes({ type }).join(INTERSECTION);
|
|
97
101
|
}
|
|
@@ -135,8 +139,8 @@ const typeString = (prop) => {
|
|
|
135
139
|
return unionTypes(prop).join(' | ');
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
if (type.type === '
|
|
139
|
-
return `
|
|
142
|
+
if (type.type === 'literal') {
|
|
143
|
+
return `"${type.value}"`;
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
return singleTypeString(prop.type);
|
package/src/api/utils.js
CHANGED
|
@@ -27,8 +27,6 @@ const warn = (type, text) => {
|
|
|
27
27
|
console.warn(msg);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const extractComment = (member) => member.comment || member.type?.declaration?.signatures[0].comment;
|
|
31
|
-
|
|
32
30
|
module.exports = {
|
|
33
31
|
groupBy: groupBy,
|
|
34
32
|
flatten: flatten,
|
|
@@ -37,7 +35,6 @@ module.exports = {
|
|
|
37
35
|
warnings: () => WARNINGS,
|
|
38
36
|
not: not,
|
|
39
37
|
ignore: ignore,
|
|
40
|
-
hasProp: hasProp
|
|
41
|
-
extractComment: extractComment
|
|
38
|
+
hasProp: hasProp
|
|
42
39
|
};
|
|
43
40
|
|
package/test/api.js
CHANGED
|
@@ -162,13 +162,13 @@ describe('API generation', () => {
|
|
|
162
162
|
it('formats anonymous interfaces', () => {
|
|
163
163
|
const unionData = require('./type-union.json');
|
|
164
164
|
const page = unionPage(unionData);
|
|
165
|
-
expect(page).toContain(
|
|
165
|
+
expect(page).toContain('{ allowUnsort?: boolean; mode?: "single" | "multiple"; }');
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
it('formats intersection interfaces', () => {
|
|
169
169
|
const intersectionData = require('./intersection.json');
|
|
170
170
|
const page = unionPage(intersectionData);
|
|
171
|
-
expect(page).toContain(
|
|
171
|
+
expect(page).toContain('ColumnSortSettings [intersected](https://www.typescriptlang.org/docs/handbook/advanced-types.html#intersection-types) with { mode?: "single" | "multiple"; }');
|
|
172
172
|
});
|
|
173
173
|
});
|
|
174
174
|
|
package/test/intersection.json
CHANGED