@ng-doc/builder 16.3.6 → 16.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/index.js +14 -11
- package/browser/index.js.map +1 -1
- package/dev-server/index.js +5 -5
- package/dev-server/index.js.map +1 -1
- package/engine/actions/playground.action.js +9 -21
- package/engine/actions/playground.action.js.map +1 -1
- package/engine/build-ng-doc.d.ts +9 -0
- package/engine/build-ng-doc.js +61 -0
- package/engine/build-ng-doc.js.map +1 -0
- package/engine/builder-operators/add-build-candidates.d.ts +8 -0
- package/engine/builder-operators/add-build-candidates.js +27 -0
- package/engine/builder-operators/add-build-candidates.js.map +1 -0
- package/engine/builder-operators/build.d.ts +13 -0
- package/engine/builder-operators/build.js +20 -0
- package/engine/builder-operators/build.js.map +1 -0
- package/engine/builder-operators/collect-garbage.d.ts +8 -0
- package/engine/builder-operators/collect-garbage.js +21 -0
- package/engine/builder-operators/collect-garbage.js.map +1 -0
- package/engine/builder-operators/compile.d.ts +6 -0
- package/engine/builder-operators/compile.js +20 -0
- package/engine/builder-operators/compile.js.map +1 -0
- package/engine/builder-operators/dependency-changes.d.ts +10 -0
- package/engine/builder-operators/dependency-changes.js +25 -0
- package/engine/builder-operators/dependency-changes.js.map +1 -0
- package/engine/builder-operators/emit.d.ts +6 -0
- package/engine/builder-operators/emit.js +14 -0
- package/engine/builder-operators/emit.js.map +1 -0
- package/engine/builder-operators/index.d.ts +8 -0
- package/engine/builder-operators/index.js +12 -0
- package/engine/builder-operators/index.js.map +1 -0
- package/engine/builder-operators/load.d.ts +6 -0
- package/engine/builder-operators/load.js +20 -0
- package/engine/builder-operators/load.js.map +1 -0
- package/engine/builder-operators/post-process.d.ts +13 -0
- package/engine/builder-operators/post-process.js +32 -0
- package/engine/builder-operators/post-process.js.map +1 -0
- package/engine/builder-operators/print-output.d.ts +8 -0
- package/engine/builder-operators/print-output.js +53 -0
- package/engine/builder-operators/print-output.js.map +1 -0
- package/engine/builder-operators/refresh.d.ts +6 -0
- package/engine/builder-operators/refresh.js +20 -0
- package/engine/builder-operators/refresh.js.map +1 -0
- package/engine/builder-operators/task.d.ts +25 -0
- package/engine/builder-operators/task.js +46 -0
- package/engine/builder-operators/task.js.map +1 -0
- package/engine/entities/abstractions/entity.d.ts +18 -16
- package/engine/entities/abstractions/entity.js +21 -19
- package/engine/entities/abstractions/entity.js.map +1 -1
- package/engine/entities/abstractions/file.entity.d.ts +11 -1
- package/engine/entities/abstractions/file.entity.js +32 -13
- package/engine/entities/abstractions/file.entity.js.map +1 -1
- package/engine/entities/abstractions/route.entity.d.ts +9 -1
- package/engine/entities/abstractions/route.entity.js +49 -27
- package/engine/entities/abstractions/route.entity.js.map +1 -1
- package/engine/entities/abstractions/source-file.entity.d.ts +11 -9
- package/engine/entities/abstractions/source-file.entity.js +18 -13
- package/engine/entities/abstractions/source-file.entity.js.map +1 -1
- package/engine/entities/api-page.entity.d.ts +13 -11
- package/engine/entities/api-page.entity.js +41 -28
- package/engine/entities/api-page.entity.js.map +1 -1
- package/engine/entities/api-scope.entity.d.ts +12 -10
- package/engine/entities/api-scope.entity.js +15 -13
- package/engine/entities/api-scope.entity.js.map +1 -1
- package/engine/entities/api.entity.d.ts +5 -5
- package/engine/entities/api.entity.js +18 -17
- package/engine/entities/api.entity.js.map +1 -1
- package/engine/entities/cache/decorators/cached-entity.d.ts +7 -5
- package/engine/entities/cache/decorators/cached-entity.js +11 -16
- package/engine/entities/cache/decorators/cached-entity.js.map +1 -1
- package/engine/entities/category.entity.d.ts +5 -5
- package/engine/entities/category.entity.js +16 -20
- package/engine/entities/category.entity.js.map +1 -1
- package/engine/entities/indexes.entity.d.ts +2 -3
- package/engine/entities/indexes.entity.js +2 -5
- package/engine/entities/indexes.entity.js.map +1 -1
- package/engine/entities/page.entity.d.ts +10 -10
- package/engine/entities/page.entity.js +83 -73
- package/engine/entities/page.entity.js.map +1 -1
- package/engine/entities/skeleton.entity.d.ts +2 -4
- package/engine/entities/skeleton.entity.js +11 -25
- package/engine/entities/skeleton.entity.js.map +1 -1
- package/engine/entity-emitter.d.ts +19 -0
- package/engine/entity-emitter.js +52 -0
- package/engine/entity-emitter.js.map +1 -0
- package/engine/entity-store.d.ts +1 -0
- package/engine/entity-store.js +7 -4
- package/engine/entity-store.js.map +1 -1
- package/engine/functions/build-candidates.js +16 -5
- package/engine/functions/build-candidates.js.map +1 -1
- package/engine/index.d.ts +3 -2
- package/engine/index.js +3 -2
- package/engine/index.js.map +1 -1
- package/engine/nunjucks/extentions/index.d.ts +1 -0
- package/engine/nunjucks/extentions/index.extension.js.map +1 -0
- package/engine/nunjucks/extentions/index.js +5 -0
- package/engine/nunjucks/extentions/index.js.map +1 -0
- package/engine/nunjucks/filters.d.ts +2 -0
- package/engine/{template-filters.js → nunjucks/filters.js} +5 -9
- package/engine/nunjucks/filters.js.map +1 -0
- package/engine/nunjucks/index.d.ts +2 -0
- package/engine/nunjucks/index.js +6 -0
- package/engine/nunjucks/index.js.map +1 -0
- package/engine/nunjucks/render-template.d.ts +8 -0
- package/engine/nunjucks/render-template.js +46 -0
- package/engine/nunjucks/render-template.js.map +1 -0
- package/engine/variables.d.ts +0 -2
- package/engine/variables.js +1 -3
- package/engine/variables.js.map +1 -1
- package/engine/watcher.d.ts +3 -5
- package/engine/watcher.js +13 -9
- package/engine/watcher.js.map +1 -1
- package/helpers/angular/{component-decorator.d.ts → get-component-decorator.d.ts} +1 -1
- package/helpers/angular/{component-decorator.js → get-component-decorator.js} +4 -4
- package/helpers/angular/get-component-decorator.js.map +1 -0
- package/helpers/angular/{directive-decorator.d.ts → get-directive-decorator.d.ts} +1 -1
- package/helpers/angular/{directive-decorator.js → get-directive-decorator.js} +4 -4
- package/helpers/angular/get-directive-decorator.js.map +1 -0
- package/helpers/angular/get-pipe-decorator.d.ts +8 -0
- package/helpers/angular/get-pipe-decorator.js +26 -0
- package/helpers/angular/get-pipe-decorator.js.map +1 -0
- package/helpers/angular/index.d.ts +3 -2
- package/helpers/angular/index.js +3 -2
- package/helpers/angular/index.js.map +1 -1
- package/helpers/angular/is-standalone.js +6 -4
- package/helpers/angular/is-standalone.js.map +1 -1
- package/helpers/build-entity-keyword.d.ts +10 -0
- package/helpers/build-entity-keyword.js +28 -0
- package/helpers/build-entity-keyword.js.map +1 -0
- package/helpers/build-file-entity.js +36 -34
- package/helpers/build-file-entity.js.map +1 -1
- package/helpers/build-indexes.js +43 -40
- package/helpers/build-indexes.js.map +1 -1
- package/helpers/emit-built-output.d.ts +2 -2
- package/helpers/emit-built-output.js +1 -1
- package/helpers/emit-built-output.js.map +1 -1
- package/helpers/entity-type.d.ts +6 -0
- package/helpers/entity-type.js +10 -1
- package/helpers/entity-type.js.map +1 -1
- package/helpers/extract-docs.js +2 -2
- package/helpers/extract-docs.js.map +1 -1
- package/helpers/extract-selectors.js +1 -1
- package/helpers/extract-selectors.js.map +1 -1
- package/helpers/generate-api-entities.js +4 -3
- package/helpers/generate-api-entities.js.map +1 -1
- package/helpers/get-component-asset.js +4 -11
- package/helpers/get-component-asset.js.map +1 -1
- package/helpers/index.d.ts +3 -5
- package/helpers/index.js +3 -5
- package/helpers/index.js.map +1 -1
- package/helpers/playground/build-playground-metadata.d.ts +9 -0
- package/helpers/playground/build-playground-metadata.js +66 -0
- package/helpers/playground/build-playground-metadata.js.map +1 -0
- package/helpers/playground/get-content-for-playground.d.ts +8 -0
- package/helpers/playground/get-content-for-playground.js +39 -0
- package/helpers/playground/get-content-for-playground.js.map +1 -0
- package/helpers/playground/get-playground-by-id.js.map +1 -0
- package/helpers/playground/get-playground-inputs.d.ts +12 -0
- package/helpers/playground/get-playground-inputs.js +72 -0
- package/helpers/playground/get-playground-inputs.js.map +1 -0
- package/helpers/playground/get-playground-template-inputs.d.ts +7 -0
- package/helpers/playground/get-playground-template-inputs.js +17 -0
- package/helpers/playground/get-playground-template-inputs.js.map +1 -0
- package/helpers/playground/get-playgrounds-expression.js.map +1 -0
- package/helpers/playground/get-playgrounds-ids.js.map +1 -0
- package/helpers/playground/get-target-for-playground.d.ts +8 -0
- package/helpers/playground/get-target-for-playground.js +26 -0
- package/helpers/playground/get-target-for-playground.js.map +1 -0
- package/helpers/playground/get-template-for-playground.d.ts +8 -0
- package/helpers/playground/get-template-for-playground.js +22 -0
- package/helpers/playground/get-template-for-playground.js.map +1 -0
- package/helpers/playground/index.d.ts +9 -0
- package/helpers/playground/index.js +13 -0
- package/helpers/playground/index.js.map +1 -0
- package/helpers/print.d.ts +24 -0
- package/helpers/print.js +46 -0
- package/helpers/print.js.map +1 -0
- package/helpers/process-html.d.ts +9 -2
- package/helpers/process-html.js +29 -10
- package/helpers/process-html.js.map +1 -1
- package/helpers/typescript/accessor/group-accessors.js +2 -2
- package/helpers/typescript/accessor/group-accessors.js.map +1 -1
- package/helpers/typescript/create-project.js +1 -18
- package/helpers/typescript/create-project.js.map +1 -1
- package/interfaces/entity-keyword.d.ts +5 -0
- package/interfaces/entity-keyword.js +3 -0
- package/interfaces/entity-keyword.js.map +1 -0
- package/interfaces/index.d.ts +3 -1
- package/interfaces/index.js +3 -1
- package/interfaces/index.js.map +1 -1
- package/interfaces/output.d.ts +6 -0
- package/interfaces/{built-output.js → output.js} +1 -1
- package/interfaces/output.js.map +1 -0
- package/interfaces/playground-metadata.d.ts +12 -0
- package/interfaces/playground-metadata.js +3 -0
- package/interfaces/playground-metadata.js.map +1 -0
- package/operators/error-handler.d.ts +8 -0
- package/operators/error-handler.js +22 -0
- package/operators/error-handler.js.map +1 -0
- package/package.json +3 -3
- package/schematics/api/index.js +1 -1
- package/schematics/api/index.js.map +1 -1
- package/schematics/category/index.js +1 -1
- package/schematics/category/index.js.map +1 -1
- package/schematics/migrations/standalone-pages/index.js +2 -9
- package/schematics/migrations/standalone-pages/index.js.map +1 -1
- package/schematics/page/index.js +1 -7
- package/schematics/page/index.js.map +1 -1
- package/templates/helpers/accessor.html.nunj +2 -1
- package/templates/helpers/constructor.html.nunj +1 -1
- package/templates/helpers/members.html.nunj +2 -1
- package/templates/helpers/method.html.nunj +1 -1
- package/templates/helpers/parameters.html.nunj +2 -2
- package/templates/helpers/properties.html.nunj +1 -1
- package/templates/playgrounds.ts.nunj +15 -19
- package/engine/builder.d.ts +0 -23
- package/engine/builder.js +0 -125
- package/engine/builder.js.map +0 -1
- package/engine/entity-life-cycle.d.ts +0 -15
- package/engine/entity-life-cycle.js +0 -32
- package/engine/entity-life-cycle.js.map +0 -1
- package/engine/extentions/index.extension.js.map +0 -1
- package/engine/renderer.d.ts +0 -7
- package/engine/renderer.js +0 -49
- package/engine/renderer.js.map +0 -1
- package/engine/template-filters.d.ts +0 -2
- package/engine/template-filters.js.map +0 -1
- package/helpers/angular/component-decorator.js.map +0 -1
- package/helpers/angular/directive-decorator.js.map +0 -1
- package/helpers/get-playground-by-id.js.map +0 -1
- package/helpers/get-playground-properties.d.ts +0 -25
- package/helpers/get-playground-properties.js +0 -113
- package/helpers/get-playground-properties.js.map +0 -1
- package/helpers/get-playground-targets.d.ts +0 -6
- package/helpers/get-playground-targets.js +0 -21
- package/helpers/get-playground-targets.js.map +0 -1
- package/helpers/get-playgrounds-expression.js.map +0 -1
- package/helpers/get-playgrounds-ids.js.map +0 -1
- package/helpers/print-progress.d.ts +0 -6
- package/helpers/print-progress.js +0 -19
- package/helpers/print-progress.js.map +0 -1
- package/interfaces/built-output.d.ts +0 -4
- package/interfaces/built-output.js.map +0 -1
- /package/engine/{extentions → nunjucks/extentions}/index.extension.d.ts +0 -0
- /package/engine/{extentions → nunjucks/extentions}/index.extension.js +0 -0
- /package/helpers/{get-playground-by-id.d.ts → playground/get-playground-by-id.d.ts} +0 -0
- /package/helpers/{get-playground-by-id.js → playground/get-playground-by-id.js} +0 -0
- /package/helpers/{get-playgrounds-expression.d.ts → playground/get-playgrounds-expression.d.ts} +0 -0
- /package/helpers/{get-playgrounds-expression.js → playground/get-playgrounds-expression.js} +0 -0
- /package/helpers/{get-playgrounds-ids.d.ts → playground/get-playgrounds-ids.d.ts} +0 -0
- /package/helpers/{get-playgrounds-ids.js → playground/get-playgrounds-ids.js} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printOutput = void 0;
|
|
4
|
+
const operators_1 = require("rxjs/operators");
|
|
5
|
+
const helpers_1 = require("../../helpers");
|
|
6
|
+
/**
|
|
7
|
+
* Prints all errors and warnings existing in the store
|
|
8
|
+
*
|
|
9
|
+
* @param store - The store to print warnings and errors from
|
|
10
|
+
*/
|
|
11
|
+
function printOutput(store) {
|
|
12
|
+
return (source) => source.pipe((0, operators_1.tap)(() => {
|
|
13
|
+
const entitiesWithErrors = store.getAllWithErrorsOrWarnings().sort(sortEntities);
|
|
14
|
+
if (entitiesWithErrors.length > 0) {
|
|
15
|
+
(0, helpers_1.printError)(`NgDoc: ${entitiesWithErrors.length} entities with problems:`);
|
|
16
|
+
entitiesWithErrors.forEach((entity) => {
|
|
17
|
+
const printIdFunc = entity.errors.length ? helpers_1.printError : helpers_1.printWarning;
|
|
18
|
+
printIdFunc(` ${entity.id}:`);
|
|
19
|
+
entity.warnings.forEach((error, i) => {
|
|
20
|
+
const isLast = i === entity.warnings.length - 1 && !entity.errors.length;
|
|
21
|
+
(0, helpers_1.printWarning)(` ${error.message}${isLast ? '\n' : ''}`);
|
|
22
|
+
});
|
|
23
|
+
entity.errors.forEach((error, i) => {
|
|
24
|
+
const isLast = i === entity.errors.length - 1;
|
|
25
|
+
(0, helpers_1.printError)(` ${error}${isLast ? '\n' : ''}`);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
exports.printOutput = printOutput;
|
|
32
|
+
/**
|
|
33
|
+
* Sorts entities by errors and warnings
|
|
34
|
+
*
|
|
35
|
+
* @param a - The first entity to compare
|
|
36
|
+
* @param b - The second entity to compare
|
|
37
|
+
*/
|
|
38
|
+
function sortEntities(a, b) {
|
|
39
|
+
if (a.errors.length && !b.errors.length) {
|
|
40
|
+
return -1;
|
|
41
|
+
}
|
|
42
|
+
if (!a.errors.length && b.errors.length) {
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
if (a.warnings.length && !b.warnings.length) {
|
|
46
|
+
return -1;
|
|
47
|
+
}
|
|
48
|
+
if (!a.warnings.length && b.warnings.length) {
|
|
49
|
+
return 1;
|
|
50
|
+
}
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=print-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-output.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/builder-operators/print-output.ts"],"names":[],"mappings":";;;AACA,8CAAmC;AAEnC,2CAAuD;AAIvD;;;;GAIG;AACH,SAAgB,WAAW,CAAI,KAAuB;IACrD,OAAO,CAAC,MAAqB,EAAE,EAAE,CAChC,MAAM,CAAC,IAAI,CACV,IAAA,eAAG,EAAC,GAAG,EAAE;QACR,MAAM,kBAAkB,GAAkB,KAAK,CAAC,0BAA0B,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEhG,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;YAClC,IAAA,oBAAU,EAAC,UAAU,kBAAkB,CAAC,MAAM,0BAA0B,CAAC,CAAC;YAE1E,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAmB,EAAE,EAAE;gBAClD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAU,CAAC,CAAC,CAAC,sBAAY,CAAC;gBAErE,WAAW,CAAC,KAAK,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;gBAE/B,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAY,EAAE,CAAS,EAAE,EAAE;oBACnD,MAAM,MAAM,GAAY,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM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"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refresh = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const helpers_1 = require("../../helpers");
|
|
7
|
+
const error_handler_1 = require("../../operators/error-handler");
|
|
8
|
+
/**
|
|
9
|
+
* Operator that runs the `emit` method of the entity.
|
|
10
|
+
*/
|
|
11
|
+
function refresh() {
|
|
12
|
+
return (source) => source.pipe((0, operators_1.switchMap)((e) => {
|
|
13
|
+
if ((0, helpers_1.isSourceFileEntity)(e) && !e.destroyed) {
|
|
14
|
+
return e.refresh().pipe((0, operators_1.map)(() => e), (0, error_handler_1.errorHandler)(e));
|
|
15
|
+
}
|
|
16
|
+
return (0, rxjs_1.of)(e);
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
exports.refresh = refresh;
|
|
20
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/builder-operators/refresh.ts"],"names":[],"mappings":";;;AAAA,+BAAsD;AACtD,8CAA8C;AAE9C,2CAAiD;AACjD,iEAA2D;AAG3D;;GAEG;AACH,SAAgB,OAAO;IACtB,OAAO,CAAC,MAA+B,EAAE,EAAE,CAC1C,MAAM,CAAC,IAAI,CACV,IAAA,qBAAS,EAAC,CAAC,CAAc,EAAE,EAAE;QAC5B,IAAI,IAAA,4BAAkB,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE;YAC1C,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CACtB,IAAA,eAAG,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EACZ,IAAA,4BAAY,EAAC,CAAC,CAAC,CACf,CAAC;SACF;QAED,OAAO,IAAA,SAAE,EAAC,CAAC,CAAC,CAAC;IACd,CAAC,CAAC,CACF,CAAC;AACJ,CAAC;AAdD,0BAcC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OperatorFunction } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Task operator that runs the provided operator on each value of the source.
|
|
4
|
+
* It also filters the values if the filter function is provided, shows the progress and handles the errors.
|
|
5
|
+
*
|
|
6
|
+
* The operator will be executed for each value that passes the filter function,
|
|
7
|
+
* and return the values in the same order as they were in the source.
|
|
8
|
+
*
|
|
9
|
+
* @param name - The name of the task (for progress).
|
|
10
|
+
* @param operator - The operator to run on each value of the source.
|
|
11
|
+
* @param filter - The filter function to filter the values of the source.
|
|
12
|
+
*/
|
|
13
|
+
export declare function task<T, R>(name: string, operator: OperatorFunction<T, R>, filter?: (value: T) => boolean): OperatorFunction<T[], R[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Task operator that runs the provided operator on the source with all the values.
|
|
16
|
+
* It also filters the values if the filter function is provided, shows the progress and handles the errors.
|
|
17
|
+
*
|
|
18
|
+
* The operator will be executed for each value that passes the filter function,
|
|
19
|
+
* and return the values in the same order as they were in the source.
|
|
20
|
+
*
|
|
21
|
+
* @param name - The name of the task (for progress).
|
|
22
|
+
* @param operator - The operator to run on the source.
|
|
23
|
+
* @param filter - The filter function to filter the values of the source.
|
|
24
|
+
*/
|
|
25
|
+
export declare function taskForMany<T, R>(name: string, operator: OperatorFunction<T[], R[]>, filter?: (value: T) => boolean): OperatorFunction<T[], R[]>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.taskForMany = exports.task = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("../../operators");
|
|
6
|
+
/**
|
|
7
|
+
* Task operator that runs the provided operator on each value of the source.
|
|
8
|
+
* It also filters the values if the filter function is provided, shows the progress and handles the errors.
|
|
9
|
+
*
|
|
10
|
+
* The operator will be executed for each value that passes the filter function,
|
|
11
|
+
* and return the values in the same order as they were in the source.
|
|
12
|
+
*
|
|
13
|
+
* @param name - The name of the task (for progress).
|
|
14
|
+
* @param operator - The operator to run on each value of the source.
|
|
15
|
+
* @param filter - The filter function to filter the values of the source.
|
|
16
|
+
*/
|
|
17
|
+
function task(name, operator, filter) {
|
|
18
|
+
return (source) => {
|
|
19
|
+
return source.pipe((0, operators_1.progress)(name), (0, rxjs_1.mergeMap)((values) => {
|
|
20
|
+
const filtered = filter ? values.filter(filter) : values;
|
|
21
|
+
return (0, operators_1.forkJoinOrEmpty)(filtered.map((v) => (0, rxjs_1.of)(v).pipe(operator)));
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.task = task;
|
|
26
|
+
/**
|
|
27
|
+
* Task operator that runs the provided operator on the source with all the values.
|
|
28
|
+
* It also filters the values if the filter function is provided, shows the progress and handles the errors.
|
|
29
|
+
*
|
|
30
|
+
* The operator will be executed for each value that passes the filter function,
|
|
31
|
+
* and return the values in the same order as they were in the source.
|
|
32
|
+
*
|
|
33
|
+
* @param name - The name of the task (for progress).
|
|
34
|
+
* @param operator - The operator to run on the source.
|
|
35
|
+
* @param filter - The filter function to filter the values of the source.
|
|
36
|
+
*/
|
|
37
|
+
function taskForMany(name, operator, filter) {
|
|
38
|
+
return (source) => {
|
|
39
|
+
return source.pipe((0, operators_1.progress)(name), (0, rxjs_1.mergeMap)((values) => {
|
|
40
|
+
const filtered = filter ? values.filter(filter) : values;
|
|
41
|
+
return (0, rxjs_1.of)(filtered).pipe(operator);
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.taskForMany = taskForMany;
|
|
46
|
+
//# sourceMappingURL=task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/builder-operators/task.ts"],"names":[],"mappings":";;;AAAA,+BAAoD;AAEpD,+CAA0D;AAE1D;;;;;;;;;;GAUG;AACH,SAAgB,IAAI,CACnB,IAAY,EACZ,QAAgC,EAChC,MAA8B;IAE9B,OAAO,CAAC,MAAM,EAAE,EAAE;QACjB,OAAO,MAAM,CAAC,IAAI,CACjB,IAAA,oBAAQ,EAAC,IAAI,CAAC,EACd,IAAA,eAAQ,EAAC,CAAC,MAAM,EAAE,EAAE;YACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAEzD,OAAO,IAAA,2BAAe,EAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,SAAE,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC,CAAC,CACF,CAAC;IACH,CAAC,CAAC;AACH,CAAC;AAfD,oBAeC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,WAAW,CAC1B,IAAY,EACZ,QAAoC,EACpC,MAA8B;IAE9B,OAAO,CAAC,MAAM,EAAE,EAAE;QACjB,OAAO,MAAM,CAAC,IAAI,CACjB,IAAA,oBAAQ,EAAC,IAAI,CAAC,EACd,IAAA,eAAQ,EAAC,CAAC,MAAM,EAAE,EAAE;YACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAEzD,OAAO,IAAA,SAAE,EAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC,CAAC,CACF,CAAC;IACH,CAAC,CAAC;AACH,CAAC;AAfD,kCAeC"}
|
|
@@ -2,13 +2,15 @@ import { logging } from '@angular-devkit/core';
|
|
|
2
2
|
import { NgDocPageIndex } from '@ng-doc/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ObservableSet } from '../../../classes';
|
|
5
|
-
import { NgDocBuilderContext,
|
|
6
|
-
import {
|
|
5
|
+
import { NgDocBuilderContext, NgDocBuildOutput } from '../../../interfaces';
|
|
6
|
+
import { NgDocEntityStore } from '../../entity-store';
|
|
7
|
+
import { NgDocCache } from '../cache';
|
|
7
8
|
/**
|
|
8
9
|
* Base entity class that all entities should extend.
|
|
9
10
|
*/
|
|
10
11
|
export declare abstract class NgDocEntity {
|
|
11
|
-
readonly
|
|
12
|
+
readonly store: NgDocEntityStore;
|
|
13
|
+
readonly cache: NgDocCache;
|
|
12
14
|
readonly context: NgDocBuilderContext;
|
|
13
15
|
/**
|
|
14
16
|
* The key by which the entity will be stored in the store
|
|
@@ -39,9 +41,15 @@ export declare abstract class NgDocEntity {
|
|
|
39
41
|
* NgDoc destroys all child elements of non-physical entities when they are destroyed
|
|
40
42
|
*/
|
|
41
43
|
readonly physical: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* List of errors that were occurred during the build process
|
|
46
|
+
*/
|
|
47
|
+
errors: Error[];
|
|
48
|
+
/**
|
|
49
|
+
* List of warnings that were occurred during the build process
|
|
50
|
+
*/
|
|
51
|
+
warnings: Error[];
|
|
42
52
|
private destroy$;
|
|
43
|
-
/** Indicates when current entity could be built */
|
|
44
|
-
protected readyToBuild: boolean;
|
|
45
53
|
/**
|
|
46
54
|
* Files that are watched for changes to rebuild entity or remove it
|
|
47
55
|
*/
|
|
@@ -58,9 +66,9 @@ export declare abstract class NgDocEntity {
|
|
|
58
66
|
* Should return the list of the dependencies that have to be built if current entity was changed.
|
|
59
67
|
*/
|
|
60
68
|
abstract readonly buildCandidates: NgDocEntity[];
|
|
61
|
-
constructor(
|
|
62
|
-
/** Indicates
|
|
63
|
-
get canBeBuilt(): boolean;
|
|
69
|
+
constructor(store: NgDocEntityStore, cache: NgDocCache, context: NgDocBuilderContext);
|
|
70
|
+
/** Indicates when current entity could be built */
|
|
71
|
+
protected get canBeBuilt(): boolean;
|
|
64
72
|
/**
|
|
65
73
|
* Recursively returns parents for the current entity
|
|
66
74
|
*
|
|
@@ -90,7 +98,6 @@ export declare abstract class NgDocEntity {
|
|
|
90
98
|
get hasChildren(): boolean;
|
|
91
99
|
/**
|
|
92
100
|
* Should return if this entity is ready to build
|
|
93
|
-
* Using for build process to skip entityStore that is not ready for build
|
|
94
101
|
*
|
|
95
102
|
* @type {boolean}
|
|
96
103
|
*/
|
|
@@ -101,18 +108,13 @@ export declare abstract class NgDocEntity {
|
|
|
101
108
|
* Build all artifacts that need for application.
|
|
102
109
|
* This is the last method in the build process, should return output that should be emitted to the file system
|
|
103
110
|
*/
|
|
104
|
-
protected abstract
|
|
105
|
-
/**
|
|
106
|
-
* Runs when the source file was updated, can be used to refresh target file etc.
|
|
107
|
-
*/
|
|
108
|
-
abstract update(): Observable<void>;
|
|
111
|
+
protected abstract buildImpl(): Observable<NgDocBuildOutput[]>;
|
|
109
112
|
/**
|
|
110
113
|
* Method called by NgDocBuilder when one or more dependencies have changed
|
|
111
114
|
*/
|
|
112
115
|
dependenciesChanged(): void;
|
|
113
116
|
childrenGenerator(): Observable<NgDocEntity[]>;
|
|
114
|
-
|
|
115
|
-
emit(): Observable<void>;
|
|
117
|
+
build(): Observable<NgDocBuildOutput[]>;
|
|
116
118
|
removeArtifacts(): void;
|
|
117
119
|
/**
|
|
118
120
|
* Destroys current entity and clear all references
|
|
@@ -20,8 +20,9 @@ exports.NgDocEntity = (() => {
|
|
|
20
20
|
let _potentialKeywords_initializers = [];
|
|
21
21
|
let _get_cachedFilePaths_decorators;
|
|
22
22
|
return _a = class NgDocEntity {
|
|
23
|
-
constructor(
|
|
24
|
-
this.
|
|
23
|
+
constructor(store, cache, context) {
|
|
24
|
+
this.store = (tslib_1.__runInitializers(this, _instanceExtraInitializers), store);
|
|
25
|
+
this.cache = cache;
|
|
25
26
|
this.context = context;
|
|
26
27
|
/** Indicates when entity was destroyed */
|
|
27
28
|
this.destroyed = false;
|
|
@@ -48,11 +49,17 @@ exports.NgDocEntity = (() => {
|
|
|
48
49
|
* NgDoc destroys all child elements of non-physical entities when they are destroyed
|
|
49
50
|
*/
|
|
50
51
|
this.physical = true;
|
|
52
|
+
/**
|
|
53
|
+
* List of errors that were occurred during the build process
|
|
54
|
+
*/
|
|
55
|
+
this.errors = [];
|
|
56
|
+
/**
|
|
57
|
+
* List of warnings that were occurred during the build process
|
|
58
|
+
*/
|
|
59
|
+
this.warnings = [];
|
|
51
60
|
this.destroy$ = new rxjs_1.Subject();
|
|
52
|
-
/** Indicates when current entity could be built */
|
|
53
|
-
this.readyToBuild = false;
|
|
54
61
|
}
|
|
55
|
-
/** Indicates
|
|
62
|
+
/** Indicates when current entity could be built */
|
|
56
63
|
get canBeBuilt() {
|
|
57
64
|
return true;
|
|
58
65
|
}
|
|
@@ -70,7 +77,7 @@ exports.NgDocEntity = (() => {
|
|
|
70
77
|
* Contains all children of the current entity.
|
|
71
78
|
*/
|
|
72
79
|
get children() {
|
|
73
|
-
return this.
|
|
80
|
+
return this.store.asArray().filter((entity) => entity.parent === this && !entity.destroyed);
|
|
74
81
|
}
|
|
75
82
|
/**
|
|
76
83
|
* Returns children that are ready to build or already built
|
|
@@ -96,12 +103,11 @@ exports.NgDocEntity = (() => {
|
|
|
96
103
|
}
|
|
97
104
|
/**
|
|
98
105
|
* Should return if this entity is ready to build
|
|
99
|
-
* Using for build process to skip entityStore that is not ready for build
|
|
100
106
|
*
|
|
101
107
|
* @type {boolean}
|
|
102
108
|
*/
|
|
103
109
|
get isReadyForBuild() {
|
|
104
|
-
return this.
|
|
110
|
+
return !this.destroyed && !this.errors.length && this.canBeBuilt;
|
|
105
111
|
}
|
|
106
112
|
get logger() {
|
|
107
113
|
return this.context.context.logger;
|
|
@@ -113,26 +119,23 @@ exports.NgDocEntity = (() => {
|
|
|
113
119
|
* Method called by NgDocBuilder when one or more dependencies have changed
|
|
114
120
|
*/
|
|
115
121
|
dependenciesChanged() {
|
|
116
|
-
|
|
122
|
+
// Reset error and warnings, because dependency changes could fix them
|
|
123
|
+
this.warnings = [];
|
|
124
|
+
this.errors = [];
|
|
117
125
|
}
|
|
118
126
|
childrenGenerator() {
|
|
119
127
|
return (0, rxjs_1.of)([]);
|
|
120
128
|
}
|
|
121
|
-
|
|
129
|
+
build() {
|
|
122
130
|
// Clear all indexes and used keywords before build
|
|
123
131
|
this.usedKeywords.clear();
|
|
124
132
|
this.potentialKeywords.clear();
|
|
125
133
|
this.indexes = [];
|
|
126
|
-
return this.
|
|
127
|
-
|
|
128
|
-
this.
|
|
129
|
-
return (0, rxjs_1.of)([]);
|
|
134
|
+
return this.buildImpl().pipe((0, operators_1.tap)({
|
|
135
|
+
next: () => this.cache.cache(this),
|
|
136
|
+
error: (e) => this.errors.push(e),
|
|
130
137
|
}));
|
|
131
138
|
}
|
|
132
|
-
emit() {
|
|
133
|
-
// No implementation
|
|
134
|
-
return (0, rxjs_1.of)(void 0);
|
|
135
|
-
}
|
|
136
139
|
removeArtifacts() {
|
|
137
140
|
// No implementation
|
|
138
141
|
}
|
|
@@ -143,7 +146,6 @@ exports.NgDocEntity = (() => {
|
|
|
143
146
|
*/
|
|
144
147
|
destroy() {
|
|
145
148
|
this.children.forEach((entity) => !entity.physical && entity.destroy());
|
|
146
|
-
this.readyToBuild = false;
|
|
147
149
|
this.destroyed = true;
|
|
148
150
|
this.destroy$.next();
|
|
149
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/entities/abstractions/entity.ts"],"names":[],"mappings":";;;;AAEA,+BAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/entities/abstractions/entity.ts"],"names":[],"mappings":";;;;AAEA,+BAA6C;AAC7C,8CAAyC;AAEzC,8CAA+C;AAI/C,oDAAsE;AAEtE;;GAEG;AACmB,QAAA,WAAW;;;;;;;;;;sBAAX,WAAW;YA8EhC,YAAqB,KAAuB,EAAW,KA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AAkC"}
|
|
@@ -11,8 +11,18 @@ export declare abstract class NgDocFileEntity<T> extends NgDocSourceFileEntity {
|
|
|
11
11
|
* Entity target.
|
|
12
12
|
*/
|
|
13
13
|
target?: T;
|
|
14
|
-
|
|
14
|
+
protected refreshImpl(): Observable<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Runs when the source file was updated, can be used to load target file.
|
|
17
|
+
*/
|
|
18
|
+
protected loadImpl(): Observable<void>;
|
|
15
19
|
protected getParentFromCategory(): NgDocCategoryEntity | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Compiles the source file
|
|
22
|
+
*/
|
|
23
|
+
compile(): Observable<void>;
|
|
24
|
+
load(): Observable<void>;
|
|
25
|
+
setParentDynamically(): void;
|
|
16
26
|
destroy(): void;
|
|
17
27
|
removeArtifacts(): void;
|
|
18
28
|
}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const minimatch_1 = require("minimatch");
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
7
|
const rxjs_1 = require("rxjs");
|
|
8
|
+
const operators_1 = require("rxjs/operators");
|
|
8
9
|
const ts_morph_1 = require("ts-morph");
|
|
9
10
|
const helpers_1 = require("../../../helpers");
|
|
10
11
|
const variables_1 = require("../../variables");
|
|
@@ -13,31 +14,49 @@ const source_file_entity_1 = require("./source-file.entity");
|
|
|
13
14
|
* Entity for file end points that generate modules and components.
|
|
14
15
|
*/
|
|
15
16
|
class NgDocFileEntity extends source_file_entity_1.NgDocSourceFileEntity {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
refreshImpl() {
|
|
18
|
+
return super
|
|
19
|
+
.refreshImpl()
|
|
20
|
+
.pipe((0, operators_1.tap)(() => (this.objectExpression = (0, helpers_1.getObjectExpressionFromDefault)(this.sourceFile))));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Runs when the source file was updated, can be used to load target file.
|
|
24
|
+
*/
|
|
25
|
+
loadImpl() {
|
|
26
|
+
return (0, rxjs_1.defer)(() => {
|
|
19
27
|
delete require.cache[require.resolve(this.pathToCompiledFile)];
|
|
20
28
|
this.target = require(this.pathToCompiledFile).default;
|
|
21
|
-
this.objectExpression = (0, helpers_1.getObjectExpressionFromDefault)(this.sourceFile);
|
|
22
29
|
if (!this.target || !this.objectExpression) {
|
|
23
|
-
new Error(`Failed to load
|
|
30
|
+
new Error(`Failed to load object. Make sure that you have exported it as default.`);
|
|
24
31
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return (0, rxjs_1.throwError)(e);
|
|
28
|
-
}
|
|
29
|
-
this.readyToBuild = true;
|
|
30
|
-
return (0, rxjs_1.of)(void 0);
|
|
32
|
+
return (0, rxjs_1.of)(void 0);
|
|
33
|
+
});
|
|
31
34
|
}
|
|
32
35
|
getParentFromCategory() {
|
|
33
36
|
var _a, _b, _c, _d, _e, _f;
|
|
34
37
|
const sourceFilePath = (_f = (_e = (_d = (_c = (_b = (_a = this.objectExpression) === null || _a === void 0 ? void 0 : _a.getProperty('category')) === null || _b === void 0 ? void 0 : _b.getChildrenOfKind(ts_morph_1.SyntaxKind.Identifier)) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.getDefinitions()[0]) === null || _e === void 0 ? void 0 : _e.getSourceFile()) === null || _f === void 0 ? void 0 : _f.getFilePath();
|
|
35
38
|
if (sourceFilePath && (0, minimatch_1.minimatch)(sourceFilePath, variables_1.CATEGORY_PATTERN) && sourceFilePath !== this.sourceFilePath) {
|
|
36
|
-
const parent = this.
|
|
37
|
-
return (0, helpers_1.isCategoryEntity)(parent) ? parent : undefined;
|
|
39
|
+
const parent = this.store.get(path.relative(this.context.context.workspaceRoot, sourceFilePath));
|
|
40
|
+
return (0, helpers_1.isCategoryEntity)(parent) && parent.isReadyForBuild ? parent : undefined;
|
|
38
41
|
}
|
|
39
42
|
return undefined;
|
|
40
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Compiles the source file
|
|
46
|
+
*/
|
|
47
|
+
compile() {
|
|
48
|
+
return (0, rxjs_1.from)((0, helpers_1.buildFileEntity)(this.sourceFile, this.context.tsConfig, this.context.context.workspaceRoot)).pipe((0, operators_1.map)(() => void 0), (0, operators_1.tap)({
|
|
49
|
+
error: (e) => this.errors.push(e),
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
load() {
|
|
53
|
+
return this.loadImpl().pipe((0, operators_1.tap)({
|
|
54
|
+
error: (e) => this.errors.push(e),
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
setParentDynamically() {
|
|
58
|
+
// No implementation
|
|
59
|
+
}
|
|
41
60
|
destroy() {
|
|
42
61
|
super.destroy();
|
|
43
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/entities/abstractions/file.entity.ts"],"names":[],"mappings":";;;;AAAA,yCAAoC;AACpC,mDAA6B;AAC7B,+
|
|
1
|
+
{"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/entities/abstractions/file.entity.ts"],"names":[],"mappings":";;;;AAAA,yCAAoC;AACpC,mDAA6B;AAC7B,+BAAiD;AACjD,8CAAwC;AACxC,uCAA6D;AAE7D,8CAAmG;AACnG,+CAAiD;AAGjD,6DAA2D;AAE3D;;GAEG;AACH,MAAsB,eAAmB,SAAQ,0CAAqB;IAOlD,WAAW;QAC7B,OAAO,KAAK;aACV,WAAW,EAAE;aACb,IAAI,CAAC,IAAA,eAAG,EAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,GAAG,IAAA,wCAA8B,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED;;OAEG;IACO,QAAQ;QACjB,OAAO,IAAA,YAAK,EAAC,GAAG,EAAE;YACjB,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,O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AAa,CAAC,CAAC,CAAC,IAAI,CAC5G,IAAA,eAAG,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EACjB,IAAA,eAAG,EAAC;YACH,KAAK,EAAE,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SACxC,CAAC,CACF,CAAC;IACH,CAAC;IAED,IAAI;QACH,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAC1B,IAAA,eAAG,EAAC;YACH,KAAK,EAAE,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SACxC,CAAC,CACF,CAAC;IACH,CAAC;IAED,oBAAoB;QACnB,oBAAoB;IACrB,CAAC;IAEQ,OAAO;QACf,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEQ,eAAe;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;CACD;AAhFD,0CAgFC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { NgDocBuildOutput, NgDocEntityKeyword } from '@ng-doc/builder';
|
|
2
|
+
import { NgDocEntityAnchor } from '@ng-doc/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
1
4
|
import { NgDocModuleEntity } from './module.entity';
|
|
2
5
|
export declare abstract class NgDocRouteEntity<T = unknown> extends NgDocModuleEntity<T> {
|
|
3
6
|
/**
|
|
@@ -11,7 +14,11 @@ export declare abstract class NgDocRouteEntity<T = unknown> extends NgDocModuleE
|
|
|
11
14
|
/**
|
|
12
15
|
* Keywords that will be used to create links to the current entity on the pages
|
|
13
16
|
*/
|
|
14
|
-
abstract keywords:
|
|
17
|
+
abstract keywords: NgDocEntityKeyword[];
|
|
18
|
+
/**
|
|
19
|
+
* The list of anchors for the current entity, that can be used to create keywords
|
|
20
|
+
*/
|
|
21
|
+
anchors: NgDocEntityAnchor[];
|
|
15
22
|
/**
|
|
16
23
|
* Url for to the source file to the current page, that can be used to open it in repository and edit
|
|
17
24
|
*/
|
|
@@ -25,4 +32,5 @@ export declare abstract class NgDocRouteEntity<T = unknown> extends NgDocModuleE
|
|
|
25
32
|
* Returns breadcrumbs for the current entity
|
|
26
33
|
*/
|
|
27
34
|
get breadcrumbs(): string[];
|
|
35
|
+
build(): Observable<NgDocBuildOutput[]>;
|
|
28
36
|
}
|
|
@@ -5,32 +5,54 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const core_1 = require("@ng-doc/core");
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
7
|
const helpers_1 = require("../../../helpers");
|
|
8
|
+
const cache_1 = require("../cache");
|
|
8
9
|
const module_entity_1 = require("./module.entity");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
10
|
+
exports.NgDocRouteEntity = (() => {
|
|
11
|
+
var _a;
|
|
12
|
+
let _instanceExtraInitializers = [];
|
|
13
|
+
let _anchors_decorators;
|
|
14
|
+
let _anchors_initializers = [];
|
|
15
|
+
return _a = class NgDocRouteEntity extends module_entity_1.NgDocModuleEntity {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
/**
|
|
19
|
+
* The list of anchors for the current entity, that can be used to create keywords
|
|
20
|
+
*/
|
|
21
|
+
this.anchors = (tslib_1.__runInitializers(this, _instanceExtraInitializers), tslib_1.__runInitializers(this, _anchors_initializers, []));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Url for to the source file to the current page, that can be used to open it in repository and edit
|
|
25
|
+
*/
|
|
26
|
+
get editSourceFileUrl() {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Url for to the source file to the current page, that can be used to open it in repository and view
|
|
31
|
+
*/
|
|
32
|
+
get viewSourceFileUrl() {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
get fullRoute() {
|
|
36
|
+
var _a;
|
|
37
|
+
const parentRoute = this.parent instanceof NgDocRouteEntity ? this.parent.fullRoute : (_a = this.context.config.routePrefix) !== null && _a !== void 0 ? _a : '';
|
|
38
|
+
return (0, helpers_1.slash)(path.join('/', parentRoute, this.route));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns breadcrumbs for the current entity
|
|
42
|
+
*/
|
|
43
|
+
get breadcrumbs() {
|
|
44
|
+
var _a;
|
|
45
|
+
return (0, helpers_1.isRouteEntity)(this.parent) ? [...(0, core_1.asArray)((_a = this === null || this === void 0 ? void 0 : this.parent) === null || _a === void 0 ? void 0 : _a.breadcrumbs), this.title] : [this.title];
|
|
46
|
+
}
|
|
47
|
+
build() {
|
|
48
|
+
this.anchors = [];
|
|
49
|
+
return super.build();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
(() => {
|
|
53
|
+
_anchors_decorators = [(0, cache_1.CachedProperty)()];
|
|
54
|
+
tslib_1.__esDecorate(null, null, _anchors_decorators, { kind: "field", name: "anchors", static: false, private: false, access: { has: obj => "anchors" in obj, get: obj => obj.anchors, set: (obj, value) => { obj.anchors = value; } } }, _anchors_initializers, _instanceExtraInitializers);
|
|
55
|
+
})(),
|
|
56
|
+
_a;
|
|
57
|
+
})();
|
|
36
58
|
//# sourceMappingURL=route.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.entity.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/entities/abstractions/route.entity.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"route.entity.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/entities/abstractions/route.entity.ts"],"names":[],"mappings":";;;;AACA,uCAAwD;AACxD,mDAA6B;AAG7B,8CAAsD;AACtD,oCAAwC;AACxC,mDAAkD;AAE5B,QAAA,gBAAgB;;;;;sBAAhB,gBAA8B,SAAQ,iCAAoB;;;gBAgB/E;;mBAEG;gBAEH,YAAO,wHAAwB,EAAE,GAAC;YAmCnC,CAAC;YAjCA;;eAEG;YACH,IAAI,iBAAiB;gBACpB,OAAO,SAAS,CAAC;YAClB,CAAC;YAED;;eAEG;YACH,IAAI,iBAAiB;gBACpB,OAAO,SAAS,CAAC;YAClB,CAAC;YAED,IAAI,SAAS;;gBACZ,MAAM,WAAW,GAChB,IAAI,CAAC,MAAM,YAAY,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,mCAAI,EAAE,CAAC;gBAEzG,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACvD,CAAC;YAED;;eAEG;YACH,IAAI,WAAW;;gBACd,OAAO,IAAA,uBAAa,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAA,cAAO,EAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAE,WAAW,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxG,CAAC;YAEQ,KAAK;gBACb,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;gBAElB,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;YACtB,CAAC;;;mCAnCA,IAAA,sBAAc,GAAE;YACjB,+KAAA,OAAO,6BAAP,OAAO,oEAA2B"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { SourceFile } from 'ts-morph';
|
|
3
3
|
import { NgDocBuilderContext } from '../../../interfaces';
|
|
4
|
-
import {
|
|
4
|
+
import { NgDocEntityStore } from '../../entity-store';
|
|
5
|
+
import { NgDocCache } from '../cache';
|
|
5
6
|
import { NgDocEntity } from './entity';
|
|
6
7
|
export declare abstract class NgDocSourceFileEntity extends NgDocEntity {
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
8
|
+
readonly store: NgDocEntityStore;
|
|
9
|
+
readonly cache: NgDocCache;
|
|
9
10
|
readonly context: NgDocBuilderContext;
|
|
11
|
+
readonly sourceFile: SourceFile;
|
|
10
12
|
/**
|
|
11
13
|
* The key by which the entity will be stored in the store
|
|
12
14
|
*/
|
|
13
15
|
readonly id: string;
|
|
14
|
-
|
|
15
|
-
* Indicates whether the entity's source file can be compiled
|
|
16
|
-
*/
|
|
17
|
-
readonly compilable: boolean;
|
|
18
|
-
constructor(builder: NgDocBuilder, sourceFile: SourceFile, context: NgDocBuilderContext);
|
|
16
|
+
constructor(store: NgDocEntityStore, cache: NgDocCache, context: NgDocBuilderContext, sourceFile: SourceFile);
|
|
19
17
|
/**
|
|
20
18
|
* Files that are watched for changes to rebuild entity or remove it
|
|
21
19
|
*/
|
|
@@ -32,6 +30,10 @@ export declare abstract class NgDocSourceFileEntity extends NgDocEntity {
|
|
|
32
30
|
* Returns import paths that can be used to import the current source file
|
|
33
31
|
*/
|
|
34
32
|
get pathToCompiledFile(): string;
|
|
35
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Runs when the source file was updated, can be used refresh source file in the typescript project
|
|
35
|
+
*/
|
|
36
|
+
protected refreshImpl(): Observable<void>;
|
|
37
|
+
refresh(): Observable<void>;
|
|
36
38
|
destroy(): void;
|
|
37
39
|
}
|