@ng-doc/builder 16.3.6 → 16.4.1

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.
Files changed (252) hide show
  1. package/browser/index.js +14 -11
  2. package/browser/index.js.map +1 -1
  3. package/dev-server/index.js +5 -5
  4. package/dev-server/index.js.map +1 -1
  5. package/engine/actions/playground.action.js +9 -21
  6. package/engine/actions/playground.action.js.map +1 -1
  7. package/engine/build-ng-doc.d.ts +9 -0
  8. package/engine/build-ng-doc.js +61 -0
  9. package/engine/build-ng-doc.js.map +1 -0
  10. package/engine/builder-operators/add-build-candidates.d.ts +8 -0
  11. package/engine/builder-operators/add-build-candidates.js +27 -0
  12. package/engine/builder-operators/add-build-candidates.js.map +1 -0
  13. package/engine/builder-operators/build.d.ts +13 -0
  14. package/engine/builder-operators/build.js +20 -0
  15. package/engine/builder-operators/build.js.map +1 -0
  16. package/engine/builder-operators/collect-garbage.d.ts +8 -0
  17. package/engine/builder-operators/collect-garbage.js +21 -0
  18. package/engine/builder-operators/collect-garbage.js.map +1 -0
  19. package/engine/builder-operators/compile.d.ts +6 -0
  20. package/engine/builder-operators/compile.js +20 -0
  21. package/engine/builder-operators/compile.js.map +1 -0
  22. package/engine/builder-operators/dependency-changes.d.ts +10 -0
  23. package/engine/builder-operators/dependency-changes.js +25 -0
  24. package/engine/builder-operators/dependency-changes.js.map +1 -0
  25. package/engine/builder-operators/emit.d.ts +6 -0
  26. package/engine/builder-operators/emit.js +14 -0
  27. package/engine/builder-operators/emit.js.map +1 -0
  28. package/engine/builder-operators/index.d.ts +8 -0
  29. package/engine/builder-operators/index.js +12 -0
  30. package/engine/builder-operators/index.js.map +1 -0
  31. package/engine/builder-operators/load.d.ts +6 -0
  32. package/engine/builder-operators/load.js +20 -0
  33. package/engine/builder-operators/load.js.map +1 -0
  34. package/engine/builder-operators/post-process.d.ts +13 -0
  35. package/engine/builder-operators/post-process.js +32 -0
  36. package/engine/builder-operators/post-process.js.map +1 -0
  37. package/engine/builder-operators/print-output.d.ts +8 -0
  38. package/engine/builder-operators/print-output.js +53 -0
  39. package/engine/builder-operators/print-output.js.map +1 -0
  40. package/engine/builder-operators/refresh.d.ts +6 -0
  41. package/engine/builder-operators/refresh.js +20 -0
  42. package/engine/builder-operators/refresh.js.map +1 -0
  43. package/engine/builder-operators/task.d.ts +25 -0
  44. package/engine/builder-operators/task.js +46 -0
  45. package/engine/builder-operators/task.js.map +1 -0
  46. package/engine/entities/abstractions/entity.d.ts +18 -16
  47. package/engine/entities/abstractions/entity.js +21 -19
  48. package/engine/entities/abstractions/entity.js.map +1 -1
  49. package/engine/entities/abstractions/file.entity.d.ts +11 -1
  50. package/engine/entities/abstractions/file.entity.js +32 -13
  51. package/engine/entities/abstractions/file.entity.js.map +1 -1
  52. package/engine/entities/abstractions/route.entity.d.ts +9 -1
  53. package/engine/entities/abstractions/route.entity.js +49 -27
  54. package/engine/entities/abstractions/route.entity.js.map +1 -1
  55. package/engine/entities/abstractions/source-file.entity.d.ts +11 -9
  56. package/engine/entities/abstractions/source-file.entity.js +18 -13
  57. package/engine/entities/abstractions/source-file.entity.js.map +1 -1
  58. package/engine/entities/api-page.entity.d.ts +13 -11
  59. package/engine/entities/api-page.entity.js +41 -28
  60. package/engine/entities/api-page.entity.js.map +1 -1
  61. package/engine/entities/api-scope.entity.d.ts +12 -10
  62. package/engine/entities/api-scope.entity.js +15 -13
  63. package/engine/entities/api-scope.entity.js.map +1 -1
  64. package/engine/entities/api.entity.d.ts +5 -5
  65. package/engine/entities/api.entity.js +18 -17
  66. package/engine/entities/api.entity.js.map +1 -1
  67. package/engine/entities/cache/decorators/cached-entity.d.ts +7 -5
  68. package/engine/entities/cache/decorators/cached-entity.js +11 -16
  69. package/engine/entities/cache/decorators/cached-entity.js.map +1 -1
  70. package/engine/entities/category.entity.d.ts +5 -5
  71. package/engine/entities/category.entity.js +16 -20
  72. package/engine/entities/category.entity.js.map +1 -1
  73. package/engine/entities/indexes.entity.d.ts +2 -3
  74. package/engine/entities/indexes.entity.js +2 -5
  75. package/engine/entities/indexes.entity.js.map +1 -1
  76. package/engine/entities/page.entity.d.ts +10 -10
  77. package/engine/entities/page.entity.js +83 -73
  78. package/engine/entities/page.entity.js.map +1 -1
  79. package/engine/entities/skeleton.entity.d.ts +2 -4
  80. package/engine/entities/skeleton.entity.js +11 -25
  81. package/engine/entities/skeleton.entity.js.map +1 -1
  82. package/engine/entity-emitter.d.ts +19 -0
  83. package/engine/entity-emitter.js +52 -0
  84. package/engine/entity-emitter.js.map +1 -0
  85. package/engine/entity-store.d.ts +1 -0
  86. package/engine/entity-store.js +7 -4
  87. package/engine/entity-store.js.map +1 -1
  88. package/engine/functions/build-candidates.js +16 -5
  89. package/engine/functions/build-candidates.js.map +1 -1
  90. package/engine/index.d.ts +3 -2
  91. package/engine/index.js +3 -2
  92. package/engine/index.js.map +1 -1
  93. package/engine/nunjucks/extentions/index.d.ts +1 -0
  94. package/engine/nunjucks/extentions/index.extension.js.map +1 -0
  95. package/engine/nunjucks/extentions/index.js +5 -0
  96. package/engine/nunjucks/extentions/index.js.map +1 -0
  97. package/engine/nunjucks/filters.d.ts +2 -0
  98. package/engine/{template-filters.js → nunjucks/filters.js} +5 -9
  99. package/engine/nunjucks/filters.js.map +1 -0
  100. package/engine/nunjucks/index.d.ts +2 -0
  101. package/engine/nunjucks/index.js +6 -0
  102. package/engine/nunjucks/index.js.map +1 -0
  103. package/engine/nunjucks/render-template.d.ts +8 -0
  104. package/engine/nunjucks/render-template.js +46 -0
  105. package/engine/nunjucks/render-template.js.map +1 -0
  106. package/engine/variables.d.ts +0 -2
  107. package/engine/variables.js +1 -3
  108. package/engine/variables.js.map +1 -1
  109. package/engine/watcher.d.ts +3 -5
  110. package/engine/watcher.js +13 -9
  111. package/engine/watcher.js.map +1 -1
  112. package/helpers/angular/{component-decorator.d.ts → get-component-decorator.d.ts} +1 -1
  113. package/helpers/angular/{component-decorator.js → get-component-decorator.js} +4 -4
  114. package/helpers/angular/get-component-decorator.js.map +1 -0
  115. package/helpers/angular/{directive-decorator.d.ts → get-directive-decorator.d.ts} +1 -1
  116. package/helpers/angular/{directive-decorator.js → get-directive-decorator.js} +4 -4
  117. package/helpers/angular/get-directive-decorator.js.map +1 -0
  118. package/helpers/angular/get-pipe-decorator.d.ts +8 -0
  119. package/helpers/angular/get-pipe-decorator.js +26 -0
  120. package/helpers/angular/get-pipe-decorator.js.map +1 -0
  121. package/helpers/angular/index.d.ts +3 -2
  122. package/helpers/angular/index.js +3 -2
  123. package/helpers/angular/index.js.map +1 -1
  124. package/helpers/angular/is-standalone.js +6 -4
  125. package/helpers/angular/is-standalone.js.map +1 -1
  126. package/helpers/build-entity-keyword.d.ts +10 -0
  127. package/helpers/build-entity-keyword.js +28 -0
  128. package/helpers/build-entity-keyword.js.map +1 -0
  129. package/helpers/build-file-entity.js +36 -34
  130. package/helpers/build-file-entity.js.map +1 -1
  131. package/helpers/build-indexes.js +43 -40
  132. package/helpers/build-indexes.js.map +1 -1
  133. package/helpers/emit-built-output.d.ts +2 -2
  134. package/helpers/emit-built-output.js +1 -1
  135. package/helpers/emit-built-output.js.map +1 -1
  136. package/helpers/entity-type.d.ts +6 -0
  137. package/helpers/entity-type.js +10 -1
  138. package/helpers/entity-type.js.map +1 -1
  139. package/helpers/extract-docs.js +2 -2
  140. package/helpers/extract-docs.js.map +1 -1
  141. package/helpers/extract-selectors.js +1 -1
  142. package/helpers/extract-selectors.js.map +1 -1
  143. package/helpers/generate-api-entities.js +4 -3
  144. package/helpers/generate-api-entities.js.map +1 -1
  145. package/helpers/get-component-asset.js +4 -11
  146. package/helpers/get-component-asset.js.map +1 -1
  147. package/helpers/index.d.ts +3 -5
  148. package/helpers/index.js +3 -5
  149. package/helpers/index.js.map +1 -1
  150. package/helpers/playground/build-playground-metadata.d.ts +9 -0
  151. package/helpers/playground/build-playground-metadata.js +66 -0
  152. package/helpers/playground/build-playground-metadata.js.map +1 -0
  153. package/helpers/playground/get-content-for-playground.d.ts +8 -0
  154. package/helpers/playground/get-content-for-playground.js +39 -0
  155. package/helpers/playground/get-content-for-playground.js.map +1 -0
  156. package/helpers/playground/get-playground-by-id.js.map +1 -0
  157. package/helpers/playground/get-playground-inputs.d.ts +12 -0
  158. package/helpers/playground/get-playground-inputs.js +72 -0
  159. package/helpers/playground/get-playground-inputs.js.map +1 -0
  160. package/helpers/playground/get-playground-template-inputs.d.ts +7 -0
  161. package/helpers/playground/get-playground-template-inputs.js +17 -0
  162. package/helpers/playground/get-playground-template-inputs.js.map +1 -0
  163. package/helpers/playground/get-playgrounds-expression.js.map +1 -0
  164. package/helpers/playground/get-playgrounds-ids.js.map +1 -0
  165. package/helpers/playground/get-target-for-playground.d.ts +8 -0
  166. package/helpers/playground/get-target-for-playground.js +26 -0
  167. package/helpers/playground/get-target-for-playground.js.map +1 -0
  168. package/helpers/playground/get-template-for-playground.d.ts +8 -0
  169. package/helpers/playground/get-template-for-playground.js +22 -0
  170. package/helpers/playground/get-template-for-playground.js.map +1 -0
  171. package/helpers/playground/index.d.ts +9 -0
  172. package/helpers/playground/index.js +13 -0
  173. package/helpers/playground/index.js.map +1 -0
  174. package/helpers/print.d.ts +24 -0
  175. package/helpers/print.js +46 -0
  176. package/helpers/print.js.map +1 -0
  177. package/helpers/process-html.d.ts +9 -2
  178. package/helpers/process-html.js +29 -10
  179. package/helpers/process-html.js.map +1 -1
  180. package/helpers/typescript/accessor/group-accessors.js +2 -2
  181. package/helpers/typescript/accessor/group-accessors.js.map +1 -1
  182. package/helpers/typescript/create-project.js +1 -18
  183. package/helpers/typescript/create-project.js.map +1 -1
  184. package/interfaces/entity-keyword.d.ts +5 -0
  185. package/interfaces/entity-keyword.js +3 -0
  186. package/interfaces/entity-keyword.js.map +1 -0
  187. package/interfaces/index.d.ts +3 -1
  188. package/interfaces/index.js +3 -1
  189. package/interfaces/index.js.map +1 -1
  190. package/interfaces/output.d.ts +6 -0
  191. package/interfaces/{built-output.js → output.js} +1 -1
  192. package/interfaces/output.js.map +1 -0
  193. package/interfaces/playground-metadata.d.ts +12 -0
  194. package/interfaces/playground-metadata.js +3 -0
  195. package/interfaces/playground-metadata.js.map +1 -0
  196. package/operators/error-handler.d.ts +8 -0
  197. package/operators/error-handler.js +22 -0
  198. package/operators/error-handler.js.map +1 -0
  199. package/package.json +3 -3
  200. package/schematics/api/index.js +1 -1
  201. package/schematics/api/index.js.map +1 -1
  202. package/schematics/category/index.js +1 -1
  203. package/schematics/category/index.js.map +1 -1
  204. package/schematics/migrations/standalone-pages/index.js +2 -9
  205. package/schematics/migrations/standalone-pages/index.js.map +1 -1
  206. package/schematics/page/index.js +1 -7
  207. package/schematics/page/index.js.map +1 -1
  208. package/templates/api-page.module.ts.nunj +2 -2
  209. package/templates/helpers/accessor.html.nunj +2 -1
  210. package/templates/helpers/constructor.html.nunj +1 -1
  211. package/templates/helpers/members.html.nunj +2 -1
  212. package/templates/helpers/method.html.nunj +1 -1
  213. package/templates/helpers/parameters.html.nunj +2 -2
  214. package/templates/helpers/properties.html.nunj +1 -1
  215. package/templates/page.module.ts.nunj +2 -2
  216. package/templates/playgrounds.ts.nunj +15 -19
  217. package/engine/builder.d.ts +0 -23
  218. package/engine/builder.js +0 -125
  219. package/engine/builder.js.map +0 -1
  220. package/engine/entity-life-cycle.d.ts +0 -15
  221. package/engine/entity-life-cycle.js +0 -32
  222. package/engine/entity-life-cycle.js.map +0 -1
  223. package/engine/extentions/index.extension.js.map +0 -1
  224. package/engine/renderer.d.ts +0 -7
  225. package/engine/renderer.js +0 -49
  226. package/engine/renderer.js.map +0 -1
  227. package/engine/template-filters.d.ts +0 -2
  228. package/engine/template-filters.js.map +0 -1
  229. package/helpers/angular/component-decorator.js.map +0 -1
  230. package/helpers/angular/directive-decorator.js.map +0 -1
  231. package/helpers/get-playground-by-id.js.map +0 -1
  232. package/helpers/get-playground-properties.d.ts +0 -25
  233. package/helpers/get-playground-properties.js +0 -113
  234. package/helpers/get-playground-properties.js.map +0 -1
  235. package/helpers/get-playground-targets.d.ts +0 -6
  236. package/helpers/get-playground-targets.js +0 -21
  237. package/helpers/get-playground-targets.js.map +0 -1
  238. package/helpers/get-playgrounds-expression.js.map +0 -1
  239. package/helpers/get-playgrounds-ids.js.map +0 -1
  240. package/helpers/print-progress.d.ts +0 -6
  241. package/helpers/print-progress.js +0 -19
  242. package/helpers/print-progress.js.map +0 -1
  243. package/interfaces/built-output.d.ts +0 -4
  244. package/interfaces/built-output.js.map +0 -1
  245. /package/engine/{extentions → nunjucks/extentions}/index.extension.d.ts +0 -0
  246. /package/engine/{extentions → nunjucks/extentions}/index.extension.js +0 -0
  247. /package/helpers/{get-playground-by-id.d.ts → playground/get-playground-by-id.d.ts} +0 -0
  248. /package/helpers/{get-playground-by-id.js → playground/get-playground-by-id.js} +0 -0
  249. /package/helpers/{get-playgrounds-expression.d.ts → playground/get-playgrounds-expression.d.ts} +0 -0
  250. /package/helpers/{get-playgrounds-expression.js → playground/get-playgrounds-expression.js} +0 -0
  251. /package/helpers/{get-playgrounds-ids.d.ts → playground/get-playgrounds-ids.d.ts} +0 -0
  252. /package/helpers/{get-playgrounds-ids.js → playground/get-playgrounds-ids.js} +0 -0
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.entityEmitter = void 0;
4
+ const core_1 = require("@ng-doc/core");
5
+ const rxjs_1 = require("rxjs");
6
+ const operators_1 = require("rxjs/operators");
7
+ const helpers_1 = require("../helpers");
8
+ const operators_2 = require("../operators");
9
+ const variables_1 = require("./variables");
10
+ /**
11
+ * Emits new entities if they are added or changed. Also emits destroyed entities if their root files are unlinked.
12
+ * This function not only creates the entities based on the file path, but also creates the child entities recursively
13
+ * if it's can be done.
14
+ *
15
+ * @param store - The entity store.
16
+ * @param cache - The cache instance.
17
+ * @param context - The builder context.
18
+ * @param project - The project instance.
19
+ * @param watcher - The watcher instance.
20
+ */
21
+ function entityEmitter(store, cache, context, project, watcher) {
22
+ return (0, rxjs_1.merge)(watcher.onAdd(variables_1.PAGE_PATTERN, variables_1.CATEGORY_PATTERN, variables_1.API_PATTERN), watcher.onChange(variables_1.PAGE_PATTERN, variables_1.CATEGORY_PATTERN, variables_1.API_PATTERN)).pipe((0, operators_1.map)((paths) => paths.map((p) => {
23
+ const EntityConstructor = (0, helpers_1.getEntityConstructor)(p);
24
+ const entity = new EntityConstructor(store, cache, context, project.addSourceFileAtPath(p));
25
+ entity.store.set(entity.id, entity);
26
+ return entity;
27
+ })), (0, operators_1.mergeMap)((entities) => (0, rxjs_1.merge)(...entities.map((entity) => (0, rxjs_1.merge)(watcher.onUnlink(...entity.rootFiles), entity.onDestroy()).pipe((0, operators_1.take)(1), (0, operators_1.tap)(() => entity.destroy()), (0, operators_1.map)(() => [entity])))).pipe((0, operators_1.startWith)(entities))), (0, operators_1.mergeMap)((entities) => {
28
+ const notDestroyed = entities.filter((e) => !e.destroyed);
29
+ if (notDestroyed.length) {
30
+ return (0, rxjs_1.forkJoin)(notDestroyed.map(childGenerator)).pipe((0, operators_1.map)((children) => children.flat()), (0, operators_1.switchMap)((children) => (0, rxjs_1.merge)(...children.map((child) => watcher
31
+ .watch(child.rootFiles)
32
+ .onChange(...child.rootFiles)
33
+ .pipe((0, operators_1.map)(() => [child]), (0, rxjs_1.takeUntil)(child.onDestroy())))).pipe((0, operators_1.startWith)((0, core_1.unique)(entities.concat(children))))));
34
+ }
35
+ return (0, rxjs_1.of)(entities);
36
+ }), (0, operators_2.bufferDebounce)(10), (0, operators_1.map)((entities) => entities.flat()), (0, operators_1.map)((entities) => (0, core_1.asArray)(new Set(entities.concat(
37
+ /*
38
+ Add the entities with errors or warnings to the output.
39
+ This is necessary to try to build them again.
40
+ */
41
+ ...store.getAllWithErrorsOrWarnings())))));
42
+ }
43
+ exports.entityEmitter = entityEmitter;
44
+ /**
45
+ * Creates the child entities recursively.
46
+ *
47
+ * @param entity - The entity to create the children for.
48
+ */
49
+ function childGenerator(entity) {
50
+ return entity.childrenGenerator().pipe((0, operators_2.progress)('Loading entities...'), (0, operators_1.switchMap)((children) => (0, operators_2.forkJoinOrEmpty)(children.map(childGenerator)).pipe((0, operators_1.map)((children2) => children.concat(children2.flat())))), (0, operators_1.tap)((entities) => entities.forEach((e) => entity.store.set(e.id, e))));
51
+ }
52
+ //# sourceMappingURL=entity-emitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-emitter.js","sourceRoot":"","sources":["../../../../libs/builder/engine/entity-emitter.ts"],"names":[],"mappings":";;;AACA,uCAA6C;AAC7C,+BAAgE;AAChE,8CAA8E;AAG9E,wCAAgD;AAChD,4CAAuE;AAKvE,2CAAwE;AAGxE;;;;;;;;;;GAUG;AACH,SAAgB,aAAa,CAC5B,KAAuB,EACvB,KAAiB,EACjB,OAA4B,EAC5B,OAAgB,EAChB,OAAqB;IAErB,OAAO,IAAA,YAAK,EACX,OAAO,CAAC,KAAK,CAAC,wBAAY,EAAE,4BAAgB,EAAE,uBAAW,CAAC,EAC1D,OAAO,CAAC,QAAQ,CAAC,wBAAY,EAAE,4BAAgB,EAAE,uBAAW,CAAC,CAC7D,CAAC,IAAI,CACL,IAAA,eAAG,EAAC,CAAC,KAAe,EAAE,EAAE,CACvB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE;QACvB,MAAM,iBAAiB,GAA+B,IAAA,8BAAoB,EAAC,CAAC,CAAC,CAAC;QAC9E,MAAM,MAAM,GAAgB,IAAI,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAEpC,OAAO,MAAM,CAAC;IACf,CAAC,CAAC,CACF,EACD,IAAA,oBAAQ,EAAC,CAAC,QAAuB,EAAE,EAAE,CACpC,IAAA,YAAK,EACJ,GAAG,QAAQ,CAAC,G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,EAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACpD,CACD,CAAC;SACF;QAED,OAAO,IAAA,SAAE,EAAC,QAAQ,CAAC,CAAC;IACrB,CAAC,CAAC,EACF,IAAA,0BAAc,EAAC,EAAE,CAAC,EAClB,IAAA,eAAG,EAAC,CAAC,QAAyB,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EACnD,IAAA,eAAG,EAAC,CAAC,QAAuB,EAAE,EAAE,CAC/B,IAAA,cAAO,EACN,IAAI,GAAG,CACN,QAAQ,CAAC,MAAM;IACd;;;EAGC;IACD,GAAG,KAAK,CAAC,0BAA0B,EAAE,CACrC,CACD,CACD,CACD,CACD,CAAC;AACH,CAAC;AAxED,sCAwEC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,MAAmB;IAC1C,OAAO,MAAM,CAAC,iBAAiB,EAAE,CAAC,IAAI,CACrC,IAAA,oBAAQ,EAAC,qBAAqB,CAAC,EAC/B,IAAA,qBAAS,EAAC,CAAC,QAAuB,EAAE,EAAE,CACrC,IAAA,2BAAe,EAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CACjD,IAAA,eAAG,EAAC,CAAC,SAA0B,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CACtE,CACD,EACD,IAAA,eAAG,EAAC,CAAC,QAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CACjG,CAAC;AACH,CAAC"}
@@ -8,5 +8,6 @@ export declare class NgDocEntityStore extends Map<string, NgDocEntity> {
8
8
  getByKeyword(keyword: string): NgDocKeyword | undefined;
9
9
  getAllByKeyword(keyword: string): NgDocKeyword[];
10
10
  updateKeywordMap(globalKeywords?: Record<string, NgDocGlobalKeyword>): void;
11
+ getAllWithErrorsOrWarnings(): NgDocEntity[];
11
12
  private addKeyword;
12
13
  }
