devextreme-internal-tools 7.7.0 → 7.8.2
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/Readme.md +429 -429
- package/bin/DevExtreme.Declarations.Discoverer.dll +0 -0
- package/bin/DevExtreme.Declarations.Discoverer.exe +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator.dll +0 -0
- package/bin/DevExtreme.Declarations.IntegrityValidator.exe +0 -0
- package/bin/DevExtreme.Declarations.dll +0 -0
- package/bin/DevExtreme.Descriptions.Injector.dll +0 -0
- package/bin/DevExtreme.Descriptions.Injector.exe +0 -0
- package/bin/DevExtreme.Infrastructure.dll +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator.dll +0 -0
- package/bin/DevExtreme.IntegrationDataGenerator.exe +0 -0
- package/bin/DevExtreme.NgSmdGenerator.dll +0 -0
- package/bin/DevExtreme.NgSmdGenerator.exe +0 -0
- package/bin/DevExtreme.SmdCommon.dll +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator.dll +0 -0
- package/bin/DevExtreme.StrongMetaDataGenerator.exe +0 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator.dll +0 -0
- package/bin/DevExtreme.Topics.ExtraFilesGenerator.exe +0 -0
- package/bin/DevExtreme.Topics.Generator.dll +0 -0
- package/bin/DevExtreme.Topics.Generator.exe +0 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator.dll +0 -0
- package/bin/DevExtreme.Topics.ModulesGuideValidator.exe +0 -0
- package/bin/DevExtreme.Topics.Validation.dll +0 -0
- package/bin/DevExtreme.Topics.Validation.exe +0 -0
- package/bin/DevExtreme.Topics.dll +0 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator.dll +0 -0
- package/bin/DevExtreme.WebSite.ContentMapCreator.exe +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter.dll +0 -0
- package/bin/DevExtreme.WebSite.LinksConverter.exe +0 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator.dll +0 -0
- package/bin/DevExtreme.WebSite.SyntaxDataGenerator.exe +0 -0
- package/bin/Enums_19_2.json +188 -188
- package/bin/Enums_20_1.json +188 -188
- package/bin/Enums_20_2.json +188 -188
- package/bin/Enums_21_1.json +188 -188
- package/bin/Enums_21_2.json +227 -227
- package/bin/Enums_22_1.json +227 -227
- package/bin/internal-tools-log.txt +19 -0
- package/index.js +1 -3
- package/index.js.map +1 -1
- package/package.json +55 -55
- package/ts/bundler/bundler.js +2 -2
- package/ts/bundler/bundler.js.map +1 -1
- package/ts/collapser/collapser.js +17 -14
- package/ts/collapser/collapser.js.map +1 -1
- package/ts/common/common-resolving.js +3 -1
- package/ts/common/common-resolving.js.map +1 -1
- package/ts/common/tags.js +19 -23
- package/ts/common/tags.js.map +1 -1
- package/ts/common/ts-type-resolving.js +13 -6
- package/ts/common/ts-type-resolving.js.map +1 -1
- package/ts/common/ts-utils.js +13 -10
- package/ts/common/ts-utils.js.map +1 -1
- package/ts/common/type-resolving.js +2 -2
- package/ts/common/type-resolving.js.map +1 -1
- package/ts/common/utils.js +2 -5
- package/ts/common/utils.js.map +1 -1
- package/ts/discoverer/discovering.js +42 -115
- package/ts/discoverer/discovering.js.map +1 -1
- package/ts/discoverer/parsing/enum-collecting.js +94 -0
- package/ts/discoverer/parsing/enum-collecting.js.map +1 -0
- package/ts/logging.js +38 -16
- package/ts/logging.js.map +1 -1
- package/ts/modules-meta-generator/modules-meta-generator.js +2 -2
- package/ts/modules-meta-generator/modules-meta-generator.js.map +1 -1
- package/ts/scripts/args.js +3 -4
- package/ts/scripts/args.js.map +1 -1
- package/ts/scripts/helpers.js +0 -1
- package/ts/scripts/helpers.js.map +1 -1
- package/ts/scripts/tools.js +21 -12
- package/ts/scripts/tools.js.map +1 -1
- package/bin/log-IntegrationDataModel-Generation.txt +0 -18
package/Readme.md
CHANGED
|
@@ -1,429 +1,429 @@
|
|
|
1
|
-
# DevExtreme Internal Tools #
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
This package contains tools used by the DevExtreme team for development.
|
|
6
|
-
|
|
7
|
-
# Commands
|
|
8
|
-
|
|
9
|
-
| Command | Description |
|
|
10
|
-
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
11
|
-
| [discover-declarations](#discover-declarations) | Runs discovering |
|
|
12
|
-
| [discover-ts-declarations](#discover-ts-declarations) | Runs discovering for TS files only |
|
|
13
|
-
| [generate-smd](#generate-smd) | Generates the `StrongMetaData.json` file |
|
|
14
|
-
| [generate-ng-smd](#generate-ng-smd) | Generates the `NGDataMeta.json` file |
|
|
15
|
-
| [update-meta](#update-meta) | Updates the `NGDataMeta.json` file |
|
|
16
|
-
| [generate-ts-bundle](#generate-ts-bundle) | Bundles all `*.d.ts` files to a single file (e.g. `dx.all.d.ts`) |
|
|
17
|
-
| [update-ts-bundle](#update-ts-bundle) | Bundles all `*.d.ts` files to a single file (e.g. `dx.all.d.ts`) |
|
|
18
|
-
| [integration-data-generator](#integration-data-generator) | Generates `integration-data.json` and `integration-data-model.json` |
|
|
19
|
-
| [update-integration-meta](#update-integration-meta) | Updates `integration-data.json` and `integration-data-model.json` |
|
|
20
|
-
| [inject-descriptions](#inject-descriptions) | Runs the injector for all `*.d.ts` files that equal the search pattern. |
|
|
21
|
-
| [inject-descriptions-to-bundle](#inject-descriptions-to-bundle) | Runs the injector for the `dx.all.d.ts` file only |
|
|
22
|
-
| [update-topics](#update-topics) | Updates the documentation |
|
|
23
|
-
| [generate-content-map](#generate-content-map) | Generates content maps necessary to run `WebSite.JS`. The actual content is not included. |
|
|
24
|
-
| [update-links](#update-links) | Updates links for the site. Logs are saved in the root directory. |
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## discover-declarations
|
|
30
|
-
```
|
|
31
|
-
dx-tools discover-declarations
|
|
32
|
-
```
|
|
33
|
-
| Arg | Default | Description |
|
|
34
|
-
| ------------ | ---------------------------------- | ----------------------------------------- |
|
|
35
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
36
|
-
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
37
|
-
| `docs-root` | Optional parameter | See [common arguments](#common-arguments) |
|
|
38
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
39
|
-
|
|
40
|
-
## discover-ts-declarations
|
|
41
|
-
```
|
|
42
|
-
dx-tools discover-ts-declarations
|
|
43
|
-
```
|
|
44
|
-
| Arg | Default | Description |
|
|
45
|
-
| ------------ | ------------ | ----------------------------------------- |
|
|
46
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
47
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
48
|
-
|
|
49
|
-
## generate-smd
|
|
50
|
-
```
|
|
51
|
-
dx-tools generate-smd --version xx_x
|
|
52
|
-
```
|
|
53
|
-
| Arg | Default | Description |
|
|
54
|
-
| ------------------- | ------------------------------------------------------ | ----------------------------------------- |
|
|
55
|
-
| `version` | xx_x | See [common arguments](#common-arguments) |
|
|
56
|
-
| `output-path` | *rootDir*\artifacts\internal-tools\StrongMetaData.json | See [common arguments](#common-arguments) |
|
|
57
|
-
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
58
|
-
|
|
59
|
-
## generate-ng-smd
|
|
60
|
-
```
|
|
61
|
-
dx-tools generate-ng-smd --version xx_x
|
|
62
|
-
```
|
|
63
|
-
| Arg | Default | Description |
|
|
64
|
-
| ------------------- | ---------------------------------------------------- | ----------------------------------------- |
|
|
65
|
-
| `version` | xx_x | See [common arguments](#common-arguments) |
|
|
66
|
-
| `output-path` | *rootDir*\artifacts\internal-tools\NGMetaData.json | See [common arguments](#common-arguments) |
|
|
67
|
-
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
68
|
-
|
|
69
|
-
## update-meta
|
|
70
|
-
```
|
|
71
|
-
dx-tools update-meta --version xx_x --js-scripts D:\DevExtreme\js --docs-root D:\devextreme-docs
|
|
72
|
-
```
|
|
73
|
-
| Arg | Default | Descriptions |
|
|
74
|
-
| ------------------- | ---------------------------------------------------- | ----------------------------------------- |
|
|
75
|
-
| `version` | xx_x | See [common arguments](#common-arguments) |
|
|
76
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
77
|
-
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
78
|
-
| `output-path` | *rootDir*\artifacts\internal-tools\NGMetaData.json | See [common arguments](#common-arguments) |
|
|
79
|
-
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
80
|
-
| `docs-root` | Optional parameter | See [common arguments](#common-arguments) |
|
|
81
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
82
|
-
|
|
83
|
-
## generate-ts-bundle
|
|
84
|
-
```
|
|
85
|
-
dx-tools generate-ts-bundle --js-scripts D:\DevExtreme\js --output-path D:\DevExtreme\ts\dx.all.d.ts
|
|
86
|
-
```
|
|
87
|
-
| Arg | Default | Description |
|
|
88
|
-
| ------------- | ------------------------ | ----------------------------------------- |
|
|
89
|
-
| `js-scripts` | undefined | See [common arguments](#common-arguments) |
|
|
90
|
-
| `output-path` | undefined | See [common arguments](#common-arguments) |
|
|
91
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
92
|
-
|
|
93
|
-
For more information, see [Bundler specs](#bundler-specs)
|
|
94
|
-
|
|
95
|
-
## update-ts-bundle
|
|
96
|
-
```
|
|
97
|
-
dx-tools update-ts-bundle --js-scripts D:\DevExtreme\js --output-path D:\DevExtreme\ts\dx.all.d.ts
|
|
98
|
-
```
|
|
99
|
-
| Arg | Default | Description |
|
|
100
|
-
| ------------- | ------------------------ | ----------------------------------------- |
|
|
101
|
-
| `js-scripts` | undefined | See [common arguments](#common-arguments) |
|
|
102
|
-
| `output-path` | undefined | See [common arguments](#common-arguments) |
|
|
103
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
104
|
-
|
|
105
|
-
For more information, see [Bundler specs](#bundler-specs)
|
|
106
|
-
|
|
107
|
-
## integration-data-generator
|
|
108
|
-
```
|
|
109
|
-
dx-tools integration-data-generator
|
|
110
|
-
```
|
|
111
|
-
| Arg | Default | Description |
|
|
112
|
-
| ------------------- | -------------------------------------------------------- | ----------------------------------------- |
|
|
113
|
-
| `output-path` | *rootDir*\artifacts\internal-tools\integration-data.json | See [common arguments](#common-arguments) |
|
|
114
|
-
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
115
|
-
|
|
116
|
-
## update-integration-meta
|
|
117
|
-
```
|
|
118
|
-
dx-tools update-integration-meta --js-scripts D:\DevExtreme\js --docs-root D:\devextreme-docs
|
|
119
|
-
```
|
|
120
|
-
| Arg | Default | Description |
|
|
121
|
-
| ------------------- | -------------------------------------------------------- | ----------------------------------------- |
|
|
122
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
123
|
-
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
124
|
-
| `output-path` | *rootDir*\artifacts\internal-tools\integration-data.json | See [common arguments](#common-arguments) |
|
|
125
|
-
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
126
|
-
| `docs-root` | Optional parameter | See [common arguments](#common-arguments) |
|
|
127
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
128
|
-
|
|
129
|
-
## inject-descriptions
|
|
130
|
-
```
|
|
131
|
-
dx-tools inject-descriptions
|
|
132
|
-
```
|
|
133
|
-
| Arg | Default | Description |
|
|
134
|
-
| ------------------- | ---------------------------------------------------- | ----------------------------------------- |
|
|
135
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
136
|
-
| `descriptions-path` | *rootDir*\artifacts\internal-tools\Descriptions.json | Sets path to the Descriptions.json file |
|
|
137
|
-
| `search-pattern` | * | Sets a pattern to find the files |
|
|
138
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
139
|
-
|
|
140
|
-
## inject-descriptions-to-bundle
|
|
141
|
-
```
|
|
142
|
-
dx-tools inject-descriptions-to-bundle
|
|
143
|
-
```
|
|
144
|
-
| Arg | Default | Description |
|
|
145
|
-
| ------------------- | ---------------------------------------------------------------- | ----------------------------------------- |
|
|
146
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
147
|
-
| `descriptions-path` | *rootDir*\artifacts\internal-tools\Descriptions.json | Sets path to the Descriptions.json file |
|
|
148
|
-
| `target-path` | *rootDir*\node_modules\devextreme-internal-tools\bin\dx.all.d.ts | Sets the path to the `dx.all.d.ts` file |
|
|
149
|
-
| `output-path` | `target-path | See [common arguments](#common-arguments) |
|
|
150
|
-
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
151
|
-
|
|
152
|
-
## update-topics
|
|
153
|
-
```
|
|
154
|
-
dx-tools update-topics
|
|
155
|
-
```
|
|
156
|
-
| Arg | Default | Description |
|
|
157
|
-
| ------------ | ---------------------------------- | ----------------------------------------- |
|
|
158
|
-
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
159
|
-
| `docs-root` | *rootDir* | See [common arguments](#common-arguments) |
|
|
160
|
-
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
161
|
-
|
|
162
|
-
## generate-content-map
|
|
163
|
-
```
|
|
164
|
-
dx-tools generate-content-map
|
|
165
|
-
```
|
|
166
|
-
| Arg | Default | Description |
|
|
167
|
-
| ----------- | ------------------------- | ----------------------------------------- |
|
|
168
|
-
| `docs-root` | *rootDir* | See [common arguments](#common-arguments) |
|
|
169
|
-
| `version` | Version in `package.json` | See [common arguments](#common-arguments) |
|
|
170
|
-
|
|
171
|
-
## update-links
|
|
172
|
-
```
|
|
173
|
-
dx-tools update-links --check-all --validation
|
|
174
|
-
```
|
|
175
|
-
| Flag | Description |
|
|
176
|
-
| ------------------ | -------------------------------------------- |
|
|
177
|
-
| `--fail-on-change` | Check and update links in changed files only |
|
|
178
|
-
| `--check-all` | Check and update links in all files |
|
|
179
|
-
| `--validation` | Check links without updating them |
|
|
180
|
-
|
|
181
|
-
# Common Arguments
|
|
182
|
-
|
|
183
|
-
| Arg | Description |
|
|
184
|
-
| ------------------- | --------------------------------------------------------------------------------------------------- |
|
|
185
|
-
| `js-scripts` | Path to the `js` folder in the [DevExtreme repo](https://github.com/DevExpress/DevExtreme) |
|
|
186
|
-
| `docs-root` | Path to the [devextreme-documentation repo](https://github.com/DevExpress/devextreme-documentation) |
|
|
187
|
-
| `version` | Major version (for example, `20_1`) |
|
|
188
|
-
| `artifacts` | Path to the `artifacts` folder |
|
|
189
|
-
| `declarations-path` | Path to the `Declarations.json` file |
|
|
190
|
-
| `output-path` | Path to the output file |
|
|
191
|
-
| `ignore-pattern` | Pattern for ignoring files |
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
# Development
|
|
195
|
-
|
|
196
|
-
We assume that [DevExtreme repo](https://github.com/DevExpress/DevExtreme) is located in the same parent directory:
|
|
197
|
-
```
|
|
198
|
-
···
|
|
199
|
-
├── devextreme/
|
|
200
|
-
│ ├── js/
|
|
201
|
-
│ └── ···
|
|
202
|
-
├── devextreme-internal-tools/
|
|
203
|
-
│ └── ···
|
|
204
|
-
···
|
|
205
|
-
```
|
|
206
|
-
If you need to target another directory, go to `./package.json` and change `--js-scripts` argument value.
|
|
207
|
-
|
|
208
|
-
## Discover TypeScript Declarations
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
npm run build-ts
|
|
212
|
-
npm run discover
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
The commands above run the TypeScript Discoverer only. The .NET Discoverer should be run separately.
|
|
216
|
-
|
|
217
|
-
## Discover TypeScript Declarations in Watch Mode
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
npm run build-ts-watch
|
|
221
|
-
npm run discover-watch
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
`build-ts-watch` recompiles the TypeScript Discoverer when its sources change.
|
|
225
|
-
|
|
226
|
-
`discover-watch` reruns the TypeScript Discoverer when Declarations change.
|
|
227
|
-
|
|
228
|
-
# Additional Information
|
|
229
|
-
|
|
230
|
-
## Bundler specs
|
|
231
|
-
|
|
232
|
-
`Bundler` is a tool that bundles all `*.d.ts` files into a single `bundle` file. A `bundle` is a file with a set of module declarations (namespaces).
|
|
233
|
-
|
|
234
|
-
```typescript
|
|
235
|
-
declare global {}
|
|
236
|
-
|
|
237
|
-
declare module DevExpress {}
|
|
238
|
-
|
|
239
|
-
declare module DevExpress.module1 {}
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
The bundling process starts with collecting all `public` types (types, interfaces, classes, etc.). A type is considered `public` if it is:
|
|
243
|
-
|
|
244
|
-
- exported and has the `@docid`, `@public`, or `@const` jsDoc tag.
|
|
245
|
-
- referenced by another `public` type.
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
|
|
249
|
-
export interface NonPublicType { }
|
|
250
|
-
|
|
251
|
-
/** @docid */
|
|
252
|
-
export interface PublicType {
|
|
253
|
-
field: AnotherPublicType;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export interface AnotherPublicType {}
|
|
257
|
-
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
The next step is to decide what namespace the `public` type belongs to.
|
|
261
|
-
|
|
262
|
-
There are two options:
|
|
263
|
-
|
|
264
|
-
- the namespace is set explicitly with the help of the `@namespace` jsDoc tag.
|
|
265
|
-
- the namespace is calculated based on the type file location and structure.
|
|
266
|
-
|
|
267
|
-
In the latter case, there are 3 options:
|
|
268
|
-
|
|
269
|
-
- if the type is declared in the `global` namespace, it is preserved in this namespace.
|
|
270
|
-
- the calculated namespace is a `DevExpress` string followed by the first folder name in `cwd`. E.g., for types in the `{cwd}/core/utils/math/calculation.utils.d.ts` file, the namespace is `DevExpress.core`.
|
|
271
|
-
- if there is the default export of some class in the file, this class is considered a widget class, and then the `public` type is placed in the nested module with the name of the exported widget class. E.g., for types in the `{cwd}/ui/data_grid.d.ts` file with the `dxDataGrid` class as the default export, the module is `dxDataGrid` inside the `DevExpress.ui` namespace.
|
|
272
|
-
|
|
273
|
-
In the last step, all jsDoc comments are transformed by the [Collapser](#collapser-specs).
|
|
274
|
-
|
|
275
|
-
For example, consider the following files:
|
|
276
|
-
|
|
277
|
-
```typescript
|
|
278
|
-
// {cwd}/ui/some_widget.d.ts
|
|
279
|
-
|
|
280
|
-
import { MyType } from '../core/utils';
|
|
281
|
-
|
|
282
|
-
export type SimplePropType = number;
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* @public
|
|
286
|
-
* @namespace DevExpress.ui.options
|
|
287
|
-
*/
|
|
288
|
-
export interface WidgetOptions {
|
|
289
|
-
myProp?: MyType;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/** @public */
|
|
293
|
-
export default class Widget {
|
|
294
|
-
getOptions(): WidgetOptions;
|
|
295
|
-
getSingleProp(): SimplePropType;
|
|
296
|
-
}
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
```typescript
|
|
300
|
-
// {cwd}/core/utils.d.ts
|
|
301
|
-
|
|
302
|
-
export type MyType = string;
|
|
303
|
-
|
|
304
|
-
export type MyType = string;
|
|
305
|
-
|
|
306
|
-
export type MySuperType = any;
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
The result of bundling these files:
|
|
310
|
-
|
|
311
|
-
```typescript
|
|
312
|
-
declare module DevExpress.core {
|
|
313
|
-
/**
|
|
314
|
-
* @deprecated Attention! This type is for internal purposes only...
|
|
315
|
-
*/
|
|
316
|
-
export type MyType = string;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
declare module DevExpress.ui {
|
|
320
|
-
module Widget {
|
|
321
|
-
/**
|
|
322
|
-
* @deprecated Attention! This type is for internal purposes only...
|
|
323
|
-
*/
|
|
324
|
-
export type SimplePropType = number;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* [descr:Widget]
|
|
329
|
-
*/
|
|
330
|
-
export class Widget {
|
|
331
|
-
getOptions(): DevExpress.ui.options.WidgetOptions;
|
|
332
|
-
|
|
333
|
-
getSingleProp(): DevExpress.ui.Widget.SimplePropType;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
declare module DevExpress.ui.options {
|
|
338
|
-
/**
|
|
339
|
-
* [descr:WidgetOptions]
|
|
340
|
-
*/
|
|
341
|
-
export interface WidgetOptions {
|
|
342
|
-
myProp?: DevExpress.core.MyType;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
To replace placeholders with actual descriptions or deprecation messages, use the [inject-descriptions-to-bundle](#inject-descriptions-to-bundle) command.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
## Collapser specs
|
|
351
|
-
|
|
352
|
-
The collapser is an internal process that runs against `*.d.ts` files and simplifies jsDoc comments to prepare them for further usage. It is used by the [inject-descriptions](#inject-descriptions) command as a first step and by [update-ts-bundle](#update-ts-bundle) as a last step.
|
|
353
|
-
|
|
354
|
-
The collapser changes jsDoc comments following the rules below:
|
|
355
|
-
|
|
356
|
-
- the `@docid` or `@const` jsDoc tag is replaced with a placeholder for description.
|
|
357
|
-
- the `@deprecated` tag with a custom (or empty) message is preserved.
|
|
358
|
-
- the `@deprecated` tag with a reference to other types either by `docid` or `{file/path.typeName}` is preserved, but the reference is replaced with a placeholder for a correct deprecation message.
|
|
359
|
-
- all other tags or content of a jsDoc comment will be removed.
|
|
360
|
-
- if the original type has no `@public` tag or jsDoc comments, an additional `@deprecated` tag is added with a standard warning message stating that this type is for internal use.
|
|
361
|
-
|
|
362
|
-
Once the collapser process is completed, all jsDoc comments will contain only placeholders and meaningful deprecation messages.
|
|
363
|
-
|
|
364
|
-
Let's look at an example. Below is the initial file.
|
|
365
|
-
|
|
366
|
-
```typescript
|
|
367
|
-
/**
|
|
368
|
-
* @docid
|
|
369
|
-
* @public
|
|
370
|
-
*/
|
|
371
|
-
export interface WidgetProps {}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @docid
|
|
375
|
-
* @public
|
|
376
|
-
* @deprecated WidgetProps
|
|
377
|
-
*/
|
|
378
|
-
export interface WidgetOptions {}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* @deprecated This is custom message
|
|
382
|
-
* @public
|
|
383
|
-
*/
|
|
384
|
-
export type DeprecatedType = {};
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* @docid
|
|
388
|
-
* @public
|
|
389
|
-
* @deprecated {file_path/file_name.TypeName}
|
|
390
|
-
*/
|
|
391
|
-
export type OldType = {};
|
|
392
|
-
|
|
393
|
-
export type InternalType = {};
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
And this is the result of the applied collapser:
|
|
397
|
-
|
|
398
|
-
```typescript
|
|
399
|
-
/**
|
|
400
|
-
* [descr:WidgetProps]
|
|
401
|
-
*/
|
|
402
|
-
export interface WidgetProps {}
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* [descr:WidgetOptions]
|
|
406
|
-
* @deprecated [depNote:WidgetProps]
|
|
407
|
-
*/
|
|
408
|
-
export interface WidgetOptions {}
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* @deprecated This is custom message
|
|
412
|
-
*/
|
|
413
|
-
export type DeprecatedType = {};
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* [descr:OldType]
|
|
417
|
-
* @deprecated [depNote.OldType]
|
|
418
|
-
*/
|
|
419
|
-
export type OldType = {};
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* @deprecated Attention! This type is for internal purposes only...
|
|
423
|
-
*/
|
|
424
|
-
export type InternalType = {};
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
# License
|
|
428
|
-
|
|
429
|
-
**DevExtreme Internal Tools are released as MIT-licensed.**
|
|
1
|
+
# DevExtreme Internal Tools #
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
This package contains tools used by the DevExtreme team for development.
|
|
6
|
+
|
|
7
|
+
# Commands
|
|
8
|
+
|
|
9
|
+
| Command | Description |
|
|
10
|
+
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
11
|
+
| [discover-declarations](#discover-declarations) | Runs discovering |
|
|
12
|
+
| [discover-ts-declarations](#discover-ts-declarations) | Runs discovering for TS files only |
|
|
13
|
+
| [generate-smd](#generate-smd) | Generates the `StrongMetaData.json` file |
|
|
14
|
+
| [generate-ng-smd](#generate-ng-smd) | Generates the `NGDataMeta.json` file |
|
|
15
|
+
| [update-meta](#update-meta) | Updates the `NGDataMeta.json` file |
|
|
16
|
+
| [generate-ts-bundle](#generate-ts-bundle) | Bundles all `*.d.ts` files to a single file (e.g. `dx.all.d.ts`) |
|
|
17
|
+
| [update-ts-bundle](#update-ts-bundle) | Bundles all `*.d.ts` files to a single file (e.g. `dx.all.d.ts`) |
|
|
18
|
+
| [integration-data-generator](#integration-data-generator) | Generates `integration-data.json` and `integration-data-model.json` |
|
|
19
|
+
| [update-integration-meta](#update-integration-meta) | Updates `integration-data.json` and `integration-data-model.json` |
|
|
20
|
+
| [inject-descriptions](#inject-descriptions) | Runs the injector for all `*.d.ts` files that equal the search pattern. |
|
|
21
|
+
| [inject-descriptions-to-bundle](#inject-descriptions-to-bundle) | Runs the injector for the `dx.all.d.ts` file only |
|
|
22
|
+
| [update-topics](#update-topics) | Updates the documentation |
|
|
23
|
+
| [generate-content-map](#generate-content-map) | Generates content maps necessary to run `WebSite.JS`. The actual content is not included. |
|
|
24
|
+
| [update-links](#update-links) | Updates links for the site. Logs are saved in the root directory. |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## discover-declarations
|
|
30
|
+
```
|
|
31
|
+
dx-tools discover-declarations
|
|
32
|
+
```
|
|
33
|
+
| Arg | Default | Description |
|
|
34
|
+
| ------------ | ---------------------------------- | ----------------------------------------- |
|
|
35
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
36
|
+
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
37
|
+
| `docs-root` | Optional parameter | See [common arguments](#common-arguments) |
|
|
38
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
39
|
+
|
|
40
|
+
## discover-ts-declarations
|
|
41
|
+
```
|
|
42
|
+
dx-tools discover-ts-declarations
|
|
43
|
+
```
|
|
44
|
+
| Arg | Default | Description |
|
|
45
|
+
| ------------ | ------------ | ----------------------------------------- |
|
|
46
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
47
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
48
|
+
|
|
49
|
+
## generate-smd
|
|
50
|
+
```
|
|
51
|
+
dx-tools generate-smd --version xx_x
|
|
52
|
+
```
|
|
53
|
+
| Arg | Default | Description |
|
|
54
|
+
| ------------------- | ------------------------------------------------------ | ----------------------------------------- |
|
|
55
|
+
| `version` | xx_x | See [common arguments](#common-arguments) |
|
|
56
|
+
| `output-path` | *rootDir*\artifacts\internal-tools\StrongMetaData.json | See [common arguments](#common-arguments) |
|
|
57
|
+
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
58
|
+
|
|
59
|
+
## generate-ng-smd
|
|
60
|
+
```
|
|
61
|
+
dx-tools generate-ng-smd --version xx_x
|
|
62
|
+
```
|
|
63
|
+
| Arg | Default | Description |
|
|
64
|
+
| ------------------- | ---------------------------------------------------- | ----------------------------------------- |
|
|
65
|
+
| `version` | xx_x | See [common arguments](#common-arguments) |
|
|
66
|
+
| `output-path` | *rootDir*\artifacts\internal-tools\NGMetaData.json | See [common arguments](#common-arguments) |
|
|
67
|
+
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
68
|
+
|
|
69
|
+
## update-meta
|
|
70
|
+
```
|
|
71
|
+
dx-tools update-meta --version xx_x --js-scripts D:\DevExtreme\js --docs-root D:\devextreme-docs
|
|
72
|
+
```
|
|
73
|
+
| Arg | Default | Descriptions |
|
|
74
|
+
| ------------------- | ---------------------------------------------------- | ----------------------------------------- |
|
|
75
|
+
| `version` | xx_x | See [common arguments](#common-arguments) |
|
|
76
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
77
|
+
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
78
|
+
| `output-path` | *rootDir*\artifacts\internal-tools\NGMetaData.json | See [common arguments](#common-arguments) |
|
|
79
|
+
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
80
|
+
| `docs-root` | Optional parameter | See [common arguments](#common-arguments) |
|
|
81
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
82
|
+
|
|
83
|
+
## generate-ts-bundle
|
|
84
|
+
```
|
|
85
|
+
dx-tools generate-ts-bundle --js-scripts D:\DevExtreme\js --output-path D:\DevExtreme\ts\dx.all.d.ts
|
|
86
|
+
```
|
|
87
|
+
| Arg | Default | Description |
|
|
88
|
+
| ------------- | ------------------------ | ----------------------------------------- |
|
|
89
|
+
| `js-scripts` | undefined | See [common arguments](#common-arguments) |
|
|
90
|
+
| `output-path` | undefined | See [common arguments](#common-arguments) |
|
|
91
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
92
|
+
|
|
93
|
+
For more information, see [Bundler specs](#bundler-specs)
|
|
94
|
+
|
|
95
|
+
## update-ts-bundle
|
|
96
|
+
```
|
|
97
|
+
dx-tools update-ts-bundle --js-scripts D:\DevExtreme\js --output-path D:\DevExtreme\ts\dx.all.d.ts
|
|
98
|
+
```
|
|
99
|
+
| Arg | Default | Description |
|
|
100
|
+
| ------------- | ------------------------ | ----------------------------------------- |
|
|
101
|
+
| `js-scripts` | undefined | See [common arguments](#common-arguments) |
|
|
102
|
+
| `output-path` | undefined | See [common arguments](#common-arguments) |
|
|
103
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
104
|
+
|
|
105
|
+
For more information, see [Bundler specs](#bundler-specs)
|
|
106
|
+
|
|
107
|
+
## integration-data-generator
|
|
108
|
+
```
|
|
109
|
+
dx-tools integration-data-generator
|
|
110
|
+
```
|
|
111
|
+
| Arg | Default | Description |
|
|
112
|
+
| ------------------- | -------------------------------------------------------- | ----------------------------------------- |
|
|
113
|
+
| `output-path` | *rootDir*\artifacts\internal-tools\integration-data.json | See [common arguments](#common-arguments) |
|
|
114
|
+
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
115
|
+
|
|
116
|
+
## update-integration-meta
|
|
117
|
+
```
|
|
118
|
+
dx-tools update-integration-meta --js-scripts D:\DevExtreme\js --docs-root D:\devextreme-docs
|
|
119
|
+
```
|
|
120
|
+
| Arg | Default | Description |
|
|
121
|
+
| ------------------- | -------------------------------------------------------- | ----------------------------------------- |
|
|
122
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
123
|
+
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
124
|
+
| `output-path` | *rootDir*\artifacts\internal-tools\integration-data.json | See [common arguments](#common-arguments) |
|
|
125
|
+
| `declarations-path` | *rootDir*\artifacts\internal-tools\Declarations.json | See [common arguments](#common-arguments) |
|
|
126
|
+
| `docs-root` | Optional parameter | See [common arguments](#common-arguments) |
|
|
127
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
128
|
+
|
|
129
|
+
## inject-descriptions
|
|
130
|
+
```
|
|
131
|
+
dx-tools inject-descriptions
|
|
132
|
+
```
|
|
133
|
+
| Arg | Default | Description |
|
|
134
|
+
| ------------------- | ---------------------------------------------------- | ----------------------------------------- |
|
|
135
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
136
|
+
| `descriptions-path` | *rootDir*\artifacts\internal-tools\Descriptions.json | Sets path to the Descriptions.json file |
|
|
137
|
+
| `search-pattern` | * | Sets a pattern to find the files |
|
|
138
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
139
|
+
|
|
140
|
+
## inject-descriptions-to-bundle
|
|
141
|
+
```
|
|
142
|
+
dx-tools inject-descriptions-to-bundle
|
|
143
|
+
```
|
|
144
|
+
| Arg | Default | Description |
|
|
145
|
+
| ------------------- | ---------------------------------------------------------------- | ----------------------------------------- |
|
|
146
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
147
|
+
| `descriptions-path` | *rootDir*\artifacts\internal-tools\Descriptions.json | Sets path to the Descriptions.json file |
|
|
148
|
+
| `target-path` | *rootDir*\node_modules\devextreme-internal-tools\bin\dx.all.d.ts | Sets the path to the `dx.all.d.ts` file |
|
|
149
|
+
| `output-path` | `target-path | See [common arguments](#common-arguments) |
|
|
150
|
+
| `ignore-pattern` | null | See [common arguments](#common-arguments) |
|
|
151
|
+
|
|
152
|
+
## update-topics
|
|
153
|
+
```
|
|
154
|
+
dx-tools update-topics
|
|
155
|
+
```
|
|
156
|
+
| Arg | Default | Description |
|
|
157
|
+
| ------------ | ---------------------------------- | ----------------------------------------- |
|
|
158
|
+
| `js-scripts` | *rootDir*\js | See [common arguments](#common-arguments) |
|
|
159
|
+
| `docs-root` | *rootDir* | See [common arguments](#common-arguments) |
|
|
160
|
+
| `artifacts` | *rootDir*\artifacts\internal-tools | See [common arguments](#common-arguments) |
|
|
161
|
+
|
|
162
|
+
## generate-content-map
|
|
163
|
+
```
|
|
164
|
+
dx-tools generate-content-map
|
|
165
|
+
```
|
|
166
|
+
| Arg | Default | Description |
|
|
167
|
+
| ----------- | ------------------------- | ----------------------------------------- |
|
|
168
|
+
| `docs-root` | *rootDir* | See [common arguments](#common-arguments) |
|
|
169
|
+
| `version` | Version in `package.json` | See [common arguments](#common-arguments) |
|
|
170
|
+
|
|
171
|
+
## update-links
|
|
172
|
+
```
|
|
173
|
+
dx-tools update-links --check-all --validation
|
|
174
|
+
```
|
|
175
|
+
| Flag | Description |
|
|
176
|
+
| ------------------ | -------------------------------------------- |
|
|
177
|
+
| `--fail-on-change` | Check and update links in changed files only |
|
|
178
|
+
| `--check-all` | Check and update links in all files |
|
|
179
|
+
| `--validation` | Check links without updating them |
|
|
180
|
+
|
|
181
|
+
# Common Arguments
|
|
182
|
+
|
|
183
|
+
| Arg | Description |
|
|
184
|
+
| ------------------- | --------------------------------------------------------------------------------------------------- |
|
|
185
|
+
| `js-scripts` | Path to the `js` folder in the [DevExtreme repo](https://github.com/DevExpress/DevExtreme) |
|
|
186
|
+
| `docs-root` | Path to the [devextreme-documentation repo](https://github.com/DevExpress/devextreme-documentation) |
|
|
187
|
+
| `version` | Major version (for example, `20_1`) |
|
|
188
|
+
| `artifacts` | Path to the `artifacts` folder |
|
|
189
|
+
| `declarations-path` | Path to the `Declarations.json` file |
|
|
190
|
+
| `output-path` | Path to the output file |
|
|
191
|
+
| `ignore-pattern` | Pattern for ignoring files |
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
# Development
|
|
195
|
+
|
|
196
|
+
We assume that [DevExtreme repo](https://github.com/DevExpress/DevExtreme) is located in the same parent directory:
|
|
197
|
+
```
|
|
198
|
+
···
|
|
199
|
+
├── devextreme/
|
|
200
|
+
│ ├── js/
|
|
201
|
+
│ └── ···
|
|
202
|
+
├── devextreme-internal-tools/
|
|
203
|
+
│ └── ···
|
|
204
|
+
···
|
|
205
|
+
```
|
|
206
|
+
If you need to target another directory, go to `./package.json` and change `--js-scripts` argument value.
|
|
207
|
+
|
|
208
|
+
## Discover TypeScript Declarations
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
npm run build-ts
|
|
212
|
+
npm run discover
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The commands above run the TypeScript Discoverer only. The .NET Discoverer should be run separately.
|
|
216
|
+
|
|
217
|
+
## Discover TypeScript Declarations in Watch Mode
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
npm run build-ts-watch
|
|
221
|
+
npm run discover-watch
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`build-ts-watch` recompiles the TypeScript Discoverer when its sources change.
|
|
225
|
+
|
|
226
|
+
`discover-watch` reruns the TypeScript Discoverer when Declarations change.
|
|
227
|
+
|
|
228
|
+
# Additional Information
|
|
229
|
+
|
|
230
|
+
## Bundler specs
|
|
231
|
+
|
|
232
|
+
`Bundler` is a tool that bundles all `*.d.ts` files into a single `bundle` file. A `bundle` is a file with a set of module declarations (namespaces).
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
declare global {}
|
|
236
|
+
|
|
237
|
+
declare module DevExpress {}
|
|
238
|
+
|
|
239
|
+
declare module DevExpress.module1 {}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
The bundling process starts with collecting all `public` types (types, interfaces, classes, etc.). A type is considered `public` if it is:
|
|
243
|
+
|
|
244
|
+
- exported and has the `@docid`, `@public`, or `@const` jsDoc tag.
|
|
245
|
+
- referenced by another `public` type.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
|
|
249
|
+
export interface NonPublicType { }
|
|
250
|
+
|
|
251
|
+
/** @docid */
|
|
252
|
+
export interface PublicType {
|
|
253
|
+
field: AnotherPublicType;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface AnotherPublicType {}
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
The next step is to decide what namespace the `public` type belongs to.
|
|
261
|
+
|
|
262
|
+
There are two options:
|
|
263
|
+
|
|
264
|
+
- the namespace is set explicitly with the help of the `@namespace` jsDoc tag.
|
|
265
|
+
- the namespace is calculated based on the type file location and structure.
|
|
266
|
+
|
|
267
|
+
In the latter case, there are 3 options:
|
|
268
|
+
|
|
269
|
+
- if the type is declared in the `global` namespace, it is preserved in this namespace.
|
|
270
|
+
- the calculated namespace is a `DevExpress` string followed by the first folder name in `cwd`. E.g., for types in the `{cwd}/core/utils/math/calculation.utils.d.ts` file, the namespace is `DevExpress.core`.
|
|
271
|
+
- if there is the default export of some class in the file, this class is considered a widget class, and then the `public` type is placed in the nested module with the name of the exported widget class. E.g., for types in the `{cwd}/ui/data_grid.d.ts` file with the `dxDataGrid` class as the default export, the module is `dxDataGrid` inside the `DevExpress.ui` namespace.
|
|
272
|
+
|
|
273
|
+
In the last step, all jsDoc comments are transformed by the [Collapser](#collapser-specs).
|
|
274
|
+
|
|
275
|
+
For example, consider the following files:
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
// {cwd}/ui/some_widget.d.ts
|
|
279
|
+
|
|
280
|
+
import { MyType } from '../core/utils';
|
|
281
|
+
|
|
282
|
+
export type SimplePropType = number;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @public
|
|
286
|
+
* @namespace DevExpress.ui.options
|
|
287
|
+
*/
|
|
288
|
+
export interface WidgetOptions {
|
|
289
|
+
myProp?: MyType;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** @public */
|
|
293
|
+
export default class Widget {
|
|
294
|
+
getOptions(): WidgetOptions;
|
|
295
|
+
getSingleProp(): SimplePropType;
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
// {cwd}/core/utils.d.ts
|
|
301
|
+
|
|
302
|
+
export type MyType = string;
|
|
303
|
+
|
|
304
|
+
export type MyType = string;
|
|
305
|
+
|
|
306
|
+
export type MySuperType = any;
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
The result of bundling these files:
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
declare module DevExpress.core {
|
|
313
|
+
/**
|
|
314
|
+
* @deprecated Attention! This type is for internal purposes only...
|
|
315
|
+
*/
|
|
316
|
+
export type MyType = string;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare module DevExpress.ui {
|
|
320
|
+
module Widget {
|
|
321
|
+
/**
|
|
322
|
+
* @deprecated Attention! This type is for internal purposes only...
|
|
323
|
+
*/
|
|
324
|
+
export type SimplePropType = number;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* [descr:Widget]
|
|
329
|
+
*/
|
|
330
|
+
export class Widget {
|
|
331
|
+
getOptions(): DevExpress.ui.options.WidgetOptions;
|
|
332
|
+
|
|
333
|
+
getSingleProp(): DevExpress.ui.Widget.SimplePropType;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare module DevExpress.ui.options {
|
|
338
|
+
/**
|
|
339
|
+
* [descr:WidgetOptions]
|
|
340
|
+
*/
|
|
341
|
+
export interface WidgetOptions {
|
|
342
|
+
myProp?: DevExpress.core.MyType;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
To replace placeholders with actual descriptions or deprecation messages, use the [inject-descriptions-to-bundle](#inject-descriptions-to-bundle) command.
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
## Collapser specs
|
|
351
|
+
|
|
352
|
+
The collapser is an internal process that runs against `*.d.ts` files and simplifies jsDoc comments to prepare them for further usage. It is used by the [inject-descriptions](#inject-descriptions) command as a first step and by [update-ts-bundle](#update-ts-bundle) as a last step.
|
|
353
|
+
|
|
354
|
+
The collapser changes jsDoc comments following the rules below:
|
|
355
|
+
|
|
356
|
+
- the `@docid` or `@const` jsDoc tag is replaced with a placeholder for description.
|
|
357
|
+
- the `@deprecated` tag with a custom (or empty) message is preserved.
|
|
358
|
+
- the `@deprecated` tag with a reference to other types either by `docid` or `{file/path.typeName}` is preserved, but the reference is replaced with a placeholder for a correct deprecation message.
|
|
359
|
+
- all other tags or content of a jsDoc comment will be removed.
|
|
360
|
+
- if the original type has no `@public` tag or jsDoc comments, an additional `@deprecated` tag is added with a standard warning message stating that this type is for internal use.
|
|
361
|
+
|
|
362
|
+
Once the collapser process is completed, all jsDoc comments will contain only placeholders and meaningful deprecation messages.
|
|
363
|
+
|
|
364
|
+
Let's look at an example. Below is the initial file.
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
/**
|
|
368
|
+
* @docid
|
|
369
|
+
* @public
|
|
370
|
+
*/
|
|
371
|
+
export interface WidgetProps {}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @docid
|
|
375
|
+
* @public
|
|
376
|
+
* @deprecated WidgetProps
|
|
377
|
+
*/
|
|
378
|
+
export interface WidgetOptions {}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @deprecated This is custom message
|
|
382
|
+
* @public
|
|
383
|
+
*/
|
|
384
|
+
export type DeprecatedType = {};
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* @docid
|
|
388
|
+
* @public
|
|
389
|
+
* @deprecated {file_path/file_name.TypeName}
|
|
390
|
+
*/
|
|
391
|
+
export type OldType = {};
|
|
392
|
+
|
|
393
|
+
export type InternalType = {};
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
And this is the result of the applied collapser:
|
|
397
|
+
|
|
398
|
+
```typescript
|
|
399
|
+
/**
|
|
400
|
+
* [descr:WidgetProps]
|
|
401
|
+
*/
|
|
402
|
+
export interface WidgetProps {}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* [descr:WidgetOptions]
|
|
406
|
+
* @deprecated [depNote:WidgetProps]
|
|
407
|
+
*/
|
|
408
|
+
export interface WidgetOptions {}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* @deprecated This is custom message
|
|
412
|
+
*/
|
|
413
|
+
export type DeprecatedType = {};
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* [descr:OldType]
|
|
417
|
+
* @deprecated [depNote.OldType]
|
|
418
|
+
*/
|
|
419
|
+
export type OldType = {};
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* @deprecated Attention! This type is for internal purposes only...
|
|
423
|
+
*/
|
|
424
|
+
export type InternalType = {};
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
# License
|
|
428
|
+
|
|
429
|
+
**DevExtreme Internal Tools are released as MIT-licensed.**
|