@ng-doc/builder 16.2.0 → 16.3.0-beta.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 (159) hide show
  1. package/engine/.cache/apps/ng-doc/src/app/pages/docs/api-documentation/ng-doc.category.js +1 -2
  2. package/engine/.cache/apps/ng-doc/src/app/pages/docs/api-documentation/templating/ng-doc.page.js +2 -3
  3. package/engine/.cache/apps/ng-doc/src/app/pages/docs/customization/layout/ng-doc.page.js +2 -3
  4. package/engine/.cache/apps/ng-doc/src/app/pages/docs/customization/ng-doc.category.js +1 -2
  5. package/engine/.cache/apps/ng-doc/src/app/pages/docs/customization/search/ng-doc.page.js +2 -3
  6. package/engine/.cache/apps/ng-doc/src/app/pages/docs/customization/themes/ng-doc.page.js +2 -3
  7. package/engine/.cache/apps/ng-doc/src/app/pages/docs/customization/type-controls/ng-doc.page.js +2 -3
  8. package/engine/.cache/apps/ng-doc/src/app/pages/docs/develop/ng-doc.page.js +2 -3
  9. package/engine/.cache/apps/ng-doc/src/app/pages/docs/features/cache/ng-doc.page.js +2 -3
  10. package/engine/.cache/apps/ng-doc/src/app/pages/docs/features/keywords/ng-doc.page.js +2 -3
  11. package/engine/.cache/apps/ng-doc/src/app/pages/docs/features/ng-doc.category.js +1 -2
  12. package/engine/.cache/apps/ng-doc/src/app/pages/docs/file-entities/api/ng-doc.page.js +2 -3
  13. package/engine/.cache/apps/ng-doc/src/app/pages/docs/file-entities/category/ng-doc.page.js +2 -3
  14. package/engine/.cache/apps/ng-doc/src/app/pages/docs/file-entities/ng-doc.category.js +1 -2
  15. package/engine/.cache/apps/ng-doc/src/app/pages/docs/file-entities/page/ng-doc.page.js +2 -3
  16. package/engine/.cache/apps/ng-doc/src/app/pages/docs/getting-started/configuration/ng-doc.page.js +2 -3
  17. package/engine/.cache/apps/ng-doc/src/app/pages/docs/getting-started/installation/ng-doc.page.js +2 -3
  18. package/engine/.cache/apps/ng-doc/src/app/pages/docs/{file-entities/dependencies → getting-started/migrations}/ng-doc.page.js +11 -15
  19. package/engine/.cache/apps/ng-doc/src/app/pages/docs/getting-started/ng-doc.category.js +1 -2
  20. package/engine/.cache/apps/ng-doc/src/app/pages/docs/getting-started/what-is-ng-doc/ng-doc.page.js +2 -3
  21. package/engine/.cache/apps/ng-doc/src/app/pages/docs/guides/demo/ng-doc.page.js +2 -3
  22. package/engine/.cache/apps/ng-doc/src/app/pages/docs/guides/demo-pane/ng-doc.page.js +2 -3
  23. package/engine/.cache/apps/ng-doc/src/app/pages/docs/guides/ng-doc.category.js +1 -2
  24. package/engine/.cache/apps/ng-doc/src/app/pages/docs/guides/playground/ng-doc.page.js +2 -3
  25. package/engine/.cache/apps/ng-doc/src/app/pages/docs/guides/snippets/ng-doc.page.js +2 -3
  26. package/engine/.cache/apps/ng-doc/src/app/pages/docs/guides/templating/ng-doc.page.js +2 -3
  27. package/engine/.cache/apps/ng-doc/src/app/pages/docs/ng-doc.api.js +2 -4
  28. package/engine/actions/playground.action.js +5 -9
  29. package/engine/actions/playground.action.js.map +1 -1
  30. package/engine/builder.js +10 -20
  31. package/engine/builder.js.map +1 -1
  32. package/engine/entities/abstractions/file.entity.d.ts +2 -0
  33. package/engine/entities/abstractions/file.entity.js +3 -9
  34. package/engine/entities/abstractions/file.entity.js.map +1 -1
  35. package/engine/entities/abstractions/source-file.entity.d.ts +1 -7
  36. package/engine/entities/abstractions/source-file.entity.js +0 -12
  37. package/engine/entities/abstractions/source-file.entity.js.map +1 -1
  38. package/engine/entities/index.d.ts +0 -1
  39. package/engine/entities/index.js +0 -1
  40. package/engine/entities/index.js.map +1 -1
  41. package/engine/entities/page.entity.d.ts +26 -11
  42. package/engine/entities/page.entity.js +88 -22
  43. package/engine/entities/page.entity.js.map +1 -1
  44. package/engine/renderer.js +4 -2
  45. package/engine/renderer.js.map +1 -1
  46. package/engine/template-filters.d.ts +1 -1
  47. package/engine/template-filters.js +2 -1
  48. package/engine/template-filters.js.map +1 -1
  49. package/engine/variables.d.ts +3 -1
  50. package/engine/variables.js +4 -2
  51. package/engine/variables.js.map +1 -1
  52. package/helpers/angular/component-decorator.d.ts +8 -0
  53. package/helpers/angular/component-decorator.js +30 -0
  54. package/helpers/angular/component-decorator.js.map +1 -0
  55. package/helpers/angular/directive-decorator.d.ts +8 -0
  56. package/helpers/angular/directive-decorator.js +26 -0
  57. package/helpers/angular/directive-decorator.js.map +1 -0
  58. package/helpers/angular/index.d.ts +3 -0
  59. package/helpers/angular/index.js +7 -0
  60. package/helpers/angular/index.js.map +1 -0
  61. package/helpers/angular/is-standalone.d.ts +7 -0
  62. package/helpers/angular/is-standalone.js +16 -0
  63. package/helpers/angular/is-standalone.js.map +1 -0
  64. package/helpers/build-file-entity.d.ts +9 -0
  65. package/helpers/build-file-entity.js +68 -0
  66. package/helpers/build-file-entity.js.map +1 -0
  67. package/helpers/entity-type.d.ts +1 -6
  68. package/helpers/entity-type.js +1 -9
  69. package/helpers/entity-type.js.map +1 -1
  70. package/helpers/extract-selectors.js +4 -8
  71. package/helpers/extract-selectors.js.map +1 -1
  72. package/helpers/get-component-asset.js +3 -6
  73. package/helpers/get-component-asset.js.map +1 -1
  74. package/helpers/get-demo-class-declarations.js +2 -3
  75. package/helpers/get-demo-class-declarations.js.map +1 -1
  76. package/helpers/get-entity-constructor.js +0 -3
  77. package/helpers/get-entity-constructor.js.map +1 -1
  78. package/helpers/get-playground-by-id.js.map +1 -1
  79. package/helpers/get-playground-targets.d.ts +6 -0
  80. package/helpers/get-playground-targets.js +21 -0
  81. package/helpers/get-playground-targets.js.map +1 -0
  82. package/helpers/get-playgrounds-expression.d.ts +7 -0
  83. package/helpers/get-playgrounds-expression.js +23 -0
  84. package/helpers/get-playgrounds-expression.js.map +1 -0
  85. package/helpers/get-playgrounds-ids.d.ts +6 -0
  86. package/helpers/get-playgrounds-ids.js +17 -0
  87. package/helpers/get-playgrounds-ids.js.map +1 -0
  88. package/helpers/index.d.ts +5 -1
  89. package/helpers/index.js +5 -1
  90. package/helpers/index.js.map +1 -1
  91. package/{resolvers/string-expression.resolver.d.ts → helpers/string-expression.d.ts} +2 -2
  92. package/{resolvers/string-expression.resolver.js → helpers/string-expression.js} +5 -5
  93. package/helpers/string-expression.js.map +1 -0
  94. package/helpers/to-template-string.js +1 -1
  95. package/helpers/to-template-string.js.map +1 -1
  96. package/helpers/typescript/create-project.js +1 -5
  97. package/helpers/typescript/create-project.js.map +1 -1
  98. package/helpers/typescript/declaration-import.d.ts +6 -0
  99. package/helpers/typescript/declaration-import.js +20 -0
  100. package/helpers/typescript/declaration-import.js.map +1 -0
  101. package/helpers/typescript/get-object-expression-from-default.d.ts +7 -0
  102. package/helpers/typescript/get-object-expression-from-default.js +19 -0
  103. package/helpers/typescript/get-object-expression-from-default.js.map +1 -0
  104. package/helpers/typescript/index.d.ts +2 -0
  105. package/helpers/typescript/index.js +2 -0
  106. package/helpers/typescript/index.js.map +1 -1
  107. package/helpers/typescript/property/get-property-assignment.js.map +1 -0
  108. package/helpers/typescript/property/index.d.ts +1 -0
  109. package/helpers/typescript/property/index.js +1 -0
  110. package/helpers/typescript/property/index.js.map +1 -1
  111. package/interfaces/renderer-options.d.ts +1 -0
  112. package/package.json +4 -4
  113. package/schematics/category/index.js +3 -3
  114. package/schematics/category/index.js.map +1 -1
  115. package/schematics/category/schema.json +1 -1
  116. package/schematics/collection.json +4 -4
  117. package/schematics/migrations/standalone-pages/index.d.ts +8 -0
  118. package/schematics/migrations/standalone-pages/index.js +112 -0
  119. package/schematics/migrations/standalone-pages/index.js.map +1 -0
  120. package/schematics/migrations/standalone-pages/schema.d.ts +2 -0
  121. package/schematics/migrations/standalone-pages/schema.js.map +1 -0
  122. package/schematics/{dependencies → migrations/standalone-pages}/schema.json +2 -7
  123. package/schematics/page/files/ng-doc.page.ts.template +4 -2
  124. package/schematics/page/index.js +5 -6
  125. package/schematics/page/index.js.map +1 -1
  126. package/schematics/page/schema.d.ts +3 -4
  127. package/schematics/page/schema.json +4 -4
  128. package/schematics/utils/extract-default-export-name.d.ts +3 -1
  129. package/schematics/utils/extract-default-export-name.js +4 -5
  130. package/schematics/utils/extract-default-export-name.js.map +1 -1
  131. package/{helpers → schematics/utils}/find-closest-file.d.ts +3 -1
  132. package/{helpers → schematics/utils}/find-closest-file.js +4 -4
  133. package/schematics/utils/find-closest-file.js.map +1 -0
  134. package/schematics/utils/index.d.ts +1 -0
  135. package/schematics/utils/index.js +1 -0
  136. package/schematics/utils/index.js.map +1 -1
  137. package/templates/{component-assets.ts.nunj → demo-assets.ts.nunj} +2 -2
  138. package/templates/page.module.ts.nunj +18 -20
  139. package/templates/playgrounds.ts.nunj +17 -7
  140. package/engine/entities/dependencies.entity.d.ts +0 -31
  141. package/engine/entities/dependencies.entity.js +0 -155
  142. package/engine/entities/dependencies.entity.js.map +0 -1
  143. package/helpers/find-closest-file.js.map +0 -1
  144. package/resolvers/common/get-property-assignment.js.map +0 -1
  145. package/resolvers/component-decorator.resolver.d.ts +0 -9
  146. package/resolvers/component-decorator.resolver.js +0 -23
  147. package/resolvers/component-decorator.resolver.js.map +0 -1
  148. package/resolvers/string-expression.resolver.js.map +0 -1
  149. package/schematics/dependencies/files/ng-doc.dependencies.ts.template +0 -10
  150. package/schematics/dependencies/files/ng-doc.module.ts.template +0 -9
  151. package/schematics/dependencies/index.d.ts +0 -9
  152. package/schematics/dependencies/index.js +0 -38
  153. package/schematics/dependencies/index.js.map +0 -1
  154. package/schematics/dependencies/schema.d.ts +0 -20
  155. package/schematics/dependencies/schema.js.map +0 -1
  156. package/schematics/page/files/ng-doc.dependencies.ts.template +0 -10
  157. /package/{resolvers/common → helpers/typescript/property}/get-property-assignment.d.ts +0 -0
  158. /package/{resolvers/common → helpers/typescript/property}/get-property-assignment.js +0 -0
  159. /package/schematics/{dependencies → migrations/standalone-pages}/schema.js +0 -0
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractDefaultExportName = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs = tslib_1.__importStar(require("fs"));
6
4
  /**
7
5
  * Extracts the category name from the given file path.
8
6
  *
7
+ * @param tree
9
8
  * @param {string} filePath The file path.
10
9
  * @returns {string | null} The category name.
11
10
  */
