@nrwl/angular 15.9.1 → 16.0.0-beta.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 (175) hide show
  1. package/migrations.json +2 -2
  2. package/package.json +11 -10
  3. package/src/generators/application/lib/add-e2e.js +5 -3
  4. package/src/generators/application/lib/add-e2e.js.map +1 -1
  5. package/src/generators/application/lib/create-project.d.ts +1 -1
  6. package/src/generators/application/lib/create-project.js.map +1 -1
  7. package/src/generators/component/component.compat.js +3 -3
  8. package/src/generators/component/component.compat.js.map +1 -1
  9. package/src/generators/component/component.js +10 -31
  10. package/src/generators/component/component.js.map +1 -1
  11. package/src/generators/component/lib/component.js +16 -6
  12. package/src/generators/component/lib/component.js.map +1 -1
  13. package/src/generators/component/lib/index.d.ts +4 -0
  14. package/src/generators/component/lib/index.js +8 -0
  15. package/src/generators/component/lib/index.js.map +1 -0
  16. package/src/generators/component/lib/module.js +2 -3
  17. package/src/generators/component/lib/module.js.map +1 -1
  18. package/src/generators/component/lib/normalize-options.d.ts +1 -1
  19. package/src/generators/component/lib/normalize-options.js +9 -11
  20. package/src/generators/component/lib/normalize-options.js.map +1 -1
  21. package/src/generators/component/lib/validate-options.d.ts +3 -0
  22. package/src/generators/component/lib/validate-options.js +12 -0
  23. package/src/generators/component/lib/validate-options.js.map +1 -0
  24. package/src/generators/component/schema.d.ts +3 -1
  25. package/src/generators/component/schema.json +1 -1
  26. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +1 -1
  27. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js.map +1 -1
  28. package/src/generators/directive/directive.js +13 -29
  29. package/src/generators/directive/directive.js.map +1 -1
  30. package/src/generators/directive/lib/index.d.ts +2 -0
  31. package/src/generators/directive/lib/index.js +6 -0
  32. package/src/generators/directive/lib/index.js.map +1 -0
  33. package/src/generators/directive/lib/normalize-options.d.ts +3 -0
  34. package/src/generators/directive/lib/normalize-options.js +18 -0
  35. package/src/generators/directive/lib/normalize-options.js.map +1 -0
  36. package/src/generators/directive/lib/validate-options.d.ts +3 -0
  37. package/src/generators/directive/lib/validate-options.js +12 -0
  38. package/src/generators/directive/lib/validate-options.js.map +1 -0
  39. package/src/generators/directive/schema.d.ts +5 -0
  40. package/src/generators/directive/schema.json +1 -1
  41. package/src/generators/host/host.js +2 -1
  42. package/src/generators/host/host.js.map +1 -1
  43. package/src/generators/library/lib/add-project.d.ts +4 -5
  44. package/src/generators/library/lib/add-project.js.map +1 -1
  45. package/src/generators/library/lib/create-files.d.ts +4 -5
  46. package/src/generators/library/lib/create-files.js +1 -1
  47. package/src/generators/library/lib/create-files.js.map +1 -1
  48. package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.effects.ts__tmpl__ +4 -4
  49. package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts +2 -1
  50. package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +5 -12
  51. package/src/generators/ngrx/lib/add-ngrx-to-package-json.js.map +1 -1
  52. package/src/generators/ngrx/lib/generate-files.js +1 -1
  53. package/src/generators/ngrx/lib/generate-files.js.map +1 -1
  54. package/src/generators/ngrx/lib/normalize-options.d.ts +3 -1
  55. package/src/generators/ngrx/lib/normalize-options.js +11 -2
  56. package/src/generators/ngrx/lib/normalize-options.js.map +1 -1
  57. package/src/generators/ngrx/ngrx.js +2 -2
  58. package/src/generators/ngrx/ngrx.js.map +1 -1
  59. package/src/generators/pipe/lib/index.d.ts +2 -0
  60. package/src/generators/pipe/lib/index.js +6 -0
  61. package/src/generators/pipe/lib/index.js.map +1 -0
  62. package/src/generators/pipe/lib/normalize-options.d.ts +3 -0
  63. package/src/generators/pipe/lib/normalize-options.js +12 -0
  64. package/src/generators/pipe/lib/normalize-options.js.map +1 -0
  65. package/src/generators/pipe/lib/validate-options.d.ts +3 -0
  66. package/src/generators/pipe/lib/validate-options.js +12 -0
  67. package/src/generators/pipe/lib/validate-options.js.map +1 -0
  68. package/src/generators/pipe/pipe.d.ts +1 -1
  69. package/src/generators/pipe/pipe.js +13 -23
  70. package/src/generators/pipe/pipe.js.map +1 -1
  71. package/src/generators/pipe/schema.d.ts +5 -0
  72. package/src/generators/pipe/schema.json +1 -1
  73. package/src/generators/remote/remote.js +2 -1
  74. package/src/generators/remote/remote.js.map +1 -1
  75. package/src/generators/scam/lib/convert-component-to-scam.d.ts +1 -2
  76. package/src/generators/scam/lib/convert-component-to-scam.js +11 -11
  77. package/src/generators/scam/lib/convert-component-to-scam.js.map +1 -1
  78. package/src/generators/scam/lib/index.d.ts +1 -0
  79. package/src/generators/scam/lib/index.js +1 -0
  80. package/src/generators/scam/lib/index.js.map +1 -1
  81. package/src/generators/scam/lib/normalize-options.js +6 -6
  82. package/src/generators/scam/lib/normalize-options.js.map +1 -1
  83. package/src/generators/scam/lib/validate-options.d.ts +3 -0
  84. package/src/generators/scam/lib/validate-options.js +11 -0
  85. package/src/generators/scam/lib/validate-options.js.map +1 -0
  86. package/src/generators/scam/scam.js +9 -24
  87. package/src/generators/scam/scam.js.map +1 -1
  88. package/src/generators/scam/schema.d.ts +4 -2
  89. package/src/generators/scam/schema.json +6 -0
  90. package/src/generators/scam-directive/lib/convert-directive-to-scam.d.ts +1 -2
  91. package/src/generators/scam-directive/lib/convert-directive-to-scam.js +11 -11
  92. package/src/generators/scam-directive/lib/convert-directive-to-scam.js.map +1 -1
  93. package/src/generators/scam-directive/lib/index.d.ts +1 -0
  94. package/src/generators/scam-directive/lib/index.js +1 -0
  95. package/src/generators/scam-directive/lib/index.js.map +1 -1
  96. package/src/generators/scam-directive/lib/normalize-options.js +8 -7
  97. package/src/generators/scam-directive/lib/normalize-options.js.map +1 -1
  98. package/src/generators/scam-directive/lib/validate-options.d.ts +3 -0
  99. package/src/generators/scam-directive/lib/validate-options.js +11 -0
  100. package/src/generators/scam-directive/lib/validate-options.js.map +1 -0
  101. package/src/generators/scam-directive/scam-directive.js +6 -22
  102. package/src/generators/scam-directive/scam-directive.js.map +1 -1
  103. package/src/generators/scam-directive/schema.d.ts +3 -1
  104. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.d.ts +1 -2
  105. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +11 -11
  106. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js.map +1 -1
  107. package/src/generators/scam-pipe/lib/index.d.ts +1 -0
  108. package/src/generators/scam-pipe/lib/index.js +1 -0
  109. package/src/generators/scam-pipe/lib/index.js.map +1 -1
  110. package/src/generators/scam-pipe/lib/normalize-options.js +8 -7
  111. package/src/generators/scam-pipe/lib/normalize-options.js.map +1 -1
  112. package/src/generators/scam-pipe/lib/validate-options.d.ts +3 -0
  113. package/src/generators/scam-pipe/lib/validate-options.js +11 -0
  114. package/src/generators/scam-pipe/lib/validate-options.js.map +1 -0
  115. package/src/generators/scam-pipe/scam-pipe.js +6 -20
  116. package/src/generators/scam-pipe/scam-pipe.js.map +1 -1
  117. package/src/generators/scam-pipe/schema.d.ts +3 -1
  118. package/src/generators/setup-mf/lib/add-remote-entry.d.ts +1 -1
  119. package/src/generators/setup-mf/lib/add-remote-entry.js +1 -1
  120. package/src/generators/setup-mf/lib/add-remote-entry.js.map +1 -1
  121. package/src/generators/storybook-configuration/schema.json +1 -1
  122. package/src/generators/utils/export-scam.d.ts +3 -2
  123. package/src/generators/utils/export-scam.js +4 -4
  124. package/src/generators/utils/export-scam.js.map +1 -1
  125. package/src/generators/utils/names.d.ts +5 -0
  126. package/src/generators/utils/names.js +12 -0
  127. package/src/generators/utils/names.js.map +1 -0
  128. package/src/generators/utils/path.d.ts +18 -1
  129. package/src/generators/utils/path.js +26 -1
  130. package/src/generators/utils/path.js.map +1 -1
  131. package/src/generators/utils/selector.d.ts +3 -0
  132. package/src/generators/utils/selector.js +15 -0
  133. package/src/generators/utils/selector.js.map +1 -0
  134. package/src/generators/utils/validations.d.ts +3 -0
  135. package/src/generators/utils/validations.js +25 -0
  136. package/src/generators/utils/validations.js.map +1 -0
  137. package/src/migrations/update-15-7-0/install-required-packages.js +1 -1
  138. package/src/migrations/update-15-7-0/install-required-packages.js.map +1 -1
  139. package/src/utils/mf/utils.js +2 -2
  140. package/src/utils/mf/utils.js.map +1 -1
  141. package/src/utils/nx-devkit/ast-utils.d.ts +53 -0
  142. package/src/utils/nx-devkit/ast-utils.js +62 -10
  143. package/src/utils/nx-devkit/ast-utils.js.map +1 -1
  144. package/src/utils/nx-devkit/route-utils.d.ts +16 -0
  145. package/src/utils/nx-devkit/route-utils.js +16 -0
  146. package/src/utils/nx-devkit/route-utils.js.map +1 -1
  147. package/src/utils/public-api.d.ts +2 -0
  148. package/src/utils/public-api.js +16 -0
  149. package/src/utils/public-api.js.map +1 -0
  150. package/src/utils/types.d.ts +4 -0
  151. package/src/utils/types.js +3 -0
  152. package/src/utils/types.js.map +1 -0
  153. package/src/generators/component/lib/entry-point.d.ts +0 -2
  154. package/src/generators/component/lib/entry-point.js +0 -19
  155. package/src/generators/component/lib/entry-point.js.map +0 -1
  156. package/src/generators/utils/file-info.d.ts +0 -16
  157. package/src/generators/utils/file-info.js +0 -30
  158. package/src/generators/utils/file-info.js.map +0 -1
  159. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.__style__ → __fileName__.__type__.__style__} +0 -0
  160. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.html__tpl__ → __fileName__.__type__.html__tpl__} +0 -0
  161. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.spec.ts__tpl__ → __fileName__.__type__.spec.ts__tpl__} +0 -0
  162. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.ts__tpl__ → __fileName__.__type__.ts__tpl__} +0 -0
  163. /package/src/generators/directive/files/{__directiveFileName__/__directiveFileName__.directive.spec.ts__tpl__ → __directiveFileName__.directive.spec.ts__tpl__} +0 -0
  164. /package/src/generators/directive/files/{__directiveFileName__/__directiveFileName__.directive.ts__tpl__ → __directiveFileName__.directive.ts__tpl__} +0 -0
  165. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.actions.ts__tmpl__ +0 -0
  166. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.effects.spec.ts__tmpl__ +0 -0
  167. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -0
  168. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.facade.ts__tmpl__ +0 -0
  169. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.models.ts__tmpl__ +0 -0
  170. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.reducer.spec.ts__tmpl__ +0 -0
  171. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.reducer.ts__tmpl__ +0 -0
  172. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.selectors.spec.ts__tmpl__ +0 -0
  173. /package/src/generators/ngrx/files/{latest → base}/__directory__/__fileName__.selectors.ts__tmpl__ +0 -0
  174. /package/src/generators/pipe/files/{__pipeFileName__/__pipeFileName__.pipe.spec.ts__tpl__ → __pipeFileName__.pipe.spec.ts__tpl__} +0 -0
  175. /package/src/generators/pipe/files/{__pipeFileName__/__pipeFileName__.pipe.ts__tpl__ → __pipeFileName__.pipe.ts__tpl__} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAG3E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,IAAI;QACJ,iBAAiB,IACjB;AACJ,CAAC;AAvBD,4CAuBC"}
