@ng-doc/builder 16.10.0 → 16.11.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 (249) hide show
  1. package/classes/observable-set.d.ts +1 -0
  2. package/classes/observable-set.js +4 -0
  3. package/classes/observable-set.js.map +1 -1
  4. package/engine/.cache/apps/ng-doc/docs/ng-doc.api.js +3 -8
  5. package/engine/.cache/apps/ng-doc/docs/recipes/ignoring-file-lines/ng-doc.page.js +41 -0
  6. package/engine/.cache/apps/ng-doc/docs/recipes/ng-doc.category.js +30 -0
  7. package/engine/actions/playground.action.js +2 -2
  8. package/engine/actions/playground.action.js.map +1 -1
  9. package/engine/build-ng-doc.js +10 -2
  10. package/engine/build-ng-doc.js.map +1 -1
  11. package/engine/builder-operators/build.d.ts +2 -3
  12. package/engine/builder-operators/build.js +8 -4
  13. package/engine/builder-operators/build.js.map +1 -1
  14. package/engine/builder-operators/compile.d.ts +1 -1
  15. package/engine/builder-operators/compile.js.map +1 -1
  16. package/engine/builder-operators/emit.d.ts +2 -2
  17. package/engine/builder-operators/emit.js.map +1 -1
  18. package/engine/builder-operators/post-build.d.ts +6 -0
  19. package/engine/builder-operators/post-build.js +23 -0
  20. package/engine/builder-operators/post-build.js.map +1 -0
  21. package/engine/builder-operators/post-process.d.ts +2 -2
  22. package/engine/builder-operators/post-process.js +4 -5
  23. package/engine/builder-operators/post-process.js.map +1 -1
  24. package/engine/builder-operators/task.d.ts +1 -1
  25. package/engine/builder-operators/task.js.map +1 -1
  26. package/engine/builder-operators/to-builder-output.d.ts +6 -0
  27. package/engine/builder-operators/to-builder-output.js +13 -0
  28. package/engine/builder-operators/to-builder-output.js.map +1 -0
  29. package/engine/entities/abstractions/entity.d.ts +11 -11
  30. package/engine/entities/abstractions/entity.js +2 -5
  31. package/engine/entities/abstractions/entity.js.map +1 -1
  32. package/engine/entities/abstractions/file.entity.d.ts +2 -2
  33. package/engine/entities/abstractions/file.entity.js.map +1 -1
  34. package/engine/entities/abstractions/module.entity.d.ts +1 -1
  35. package/engine/entities/abstractions/module.entity.js.map +1 -1
  36. package/engine/entities/abstractions/navigation.entity.d.ts +1 -1
  37. package/engine/entities/abstractions/navigation.entity.js.map +1 -1
  38. package/engine/entities/abstractions/route.entity.d.ts +3 -4
  39. package/engine/entities/abstractions/route.entity.js +2 -2
  40. package/engine/entities/abstractions/route.entity.js.map +1 -1
  41. package/engine/entities/api-list.entity.d.ts +20 -0
  42. package/engine/entities/api-list.entity.js +69 -0
  43. package/engine/entities/api-list.entity.js.map +1 -0
  44. package/engine/entities/api-page.entity.d.ts +2 -3
  45. package/engine/entities/api-page.entity.js +26 -28
  46. package/engine/entities/api-page.entity.js.map +1 -1
  47. package/engine/entities/api-scope.entity.d.ts +2 -3
  48. package/engine/entities/api-scope.entity.js +13 -7
  49. package/engine/entities/api-scope.entity.js.map +1 -1
  50. package/engine/entities/api.entity.d.ts +3 -4
  51. package/engine/entities/api.entity.js +26 -29
  52. package/engine/entities/api.entity.js.map +1 -1
  53. package/engine/entities/category.entity.d.ts +2 -3
  54. package/engine/entities/category.entity.js +11 -13
  55. package/engine/entities/category.entity.js.map +1 -1
  56. package/engine/entities/context.entity.d.ts +11 -0
  57. package/engine/entities/context.entity.js +34 -0
  58. package/engine/entities/context.entity.js.map +1 -0
  59. package/engine/entities/generated-module.entity.d.ts +12 -0
  60. package/engine/entities/generated-module.entity.js +52 -0
  61. package/engine/entities/generated-module.entity.js.map +1 -0
  62. package/engine/entities/index-file.entity.d.ts +12 -0
  63. package/engine/entities/index-file.entity.js +52 -0
  64. package/engine/entities/index-file.entity.js.map +1 -0
  65. package/engine/entities/index.d.ts +8 -1
  66. package/engine/entities/index.js +8 -1
  67. package/engine/entities/index.js.map +1 -1
  68. package/engine/entities/indexes.entity.d.ts +3 -4
  69. package/engine/entities/indexes.entity.js +12 -14
  70. package/engine/entities/indexes.entity.js.map +1 -1
  71. package/engine/entities/keywords.entity.d.ts +12 -0
  72. package/engine/entities/keywords.entity.js +32 -0
  73. package/engine/entities/keywords.entity.js.map +1 -0
  74. package/engine/entities/page-demo.entity.d.ts +20 -0
  75. package/engine/entities/page-demo.entity.js +87 -0
  76. package/engine/entities/page-demo.entity.js.map +1 -0
  77. package/engine/entities/page-playground.entity.d.ts +21 -0
  78. package/engine/entities/page-playground.entity.js +80 -0
  79. package/engine/entities/page-playground.entity.js.map +1 -0
  80. package/engine/entities/page.entity.d.ts +6 -18
  81. package/engine/entities/page.entity.js +39 -107
  82. package/engine/entities/page.entity.js.map +1 -1
  83. package/engine/entities/plugins/entity-plugins/add-to-dependencies.plugin.d.ts +5 -0
  84. package/engine/entities/plugins/entity-plugins/add-to-dependencies.plugin.js +20 -0
  85. package/engine/entities/plugins/entity-plugins/add-to-dependencies.plugin.js.map +1 -0
  86. package/engine/entities/plugins/entity-plugins/apply.plugin.d.ts +26 -0
  87. package/engine/entities/plugins/entity-plugins/apply.plugin.js +65 -0
  88. package/engine/entities/plugins/entity-plugins/apply.plugin.js.map +1 -0
  89. package/engine/entities/plugins/entity-plugins/extract-snippets.plugin.d.ts +6 -0
  90. package/engine/entities/plugins/entity-plugins/extract-snippets.plugin.js +23 -0
  91. package/engine/entities/plugins/entity-plugins/extract-snippets.plugin.js.map +1 -0
  92. package/engine/entities/plugins/entity-plugins/fill-indexes.plugin.d.ts +6 -0
  93. package/engine/entities/plugins/entity-plugins/fill-indexes.plugin.js +27 -0
  94. package/engine/entities/plugins/entity-plugins/fill-indexes.plugin.js.map +1 -0
  95. package/engine/entities/plugins/entity-plugins/index.d.ts +9 -0
  96. package/engine/entities/plugins/entity-plugins/index.js +13 -0
  97. package/engine/entities/plugins/entity-plugins/index.js.map +1 -0
  98. package/engine/entities/plugins/entity-plugins/markdown-to-html.plugin.d.ts +5 -0
  99. package/engine/entities/plugins/entity-plugins/markdown-to-html.plugin.js +21 -0
  100. package/engine/entities/plugins/entity-plugins/markdown-to-html.plugin.js.map +1 -0
  101. package/engine/entities/plugins/entity-plugins/post-process-html.plugin.d.ts +5 -0
  102. package/engine/entities/plugins/entity-plugins/post-process-html.plugin.js +18 -0
  103. package/engine/entities/plugins/entity-plugins/post-process-html.plugin.js.map +1 -0
  104. package/engine/entities/plugins/entity-plugins/process-html.plugin.d.ts +5 -0
  105. package/engine/entities/plugins/entity-plugins/process-html.plugin.js +18 -0
  106. package/engine/entities/plugins/entity-plugins/process-html.plugin.js.map +1 -0
  107. package/engine/entities/plugins/entity-plugins/remove-lines.plugin.d.ts +6 -0
  108. package/engine/entities/plugins/entity-plugins/remove-lines.plugin.js +23 -0
  109. package/engine/entities/plugins/entity-plugins/remove-lines.plugin.js.map +1 -0
  110. package/engine/entities/plugins/entity-plugins/wrap-code.plugin.d.ts +6 -0
  111. package/engine/entities/plugins/entity-plugins/wrap-code.plugin.js +21 -0
  112. package/engine/entities/plugins/entity-plugins/wrap-code.plugin.js.map +1 -0
  113. package/engine/entities/plugins/helpers/execute-plugins.d.ts +10 -0
  114. package/engine/entities/plugins/helpers/execute-plugins.js +18 -0
  115. package/engine/entities/plugins/helpers/execute-plugins.js.map +1 -0
  116. package/engine/entities/plugins/helpers/index.d.ts +1 -0
  117. package/engine/entities/plugins/helpers/index.js +5 -0
  118. package/engine/entities/plugins/helpers/index.js.map +1 -0
  119. package/engine/entities/plugins/index.d.ts +3 -0
  120. package/engine/entities/plugins/index.js +7 -0
  121. package/engine/entities/plugins/index.js.map +1 -0
  122. package/engine/entities/plugins/types/entity-plugin.d.ts +5 -0
  123. package/engine/entities/plugins/types/entity-plugin.js +3 -0
  124. package/engine/entities/plugins/types/entity-plugin.js.map +1 -0
  125. package/engine/entities/plugins/types/index.d.ts +1 -0
  126. package/engine/entities/plugins/types/index.js +5 -0
  127. package/engine/entities/plugins/types/index.js.map +1 -0
  128. package/engine/entities/routes.entity.d.ts +11 -0
  129. package/engine/entities/routes.entity.js +34 -0
  130. package/engine/entities/routes.entity.js.map +1 -0
  131. package/engine/entity-store.d.ts +1 -0
  132. package/engine/entity-store.js +3 -0
  133. package/engine/entity-store.js.map +1 -1
  134. package/engine/nunjucks/filters.d.ts +2 -2
  135. package/engine/nunjucks/filters.js +3 -2
  136. package/engine/nunjucks/filters.js.map +1 -1
  137. package/engine/variables.d.ts +1 -0
  138. package/engine/variables.js +1 -0
  139. package/engine/variables.js.map +1 -1
  140. package/helpers/angular/get-component-assets.d.ts +8 -0
  141. package/helpers/angular/get-component-assets.js +15 -0
  142. package/helpers/angular/get-component-assets.js.map +1 -0
  143. package/helpers/angular/get-component-source-files.d.ts +7 -0
  144. package/helpers/angular/get-component-source-files.js +23 -0
  145. package/helpers/angular/get-component-source-files.js.map +1 -0
  146. package/helpers/angular/index.d.ts +2 -0
  147. package/helpers/angular/index.js +2 -0
  148. package/helpers/angular/index.js.map +1 -1
  149. package/helpers/build-file-assets.d.ts +7 -0
  150. package/helpers/build-file-assets.js +25 -0
  151. package/helpers/build-file-assets.js.map +1 -0
  152. package/helpers/build-file-entity.js +14 -1
  153. package/helpers/build-file-entity.js.map +1 -1
  154. package/helpers/demo/assets-from-component-asset.d.ts +6 -0
  155. package/helpers/demo/assets-from-component-asset.js +14 -0
  156. package/helpers/demo/assets-from-component-asset.js.map +1 -0
  157. package/helpers/demo/index.d.ts +1 -0
  158. package/helpers/demo/index.js +5 -0
  159. package/helpers/demo/index.js.map +1 -0
  160. package/helpers/emit-built-output.d.ts +2 -2
  161. package/helpers/emit-built-output.js.map +1 -1
  162. package/helpers/entity-type.d.ts +1 -1
  163. package/helpers/extract-docs.js +4 -4
  164. package/helpers/extract-docs.js.map +1 -1
  165. package/helpers/format-code.d.ts +1 -1
  166. package/helpers/format-code.js +14 -3
  167. package/helpers/format-code.js.map +1 -1
  168. package/helpers/get-code-type-from-lang.d.ts +6 -0
  169. package/helpers/get-code-type-from-lang.js +31 -0
  170. package/helpers/get-code-type-from-lang.js.map +1 -0
  171. package/helpers/get-demo-class-declarations.d.ts +1 -1
  172. package/helpers/get-demo-class-declarations.js +18 -7
  173. package/helpers/get-demo-class-declarations.js.map +1 -1
  174. package/helpers/index.d.ts +7 -3
  175. package/helpers/index.js +7 -3
  176. package/helpers/index.js.map +1 -1
  177. package/helpers/markdown-to-html.d.ts +10 -0
  178. package/helpers/{marked.js → markdown-to-html.js} +11 -8
  179. package/helpers/markdown-to-html.js.map +1 -0
  180. package/helpers/process-html.d.ts +3 -3
  181. package/helpers/process-html.js +14 -11
  182. package/helpers/process-html.js.map +1 -1
  183. package/helpers/process-legacy-snippets.d.ts +9 -0
  184. package/helpers/process-legacy-snippets.js +70 -0
  185. package/helpers/process-legacy-snippets.js.map +1 -0
  186. package/helpers/process-snippets.d.ts +5 -5
  187. package/helpers/process-snippets.js +63 -50
  188. package/helpers/process-snippets.js.map +1 -1
  189. package/helpers/remove-lines-from-code.d.ts +6 -0
  190. package/helpers/remove-lines-from-code.js +30 -0
  191. package/helpers/remove-lines-from-code.js.map +1 -0
  192. package/helpers/snippets-from-asset.d.ts +9 -0
  193. package/helpers/snippets-from-asset.js +26 -0
  194. package/helpers/snippets-from-asset.js.map +1 -0
  195. package/interfaces/asset.d.ts +5 -7
  196. package/interfaces/build-result.d.ts +10 -0
  197. package/{types/snippet-type.js → interfaces/build-result.js} +1 -1
  198. package/interfaces/build-result.js.map +1 -0
  199. package/interfaces/index.d.ts +3 -0
  200. package/interfaces/index.js +3 -0
  201. package/interfaces/index.js.map +1 -1
  202. package/interfaces/output.d.ts +1 -3
  203. package/interfaces/snippet-config.d.ts +8 -0
  204. package/interfaces/snippet-config.js +3 -0
  205. package/interfaces/snippet-config.js.map +1 -0
  206. package/interfaces/snippet.d.ts +5 -4
  207. package/operators/error-handler.d.ts +1 -1
  208. package/package.json +5 -5
  209. package/parsers/helpers/index.d.ts +3 -0
  210. package/parsers/helpers/index.js +7 -0
  211. package/parsers/helpers/index.js.map +1 -0
  212. package/parsers/helpers/number.d.ts +2 -0
  213. package/parsers/helpers/number.js +7 -0
  214. package/parsers/helpers/number.js.map +1 -0
  215. package/parsers/helpers/param-value.d.ts +2 -0
  216. package/parsers/helpers/param-value.js +8 -0
  217. package/parsers/helpers/param-value.js.map +1 -0
  218. package/parsers/helpers/param.d.ts +7 -0
  219. package/parsers/helpers/param.js +19 -0
  220. package/parsers/helpers/param.js.map +1 -0
  221. package/parsers/parse-code-block-params.js +8 -13
  222. package/parsers/parse-code-block-params.js.map +1 -1
  223. package/parsers/parse-snippet.d.ts +6 -0
  224. package/parsers/parse-snippet.js +27 -0
  225. package/parsers/parse-snippet.js.map +1 -0
  226. package/schematics/category/index.js +2 -1
  227. package/schematics/category/index.js.map +1 -1
  228. package/schematics/page/index.js +2 -1
  229. package/schematics/page/index.js.map +1 -1
  230. package/templates/demo-assets.ts.nunj +13 -4
  231. package/templates/page.module.ts.nunj +3 -2
  232. package/templates/parts/usage-notes.html.nunj +1 -1
  233. package/templates/playgrounds.ts.nunj +5 -7
  234. package/types/index.d.ts +0 -1
  235. package/types/index.js +0 -1
  236. package/types/index.js.map +1 -1
  237. package/engine/entities/skeleton.entity.d.ts +0 -16
  238. package/engine/entities/skeleton.entity.js +0 -44
  239. package/engine/entities/skeleton.entity.js.map +0 -1
  240. package/helpers/build-assets.d.ts +0 -10
  241. package/helpers/build-assets.js +0 -55
  242. package/helpers/build-assets.js.map +0 -1
  243. package/helpers/get-component-asset.d.ts +0 -10
  244. package/helpers/get-component-asset.js +0 -50
  245. package/helpers/get-component-asset.js.map +0 -1
  246. package/helpers/marked.d.ts +0 -9
  247. package/helpers/marked.js.map +0 -1
  248. package/types/snippet-type.d.ts +0 -1
  249. package/types/snippet-type.js.map +0 -1
