@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.
Files changed (250) 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/helpers/accessor.html.nunj +2 -1
  209. package/templates/helpers/constructor.html.nunj +1 -1
  210. package/templates/helpers/members.html.nunj +2 -1
  211. package/templates/helpers/method.html.nunj +1 -1
  212. package/templates/helpers/parameters.html.nunj +2 -2
  213. package/templates/helpers/properties.html.nunj +1 -1
  214. package/templates/playgrounds.ts.nunj +15 -19
  215. package/engine/builder.d.ts +0 -23
  216. package/engine/builder.js +0 -125
  217. package/engine/builder.js.map +0 -1
  218. package/engine/entity-life-cycle.d.ts +0 -15
  219. package/engine/entity-life-cycle.js +0 -32
  220. package/engine/entity-life-cycle.js.map +0 -1
  221. package/engine/extentions/index.extension.js.map +0 -1
  222. package/engine/renderer.d.ts +0 -7
  223. package/engine/renderer.js +0 -49
  224. package/engine/renderer.js.map +0 -1
  225. package/engine/template-filters.d.ts +0 -2
  226. package/engine/template-filters.js.map +0 -1
  227. package/helpers/angular/component-decorator.js.map +0 -1
  228. package/helpers/angular/directive-decorator.js.map +0 -1
  229. package/helpers/get-playground-by-id.js.map +0 -1
  230. package/helpers/get-playground-properties.d.ts +0 -25
  231. package/helpers/get-playground-properties.js +0 -113
  232. package/helpers/get-playground-properties.js.map +0 -1
  233. package/helpers/get-playground-targets.d.ts +0 -6
  234. package/helpers/get-playground-targets.js +0 -21
  235. package/helpers/get-playground-targets.js.map +0 -1
  236. package/helpers/get-playgrounds-expression.js.map +0 -1
  237. package/helpers/get-playgrounds-ids.js.map +0 -1
  238. package/helpers/print-progress.d.ts +0 -6
  239. package/helpers/print-progress.js +0 -19
  240. package/helpers/print-progress.js.map +0 -1
  241. package/interfaces/built-output.d.ts +0 -4
  242. package/interfaces/built-output.js.map +0 -1
  243. /package/engine/{extentions → nunjucks/extentions}/index.extension.d.ts +0 -0
  244. /package/engine/{extentions → nunjucks/extentions}/index.extension.js +0 -0
  245. /package/helpers/{get-playground-by-id.d.ts → playground/get-playground-by-id.d.ts} +0 -0
  246. /package/helpers/{get-playground-by-id.js → playground/get-playground-by-id.js} +0 -0
  247. /package/helpers/{get-playgrounds-expression.d.ts → playground/get-playgrounds-expression.d.ts} +0 -0
  248. /package/helpers/{get-playgrounds-expression.js → playground/get-playgrounds-expression.js} +0 -0
  249. /package/helpers/{get-playgrounds-ids.d.ts → playground/get-playgrounds-ids.d.ts} +0 -0
  250. /package/helpers/{get-playgrounds-ids.js → playground/get-playgrounds-ids.js} +0 -0
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildPlaygroundMetadata = void 0;
4
+ const core_1 = require("@ng-doc/core");
5
+ const angular_1 = require("../angular");
6
+ const extract_selectors_1 = require("../extract-selectors");
7
+ const get_content_for_playground_1 = require("./get-content-for-playground");
8
+ const get_playground_inputs_1 = require("./get-playground-inputs");
9
+ const get_playground_template_inputs_1 = require("./get-playground-template-inputs");
10
+ const get_target_for_playground_1 = require("./get-target-for-playground");
11
+ const get_template_for_playground_1 = require("./get-template-for-playground");
12
+ /**
13
+ * Collects all the information about a playground that is needed to render and build it.
14
+ *
15
+ * @param id - The id of the playground
16
+ * @param playground - The playground object
17
+ */
18
+ function buildPlaygroundMetadata(id, playground) {
19
+ var _a, _b;
20
+ const target = (0, get_target_for_playground_1.getTargetForPlayground)(playground);
21
+ if (!target) {
22
+ throw new Error(`Can't find "target" for playground "${id}"`);
23
+ }
24
+ const decorator = (_b = (_a = (0, angular_1.getComponentDecorator)(target)) !== null && _a !== void 0 ? _a : (0, angular_1.getDirectiveDecorator)(target)) !== null && _b !== void 0 ? _b : (0, angular_1.getPipeDecorator)(target);
25
+ if (!decorator) {
26
+ throw new Error(`Invalid target class for playground "${id}". Make sure that the class is decorated with @Component, @Directive or @Pipe.`);
27
+ }
28
+ const template = (0, get_template_for_playground_1.getTemplateForPlayground)(playground);
29
+ const content = (0, get_content_for_playground_1.getContentForPlayground)(playground);
30
+ const standalone = (0, angular_1.isStandalone)(target);
31
+ if ('selector' in decorator) {
32
+ const selector = decorator.selector.replace(/[\n\s]/gm, '');
33
+ const properties = (0, get_playground_inputs_1.getPlaygroundComponentInputs)(target);
34
+ const templateInputs = (0, get_playground_template_inputs_1.getPlaygroundTemplateInputs)(properties);
35
+ return {
36
+ selector: selector,
37
+ standalone,
38
+ template,
39
+ templateForComponents: (0, extract_selectors_1.extractSelectors)(target).reduce((templateForComponents, selector) => {
40
+ return Object.assign(Object.assign({}, templateForComponents), { [selector]: (0, core_1.buildPlaygroundDemoTemplate)(template, selector, content, templateInputs, false) });
41
+ }, {}),
42
+ class: target,
43
+ properties,
44
+ content,
45
+ };
46
+ }
47
+ else if ('name' in decorator) {
48
+ const name = decorator.name.replace(/[\n\s]/gm, '');
49
+ const properties = (0, get_playground_inputs_1.getPlaygroundPipeInputs)(target);
50
+ const templateInputs = (0, get_playground_template_inputs_1.getPlaygroundTemplateInputs)(properties);
51
+ return {
52
+ name,
53
+ standalone,
54
+ template,
55
+ templateForComponents: { [name]: (0, core_1.buildPlaygroundDemoPipeTemplate)(template, name, content, templateInputs, false) },
56
+ class: target,
57
+ properties,
58
+ content,
59
+ };
60
+ }
61
+ else {
62
+ throw new Error(`Invalid target for playground "${id}". Make sure that your @Component/@Directive has a "selector" property or "name" property if you are using @Pipe.`);
63
+ }
64
+ }
65
+ exports.buildPlaygroundMetadata = buildPlaygroundMetadata;
66
+ //# sourceMappingURL=build-playground-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-playground-metadata.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/build-playground-metadata.ts"],"names":[],"mappings":";;;AACA,uCAAqH;AAIrH,wCAAwG;AACxG,4DAAsD;AACtD,6EAAqE;AACrE,mEAA8F;AAC9F,qFAA6E;AAC7E,2EAAmE;AACnE,+EAAuE;AAEvE;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,EAAU,EAAE,UAAmC;;IACtF,MAAM,MAAM,GAAiC,IAAA,kDAAsB,EAAC,UAAU,CAAC,CAAC;IAEhF,IAAI,CAAC,MAAM,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAC;KAC9D;IAED,MAAM,SAAS,GACd,MAAA,MAAA,IAAA,+BAAqB,EAAC,MAAM,CAAC,mCAAI,IAAA,+BAAqB,EAAC,MAAM,CAAC,mCAAI,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;IAE5F,IAAI,CAAC,SAAS,EAAE;QACf,MAAM,IAAI,KAAK,CACd,wCAAwC,EAAE,gFAAgF,CAC1H,CAAC;KACF;IAED,MAAM,QAAQ,GAAW,IAAA,sDAAwB,EAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,OAAO,GAA2B,IAAA,oDAAuB,EAAC,UAAU,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAY,IAAA,sBAAY,EAAC,MAAM,CAAC,CAAC;IAEjD,IAAI,UAAU,IAAI,SAAS,EAAE;QAC5B,MAAM,QAAQ,GAAW,SAAS,CAAC,QAAS,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACrE,MAAM,UAAU,GAA8B,IAAA,oDAA4B,EAAC,MAAM,CAAC,CAAC;QACnF,MAAM,cAAc,GAA2B,IAAA,4DAA2B,EAAC,UAAU,CAAC,CAAC;QAEvF,OAAO;YACN,QAAQ,EAAE,QAAQ;YAClB,UAAU;YACV,QAAQ;YACR,qBAAqB,EAAE,IAAA,oCAAgB,EAAC,MAAM,CAAC,CAAC,MAAM,CACrD,CAAC,qBAA6C,EAAE,QAAgB,EAAE,EAAE;gBACnE,uCACI,qBAAqB,KACxB,CAAC,QAAQ,CAAC,EAAE,IAAA,kCAA2B,EAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,IAC1F;YACH,CAAC,EACD,EAAE,CACF;YACD,KAAK,EAAE,MAAM;YACb,UAAU;YACV,OAAO;SACP,CAAC;KACF;SAAM,IAAI,MAAM,IAAI,SAAS,EAAE;QAC/B,MAAM,IAAI,GAAW,SAAS,CAAC,IAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,UAAU,GAA8B,IAAA,+CAAuB,EAAC,MAAM,CAAC,CAAC;QAC9E,MAAM,cAAc,GAA2B,IAAA,4DAA2B,EAAC,UAAU,CAAC,CAAC;QAEvF,OAAO;YACN,IAAI;YACJ,UAAU;YACV,QAAQ;YACR,qBAAqB,EAAE,EAAC,CAAC,IAAI,CAAC,EAAE,IAAA,sCAA+B,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAC;YAChH,KAAK,EAAE,MAAM;YACb,UAAU;YACV,OAAO;SACP,CAAC;KACF;SAAM;QACN,MAAM,IAAI,KAAK,CACd,kCAAkC,EAAE,mHAAmH,CACvJ,CAAC;KACF;AACF,CAAC;AA7DD,0DA6DC"}
@@ -0,0 +1,8 @@
1
+ import { ObjectLiteralExpression } from 'ts-morph';
2
+ /**
3
+ *
4
+ * @param expression
5
+ * @param playgroundId
6
+ * @param playground
7
+ */
8
+ export declare function getContentForPlayground(playground: ObjectLiteralExpression): Record<string, string>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getContentForPlayground = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ /**
6
+ *
7
+ * @param expression
8
+ * @param playgroundId
9
+ * @param playground
10
+ */
11
+ function getContentForPlayground(playground) {
12
+ const content = playground.getProperty('content');
13
+ if (ts_morph_1.Node.isPropertyAssignment(content)) {
14
+ const contentInitializer = content.getInitializer();
15
+ if (ts_morph_1.Node.isObjectLiteralExpression(contentInitializer)) {
16
+ return contentInitializer
17
+ .getProperties()
18
+ .reduce((content, property) => {
19
+ if (ts_morph_1.Node.isPropertyAssignment(property)) {
20
+ const initializer = property.getInitializer();
21
+ if (ts_morph_1.Node.isObjectLiteralExpression(initializer)) {
22
+ const templateProperty = initializer.getProperty('template');
23
+ if (ts_morph_1.Node.isPropertyAssignment(templateProperty)) {
24
+ const templateInitializer = templateProperty.getInitializer();
25
+ if (ts_morph_1.Node.isStringLiteral(templateInitializer) ||
26
+ ts_morph_1.Node.isNoSubstitutionTemplateLiteral(templateInitializer)) {
27
+ content[property.getName()] = templateInitializer.getLiteralValue();
28
+ }
29
+ }
30
+ }
31
+ }
32
+ return content;
33
+ }, {});
34
+ }
35
+ }
36
+ return {};
37
+ }
38
+ exports.getContentForPlayground = getContentForPlayground;
39
+ //# sourceMappingURL=get-content-for-playground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-content-for-playground.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-content-for-playground.ts"],"names":[],"mappings":";;;AAAA,uCAA6F;AAE7F;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,UAAmC;IAC1E,MAAM,OAAO,GAAyC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAExF,IAAI,eAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE;QACvC,MAAM,kBAAkB,GAA2B,OAAO,CAAC,cAAc,EAAE,CAAC;QAE5E,IAAI,eAAI,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,EAAE;YACvD,OAAO,kBAAkB;iBACvB,aAAa,EAAE;iBACf,MAAM,CAAC,CAAC,OAA+B,EAAE,QAAkC,EAAE,EAAE;gBAC/E,IAAI,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE;oBACxC,MAAM,WAAW,GAA2B,QAAQ,CAAC,cAAc,EAAE,CAAC;oBAEtE,IAAI,eAAI,CAAC,yBAAyB,CAAC,WAAW,CAAC,EAAE;wBAChD,MAAM,gBAAgB,GAAyC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;wBAEnG,IAAI,eAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,EAAE;4BAChD,MAAM,mBAAmB,GAA2B,gBAAgB,CAAC,cAAc,EAAE,CAAC;4BAEtF,IACC,eAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC;gCACzC,eAAI,CAAC,+BAA+B,CAAC,mBAAmB,CAAC,EACxD;gCACD,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC,eAAe,EAAE,CAAC;6BACpE;yBACD;qBACD;iBACD;gBAED,OAAO,OAAO,CAAC;YAChB,CAAC,EAAE,EAAE,CAAC,CAAC;SACR;KACD;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAnCD,0DAmCC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-playground-by-id.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-playground-by-id.ts"],"names":[],"mappings":";;;AAAA,uCAA6F;AAE7F;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,UAAmC,EAAE,YAAoB;IAC1F,MAAM,oBAAoB,GAAyC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAExG,IAAI,eAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,EAAE;QACpD,MAAM,qBAAqB,GAA2B,oBAAoB,CAAC,cAAc,EAAE,CAAC;QAE5F,IAAI,eAAI,CAAC,yBAAyB,CAAC,qBAAqB,CAAC,EAAE;YAC1D,OAAO,qBAAqB,CAAC;SAC7B;KACD;IAED,OAAO,SAAS,CAAA;AACjB,CAAC;AAZD,8CAYC"}
@@ -0,0 +1,12 @@
1
+ import { NgDocPlaygroundProperties } from '@ng-doc/core';
2
+ import { ClassDeclaration } from 'ts-morph';
3
+ /**
4
+ *
5
+ * @param declaration
6
+ */
7
+ export declare function getPlaygroundComponentInputs(declaration: ClassDeclaration): NgDocPlaygroundProperties;
8
+ /**
9
+ *
10
+ * @param declaration
11
+ */
12
+ export declare function getPlaygroundPipeInputs(declaration: ClassDeclaration): NgDocPlaygroundProperties;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPlaygroundPipeInputs = exports.getPlaygroundComponentInputs = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const extract_docs_1 = require("../extract-docs");
6
+ const typescript_1 = require("../typescript");
7
+ /**
8
+ *
9
+ * @param declaration
10
+ */
11
+ function getPlaygroundComponentInputs(declaration) {
12
+ return declaration
13
+ .getProperties()
14
+ .filter((property) => !!property.getDecorator('Input'))
15
+ .reduce((properties, property) => {
16
+ var _a, _b, _c;
17
+ const inputName = (_c = (_b = (_a = property
18
+ .getDecorator('Input')) === null || _a === void 0 ? void 0 : _a.getArguments()[0]) === null || _b === void 0 ? void 0 : _b.getText().replace(/^["']|['"]$/g, '')) !== null && _c !== void 0 ? _c : property.getName();
19
+ return Object.assign(Object.assign({}, properties), propOrParamToPlaygroundProperty(property, inputName));
20
+ }, {});
21
+ }
22
+ exports.getPlaygroundComponentInputs = getPlaygroundComponentInputs;
23
+ /**
24
+ *
25
+ * @param declaration
26
+ */
27
+ function getPlaygroundPipeInputs(declaration) {
28
+ return declaration
29
+ .getMethodOrThrow('transform')
30
+ .getParameters()
31
+ .slice(1)
32
+ .reduce((properties, parameter) => {
33
+ return Object.assign(Object.assign({}, properties), propOrParamToPlaygroundProperty(parameter));
34
+ }, {});
35
+ }
36
+ exports.getPlaygroundPipeInputs = getPlaygroundPipeInputs;
37
+ /**
38
+ *
39
+ * @param propOrParam
40
+ * @param inputName
41
+ */
42
+ function propOrParamToPlaygroundProperty(propOrParam, inputName) {
43
+ var _a, _b;
44
+ const type = (0, typescript_1.displayType)(propOrParam, ts_morph_1.TypeFormatFlags.NoTruncation | ts_morph_1.TypeFormatFlags.UseSingleQuotesForStringLiteralType);
45
+ return {
46
+ [propOrParam.getName()]: {
47
+ inputName: inputName !== null && inputName !== void 0 ? inputName : propOrParam.getName(),
48
+ type,
49
+ default: (_b = (_a = propOrParam.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText()) !== null && _b !== void 0 ? _b : defaultForType(type),
50
+ description: ts_morph_1.Node.isPropertyDeclaration(propOrParam)
51
+ ? (0, extract_docs_1.extractDocs)(propOrParam)
52
+ : (0, extract_docs_1.extractParameterDocs)(propOrParam.getParentIfKindOrThrow(ts_morph_1.SyntaxKind.MethodDeclaration), propOrParam.getName()),
53
+ options: propOrParam
54
+ .getType()
55
+ .getUnionTypes()
56
+ .map((type) => type.getText(undefined, ts_morph_1.TypeFormatFlags.NoTruncation | ts_morph_1.TypeFormatFlags.UseSingleQuotesForStringLiteralType)),
57
+ },
58
+ };
59
+ }
60
+ /**
61
+ *
62
+ * @param type
63
+ */
64
+ function defaultForType(type) {
65
+ switch (type) {
66
+ case 'boolean':
67
+ return 'false';
68
+ default:
69
+ return 'undefined';
70
+ }
71
+ }
72
+ //# sourceMappingURL=get-playground-inputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-playground-inputs.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-playground-inputs.ts"],"names":[],"mappings":";;;AACA,uCAQkB;AAElB,kDAAkE;AAClE,8CAA0C;AAE1C;;;GAGG;AACH,SAAgB,4BAA4B,CAAC,WAA6B;IACzE,OAAO,WAAW;SAChB,aAAa,EAAE;SACf,MAAM,CAAC,CAAC,QAA6B,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SAC3E,MAAM,CAAC,CAAC,UAAqC,EAAE,QAA6B,EAAE,EAAE;;QAChF,MAAM,SAAS,GACd,MAAA,MAAA,MAAA,QAAQ;aACN,YAAY,CAAC,OAAO,CAAC,0CACpB,YAAY,GAAG,CAAC,CAAC,0CACjB,OAAO,GACR,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,mCAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QAErD,uCAAW,UAAU,GAAK,+BAA+B,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE;IACjF,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAdD,oEAcC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,WAA6B;IACpE,OAAO,WAAW;SAChB,gBAAgB,CAAC,WAAW,CAAC;SAC7B,aAAa,EAAE;SACf,KAAK,CAAC,CAAC,CAAC;SACR,MAAM,CAAC,CAAC,UAAqC,EAAE,SAA+B,EAAE,EAAE;QAClF,uCAAW,UAAU,GAAK,+BAA+B,CAAC,SAAS,CAAC,EAAE;IACvE,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AARD,0DAQC;AAED;;;;GAIG;AACH,SAAS,+BAA+B,CACvC,WAAuD,EACvD,SAAkB;;IAElB,MAAM,IAAI,GAAW,IAAA,wBAAW,EAC/B,WAAW,EACX,0BAAe,CAAC,YAAY,GAAG,0BAAe,CAAC,mCAAmC,CAClF,CAAC;IAEF,OAAO;QACN,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE;YACxB,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,WAAW,CAAC,OAAO,EAAE;YAC7C,IAAI;YACJ,OAAO,EAAE,MAAA,MAAA,WAAW,CAAC,cAAc,EAAE,0CAAE,OAAO,EAAE,mCAAI,cAAc,CAAC,IAAI,CAAC;YACxE,WAAW,EAAE,eAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC;gBACnD,CAAC,CAAC,IAAA,0BAAW,EAAC,WAAW,CAAC;gBAC1B,CAAC,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC,sBAAsB,CAAC,qBAAU,CAAC,iBAAiB,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC;YAChH,OAAO,EAAE,WAAW;iBAClB,OAAO,EAAE;iBACT,aAAa,EAAE;iBACf,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE,CACnB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,0BAAe,CAAC,YAAY,GAAG,0BAAe,CAAC,mCAAmC,CAAC,CAC3G;SACF;KACD,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAY;IACnC,QAAQ,IAAI,EAAE;QACb,KAAK,SAAS;YACb,OAAO,OAAO,CAAC;QAChB;YACC,OAAO,WAAW,CAAC;KACpB;AACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { NgDocPlaygroundProperties } from '@ng-doc/core';
2
+ /**
3
+ *
4
+ * @param declaration
5
+ * @param properties
6
+ */
7
+ export declare function getPlaygroundTemplateInputs(properties: NgDocPlaygroundProperties): Record<string, string>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPlaygroundTemplateInputs = void 0;
4
+ /**
5
+ *
6
+ * @param declaration
7
+ * @param properties
8
+ */
9
+ function getPlaygroundTemplateInputs(properties) {
10
+ return Object.keys(properties).reduce((inputs, property) => {
11
+ const inputName = properties[property].inputName;
12
+ inputs[inputName] = `properties['${property}']`;
13
+ return inputs;
14
+ }, {});
15
+ }
16
+ exports.getPlaygroundTemplateInputs = getPlaygroundTemplateInputs;
17
+ //# sourceMappingURL=get-playground-template-inputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-playground-template-inputs.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-playground-template-inputs.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,UAAqC;IAChF,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,MAA8B,EAAE,QAAgB,EAAE,EAAE;QAC1F,MAAM,SAAS,GAAW,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC;QAEzD,MAAM,CAAC,SAAS,CAAC,GAAG,eAAe,QAAQ,IAAI,CAAC;QAEhD,OAAO,MAAM,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;AACR,CAAC;AARD,kEAQC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-playgrounds-expression.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-playgrounds-expression.ts"],"names":[],"mappings":";;;AAAA,uCAA6F;AAE7F;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,uBAAgD;IAEhD,IAAI,uBAAuB,EAAE;QAC5B,MAAM,QAAQ,GAAyC,uBAAuB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAE1G,IAAI,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE;YACxC,MAAM,KAAK,GAA2B,QAAQ,CAAC,cAAc,EAAE,CAAC;YAEhE,IAAI,eAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAE;gBAC1C,OAAO,KAAK,CAAC;aACb;SACD;KACD;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAhBD,4DAgBC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-playgrounds-ids.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-playgrounds-ids.ts"],"names":[],"mappings":";;;AAAA,uCAA2E;AAE3E;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,UAAmC;;IACpE,OAAO,CACN,MAAA,UAAU;SACR,aAAa,EAAE;SACf,MAAM,CAAC,eAAI,CAAC,oBAAoB,CAAC;SACjC,GAAG,CAAC,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,mCAAI,EAAE,CACnD,CAAC;AACH,CAAC;AAPD,8CAOC"}
@@ -0,0 +1,8 @@
1
+ import { ClassDeclaration, ObjectLiteralExpression } from 'ts-morph';
2
+ /**
3
+ *
4
+ * @param expression
5
+ * @param playgroundId
6
+ * @param playground
7
+ */
8
+ export declare function getTargetForPlayground(playground: ObjectLiteralExpression): ClassDeclaration | undefined;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTargetForPlayground = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ /**
6
+ *
7
+ * @param expression
8
+ * @param playgroundId
9
+ * @param playground
10
+ */
11
+ function getTargetForPlayground(playground) {
12
+ var _a, _b;
13
+ const target = playground.getProperty('target');
14
+ if (ts_morph_1.Node.isPropertyAssignment(target)) {
15
+ const targetInitializer = target.getInitializer();
16
+ if (ts_morph_1.Node.isIdentifier(targetInitializer)) {
17
+ const declaration = (_b = (_a = targetInitializer.getType()) === null || _a === void 0 ? void 0 : _a.getSymbol()) === null || _b === void 0 ? void 0 : _b.getDeclarations()[0];
18
+ if (ts_morph_1.Node.isClassDeclaration(declaration)) {
19
+ return declaration;
20
+ }
21
+ }
22
+ }
23
+ return undefined;
24
+ }
25
+ exports.getTargetForPlayground = getTargetForPlayground;
26
+ //# sourceMappingURL=get-target-for-playground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-target-for-playground.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-target-for-playground.ts"],"names":[],"mappings":";;;AAAA,uCAA+G;AAE/G;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,UAAmC;;IACzE,MAAM,MAAM,GAAyC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEtF,IAAI,eAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE;QACtC,MAAM,iBAAiB,GAA2B,MAAM,CAAC,cAAc,EAAE,CAAC;QAE1E,IAAI,eAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE;YACzC,MAAM,WAAW,GAAqB,MAAA,MAAA,iBAAiB,CAAC,OAAO,EAAE,0CAAE,SAAS,EAAE,0CAAE,eAAe,GAAG,CAAC,CAAC,CAAC;YAErG,IAAI,eAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE;gBACzC,OAAO,WAAW,CAAC;aACnB;SACD;KACD;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAhBD,wDAgBC"}
@@ -0,0 +1,8 @@
1
+ import { ObjectLiteralExpression } from 'ts-morph';
2
+ /**
3
+ *
4
+ * @param expression
5
+ * @param playgroundId
6
+ * @param playground
7
+ */
8
+ export declare function getTemplateForPlayground(playground: ObjectLiteralExpression): string;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTemplateForPlayground = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ /**
6
+ *
7
+ * @param expression
8
+ * @param playgroundId
9
+ * @param playground
10
+ */
11
+ function getTemplateForPlayground(playground) {
12
+ const template = playground.getProperty('template');
13
+ if (ts_morph_1.Node.isPropertyAssignment(template)) {
14
+ const templateInitializer = template.getInitializer();
15
+ if (ts_morph_1.Node.isStringLiteral(templateInitializer) || ts_morph_1.Node.isNoSubstitutionTemplateLiteral(templateInitializer)) {
16
+ return templateInitializer.getLiteralValue();
17
+ }
18
+ }
19
+ return '';
20
+ }
21
+ exports.getTemplateForPlayground = getTemplateForPlayground;
22
+ //# sourceMappingURL=get-template-for-playground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-template-for-playground.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/get-template-for-playground.ts"],"names":[],"mappings":";;;AAAA,uCAA6F;AAE7F;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,UAAmC;IAC3E,MAAM,QAAQ,GAAyC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE1F,IAAI,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE;QACxC,MAAM,mBAAmB,GAA2B,QAAQ,CAAC,cAAc,EAAE,CAAC;QAE9E,IAAI,eAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,IAAI,eAAI,CAAC,+BAA+B,CAAC,mBAAmB,CAAC,EAAE;YAC3G,OAAO,mBAAmB,CAAC,eAAe,EAAE,CAAC;SAC7C;KACD;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAZD,4DAYC"}
@@ -0,0 +1,9 @@
1
+ export * from './build-playground-metadata';
2
+ export * from './get-content-for-playground';
3
+ export * from './get-playground-by-id';
4
+ export * from './get-playground-inputs';
5
+ export * from './get-playground-template-inputs';
6
+ export * from './get-playgrounds-expression';
7
+ export * from './get-playgrounds-ids';
8
+ export * from './get-target-for-playground';
9
+ export * from './get-template-for-playground';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./build-playground-metadata"), exports);
5
+ tslib_1.__exportStar(require("./get-content-for-playground"), exports);
6
+ tslib_1.__exportStar(require("./get-playground-by-id"), exports);
7
+ tslib_1.__exportStar(require("./get-playground-inputs"), exports);
8
+ tslib_1.__exportStar(require("./get-playground-template-inputs"), exports);
9
+ tslib_1.__exportStar(require("./get-playgrounds-expression"), exports);
10
+ tslib_1.__exportStar(require("./get-playgrounds-ids"), exports);
11
+ tslib_1.__exportStar(require("./get-target-for-playground"), exports);
12
+ tslib_1.__exportStar(require("./get-template-for-playground"), exports);
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/playground/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,uEAA6C;AAC7C,iEAAuC;AACvC,kEAAwC;AACxC,2EAAiD;AACjD,uEAA6C;AAC7C,gEAAsC;AACtC,sEAA4C;AAC5C,wEAA8C"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Prints a progress message. If no message is passed, the message will be cleared.
3
+ *
4
+ * @param text - The message to print.
5
+ */
6
+ export declare function printProgress(text?: string): void;
7
+ /**
8
+ * Prints an info message.
9
+ *
10
+ * @param info - The info to print.
11
+ */
12
+ export declare function printInfo(info: string): void;
13
+ /**
14
+ * Prints a warning message.
15
+ *
16
+ * @param warn - The warning to print.
17
+ */
18
+ export declare function printWarning(warn: string): void;
19
+ /**
20
+ * Prints an error message.
21
+ *
22
+ * @param error - The error to print.
23
+ */
24
+ export declare function printError(error: string): void;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printError = exports.printWarning = exports.printInfo = exports.printProgress = void 0;
4
+ const spinner_1 = require("@angular/cli/src/utilities/spinner");
5
+ const spinner = new spinner_1.Spinner();
6
+ /**
7
+ * Prints a progress message. If no message is passed, the message will be cleared.
8
+ *
9
+ * @param text - The message to print.
10
+ */
11
+ function printProgress(text) {
12
+ spinner.stop();
13
+ if (text) {
14
+ spinner.text = `NgDoc: ${text}`;
15
+ spinner.start();
16
+ }
17
+ }
18
+ exports.printProgress = printProgress;
19
+ /**
20
+ * Prints an info message.
21
+ *
22
+ * @param info - The info to print.
23
+ */
24
+ function printInfo(info) {
25
+ spinner.info(info);
26
+ }
27
+ exports.printInfo = printInfo;
28
+ /**
29
+ * Prints a warning message.
30
+ *
31
+ * @param warn - The warning to print.
32
+ */
33
+ function printWarning(warn) {
34
+ spinner.warn(warn);
35
+ }
36
+ exports.printWarning = printWarning;
37
+ /**
38
+ * Prints an error message.
39
+ *
40
+ * @param error - The error to print.
41
+ */
42
+ function printError(error) {
43
+ spinner.fail(error);
44
+ }
45
+ exports.printError = printError;
46
+ //# sourceMappingURL=print.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/print.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAE3D,MAAM,OAAO,GAAY,IAAI,iBAAO,EAAE,CAAC;AAEvC;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAa;IAC1C,OAAO,CAAC,IAAI,EAAE,CAAC;IAEf,IAAI,IAAI,EAAE;QACT,OAAO,CAAC,IAAI,GAAG,UAAU,IAAI,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,EAAE,CAAC;KAChB;AACF,CAAC;AAPD,sCAOC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,IAAY;IACrC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY;IACxC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAFD,oCAEC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAAC,KAAa;IACvC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC;AAFD,gCAEC"}
@@ -1,8 +1,15 @@
1
- import { NgDocEntity } from '../engine/entities/abstractions/entity';
1
+ import { NgDocRouteEntity } from '../engine/entities/abstractions/route.entity';
2
2
  /**
3
3
  * Processes html content for the current entity
4
4
  *
5
5
  * @param entity - The current entity
6
6
  * @param html - The html content to process
7
7
  */
8
- export declare function processHtml(entity: NgDocEntity, html: string): Promise<string>;
8
+ export declare function processHtml(entity: NgDocRouteEntity, html: string): Promise<string>;
9
+ /**
10
+ * Post-Processes html content for the current entity
11
+ *
12
+ * @param entity - The current entity
13
+ * @param html - The html content to process
14
+ */
15
+ export declare function postProcessHtml(entity: NgDocRouteEntity, html: string): Promise<string>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processHtml = void 0;
4
- const entity_type_1 = require("./entity-type");
3
+ exports.postProcessHtml = exports.processHtml = void 0;
4
+ const tslib_1 = require("tslib");
5
5
  const import_es_module_1 = require("./import-es-module");
6
6
  /**
7
7
  * Processes html content for the current entity
@@ -9,16 +9,35 @@ const import_es_module_1 = require("./import-es-module");
9
9
  * @param entity - The current entity
10
10
  * @param html - The html content to process
11
11
  */
12
- async function processHtml(entity, html) {
12
+ function processHtml(entity, html) {
13
13
  var _a;
14
- const utils = await (0, import_es_module_1.importEsModule)('@ng-doc/utils');
15
- return utils.htmlPostProcessor(html, {
16
- headings: (_a = entity.context.config.guide) === null || _a === void 0 ? void 0 : _a.anchorHeadings,
17
- route: (0, entity_type_1.isRouteEntity)(entity) ? entity.fullRoute : undefined,
18
- addUsedKeyword: entity.usedKeywords.add.bind(entity.usedKeywords),
19
- addPotentialKeyword: entity.potentialKeywords.add.bind(entity.potentialKeywords),
20
- getKeyword: entity.builder.entities.getByKeyword.bind(entity.builder.entities),
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ const utils = yield (0, import_es_module_1.importEsModule)('@ng-doc/utils');
16
+ return utils.htmlProcessor(html, {
17
+ headings: (_a = entity.context.config.guide) === null || _a === void 0 ? void 0 : _a.anchorHeadings,
18
+ route: entity.fullRoute,
19
+ raiseError: entity.warnings.push.bind(entity.warnings),
20
+ addAnchor: (anchor) => entity.anchors.push(anchor),
21
+ });
21
22
  });
22
23
  }
23
24
  exports.processHtml = processHtml;
25
+ /**
26
+ * Post-Processes html content for the current entity
27
+ *
28
+ * @param entity - The current entity
29
+ * @param html - The html content to process
30
+ */
31
+ function postProcessHtml(entity, html) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ const utils = yield (0, import_es_module_1.importEsModule)('@ng-doc/utils');
34
+ return utils.htmlPostProcessor(html, {
35
+ raiseError: entity.warnings.push.bind(entity.warnings),
36
+ addUsedKeyword: entity.usedKeywords.add.bind(entity.usedKeywords),
37
+ addPotentialKeyword: entity.potentialKeywords.add.bind(entity.potentialKeywords),
38
+ getKeyword: entity.store.getByKeyword.bind(entity.store),
39
+ });
40
+ });
41
+ }
42
+ exports.postProcessHtml = postProcessHtml;
24
43
  //# sourceMappingURL=process-html.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-html.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/process-html.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAC5C,yDAAkD;AAIlD;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAAC,MAAmB,EAAE,IAAY;;IAClE,MAAM,KAAK,GAAU,MAAM,IAAA,iCAAc,EAAQ,eAAe,CAAC,CAAC;IAElE,OAAO,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE;QACpC,QAAQ,EAAE,MAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,0CAAE,cAAc;QACrD,KAAK,EAAE,IAAA,2BAAa,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC3D,cAAc,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QACjE,mBAAmB,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAChF,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;KAC9E,CAAC,CAAC;AACJ,CAAC;AAVD,kCAUC"}