1
+ {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,2CAAyD;AAGzD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EAAC,IAAI,kCACrE,OAAO,KACV,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,WAAW,IACjC,CAAC;IAEH,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI,IACJ;AACJ,CAAC;AAlBD,4CAkBC"}
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nrwl/devkit';
2
+ import type { Schema } from '../schema';
3
+ export declare function validateOptions(tree: Tree, options: Schema): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateOptions = void 0;
4
+ const path_1 = require("../../utils/path");
5
+ const validations_1 = require("../../utils/validations");
6
+ function validateOptions(tree, options) {
7
+ (0, validations_1.validateProject)(tree, options.project);
8
+ (0, path_1.checkPathUnderProjectRoot)(tree, options.project, options.path);
9
+ }
10
+ exports.validateOptions = validateOptions;
11
+ //# sourceMappingURL=validate-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAA0D;AAG1D,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAe;IACzD,IAAA,6BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAA,gCAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAHD,0CAGC"}
@@ -3,37 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.scamGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
+ const component_1 = require("../component/component");
6
7
  const export_scam_1 = require("../utils/export-scam");
7
- const file_info_1 = require("../utils/file-info");
8
- const path_1 = require("../utils/path");
9
8
  const lib_1 = require("./lib");
10
9
  function scamGenerator(tree, rawOptions) {
11
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ (0, lib_1.validateOptions)(tree, rawOptions);
12
+ const { inlineScam } = rawOptions, generatorOptions = tslib_1.__rest(rawOptions, ["inlineScam"]);
13
+ yield (0, component_1.componentGenerator)(tree, Object.assign(Object.assign({}, generatorOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
12
14
  const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
13
- const { inlineScam, projectSourceRoot } = options, schematicOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
14
- checkPathUnderProjectRoot(tree, options);
15
- const { wrapAngularDevkitSchematic } = require('@nrwl/devkit/ngcli-adapter');
16
- const angularComponentSchematic = wrapAngularDevkitSchematic('@schematics/angular', 'component');
17
- yield angularComponentSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false, standalone: false }));
18
- const componentFileInfo = (0, file_info_1.getComponentFileInfo)(tree, options);
19
- (0, lib_1.convertComponentToScam)(tree, componentFileInfo, options);
20
- (0, export_scam_1.exportScam)(tree, componentFileInfo, options);
21
- yield (0, devkit_1.formatFiles)(tree);
15
+ (0, lib_1.convertComponentToScam)(tree, options);
16
+ (0, export_scam_1.exportScam)(tree, options);
17
+ if (!options.skipFormat) {
18
+ yield (0, devkit_1.formatFiles)(tree);
19
+ }
22
20
  });
