@nrwl/angular 15.9.2 → 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 (153) hide show
  1. package/migrations.json +2 -2
  2. package/package.json +11 -10
  3. package/src/generators/application/lib/create-project.d.ts +1 -1
  4. package/src/generators/application/lib/create-project.js.map +1 -1
  5. package/src/generators/component/component.compat.js +3 -3
  6. package/src/generators/component/component.compat.js.map +1 -1
  7. package/src/generators/component/component.js +10 -31
  8. package/src/generators/component/component.js.map +1 -1
  9. package/src/generators/component/lib/component.js +16 -6
  10. package/src/generators/component/lib/component.js.map +1 -1
  11. package/src/generators/component/lib/index.d.ts +4 -0
  12. package/src/generators/component/lib/index.js +8 -0
  13. package/src/generators/component/lib/index.js.map +1 -0
  14. package/src/generators/component/lib/module.js +2 -3
  15. package/src/generators/component/lib/module.js.map +1 -1
  16. package/src/generators/component/lib/normalize-options.d.ts +1 -1
  17. package/src/generators/component/lib/normalize-options.js +9 -11
  18. package/src/generators/component/lib/normalize-options.js.map +1 -1
  19. package/src/generators/component/lib/validate-options.d.ts +3 -0
  20. package/src/generators/component/lib/validate-options.js +12 -0
  21. package/src/generators/component/lib/validate-options.js.map +1 -0
  22. package/src/generators/component/schema.d.ts +3 -1
  23. package/src/generators/component/schema.json +1 -1
  24. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +1 -1
  25. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js.map +1 -1
  26. package/src/generators/directive/directive.js +13 -29
  27. package/src/generators/directive/directive.js.map +1 -1
  28. package/src/generators/directive/lib/index.d.ts +2 -0
  29. package/src/generators/directive/lib/index.js +6 -0
  30. package/src/generators/directive/lib/index.js.map +1 -0
  31. package/src/generators/directive/lib/normalize-options.d.ts +3 -0
  32. package/src/generators/directive/lib/normalize-options.js +18 -0
  33. package/src/generators/directive/lib/normalize-options.js.map +1 -0
  34. package/src/generators/directive/lib/validate-options.d.ts +3 -0
  35. package/src/generators/directive/lib/validate-options.js +12 -0
  36. package/src/generators/directive/lib/validate-options.js.map +1 -0
  37. package/src/generators/directive/schema.d.ts +5 -0
  38. package/src/generators/directive/schema.json +1 -1
  39. package/src/generators/host/host.js +2 -1
  40. package/src/generators/host/host.js.map +1 -1
  41. package/src/generators/library/lib/add-project.d.ts +4 -5
  42. package/src/generators/library/lib/add-project.js.map +1 -1
  43. package/src/generators/library/lib/create-files.d.ts +4 -5
  44. package/src/generators/library/lib/create-files.js +1 -1
  45. package/src/generators/library/lib/create-files.js.map +1 -1
  46. package/src/generators/pipe/lib/index.d.ts +2 -0
  47. package/src/generators/pipe/lib/index.js +6 -0
  48. package/src/generators/pipe/lib/index.js.map +1 -0
  49. package/src/generators/pipe/lib/normalize-options.d.ts +3 -0
  50. package/src/generators/pipe/lib/normalize-options.js +12 -0
  51. package/src/generators/pipe/lib/normalize-options.js.map +1 -0
  52. package/src/generators/pipe/lib/validate-options.d.ts +3 -0
  53. package/src/generators/pipe/lib/validate-options.js +12 -0
  54. package/src/generators/pipe/lib/validate-options.js.map +1 -0
  55. package/src/generators/pipe/pipe.d.ts +1 -1
  56. package/src/generators/pipe/pipe.js +13 -23
  57. package/src/generators/pipe/pipe.js.map +1 -1
  58. package/src/generators/pipe/schema.d.ts +5 -0
  59. package/src/generators/pipe/schema.json +1 -1
  60. package/src/generators/remote/remote.js +2 -1
  61. package/src/generators/remote/remote.js.map +1 -1
  62. package/src/generators/scam/lib/convert-component-to-scam.d.ts +1 -2
  63. package/src/generators/scam/lib/convert-component-to-scam.js +11 -11
  64. package/src/generators/scam/lib/convert-component-to-scam.js.map +1 -1
  65. package/src/generators/scam/lib/index.d.ts +1 -0
  66. package/src/generators/scam/lib/index.js +1 -0
  67. package/src/generators/scam/lib/index.js.map +1 -1
  68. package/src/generators/scam/lib/normalize-options.js +6 -6
  69. package/src/generators/scam/lib/normalize-options.js.map +1 -1
  70. package/src/generators/scam/lib/validate-options.d.ts +3 -0
  71. package/src/generators/scam/lib/validate-options.js +11 -0
  72. package/src/generators/scam/lib/validate-options.js.map +1 -0
  73. package/src/generators/scam/scam.js +9 -24
  74. package/src/generators/scam/scam.js.map +1 -1
  75. package/src/generators/scam/schema.d.ts +4 -2
  76. package/src/generators/scam/schema.json +6 -0
  77. package/src/generators/scam-directive/lib/convert-directive-to-scam.d.ts +1 -2
  78. package/src/generators/scam-directive/lib/convert-directive-to-scam.js +11 -11
  79. package/src/generators/scam-directive/lib/convert-directive-to-scam.js.map +1 -1
  80. package/src/generators/scam-directive/lib/index.d.ts +1 -0
  81. package/src/generators/scam-directive/lib/index.js +1 -0
  82. package/src/generators/scam-directive/lib/index.js.map +1 -1
  83. package/src/generators/scam-directive/lib/normalize-options.js +8 -7
  84. package/src/generators/scam-directive/lib/normalize-options.js.map +1 -1
  85. package/src/generators/scam-directive/lib/validate-options.d.ts +3 -0
  86. package/src/generators/scam-directive/lib/validate-options.js +11 -0
  87. package/src/generators/scam-directive/lib/validate-options.js.map +1 -0
  88. package/src/generators/scam-directive/scam-directive.js +6 -22
  89. package/src/generators/scam-directive/scam-directive.js.map +1 -1
  90. package/src/generators/scam-directive/schema.d.ts +3 -1
  91. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.d.ts +1 -2
  92. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +11 -11
  93. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js.map +1 -1
  94. package/src/generators/scam-pipe/lib/index.d.ts +1 -0
  95. package/src/generators/scam-pipe/lib/index.js +1 -0
  96. package/src/generators/scam-pipe/lib/index.js.map +1 -1
  97. package/src/generators/scam-pipe/lib/normalize-options.js +8 -7
  98. package/src/generators/scam-pipe/lib/normalize-options.js.map +1 -1
  99. package/src/generators/scam-pipe/lib/validate-options.d.ts +3 -0
  100. package/src/generators/scam-pipe/lib/validate-options.js +11 -0
  101. package/src/generators/scam-pipe/lib/validate-options.js.map +1 -0
  102. package/src/generators/scam-pipe/scam-pipe.js +6 -20
  103. package/src/generators/scam-pipe/scam-pipe.js.map +1 -1
  104. package/src/generators/scam-pipe/schema.d.ts +3 -1
  105. package/src/generators/setup-mf/lib/add-remote-entry.d.ts +1 -1
  106. package/src/generators/setup-mf/lib/add-remote-entry.js +1 -1
  107. package/src/generators/setup-mf/lib/add-remote-entry.js.map +1 -1
  108. package/src/generators/storybook-configuration/schema.json +1 -1
  109. package/src/generators/utils/export-scam.d.ts +3 -2
  110. package/src/generators/utils/export-scam.js +4 -4
  111. package/src/generators/utils/export-scam.js.map +1 -1
  112. package/src/generators/utils/names.d.ts +5 -0
  113. package/src/generators/utils/names.js +12 -0
  114. package/src/generators/utils/names.js.map +1 -0
  115. package/src/generators/utils/path.d.ts +18 -1
  116. package/src/generators/utils/path.js +26 -1
  117. package/src/generators/utils/path.js.map +1 -1
  118. package/src/generators/utils/selector.d.ts +3 -0
  119. package/src/generators/utils/selector.js +15 -0
  120. package/src/generators/utils/selector.js.map +1 -0
  121. package/src/generators/utils/validations.d.ts +3 -0
  122. package/src/generators/utils/validations.js +25 -0
  123. package/src/generators/utils/validations.js.map +1 -0
  124. package/src/migrations/update-15-7-0/install-required-packages.js +1 -1
  125. package/src/migrations/update-15-7-0/install-required-packages.js.map +1 -1
  126. package/src/utils/mf/utils.js +2 -2
  127. package/src/utils/mf/utils.js.map +1 -1
  128. package/src/utils/nx-devkit/ast-utils.d.ts +53 -0
  129. package/src/utils/nx-devkit/ast-utils.js +62 -10
  130. package/src/utils/nx-devkit/ast-utils.js.map +1 -1
  131. package/src/utils/nx-devkit/route-utils.d.ts +16 -0
  132. package/src/utils/nx-devkit/route-utils.js +16 -0
  133. package/src/utils/nx-devkit/route-utils.js.map +1 -1
  134. package/src/utils/public-api.d.ts +2 -0
  135. package/src/utils/public-api.js +16 -0
  136. package/src/utils/public-api.js.map +1 -0
  137. package/src/utils/types.d.ts +4 -0
  138. package/src/utils/types.js +3 -0
  139. package/src/utils/types.js.map +1 -0
  140. package/src/generators/component/lib/entry-point.d.ts +0 -2
  141. package/src/generators/component/lib/entry-point.js +0 -19
  142. package/src/generators/component/lib/entry-point.js.map +0 -1
  143. package/src/generators/utils/file-info.d.ts +0 -16
  144. package/src/generators/utils/file-info.js +0 -30
  145. package/src/generators/utils/file-info.js.map +0 -1
  146. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.__style__ → __fileName__.__type__.__style__} +0 -0
  147. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.html__tpl__ → __fileName__.__type__.html__tpl__} +0 -0
  148. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.spec.ts__tpl__ → __fileName__.__type__.spec.ts__tpl__} +0 -0
  149. /package/src/generators/component/files/{__fileName__/__fileName__.__type__.ts__tpl__ → __fileName__.__type__.ts__tpl__} +0 -0
  150. /package/src/generators/directive/files/{__directiveFileName__/__directiveFileName__.directive.spec.ts__tpl__ → __directiveFileName__.directive.spec.ts__tpl__} +0 -0
  151. /package/src/generators/directive/files/{__directiveFileName__/__directiveFileName__.directive.ts__tpl__ → __directiveFileName__.directive.ts__tpl__} +0 -0
  152. /package/src/generators/pipe/files/{__pipeFileName__/__pipeFileName__.pipe.spec.ts__tpl__ → __pipeFileName__.pipe.spec.ts__tpl__} +0 -0
  153. /package/src/generators/pipe/files/{__pipeFileName__/__pipeFileName__.pipe.ts__tpl__ → __pipeFileName__.pipe.ts__tpl__} +0 -0
