@ng-doc/builder 15.0.0-beta.28 → 15.0.0-beta.29
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/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/demos/button-demo/button-demo.component.js +0 -1
- package/engine/.cache/apps/ng-doc/src/app/docs/content/guidelines/demo/demos/button-inline-demo/button-inline-demo.component.js +0 -1
- package/engine/.cache/libs/app/classes/search-engine/search-engine.js +0 -1
- package/engine/.cache/libs/app/components/api-list/api-list.component.js +0 -9
- package/engine/.cache/libs/app/components/code/code.component.js +3 -8
- package/engine/.cache/libs/app/components/demo/demo.component.js +2 -5
- package/engine/.cache/libs/app/components/demo-displayer/demo-displayer.component.js +6 -8
- package/engine/.cache/libs/app/components/kind-icon/kind-icon.component.js +4 -2
- package/engine/.cache/libs/app/components/link/link.component.js +3 -1
- package/engine/.cache/libs/app/components/navbar/navbar.component.js +5 -9
- package/engine/.cache/libs/app/components/page/page.component.js +0 -1
- package/engine/.cache/libs/app/components/page-map/page-map-element/page-map-element.component.js +3 -4
- package/engine/.cache/libs/app/components/page-map/page-map.component.js +2 -9
- package/engine/.cache/libs/app/components/playground/playground.component.js +2 -7
- package/engine/.cache/libs/app/components/playground-demo/playground-demo.component.js +5 -14
- package/engine/.cache/libs/app/components/playground-properties/playground-properties.component.js +5 -6
- package/engine/.cache/libs/app/components/playground-property/playground-property.component.js +1 -7
- package/engine/.cache/libs/app/components/root/root.component.js +0 -7
- package/engine/.cache/libs/app/components/search/search.component.js +4 -6
- package/engine/.cache/libs/app/components/search-result/search-result.component.js +4 -2
- package/engine/.cache/libs/app/components/sidebar/sidebar-category/sidebar-category.component.js +4 -7
- package/engine/.cache/libs/app/components/sidebar/sidebar-item/sidebar-item.component.js +0 -1
- package/engine/.cache/libs/app/components/sidebar/sidebar.component.js +0 -1
- package/engine/.cache/libs/app/components/theme-toggle/theme-toggle.component.js +1 -2
- package/engine/.cache/libs/app/directives/code-highlighter/code-highlighter.directive.js +4 -5
- package/engine/.cache/libs/app/directives/route-active/route-active.directive.js +8 -12
- package/engine/.cache/libs/app/pipes/sanitize-html/sanitize-html.pipe.js +0 -1
- package/engine/.cache/libs/app/processors/blockquote-processor/blockquote-processor.directive.js +0 -2
- package/engine/.cache/libs/app/processors/code-processor/code-processor.directive.js +0 -2
- package/engine/.cache/libs/app/processors/demo-processor/demo-processor.directive.js +0 -2
- package/engine/.cache/libs/app/processors/html-processor/html-processor.directive.js +0 -4
- package/engine/.cache/libs/app/processors/icon-processor/icon-processor.directive.js +0 -2
- package/engine/.cache/libs/app/processors/playground-processor/playground-processor.directive.js +0 -2
- package/engine/.cache/libs/app/processors/tooltip-processor/tooltip-processor.directive.js +0 -2
- package/engine/.cache/libs/app/processors/tooltip-processor/tooltip-wrapper.component.js +0 -1
- package/engine/.cache/libs/app/services/sidebar/sidebar.service.js +2 -5
- package/engine/.cache/libs/app/services/theme/theme.service.js +1 -5
- package/engine/.cache/libs/app/type-controls/boolean-control/boolean-control.component.js +2 -2
- package/engine/.cache/libs/app/type-controls/number-control/number-control.component.js +0 -1
- package/engine/.cache/libs/app/type-controls/string-control/string-control.component.js +0 -1
- package/engine/.cache/libs/app/type-controls/type-alias-control/type-alias-control.component.js +0 -2
- package/engine/.cache/libs/builder/classes/observable-set.js +4 -2
- package/engine/.cache/libs/builder/engine/actions.js +0 -1
- package/engine/.cache/libs/builder/engine/builder.js +2 -5
- package/engine/.cache/libs/builder/engine/entities/abstractions/entity.js +23 -25
- package/engine/.cache/libs/builder/engine/entities/abstractions/file.entity.js +0 -4
- package/engine/.cache/libs/builder/engine/entities/abstractions/navigation.entity.js +7 -4
- package/engine/.cache/libs/builder/engine/entities/abstractions/route.entity.js +8 -5
- package/engine/.cache/libs/builder/engine/entities/abstractions/source-file.entity.js +4 -7
- package/engine/.cache/libs/builder/engine/entities/api-page.entity.js +7 -13
- package/engine/.cache/libs/builder/engine/entities/api-scope.entity.js +6 -11
- package/engine/.cache/libs/builder/engine/entities/api.entity.js +6 -4
- package/engine/.cache/libs/builder/engine/entities/category.entity.js +5 -3
- package/engine/.cache/libs/builder/engine/entities/dependencies.entity.js +4 -1
- package/engine/.cache/libs/builder/engine/entities/page.entity.js +6 -4
- package/engine/.cache/libs/builder/engine/entities/playground.entity.js +5 -2
- package/engine/.cache/libs/builder/engine/entities/skeleton.entity.js +8 -5
- package/engine/.cache/libs/builder/engine/entity-store.js +4 -1
- package/engine/.cache/libs/builder/engine/renderer.js +0 -5
- package/engine/.cache/libs/builder/engine/template-filters.js +15 -1
- package/engine/.cache/libs/builder/engine/watcher.js +4 -5
- package/engine/.cache/libs/builder/helpers/format-code.js +3 -6
- package/engine/.cache/libs/builder/helpers/presentation.js +76 -4
- package/engine/.cache/libs/builder/helpers/typescript/class/find-base-class.js +21 -0
- package/engine/.cache/libs/builder/helpers/typescript/class/find-class.js +21 -0
- package/engine/.cache/libs/builder/helpers/typescript/class/for-all-classes.js +15 -0
- package/engine/.cache/libs/builder/helpers/typescript/class/index.js +6 -0
- package/engine/.cache/libs/builder/helpers/typescript/first-node-with-comment.js +13 -0
- package/engine/.cache/libs/builder/helpers/typescript/index.js +6 -0
- package/engine/.cache/libs/builder/helpers/typescript/interface/find-interface.js +29 -0
- package/engine/.cache/libs/builder/helpers/typescript/interface/for-all-interfaces.js +20 -0
- package/engine/.cache/libs/builder/helpers/typescript/interface/index.js +5 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/get-class-methods.js +22 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/get-implemented-method.js +44 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/get-interface-methods.js +22 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/get-method-chain.js +32 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/get-overridden-method.js +26 -0
- package/engine/.cache/libs/builder/helpers/typescript/method/index.js +8 -0
- package/engine/.cache/libs/builder/helpers/typescript/node/index.js +4 -0
- package/engine/.cache/libs/builder/helpers/typescript/node/sort-by-nodes-name.js +11 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/get-class-properties.js +22 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/get-implemented-property.js +44 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/get-interface-properties.js +22 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/get-overridden-property.js +26 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/get-property-chain.js +33 -0
- package/engine/.cache/libs/builder/helpers/typescript/property/index.js +8 -0
- package/engine/.cache/libs/ui-kit/cdk/combobox-host/combobox-host.component.js +3 -8
- package/engine/.cache/libs/ui-kit/classes/base-input/base-input.js +0 -3
- package/engine/.cache/libs/ui-kit/classes/overlay-ref/overlay-ref.js +2 -8
- package/engine/.cache/libs/ui-kit/components/blockquote/blockquote.component.js +3 -1
- package/engine/.cache/libs/ui-kit/components/button/button.component.js +4 -2
- package/engine/.cache/libs/ui-kit/components/button-icon/button-icon.component.js +5 -3
- package/engine/.cache/libs/ui-kit/components/checkbox/checkbox.component.js +1 -3
- package/engine/.cache/libs/ui-kit/components/clear-control/clear-control.component.js +0 -3
- package/engine/.cache/libs/ui-kit/components/combobox/combobox.component.js +6 -7
- package/engine/.cache/libs/ui-kit/components/dot/dot.component.js +0 -2
- package/engine/.cache/libs/ui-kit/components/dropdown/dropdown.component.js +26 -32
- package/engine/.cache/libs/ui-kit/components/expander/expander.component.js +8 -7
- package/engine/.cache/libs/ui-kit/components/floated-content/floated-content.component.js +2 -6
- package/engine/.cache/libs/ui-kit/components/focus-control/focus-control.component.js +1 -2
- package/engine/.cache/libs/ui-kit/components/icon/icon.component.js +5 -8
- package/engine/.cache/libs/ui-kit/components/input-wrapper/input-wrapper.component.js +5 -11
- package/engine/.cache/libs/ui-kit/components/label/label.component.js +5 -3
- package/engine/.cache/libs/ui-kit/components/list/list.component.js +2 -6
- package/engine/.cache/libs/ui-kit/components/option/option.component.js +1 -5
- package/engine/.cache/libs/ui-kit/components/overlay-container/overlay-container.component.js +4 -14
- package/engine/.cache/libs/ui-kit/components/overlay-pointer/overlay-pointer.component.js +5 -3
- package/engine/.cache/libs/ui-kit/components/selection/selection-host.directive.js +4 -3
- package/engine/.cache/libs/ui-kit/components/selection/selection-origin.directive.js +1 -3
- package/engine/.cache/libs/ui-kit/components/selection/selection.component.js +1 -3
- package/engine/.cache/libs/ui-kit/components/tab-group/tab/tab.component.js +6 -4
- package/engine/.cache/libs/ui-kit/components/tab-group/tab-group.component.js +2 -5
- package/engine/.cache/libs/ui-kit/components/tag/tag.component.js +4 -2
- package/engine/.cache/libs/ui-kit/components/text/text.component.js +7 -10
- package/engine/.cache/libs/ui-kit/components/toggle/toggle.component.js +2 -8
- package/engine/.cache/libs/ui-kit/directives/autofocus/autofocus.directive.js +0 -1
- package/engine/.cache/libs/ui-kit/directives/checked-change/checked-change.directive.js +5 -7
- package/engine/.cache/libs/ui-kit/directives/data/data.directive.js +0 -2
- package/engine/.cache/libs/ui-kit/directives/dropdown-handler/dropdown-handler.directive.js +0 -1
- package/engine/.cache/libs/ui-kit/directives/dropdown-origin/dropdown-origin.directive.js +0 -1
- package/engine/.cache/libs/ui-kit/directives/event-switcher/event-switcher.directive.js +2 -4
- package/engine/.cache/libs/ui-kit/directives/focus-catcher/focus-catcher.directive.js +3 -6
- package/engine/.cache/libs/ui-kit/directives/focusable/focusable.directive.js +3 -1
- package/engine/.cache/libs/ui-kit/directives/input-number/input-number.directive.js +0 -3
- package/engine/.cache/libs/ui-kit/directives/input-string/input-string.directive.js +0 -3
- package/engine/.cache/libs/ui-kit/directives/let/let-context.js +0 -1
- package/engine/.cache/libs/ui-kit/directives/let/let.directive.js +0 -3
- package/engine/.cache/libs/ui-kit/directives/media-query/media-query.directive.js +3 -7
- package/engine/.cache/libs/ui-kit/directives/rotator/rotator.directive.js +6 -8
- package/engine/.cache/libs/ui-kit/directives/tooltip/tooltip.directive.js +21 -29
- package/engine/.cache/libs/ui-kit/interceptors/cache.interceptor.js +4 -2
- package/engine/.cache/libs/ui-kit/observables/zone.js +0 -1
- package/engine/.cache/libs/ui-kit/services/notify/notify.service.js +1 -3
- package/engine/.cache/libs/ui-kit/services/overlay/overlay.service.js +0 -4
- package/engine/.cache/libs/ui-kit/services/overlay-strategy/overlay-strategy.js +2 -4
- package/engine/.cache/libs/ui-kit/types/content.js +0 -2
- package/engine/entities/api-page.entity.d.ts +1 -1
- package/engine/template-filters.d.ts +1 -1
- package/engine/template-filters.js +15 -1
- package/engine/template-filters.js.map +1 -1
- package/helpers/format-code.js +3 -6
- package/helpers/format-code.js.map +1 -1
- package/helpers/presentation.d.ts +11 -1
- package/helpers/presentation.js +77 -4
- package/helpers/presentation.js.map +1 -1
- package/helpers/typescript/class/find-base-class.d.ts +7 -0
- package/helpers/typescript/class/find-base-class.js +22 -0
- package/helpers/typescript/class/find-base-class.js.map +1 -0
- package/helpers/typescript/class/find-class.d.ts +7 -0
- package/helpers/typescript/class/find-class.js +22 -0
- package/helpers/typescript/class/find-class.js.map +1 -0
- package/helpers/typescript/class/for-all-classes.d.ts +7 -0
- package/helpers/typescript/class/for-all-classes.js +16 -0
- package/helpers/typescript/class/for-all-classes.js.map +1 -0
- package/helpers/typescript/class/index.d.ts +3 -0
- package/helpers/typescript/class/index.js +7 -0
- package/helpers/typescript/class/index.js.map +1 -0
- package/helpers/typescript/first-node-with-comment.d.ts +8 -0
- package/helpers/typescript/first-node-with-comment.js +15 -0
- package/helpers/typescript/first-node-with-comment.js.map +1 -0
- package/helpers/typescript/index.d.ts +6 -0
- package/helpers/typescript/index.js +6 -0
- package/helpers/typescript/index.js.map +1 -1
- package/helpers/typescript/interface/find-interface.d.ts +7 -0
- package/helpers/typescript/interface/find-interface.js +30 -0
- package/helpers/typescript/interface/find-interface.js.map +1 -0
- package/helpers/typescript/interface/for-all-interfaces.d.ts +7 -0
- package/helpers/typescript/interface/for-all-interfaces.js +21 -0
- package/helpers/typescript/interface/for-all-interfaces.js.map +1 -0
- package/helpers/typescript/interface/index.d.ts +2 -0
- package/helpers/typescript/interface/index.js +6 -0
- package/helpers/typescript/interface/index.js.map +1 -0
- package/helpers/typescript/method/get-class-methods.d.ts +6 -0
- package/helpers/typescript/method/get-class-methods.js +23 -0
- package/helpers/typescript/method/get-class-methods.js.map +1 -0
- package/helpers/typescript/method/get-implemented-method.d.ts +7 -0
- package/helpers/typescript/method/get-implemented-method.js +46 -0
- package/helpers/typescript/method/get-implemented-method.js.map +1 -0
- package/helpers/typescript/method/get-interface-methods.d.ts +6 -0
- package/helpers/typescript/method/get-interface-methods.js +23 -0
- package/helpers/typescript/method/get-interface-methods.js.map +1 -0
- package/helpers/typescript/method/get-method-chain.d.ts +6 -0
- package/helpers/typescript/method/get-method-chain.js +33 -0
- package/helpers/typescript/method/get-method-chain.js.map +1 -0
- package/helpers/typescript/method/get-overridden-method.d.ts +7 -0
- package/helpers/typescript/method/get-overridden-method.js +28 -0
- package/helpers/typescript/method/get-overridden-method.js.map +1 -0
- package/helpers/typescript/method/index.d.ts +5 -0
- package/helpers/typescript/method/index.js +9 -0
- package/helpers/typescript/method/index.js.map +1 -0
- package/helpers/typescript/node/index.d.ts +1 -0
- package/helpers/typescript/node/index.js +5 -0
- package/helpers/typescript/node/index.js.map +1 -0
- package/helpers/typescript/node/sort-by-nodes-name.d.ts +6 -0
- package/helpers/typescript/node/sort-by-nodes-name.js +12 -0
- package/helpers/typescript/node/sort-by-nodes-name.js.map +1 -0
- package/helpers/typescript/property/get-class-properties.d.ts +6 -0
- package/helpers/typescript/property/get-class-properties.js +23 -0
- package/helpers/typescript/property/get-class-properties.js.map +1 -0
- package/helpers/typescript/property/get-implemented-property.d.ts +7 -0
- package/helpers/typescript/property/get-implemented-property.js +46 -0
- package/helpers/typescript/property/get-implemented-property.js.map +1 -0
- package/helpers/typescript/property/get-interface-properties.d.ts +6 -0
- package/helpers/typescript/property/get-interface-properties.js +23 -0
- package/helpers/typescript/property/get-interface-properties.js.map +1 -0
- package/helpers/typescript/property/get-overridden-property.d.ts +7 -0
- package/helpers/typescript/property/get-overridden-property.js +28 -0
- package/helpers/typescript/property/get-overridden-property.js.map +1 -0
- package/helpers/typescript/property/get-property-chain.d.ts +6 -0
- package/helpers/typescript/property/get-property-chain.js +34 -0
- package/helpers/typescript/property/get-property-chain.js.map +1 -0
- package/helpers/typescript/property/index.d.ts +5 -0
- package/helpers/typescript/property/index.js +9 -0
- package/helpers/typescript/property/index.js.map +1 -0
- package/package.json +2 -2
- package/templates/api/class.html.nunj +22 -8
- package/templates/api/function.html.nunj +1 -1
- package/templates/api/interface.html.nunj +4 -4
- package/templates/helpers/constructor.html.nunj +34 -0
- package/templates/helpers/declaration-modifiers.html.nunj +4 -8
- package/templates/helpers/method.html.nunj +19 -4
- package/templates/helpers/methods.html.nunj +2 -2
- package/templates/helpers/parameters.html.nunj +2 -1
- package/templates/helpers/properties.html.nunj +19 -2
|
@@ -17,13 +17,10 @@ const build_candidates_1 = require("./functions/build-candidates");
|
|
|
17
17
|
const variables_1 = require("./variables");
|
|
18
18
|
const watcher_1 = require("./watcher");
|
|
19
19
|
class NgDocBuilder {
|
|
20
|
-
context;
|
|
21
|
-
entities = new entity_store_1.NgDocEntityStore();
|
|
22
|
-
skeleton = new entities_1.NgDocSkeletonEntity(this, this.context);
|
|
23
|
-
project;
|
|
24
|
-
watcher;
|
|
25
20
|
constructor(context) {
|
|
26
21
|
this.context = context;
|
|
22
|
+
this.entities = new entity_store_1.NgDocEntityStore();
|
|
23
|
+
this.skeleton = new entities_1.NgDocSkeletonEntity(this, this.context);
|
|
27
24
|
this.project = (0, helpers_1.createProject)({
|
|
28
25
|
tsConfigFilePath: this.context.tsConfig,
|
|
29
26
|
compilerOptions: {
|
|
@@ -10,34 +10,32 @@ const post_processors_1 = require("../../post-processors");
|
|
|
10
10
|
* Base entity class that all entities should extend.
|
|
11
11
|
*/
|
|
12
12
|
class NgDocEntity {
|
|
13
|
-
builder;
|
|
14
|
-
context;
|
|
15
|
-
/** Indicates when entity was destroyed */
|
|
16
|
-
destroyed = false;
|
|
17
|
-
/** Indicates if the current entity can be built */
|
|
18
|
-
get canBeBuilt() {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
/** Last built artifacts */
|
|
22
|
-
artifacts = [];
|
|
23
|
-
/**
|
|
24
|
-
* Collection of all file dependencies of the current entity.
|
|
25
|
-
* This property is using to watch for changes in this dependencies list and rebuild current buildable.
|
|
26
|
-
*/
|
|
27
|
-
dependencies = new classes_1.ObservableSet();
|
|
28
|
-
/**
|
|
29
|
-
* Indicates if this entity has physical file in file system
|
|
30
|
-
* If this entity was generated by another Entity, this property should be `false`
|
|
31
|
-
*
|
|
32
|
-
* NgDoc destroys all child elements of non-physical entities when they are destroyed
|
|
33
|
-
*/
|
|
34
|
-
physical = true;
|
|
35
|
-
/** Indicates when current entity could be built */
|
|
36
|
-
readyToBuild = false;
|
|
37
|
-
destroy$ = new rxjs_1.Subject();
|
|
38
13
|
constructor(builder, context) {
|
|
39
14
|
this.builder = builder;
|
|
40
15
|
this.context = context;
|
|
16
|
+
/** Indicates when entity was destroyed */
|
|
17
|
+
this.destroyed = false;
|
|
18
|
+
/** Last built artifacts */
|
|
19
|
+
this.artifacts = [];
|
|
20
|
+
/**
|
|
21
|
+
* Collection of all file dependencies of the current entity.
|
|
22
|
+
* This property is using to watch for changes in this dependencies list and rebuild current buildable.
|
|
23
|
+
*/
|
|
24
|
+
this.dependencies = new classes_1.ObservableSet();
|
|
25
|
+
/**
|
|
26
|
+
* Indicates if this entity has physical file in file system
|
|
27
|
+
* If this entity was generated by another Entity, this property should be `false`
|
|
28
|
+
*
|
|
29
|
+
* NgDoc destroys all child elements of non-physical entities when they are destroyed
|
|
30
|
+
*/
|
|
31
|
+
this.physical = true;
|
|
32
|
+
/** Indicates when current entity could be built */
|
|
33
|
+
this.readyToBuild = false;
|
|
34
|
+
this.destroy$ = new rxjs_1.Subject();
|
|
35
|
+
}
|
|
36
|
+
/** Indicates if the current entity can be built */
|
|
37
|
+
get canBeBuilt() {
|
|
38
|
+
return true;
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* Recursively returns parents for the current entity
|
|
@@ -13,10 +13,6 @@ const source_file_entity_1 = require("./source-file.entity");
|
|
|
13
13
|
* Entity for file end points that generate modules and components.
|
|
14
14
|
*/
|
|
15
15
|
class NgDocFileEntity extends source_file_entity_1.NgDocSourceFileEntity {
|
|
16
|
-
/**
|
|
17
|
-
* Entity target.
|
|
18
|
-
*/
|
|
19
|
-
target;
|
|
20
16
|
update() {
|
|
21
17
|
this.readyToBuild = false;
|
|
22
18
|
try {
|
|
@@ -8,10 +8,13 @@ const route_entity_1 = require("./route.entity");
|
|
|
8
8
|
* Entity for file end points that generate modules and components.
|
|
9
9
|
*/
|
|
10
10
|
class NgDocNavigationEntity extends route_entity_1.NgDocRouteEntity {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Indicates when current entity is using for page navigation.
|
|
15
|
+
*/
|
|
16
|
+
this.isNavigable = true;
|
|
17
|
+
}
|
|
15
18
|
get folderName() {
|
|
16
19
|
return this.route;
|
|
17
20
|
}
|
|
@@ -5,11 +5,14 @@ const path = require("path");
|
|
|
5
5
|
const helpers_1 = require("../../../helpers");
|
|
6
6
|
const module_entity_1 = require("./module.entity");
|
|
7
7
|
class NgDocRouteEntity extends module_entity_1.NgDocModuleEntity {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
/**
|
|
11
|
+
* List of keywords that are used by the entity
|
|
12
|
+
* (they will be sat by Keywords Processor, and used to indicate when this entity should be re-build if one of them appears)
|
|
13
|
+
*/
|
|
14
|
+
this.usedKeywords = new Set();
|
|
15
|
+
}
|
|
13
16
|
get fullRoute() {
|
|
14
17
|
const parentRoute = this.parent instanceof NgDocRouteEntity
|
|
15
18
|
? this.parent.fullRoute
|
|
@@ -9,18 +9,15 @@ const helpers_1 = require("../../../helpers");
|
|
|
9
9
|
const variables_1 = require("../../variables");
|
|
10
10
|
const entity_1 = require("./entity");
|
|
11
11
|
class NgDocSourceFileEntity extends entity_1.NgDocEntity {
|
|
12
|
-
builder;
|
|
13
|
-
sourceFile;
|
|
14
|
-
context;
|
|
15
|
-
/**
|
|
16
|
-
* The key by which the entity will be stored in the store
|
|
17
|
-
*/
|
|
18
|
-
id = this.sourceFilePath;
|
|
19
12
|
constructor(builder, sourceFile, context) {
|
|
20
13
|
super(builder, context);
|
|
21
14
|
this.builder = builder;
|
|
22
15
|
this.sourceFile = sourceFile;
|
|
23
16
|
this.context = context;
|
|
17
|
+
/**
|
|
18
|
+
* The key by which the entity will be stored in the store
|
|
19
|
+
*/
|
|
20
|
+
this.id = this.sourceFilePath;
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
23
|
* Files that are watched for changes to rebuild entity or remove it
|
|
@@ -11,19 +11,6 @@ const renderer_1 = require("../renderer");
|
|
|
11
11
|
const variables_1 = require("../variables");
|
|
12
12
|
const route_entity_1 = require("./abstractions/route.entity");
|
|
13
13
|
class NgDocApiPageEntity extends route_entity_1.NgDocRouteEntity {
|
|
14
|
-
builder;
|
|
15
|
-
sourceFile;
|
|
16
|
-
context;
|
|
17
|
-
parent;
|
|
18
|
-
declarationName;
|
|
19
|
-
folderName = '';
|
|
20
|
-
moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiPageModule`);
|
|
21
|
-
componentName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiPageComponent`);
|
|
22
|
-
moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-api-page')}.module.ts`;
|
|
23
|
-
readyToBuild = true;
|
|
24
|
-
physical = false;
|
|
25
|
-
declaration;
|
|
26
|
-
id = (0, helpers_1.uniqueName)(`${this.sourceFilePath}}#${this.declarationName}`);
|
|
27
14
|
constructor(builder, sourceFile, context, parent, declarationName) {
|
|
28
15
|
super(builder, sourceFile, context);
|
|
29
16
|
this.builder = builder;
|
|
@@ -31,6 +18,13 @@ class NgDocApiPageEntity extends route_entity_1.NgDocRouteEntity {
|
|
|
31
18
|
this.context = context;
|
|
32
19
|
this.parent = parent;
|
|
33
20
|
this.declarationName = declarationName;
|
|
21
|
+
this.folderName = '';
|
|
22
|
+
this.moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiPageModule`);
|
|
23
|
+
this.componentName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiPageComponent`);
|
|
24
|
+
this.moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-api-page')}.module.ts`;
|
|
25
|
+
this.readyToBuild = true;
|
|
26
|
+
this.physical = false;
|
|
27
|
+
this.id = (0, helpers_1.uniqueName)(`${this.sourceFilePath}}#${this.declarationName}`);
|
|
34
28
|
this.updateDeclaration();
|
|
35
29
|
}
|
|
36
30
|
get isRoot() {
|
|
@@ -8,17 +8,6 @@ const helpers_1 = require("../../helpers");
|
|
|
8
8
|
const renderer_1 = require("../renderer");
|
|
9
9
|
const navigation_entity_1 = require("./abstractions/navigation.entity");
|
|
10
10
|
class NgDocApiScopeEntity extends navigation_entity_1.NgDocNavigationEntity {
|
|
11
|
-
builder;
|
|
12
|
-
sourceFile;
|
|
13
|
-
context;
|
|
14
|
-
parent;
|
|
15
|
-
target;
|
|
16
|
-
moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiScopeCategoryModule`);
|
|
17
|
-
isNavigable = false;
|
|
18
|
-
physical = false;
|
|
19
|
-
readyToBuild = true;
|
|
20
|
-
moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-api-scope')}.module.ts`;
|
|
21
|
-
id = (0, helpers_1.uniqueName)(`${this.sourceFilePath}#${this.target.route}`);
|
|
22
11
|
constructor(builder, sourceFile, context, parent, target) {
|
|
23
12
|
super(builder, sourceFile, context);
|
|
24
13
|
this.builder = builder;
|
|
@@ -26,6 +15,12 @@ class NgDocApiScopeEntity extends navigation_entity_1.NgDocNavigationEntity {
|
|
|
26
15
|
this.context = context;
|
|
27
16
|
this.parent = parent;
|
|
28
17
|
this.target = target;
|
|
18
|
+
this.moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiScopeCategoryModule`);
|
|
19
|
+
this.isNavigable = false;
|
|
20
|
+
this.physical = false;
|
|
21
|
+
this.readyToBuild = true;
|
|
22
|
+
this.moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-api-scope')}.module.ts`;
|
|
23
|
+
this.id = (0, helpers_1.uniqueName)(`${this.sourceFilePath}#${this.target.route}`);
|
|
29
24
|
}
|
|
30
25
|
get rootFiles() {
|
|
31
26
|
return [];
|
|
@@ -9,10 +9,12 @@ const helpers_1 = require("../../helpers");
|
|
|
9
9
|
const renderer_1 = require("../renderer");
|
|
10
10
|
const navigation_entity_1 = require("./abstractions/navigation.entity");
|
|
11
11
|
class NgDocApiEntity extends navigation_entity_1.NgDocNavigationEntity {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiListModule`);
|
|
15
|
+
this.componentName = (0, helpers_1.uniqueName)(`NgDocGeneratedApiListComponent`);
|
|
16
|
+
this.moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-api-list')}.module.ts`;
|
|
17
|
+
}
|
|
16
18
|
get route() {
|
|
17
19
|
return this.target?.route ?? 'api';
|
|
18
20
|
}
|
|
@@ -9,9 +9,11 @@ const helpers_1 = require("../../helpers");
|
|
|
9
9
|
const renderer_1 = require("../renderer");
|
|
10
10
|
const navigation_entity_1 = require("./abstractions/navigation.entity");
|
|
11
11
|
class NgDocCategoryEntity extends navigation_entity_1.NgDocNavigationEntity {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedCategoryModule`);
|
|
15
|
+
this.moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-category')}.module.ts`;
|
|
16
|
+
}
|
|
15
17
|
get route() {
|
|
16
18
|
const folderName = path.basename(path.dirname(this.sourceFile.getFilePath()));
|
|
17
19
|
return this.target?.route ?? folderName;
|
|
@@ -12,7 +12,10 @@ const renderer_1 = require("../renderer");
|
|
|
12
12
|
const variables_1 = require("../variables");
|
|
13
13
|
const source_file_entity_1 = require("./abstractions/source-file.entity");
|
|
14
14
|
class NgDocDependenciesEntity extends source_file_entity_1.NgDocSourceFileEntity {
|
|
15
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.componentsAssets = {};
|
|
18
|
+
}
|
|
16
19
|
get isRoot() {
|
|
17
20
|
// always false, page dependencies are not rooted
|
|
18
21
|
return false;
|
|
@@ -12,10 +12,12 @@ const renderer_1 = require("../renderer");
|
|
|
12
12
|
const variables_1 = require("../variables");
|
|
13
13
|
const navigation_entity_1 = require("./abstractions/navigation.entity");
|
|
14
14
|
class NgDocPageEntity extends navigation_entity_1.NgDocNavigationEntity {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.moduleName = (0, helpers_1.uniqueName)(`NgDocGeneratedPageModule`);
|
|
18
|
+
this.componentName = (0, helpers_1.uniqueName)(`NgDocGeneratedPageComponent`);
|
|
19
|
+
this.moduleFileName = `${(0, helpers_1.uniqueName)('ng-doc-page')}.module.ts`;
|
|
20
|
+
}
|
|
19
21
|
get route() {
|
|
20
22
|
const folderName = path.basename(path.dirname(this.sourceFile.getFilePath()));
|
|
21
23
|
return this.target?.route ?? folderName;
|
|
@@ -9,8 +9,11 @@ const helpers_1 = require("../../helpers");
|
|
|
9
9
|
const variables_1 = require("../variables");
|
|
10
10
|
const file_entity_1 = require("./abstractions/file.entity");
|
|
11
11
|
class NgDocPlaygroundEntity extends file_entity_1.NgDocFileEntity {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.isRoot = false;
|
|
15
|
+
this.buildCandidates = [];
|
|
16
|
+
}
|
|
14
17
|
get parent() {
|
|
15
18
|
const expectedPath = path.join(this.sourceFileFolder, variables_1.PAGE_NAME);
|
|
16
19
|
const buildable = this.builder.get(expectedPath);
|
|
@@ -8,11 +8,14 @@ const build_global_indexes_1 = require("../../helpers/build-global-indexes");
|
|
|
8
8
|
const renderer_1 = require("../renderer");
|
|
9
9
|
const entity_1 = require("./abstractions/entity");
|
|
10
10
|
class NgDocSkeletonEntity extends entity_1.NgDocEntity {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.id = 'NgDocSkeletonEntity';
|
|
14
|
+
this.isRoot = true;
|
|
15
|
+
this.rootFiles = [];
|
|
16
|
+
this.parent = undefined;
|
|
17
|
+
this.buildCandidates = [];
|
|
18
|
+
}
|
|
16
19
|
update() {
|
|
17
20
|
return (0, rxjs_1.of)(void 0);
|
|
18
21
|
}
|
|
@@ -4,7 +4,10 @@ exports.NgDocEntityStore = void 0;
|
|
|
4
4
|
const core_1 = require("@ng-doc/core");
|
|
5
5
|
const helpers_1 = require("../helpers");
|
|
6
6
|
class NgDocEntityStore extends Map {
|
|
7
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.keywordMap = new Map();
|
|
10
|
+
}
|
|
8
11
|
asArray() {
|
|
9
12
|
return (0, core_1.asArray)(this.values());
|
|
10
13
|
}
|
|
@@ -10,8 +10,6 @@ const ts_morph_1 = require("ts-morph");
|
|
|
10
10
|
const filters = require("./template-filters");
|
|
11
11
|
const variables_1 = require("./variables");
|
|
12
12
|
class NgDocRelativeLoader {
|
|
13
|
-
path;
|
|
14
|
-
dependenciesStore;
|
|
15
13
|
constructor(path, dependenciesStore) {
|
|
16
14
|
this.path = path;
|
|
17
15
|
this.dependenciesStore = dependenciesStore;
|
|
@@ -27,9 +25,6 @@ class NgDocRelativeLoader {
|
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
class NgDocRenderer {
|
|
30
|
-
builder;
|
|
31
|
-
context;
|
|
32
|
-
dependenciesStore;
|
|
33
28
|
constructor(builder, context, dependenciesStore) {
|
|
34
29
|
this.builder = builder;
|
|
35
30
|
this.context = context;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Just export filters from this file, they will be included to the template renderer automatically */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.humanizeDeclarationName = exports.variablePresentation = exports.typeAliasPresentation = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = void 0;
|
|
4
|
+
exports.humanizeDeclarationName = exports.variablePresentation = exports.typeAliasPresentation = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.getPropertyChain = exports.getOverriddenProperty = exports.getOverriddenMethod = exports.getMethodChain = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getImplementedProperty = exports.getImplementedMethod = exports.getClassProperties = exports.getClassMethods = exports.functionPresentation = exports.firstNodeWithComment = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.constructorPresentation = void 0;
|
|
5
5
|
var helpers_1 = require("../helpers");
|
|
6
|
+
Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
|
|
6
7
|
Object.defineProperty(exports, "displayType", { enumerable: true, get: function () { return helpers_1.displayType; } });
|
|
7
8
|
Object.defineProperty(exports, "extractDocs", { enumerable: true, get: function () { return helpers_1.extractDocs; } });
|
|
8
9
|
Object.defineProperty(exports, "extractParameterDocs", { enumerable: true, get: function () { return helpers_1.extractParameterDocs; } });
|
|
@@ -10,11 +11,24 @@ Object.defineProperty(exports, "extractSeeDocs", { enumerable: true, get: functi
|
|
|
10
11
|
Object.defineProperty(exports, "extractSelectors", { enumerable: true, get: function () { return helpers_1.extractSelectors; } });
|
|
11
12
|
Object.defineProperty(exports, "filterByScope", { enumerable: true, get: function () { return helpers_1.filterByScope; } });
|
|
12
13
|
Object.defineProperty(exports, "filterByStatic", { enumerable: true, get: function () { return helpers_1.filterByStatic; } });
|
|
14
|
+
Object.defineProperty(exports, "firstNodeWithComment", { enumerable: true, get: function () { return helpers_1.firstNodeWithComment; } });
|
|
15
|
+
Object.defineProperty(exports, "functionPresentation", { enumerable: true, get: function () { return helpers_1.functionPresentation; } });
|
|
16
|
+
Object.defineProperty(exports, "getClassMethods", { enumerable: true, get: function () { return helpers_1.getClassMethods; } });
|
|
17
|
+
Object.defineProperty(exports, "getClassProperties", { enumerable: true, get: function () { return helpers_1.getClassProperties; } });
|
|
18
|
+
Object.defineProperty(exports, "getImplementedMethod", { enumerable: true, get: function () { return helpers_1.getImplementedMethod; } });
|
|
19
|
+
Object.defineProperty(exports, "getImplementedProperty", { enumerable: true, get: function () { return helpers_1.getImplementedProperty; } });
|
|
20
|
+
Object.defineProperty(exports, "getInterfaceMethods", { enumerable: true, get: function () { return helpers_1.getInterfaceMethods; } });
|
|
21
|
+
Object.defineProperty(exports, "getInterfaceProperties", { enumerable: true, get: function () { return helpers_1.getInterfaceProperties; } });
|
|
22
|
+
Object.defineProperty(exports, "getMethodChain", { enumerable: true, get: function () { return helpers_1.getMethodChain; } });
|
|
23
|
+
Object.defineProperty(exports, "getOverriddenMethod", { enumerable: true, get: function () { return helpers_1.getOverriddenMethod; } });
|
|
24
|
+
Object.defineProperty(exports, "getOverriddenProperty", { enumerable: true, get: function () { return helpers_1.getOverriddenProperty; } });
|
|
25
|
+
Object.defineProperty(exports, "getPropertyChain", { enumerable: true, get: function () { return helpers_1.getPropertyChain; } });
|
|
13
26
|
Object.defineProperty(exports, "marked", { enumerable: true, get: function () { return helpers_1.marked; } });
|
|
14
27
|
Object.defineProperty(exports, "methodPresentation", { enumerable: true, get: function () { return helpers_1.methodPresentation; } });
|
|
15
28
|
Object.defineProperty(exports, "noEmpty", { enumerable: true, get: function () { return helpers_1.noEmpty; } });
|
|
16
29
|
Object.defineProperty(exports, "noLineBreaks", { enumerable: true, get: function () { return helpers_1.noLineBreaks; } });
|
|
17
30
|
Object.defineProperty(exports, "notEmptyAssets", { enumerable: true, get: function () { return helpers_1.notEmptyAssets; } });
|
|
31
|
+
Object.defineProperty(exports, "sortByNodesName", { enumerable: true, get: function () { return helpers_1.sortByNodesName; } });
|
|
18
32
|
Object.defineProperty(exports, "typeAliasPresentation", { enumerable: true, get: function () { return helpers_1.typeAliasPresentation; } });
|
|
19
33
|
Object.defineProperty(exports, "variablePresentation", { enumerable: true, get: function () { return helpers_1.variablePresentation; } });
|
|
20
34
|
var core_1 = require("@ng-doc/core");
|
|
@@ -6,12 +6,11 @@ const minimatch_1 = require("minimatch");
|
|
|
6
6
|
const rxjs_1 = require("rxjs");
|
|
7
7
|
const operators_1 = require("rxjs/operators");
|
|
8
8
|
class NgDocWatcher {
|
|
9
|
-
watcher;
|
|
10
|
-
change$ = new rxjs_1.Subject();
|
|
11
|
-
add$ = new rxjs_1.Subject();
|
|
12
|
-
unlink$ = new rxjs_1.Subject();
|
|
13
|
-
ready$ = new rxjs_1.Subject();
|
|
14
9
|
constructor(files) {
|
|
10
|
+
this.change$ = new rxjs_1.Subject();
|
|
11
|
+
this.add$ = new rxjs_1.Subject();
|
|
12
|
+
this.unlink$ = new rxjs_1.Subject();
|
|
13
|
+
this.ready$ = new rxjs_1.Subject();
|
|
15
14
|
this.watcher = chokidar.watch(files ?? [], {
|
|
16
15
|
/* `useFsEvents` causes problems on Mac when chokidar doesn't fire `unlink` event if the file has been moved */
|
|
17
16
|
useFsEvents: false,
|
|
@@ -10,7 +10,8 @@ exports.formatCode = void 0;
|
|
|
10
10
|
*/
|
|
11
11
|
function formatCode(code, codeType) {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
const parser = getPrettierParserFromCodeType(codeType);
|
|
14
|
+
return require('prettier').format(code, parser ? { parser } : {});
|
|
14
15
|
}
|
|
15
16
|
catch (e) {
|
|
16
17
|
return code;
|
|
@@ -25,16 +26,12 @@ exports.formatCode = formatCode;
|
|
|
25
26
|
*/
|
|
26
27
|
function getPrettierParserFromCodeType(codeType) {
|
|
27
28
|
switch (codeType) {
|
|
28
|
-
case 'TypeScript':
|
|
29
|
-
return 'typescript';
|
|
30
|
-
case 'HTML':
|
|
31
|
-
return 'html';
|
|
32
29
|
case 'CSS':
|
|
33
30
|
case 'LESS':
|
|
34
31
|
case 'SCSS':
|
|
35
32
|
case 'SASS':
|
|
36
33
|
return 'css';
|
|
37
34
|
default:
|
|
38
|
-
return
|
|
35
|
+
return codeType.toLowerCase();
|
|
39
36
|
}
|
|
40
37
|
}
|
|
@@ -1,16 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.variablePresentation = exports.typeAliasPresentation = exports.methodPresentation = void 0;
|
|
3
|
+
exports.variablePresentation = exports.typeAliasPresentation = exports.functionPresentation = exports.methodPresentation = exports.constructorPresentation = void 0;
|
|
4
|
+
const core_1 = require("@ng-doc/core");
|
|
5
|
+
const ts_morph_1 = require("ts-morph");
|
|
6
|
+
const format_code_1 = require("./format-code");
|
|
4
7
|
const typescript_1 = require("./typescript");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param constructor
|
|
11
|
+
*/
|
|
12
|
+
function constructorPresentation(constructor) {
|
|
13
|
+
const parameters = constructor.getParameters().map(parameterPresentation).join(', \n ');
|
|
14
|
+
const presentation = [
|
|
15
|
+
scopePresentation(constructor),
|
|
16
|
+
`constructor(\n ${parameters}\n):`,
|
|
17
|
+
(0, typescript_1.displayType)(constructor.getReturnType()),
|
|
18
|
+
]
|
|
19
|
+
.filter(core_1.isPresent)
|
|
20
|
+
.join(' ');
|
|
21
|
+
return (0, format_code_1.formatCode)(presentation, 'TypeScript');
|
|
22
|
+
}
|
|
23
|
+
exports.constructorPresentation = constructorPresentation;
|
|
5
24
|
/**
|
|
6
25
|
*
|
|
7
26
|
* @param method
|
|
8
27
|
*/
|
|
9
28
|
function methodPresentation(method) {
|
|
10
29
|
const parameters = method.getParameters().map(parameterPresentation).join(', ');
|
|
11
|
-
return
|
|
30
|
+
return [scopePresentation(method), `${method.getName()}(${parameters}):`, `${(0, typescript_1.displayType)(method.getReturnType())};`]
|
|
31
|
+
.filter(core_1.isPresent)
|
|
32
|
+
.join(' ');
|
|
12
33
|
}
|
|
13
34
|
exports.methodPresentation = methodPresentation;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param fnc
|
|
38
|
+
*/
|
|
39
|
+
function functionPresentation(fnc) {
|
|
40
|
+
const parameters = fnc.getParameters().map(parameterPresentation).join(', ');
|
|
41
|
+
return ['function', `${fnc.getName()}(${parameters}):`, `${(0, typescript_1.displayType)(fnc.getReturnType())};`]
|
|
42
|
+
.filter(core_1.isPresent)
|
|
43
|
+
.join(' ');
|
|
44
|
+
}
|
|
45
|
+
exports.functionPresentation = functionPresentation;
|
|
14
46
|
/**
|
|
15
47
|
*
|
|
16
48
|
* @param typeAlias
|
|
@@ -24,7 +56,13 @@ exports.typeAliasPresentation = typeAliasPresentation;
|
|
|
24
56
|
* @param variable
|
|
25
57
|
*/
|
|
26
58
|
function variablePresentation(variable) {
|
|
27
|
-
return
|
|
59
|
+
return [
|
|
60
|
+
variable.getVariableStatement()?.getDeclarationKind() ?? 'const',
|
|
61
|
+
`${variable.getName()}:`,
|
|
62
|
+
`${(0, typescript_1.displayType)(variable.getType())};`,
|
|
63
|
+
]
|
|
64
|
+
.filter(core_1.isPresent)
|
|
65
|
+
.join(' ');
|
|
28
66
|
}
|
|
29
67
|
exports.variablePresentation = variablePresentation;
|
|
30
68
|
/**
|
|
@@ -32,5 +70,39 @@ exports.variablePresentation = variablePresentation;
|
|
|
32
70
|
* @param parameter
|
|
33
71
|
*/
|
|
34
72
|
function parameterPresentation(parameter) {
|
|
35
|
-
return
|
|
73
|
+
return [
|
|
74
|
+
parameter.hasOverrideKeyword() ? 'override' : '',
|
|
75
|
+
decoratorsPresentation(parameter),
|
|
76
|
+
scopePresentation(parameter),
|
|
77
|
+
modPresentation(parameter),
|
|
78
|
+
parameter.getName() + (parameter.hasQuestionToken() ? '?' : '') + ':',
|
|
79
|
+
(0, typescript_1.displayType)(parameter.getType()),
|
|
80
|
+
parameter.getInitializer() ? `= ${parameter.getInitializer()}` : '',
|
|
81
|
+
]
|
|
82
|
+
.filter(core_1.isPresent)
|
|
83
|
+
.join(' ');
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param node
|
|
88
|
+
*/
|
|
89
|
+
function scopePresentation(node) {
|
|
90
|
+
return (node.getScope && node.getScope()?.replace(ts_morph_1.Scope.Public, '')) ?? '';
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @param node
|
|
95
|
+
*/
|
|
96
|
+
function modPresentation(node) {
|
|
97
|
+
return (node.isReadonly && node.isReadonly() && 'readonly') || '';
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param node
|
|
102
|
+
*/
|
|
103
|
+
function decoratorsPresentation(node) {
|
|
104
|
+
return node
|
|
105
|
+
.getDecorators()
|
|
106
|
+
.map((d) => `@${d.getName()}()`)
|
|
107
|
+
.join(' ');
|
|
36
108
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findBaseClass = void 0;
|
|
4
|
+
const for_all_classes_1 = require("./for-all-classes");
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param cls
|
|
8
|
+
* @param condition
|
|
9
|
+
*/
|
|
10
|
+
function findBaseClass(cls, condition) {
|
|
11
|
+
let baseClass;
|
|
12
|
+
(0, for_all_classes_1.forAllClasses)(cls, (c) => {
|
|
13
|
+
if (c !== cls && condition(c)) {
|
|
14
|
+
baseClass = c;
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
});
|
|
19
|
+
return baseClass;
|
|
20
|
+
}
|
|
21
|
+
exports.findBaseClass = findBaseClass;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findClass = void 0;
|
|
4
|
+
const for_all_classes_1 = require("./for-all-classes");
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param cls
|
|
8
|
+
* @param condition
|
|
9
|
+
*/
|
|
10
|
+
function findClass(cls, condition) {
|
|
11
|
+
let baseClass;
|
|
12
|
+
(0, for_all_classes_1.forAllClasses)(cls, (c) => {
|
|
13
|
+
if (condition(c)) {
|
|
14
|
+
baseClass = c;
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
});
|
|
19
|
+
return baseClass;
|
|
20
|
+
}
|
|
21
|
+
exports.findClass = findClass;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.forAllClasses = void 0;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param cls
|
|
7
|
+
* @param fn
|
|
8
|
+
*/
|
|
9
|
+
function forAllClasses(cls, fn) {
|
|
10
|
+
let baseClass = cls;
|
|
11
|
+
while (baseClass && !fn(baseClass)) {
|
|
12
|
+
baseClass = baseClass.getBaseClass();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.forAllClasses = forAllClasses;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./find-base-class"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./find-class"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./for-all-classes"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firstNodeWithComment = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Returns first node that has JSDoc comment, will return first node, if there are no comment nodes
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @param nodes
|
|
9
|
+
*/
|
|
10
|
+
function firstNodeWithComment(nodes) {
|
|
11
|
+
return nodes.find((n) => n.getJsDocs().length) ?? nodes[0];
|
|
12
|
+
}
|
|
13
|
+
exports.firstNodeWithComment = firstNodeWithComment;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./class"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./create-project"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./display-type"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./filter-by-scope"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./filter-by-static"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./find-declaration"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./first-node-with-comment"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./interface"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./method"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./node"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./property"), exports);
|