23
21
  }
24
22
  exports.scamGenerator = scamGenerator;
25
- function checkPathUnderProjectRoot(tree, options) {
26
- if (!options.path) {
27
- return;
28
- }
29
- const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
30
- let pathToComponent = (0, devkit_1.normalizePath)(options.path);
31
- pathToComponent = pathToComponent.startsWith('/')
32
- ? pathToComponent.slice(1)
33
- : pathToComponent;
34
- if (!(0, path_1.pathStartsWith)(pathToComponent, root)) {
35
- throw new Error(`The path provided for the SCAM (${options.path}) does not exist under the project root (${root}).`);
36
- }
37
- }
38
23
  exports.default = scamGenerator;
39
24
  //# sourceMappingURL=scam.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,sDAAkD;AAClD,kDAA0D;AAC1D,wCAA+C;AAC/C,+BAAiE;AAGjE,SAAsB,aAAa,CAAC,IAAU,EAAE,UAAkB;;QAChE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAA0B,OAAO,EAA5B,gBAAgB,kBAAK,OAAO,EAAhE,mCAAsD,CAAU,CAAC;QAEvE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC7E,MAAM,yBAAyB,GAAG,0BAA0B,CAC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;AAGf,SAAsB,aAAa,CAAC,IAAU,EAAE,UAAkB;;QAChE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAElC,MAAM,EAAE,UAAU,KAA0B,UAAU,EAA/B,gBAAgB,kBAAK,UAAU,EAAhD,cAAmC,CAAa,CAAC;QACvD,MAAM,IAAA,8BAAkB,EAAC,IAAI,kCACxB,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,IAAA,4BAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AAnBD,sCAmBC;AAED,kBAAe,aAAa,CAAC"}
@@ -16,11 +16,13 @@ export interface Schema {
16
16
  selector?: string;
17
17
  skipSelector?: boolean;
18
18
  export?: boolean;
19
+ skipFormat?: boolean;
19
20
  }
20
21
 
21
22
  export interface NormalizedSchema extends Schema {
23
+ directory: string;
24
+ fileName: string;
25
+ filePath: string;
22
26
  export: boolean;
23
27
  inlineScam: boolean;
24
- path: string;
25
- projectSourceRoot: string;
26
28
  }
@@ -123,6 +123,12 @@
123
123
  "description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
124
124
  "default": true,
125
125
  "x-priority": "important"