@@ -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":";;;;AACA,yCAIsB;AACtB,sDAAkD;AAClD,kDAA0D;AAC1D,wCAA+C;AAC/C,+BAAiE;AAEjE,sDAAwD;AAExD,SAAsB,sBAAsB,CAAC,IAAU,EAAE,UAAkB;;QACzE,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,IAAA,mBAAkB,EAAC,IAAI,kCACxB,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,YAAY,GAAG,IAAA,gCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzD,IAAA,4BAAsB,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QACpD,IAAA,wBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAnBD,wDAmBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;IACrE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO;KACR;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjE,IAAI,eAAe,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,eAAe,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC;QAC/C,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC,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,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,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CACpC,YAAY,CAAC,QAAQ,EACrB,mBAAmB,EACnB,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,YAAY,CAAC,QAAQ,EACrB,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,iBAAY,EACnB,IAAI,EACJ,MAAM,EACN,YAAY,CAAC,QAAQ,EACrB,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,YAAY,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QACrD,OAAO;KACR;IAED,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,YAAY,CAAC,SAAS,EACtB,GAAG,SAAS,CAAC,QAAQ,YAAY,CAClC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,CAC3D,CAAC;AACJ,CAAC;AA5DD,8CA4DC;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
+ {"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,EAAE,UAAkB;;QACpE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAAqB,OAAO,EAAvB,WAAW,kBAAK,OAAO,EAA3D,mCAAiD,CAAU,CAAC;QAElE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,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,YAAY,GAAG,IAAA,2BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpD,IAAA,uBAAiB,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAA,wBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAnBD,8CAmBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;IACrE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO;KACR;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjE,IAAI,UAAU,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAE3E,IAAI,CAAC,IAAA,qBAAc,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE;QACrC,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,IAAI,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;
@@ -4,7 +4,7 @@ exports.exportScam = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const entry_point_1 = require("./entry-point");
6
6
  const path_1 = require("./path");
7
- function exportScam(tree, fileInfo, options) {
7
+ function exportScam(tree, options) {
8
8
  if (!options.export) {
9
9
  return;
10
10
  }
@@ -14,7 +14,7 @@ function exportScam(tree, fileInfo, options) {
14
14
  devkit_1.logger.warn('--export=true was ignored as the project the SCAM is being generated in is not a library.');
15
15
  return;
16
16
  }
17
- const entryPointPath = (0, entry_point_1.locateLibraryEntryPointFromDirectory)(tree, fileInfo.directory, root, projectSourceRoot);
17
+ const entryPointPath = (0, entry_point_1.locateLibraryEntryPointFromDirectory)(tree, options.directory, root, projectSourceRoot);
18
18
  if (!entryPointPath) {
19
19
  // Let's not error, simply warn the user
20
20
  // It's not too much effort to manually do this
@@ -22,12 +22,12 @@ function exportScam(tree, fileInfo, options) {
22
22
  devkit_1.logger.warn(`Could not export SCAM. Unable to determine project's entry point. SCAM has still been created.`);
23
23
  return;
24
24
  }
25
- const relativePathFromEntryPoint = (0, path_1.getRelativeImportToFile)(entryPointPath, fileInfo.filePath);
25
+ const relativePathFromEntryPoint = (0, path_1.getRelativeImportToFile)(entryPointPath, options.filePath);
26
26
  const entryPointContent = tree.read(entryPointPath, 'utf-8');
27
27
  let updatedEntryPointContent = (0, devkit_1.stripIndents) `${entryPointContent}
28
28
  export * from "${relativePathFromEntryPoint}";`;
29
29
  if (!options.inlineScam) {
30
- const moduleFilePath = (0, devkit_1.joinPathFragments)(fileInfo.directory, `${(0, devkit_1.names)(options.name).fileName}.module.ts`);
30
+ const moduleFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${(0, devkit_1.names)(options.name).fileName}.module.ts`);
31
31
  const relativePathFromModule = (0, path_1.getRelativeImportToFile)(entryPointPath, moduleFilePath);
32
32
  updatedEntryPointContent = (0, devkit_1.stripIndents) `${updatedEntryPointContent}
33
33
  export * from "${relativePathFromModule}";`;
@@ -1 +1 @@
1
- {"version":3,"file":"export-scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/export-scam.ts"],"names":[],"mappings":";;;AACA,yCAMsB;AACtB,+CAAqE;AAErE,iCAAiD;AASjD,SAAgB,UAAU,CACxB,IAAU,EACV,QAAkB,EAClB,OAA0B;IAE1B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,OAAO;KACR;IAED,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;IAEvE,IAAI,WAAW,KAAK,aAAa,EAAE;QACjC,eAAM,CAAC,IAAI,CACT,2FAA2F,CAC5F,CAAC;QAEF,OAAO;KACR;IAED,MAAM,cAAc,GAAG,IAAA,kDAAoC,EACzD,IAAI,EACJ,QAAQ,CAAC,SAAS,EAClB,IAAI,EACJ,iBAAiB,CAClB,CAAC;IACF,IAAI,CAAC,cAAc,EAAE;QACnB,wCAAwC;QACxC,+CAA+C;QAC/C,uFAAuF;QACvF,eAAM,CAAC,IAAI,CACT,gGAAgG,CACjG,CAAC;QAEF,OAAO;KACR;IAED,MAAM,0BAA0B,GAAG,IAAA,8BAAuB,EACxD,cAAc,EACd,QAAQ,CAAC,QAAQ,CAClB,CAAC;IACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7D,IAAI,wBAAwB,GAAG,IAAA,qBAAY,EAAA,GAAG,iBAAiB;qBAC5C,0BAA0B,IAAI,CAAC;IAElD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;QACvB,MAAM,cAAc,GAAG,IAAA,0BAAiB,EACtC,QAAQ,CAAC,SAAS,EAClB,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,YAAY,CAC5C,CAAC;QACF,MAAM,sBAAsB,GAAG,IAAA,8BAAuB,EACpD,cAAc,EACd,cAAc,CACf,CAAC;QACF,wBAAwB,GAAG,IAAA,qBAAY,EAAA,GAAG,wBAAwB;yBAC7C,sBAAsB,IAAI,CAAC;KACjD;IAED,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;AACvD,CAAC;AA9DD,gCA8DC"}
1
+ {"version":3,"file":"export-scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/export-scam.ts"],"names":[],"mappings":";;;AACA,yCAMsB;AACtB,+CAAqE;AACrE,iCAAiD;AAWjD,SAAgB,UAAU,CAAC,IAAU,EAAE,OAA0B;IAC/D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACnB,OAAO;KACR;IAED,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;IAEvE,IAAI,WAAW,KAAK,aAAa,EAAE;QACjC,eAAM,CAAC,IAAI,CACT,2FAA2F,CAC5F,CAAC;QAEF,OAAO;KACR;IAED,MAAM,cAAc,GAAG,IAAA,kDAAoC,EACzD,IAAI,EACJ,OAAO,CAAC,SAAS,EACjB,IAAI,EACJ,iBAAiB,CAClB,CAAC;IACF,IAAI,CAAC,cAAc,EAAE;QACnB,wCAAwC;QACxC,+CAA+C;QAC/C,uFAAuF;QACvF,eAAM,CAAC,IAAI,CACT,gGAAgG,CACjG,CAAC;QAEF,OAAO;KACR;IAED,MAAM,0BAA0B,GAAG,IAAA,8BAAuB,EACxD,cAAc,EACd,OAAO,CAAC,QAAQ,CACjB,CAAC;IACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7D,IAAI,wBAAwB,GAAG,IAAA,qBAAY,EAAA,GAAG,iBAAiB;qBAC5C,0BAA0B,IAAI,CAAC;IAElD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;QACvB,MAAM,cAAc,GAAG,IAAA,0BAAiB,EACtC,OAAO,CAAC,SAAS,EACjB,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,YAAY,CAC5C,CAAC;QACF,MAAM,sBAAsB,GAAG,IAAA,8BAAuB,EACpD,cAAc,EACd,cAAc,CACf,CAAC;QACF,wBAAwB,GAAG,IAAA,qBAAY,EAAA,GAAG,wBAAwB;yBAC7C,sBAAsB,IAAI,CAAC;KACjD;IAED,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;AACvD,CAAC;AA1DD,gCA0DC"}
@@ -0,0 +1,5 @@
1
+ export type NameInfo = {
2
+ name: string;
3
+ path: string;
4
+ };
5
+ export declare function parseNameWithPath(rawName: string): NameInfo;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseNameWithPath = void 0;
4
+ const devkit_1 = require("@nrwl/devkit");
5
+ function parseNameWithPath(rawName) {
6
+ const parsedName = (0, devkit_1.normalizePath)(rawName).split('/');
7
+ const name = parsedName.pop();
8
+ const path = parsedName.join('/');
9
+ return { name, path };
10
+ }
11
+ exports.parseNameWithPath = parseNameWithPath;
12
+ //# sourceMappingURL=names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"names.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/names.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAI7C,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,MAAM,UAAU,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC;AAND,8CAMC"}
@@ -1,4 +1,21 @@
1
- import { Tree } from '@nrwl/devkit';
1
+ import type { Tree } from '@nrwl/devkit';
2
2
  export declare function pathStartsWith(path1: string, path2: string): boolean;
3
3
  export declare function getRelativeImportToFile(sourceFilePath: string, targetFilePath: string): string;
4
4
  export declare function checkPathUnderProjectRoot(tree: Tree, projectName: string, path: string): void;
5
+ export type PathGenerationOptions = {
6
+ name: string;
7
+ project: string;
8
+ flat?: boolean;
9
+ path?: string;
10
+ type?: string;
11
+ };
12
+ export type GenerationPaths = {
13
+ directory: string;
14
+ fileName: string;
15
+ filePath: string;
16
+ name: string;
17
+ path: string;
18
+ root: string;
19
+ sourceRoot: string;
20
+ };
21
+ export declare function normalizeNameAndPaths(tree: Tree, options: PathGenerationOptions): GenerationPaths;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkPathUnderProjectRoot = exports.getRelativeImportToFile = exports.pathStartsWith = void 0;
3
+ exports.normalizeNameAndPaths = exports.checkPathUnderProjectRoot = exports.getRelativeImportToFile = exports.pathStartsWith = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const path_1 = require("path");
6
+ const names_1 = require("./names");
6
7
  function pathStartsWith(path1, path2) {
7
8
  const normalizedPath1 = (0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, path1);
8
9
  const normalizedPath2 = (0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, path2);
@@ -29,4 +30,28 @@ function checkPathUnderProjectRoot(tree, projectName, path) {
29
30
  }
30
31
  }
31
32
  exports.checkPathUnderProjectRoot = checkPathUnderProjectRoot;
33
+ function normalizeNameAndPaths(tree, options) {
34
+ var _a;
35
+ const { root, sourceRoot, projectType } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
36
+ const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
37
+ const { name, path: namePath } = (0, names_1.parseNameWithPath)(options.name);
38
+ const path = (_a = options.path) !== null && _a !== void 0 ? _a : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib', namePath);
39
+ const directory = options.flat
40
+ ? (0, devkit_1.normalizePath)(path)
41
+ : (0, devkit_1.joinPathFragments)(path, name);
42
+ const fileName = options.type
43
+ ? `${name}.${(0, devkit_1.names)(options.type).fileName}`
44
+ : name;
45
+ const filePath = (0, devkit_1.joinPathFragments)(directory, `${fileName}.ts`);
46
+ return {
47
+ directory,
48
+ fileName,
49
+ filePath,
50
+ name,
51
+ path,
52
+ root,
53
+ sourceRoot,
54
+ };
55
+ }
56
+ exports.normalizeNameAndPaths = normalizeNameAndPaths;
32
57
  //# sourceMappingURL=path.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/path.ts"],"names":[],"mappings":";;;AAAA,yCAOsB;AACtB,+BAAmD;AAEnD,SAAgB,cAAc,CAAC,KAAa,EAAE,KAAa;IACzD,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,sBAAa,EAAE,KAAK,CAAC,CAAC;IAChE,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,sBAAa,EAAE,KAAK,CAAC,CAAC;IAEhE,OAAO,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACrD,CAAC;AALD,wCAKC;AAED,SAAgB,uBAAuB,CACrC,cAAsB,EACtB,cAAsB;IAEtB,MAAM,mBAAmB,GAAG,IAAA,eAAQ,EAClC,IAAA,cAAO,EAAC,cAAc,CAAC,EACvB,IAAA,cAAO,EAAC,cAAc,CAAC,CACxB,CAAC;IAEF,OAAO,KAAK,IAAA,0BAAiB,EAC3B,mBAAmB,EACnB,IAAA,eAAQ,EAAC,cAAc,EAAE,KAAK,CAAC,CAChC,EAAE,CAAC;AACN,CAAC;AAbD,0DAaC;AAED,SAAgB,yBAAyB,CACvC,IAAU,EACV,WAAmB,EACnB,IAAY;IAEZ,IAAI,CAAC,IAAI,EAAE;QACT,OAAO;KACR;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAE7D,IAAI,eAAe,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,CAAC;IAC1C,eAAe,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC;QAC/C,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,eAAe,CAAC;IAEpB,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,KAAK,CACb,sBAAsB,IAAI,4CAA4C,IAAI,KAAK;YAC7E,wEAAwE,CAC3E,CAAC;KACH;AACH,CAAC;AAtBD,8DAsBC"}
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/path.ts"],"names":[],"mappings":";;;AACA,yCAMsB;AACtB,+BAAmD;AACnD,mCAA4C;AAE5C,SAAgB,cAAc,CAAC,KAAa,EAAE,KAAa;IACzD,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,sBAAa,EAAE,KAAK,CAAC,CAAC;IAChE,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,sBAAa,EAAE,KAAK,CAAC,CAAC;IAEhE,OAAO,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACrD,CAAC;AALD,wCAKC;AAED,SAAgB,uBAAuB,CACrC,cAAsB,EACtB,cAAsB;IAEtB,MAAM,mBAAmB,GAAG,IAAA,eAAQ,EAClC,IAAA,cAAO,EAAC,cAAc,CAAC,EACvB,IAAA,cAAO,EAAC,cAAc,CAAC,CACxB,CAAC;IAEF,OAAO,KAAK,IAAA,0BAAiB,EAC3B,mBAAmB,EACnB,IAAA,eAAQ,EAAC,cAAc,EAAE,KAAK,CAAC,CAChC,EAAE,CAAC;AACN,CAAC;AAbD,0DAaC;AAED,SAAgB,yBAAyB,CACvC,IAAU,EACV,WAAmB,EACnB,IAAY;IAEZ,IAAI,CAAC,IAAI,EAAE;QACT,OAAO;KACR;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAE7D,IAAI,eAAe,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,CAAC;IAC1C,eAAe,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC;QAC/C,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,eAAe,CAAC;IAEpB,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,KAAK,CACb,sBAAsB,IAAI,4CAA4C,IAAI,KAAK;YAC7E,wEAAwE,CAC3E,CAAC;KACH;AACH,CAAC;AAtBD,8DAsBC;AAoBD,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAA8B;;IAE9B,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CAAC,OAAO,CAChB,CAAC;IAEF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAA,yBAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAC7C,QAAQ,CACT,CAAC;IAEJ,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI;QAC5B,CAAC,CAAC,IAAA,sBAAa,EAAC,IAAI,CAAC;QACrB,CAAC,CAAC,IAAA,0BAAiB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAElC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI;QAC3B,CAAC,CAAC,GAAG,IAAI,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QAC3C,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,QAAQ,GAAG,IAAA,0BAAiB,EAAC,SAAS,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAC;IAEhE,OAAO;QACL,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,UAAU;KACX,CAAC;AACJ,CAAC;AAvCD,sDAuCC"}
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nrwl/devkit';
2
+ import { names } from '@nrwl/devkit';
3
+ export declare function buildSelector(tree: Tree, name: string, prefix: string | undefined, projectPrefix: string | undefined, casing: keyof Pick<ReturnType<typeof names>, 'fileName' | 'propertyName'>): string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildSelector = void 0;
4
+ const devkit_1 = require("@nrwl/devkit");
5
+ function buildSelector(tree, name, prefix, projectPrefix, casing) {
6
+ var _a;
7
+ let selector = name;
8
+ prefix !== null && prefix !== void 0 ? prefix : (prefix = projectPrefix !== null && projectPrefix !== void 0 ? projectPrefix : (_a = (0, devkit_1.readNxJson)(tree)) === null || _a === void 0 ? void 0 : _a.npmScope);
9
+ if (prefix) {
10
+ selector = `${prefix}-${selector}`;
11
+ }
12
+ return (0, devkit_1.names)(selector)[casing];
13
+ }
14
+ exports.buildSelector = buildSelector;
15
+ //# sourceMappingURL=selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/selector.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AAEjD,SAAgB,aAAa,CAC3B,IAAU,EACV,IAAY,EACZ,MAA0B,EAC1B,aAAiC,EACjC,MAAyE;;IAEzE,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,aAAN,MAAM,cAAN,MAAM,IAAN,MAAM,GAAK,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,MAAA,IAAA,mBAAU,EAAC,IAAI,CAAC,0CAAE,QAAQ,EAAC;IACvD,IAAI,MAAM,EAAE;QACV,QAAQ,GAAG,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;KACpC;IAED,OAAO,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAdD,sCAcC"}
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nrwl/devkit';
2
+ export declare function validateProject(tree: Tree, projectName: string): void;
3
+ export declare function validateStandaloneOption(tree: Tree, standalone: boolean | undefined, angularVersion?: string): void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateStandaloneOption = exports.validateProject = void 0;
4
+ const devkit_1 = require("@nrwl/devkit");
5
+ const semver_1 = require("semver");
6
+ const version_utils_1 = require("./version-utils");
7
+ function validateProject(tree, projectName) {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ if (!projects.has(projectName)) {
10
+ throw new Error(`Project "${projectName}" does not exist! Please provide an existing project name.`);
11
+ }
12
+ }
13
+ exports.validateProject = validateProject;
14
+ function validateStandaloneOption(tree, standalone, angularVersion) {
15
+ if (!standalone) {
16
+ return;
17
+ }
18
+ const installedAngularVersion = angularVersion !== null && angularVersion !== void 0 ? angularVersion : (0, version_utils_1.getInstalledAngularVersionInfo)(tree).version;
19
+ if ((0, semver_1.lt)(installedAngularVersion, '14.1.0')) {
20
+ throw new Error((0, devkit_1.stripIndents) `The "standalone" option is only supported in Angular >= 14.1.0. You are currently using "${installedAngularVersion}".
21
+ You can resolve this error by removing the "standalone" option or by migrating to Angular 14.1.0.`);
22
+ }
23
+ }
24
+ exports.validateStandaloneOption = validateStandaloneOption;
25
+ //# sourceMappingURL=validations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/validations.ts"],"names":[],"mappings":";;;AACA,yCAAyD;AACzD,mCAA4B;AAC5B,mDAAiE;AAEjE,SAAgB,eAAe,CAAC,IAAU,EAAE,WAAmB;IAC7D,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CACb,YAAY,WAAW,4DAA4D,CACpF,CAAC;KACH;AACH,CAAC;AARD,0CAQC;AAED,SAAgB,wBAAwB,CACtC,IAAU,EACV,UAA+B,EAC/B,cAAuB;IAEvB,IAAI,CAAC,UAAU,EAAE;QACf,OAAO;KACR;IAED,MAAM,uBAAuB,GAC3B,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,IAAA,8CAA8B,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IAEjE,IAAI,IAAA,WAAE,EAAC,uBAAuB,EAAE,QAAQ,CAAC,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,IAAA,qBAAY,EAAA,4FAA4F,uBAAuB;sGAC7C,CAAC,CAAC;KACrG;AACH,CAAC;AAhBD,4DAgBC"}
@@ -17,7 +17,7 @@ function default_1(tree) {
17
17
  const pkgJson = (0, devkit_1.readJson)(tree, 'package.json');
18
18
  const angularMajorVersion = (0, version_utils_1.getInstalledAngularMajorVersion)(tree);
19
19
  const angularDevkitVersion = (0, version_utils_2.getPkgVersionForAngularMajorVersion)('angularDevkitVersion', angularMajorVersion);
20
- const angularCliVersion = (_d = (_b = (_a = pkgJson.devDependencies) === null || _a === void 0 ? void 0 : _a['@angular/cli']) !== null && _b !== void 0 ? _b : (_c = pkgJson.dependencies) === null || _c === void 0 ? void 0 : _c['@angular/cli']) !== null && _d !== void 0 ? _d : angularDevkitVersion;
20
+ const angularCliVersion = (_d = (_b = (_a = pkgJson.devDependencies) === null || _a === void 0 ? void 0 : _a['@angular-devkit/build-angular']) !== null && _b !== void 0 ? _b : (_c = pkgJson.dependencies) === null || _c === void 0 ? void 0 : _c['@angular-devkit/build-angular']) !== null && _d !== void 0 ? _d : angularDevkitVersion;
21
21
  const filteredPackages = packagesToInstall
22
22
  .filter((pkg) => { var _a, _b; return !((_a = pkgJson.devDependencies) === null || _a === void 0 ? void 0 : _a[pkg]) && !((_b = pkgJson.dependencies) === null || _b === void 0 ? void 0 : _b[pkg]); })
23
23
  .reduce((allPkgs, pkg) => (Object.assign(Object.assign({}, allPkgs), { [pkg]: angularCliVersion })), {});
@@ -1 +1 @@
1
- {"version":3,"file":"install-required-packages.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-15-7-0/install-required-packages.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AACtB,iDAAyC;AACzC,+BAA4B;AAC5B,wEAAuF;AACvF,6DAAgF;AAEhF,mBAA+B,IAAU;;;QACvC,MAAM,iBAAiB,GAAG;YACxB,sBAAsB;YACtB,4BAA4B;YAC5B,qBAAqB;SACtB,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAE/C,MAAM,mBAAmB,GAAG,IAAA,+CAA+B,EAAC,IAAI,CAAC,CAAC;QAClE,MAAM,oBAAoB,GAAG,IAAA,mDAAmC,EAC9D,sBAAsB,EACtB,mBAAmB,CACpB,CAAC;QAEF,MAAM,iBAAiB,GACrB,MAAA,MAAA,MAAA,OAAO,CAAC,eAAe,0CAAG,cAAc,CAAC,mCACzC,MAAA,OAAO,CAAC,YAAY,0CAAG,cAAc,CAAC,mCACtC,oBAAoB,CAAC;QAEvB,MAAM,gBAAgB,GAA2B,iBAAiB;aAC/D,MAAM,CACL,CAAC,GAAG,EAAE,EAAE,eAAC,OAAA,CAAC,CAAA,MAAA,OAAO,CAAC,eAAe,0CAAG,GAAG,CAAC,CAAA,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,YAAY,0CAAG,GAAG,CAAC,CAAA,CAAA,EAAA,CACzE;aACA,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,iCAAM,OAAO,KAAE,CAAC,GAAG,CAAC,EAAE,iBAAiB,IAAG,EAAE,EAAE,CAAC,CAAC;QAC5E,2EAA2E;QAC3E,yEAAyE;QACzE,IAAA,qCAA4B,EAAC,IAAI,EAAE,EAAE,oBAAO,gBAAgB,EAAG,CAAC;QAEhE,wEAAwE;QACxE,4CAA4C;QAC5C,MAAA,OAAO,CAAC,eAAe,oCAAvB,OAAO,CAAC,eAAe,GAAK,EAAE,EAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;YAC1D,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAA,sBAAa,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;QACxD,MAAM,GAAG,GAAG,IAAA,iCAAwB,GAAE,CAAC;QACvC,IAAA,wBAAQ,EAAC,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;;CAC7C;AArCD,4BAqCC"}
1
+ {"version":3,"file":"install-required-packages.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-15-7-0/install-required-packages.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AACtB,iDAAyC;AACzC,+BAA4B;AAC5B,wEAAuF;AACvF,6DAAgF;AAEhF,mBAA+B,IAAU;;;QACvC,MAAM,iBAAiB,GAAG;YACxB,sBAAsB;YACtB,4BAA4B;YAC5B,qBAAqB;SACtB,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAE/C,MAAM,mBAAmB,GAAG,IAAA,+CAA+B,EAAC,IAAI,CAAC,CAAC;QAClE,MAAM,oBAAoB,GAAG,IAAA,mDAAmC,EAC9D,sBAAsB,EACtB,mBAAmB,CACpB,CAAC;QAEF,MAAM,iBAAiB,GACrB,MAAA,MAAA,MAAA,OAAO,CAAC,eAAe,0CAAG,+BAA+B,CAAC,mCAC1D,MAAA,OAAO,CAAC,YAAY,0CAAG,+BAA+B,CAAC,mCACvD,oBAAoB,CAAC;QAEvB,MAAM,gBAAgB,GAA2B,iBAAiB;aAC/D,MAAM,CACL,CAAC,GAAG,EAAE,EAAE,eAAC,OAAA,CAAC,CAAA,MAAA,OAAO,CAAC,eAAe,0CAAG,GAAG,CAAC,CAAA,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,YAAY,0CAAG,GAAG,CAAC,CAAA,CAAA,EAAA,CACzE;aACA,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,iCAAM,OAAO,KAAE,CAAC,GAAG,CAAC,EAAE,iBAAiB,IAAG,EAAE,EAAE,CAAC,CAAC;QAC5E,2EAA2E;QAC3E,yEAAyE;QACzE,IAAA,qCAA4B,EAAC,IAAI,EAAE,EAAE,oBAAO,gBAAgB,EAAG,CAAC;QAEhE,wEAAwE;QACxE,4CAA4C;QAC5C,MAAA,OAAO,CAAC,eAAe,oCAAvB,OAAO,CAAC,eAAe,GAAK,EAAE,EAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;YAC1D,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAA,sBAAa,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;QACxD,MAAM,GAAG,GAAG,IAAA,iCAAwB,GAAE,CAAC;QACvC,IAAA,wBAAQ,EAAC,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;;CAC7C;AArCD,4BAqCC"}