@@ -2,13 +2,12 @@
2
2
  import {ChangeDetectionStrategy, Component, NgModule, Type, ViewChild, ViewContainerRef} from '@angular/core';
3
3
  import {NgDocBasePlayground, providePlaygroundDemo} from '@ng-doc/app';
4
4
  // noinspection ES6UnusedImports
5
- import pageEntity from '{{ page.importPath }}';
5
+ import pageEntity from '{{ targetImportPath }}';
6
6
  import {CommonModule} from '@angular/common';
7
- import {Constructor} from '@ng-doc/core';
8
7
 
9
8
  {%- set components = [] %}
10
9
  {%- set index = 1 %}
11
- {%- set playgrounds = page.playgroundMetadata %}
10
+ {%- set playgrounds = playgroundMetadata %}
12
11
 
13
12
 
14
13
  {%- for id, metadata in playgrounds -%}
@@ -25,7 +24,7 @@ import {Constructor} from '@ng-doc/core';
25
24
  standalone: true,
26
25
  imports: [
27
26
  CommonModule,
28
- {%- if page.hasImports %}
27
+ {%- if hasImports %}
29
28
  ...pageEntity.imports,
30
29
  {%- endif %}
31
30
  {%- if metadata.standalone %}
@@ -38,8 +37,7 @@ export class {{ comp.name }} extends NgDocBasePlayground {
38
37
  static readonly selector: string = '{{ comp.selector }}';
39
38
 
40
39
  @ViewChild(pageEntity.playgrounds['{{ id }}'].target, {static: true})
41
- readonly playground?: Type<unknown>;
42
- readonly playgroundInstance?: Constructor<unknown> = pageEntity.playgrounds['{{ id }}'].target;
40
+ readonly playground: Type<any>;
43
41
 
44
42
  @ViewChild(pageEntity.playgrounds['{{ id }}'].target, {static: true, read: ViewContainerRef})
45
43
  readonly viewContainerRef: ViewContainerRef;
@@ -47,7 +45,7 @@ export class {{ comp.name }} extends NgDocBasePlayground {
47
45
  readonly configData: any = pageEntity.playgrounds['{{ id }}'].data;
48
46
 
49
47
  constructor() {
50
- super();
48
+ super(pageEntity.playgrounds['{{ id }}'].target);
51
49
  }
52
50
  }
53
51
  {%- set index = index + 1 -%}
package/types/index.d.ts CHANGED
@@ -2,5 +2,4 @@ export * from './action';
2
2
  export * from './artifact-processor';
3
3
  export * from './component-asset';
4
4
  export * from './constructable';
5
- export * from './snippet-type';
6
5
  export * from './supported-declarations';
package/types/index.js CHANGED
@@ -5,6 +5,5 @@ tslib_1.__exportStar(require("./action"), exports);
5
5
  tslib_1.__exportStar(require("./artifact-processor"), exports);
6
6
  tslib_1.__exportStar(require("./component-asset"), exports);
7
7
  tslib_1.__exportStar(require("./constructable"), exports);
8
- tslib_1.__exportStar(require("./snippet-type"), exports);
9
8
  tslib_1.__exportStar(require("./supported-declarations"), exports);
10
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/types/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,+DAAqC;AACrC,4DAAkC;AAClC,0DAAgC;AAChC,yDAA+B;AAC/B,mEAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/types/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,+DAAqC;AACrC,4DAAkC;AAClC,0DAAgC;AAChC,mEAAyC"}
@@ -1,16 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { NgDocBuildOutput } from '../../interfaces';
3
- import { NgDocEntity } from './abstractions/entity';
4
- export declare class NgDocSkeletonEntity extends NgDocEntity {
5
- readonly id: string;
6
- readonly isRoot: boolean;
7
- readonly rootFiles: string[];
8
- readonly parent: undefined;
9
- readonly buildCandidates: NgDocEntity[];
10
- protected buildImpl(): Observable<NgDocBuildOutput[]>;
11
- private buildRoutes;
12
- private buildContext;
13
- private buildIndexFile;
14
- private buildGeneratedModule;
15
- private get rootEntitiesForBuild();
16
- }
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NgDocSkeletonEntity = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const rxjs_1 = require("rxjs");
7
- const nunjucks_1 = require("../nunjucks");
8
- const entity_1 = require("./abstractions/entity");
9
- class NgDocSkeletonEntity extends entity_1.NgDocEntity {
10
- constructor() {
11
- super(...arguments);
12
- this.id = 'NgDocSkeletonEntity';
13
- this.isRoot = true;
14
- this.rootFiles = [];
15
- this.parent = undefined;
16
- this.buildCandidates = [];
17
- }
18
- buildImpl() {
19
- return (0, rxjs_1.forkJoin)([this.buildIndexFile(), this.buildGeneratedModule(), this.buildRoutes(), this.buildContext()]);
20
- }
21
- buildRoutes() {
22
- const entities = this.rootEntitiesForBuild;
23
- const content = (0, nunjucks_1.renderTemplate)('./routing.ts.nunj', { context: { entities } });
24
- return (0, rxjs_1.of)({ content, filePath: path_1.default.join(this.context.buildPath, 'ng-doc.routing.ts') });
25
- }
26
- buildContext() {
27
- const entities = this.rootEntitiesForBuild;
28
- const content = (0, nunjucks_1.renderTemplate)('./context.ts.nunj', { context: { entities } });
29
- return (0, rxjs_1.of)({ content, filePath: path_1.default.join(this.context.buildPath, 'ng-doc.context.ts') });
30
- }
31
- buildIndexFile() {
32
- const content = (0, nunjucks_1.renderTemplate)('./index.ts.nunj');
33
- return (0, rxjs_1.of)({ content, filePath: path_1.default.join(this.context.buildPath, 'index.ts') });
34
- }
35
- buildGeneratedModule() {
36
- const content = (0, nunjucks_1.renderTemplate)('./ng-doc.generated.module.ts.nunj');
37
- return (0, rxjs_1.of)({ content, filePath: path_1.default.join(this.context.buildPath, 'ng-doc.generated.module.ts') });
38
- }
39
- get rootEntitiesForBuild() {
40
- return this.store.asArray().filter((e) => e.isRoot && e.isReadyForBuild);
41
- }
42
- }
43
- exports.NgDocSkeletonEntity = NgDocSkeletonEntity;
44
- //# sourceMappingURL=skeleton.entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skeleton.entity.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/entities/skeleton.entity.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,+BAA8C;AAG9C,0CAA2C;AAC3C,kDAAkD;AAElD,MAAa,mBAAoB,SAAQ,oBAAW;IAApD;;QACU,OAAE,GAAW,qBAAqB,CAAC;QACnC,WAAM,GAAY,IAAI,CAAC;QACvB,cAAS,GAAa,EAAE,CAAC;QACzB,WAAM,GAAc,SAAS,CAAC;QAC9B,oBAAe,GAAkB,EAAE,CAAC;IAqC9C,CAAC;IAnCU,SAAS;QAClB,OAAO,IAAA,eAAQ,EAAC,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,o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S,EAAE,4BAA4B,CAAC,EAAC,CAAC,CAAC;IACjG,CAAC;IAED,IAAY,oBAAoB;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,eAAe,CAAC,CAAC;IACvF,CAAC;CACD;AA1CD,kDA0CC"}
@@ -1,10 +0,0 @@
1
- import { NgDocStyleType } from '@ng-doc/core';
2
- import { NgDocAsset } from '../interfaces';
3
- /**
4
- * Builds an asset from a file.
5
- *
6
- * @param {string} filePath The path to the file.
7
- * @param {NgDocStyleType} styleType The inline style path.
8
- * @returns {NgDocAsset} The array of assets.
9
- */
10
- export declare function buildAssets(filePath: string, styleType: NgDocStyleType): Array<Omit<NgDocAsset, 'outputPath'>>;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildAssets = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs = tslib_1.__importStar(require("fs"));
6
- const code_type_from_ext_1 = require("./code-type-from-ext");
7
- const process_snippets_1 = require("./process-snippets");
8
- /**
9
- * Builds an asset from a file.
10
- *
11
- * @param {string} filePath The path to the file.
12
- * @param {NgDocStyleType} styleType The inline style path.
13
- * @returns {NgDocAsset} The array of assets.
14
- */
15
- function buildAssets(filePath, styleType) {
16
- try {
17
- const fileContent = fs.readFileSync(filePath, 'utf8').trim();
18
- const snippets = (0, process_snippets_1.processSnippets)(fileContent);
19
- const codeType = (0, code_type_from_ext_1.codeTypeFromExt)(filePath);
20
- // If the file contains snippets, we return an asset for each snippet,
21
- // otherwise we return a single file as an asset.
22
- if (snippets.length) {
23
- return snippets.map((snippet) => ({
24
- title: snippet.name,
25
- name: `Asset`,
26
- originalPath: filePath,
27
- code: snippet.content,
28
- output: snippet.content,
29
- type: snippet.type === 'styles'
30
- ? ['CSS', 'SCSS', 'SASS', 'LESS'].includes(codeType)
31
- ? codeType
32
- : styleType
33
- : snippet.type,
34
- }));
35
- }
36
- else {
37
- return [
38
- {
39
- title: codeType,
40
- name: `Asset`,
41
- originalPath: filePath,
42
- code: fileContent,
43
- output: fileContent,
44
- type: codeType,
45
- },
46
- ];
47
- }
48
- }
49
- catch (e) {
50
- console.error(e);
51
- }
52
- return [];
53
- }
54
- exports.buildAssets = buildAssets;
55
- //# sourceMappingURL=build-assets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-assets.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/build-assets.ts"],"names":[],"mappings":";;;;AACA,+CAAyB;AAIzB,6DAAqD;AACrD,yDAAmD;AAEnD;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,QAAgB,EAAE,SAAyB;IACtE,IAAI;QACH,MAAM,WAAW,GAAW,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACrE,MAAM,QAAQ,GAAmB,IAAA,kCAAe,EAAC,WAAW,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAAkB,IAAA,oCAAe,EAAC,QAAQ,CAAC,CAAC;QAE1D,sEAAsE;QACtE,iDAAiD;QACjD,IAAI,QAAQ,CAAC,MAAM,EAAE;YACpB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAqB,EAAE,EAAE,CAAC,CAAC;gBAC/C,KAAK,EAAE,OAAO,CAAC,IAAI;gBACnB,IAAI,EAAE,OAAO;gBACb,YAAY,EAAE,QAAQ;gBACtB,IAAI,EAAE,OAAO,CAAC,OAAO;gBACrB,MAAM,EAAE,OAAO,CAAC,OAAO;gBACvB,IAAI,EACH,OAAO,CAAC,IAAI,KAAK,QAAQ;oBACxB,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;wBACnD,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,SAAS;oBACZ,CAAC,CAAC,OAAO,CAAC,IAAI;aAChB,CAAC,CAAC,CAAC;SACJ;aAAM;YACN,OAAO;gBACN;oBACC,KAAK,EAAE,QAAQ;oBACf,IAAI,EAAE,OAAO;oBACb,YAAY,EAAE,QAAQ;oBACtB,IAAI,EAAE,WAAW;oBACjB,MAAM,EAAE,WAAW;oBACnB,IAAI,EAAE,QAAQ;iBACd;aACD,CAAC;SACF;KACD;IAAC,OAAO,CAAC,EAAE;QACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,EAAE,CAAC;AACX,CAAC;AAtCD,kCAsCC"}
@@ -1,10 +0,0 @@
1
- import { NgDocStyleType } from '@ng-doc/core';
2
- import { ClassDeclaration } from 'ts-morph';
3
- import { NgDocComponentAsset } from '../types';
4
- /**
5
- *
6
- * @param classDeclaration
7
- * @param inlineStyleLang
8
- * @param outDir
9
- */
10
- export declare function getComponentAsset(classDeclaration: ClassDeclaration, inlineStyleLang: NgDocStyleType, outDir: string): NgDocComponentAsset;
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getComponentAsset = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@ng-doc/core");
6
- const path = tslib_1.__importStar(require("path"));
7
- const nunjucks_1 = require("../engine/nunjucks");
8
- const angular_1 = require("./angular");
9
- const build_assets_1 = require("./build-assets");
10
- const format_code_1 = require("./format-code");
11
- const slash_1 = require("./slash");
12
- /**
13
- *
14
- * @param classDeclaration
15
- * @param inlineStyleLang
16
- * @param outDir
17
- */
18
- function getComponentAsset(classDeclaration, inlineStyleLang, outDir) {
19
- var _a;
20
- const decoratorData = (0, angular_1.getComponentDecorator)(classDeclaration);
21
- if (decoratorData) {
22
- const filePath = classDeclaration.getSourceFile().getFilePath();
23
- const fileDir = path.dirname(filePath);
24
- const assets = [
25
- // Add assets for the component file
26
- ...(0, build_assets_1.buildAssets)(filePath, inlineStyleLang),
27
- // Add assets for the template file if it exists
28
- ...(decoratorData.templateUrl ? (0, build_assets_1.buildAssets)(path.join(fileDir, decoratorData.templateUrl), inlineStyleLang) : []),
29
- // Add assets for the style files if they exist
30
- ...(0, core_1.asArray)(decoratorData.styleUrls)
31
- .map((styleUrl) => (0, build_assets_1.buildAssets)(path.join(fileDir, styleUrl), inlineStyleLang))
32
- .flat(),
33
- ];
34
- return {
35
- [(_a = classDeclaration.getName()) !== null && _a !== void 0 ? _a : '']: assets.map((asset, i) => {
36
- var _a;
37
- const code = (0, format_code_1.formatCode)(asset.output, asset.type).trim();
38
- return Object.assign(Object.assign({}, asset), { code, output: (0, nunjucks_1.renderTemplate)('./code.html.nunj', {
39
- context: {
40
- code,
41
- lang: asset.type,
42
- },
43
- }).trim(), outputPath: (0, slash_1.slash)(path.join(outDir, (_a = classDeclaration.getName()) !== null && _a !== void 0 ? _a : '', asset.type, `${asset.name}${i}.html`)) });
44
- }),
45
- };
46
- }
47
- return {};
48
- }
49
- exports.getComponentAsset = getComponentAsset;
50
- //# sourceMappingURL=get-component-asset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-component-asset.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/get-component-asset.ts"],"names":[],"mappings":";;;;AACA,uCAAqD;AACrD,mDAA6B;AAG7B,iDAAkD;AAGlD,uCAAgD;AAChD,iDAA2C;AAC3C,+CAAyC;AACzC,mCAA8B;AAE9B;;;;;GAKG;AACH,SAAgB,iBAAiB,CAChC,gBAAkC,EAClC,eAA+B,EAC/B,MAAc;;IAEd,MAAM,aAAa,GAA0B,IAAA,+BAAqB,EAAC,gBAAgB,CAAC,CAAC;IAErF,IAAI,aAAa,EAAE;QAClB,MAAM,QAAQ,GAAW,gBAAgB,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,CAAC;QACxE,MAAM,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE/C,MAAM,MAAM,GAA0C;YACrD,oCAAoC;YACpC,GAA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-1,9 +0,0 @@
1
- import { NgDocPageEntity } from '../engine';
2
- /**
3
- *
4
- * @param this
5
- * @param markdown
6
- * @param contextFolder
7
- * @param page
8
- */
9
- export declare function marked(markdown: string, page?: NgDocPageEntity): string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"marked.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/marked.ts"],"names":[],"mappings":";;;;AAAA,6CAA2E;AAC3E,uCAAwC;AACxC,+CAAyB;AACzB,mCAA8C;AAC9C,qCAA4B;AAC5B,mDAA6B;AAI7B,MAAM,WAAW,GAAW,0BAA0B,CAAC;AACvD,MAAM,cAAc,GAAW,6BAA6B,CAAC;AAE7D;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,QAAgB,EAAE,IAAsB;IAC9D,MAAM,QAAQ,GAAgC;QAC7C,IAAI,CAAC,IAAY,EAAE,IAAwB;;YAC1C,MAAM,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,KAAK,EACL,MAAM,EACN,IAAI,GACJ,GAAyB,IAAA,8BAAoB,EAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,EAAE,mCAAI,YAAY,CAAC,CAAC;YAE7E,IAAI,IAAI,IAAI,IAAI,EAAE;gBACjB,MAAM,gBAAgB,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;gBAChE,MAAM,WAAW,GAAW,EAAE;qBAC5B,YAAY,CAAC,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,EAAE,EAAE,MAAM,CAAC;qBAC5C,KAAK,CAAC,aAAG,CAAC;qBACV,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC;qBACjC,IAAI,CAAC,aAAG,CAAC;qBACT,IAAI,EAAE,CAAC;gBAET,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBAExC,IA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E7B,OAAO,eAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;AACzD,CAAC;AA/DD,wBA+DC"}
@@ -1 +0,0 @@
1
- export type NgDocSnippetType = 'TypeScript' | 'HTML' | 'styles';
@@ -1 +0,0 @@
1
- {"version":3,"file":"snippet-type.js","sourceRoot":"","sources":["../../../../libs/builder/types/snippet-type.ts"],"names":[],"mappings":""}