1
+ {"version":3,"file":"process-html.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/process-html.ts"],"names":[],"mappings":";;;;AAGA,yDAAkD;AAIlD;;;;;GAKG;AACH,SAAsB,WAAW,CAAC,MAAwB,EAAE,IAAY;;;QACvE,MAAM,KAAK,GAAU,MAAM,IAAA,iCAAc,EAAQ,eAAe,CAAC,CAAC;QAElE,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;YAChC,QAAQ,EAAE,MAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,0CAAE,cAAc;YACrD,KAAK,EAAE,MAAM,CAAC,SAAS;YACvB,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACtD,SAAS,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;SACrE,CAAC,CAAC;;CACH;AATD,kCASC;AAED;;;;;GAKG;AACH,SAAsB,eAAe,CAAC,MAAwB,EAAE,IAAY;;QAC3E,MAAM,KAAK,GAAU,MAAM,IAAA,iCAAc,EAAQ,eAAe,CAAC,CAAC;QAElE,OAAO,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE;YACpC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACtD,cAAc,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;YACjE,mBAAmB,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;YAChF,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;SACxD,CAAC,CAAC;IACJ,CAAC;CAAA;AATD,0CASC"}
@@ -11,10 +11,10 @@ function groupAccessors(accessors) {
11
11
  const map = new Map();
12
12
  accessors.forEach((accessor) => {
13
13
  if (ts_morph_1.Node.isGetAccessorDeclaration(accessor)) {
14
- map.set(accessor.getName(), { ...map.get(accessor.getName()), get: accessor });
14
+ map.set(accessor.getName(), Object.assign(Object.assign({}, map.get(accessor.getName())), { get: accessor }));
15
15
  }
16
16
  if (ts_morph_1.Node.isSetAccessorDeclaration(accessor)) {
17
- map.set(accessor.getName(), { ...map.get(accessor.getName()), set: accessor });
17
+ map.set(accessor.getName(), Object.assign(Object.assign({}, map.get(accessor.getName())), { set: accessor }));
18
18
  }
19
19
  });
20
20
  return (0, core_1.asArray)(map.values());
@@ -1 +1 @@
1
- {"version":3,"file":"group-accessors.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/accessor/group-accessors.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,uCAAmD;AAInD;;;GAGG;AACH,SAAgB,cAAc,CAAC,SAAgC;IAC9D,MAAM,GAAG,GAA+B,IAAI,GAAG,EAAyB,CAAC;IAEzE,SAAS,CAAC,OAAO,CAAC,CAAC,QAA6B,EAAE,EAAE;QACnD,IAAI,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE;YAC5C,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;SAC7E;QAED,IAAI,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE;YAC5C,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;SAC7E;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,cAAO,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC;AAdD,wCAcC"}
1
+ {"version":3,"file":"group-accessors.js","sourceRoot":"","sources":["../../../../../../libs/builder/helpers/typescript/accessor/group-accessors.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,uCAAmD;AAInD;;;GAGG;AACH,SAAgB,cAAc,CAAC,SAAgC;IAC9D,MAAM,GAAG,GAA+B,IAAI,GAAG,EAAyB,CAAC;IAEzE,SAAS,CAAC,OAAO,CAAC,CAAC,QAA6B,EAAE,EAAE;QACnD,IAAI,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE;YAC5C,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,kCAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAE,GAAG,EAAE,QAAQ,IAAE,CAAC;SAC7E;QAED,IAAI,eAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE;YAC5C,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,kCAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAE,GAAG,EAAE,QAAQ,IAAE,CAAC;SAC7E;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,cAAO,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC;AAdD,wCAcC"}
@@ -9,24 +9,7 @@ const ts_morph_1 = require("ts-morph");
9
9
  * @returns {Project} - The project
10
10
  */
11
11
  function createProject(options) {
12
- return new ts_morph_1.Project({
13
- ...options,
14
- compilerOptions: {
15
- module: ts_morph_1.ModuleKind.CommonJS,
16
- sourceMap: false,
17
- incremental: true,
18
- declaration: false,
19
- skipLibCheck: true,
20
- moduleResolution: ts_morph_1.ModuleResolutionKind.NodeJs,
21
- isolatedModules: true,
22
- noEmit: true,
23
- types: [],
24
- ...options === null || options === void 0 ? void 0 : options.compilerOptions,
25
- },
26
- skipAddingFilesFromTsConfig: true,
27
- skipFileDependencyResolution: false,
28
- skipLoadingLibFiles: false,
29
- });
12
+ return new ts_morph_1.Project(Object.assign(Object.assign({}, options), { compilerOptions: Object.assign({ module: ts_morph_1.ModuleKind.CommonJS, sourceMap: false, incremental: true, declaration: false, skipLibCheck: true, moduleResolution: ts_morph_1.ModuleResolutionKind.NodeJs, isolatedModules: true, noEmit: true, types: [] }, options === null || options === void 0 ? void 0 : options.compilerOptions), skipAddingFilesFromTsConfig: true, skipFileDependencyResolution: false, skipLoadingLibFiles: false }));
30
13
  }
31
14
  exports.createProject = createProject;
32
15
  //# sourceMappingURL=create-project.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/create-project.ts"],"names":[],"mappings":";;;AAAA,uCAAmF;AAEnF;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAwB;IACrD,OAAO,IAAI,kBAAO,CAAC;QAClB,GAAG,OAAO;QACV,eAAe,EAAE;YAChB,MAAM,EAAE,qBAAU,CAAC,QAAQ;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,IAAI;YAClB,gBAAgB,EAAE,+BAAoB,CAAC,MAAM;YAC7C,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,EAAE;YACT,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe;SAC3B;QACD,2BAA2B,EAAE,IAAI;QACjC,4BAA4B,EAAE,KAAK;QACnC,mBAAmB,EAAE,KAAK;KAC1B,CAAC,CAAC;AACJ,CAAC;AAnBD,sCAmBC"}
1
+ {"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../../../../libs/builder/helpers/typescript/create-project.ts"],"names":[],"mappings":";;;AAAA,uCAAmF;AAEnF;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAwB;IACrD,OAAO,IAAI,kBAAO,iCACd,OAAO,KACV,eAAe,kBACd,MAAM,EAAE,qBAAU,CAAC,QAAQ,EAC3B,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,IAAI,EACjB,WAAW,EAAE,KAAK,EAClB,YAAY,EAAE,IAAI,EAClB,gBAAgB,EAAE,+BAAoB,CAAC,MAAM,EAC7C,eAAe,EAAE,IAAI,EACrB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,EAAE,IACN,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,GAE5B,2BAA2B,EAAE,IAAI,EACjC,4BAA4B,EAAE,KAAK,EACnC,mBAAmB,EAAE,KAAK,IACzB,CAAC;AACJ,CAAC;AAnBD,sCAmBC"}
@@ -0,0 +1,5 @@
1
+ export interface NgDocEntityKeyword {
2
+ key: string;
3
+ title: string;
4
+ path: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=entity-keyword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-keyword.js","sourceRoot":"","sources":["../../../../libs/builder/interfaces/entity-keyword.ts"],"names":[],"mappings":""}
@@ -1,9 +1,11 @@
1
1
  export * from './action-output';
2
2
  export * from './asset';
3
3
  export * from './builder-context';
4
- export * from './built-output';
5
4
  export * from './configuration';
5
+ export * from './entity-keyword';
6
+ export * from './output';
6
7
  export * from './path-anchor';
8
+ export * from './playground-metadata';
7
9
  export * from './renderer-options';
8
10
  export * from './repo-config';
9
11
  export * from './schema';
@@ -4,9 +4,11 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./action-output"), exports);
5
5
  tslib_1.__exportStar(require("./asset"), exports);
6
6
  tslib_1.__exportStar(require("./builder-context"), exports);
7
- tslib_1.__exportStar(require("./built-output"), exports);
8
7
  tslib_1.__exportStar(require("./configuration"), exports);
8
+ tslib_1.__exportStar(require("./entity-keyword"), exports);
9
+ tslib_1.__exportStar(require("./output"), exports);
9
10
  tslib_1.__exportStar(require("./path-anchor"), exports);
11
+ tslib_1.__exportStar(require("./playground-metadata"), exports);
10
12
  tslib_1.__exportStar(require("./renderer-options"), exports);
11
13
  tslib_1.__exportStar(require("./repo-config"), exports);
12
14
  tslib_1.__exportStar(require("./schema"), exports);