12
- function extractDefaultExportName(filePath) {
13
- if (fs.existsSync(filePath)) {
14
- const fileContent = fs.readFileSync(filePath, 'utf8');
11
+ function extractDefaultExportName(tree, filePath) {
12
+ if (tree.get(filePath)) {
13
+ const fileContent = tree.readText(filePath);
15
14
  const matchResult = /export\s*default\s*(\w*)/gm.exec(fileContent);
16
15
  return matchResult ? matchResult[1] : null;
17
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"extract-default-export-name.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/utils/extract-default-export-name.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAEzB;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,QAAgB;IACxD,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,WAAW,GAAW,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9D,MAAM,WAAW,GAA4B,4BAA4B,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE5F,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KAC3C;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AARD,4DAQC"}
1
+ {"version":3,"file":"extract-default-export-name.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/utils/extract-default-export-name.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,wBAAwB,CAAC,IAAU,EAAE,QAAgB;IACpE,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QACvB,MAAM,WAAW,GAAW,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,WAAW,GAA4B,4BAA4B,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE5F,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KAC3C;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AARD,4DAQC"}
@@ -1,8 +1,10 @@
1
+ import { Tree } from '@angular-devkit/schematics';
1
2
  /**
2
3
  * Finds the closest file in the given path.
3
4
  *
5
+ * @param tree
4
6
  * @param {string} currentFolder The current folder to search in.
5
7
  * @param {string} fileName The file name to search for.
6
8
  * @returns {string} The path to the closest file.
7
9
  */
8
- export declare function findClosestFile(currentFolder: string, fileName: string): string | null;
10
+ export declare function findClosestFile(tree: Tree, currentFolder: string, fileName: string): string | null;
@@ -2,26 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findClosestFile = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const fs = tslib_1.__importStar(require("fs"));
6
5
  const path = tslib_1.__importStar(require("path"));
7
6
  /**
8
7
  * Finds the closest file in the given path.
9
8
  *
9
+ * @param tree
10
10
  * @param {string} currentFolder The current folder to search in.
11
11
  * @param {string} fileName The file name to search for.
12
12
  * @returns {string} The path to the closest file.
13
13
  */
14
- function findClosestFile(currentFolder, fileName) {
14
+ function findClosestFile(tree, currentFolder, fileName) {
15
15
  const currentPath = currentFolder;
16
16
  const filePath = path.join(currentPath, fileName);
17
- if (fs.existsSync(filePath)) {
17
+ if (tree.get(filePath)) {
18
18
  return filePath;
19
19
  }
20
20
  const parentPath = path.dirname(currentPath);
21
21
  if (['/', '.', ''].includes(parentPath)) {
22
22
  return null;
23
23
  }
24
- return findClosestFile(parentPath, fileName);
24
+ return findClosestFile(tree, parentPath, fileName);
25
25
  }
26
26
  exports.findClosestFile = findClosestFile;
27
27
  //# sourceMappingURL=find-closest-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-closest-file.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/utils/find-closest-file.ts"],"names":[],"mappings":";;;;AACA,mDAA6B;AAE7B;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,IAAU,EAAE,aAAqB,EAAE,QAAgB;IAClF,MAAM,WAAW,GAAW,aAAa,CAAC;IAC1C,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAE1D,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QACvB,OAAO,QAAQ,CAAC;KAChB;IAED,MAAM,UAAU,GAAW,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAErD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACxC,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC;AAfD,0CAeC"}
@@ -1 +1,2 @@
1
1
  export * from './extract-default-export-name';
2
+ export * from './find-closest-file';
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./extract-default-export-name"), exports);
5
+ tslib_1.__exportStar(require("./find-closest-file"), exports);
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/utils/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/utils/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,8DAAoC"}
@@ -3,8 +3,8 @@ import {NgDocDemoAssets} from '@ng-doc/app';
3
3
 
4
4
  export const demoAssets: NgDocDemoAssets = {
5
5
  {% set i = 0 %}
6
- {%- for componentName, assets in componentsAssets %}
7
- {{ componentName }}: [
6
+ {%- for demoName, assets in demoAssets %}
7
+ {{ demoName }}: [
8
8
  {%- for asset in assets | notEmptyAssets %}
9
9
  {title: '{{ asset.title }}', codeType: '{{ asset.type }}', code: `{{ asset.output | toTemplateString }}`},
10
10
  {%- set i = i + 1 %}
@@ -1,18 +1,15 @@
1
1
  // @ts-nocheck
2
- import {Component, NgModule, Type, ChangeDetectionStrategy} from '@angular/core';
2
+ import {Component, NgModule, ChangeDetectionStrategy} from '@angular/core';
3
3
  import {RouterModule} from '@angular/router';
4
4
  import {CommonModule} from '@angular/common';
5
5
  import {NgDocPageModule, NgDocRootPage, NgDocDemoAssets} from '@ng-doc/app';
6
- import {NgDocDependencies, NgDocPageType} from '@ng-doc/core';
7
- {%- if page.pageDependencies %}
8
- // noinspection ES6UnusedImports
6
+ import {NgDocPage, NgDocPageType} from '@ng-doc/core';
7
+ import pageEntity from '{{ page.importPath }}';
9
8
  import {PlaygroundsModule} from './playgrounds';
10
- import pageDependencies from '{{ page.pageDependencies.importPath }}';
11
- {%- endif %}
12
- {%- if page.componentsAssets %}
13
- // noinspection ES6UnusedImports
14
- import demoAssets from '{{ page.componentsAssets }}';
15
- {%- endif %}
9
+ import demoAssets from '{{ page.demoAssetsImport }}';
10
+ {%- for standalone in page.standalone %}
11
+ {{ standalone | declarationImport }}
12
+ {%- endfor %}
16
13
 
17
14
  const pageContent: string = `{{ pageContent | toTemplateString }}`
18
15
 
@@ -36,13 +33,8 @@ export class DynamicComponent extends NgDocRootPage {
36
33
  readonly viewSourceFileUrl: string = '{{ page.viewSourceFileUrl }}';
37
34
  {%- endif %}
38
35
 
39
- {%- if page.pageDependencies %}
40
- readonly dependencies?: NgDocDependencies = pageDependencies;
41
- {%- endif %}
42
-
43
- {%- if page.componentsAssets %}
36
+ readonly page?: NgDocPage = pageEntity;
44
37
  readonly demoAssets: NgDocDemoAssets = demoAssets;
45
- {%- endif %}
46
38
 
47
39
  constructor() {
48
40
  super();
@@ -50,20 +42,26 @@ export class DynamicComponent extends NgDocRootPage {
50
42
  }
51
43
 
52
44
  @NgModule({
53
- declarations: [DynamicComponent],
45
+ declarations: [
46
+ DynamicComponent,
47
+ ],
54
48
  imports: [
55
49
  CommonModule,
50
+ {%- if page.hasImports %}
51
+ ...pageEntity.imports,
52
+ {%- endif %}
56
53
  NgDocPageModule,
57
- {%- if page.pageDependencies %}
58
- pageDependencies.module,
59
54
  PlaygroundsModule,
60
- {%- endif %}
61
55
  RouterModule.forChild([{
62
56
  path: '',
63
57
  component: DynamicComponent,
64
58
  title: '{{ page.title }}',
65
59
  }]),
60
+ {%- for standalone in page.standalone %}
61
+ {{ standalone.getName() }},
62
+ {%- endfor %}
66
63
  ],
64
+ providers: pageEntity.providers,
67
65
  exports: [RouterModule]
68
66
  })
69
67
  export class DynamicModule {
@@ -2,13 +2,18 @@
2
2
  import {NgModule, Component, ViewChild, Type, ViewContainerRef} from '@angular/core';
3
3
  import {NgDocBasePlayground, providePlaygroundDemo} from '@ng-doc/app';
4
4
  // noinspection ES6UnusedImports
5
- import pageDependencies from '{{ dependencies.importPath }}'; import {CommonModule} from '@angular/common';
5
+ import pageEntity from '{{ page.importPath }}';
6
+ import {CommonModule} from '@angular/common';
7
+ {%- for standalone in page.standalone %}
8
+ {{ standalone | declarationImport }}
9
+ {%- endfor %}
6
10
 
7
11
  {% set components = [] -%}
8
12
  {%- set index = 1 %}
13
+ {%- set playgrounds = page.playgroundsExpression %}
14
+
15
+ {%- for id in page.playgroundIds -%}
9
16
 
10
- {%- for id in dependencies.playgroundIds -%}
11
- {%- set playgrounds = dependencies.getPlaygroundsExpression() %}
12
17
  {%- set target = playgrounds | getTargetForPlayground(id) %}
13
18
  {%- set template = playgrounds | getTemplateForPlayground(id) %}
14
19
  {%- set content = playgrounds | getContentForPlayground(id) %}
@@ -29,13 +34,13 @@ import pageDependencies from '{{ dependencies.importPath }}'; import {CommonModu
29
34
  export class {{ comp.name }} extends NgDocBasePlayground {
30
35
  static readonly selector: string = '{{ comp.selector }}';
31
36
 
32
- @ViewChild(pageDependencies.playgrounds['{{ id }}'].target, {static: true})
37
+ @ViewChild(pageEntity.playgrounds['{{ id }}'].target, {static: true})
33
38
  readonly playground?: Type<unknown>;
34
39
 
35
- @ViewChild(pageDependencies.playgrounds['{{ id }}'].target, {static: true, read: ViewContainerRef})
40
+ @ViewChild(pageEntity.playgrounds['{{ id }}'].target, {static: true, read: ViewContainerRef})
36
41
  readonly viewContainerRef: ViewContainerRef;
37
42
 
38
- data: any = pageDependencies.playgrounds['{{ id }}'].data;
43
+ data: any = pageEntity.playgrounds['{{ id }}'].data;
39
44
 
40
45
  constructor() {
41
46
  super();
@@ -49,7 +54,12 @@ export class {{ comp.name }} extends NgDocBasePlayground {
49
54
  @NgModule({
50
55
  imports: [
51
56
  CommonModule,
52
- pageDependencies.module,
57
+ {%- if page.hasImports %}
58
+ ...pageEntity.imports,
59
+ {%- endif %}
60
+ {%- for standalone in page.standalone %}
61
+ {{ standalone.getName() }},
62
+ {%- endfor %}
53
63
  ],
54
64
  declarations: [
55
65
  {%- for comp in components %}
@@ -1,31 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ObjectLiteralExpression } from 'ts-morph';
3
- import { NgDocAsset, NgDocBuiltOutput } from '../../interfaces';
4
- import { NgDocEntity } from './abstractions/entity';
5
- import { NgDocSourceFileEntity } from './abstractions/source-file.entity';
6
- import { NgDocPageEntity } from './page.entity';
7
- export declare class NgDocDependenciesEntity extends NgDocSourceFileEntity {
8
- private componentsAssets;
9
- get isRoot(): boolean;
10
- get folderPath(): string;
11
- get buildCandidates(): NgDocEntity[];
12
- /**
13
- * The parent of the current entity is always the page entity
14
- * that located in the same folder
15
- */
16
- get parent(): NgDocPageEntity | undefined;
17
- get assets(): NgDocAsset[];
18
- get componentAssetsPath(): string;
19
- get componentAssetsImport(): string;
20
- get playgroundsPath(): string;
21
- get playgroundIds(): string[];
22
- dependenciesChanged(): void;
23
- update(): Observable<void>;
24
- protected build(): Observable<NgDocBuiltOutput[]>;
25
- getPlaygroundsExpression(): ObjectLiteralExpression | undefined;
26
- private buildAssets;
27
- private fillAssets;
28
- private getTargets;
29
- private buildComponentAssets;
30
- private buildPlaygrounds;
31
- }
@@ -1,155 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NgDocDependenciesEntity = 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 rxjs_1 = require("rxjs");
8
- const operators_1 = require("rxjs/operators");
9
- const ts_morph_1 = require("ts-morph");
10
- const helpers_1 = require("../../helpers");
11
- const fork_join_or_empty_1 = require("../../operators/fork-join-or-empty");
12
- const variables_1 = require("../variables");
13
- const source_file_entity_1 = require("./abstractions/source-file.entity");
14
- const decorators_1 = require("./cache/decorators");
15
- exports.NgDocDependenciesEntity = (() => {
16
- let _classDecorators = [(0, decorators_1.CachedEntity)()];
17
- let _classDescriptor;
18
- let _classExtraInitializers = [];
19
- let _classThis;
20
- var NgDocDependenciesEntity = _classThis = class extends source_file_entity_1.NgDocSourceFileEntity {
21
- constructor() {
22
- super(...arguments);
23
- this.componentsAssets = {};
24
- }
25
- get isRoot() {
26
- // always false, page dependencies are not rooted
27
- return false;
28
- }
29
- get folderPath() {
30
- var _a;
31
- return ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.folderPath) || '';
32
- }
33
- get buildCandidates() {
34
- return (0, core_1.asArray)(this.parent);
35
- }
36
- /**
37
- * The parent of the current entity is always the page entity
38
- * that located in the same folder
39
- */
40
- get parent() {
41
- const expectedPath = path.join(this.sourceFileFolder, variables_1.PAGE_NAME);
42
- const entity = this.builder.get(expectedPath);
43
- return entity && (0, helpers_1.isPageEntity)(entity) ? entity : undefined;
44
- }
45
- get assets() {
46
- return Object.keys(this.componentsAssets)
47
- .map((key) => this.componentsAssets[key])
48
- .flat();
49
- }
50
- get componentAssetsPath() {
51
- return path.join(this.folderPath, 'component-assets.ts');
52
- }
53
- get componentAssetsImport() {
54
- return (0, helpers_1.slash)(path.relative(this.context.context.workspaceRoot, path.join(this.folderPath, 'component-assets')));
55
- }
56
- get playgroundsPath() {
57
- return path.join(this.folderPath, 'playgrounds.ts');
58
- }
59
- get playgroundIds() {
60
- var _a;
61
- const playgrounds = this.getPlaygroundsExpression();
62
- return ((_a = playgrounds === null || playgrounds === void 0 ? void 0 : playgrounds.getProperties().filter(ts_morph_1.Node.isPropertyAssignment).map((p) => p.getName())) !== null && _a !== void 0 ? _a : []);
63
- }
64
- dependenciesChanged() {
65
- super.dependenciesChanged();
66
- this.getTargets().forEach((target) => target.getSourceFile().refreshFromFileSystem());
67
- }
68
- update() {
69
- return this.fillAssets();
70
- }
71
- build() {
72
- if (!this.parent) {
73
- return (0, rxjs_1.of)([]);
74
- }
75
- this.dependencies.clear();
76
- this.getTargets().forEach((target) => this.dependencies.add(target.getSourceFile().getFilePath()));
77
- return this.fillAssets().pipe((0, operators_1.switchMap)(() => (0, rxjs_1.forkJoin)([this.buildAssets(), this.buildPlaygrounds()]).pipe((0, operators_1.map)(([assets, playgrounds]) => [...assets, playgrounds]))));
78
- }
79
- getPlaygroundsExpression() {
80
- const objectExpression = this.getObjectExpressionFromDefault();
81
- if (objectExpression) {
82
- const property = objectExpression.getProperty('playgrounds');
83
- if (ts_morph_1.Node.isPropertyAssignment(property)) {
84
- const value = property.getInitializer();
85
- if (ts_morph_1.Node.isObjectLiteralExpression(value)) {
86
- return value;
87
- }
88
- }
89
- }
90
- return undefined;
91
- }
92
- buildAssets() {
93
- return this.buildComponentAssets().pipe((0, operators_1.map)((output) => [
94
- output,
95
- ...this.assets.map((asset) => ({
96
- content: asset.output,
97
- filePath: asset.outputPath,
98
- })),
99
- ]));
100
- }
101
- fillAssets() {
102
- const objectExpression = this.getObjectExpressionFromDefault();
103
- if (objectExpression) {
104
- const classDeclarations = (0, helpers_1.getDemoClassDeclarations)(objectExpression);
105
- this.componentsAssets = classDeclarations
106
- .map((classDeclarations) => {
107
- var _a, _b;
108
- return (0, helpers_1.getComponentAsset)(classDeclarations, this.context.inlineStyleLanguage, (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.assetsFolder) !== null && _b !== void 0 ? _b : this.folderPath);
109
- })
110
- .reduce((acc, curr) => ({ ...acc, ...curr }), {});
111
- this.dependencies.add(...this.assets.map((asset) => asset.originalPath));
112
- return (0, fork_join_or_empty_1.forkJoinOrEmpty)(Object.keys(this.componentsAssets).map((key) => (0, fork_join_or_empty_1.forkJoinOrEmpty)(this.componentsAssets[key].map((asset) => (0, rxjs_1.from)((0, helpers_1.processHtml)(this, asset.output)).pipe((0, operators_1.tap)((output) => (asset.output = output))))))).pipe((0, operators_1.mapTo)(void 0));
113
- }
114
- return (0, rxjs_1.of)(void 0);
115
- }
116
- getTargets() {
117
- return this.playgroundIds
118
- .map((pId) => {
119
- const expression = this.getPlaygroundsExpression();
120
- return expression && (0, helpers_1.getTargetForPlayground)(expression, pId);
121
- })
122
- .filter(core_1.isPresent);
123
- }
124
- buildComponentAssets() {
125
- return this.builder.renderer
126
- .render('./component-assets.ts.nunj', {
127
- context: {
128
- componentsAssets: this.componentsAssets,
129
- },
130
- })
131
- .pipe((0, operators_1.map)((output) => ({ content: output, filePath: this.componentAssetsPath })));
132
- }
133
- buildPlaygrounds() {
134
- return (this.builder.renderer
135
- .render('./playgrounds.ts.nunj', {
136
- context: {
137
- dependencies: this,
138
- },
139
- })
140
- // TODO: move format code to the post processor?
141
- .pipe((0, operators_1.map)((output) => ({
142
- content: (0, helpers_1.formatCode)(output, 'TypeScript'),
143
- filePath: this.playgroundsPath,
144
- }))));
145
- }
146
- };
147
- tslib_1.__setFunctionName(_classThis, "NgDocDependenciesEntity");
148
- (() => {
149
- tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name }, null, _classExtraInitializers);
150
- NgDocDependenciesEntity = _classThis = _classDescriptor.value;
151
- tslib_1.__runInitializers(_classThis, _classExtraInitializers);
152
- })();
153
- return NgDocDependenciesEntity = _classThis;
154
- })();
155
- //# sourceMappingURL=dependencies.entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencies.entity.js","sourceRoot":"","sources":["../../../../../libs/builder/engine/entities/dependencies.entity.ts"],"names":[],"mappings":";;;;AAAA,uCAAgD;AAChD,mDAA6B;AAC7B,+BAAoD;AACpD,8CAA0D;AAC1D,uCAOkB;AAElB,2CAQuB;AAEvB,2EAAmE;AAEnE,4CAAuC;AAEvC,0EAAwE;AACxE,mDAAgD;AAInC,QAAA,uBAAuB;4BADnC,IAAA,yBAAY,GAAE;;;;QACF,uBAAuB,qBAAC,SAAQ,0CAAqB;;;YACzD,qBAAgB,GAAwB,EAAE,CAAC;QAuLpD,CAAC;QArLA,IAAa,MAAM;YAClB,iDAAiD;YACjD,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAI,UAAU;;YACb,OAAO,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,KAAI,EAAE,CAAC;QACtC,CAAC;QAED,IAAa,eAAe;YAC3B,OAAO,IAAA,cAAO,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QAED;;;WAGG;QACH,IAAa,MAAM;YAClB,MAAM,YAAY,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,qBAAS,CAAC,CAAC;YACzE,MAAM,MAAM,GAA4B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAEvE,OAAO,MAAM,IAAI,IAAA,sBAAY,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,CAAC;QAED,IAAI,MAAM;YACT,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;iBACvC,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,G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+DAAuB;;WAAvB,uBAAuB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-closest-file.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/find-closest-file.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,mDAA6B;AAE7B;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,aAAqB,EAAE,QAAgB;IACtE,MAAM,WAAW,GAAW,aAAa,CAAC;IAC1C,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAE1D,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,OAAO,QAAQ,CAAC;KAChB;IAED,MAAM,UAAU,GAAW,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAErD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACxC,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAfD,0CAeC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-property-assignment.js","sourceRoot":"","sources":["../../../../../libs/builder/resolvers/common/get-property-assignment.ts"],"names":[],"mappings":";;;AAAA,uCAAwD;AAExD;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,wBAAmD;;IACxF,OAAO,eAAI,CAAC,oBAAoB,CAAC,wBAAwB,CAAC;QACzD,CAAC,CAAC,MAAA,MAAA,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAE,cAAc,EAAE,0CAAE,OAAO,EAAE,mCAAI,EAAE;QAC7D,CAAC,CAAC,EAAE,CAAC;AACP,CAAC;AAJD,sDAIC"}
@@ -1,9 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { ObjectLiteralExpression } from 'ts-morph';
3
- /**
4
- * Resolves the component decorator and return its properties.
5
- *
6
- * @param {ObjectLiteralExpression} objectLiteralExpression The object literal expression to extract target.
7
- * @returns {Component} The component decorator properties.
8
- */
9
- export declare function componentDecoratorResolver(objectLiteralExpression: ObjectLiteralExpression): Component;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.componentDecoratorResolver = void 0;
4
- const get_property_assignment_1 = require("./common/get-property-assignment");
5
- const string_expression_resolver_1 = require("./string-expression.resolver");
6
- /**
7
- * Resolves the component decorator and return its properties.
8
- *
9
- * @param {ObjectLiteralExpression} objectLiteralExpression The object literal expression to extract target.
10
- * @returns {Component} The component decorator properties.
11
- */
12
- function componentDecoratorResolver(objectLiteralExpression) {
13
- const selectorProperty = objectLiteralExpression.getProperty('selector');
14
- const templateProperty = objectLiteralExpression.getProperty('templateUrl');
15
- const styleUrlsProperty = objectLiteralExpression.getProperty('styleUrls');
16
- return {
17
- selector: (0, string_expression_resolver_1.stringExpressionResolver)((0, get_property_assignment_1.getPropertyAssignment)(selectorProperty)),
18
- templateUrl: (0, string_expression_resolver_1.stringExpressionResolver)((0, get_property_assignment_1.getPropertyAssignment)(templateProperty)),
19
- styleUrls: (0, string_expression_resolver_1.stringExpressionResolver)((0, get_property_assignment_1.getPropertyAssignment)(styleUrlsProperty)),
20
- };
21
- }
22
- exports.componentDecoratorResolver = componentDecoratorResolver;
23
- //# sourceMappingURL=component-decorator.resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-decorator.resolver.js","sourceRoot":"","sources":["../../../../libs/builder/resolvers/component-decorator.resolver.ts"],"names":[],"mappings":";;;AAGA,8EAAuE;AACvE,6EAAsE;AAEtE;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,uBAAgD;IAC1F,MAAM,gBAAgB,GAAyC,uBAAuB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC/G,MAAM,gBAAgB,GAAyC,uBAAuB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAClH,MAAM,iBAAiB,GAAyC,uBAAuB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEjH,OAAO;QACN,QAAQ,EAAE,IAAA,qDAAwB,EAAC,IAAA,+CAAqB,EAAC,gBAAgB,CAAC,CAAC;QAC3E,WAAW,EAAE,IAAA,qDAAwB,EAAC,IAAA,+CAAqB,EAAC,gBAAgB,CAAC,CAAC;QAC9E,SAAS,EAAE,IAAA,qDAAwB,EAAC,IAAA,+CAAqB,EAAC,iBAAiB,CAAC,CAAC;KAC7E,CAAC;AACH,CAAC;AAVD,gEAUC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"string-expression.resolver.js","sourceRoot":"","sources":["../../../../libs/builder/resolvers/string-expression.resolver.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAgB,wBAAwB,CAAI,UAAkB;IAC5D,OAAO,IAAI,QAAQ,CAAC,SAAS,GAAG,UAAU,CAAC,EAAE,CAAC;AAChD,CAAC;AAFD,4DAEC"}
@@ -1,10 +0,0 @@
1
- import {NgDocDependencies} from '@ng-doc/core';<% if (module) { %>
2
- import {<%= pageName %>Module} from './ng-doc.module';<% } %>
3
-
4
- const <%= pageName %>Dependencies: NgDocDependencies = {<% if (module) { %>
5
- module: <%= pageName %>Module,<% } %>
6
- // Add your demos that you are going to use in the page here
7
- demo: {},
8
- };
9
-
10
- export default <%= pageName %>Dependencies;
@@ -1,9 +0,0 @@
1
- import {NgModule} from '@angular/core';
2
- import {CommonModule} from '@angular/common';
3
-
4
- @NgModule({
5
- imports: [CommonModule],
6
- declarations: [],
7
- exports: []
8
- })
9
- export class <%= pageName %>Module {}
@@ -1,9 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { NgDocBuildDependenciesSchema } from './schema';
3
- /**
4
- * Generates a NgDocDependencies
5
- *
6
- * @param {NgDocBuildPageSchema} options - The options to generate the page
7
- * @returns {Rule} Angular Schematic Rule
8
- */
9
- export declare function build(options: NgDocBuildDependenciesSchema): Rule;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.build = void 0;
4
- const tslib_1 = require("tslib");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const path_1 = tslib_1.__importStar(require("path"));
7
- const variables_1 = require("../../engine/variables");
8
- const extract_default_export_name_1 = require("../utils/extract-default-export-name");
9
- const demoTemplates = ['ng-doc.module.ts.template'];
10
- /**
11
- * Generates a NgDocDependencies
12
- *
13
- * @param {NgDocBuildPageSchema} options - The options to generate the page
14
- * @returns {Rule} Angular Schematic Rule
15
- */
16
- function build(options) {
17
- return (host) => {
18
- var _a;
19
- const pagePath = path_1.default.join(options.path, variables_1.PAGE_NAME);
20
- const pageName = (_a = (0, extract_default_export_name_1.extractDefaultExportName)(pagePath)) !== null && _a !== void 0 ? _a : 'Page';
21
- return (0, schematics_1.chain)([
22
- (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
23
- (0, schematics_1.filter)((path) => (demoTemplates.includes((0, path_1.basename)(path)) && options.module) ||
24
- !demoTemplates.includes((0, path_1.basename)(path))),
25
- (0, schematics_1.applyTemplates)({ ...options, pageName }),
26
- (0, schematics_1.move)(options.path),
27
- (0, schematics_1.forEach)((fileEntry) => {
28
- if (host.exists(fileEntry.path)) {
29
- host.overwrite(fileEntry.path, fileEntry.content);
30
- }
31
- return fileEntry;
32
- }),
33
- ]), schematics_1.MergeStrategy.Overwrite),
34
- ]);
35
- };
36
- }
37
- exports.build = build;
38
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/dependencies/index.ts"],"names":[],"mappings":";;;;AAAA,2DAaoC;AACpC,qDAAoC;AAEpC,sDAAiD;AACjD,sFAA8E;AAG9E,MAAM,aAAa,GAAa,CAAC,2BAA2B,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,OAAqC;IAC1D,OAAO,CAAC,IAAU,EAAE,EAAE;;QACrB,MAAM,QAAQ,GAAW,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,qBAAS,CAAC,CAAC;QAC5D,MAAM,QAAQ,GAAW,MAAA,IAAA,sDAAwB,EAAC,QAAQ,CAAC,mCAAI,MAAM,CAAC;QAEtE,OAAO,IAAA,kBAAK,EAAC;YACZ,IAAA,sBAAS,EACR,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;gBACrB,IAAA,mBAAM,EACL,CAAC,IAAY,EAAE,EAAE,CAChB,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC;oBAC1D,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,CACxC;gBACD,IAAA,2BAAc,EAAC,EAAC,GAAG,OAAO,EAAE,QAAQ,EAAC,CAAC;gBACtC,IAAA,iBAAI,EAAC,OAAO,CAAC,IAAI,CAAC;gBAClB,IAAA,oBAAO,EAAC,CAAC,SAAoB,EAAE,EAAE;oBAChC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;wBAChC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;qBAClD;oBACD,OAAO,SAAS,CAAC;gBAClB,CAAC,CAAC;aACF,CAAC,EACF,0BAAa,CAAC,SAAS,CACvB;SACD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AA1BD,sBA0BC"}
@@ -1,20 +0,0 @@
1
- import { SchematicArgv } from '../schematic-argv';
2
- /**
3
- * The interface describes the possible parameters for generating the Dependencies entity,
4
- * the generator can be called by the command below
5
- *
6
- * ```bash
7
- * ng g @ng-doc/builder:dependencies
8
- * ```
9
- *
10
- * Here is an example showing how you can call a generator with all parameters
11
- * ```bash
12
- * ng g @ng-doc/builder:dependencies -m
13
- * ```
14
- */
15
- export interface NgDocBuildDependenciesSchema extends SchematicArgv {
16
- /**
17
- * Should NgDoc generates module (alias is `-m`)
18
- */
19
- module?: boolean;
20
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/builder/schematics/dependencies/schema.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import {NgDocDependencies} from '@ng-doc/core';
2
- import {<%= pageName %>Module} from './ng-doc.module';
3
-
4
- const <%= pageName %>Dependencies: NgDocDependencies = {
5
- module: <%= pageName %>Module,
6
- // Add your demos that you are going to use in the page here
7
- demo: {},
8
- };
9
-
10
- export default <%= pageName %>Dependencies;