126
+ },
127
+ "skipFormat": {
128
+ "type": "boolean",
129
+ "description": "Skip formatting files.",
130
+ "default": false,
131
+ "x-priority": "internal"
126
132
  }
127
133
  },
128
134
  "required": ["name", "project"]
@@ -1,4 +1,3 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
- import type { FileInfo } from '../../utils/file-info';
3
2
  import type { NormalizedSchema } from '../schema';
4
- export declare function convertDirectiveToScam(tree: Tree, directiveFileInfo: FileInfo, options: NormalizedSchema): void;
3
+ export declare function convertDirectiveToScam(tree: Tree, options: NormalizedSchema): void;
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertDirectiveToScam = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
- const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
6
5
  const js_1 = require("@nrwl/js");
6
+ const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
7
7
  let tsModule;
8
- function convertDirectiveToScam(tree, directiveFileInfo, options) {
9
- if (!tree.exists(directiveFileInfo.filePath)) {
10
- throw new Error(`Couldn't find directive at path ${directiveFileInfo.filePath} to add SCAM setup.`);
8
+ function convertDirectiveToScam(tree, options) {
9
+ if (!tree.exists(options.filePath)) {
10
+ throw new Error(`Couldn't find directive at path ${options.filePath} to add SCAM setup.`);
11
11
  }
12
12
  if (!tsModule) {
13
13
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
@@ -16,17 +16,17 @@ function convertDirectiveToScam(tree, directiveFileInfo, options) {
16
16
  const typeNames = (0, devkit_1.names)('directive');
17
17
  const directiveClassName = `${directiveNames.className}${typeNames.className}`;
18
18
  if (options.inlineScam) {
19
- const currentDirectiveContents = tree.read(directiveFileInfo.filePath, 'utf-8');
20
- let source = tsModule.createSourceFile(directiveFileInfo.filePath, currentDirectiveContents, tsModule.ScriptTarget.Latest, true);
21
- source = (0, js_1.insertImport)(tree, source, directiveFileInfo.filePath, 'NgModule', '@angular/core');
22
- source = (0, js_1.insertImport)(tree, source, directiveFileInfo.filePath, 'CommonModule', '@angular/common');
19
+ const currentDirectiveContents = tree.read(options.filePath, 'utf-8');
20
+ let source = tsModule.createSourceFile(options.filePath, currentDirectiveContents, tsModule.ScriptTarget.Latest, true);
21
+ source = (0, js_1.insertImport)(tree, source, options.filePath, 'NgModule', '@angular/core');
22
+ source = (0, js_1.insertImport)(tree, source, options.filePath, 'CommonModule', '@angular/common');
23
23
  let updatedDirectiveSource = source.getText();
24
24
  updatedDirectiveSource = `${updatedDirectiveSource}${getNgModuleDeclaration(directiveClassName)}`;
25
- tree.write(directiveFileInfo.filePath, updatedDirectiveSource);
25
+ tree.write(options.filePath, updatedDirectiveSource);
26
26
  return;
27
27
  }
28
- const scamFilePath = (0, devkit_1.joinPathFragments)(directiveFileInfo.directory, `${directiveNames.fileName}.module.ts`);
29
- tree.write(scamFilePath, getModuleFileContent(directiveClassName, directiveFileInfo.fileName));
28
+ const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${directiveNames.fileName}.module.ts`);
29
+ tree.write(scamFilePath, getModuleFileContent(directiveClassName, options.fileName));
30
30
  }
31
31
  exports.convertDirectiveToScam = convertDirectiveToScam;
32
32
  function getModuleFileContent(directiveClassName, directiveFileName) {
@@ -1 +1 @@
1
- {"version":3,"file":"convert-directive-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,uFAAmF;AACnF,iCAAwC;AAIxC,IAAI,QAAqC,CAAC;AAE1C,SAAgB,sBAAsB,CACpC,IAAU,EACV,iBAA2B,EAC3B,OAAyB;IAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC5C,MAAM,IAAI,KAAK,CACb,mCAAmC,iBAAiB,CAAC,QAAQ,qBAAqB,CACnF,CAAC;KACH;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAK,EAA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BAAkB,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,sBAAsB,CAAC,kBAA0B;IACxD,OAAO;;;mBAGU,kBAAkB;cACvB,kBAAkB;;eAEjB,kBAAkB,WAAW,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"convert-directive-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/convert-directive-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,iCAAwC;AACxC,uFAAmF;AAGnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,sBAAsB,CACpC,IAAU,EACV,OAAyB;IAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,QAAQ,qBAAqB,CACzE,CAAC;KACH;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,WAAW,CAAC,CAAC;IACrC,MAAM,kBAAkB,GAAG,GAAG,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;IAE/E,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,MAAM,wBAAwB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CACpC,OAAO,CAAC,QAAQ,EAChB,wBAAwB,EACxB,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,cAAc,EACd,iBAAiB,CAClB,CAAC;QAEF,IAAI,sBAAsB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9C,sBAAsB,GAAG,GAAG,sBAAsB,GAAG,sBAAsB,CACzE,kBAAkB,CACnB,EAAE,CAAC;QAEJ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;QACrD,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,SAAS,EACjB,GAAG,cAAc,CAAC,QAAQ,YAAY,CACvC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,oBAAoB,CAAC,kBAAkB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAC3D,CAAC;AACJ,CAAC;AA3DD,wDA2DC;AAED,SAAS,oBAAoB,CAC3B,kBAA0B,EAC1B,iBAAyB;IAEzB,OAAO;;WAEE,kBAAkB,cAAc,iBAAiB;EAC1D,sBAAsB,CAAC,kBAAkB,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,sBAAsB,CAAC,kBAA0B;IACxD,OAAO;;;mBAGU,kBAAkB;cACvB,kBAAkB;;eAEjB,kBAAkB,WAAW,CAAC;AAC7C,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './convert-directive-to-scam';
2
2
  export * from './normalize-options';
3
+ export * from './validate-options';
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./convert-directive-to-scam"), exports);
5
5
  tslib_1.__exportStar(require("./normalize-options"), exports);
6
+ tslib_1.__exportStar(require("./validate-options"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,8DAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,8DAAoC;AACpC,6DAAmC"}
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
- const devkit_1 = require("@nrwl/devkit");
4
+ const path_1 = require("../../utils/path");
5
5
  function normalizeOptions(tree, options) {
6
- var _a, _b, _c, _d;
7
- const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
8
- const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
9
- const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
10
- return Object.assign(Object.assign({}, options), { export: (_b = options.export) !== null && _b !== void 0 ? _b : true, flat: (_c = options.flat) !== null && _c !== void 0 ? _c : true, inlineScam: (_d = options.inlineScam) !== null && _d !== void 0 ? _d : true, path,
11
- projectSourceRoot });
6
+ var _a, _b, _c;
7
+ const { directory, fileName, filePath, name, path } = (0, path_1.normalizeNameAndPaths)(tree, Object.assign(Object.assign({}, options), { type: 'directive' }));
8
+ return Object.assign(Object.assign({}, options), { export: (_a = options.export) !== null && _a !== void 0 ? _a : true, flat: (_b = options.flat) !== null && _b !== void 0 ? _b : true, inlineScam: (_c = options.inlineScam) !== null && _c !== void 0 ? _c : true, directory,
9
+ fileName,
10
+ filePath,
11
+ path,
12
+ name });
12
13
  }
13
14
  exports.normalizeOptions = normalizeOptions;
14
15
  //# sourceMappingURL=normalize-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAG3E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,IAAI;QACJ,iBAAiB,IACjB;AACJ,CAAC;AAxBD,4CAwBC"}
1
+ {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,2CAAyD;AAGzD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EACzE,IAAI,kCAEC,OAAO,KACV,IAAI,EAAE,WAAW,IAEpB,CAAC;IAEF,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,IAAI,IACJ;AACJ,CAAC;AAvBD,4CAuBC"}
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nrwl/devkit';
2
+ import type { Schema } from '../schema';
3
+ export declare function validateOptions(tree: Tree, options: Schema): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateOptions = void 0;
4
+ const path_1 = require("../../utils/path");
5
+ const validations_1 = require("../../utils/validations");
6
+ function validateOptions(tree, options) {
7
+ (0, validations_1.validateProject)(tree, options.project);
8
+ (0, path_1.checkPathUnderProjectRoot)(tree, options.project, options.path);
9
+ }
10
+ exports.validateOptions = validateOptions;
11
+ //# sourceMappingURL=validate-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-directive/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAA0D;AAG1D,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAe;IACzD,IAAA,6BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAA,gCAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAHD,0CAGC"}
@@ -3,36 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.scamDirectiveGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
+ const directive_1 = require("../directive/directive");
6
7
  const export_scam_1 = require("../utils/export-scam");
7
- const file_info_1 = require("../utils/file-info");
8
- const path_1 = require("../utils/path");
9
8
  const lib_1 = require("./lib");
10
- const directive_1 = require("../directive/directive");
11
9
  function scamDirectiveGenerator(tree, rawOptions) {
12
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ (0, lib_1.validateOptions)(tree, rawOptions);
12
+ const { inlineScam } = rawOptions, directiveOptions = tslib_1.__rest(rawOptions, ["inlineScam"]);
13
+ yield (0, directive_1.directiveGenerator)(tree, Object.assign(Object.assign({}, directiveOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
13
14
  const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
14
- const { inlineScam, projectSourceRoot } = options, directiveOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
15
- checkPathUnderProjectRoot(tree, options);
16
- yield (0, directive_1.default)(tree, Object.assign(Object.assign({}, directiveOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
17
- const pipeFileInfo = (0, file_info_1.getDirectiveFileInfo)(tree, options);
18
- (0, lib_1.convertDirectiveToScam)(tree, pipeFileInfo, options);
19
- (0, export_scam_1.exportScam)(tree, pipeFileInfo, options);
15
+ (0, lib_1.convertDirectiveToScam)(tree, options);
16
+ (0, export_scam_1.exportScam)(tree, options);
20
17
  yield (0, devkit_1.formatFiles)(tree);
21
18
  });
22
19
  }
23
20
  exports.scamDirectiveGenerator = scamDirectiveGenerator;
24
- function checkPathUnderProjectRoot(tree, options) {
25
- if (!options.path) {
26
- return;
27
- }
28
- const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
29
- let pathToDirective = (0, devkit_1.normalizePath)(options.path);
30
- pathToDirective = pathToDirective.startsWith('/')
31
- ? pathToDirective.slice(1)
32
- : pathToDirective;
33
- if (!(0, path_1.pathStartsWith)(pathToDirective, root)) {
34
- throw new Error(`The path provided for the SCAM (${options.path}) does not exist under the project root (${root}).`);
35
- }
36
- }
37
21
  exports.default = scamDirectiveGenerator;
38
22
  //# sourceMappingURL=scam-directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scam-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-directive/scam-directive.ts"],"names":[],"mappings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,CAAC,eAAe,CAAC;IAEpB,IAAI,CAAC,IAAA,qBAAc,EAAC,eAAe,EAAE,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,IAAI,4CAA4C,IAAI,IAAI,CACpG,CAAC;KACH;AACH,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"scam-directive.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-directive/scam-directive.ts"],"names":[],"mappings":";;;;AACA,yCAA2C;AAC3C,sDAA4D;AAC5D,sDAAkD;AAClD,+BAIe;AAGf,SAAsB,sBAAsB,CAAC,IAAU,EAAE,UAAkB;;QACzE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAElC,MAAM,EAAE,UAAU,KAA0B,UAAU,EAA/B,gBAAgB,kBAAK,UAAU,EAAhD,cAAmC,CAAa,CAAC;QACvD,MAAM,IAAA,8BAAkB,EAAC,IAAI,kCACxB,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,IAAA,4BAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAjBD,wDAiBC;AAED,kBAAe,sBAAsB,CAAC"}
@@ -11,9 +11,11 @@ export interface Schema {
11
11
  }
12
12
 
13
13
  export interface NormalizedSchema extends Schema {
14
+ directory: string;
14
15
  export: boolean;
16
+ fileName: string;
17
+ filePath: string;
15
18
  flat: boolean;
16
19
  inlineScam: boolean;
17
20
  path: string;
18
- projectSourceRoot: string;
19
21
  }
@@ -1,4 +1,3 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
- import type { FileInfo } from '../../utils/file-info';
3
2
  import type { NormalizedSchema } from '../schema';
4
- export declare function convertPipeToScam(tree: Tree, pipeFileInfo: FileInfo, options: NormalizedSchema): void;
3
+ export declare function convertPipeToScam(tree: Tree, options: NormalizedSchema): void;
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertPipeToScam = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
- const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
6
5
  const js_1 = require("@nrwl/js");
6
+ const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
7
7
  let tsModule;
8
- function convertPipeToScam(tree, pipeFileInfo, options) {
9
- if (!tree.exists(pipeFileInfo.filePath)) {
10
- throw new Error(`Couldn't find pipe at path ${pipeFileInfo.filePath} to add SCAM setup.`);
8
+ function convertPipeToScam(tree, options) {
9
+ if (!tree.exists(options.filePath)) {
10
+ throw new Error(`Couldn't find pipe at path ${options.filePath} to add SCAM setup.`);
11
11
  }
12
12
  if (!tsModule) {
13
13
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
@@ -16,17 +16,17 @@ function convertPipeToScam(tree, pipeFileInfo, options) {
16
16
  const typeNames = (0, devkit_1.names)('pipe');
17
17
  const pipeClassName = `${pipeNames.className}${typeNames.className}`;
18
18
  if (options.inlineScam) {
19
- const currentPipeContents = tree.read(pipeFileInfo.filePath, 'utf-8');
20
- let source = tsModule.createSourceFile(pipeFileInfo.filePath, currentPipeContents, tsModule.ScriptTarget.Latest, true);
21
- source = (0, js_1.insertImport)(tree, source, pipeFileInfo.filePath, 'NgModule', '@angular/core');
22
- source = (0, js_1.insertImport)(tree, source, pipeFileInfo.filePath, 'CommonModule', '@angular/common');
19
+ const currentPipeContents = tree.read(options.filePath, 'utf-8');
20
+ let source = tsModule.createSourceFile(options.filePath, currentPipeContents, tsModule.ScriptTarget.Latest, true);
21
+ source = (0, js_1.insertImport)(tree, source, options.filePath, 'NgModule', '@angular/core');
22
+ source = (0, js_1.insertImport)(tree, source, options.filePath, 'CommonModule', '@angular/common');
23
23
  let updatedPipeSource = source.getText();
24
24
  updatedPipeSource = `${updatedPipeSource}${getNgModuleDeclaration(pipeClassName)}`;
25
- tree.write(pipeFileInfo.filePath, updatedPipeSource);
25
+ tree.write(options.filePath, updatedPipeSource);
26
26
  return;
27
27
  }
28
- const scamFilePath = (0, devkit_1.joinPathFragments)(pipeFileInfo.directory, `${pipeNames.fileName}.module.ts`);
29
- tree.write(scamFilePath, getModuleFileContent(pipeClassName, pipeFileInfo.fileName));
28
+ const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${pipeNames.fileName}.module.ts`);
29
+ tree.write(scamFilePath, getModuleFileContent(pipeClassName, options.fileName));
30
30
  }
31
31
  exports.convertPipeToScam = convertPipeToScam;
32
32
  function getModuleFileContent(pipeClassName, pipeFileName) {
@@ -1 +1 @@
1
- {"version":3,"file":"convert-pipe-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,uFAAmF;AACnF,iCAAwC;AAIxC,IAAI,QAAqC,CAAC;AAE1C,SAAgB,iBAAiB,CAC/B,IAAU,EACV,YAAsB,EACtB,OAAyB;IAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CACb,8BAA8B,YAAY,CAAC,QAAQ,qBAAqB,CACzE,CAAC;KACH;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,IAAA,cAAK,E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AED,SAAS,sBAAsB,CAAC,aAAqB;IACnD,OAAO;;;mBAGU,aAAa;cAClB,aAAa;;eAEZ,aAAa,WAAW,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"convert-pipe-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,iCAAwC;AACxC,uFAAmF;AAGnF,IAAI,QAAqC,CAAC;AAE1C,SAAgB,iBAAiB,CAAC,IAAU,EAAE,OAAyB;IACrE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,8BAA8B,OAAO,CAAC,QAAQ,qBAAqB,CACpE,CAAC;KACH;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,MAAM,CAAC,CAAC;IAChC,MAAM,aAAa,GAAG,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;IAErE,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CACpC,OAAO,CAAC,QAAQ,EAChB,mBAAmB,EACnB,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,OAAO,CAAC,QAAQ,EAChB,cAAc,EACd,iBAAiB,CAClB,CAAC;QAEF,IAAI,iBAAiB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QACzC,iBAAiB,GAAG,GAAG,iBAAiB,GAAG,sBAAsB,CAC/D,aAAa,CACd,EAAE,CAAC;QAEJ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAChD,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,SAAS,EACjB,GAAG,SAAS,CAAC,QAAQ,YAAY,CAClC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,oBAAoB,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,CACtD,CAAC;AACJ,CAAC;AAxDD,8CAwDC;AAED,SAAS,oBAAoB,CAC3B,aAAqB,EACrB,YAAoB;IAEpB,OAAO;;WAEE,aAAa,cAAc,YAAY;EAChD,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,sBAAsB,CAAC,aAAqB;IACnD,OAAO;;;mBAGU,aAAa;cAClB,aAAa;;eAEZ,aAAa,WAAW,CAAC;AACxC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './convert-pipe-to-scam';
2
2
  export * from './normalize-options';
3
+ export * from './validate-options';
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./convert-pipe-to-scam"), exports);
5
5
  tslib_1.__exportStar(require("./normalize-options"), exports);
6
+ tslib_1.__exportStar(require("./validate-options"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,8DAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,8DAAoC;AACpC,6DAAmC"}
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
- const devkit_1 = require("@nrwl/devkit");
4
+ const path_1 = require("../../utils/path");
5
5
  function normalizeOptions(tree, options) {
6
- var _a, _b, _c, _d;
7
- const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
8
- const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
9
- const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
10
- return Object.assign(Object.assign({}, options), { export: (_b = options.export) !== null && _b !== void 0 ? _b : true, flat: (_c = options.flat) !== null && _c !== void 0 ? _c : true, inlineScam: (_d = options.inlineScam) !== null && _d !== void 0 ? _d : true, path,
11
- projectSourceRoot });
6
+ var _a, _b, _c;
7
+ const { directory, fileName, filePath, name, path } = (0, path_1.normalizeNameAndPaths)(tree, Object.assign(Object.assign({}, options), { type: 'pipe' }));
8
+ return Object.assign(Object.assign({}, options), { export: (_a = options.export) !== null && _a !== void 0 ? _a : true, flat: (_b = options.flat) !== null && _b !== void 0 ? _b : true, inlineScam: (_c = options.inlineScam) !== null && _c !== void 0 ? _c : true, directory,
9
+ fileName,
10
+ filePath,
11
+ name,
12
+ path });
12
13
  }
13
14
  exports.normalizeOptions = normalizeOptions;
14
15
  //# sourceMappingURL=normalize-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAG3E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,IAAI;QACJ,iBAAiB,IACjB;AACJ,CAAC;AAxBD,4CAwBC"}
1
+ {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,2CAAyD;AAGzD,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAqB,EACzE,IAAI,kCAEC,OAAO,KACV,IAAI,EAAE,MAAM,IAEf,CAAC;IAEF,uCACK,OAAO,KACV,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,EAC9B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,EACtC,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,IAAI,IACJ;AACJ,CAAC;AAvBD,4CAuBC"}
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nrwl/devkit';
2
+ import type { Schema } from '../schema';
3
+ export declare function validateOptions(tree: Tree, options: Schema): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateOptions = void 0;
4
+ const path_1 = require("../../utils/path");
5
+ const validations_1 = require("../../utils/validations");
6
+ function validateOptions(tree, options) {
7
+ (0, validations_1.validateProject)(tree, options.project);
8
+ (0, path_1.checkPathUnderProjectRoot)(tree, options.project, options.path);
9
+ }
10
+ exports.validateOptions = validateOptions;
11
+ //# sourceMappingURL=validate-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/validate-options.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,yDAA0D;AAG1D,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAe;IACzD,IAAA,6BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAA,gCAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAHD,0CAGC"}
@@ -3,34 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.scamPipeGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
+ const pipe_1 = require("../pipe/pipe");
6
7
  const export_scam_1 = require("../utils/export-scam");
7
- const file_info_1 = require("../utils/file-info");
8
- const path_1 = require("../utils/path");
9
8
  const lib_1 = require("./lib");
10
- const pipe_1 = require("../pipe/pipe");
11
9
  function scamPipeGenerator(tree, rawOptions) {
12
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
14
- const { inlineScam, projectSourceRoot } = options, pipeOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
15
- checkPathUnderProjectRoot(tree, options);
11
+ (0, lib_1.validateOptions)(tree, rawOptions);
12
+ const { inlineScam } = rawOptions, pipeOptions = tslib_1.__rest(rawOptions, ["inlineScam"]);
16
13
  yield (0, pipe_1.pipeGenerator)(tree, Object.assign(Object.assign({}, pipeOptions), { skipImport: true, export: false, standalone: false, skipFormat: true }));
17
- const pipeFileInfo = (0, file_info_1.getPipeFileInfo)(tree, options);
18
- (0, lib_1.convertPipeToScam)(tree, pipeFileInfo, options);
19
- (0, export_scam_1.exportScam)(tree, pipeFileInfo, options);
14
+ const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
15
+ (0, lib_1.convertPipeToScam)(tree, options);
16
+ (0, export_scam_1.exportScam)(tree, options);
20
17
  yield (0, devkit_1.formatFiles)(tree);
21
18
  });
22
19
  }
23
20
  exports.scamPipeGenerator = scamPipeGenerator;
24
- function checkPathUnderProjectRoot(tree, options) {
25
- if (!options.path) {
26
- return;
27
- }
28
- const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
29
- let pathToPipe = (0, devkit_1.normalizePath)(options.path);
30
- pathToPipe = pathToPipe.startsWith('/') ? pathToPipe.slice(1) : pathToPipe;
31
- if (!(0, path_1.pathStartsWith)(pathToPipe, root)) {
32
- throw new Error(`The path provided for the SCAM (${options.path}) does not exist under the project root (${root}).`);
33
- }
34
- }
35
21
  exports.default = scamPipeGenerator;
36
22
  //# sourceMappingURL=scam-pipe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,yCAIsB;AACtB,sDAAkD;AAClD,kDAAqD;AACrD,wCAA+C;AAC/C,+BAA4D;AAE5D,uCAA6C;AAE7C,SAAsB,iBAAiB,CAAC,IAAU,EA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I,4CAA4C,IAAI,IAAI,CACpG,CAAC;KACH;AACH,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,yCAA2C;AAC3C,uCAA6C;AAC7C,sDAAkD;AAClD,+BAA6E;AAG7E,SAAsB,iBAAiB,CAAC,IAAU,EAAE,UAAkB;;QACpE,IAAA,qBAAe,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAElC,MAAM,EAAE,UAAU,KAAqB,UAAU,EAA1B,WAAW,kBAAK,UAAU,EAA3C,cAA8B,CAAa,CAAC;QAClD,MAAM,IAAA,oBAAa,EAAC,IAAI,kCACnB,WAAW,KACd,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,IAAA,uBAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE1B,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAjBD,8CAiBC;AAED,kBAAe,iBAAiB,CAAC"}
@@ -9,9 +9,11 @@ export interface Schema {
9
9
  }
10
10
 
11
11
  export interface NormalizedSchema extends Schema {
12
+ directory: string;
12
13
  export: boolean;
14
+ fileName: string;
15
+ filePath: string;
13
16
  flat: boolean;
14
17
  inlineScam: boolean;
15
18
  path: string;
16
- projectSourceRoot: string;
17
19
  }
@@ -1,3 +1,3 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
2
  import type { Schema } from '../schema';
3
- export declare function addRemoteEntry(tree: Tree, { appName, routing, mfType, prefix, standalone }: Schema, appRoot: string): void;
3
+ export declare function addRemoteEntry(tree: Tree, { appName, routing, prefix, standalone }: Schema, appRoot: string): void;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addRemoteEntry = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
6
- function addRemoteEntry(tree, { appName, routing, mfType, prefix, standalone }, appRoot) {
6
+ function addRemoteEntry(tree, { appName, routing, prefix, standalone }, appRoot) {
7
7
  var _a, _b;
8
8
  prefix =
9
9
  (_b = prefix !== null && prefix !== void 0 ? prefix : (_a = (0, devkit_1.readProjectConfiguration)(tree, appName)) === null || _a === void 0 ? void 0 : _a.prefix) !== null && _b !== void 0 ? _b : (0, devkit_1.readNxJson)(tree).npmScope;
@@ -1 +1 @@
1
- {"version":3,"file":"add-remote-entry.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAEtB,sEAAgE;AAEhE,SAAgB,cAAc,CAC5B,IAAU,EACV,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAU,EACxD,OAAe;;IAEf,MAAM;QACJ,MAAA,MAAM,aAAN,MAAM,cAAN,MAAM,GACN,MACE,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAGvC,0CAAE,MAAM,mCACT,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC5B,IAAA,sBAAa,EACX,IAAI,EACJ,UAAU;QACR,CAAC,CAAC,IAAA,0BAAiB,EACf,SAAS,EACT,2CAA2C,CAC5C;QACH,CAAC,CAAC,IAAA,0BAAiB,EAAC,SAAS,EAAE,6BAA6B,CAAC,EAC/D,GAAG,OAAO,uBAAuB,EACjC;QACE,IAAI,EAAE,EAAE;QACR,OAAO;QACP,OAAO;QACP,MAAM;KACP,CACF,CAAC;IAEF,IAAI,UAAU,IAAI,OAAO,EAAE;QACzB,IAAA,sBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,EAAE,uBAAuB,CAAC,EACnD,iGAAiG,CAClG,CAAC;KACH;SAAM;QACL,IAAI,OAAO,EAAE;YACX,IAAA,sBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,EAAE,uBAAuB,CAAC,EACnD,sGAAsG,CACvG,CAAC;SACH;QAED,IAAI,CAAC,KAAK,CACR,GAAG,OAAO,wBAAwB,EAClC;;;;;;EAMJ,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,wBAAwB,EAAE,OAAO,CAAC,EAAE,CACrD,CAAC;KACH;AACH,CAAC;AAxDD,wCAwDC"}
1
+ {"version":3,"file":"add-remote-entry.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mf/lib/add-remote-entry.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AACtB,sEAAgE;AAIhE,SAAgB,cAAc,CAC5B,IAAU,EACV,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAU,EAChD,OAAe;;IAEf,MAAM;QACJ,MAAA,MAAM,aAAN,MAAM,cAAN,MAAM,GACN,MAAC,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAiC,0CACpE,MAAM,mCACV,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC5B,IAAA,sBAAa,EACX,IAAI,EACJ,UAAU;QACR,CAAC,CAAC,IAAA,0BAAiB,EACf,SAAS,EACT,2CAA2C,CAC5C;QACH,CAAC,CAAC,IAAA,0BAAiB,EAAC,SAAS,EAAE,6BAA6B,CAAC,EAC/D,GAAG,OAAO,uBAAuB,EACjC;QACE,IAAI,EAAE,EAAE;QACR,OAAO;QACP,OAAO;QACP,MAAM;KACP,CACF,CAAC;IAEF,IAAI,UAAU,IAAI,OAAO,EAAE;QACzB,IAAA,sBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,EAAE,uBAAuB,CAAC,EACnD,iGAAiG,CAClG,CAAC;KACH;SAAM;QACL,IAAI,OAAO,EAAE;YACX,IAAA,sBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,EAAE,uBAAuB,CAAC,EACnD,sGAAsG,CACvG,CAAC;SACH;QAED,IAAI,CAAC,KAAK,CACR,GAAG,OAAO,wBAAwB,EAClC;;;;;;EAMJ,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,wBAAwB,EAAE,OAAO,CAAC,EAAE,CACrD,CAAC;KACH;AACH,CAAC;AArDD,wCAqDC"}
@@ -90,7 +90,7 @@
90
90
  "storybook7Configuration": {
91
91
  "description": "Configure your workspace using Storybook version 7.",
92
92
  "type": "boolean",
93
- "default": false,
93
+ "default": true,
94
94
  "hidden": true,
95
95
  "aliases": ["storybook7betaConfiguration"]
96
96
  }
@@ -1,9 +1,10 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
- import type { FileInfo } from './file-info';
3
2
  export type GenerationOptions = {
3
+ directory: string;
4
+ filePath: string;
4
5
  name: string;
5
6
  project: string;
6
7
  export?: boolean;
7
8
  inlineScam?: boolean;
8
9
  };
9
- export declare function exportScam(tree: Tree, fileInfo: FileInfo, options: GenerationOptions): void;
10
+ export declare function exportScam(tree: Tree, options: GenerationOptions): void;