@@ -43,16 +43,19 @@ class NgDocEntityStore extends Map {
43
43
  }
44
44
  });
45
45
  this.asArray().forEach((entity) => {
46
- if ((0, helpers_1.isRouteEntity)(entity) && !entity.destroyed) {
47
- entity.keywords.forEach((keyword) => this.addKeyword(keyword, {
48
- title: entity.title,
49
- path: entity.fullRoute,
46
+ if ((0, helpers_1.isRouteEntity)(entity) && entity.isReadyForBuild) {
47
+ entity.keywords.forEach((keyword) => this.addKeyword(keyword.key, {
48
+ title: keyword.title,
49
+ path: keyword.path,
50
50
  type: (0, helpers_1.getKeywordTypeFromEntity)(entity),
51
51
  isCodeLink: (0, helpers_1.isApiPageEntity)(entity),
52
52
  }));
53
53
  }
54
54
  });
55
55
  }
56
+ getAllWithErrorsOrWarnings() {
57
+ return this.asArray().filter((entity) => entity.errors.length || entity.warnings.length);
58
+ }
56
59
  addKeyword(key, keyword) {
57
60
  this.keywordMap.set(key, [...(0, core_1.asArray)(this.keywordMap.get(key)), keyword]);
58
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"entity-store.js","sourceRoot":"","sources":["../../../../libs/builder/engine/entity-store.ts"],"names":[],"mappings":";;;AAAA,uCAAmF;AAEnF,wCAAoF;AAGpF,MAAa,gBAAiB,SAAQ,GAAwB;IAA9D;;QACS,eAAU,GAAgC,IAAI,GAAG,EAA0B,CAAC;IA4DrF,CAAC;IA1DA,OAAO;QACN,OAAO,IAAA,cAAO,EAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEQ,GAAG,CAAC,GAAW,EAAE,KAAkB;;QAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE;YAC5B,MAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,0CAAE,OAAO,EAAE,CAAC;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CAAC;aACF;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,0BAA0B;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,MAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvG,CAAC;IAEO,UAAU,CAAC,GAAW,EAAE,OAAqB;QACpD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC;CACD;AAjED,4CAiEC"}
@@ -12,18 +12,29 @@ const helpers_1 = require("../../helpers");
12
12
  * @returns List of entities that should be rebuilt (including source entities)
13
13
  */
14
14
  function buildCandidates(entityStore, entities) {
15
- const entitiesFromStore = (0, core_1.asArray)(entityStore.asArray());
16
- const candidates = (0, core_1.asArray)(new Set(entities.map((buildable) => [buildable, ...buildable.buildCandidates]).flat()));
17
- const candidatesKeywords = (0, core_1.asArray)(new Set(candidates
15
+ /*
16
+ * If there are no entities to build, return empty array.
17
+ * This is needed because `candidatesByKeywords` may return outdated entities if there are no entities to build
18
+ * then the message about outdated keywords will be shown.
19
+ */
20
+ if (!entities.length) {
21
+ return [];
22
+ }
23
+ const entitiesFromStore = entityStore.asArray();
24
+ // Get all candidates from entities and their build candidates
25
+ const candidates = (0, core_1.unique)(entities.map((buildable) => [buildable, ...buildable.buildCandidates]).flat());
26
+ // Get all keywords from candidates
27
+ const candidatesKeywords = (0, core_1.unique)(candidates
18
28
  .filter(helpers_1.isRouteEntity)
19
29
  .map((candidate) => candidate.keywords)
20
- .flat()));
30
+ .flat()
31
+ .map((keyword) => keyword.key));
21
32
  const candidatesByKeywords = entitiesFromStore.filter((entity) =>
22
33
  // Check if entity is route and has keywords that are used by candidates
23
34
  candidatesKeywords.some((keyword) => entity.potentialKeywords.has(keyword) || entity.usedKeywords.has(keyword)) ||
24
35
  // Check if one of the used keywords is outdated
25
36
  (0, core_1.asArray)(entity.usedKeywords).some((keyword) => !entityStore.getByKeyword(keyword)));
26
- return (0, core_1.asArray)(new Set([...candidates, ...candidatesByKeywords])).sort(prioritySort);
37
+ return (0, core_1.unique)(candidates, candidatesByKeywords).sort(prioritySort);
27
38
  }
28
39
  exports.buildCandidates = buildCandidates;
29
40
  // Sort entities by parent-child relationship, children should be first, parents should be last
@@ -1 +1 @@
1
- {"version":3,"file":"build-candidates.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/functions/build-candidates.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAErC,2CAA4C;AAK5C;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,WAA6B,EAAE,QAAuB;IACrF,MAAM,iBAAiB,GAAkB,IAAA,cAAO,EAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACxE,MAAM,UAAU,GAAkB,IAAA,cAAO,EACxC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAsB,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CACnG,CAAC;IACF,MAAM,kBAAkB,GAAa,IAAA,cAAO,EAC3C,IAAI,GAAG,CACN,UAAU;SACR,MAAM,CAAC,uBAAa,CAAC;SACrB,GAAG,CAAC,CAAC,SAA2B,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC;SACxD,IAAI,EAAE,CACR,CACD,CAAC;IAEF,MAAM,oBAAoB,GAAkB,iBAAiB,CAAC,MAAM,CACnE,CAAC,MAAmB,EAAE,EAAE;IACvB,wEAAwE;IACxE,kBAAkB,CAAC,IAAI,CACtB,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAC9F;QACD,gDAAgD;QAChD,IAAA,cAAO,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAC3F,CAAC;IAEF,OAAO,IAAA,cAAO,EAAC,IAAI,GAAG,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACtF,CAAC;AAzBD,0CAyBC;AAED,+FAA+F;AAC/F;;;;GAIG;AACH,SAAS,YAAY,CAAC,CAAc,EAAE,CAAc;IACnD,OAAO,CAAC,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;AAC1D,CAAC"}
1
+ {"version":3,"file":"build-candidates.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/functions/build-candidates.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAE7C,2CAA4C;AAK5C;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,WAA6B,EAAE,QAAuB;IACrF;;;;OAIG;IACH,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACrB,OAAO,EAAE,CAAC;KACV;IAED,MAAM,iBAAiB,GAAkB,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/D,8DAA8D;IAC9D,MAAM,UAAU,GAAkB,IAAA,aAAM,EACvC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAsB,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,EAAE,CAC1F,CAAC;IAEF,mCAAmC;IACnC,MAAM,kBAAkB,GAAa,IAAA,aAAM,EAC1C,UAAU;SACR,MAAM,CAAC,uBAAa,CAAC;SACrB,GAAG,CAAC,CAAC,SAA2B,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC;SACxD,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAC/B,CAAC;IAEF,MAAM,oBAAoB,GAAkB,iBAAiB,CAAC,MAAM,CACnE,CAAC,MAAmB,EAAE,EAAE;IACvB,wEAAwE;IACxE,kBAAkB,CAAC,IAAI,CACtB,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAC9F;QACD,gDAAgD;QAChD,IAAA,cAAO,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAC3F,CAAC;IAEF,OAAO,IAAA,aAAM,EAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC;AApCD,0CAoCC;AAED,+FAA+F;AAC/F;;;;GAIG;AACH,SAAS,YAAY,CAAC,CAAc,EAAE,CAAc;IACnD,OAAO,CAAC,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;AAC1D,CAAC"}
package/engine/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export * from './actions';
2
- export * from './builder';
2
+ export * from './build-ng-doc';
3
+ export * from './builder-operators';
3
4
  export * from './entities';
4
- export * from './renderer';
5
+ export * from './nunjucks';
5
6
  export * from './ts-doc-formatter';
6
7
  export * from './variables';
7
8
  export * from './watcher';
package/engine/index.js CHANGED
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./actions"), exports);
5
- tslib_1.__exportStar(require("./builder"), exports);
5
+ tslib_1.__exportStar(require("./build-ng-doc"), exports);
6
+ tslib_1.__exportStar(require("./builder-operators"), exports);
6
7
  tslib_1.__exportStar(require("./entities"), exports);
7
- tslib_1.__exportStar(require("./renderer"), exports);
8
+ tslib_1.__exportStar(require("./nunjucks"), exports);
8
9
  tslib_1.__exportStar(require("./ts-doc-formatter"), exports);
9
10
  tslib_1.__exportStar(require("./variables"), exports);
10
11
  tslib_1.__exportStar(require("./watcher"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/engine/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,oDAA0B;AAC1B,qDAA2B;AAC3B,qDAA2B;AAC3B,6DAAmC;AACnC,sDAA4B;AAC5B,oDAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/engine/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,yDAA+B;AAC/B,8DAAoC;AACpC,qDAA2B;AAC3B,qDAA2B;AAC3B,6DAAmC;AACnC,sDAA4B;AAC5B,oDAA0B"}
@@ -0,0 +1 @@
1
+ export * from './index.extension';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.extension.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/nunjucks/extentions/index.extension.ts"],"names":[],"mappings":";;;;AAAA,gEAA6C;AAE7C,MAAa,mBAAmB;IAAhC;QACC,SAAI,GAAa,CAAC,OAAO,CAAC,CAAC;IAmB5B,CAAC;IAjBA,8DAA8D;IAC9D,KAAK,CAAC,MAAW,EAAE,KAAU;QAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEzC,MAAM,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAEjD,MAAM,CAAC,oBAAoB,EAAE,CAAC;QAE9B,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,8DAA8D;IAC9D,GAAG,CAAC,OAAY,EAAE,KAAc,EAAE,IAAS;QAC1C,OAAO,IAAI,kBAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,KAAK,KAAK,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrF,CAAC;CACD;AApBD,kDAoBC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./index.extension"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/builder/engine/nunjucks/extentions/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -0,0 +1,2 @@
1
+ export { accessorPresentation, constructorPresentation, declarationImport, displayReturnType, displayType, extractDocs, extractParameterDocs, extractSeeDocs, extractSelectors, filterByScope, filterByStatic, filterUselessMembers, firstNodeWithComment, functionPresentation, getAccessorChain, getClassAccessors, getClassMethods, getClassProperties, getDeclarationType, getImplementedMember, getInheritedParent, getInterfaceAccessors, getInterfaceMethods, getInterfaceProperties, getMemberParent, getMethodChain, getOverriddenMember, getPropertyChain, groupAccessors, marked, methodPresentation, noEmpty, noLineBreaks, notEmptyAssets, sortByNodesName, sortNavigationEntities, toTemplateString, typeAliasPresentation, variablePresentation, } from '../../helpers';
2
+ export { kebabCase, objectKeys, unique } from '@ng-doc/core';
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- /* Just export filters from this file, they will be included to the template renderer automatically */
2
+ /* Just re-export filters from this file, they will be included to the template renderer automatically */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.objectKeys = exports.kebabCase = exports.buildPlaygroundDemoTemplate = exports.variablePresentation = exports.typeAliasPresentation = exports.toTemplateString = exports.sortNavigationEntities = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.groupAccessors = exports.getTemplateForPlayground = exports.getTargetForPlayground = exports.getPropertyChain = exports.getPlaygroundClassProperties = exports.getOverriddenMember = exports.getMethodChain = exports.getMemberParent = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getInheritedParent = exports.getImplementedMember = exports.getDeclarationType = exports.getContentForPlayground = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterUselessMembers = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.displayReturnType = exports.declarationImport = exports.constructorPresentation = exports.accessorPresentation = void 0;
5
- var helpers_1 = require("../helpers");
4
+ exports.unique = exports.objectKeys = exports.kebabCase = exports.variablePresentation = exports.typeAliasPresentation = exports.toTemplateString = exports.sortNavigationEntities = exports.sortByNodesName = exports.notEmptyAssets = exports.noLineBreaks = exports.noEmpty = exports.methodPresentation = exports.marked = exports.groupAccessors = exports.getPropertyChain = exports.getOverriddenMember = exports.getMethodChain = exports.getMemberParent = exports.getInterfaceProperties = exports.getInterfaceMethods = exports.getInterfaceAccessors = exports.getInheritedParent = exports.getImplementedMember = exports.getDeclarationType = exports.getClassProperties = exports.getClassMethods = exports.getClassAccessors = exports.getAccessorChain = exports.functionPresentation = exports.firstNodeWithComment = exports.filterUselessMembers = exports.filterByStatic = exports.filterByScope = exports.extractSelectors = exports.extractSeeDocs = exports.extractParameterDocs = exports.extractDocs = exports.displayType = exports.displayReturnType = exports.declarationImport = exports.constructorPresentation = exports.accessorPresentation = void 0;
5
+ var helpers_1 = require("../../helpers");
6
6
  Object.defineProperty(exports, "accessorPresentation", { enumerable: true, get: function () { return helpers_1.accessorPresentation; } });
7
7
  Object.defineProperty(exports, "constructorPresentation", { enumerable: true, get: function () { return helpers_1.constructorPresentation; } });
8
8
  Object.defineProperty(exports, "declarationImport", { enumerable: true, get: function () { return helpers_1.declarationImport; } });
@@ -21,7 +21,6 @@ Object.defineProperty(exports, "getAccessorChain", { enumerable: true, get: func
21
21
  Object.defineProperty(exports, "getClassAccessors", { enumerable: true, get: function () { return helpers_1.getClassAccessors; } });
22
22
  Object.defineProperty(exports, "getClassMethods", { enumerable: true, get: function () { return helpers_1.getClassMethods; } });
23
23
  Object.defineProperty(exports, "getClassProperties", { enumerable: true, get: function () { return helpers_1.getClassProperties; } });
24
- Object.defineProperty(exports, "getContentForPlayground", { enumerable: true, get: function () { return helpers_1.getContentForPlayground; } });
25
24
  Object.defineProperty(exports, "getDeclarationType", { enumerable: true, get: function () { return helpers_1.getDeclarationType; } });
26
25
  Object.defineProperty(exports, "getImplementedMember", { enumerable: true, get: function () { return helpers_1.getImplementedMember; } });
27
26
  Object.defineProperty(exports, "getInheritedParent", { enumerable: true, get: function () { return helpers_1.getInheritedParent; } });
@@ -31,10 +30,7 @@ Object.defineProperty(exports, "getInterfaceProperties", { enumerable: true, get
31
30
  Object.defineProperty(exports, "getMemberParent", { enumerable: true, get: function () { return helpers_1.getMemberParent; } });
32
31
  Object.defineProperty(exports, "getMethodChain", { enumerable: true, get: function () { return helpers_1.getMethodChain; } });
33
32
  Object.defineProperty(exports, "getOverriddenMember", { enumerable: true, get: function () { return helpers_1.getOverriddenMember; } });
34
- Object.defineProperty(exports, "getPlaygroundClassProperties", { enumerable: true, get: function () { return helpers_1.getPlaygroundClassProperties; } });
35
33
  Object.defineProperty(exports, "getPropertyChain", { enumerable: true, get: function () { return helpers_1.getPropertyChain; } });
36
- Object.defineProperty(exports, "getTargetForPlayground", { enumerable: true, get: function () { return helpers_1.getTargetForPlayground; } });
37
- Object.defineProperty(exports, "getTemplateForPlayground", { enumerable: true, get: function () { return helpers_1.getTemplateForPlayground; } });
38
34
  Object.defineProperty(exports, "groupAccessors", { enumerable: true, get: function () { return helpers_1.groupAccessors; } });
39
35
  Object.defineProperty(exports, "marked", { enumerable: true, get: function () { return helpers_1.marked; } });
40
36
  Object.defineProperty(exports, "methodPresentation", { enumerable: true, get: function () { return helpers_1.methodPresentation; } });
@@ -47,7 +43,7 @@ Object.defineProperty(exports, "toTemplateString", { enumerable: true, get: func
47
43
  Object.defineProperty(exports, "typeAliasPresentation", { enumerable: true, get: function () { return helpers_1.typeAliasPresentation; } });
48
44
  Object.defineProperty(exports, "variablePresentation", { enumerable: true, get: function () { return helpers_1.variablePresentation; } });
49
45
  var core_1 = require("@ng-doc/core");
50
- Object.defineProperty(exports, "buildPlaygroundDemoTemplate", { enumerable: true, get: function () { return core_1.buildPlaygroundDemoTemplate; } });
51
46
  Object.defineProperty(exports, "kebabCase", { enumerable: true, get: function () { return core_1.kebabCase; } });
52
47
  Object.defineProperty(exports, "objectKeys", { enumerable: true, get: function () { return core_1.objectKeys; } });
53
- //# sourceMappingURL=template-filters.js.map
48
+ Object.defineProperty(exports, "unique", { enumerable: true, get: function () { return core_1.unique; } });
49
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/filters.ts"],"names":[],"mappings":";AAAA,yGAAyG;;;AAEzG,yCAwCuB;AAvCtB,+GAAA,oBAAoB,OAAA;AACpB,kHAAA,uBAAuB,OAAA;AACvB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,sGAAA,WAAW,OAAA;AACX,sGAAA,WAAW,OAAA;AACX,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,2GAAA,gBAAgB,OAAA;AAChB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,+GAAA,oBAAoB,OAAA;AACpB,2GAAA,gBAAgB,OAAA;AAChB,4GAAA,iBAAiB,OAAA;AACjB,0GAAA,eAAe,OAAA;AACf,6GAAA,kBAAkB,OAAA;AAClB,6GAAA,kBAAkB,OAAA;AAClB,+GAAA,oBAAoB,OAAA;AACpB,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AACrB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,iGAAA,MAAM,OAAA;AACN,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AACP,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,iHAAA,sBAAsB,OAAA;AACtB,2GAAA,gBAAgB,OAAA;AAChB,gHAAA,qBAAqB,OAAA;AACrB,+GAAA,oBAAoB,OAAA;AAErB,qCAA2D;AAAnD,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,8FAAA,MAAM,OAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './extentions';
2
+ export * from './render-template';
@@ -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("./extentions"), exports);
5
+ tslib_1.__exportStar(require("./render-template"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC"}
@@ -0,0 +1,8 @@
1
+ import { NgDocRendererOptions } from '../../interfaces';
2
+ /**
3
+ * Renders a template with the given options via Nunjucks.
4
+ *
5
+ * @param template - The template path to render.
6
+ * @param options - The options to render the template with.
7
+ */
8
+ export declare function renderTemplate<T extends object>(template: string, options?: NgDocRendererOptions<T>): string;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderTemplate = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const core_1 = require("@ng-doc/core");
6
+ const fs = tslib_1.__importStar(require("fs"));
7
+ const nunjucks_1 = require("nunjucks");
8
+ const path = tslib_1.__importStar(require("path"));
9
+ const ts_morph_1 = require("ts-morph");
10
+ const variables_1 = require("../variables");
11
+ const extentions_1 = require("./extentions");
12
+ const filters = tslib_1.__importStar(require("./filters"));
13
+ class NgDocRelativeLoader {
14
+ constructor(path, dependenciesStore) {
15
+ this.path = path;
16
+ this.dependenciesStore = dependenciesStore;
17
+ }
18
+ getSource(name) {
19
+ var _a;
20
+ const fullPath = path.join(this.path, name);
21
+ (_a = this.dependenciesStore) === null || _a === void 0 ? void 0 : _a.add(fullPath);
22
+ return {
23
+ src: fs.readFileSync(fullPath, 'utf-8'),
24
+ path: fullPath,
25
+ noCache: true,
26
+ };
27
+ }
28
+ }
29
+ /**
30
+ * Renders a template with the given options via Nunjucks.
31
+ *
32
+ * @param template - The template path to render.
33
+ * @param options - The options to render the template with.
34
+ */
35
+ function renderTemplate(template, options) {
36
+ var _a;
37
+ let environment = new nunjucks_1.Environment(new NgDocRelativeLoader((_a = options === null || options === void 0 ? void 0 : options.scope) !== null && _a !== void 0 ? _a : variables_1.TEMPLATES_PATH, options === null || options === void 0 ? void 0 : options.dependenciesStore), { autoescape: false });
38
+ if ((options === null || options === void 0 ? void 0 : options.filters) !== false) {
39
+ (0, core_1.objectKeys)(filters).forEach((filter) => (environment = environment.addFilter(filter, filters[filter])));
40
+ environment.addGlobal('Node', ts_morph_1.Node);
41
+ }
42
+ environment.addExtension('NgDocIndexExtension', new extentions_1.NgDocIndexExtension());
43
+ return environment.render(template, options === null || options === void 0 ? void 0 : options.context);
44
+ }
45
+ exports.renderTemplate = renderTemplate;
46
+ //# sourceMappingURL=render-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-template.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/nunjucks/render-template.ts"],"names":[],"mappings":";;;;AAAA,uCAAwC;AACxC,+CAAyB;AACzB,uCAA4D;AAC5D,mDAA6B;AAC7B,uCAA8B;AAI9B,4CAA4C;AAC5C,6CAAiD;AACjD,2DAAqC;AAErC,MAAM,mBAAmB;IACxB,YAA6B,IAAY,EAAmB,iBAAyC;QAAxE,SAAI,GAAJ,IAAI,CAAQ;QAAmB,sBAAiB,GAAjB,iBAAiB,CAAwB;IAAG,CAAC;IAEzG,SAAS,CAAC,IAAY;;QACrB,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEpD,MAAA,IAAI,CAAC,iBAAiB,0CAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEtC,OAAO;YACN,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;YACvC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;SACb,CAAC;IACH,CAAC;CACD;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAmB,QAAgB,EAAE,OAAiC;;IACnG,IAAI,WAAW,GAAgB,IAAI,sBAAW,CAC7C,IAAI,mBAAmB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,0BAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,CAAC,EACrF,EAAC,UAAU,EAAE,KAAK,EAAC,CACnB,CAAC;IAEF,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,MAAK,KAAK,EAAE;QAC/B,IAAA,iBAAU,EAAC,OAAO,CAAC,CAAC,OAAO,CAC1B,CAAC,MAA4B,EAAE,EAAE,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAChG,CAAC;QAEF,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,eAAI,CAAC,CAAC;KACpC;IACD,WAAW,CAAC,YAAY,CAAC,qBAAqB,EAAE,IAAI,gCAAmB,EAAE,CAAC,CAAC;IAE3E,OAAO,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAhBD,wCAgBC"}
@@ -3,9 +3,7 @@ export declare const GLOBALS: {
3
3
  };
4
4
  export declare const PAGE_NAME: string;
5
5
  export declare const CATEGORY_NAME: string;
6
- export declare const PAGE_DEPENDENCIES_NAME: string;
7
6
  export declare const API_NAME: string;
8
- export declare const RENDERED_PAGE_NAME: string;
9
7
  export declare const PAGE_PATTERN: string;
10
8
  export declare const CATEGORY_PATTERN: string;
11
9
  export declare const API_PATTERN: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TEMPLATES_PATH = exports.CACHE_PATH = exports.API_PATTERN = exports.CATEGORY_PATTERN = exports.PAGE_PATTERN = exports.RENDERED_PAGE_NAME = exports.API_NAME = exports.PAGE_DEPENDENCIES_NAME = exports.CATEGORY_NAME = exports.PAGE_NAME = exports.GLOBALS = void 0;
3
+ exports.TEMPLATES_PATH = exports.CACHE_PATH = exports.API_PATTERN = exports.CATEGORY_PATTERN = exports.PAGE_PATTERN = exports.API_NAME = exports.CATEGORY_NAME = exports.PAGE_NAME = exports.GLOBALS = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const path = tslib_1.__importStar(require("path"));
6
6
  exports.GLOBALS = {
@@ -8,9 +8,7 @@ exports.GLOBALS = {
8
8
  };
9
9
  exports.PAGE_NAME = 'ng-doc.page.ts';
10
10
  exports.CATEGORY_NAME = 'ng-doc.category.ts';
11
- exports.PAGE_DEPENDENCIES_NAME = 'ng-doc.dependencies.ts';
12
11
  exports.API_NAME = 'ng-doc.api.ts';
13
- exports.RENDERED_PAGE_NAME = 'index.html';
14
12
  exports.PAGE_PATTERN = `**/${exports.PAGE_NAME}`;
15
13
  exports.CATEGORY_PATTERN = `**/${exports.CATEGORY_NAME}`;
16
14
  exports.API_PATTERN = `**/${exports.API_NAME}`;
@@ -1 +1 @@
1
- {"version":3,"file":"variables.js","sourceRoot":"","sources":["../../../../libs/builder/engine/variables.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAEhB,QAAA,OAAO,GAAG;IACtB,aAAa,EAAE,EAAE;CACjB,CAAC;AACW,QAAA,SAAS,GAAW,gBAAgB,CAAC;AACrC,QAAA,aAAa,GAAW,oBAAoB,CAAC;AAC7C,QAAA,sBAAsB,GAAW,wBAAwB,CAAC;AAC1D,QAAA,QAAQ,GAAW,eAAe,CAAC;AACnC,QAAA,kBAAkB,GAAW,YAAY,CAAC;AAE1C,QAAA,YAAY,GAAW,MAAM,iBAAS,EAAE,CAAC;AACzC,QAAA,gBAAgB,GAAW,MAAM,qBAAa,EAAE,CAAC;AACjD,QAAA,WAAW,GAAW,MAAM,gBAAQ,EAAE,CAAC;AACvC,QAAA,UAAU,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACpD,QAAA,cAAc,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"variables.js","sourceRoot":"","sources":["../../../../libs/builder/engine/variables.ts"],"names":[],"mappings":";;;;AAAA,mDAA6B;AAEhB,QAAA,OAAO,GAAG;IACtB,aAAa,EAAE,EAAE;CACjB,CAAC;AACW,QAAA,SAAS,GAAW,gBAAgB,CAAC;AACrC,QAAA,aAAa,GAAW,oBAAoB,CAAC;AAC7C,QAAA,QAAQ,GAAW,eAAe,CAAC;AAEnC,QAAA,YAAY,GAAW,MAAM,iBAAS,EAAE,CAAC;AACzC,QAAA,gBAAgB,GAAW,MAAM,qBAAa,EAAE,CAAC;AACjD,QAAA,WAAW,GAAW,MAAM,gBAAQ,EAAE,CAAC;AACvC,QAAA,UAAU,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACpD,QAAA,cAAc,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC"}
@@ -7,10 +7,8 @@ export declare class NgDocWatcher {
7
7
  private readonly ready$;
8
8
  constructor(files?: string[]);
9
9
  watch(paths: string | readonly string[]): this;
10
- unwatch(paths: string | readonly string[]): void;
11
- onAdd(...filterPaths: string[]): Observable<string>;
12
- onChange(...filterPaths: string[]): Observable<string>;
13
- onUnlink(...filterPaths: string[]): Observable<string>;
14
- onReady(): Observable<void>;
10
+ onAdd(...filterPaths: string[]): Observable<string[]>;
11
+ onChange(...filterPaths: string[]): Observable<string[]>;
12
+ onUnlink(...filterPaths: string[]): Observable<string[]>;
15
13
  close(): void;
16
14
  }
package/engine/watcher.js CHANGED
@@ -7,6 +7,16 @@ const minimatch_1 = require("minimatch");
7
7
  const rxjs_1 = require("rxjs");
8
8
  const operators_1 = require("rxjs/operators");
9
9
  const helpers_1 = require("../helpers");
10
+ const operators_2 = require("../operators");
11
+ /**
12
+ *
13
+ * @param source$
14
+ * @param ready$
15
+ * @param patterns
16
+ */
17
+ function bufferAndFilter(source$, ready$, patterns) {
18
+ return source$.pipe((0, operators_2.bufferUntilOnce)(ready$), (0, operators_2.bufferDebounce)(10), (0, operators_1.map)((paths) => paths.flat()), (0, operators_1.map)((paths) => paths.filter((path) => patterns.some((p) => (0, minimatch_1.minimatch)(path, (0, helpers_1.miniPattern)(p))))), (0, operators_1.filter)((paths) => paths.length > 0));
19
+ }
10
20
  class NgDocWatcher {
11
21
  constructor(files) {
12
22
  this.change$ = new rxjs_1.Subject();
@@ -27,20 +37,14 @@ class NgDocWatcher {
27
37
  this.watcher.add(paths);
28
38
  return this;
29
39
  }
30
- unwatch(paths) {
31
- this.watcher.unwatch(paths);
32
- }
33
40
  onAdd(...filterPaths) {
34
- return this.add$.pipe((0, operators_1.filter)((path) => !filterPaths || filterPaths.some((p) => (0, minimatch_1.minimatch)(path, (0, helpers_1.miniPattern)(p)))));
41
+ return bufferAndFilter(this.add$, this.ready$, filterPaths);
35
42
  }
36
43
  onChange(...filterPaths) {
37
- return this.change$.pipe((0, operators_1.filter)((path) => !filterPaths || filterPaths.some((p) => (0, minimatch_1.minimatch)(path, (0, helpers_1.miniPattern)(p)))));
44
+ return bufferAndFilter(this.change$, this.ready$, filterPaths);
38
45
  }
39
46
  onUnlink(...filterPaths) {
40
- return this.unlink$.pipe((0, operators_1.filter)((path) => !filterPaths || filterPaths.some((p) => (0, minimatch_1.minimatch)(path, (0, helpers_1.miniPattern)(p)))));
41
- }
42
- onReady() {
43
- return this.ready$;
47
+ return bufferAndFilter(this.unlink$, this.ready$, filterPaths);
44
48
  }
45
49
  close() {
46
50
  this.watcher.close();
@@ -1 +1 @@
1
- {"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../../../libs/builder/engine/watcher.ts"],"names":[],"mappings":";;;;AAAA,2DAAqC;AACrC,yCAAoC;AACpC,+BAAwD;AACxD,8CAAsC;AAEtC,wCAAuC;AAEvC,MAAa,YAAY;IAOxB,YAAY,KAAgB;QALX,YAAO,GAAoB,IAAI,cAAO,EAAE,CAAC;QACzC,SAAI,GAAoB,IAAI,cAAO,EAAE,CAAC;QACtC,YAAO,GAAoB,IAAI,cAAO,EAAE,CAAC;QACzC,WAAM,GAAwB,IAAI,oBAAa,CAAC,CAAC,CAAC,CAAC;QAGnE,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAE;YAC1C,gHAAgH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W,CAAC,CAAC;IAC7D,CAAC;IAED,QAAQ,CAAC,GAAG,WAAqB;QAChC,OAAO,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAChE,CAAC;IAED,QAAQ,CAAC,GAAG,WAAqB;QAChC,OAAO,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAChE,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACD;AAzCD,oCAyCC"}
@@ -5,4 +5,4 @@ import { ClassDeclaration } from 'ts-morph';
5
5
  *
6
6
  * @param cls - class declaration
7
7
  */
8
- export declare function componentDecorator(cls: ClassDeclaration): Component | undefined;
8
+ export declare function getComponentDecorator(cls: ClassDeclaration): Component | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.componentDecorator = void 0;
3
+ exports.getComponentDecorator = void 0;
4
4
  const ts_morph_1 = require("ts-morph");
5
5
  const string_expression_1 = require("../string-expression");
6
6
  const typescript_1 = require("../typescript");
@@ -9,7 +9,7 @@ const typescript_1 = require("../typescript");
9
9
  *
10
10
  * @param cls - class declaration
11
11
  */
12
- function componentDecorator(cls) {
12
+ function getComponentDecorator(cls) {
13
13
  const decorator = cls.getDecorator('Component');
14
14
  const decoratorArgument = decorator === null || decorator === void 0 ? void 0 : decorator.getArguments()[0];
15
15
  if (ts_morph_1.Node.isObjectLiteralExpression(decoratorArgument)) {
@@ -26,5 +26,5 @@ function componentDecorator(cls) {
26
26
  }
27
27
  return undefined;
28
28
  }
29
- exports.componentDecorator = componentDecorator;
30
- //# sourceMappingURL=component-decorator.js.map
29
+ exports.getComponentDecorator = getComponentDecorator;
30
+ //# sourceMappingURL=get-component-decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-component-decorator.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/angular/get-component-decorator.ts"],"names":[],"mappings":";;;AACA,uCAAqF;AAErF,4DAAsD;AACtD,8CAAoD;AAEpD;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,GAAqB;IAC1D,MAAM,SAAS,GAA0B,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACvE,MAAM,iBAAiB,GAAqB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,GAAG,CAAC,CAAC,CAAC;IAEzE,IAAI,eAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE;QACtD,MAAM,kBAAkB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC7G,MAAM,gBAAgB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACzG,MAAM,gBAAgB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAC5G,MAAM,iBAAiB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE3G,OAAO;YACN,UAAU,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,kBAAkB,CAAC,CAAC;YACvE,QAAQ,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,gBAAgB,CAAC,CAAC;YACnE,WAAW,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,gBAAgB,CAAC,CAAC;YACtE,SAAS,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,iBAAiB,CAAC,CAAC;SACrE,CAAC;KACF;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAnBD,sDAmBC"}
@@ -5,4 +5,4 @@ import { ClassDeclaration } from 'ts-morph';
5
5
  *
6
6
  * @param cls - class declaration
7
7
  */
8
- export declare function directiveDecorator(cls: ClassDeclaration): Directive | undefined;
8
+ export declare function getDirectiveDecorator(cls: ClassDeclaration): Directive | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.directiveDecorator = void 0;
3
+ exports.getDirectiveDecorator = void 0;
4
4
  const ts_morph_1 = require("ts-morph");
5
5
  const string_expression_1 = require("../string-expression");
6
6
  const typescript_1 = require("../typescript");
@@ -9,7 +9,7 @@ const typescript_1 = require("../typescript");
9
9
  *
10
10
  * @param cls - class declaration
11
11
  */
12
- function directiveDecorator(cls) {
12
+ function getDirectiveDecorator(cls) {
13
13
  const decorator = cls.getDecorator('Directive');
14
14
  const decoratorArgument = decorator === null || decorator === void 0 ? void 0 : decorator.getArguments()[0];
15
15
  if (ts_morph_1.Node.isObjectLiteralExpression(decoratorArgument)) {
@@ -22,5 +22,5 @@ function directiveDecorator(cls) {
22
22
  }
23
23
  return undefined;
24
24
  }
25
- exports.directiveDecorator = directiveDecorator;
26
- //# sourceMappingURL=directive-decorator.js.map
25
+ exports.getDirectiveDecorator = getDirectiveDecorator;
26
+ //# sourceMappingURL=get-directive-decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-directive-decorator.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/angular/get-directive-decorator.ts"],"names":[],"mappings":";;;AACA,uCAAqF;AAErF,4DAAsD;AACtD,8CAAoD;AAEpD;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,GAAqB;IAC1D,MAAM,SAAS,GAA0B,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACvE,MAAM,iBAAiB,GAAqB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,GAAG,CAAC,CAAC,CAAC;IAEzE,IAAI,eAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE;QACtD,MAAM,kBAAkB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC7G,MAAM,gBAAgB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAEzG,OAAO;YACN,UAAU,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,kBAAkB,CAAC,CAAC;YACvE,QAAQ,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,gBAAgB,CAAC,CAAC;SACnE,CAAC;KACF;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAfD,sDAeC"}
@@ -0,0 +1,8 @@
1
+ import { Pipe } from '@angular/core';
2
+ import { ClassDeclaration } from 'ts-morph';
3
+ /**
4
+ * Resolves the pipe decorator and return its properties.
5
+ *
6
+ * @param cls - class declaration
7
+ */
8
+ export declare function getPipeDecorator(cls: ClassDeclaration): Pipe | undefined;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPipeDecorator = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const string_expression_1 = require("../string-expression");
6
+ const typescript_1 = require("../typescript");
7
+ /**
8
+ * Resolves the pipe decorator and return its properties.
9
+ *
10
+ * @param cls - class declaration
11
+ */
12
+ function getPipeDecorator(cls) {
13
+ const decorator = cls.getDecorator('Pipe');
14
+ const decoratorArgument = decorator === null || decorator === void 0 ? void 0 : decorator.getArguments()[0];
15
+ if (ts_morph_1.Node.isObjectLiteralExpression(decoratorArgument)) {
16
+ const standaloneProperty = decoratorArgument.getProperty('standalone');
17
+ const nameProperty = decoratorArgument.getProperty('name');
18
+ return {
19
+ standalone: (0, string_expression_1.stringExpression)((0, typescript_1.getPropertyAssignment)(standaloneProperty)),
20
+ name: (0, string_expression_1.stringExpression)((0, typescript_1.getPropertyAssignment)(nameProperty)),
21
+ };
22
+ }
23
+ return undefined;
24
+ }
25
+ exports.getPipeDecorator = getPipeDecorator;
26
+ //# sourceMappingURL=get-pipe-decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pipe-decorator.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/angular/get-pipe-decorator.ts"],"names":[],"mappings":";;;AACA,uCAAqF;AAErF,4DAAsD;AACtD,8CAAoD;AAEpD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,GAAqB;IACrD,MAAM,SAAS,GAA0B,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAClE,MAAM,iBAAiB,GAAqB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,GAAG,CAAC,CAAC,CAAC;IAEzE,IAAI,eAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE;QACtD,MAAM,kBAAkB,GAAyC,iBAAiB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC7G,MAAM,YAAY,GAAyC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEjG,OAAO;YACN,UAAU,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,kBAAkB,CAAC,CAAC;YACvE,IAAI,EAAE,IAAA,oCAAgB,EAAC,IAAA,kCAAqB,EAAC,YAAY,CAAC,CAAC;SAC3D,CAAC;KACF;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAfD,4CAeC"}
@@ -1,3 +1,4 @@
1
- export * from './component-decorator';
2
- export * from './directive-decorator';
1
+ export * from './get-component-decorator';
2
+ export * from './get-directive-decorator';
3
+ export * from './get-pipe-decorator';
3
4
  export * from './is-standalone';
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./component-decorator"), exports);
5
- tslib_1.__exportStar(require("./directive-decorator"), exports);
4
+ tslib_1.__exportStar(require("./get-component-decorator"), exports);
5
+ tslib_1.__exportStar(require("./get-directive-decorator"), exports);
6
+ tslib_1.__exportStar(require("./get-pipe-decorator"), exports);
6
7
  tslib_1.__exportStar(require("./is-standalone"), exports);
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/angular/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC;AACtC,gEAAsC;AACtC,0DAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/angular/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,oEAA0C;AAC1C,+DAAqC;AACrC,0DAAgC"}