@o3r/schematics 11.0.0-next.0 → 11.0.0-next.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/README.md +5 -1
  2. package/{src/cli → cli}/environment.d.ts.map +1 -1
  3. package/{src/cli → cli}/environment.js +1 -1
  4. package/cli/environment.js.map +1 -0
  5. package/cli/package.json +3 -0
  6. package/package.json +61 -43
  7. package/schematics/ng-add/index.d.ts +3 -1
  8. package/schematics/ng-add/index.d.ts.map +1 -1
  9. package/schematics/ng-add/index.js +36 -25
  10. package/schematics/ng-add/index.js.map +1 -1
  11. package/schematics/ng-add/schema.d.ts +1 -1
  12. package/schematics/ng-add/schema.d.ts.map +1 -1
  13. package/src/interfaces/angular-workspace.d.ts.map +1 -1
  14. package/src/interfaces/index.d.ts +1 -0
  15. package/src/interfaces/index.d.ts.map +1 -1
  16. package/src/interfaces/index.js +1 -0
  17. package/src/interfaces/index.js.map +1 -1
  18. package/src/{rule-factories/interfaces.d.ts → interfaces/rule-factories.d.ts} +2 -2
  19. package/src/interfaces/rule-factories.d.ts.map +1 -0
  20. package/src/{rule-factories/interfaces.js → interfaces/rule-factories.js} +1 -1
  21. package/src/interfaces/rule-factories.js.map +1 -0
  22. package/src/modules/modules.display.rule.d.ts.map +1 -1
  23. package/src/modules/modules.display.rule.js +3 -4
  24. package/src/modules/modules.display.rule.js.map +1 -1
  25. package/src/modules/modules.helpers.d.ts +2 -2
  26. package/src/modules/modules.helpers.d.ts.map +1 -1
  27. package/src/modules/modules.helpers.js +2 -2
  28. package/src/modules/modules.helpers.js.map +1 -1
  29. package/src/public_api.d.ts +6 -1
  30. package/src/public_api.d.ts.map +1 -1
  31. package/src/public_api.js +6 -1
  32. package/src/public_api.js.map +1 -1
  33. package/src/rule-factories/add-imports/index.js.map +1 -1
  34. package/src/rule-factories/check-packages-peers/index.js.map +1 -1
  35. package/src/rule-factories/dev-tools/devtools-registration.js +7 -7
  36. package/src/rule-factories/dev-tools/devtools-registration.js.map +1 -1
  37. package/src/rule-factories/eslint-fix/index.d.ts +8 -3
  38. package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
  39. package/src/rule-factories/eslint-fix/index.js +5 -3
  40. package/src/rule-factories/eslint-fix/index.js.map +1 -1
  41. package/src/rule-factories/get-test-frameworks/index.js +2 -2
  42. package/src/rule-factories/get-test-frameworks/index.js.map +1 -1
  43. package/src/rule-factories/index.d.ts +1 -1
  44. package/src/rule-factories/index.d.ts.map +1 -1
  45. package/src/rule-factories/index.js +1 -1
  46. package/src/rule-factories/index.js.map +1 -1
  47. package/src/rule-factories/ng-add/dependencies.d.ts +93 -0
  48. package/src/rule-factories/ng-add/dependencies.d.ts.map +1 -0
  49. package/src/rule-factories/ng-add/dependencies.js +174 -0
  50. package/src/rule-factories/ng-add/dependencies.js.map +1 -0
  51. package/src/rule-factories/ng-add/index.d.ts +3 -36
  52. package/src/rule-factories/ng-add/index.d.ts.map +1 -1
  53. package/src/rule-factories/ng-add/index.js +4 -218
  54. package/src/rule-factories/ng-add/index.js.map +1 -1
  55. package/src/rule-factories/ng-add/ng-add.helpers.d.ts +22 -0
  56. package/src/rule-factories/ng-add/ng-add.helpers.d.ts.map +1 -0
  57. package/src/rule-factories/ng-add/ng-add.helpers.js +162 -0
  58. package/src/rule-factories/ng-add/ng-add.helpers.js.map +1 -0
  59. package/src/rule-factories/ng-add/schematics-register.d.ts +17 -0
  60. package/src/rule-factories/ng-add/schematics-register.d.ts.map +1 -0
  61. package/src/rule-factories/ng-add/schematics-register.js +64 -0
  62. package/src/rule-factories/ng-add/schematics-register.js.map +1 -0
  63. package/src/rule-factories/remove-packages/index.js.map +1 -1
  64. package/src/rule-factories/update-imports/index.d.ts +0 -1
  65. package/src/rule-factories/update-imports/index.d.ts.map +1 -1
  66. package/src/rule-factories/update-imports/index.js +0 -1
  67. package/src/rule-factories/update-imports/index.js.map +1 -1
  68. package/src/rule-factories/update-imports/list-of-vars.d.ts +4 -5
  69. package/src/rule-factories/update-imports/list-of-vars.d.ts.map +1 -1
  70. package/src/rule-factories/update-imports/list-of-vars.js.map +1 -1
  71. package/src/rule-factories/update-imports/update-imports-with-scope.d.ts +1 -1
  72. package/src/rule-factories/update-imports/update-imports-with-scope.js +3 -3
  73. package/src/rule-factories/update-imports/update-imports-with-scope.js.map +1 -1
  74. package/src/rule-factories/update-imports/update-ts-imports.d.ts +1 -1
  75. package/src/rule-factories/update-imports/update-ts-imports.d.ts.map +1 -1
  76. package/src/rule-factories/update-imports/update-ts-imports.js +7 -6
  77. package/src/rule-factories/update-imports/update-ts-imports.js.map +1 -1
  78. package/src/rule-factories/vscode-extensions/index.js.map +1 -1
  79. package/src/rules/install.d.ts +8 -4
  80. package/src/rules/install.d.ts.map +1 -1
  81. package/src/rules/install.js +10 -8
  82. package/src/rules/install.js.map +1 -1
  83. package/src/tasks/eslint/index.d.ts +8 -1
  84. package/src/tasks/eslint/index.d.ts.map +1 -1
  85. package/src/tasks/eslint/index.js +8 -1
  86. package/src/tasks/eslint/index.js.map +1 -1
  87. package/src/tasks/ng-add/index.d.ts +1 -0
  88. package/src/tasks/ng-add/index.d.ts.map +1 -1
  89. package/src/tasks/ng-add/index.js +1 -0
  90. package/src/tasks/ng-add/index.js.map +1 -1
  91. package/src/tasks/package-manager/add-dev-dependency.d.ts +1 -0
  92. package/src/tasks/package-manager/add-dev-dependency.d.ts.map +1 -1
  93. package/src/tasks/package-manager/add-dev-dependency.js +4 -3
  94. package/src/tasks/package-manager/add-dev-dependency.js.map +1 -1
  95. package/src/tasks/package-manager/interfaces.d.ts +1 -1
  96. package/src/tasks/package-manager/interfaces.d.ts.map +1 -1
  97. package/src/tasks/package-manager/npm-install.js +3 -3
  98. package/src/tasks/package-manager/npm-install.js.map +1 -1
  99. package/src/utility/ast.d.ts +2 -1
  100. package/src/utility/ast.d.ts.map +1 -1
  101. package/src/utility/ast.js +8 -2
  102. package/src/utility/ast.js.map +1 -1
  103. package/src/utility/builder.js.map +1 -1
  104. package/src/utility/collection.d.ts.map +1 -1
  105. package/src/utility/collection.js +1 -1
  106. package/src/utility/collection.js.map +1 -1
  107. package/src/utility/component.d.ts +1 -1
  108. package/src/utility/component.d.ts.map +1 -1
  109. package/src/utility/component.js.map +1 -1
  110. package/src/utility/dependencies.d.ts.map +1 -1
  111. package/src/utility/dependencies.js +1 -1
  112. package/src/utility/dependencies.js.map +1 -1
  113. package/src/utility/environment.d.ts +1 -0
  114. package/src/utility/environment.d.ts.map +1 -1
  115. package/src/utility/environment.js.map +1 -1
  116. package/src/utility/file-info.d.ts +1 -2
  117. package/src/utility/file-info.d.ts.map +1 -1
  118. package/src/utility/file-info.js.map +1 -1
  119. package/src/utility/generation.d.ts +1 -1
  120. package/src/utility/generation.d.ts.map +1 -1
  121. package/src/utility/generation.js.map +1 -1
  122. package/src/utility/gitignore.d.ts +1 -1
  123. package/src/utility/gitignore.d.ts.map +1 -1
  124. package/src/utility/gitignore.js.map +1 -1
  125. package/src/utility/index.d.ts +2 -0
  126. package/src/utility/index.d.ts.map +1 -1
  127. package/src/utility/index.js +2 -0
  128. package/src/utility/index.js.map +1 -1
  129. package/src/utility/loaders.d.ts +6 -1
  130. package/src/utility/loaders.d.ts.map +1 -1
  131. package/src/utility/loaders.js +10 -2
  132. package/src/utility/loaders.js.map +1 -1
  133. package/src/utility/matching-peers.d.ts +7 -3
  134. package/src/utility/matching-peers.d.ts.map +1 -1
  135. package/src/utility/matching-peers.js +7 -5
  136. package/src/utility/matching-peers.js.map +1 -1
  137. package/src/utility/modules.js.map +1 -1
  138. package/src/utility/monorepo.d.ts +3 -2
  139. package/src/utility/monorepo.d.ts.map +1 -1
  140. package/src/utility/monorepo.js +2 -1
  141. package/src/utility/monorepo.js.map +1 -1
  142. package/src/utility/package-manager-runner.d.ts +1 -1
  143. package/src/utility/package-manager-runner.d.ts.map +1 -1
  144. package/src/utility/package-manager-runner.js.map +1 -1
  145. package/src/utility/package-version.js.map +1 -1
  146. package/src/utility/routes.d.ts +1 -1
  147. package/src/utility/routes.d.ts.map +1 -1
  148. package/src/utility/routes.js.map +1 -1
  149. package/src/utility/sub-entry.d.ts +1 -1
  150. package/src/utility/sub-entry.d.ts.map +1 -1
  151. package/src/utility/sub-entry.js.map +1 -1
  152. package/src/utility/template-property.helper.js.map +1 -1
  153. package/src/utility/update-imports.d.ts.map +1 -1
  154. package/src/utility/update-imports.js +21 -10
  155. package/src/utility/update-imports.js.map +1 -1
  156. package/src/utility/update-pipes.d.ts +15 -0
  157. package/src/utility/update-pipes.d.ts.map +1 -0
  158. package/src/utility/update-pipes.js +82 -0
  159. package/src/utility/update-pipes.js.map +1 -0
  160. package/src/utility/wrapper.d.ts +8 -0
  161. package/src/utility/wrapper.d.ts.map +1 -0
  162. package/src/utility/wrapper.js +87 -0
  163. package/src/utility/wrapper.js.map +1 -0
  164. package/src/cli/environment.js.map +0 -1
  165. package/src/index.d.ts +0 -7
  166. package/src/index.d.ts.map +0 -1
  167. package/src/index.js +0 -10
  168. package/src/index.js.map +0 -1
  169. package/src/rule-factories/interfaces.d.ts.map +0 -1
  170. package/src/rule-factories/interfaces.js.map +0 -1
  171. package/src/rule-factories/update-imports/v7-to-v8-map-object.d.ts +0 -8
  172. package/src/rule-factories/update-imports/v7-to-v8-map-object.d.ts.map +0 -1
  173. package/src/rule-factories/update-imports/v7-to-v8-map-object.js +0 -2049
  174. package/src/rule-factories/update-imports/v7-to-v8-map-object.js.map +0 -1
  175. /package/{src/cli → cli}/environment.d.ts +0 -0
@@ -4,11 +4,11 @@ exports.registerDevtoolsToApplication = exports.injectServiceInMain = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const ts = require("typescript");
6
6
  const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
7
+ const index_1 = require("../../utility/index");
7
8
  const utility_1 = require("../../utility");
8
- const utility_2 = require("../../utility");
9
9
  const change_1 = require("@schematics/angular/utility/change");
10
10
  const registerModule = (options) => (tree, context) => {
11
- const moduleFilePath = (0, utility_1.getAppModuleFilePath)(tree, context, options.projectName);
11
+ const moduleFilePath = (0, index_1.getAppModuleFilePath)(tree, context, options.projectName);
12
12
  if (!moduleFilePath) {
13
13
  return tree;
14
14
  }
@@ -18,8 +18,8 @@ const registerModule = (options) => (tree, context) => {
18
18
  return tree;
19
19
  }
20
20
  let recorder = tree.beginUpdate(moduleFilePath);
21
- const { moduleIndex } = (0, utility_1.getModuleIndex)(sourceFile, sourceFileContent);
22
- const addImportToModuleFile = (name, file, moduleFunction) => recorder = (0, utility_2.addImportToModuleFile)(name, file, sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, moduleFunction);
21
+ const { moduleIndex } = (0, index_1.getModuleIndex)(sourceFile, sourceFileContent);
22
+ const addImportToModuleFile = (name, file, moduleFunction) => recorder = (0, utility_1.addImportToModuleFile)(name, file, sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, moduleFunction);
23
23
  addImportToModuleFile(options.moduleName, options.packageName, '.instrument({isActivatedOnBootstrap: true})');
24
24
  tree.commitUpdate(recorder);
25
25
  return tree;
@@ -32,7 +32,7 @@ const injectServiceInMain = (options) => (tree, context) => {
32
32
  if (!options.serviceName) {
33
33
  return tree;
34
34
  }
35
- const mainFilePath = (0, utility_1.getMainFilePath)(tree, context, options.projectName);
35
+ const mainFilePath = (0, index_1.getMainFilePath)(tree, context, options.projectName);
36
36
  if (!mainFilePath || !tree.exists(mainFilePath)) {
37
37
  return tree;
38
38
  }
@@ -69,13 +69,13 @@ exports.injectServiceInMain = injectServiceInMain;
69
69
  * @param options
70
70
  */
71
71
  const registerDevtoolsToApplication = (options) => (tree, context) => {
72
- const workspace = (0, utility_1.getWorkspaceConfig)(tree);
72
+ const workspace = (0, index_1.getWorkspaceConfig)(tree);
73
73
  const project = options.projectName ? workspace?.projects[options.projectName] : undefined;
74
74
  if (!workspace || !project || project.projectType !== 'application') {
75
75
  context.logger.warn(`Failed to determine the application to update, the devtool modules ${options.moduleName}.`);
76
76
  return tree;
77
77
  }
78
- const schematicConfig = (0, utility_1.getDefaultOptionsForSchematic)(workspace, options.packageName, 'ng-add', options);
78
+ const schematicConfig = (0, index_1.getDefaultOptionsForSchematic)(workspace, options.packageName, 'ng-add', options);
79
79
  if (!schematicConfig?.registerDevtool) {
80
80
  return tree;
81
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/devtools-registration.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AACzD,iCAAiC;AACjC,qEAAiF;AACjF,2CAAyI;AAEzI,2CAAkF;AAClF,+DAAyF;AAczF,MAAM,cAAc,GAAG,CAAC,OAA+B,EAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IAClF,MAAM,cAAc,GAAG,IAAA,8BAAoB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChF,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,EAAE,CAAC;IAChE,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,cAAc,EACd,iBAAiB,EACjB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,IAAI,IAAA,sBAAU,EAAC,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IAED,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,wBAAc,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAEtE,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,cAAuB,EAAE,EAAE,CACpF,QAAQ,GAAG,IAAA,+BAAwB,EAAC,IAAI,EAAE,IAAI,EAAE,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W,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3F,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,aAAa,EAAE;QACnE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sEAAsE,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;QACjH,OAAO,IAAI,CAAC;KACb;IAED,MAAM,eAAe,GAAG,IAAA,uCAA6B,EAAkC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE1I,IAAI,CAAC,eAAe,EAAE,eAAe,EAAE;QACrC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,IAAA,kBAAK,EAAC;QACX,cAAc,CAAC,OAAO,CAAC;QACvB,IAAA,2BAAmB,EAAC,OAAO,CAAC;QAC5B,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CACzB,uBAAuB,OAAO,CAAC,UAAU,mDAAmD,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,qCAAqC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,CACtL;KACF,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpB,CAAC,CAAC;AAtBW,QAAA,6BAA6B,iCAsBxC"}
1
+ {"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/devtools-registration.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AACzD,iCAAiC;AACjC,qEAAiF;AACjF,+CAA+I;AAE/I,2CAAkF;AAClF,+DAAyF;AAczF,MAAM,cAAc,GAAG,CAAC,OAA+B,EAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IAClF,MAAM,cAAc,GAAG,IAAA,4BAAoB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChF,IAAI,CA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AC;IAED,OAAO,IAAA,kBAAK,EAAC;QACX,cAAc,CAAC,OAAO,CAAC;QACvB,IAAA,2BAAmB,EAAC,OAAO,CAAC;QAC5B,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CACzB,uBAAuB,OAAO,CAAC,UAAU,mDAAmD,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,qCAAqC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,CACtL;KACF,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpB,CAAC,CAAC;AAtBW,QAAA,6BAA6B,iCAsBxC"}
@@ -1,5 +1,9 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { LinterOptions } from '../../tasks';
1
+ import { Rule, type TaskId } from '@angular-devkit/schematics';
2
+ import { LinterOptions } from '../../tasks/index';
3
+ interface ApplyEslintFixOption extends LinterOptions {
4
+ /** List of task to wait to run the linter */
5
+ dependencyTaskIds?: TaskId[];
6
+ }
3
7
  /**
4
8
  * Apply EsLint fix
5
9
  * @param prootPath Root path
@@ -7,5 +11,6 @@ import { LinterOptions } from '../../tasks';
7
11
  * @param extension List of file extensions to lint
8
12
  * @param options Linter options
9
13
  */
10
- export declare function applyEsLintFix(_prootPath?: string, extension?: string[], options?: LinterOptions): Rule;
14
+ export declare function applyEsLintFix(_prootPath?: string, extension?: string[], options?: ApplyEslintFixOption): Rule;
15
+ export {};
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAAiB,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAM,EAAE,SAAS,GAAE,MAAM,EAAW,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAkE5G"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAoB,KAAK,MAAM,EAAQ,MAAM,4BAA4B,CAAC;AAEvG,OAAO,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEjE,UAAU,oBAAqB,SAAQ,aAAa;IAClD,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAM,EAAE,SAAS,GAAE,MAAM,EAAW,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAqEnH"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.applyEsLintFix = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const node_path_1 = require("node:path");
6
- const tasks_1 = require("../../tasks");
6
+ const index_1 = require("../../tasks/index");
7
7
  /**
8
8
  * Apply EsLint fix
9
9
  * @param prootPath Root path
@@ -49,12 +49,14 @@ function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
49
49
  You can consider to run later the following command to add otter linter rules: ng add @o3r/eslint-config-otter`);
50
50
  }
51
51
  const files = filesToBeLint.reduce((acc, filePath) => {
52
- if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && filePath.startsWith(dir.path)) {
52
+ if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && filePath.startsWith(dir.path.substring(1))) {
53
53
  acc.add(filePath);
54
54
  }
55
55
  return acc;
56
56
  }, new Set());
57
- context.addTask(new tasks_1.EslintFixTask(Array.from(files), undefined, eslintFile, linterOptions));
57
+ if (files.size) {
58
+ context.addTask(new index_1.EslintFixTask(Array.from(files), undefined, eslintFile, linterOptions), options?.dependencyTaskIds);
59
+ }
58
60
  return tree;
59
61
  };
60
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AAAA,2DAA0F;AAC1F,yCAA0C;AAC1C,uCAA2D;AAE3D;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,UAAU,GAAG,GAAG,EAAE,YAAsB,CAAC,IAAI,CAAC,EAAE,OAAuB;IACpG,IAAI;QACF,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;KACxC;IAAC,MAAM;QACN,OAAO,IAAA,iBAAI,GAAE,CAAC;KACf;IAED,MAAM,aAAa,GAAkB;QACnC,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,GAAG,OAAO;KACX,CAAC;IAEF,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO;aAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC;aAC7B,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7C,gCAAgC;QAChC,IAAI,GAAG,GAAoB,IAAI,CAAC,MAAM,CACpC,IAAA,mBAAO,EACL,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;YACrC,IAAI,GAAG,CAAC,KAAK,GAAG,KAAK,EAAE;gBACrB,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;aACtB;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAC,CAAC,CAAC,IAAI,CAC9B,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1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTestFramework = void 0;
4
- const utility_1 = require("../../utility");
4
+ const index_1 = require("../../utility/index");
5
5
  const testPackageMaps = {
6
6
  'jest': ['jest'],
7
7
  'jasmine': ['jasmine-core']
@@ -13,7 +13,7 @@ const testPackageMaps = {
13
13
  */
14
14
  function getTestFramework(workspaceOptions, context) {
15
15
  if (workspaceOptions) {
16
- const testFramework = (0, utility_1.getSchematicOptions)(workspaceOptions, context)?.testFramework;
16
+ const testFramework = (0, index_1.getSchematicOptions)(workspaceOptions, context)?.testFramework;
17
17
  if (testFramework) {
18
18
  return testFramework;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/get-test-frameworks/index.ts"],"names":[],"mappings":";;;AAEA,2CAAoD;AAGpD,MAAM,eAAe,GAA8C;IACjE,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,cAAc,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,gBAAwC,EAAE,OAAyB;IAClG,IAAI,gBAAgB,EAAE;QACpB,MAAM,aAAa,GAAG,IAAA,6BAAmB,EAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC;QACpF,IAAI,aAAa,EAAE;YACjB,OAAO,aAAa,CAAC;SACtB;KACF;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;SACnC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB,IAAI;gBACF,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC;aACjD;YAAC,MAAM;gBACN,OAAO,KAAK,CAAC;aACd;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,EAAE,CAAC,CAAC,CAA4B,CAAC;AACvC,CAAC;AAjBD,4CAiBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/get-test-frameworks/index.ts"],"names":[],"mappings":";;;AAEA,+CAA0D;AAG1D,MAAM,eAAe,GAA8C;IACjE,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,cAAc,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,gBAAwC,EAAE,OAAyB;IAClG,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,aAAa,GAAG,IAAA,2BAAmB,EAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC;QACpF,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,aAAa,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;SACnC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB,IAAI,CAAC;gBACH,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC;YAClD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,EAAE,CAAC,CAAC,CAA4B,CAAC;AACvC,CAAC;AAjBD,4CAiBC"}
@@ -1,6 +1,6 @@
1
1
  export * from './add-imports/index';
2
2
  export * from './eslint-fix/index';
3
- export * from './interfaces';
3
+ export * from '../interfaces/rule-factories';
4
4
  export * from './get-test-frameworks/index';
5
5
  export * from './check-packages-peers/index';
6
6
  export * from './ng-add/index';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./add-imports/index"), exports);
5
5
  tslib_1.__exportStar(require("./eslint-fix/index"), exports);
6
- tslib_1.__exportStar(require("./interfaces"), exports);
6
+ tslib_1.__exportStar(require("../interfaces/rule-factories"), exports);
7
7
  tslib_1.__exportStar(require("./get-test-frameworks/index"), exports);
8
8
  tslib_1.__exportStar(require("./check-packages-peers/index"), exports);
9
9
  tslib_1.__exportStar(require("./ng-add/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,uDAA6B;AAC7B,sEAA4C;AAC5C,uEAA6C;AAC7C,yDAA+B;AAC/B,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C;AAC1C,4DAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,uEAA6C;AAC7C,sEAA4C;AAC5C,uEAA6C;AAC7C,yDAA+B;AAC/B,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C;AAC1C,4DAAkC"}
@@ -0,0 +1,93 @@
1
+ import { Rule, type SchematicContext, type TaskId, Tree } from '@angular-devkit/schematics';
2
+ import { NodeDependencyType } from '@schematics/angular/utility/dependencies';
3
+ import { SupportedPackageManagers } from '../../utility';
4
+ /**
5
+ * Options to be passed to the ng add task
6
+ */
7
+ export interface NgAddSchematicOptions {
8
+ /** Name of the project */
9
+ projectName?: string | null;
10
+ /** Skip the run of the linter*/
11
+ skipLinter?: boolean;
12
+ /** Skip the install process */
13
+ skipInstall?: boolean;
14
+ [x: string]: any;
15
+ }
16
+ export interface DependencyInManifest {
17
+ /**
18
+ * Range of the dependency
19
+ * @default 'latest'
20
+ */
21
+ range?: string;
22
+ /**
23
+ * Types of the dependency
24
+ * @default [NodeDependencyType.Default]
25
+ */
26
+ types?: NodeDependencyType[];
27
+ }
28
+ export interface DependencyToAdd {
29
+ /** Enforce this dependency to be applied to Workspace's manifest only */
30
+ toWorkspaceOnly?: boolean;
31
+ /** List of dependency to register in manifest */
32
+ inManifest: DependencyInManifest[];
33
+ /** ng-add schematic option dedicated to the package */
34
+ ngAddOptions?: NgAddSchematicOptions;
35
+ /** Determine if the dependency require to be installed */
36
+ requireInstall?: boolean;
37
+ }
38
+ export interface SetupDependenciesOptions {
39
+ /** Map of dependencies to install */
40
+ dependencies: Record<string, DependencyToAdd>;
41
+ /**
42
+ * Pattern of list of the dependency for which the ng-add run process is required
43
+ */
44
+ ngAddToRun?: (RegExp | string)[];
45
+ /**
46
+ * Will skip install in the end of the package.json update.
47
+ * if `undefined`, the installation will be process only if a ngAdd run is required.
48
+ * If `true` the install will not run in any case
49
+ * @default undefined
50
+ */
51
+ skipInstall?: boolean;
52
+ /** Project Name */
53
+ projectName?: string;
54
+ /** default ng-add schematic option */
55
+ ngAddOptions?: NgAddSchematicOptions;
56
+ /** Enforce install package manager */
57
+ packageManager?: SupportedPackageManagers;
58
+ /** Task will run after the given task ID (if specified) */
59
+ runAfterTasks?: TaskId[];
60
+ /** Callback to run after the task ID is calculated */
61
+ scheduleTaskCallback?: (taskIds?: TaskId[]) => void;
62
+ /** Working directory for the installation process only */
63
+ workingDirectory?: string;
64
+ }
65
+ /** Result of the Setup Dependencies task scheduling process */
66
+ export interface SetupDependenciesResult {
67
+ /** List of the task ID resulting of the install process */
68
+ taskIds: TaskId[];
69
+ }
70
+ /**
71
+ * Determine if the context has information regarding the setup dependencies process
72
+ * @param context Schematic context
73
+ */
74
+ export declare const hasSetupInformation: (context: SchematicContext) => context is SchematicContext & {
75
+ setupDependencies: SetupDependenciesResult;
76
+ };
77
+ /**
78
+ * Retrieve the package install configuration
79
+ * This is a workaround to ng-add to add the dependency to the sub-package
80
+ * @param packageJsonPath Path to the module package.json file
81
+ * @param tree Tree to read the file
82
+ * @param projectName Name of the project
83
+ * @param devDependencyOnly If true, the dependency will be added as devDependency
84
+ * @param exactO3rVersion Use a pinned version of the o3r package
85
+ */
86
+ export declare const getPackageInstallConfig: (packageJsonPath: string, tree: Tree, projectName?: string, devDependencyOnly?: boolean, exactO3rVersion?: boolean) => Record<string, DependencyToAdd>;
87
+ /**
88
+ * Setup dependency to a repository.
89
+ * Will run manually the ngAdd schematics according to the parameters and install the packages if required
90
+ * @param options
91
+ */
92
+ export declare const setupDependencies: (options: SetupDependenciesOptions) => Rule;
93
+ //# sourceMappingURL=dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAAa,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC9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AAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,+DAA+D;AAC/D,MAAM,WAAW,uBAAuB;IACtC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB;uBAAmF,uBAAuB;CAEzI,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,oBAAqB,MAAM,QAAQ,IAAI,gBAAgB,MAAM,sBAAsB,OAAO,oBAAoB,OAAO,KAAG,OAAO,MAAM,EAAE,eAAe,CAiBzL,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YAAa,wBAAwB,KAAG,IAoIrE,CAAC"}
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupDependencies = exports.getPackageInstallConfig = exports.hasSetupInformation = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
+ const path = require("node:path");
7
+ const semver = require("semver");
8
+ const utility_1 = require("../../utility");
9
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
10
+ const node_fs_1 = require("node:fs");
11
+ /**
12
+ * Determine if the context has information regarding the setup dependencies process
13
+ * @param context Schematic context
14
+ */
15
+ const hasSetupInformation = (context) => {
16
+ return !!context.setupDependencies;
17
+ };
18
+ exports.hasSetupInformation = hasSetupInformation;
19
+ /**
20
+ * Retrieve the package install configuration
21
+ * This is a workaround to ng-add to add the dependency to the sub-package
22
+ * @param packageJsonPath Path to the module package.json file
23
+ * @param tree Tree to read the file
24
+ * @param projectName Name of the project
25
+ * @param devDependencyOnly If true, the dependency will be added as devDependency
26
+ * @param exactO3rVersion Use a pinned version of the o3r package
27
+ */
28
+ const getPackageInstallConfig = (packageJsonPath, tree, projectName, devDependencyOnly, exactO3rVersion) => {
29
+ if (!projectName) {
30
+ return {};
31
+ }
32
+ const packageJson = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, { encoding: 'utf-8' }));
33
+ const workspaceProject = projectName ? (0, utility_1.getWorkspaceConfig)(tree)?.projects[projectName] : undefined;
34
+ return {
35
+ [packageJson.name]: {
36
+ inManifest: [{
37
+ range: `${exactO3rVersion ? '' : '~'}${packageJson.version}`,
38
+ types: devDependencyOnly ? [dependencies_1.NodeDependencyType.Dev] : (0, utility_1.getProjectNewDependenciesTypes)(workspaceProject)
39
+ }],
40
+ requireInstall: true,
41
+ ngAddOptions: { exactO3rVersion: exactO3rVersion }
42
+ }
43
+ };
44
+ };
45
+ exports.getPackageInstallConfig = getPackageInstallConfig;
46
+ /**
47
+ * Setup dependency to a repository.
48
+ * Will run manually the ngAdd schematics according to the parameters and install the packages if required
49
+ * @param options
50
+ */
51
+ const setupDependencies = (options) => {
52
+ return () => {
53
+ const ngAddToRun = new Set(Object.keys(options.dependencies)
54
+ .filter((dep) => options.ngAddToRun?.some((pattern) => typeof pattern === 'string' ? pattern === dep : pattern.test(dep))));
55
+ const requiringInstallList = new Set(Object.entries(options.dependencies).filter(([, { requireInstall }]) => requireInstall).map(([dep]) => dep));
56
+ const isInstallNeeded = () => options.skipInstall !== undefined ? !options.skipInstall : (ngAddToRun.size > 0 || requiringInstallList.size > 0);
57
+ const editPackageJson = (packageJsonPath, packageToInstall, dependency, updateLists) => {
58
+ return (tree, context) => {
59
+ if (!tree.exists(packageJsonPath)) {
60
+ context.logger.warn(`The file ${packageJsonPath} does not exist, the dependency ${packageToInstall} will not be added`);
61
+ return tree;
62
+ }
63
+ const packageJsonContent = tree.readJson(packageJsonPath);
64
+ dependency.inManifest.forEach(({ range, types }) => {
65
+ (types || [dependencies_1.NodeDependencyType.Default]).forEach((depType) => {
66
+ if (packageJsonContent[depType]?.[packageToInstall]) {
67
+ if (range && semver.validRange(range)) {
68
+ const currentMinimalVersion = semver.minVersion(packageJsonContent[depType]?.[packageToInstall]);
69
+ const myRangeMinimalVersion = semver.minVersion(range);
70
+ if (currentMinimalVersion && myRangeMinimalVersion && semver.gt(myRangeMinimalVersion, currentMinimalVersion)) {
71
+ context.logger.debug(`The dependency ${packageToInstall} (${depType}@${range}) will be added in ${packageJsonPath}`);
72
+ packageJsonContent[depType][packageToInstall] = range;
73
+ }
74
+ else {
75
+ if (updateLists) {
76
+ ngAddToRun.delete(packageToInstall);
77
+ requiringInstallList.delete(packageToInstall);
78
+ }
79
+ context.logger.debug(`The dependency ${packageToInstall} (${depType}) is already in ${packageJsonPath}, it will not be added.`);
80
+ context.logger.debug(`Because its range is inferior or included to the current one (${range} < ${packageJsonContent[depType][packageToInstall]}) in targeted ${packageJsonPath}`);
81
+ }
82
+ }
83
+ else {
84
+ if (updateLists) {
85
+ ngAddToRun.delete(packageToInstall);
86
+ requiringInstallList.delete(packageToInstall);
87
+ }
88
+ context.logger.warn(`The dependency ${packageToInstall} (${depType}) will not added ` +
89
+ `because there is already this dependency with a defined range (${packageJsonContent[depType][packageToInstall]}) in targeted ${packageJsonPath}`);
90
+ }
91
+ }
92
+ else {
93
+ packageJsonContent[depType] ||= {};
94
+ packageJsonContent[depType][packageToInstall] = range;
95
+ context.logger.debug(`The dependency ${packageToInstall} (${depType}@${range}) will be added in ${packageJsonPath}`);
96
+ }
97
+ packageJsonContent[depType] = Object.keys(packageJsonContent[depType])
98
+ .sort()
99
+ .reduce((acc, key) => {
100
+ acc[key] = packageJsonContent[depType][key];
101
+ return acc;
102
+ }, {});
103
+ });
104
+ });
105
+ const content = JSON.stringify(packageJsonContent, null, 2);
106
+ tree.overwrite(packageJsonPath, content);
107
+ return tree;
108
+ };
109
+ };
110
+ const addDependencies = (tree) => {
111
+ const workspaceConfig = (0, utility_1.getWorkspaceConfig)(tree);
112
+ const workspaceProject = options.projectName && workspaceConfig?.projects?.[options.projectName] || undefined;
113
+ const projectDirectory = workspaceProject?.root;
114
+ return (0, schematics_1.chain)(Object.entries(options.dependencies)
115
+ .map(([packageName, dependencyDetails]) => {
116
+ const shouldRunInSubPackage = projectDirectory && !dependencyDetails.toWorkspaceOnly;
117
+ const rootPackageRule = editPackageJson('package.json', packageName, dependencyDetails, !shouldRunInSubPackage);
118
+ if (shouldRunInSubPackage) {
119
+ return (0, schematics_1.chain)([
120
+ rootPackageRule,
121
+ editPackageJson(path.posix.join(projectDirectory, 'package.json'), packageName, dependencyDetails, true)
122
+ ]);
123
+ }
124
+ return rootPackageRule;
125
+ }));
126
+ };
127
+ const runNgAddSchematics = (_, context) => {
128
+ const packageManager = options.packageManager || (0, utility_1.getPackageManager)();
129
+ const installId = isInstallNeeded() ? [
130
+ context.addTask(new tasks_1.NodePackageInstallTask({ packageManager, quiet: true, workingDirectory: options.workingDirectory }), options.runAfterTasks)
131
+ ] : undefined;
132
+ if (installId !== undefined) {
133
+ context.logger.debug(`Schedule the installation of the workspace (${ngAddToRun.size > 0 ? 'for: ' + [...ngAddToRun].join(', ') : options.skipInstall ? 'skipped' : 'forced'})`);
134
+ }
135
+ const getOptions = (packageName, schema) => {
136
+ const schemaOptions = schema?.description.schemaJson?.properties;
137
+ return Object.fromEntries(Object.entries({ projectName: options.projectName, ...options.ngAddOptions, ...options.dependencies[packageName].ngAddOptions })
138
+ .filter(([key]) => !schemaOptions || !!schemaOptions[key]));
139
+ };
140
+ const finalTaskIds = [...ngAddToRun]
141
+ .map((packageName) => {
142
+ let schematic;
143
+ try {
144
+ const collection = context.engine.createCollection(packageName);
145
+ schematic = collection.createSchematic('ng-add');
146
+ }
147
+ catch (e) {
148
+ context.logger.warn(`The package ${packageName} was not installed, the options check will be skipped`, e);
149
+ }
150
+ const schematicOptions = getOptions(packageName, schematic);
151
+ return { packageName, schematicOptions };
152
+ })
153
+ .reduce((ids, { packageName, schematicOptions }) => {
154
+ context.logger.debug(`Schedule the schematic ng-add for ${packageName}`);
155
+ return [...ids, context.addTask(new tasks_1.RunSchematicTask(packageName, 'ng-add', schematicOptions), ids)];
156
+ }, [...(installId || []), ...(options.runAfterTasks || [])]);
157
+ if ((0, exports.hasSetupInformation)(context)) {
158
+ context.setupDependencies.taskIds.push(...finalTaskIds);
159
+ }
160
+ else {
161
+ context.setupDependencies = { taskIds: finalTaskIds };
162
+ }
163
+ if (options.scheduleTaskCallback) {
164
+ options.scheduleTaskCallback(finalTaskIds);
165
+ }
166
+ };
167
+ return (0, schematics_1.chain)([
168
+ addDependencies,
169
+ runNgAddSchematics
170
+ ]);
171
+ };
172
+ };
173
+ exports.setupDependencies = setupDependencies;
174
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/dependencies.ts"],"names":[],"mappings":";;;AAAA,2DAA8G;AAC9G,2EAA8E;AAC9E,kCAAkC;AAElC,iCAAiC;AACjC,2CAAgI;AAChI,4DAA4F;AAC5F,qCAAuC;AA4EvC;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CAAC,OAAyB,EAAgF,EAAE;IAC7I,OAAO,CAAC,CAAE,OAAe,CAAC,iBAAiB,CAAC;AAC9C,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B;AAEF;;;;;;;;GAQG;AACI,MAAM,uBAAuB,GAAG,CAAC,eAAuB,EAAE,IAAU,EAAE,WAAoB,EAAE,iBAA2B,EAAE,eAAyB,EAAmC,EAAE;IAC5L,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,eAAe,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAgB,CAAC;IAClG,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC,IAAA,4BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnG,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AO,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAE/D,IAAI,IAAA,2BAAmB,EAAC,OAAO,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACL,OAAe,CAAC,iBAAiB,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;YACjE,CAAC;YAED,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;gBACjC,OAAO,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,IAAA,kBAAK,EAAC;YACX,eAAe;YACf,kBAAkB;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;AAEJ,CAAC,CAAC;AApIW,QAAA,iBAAiB,qBAoI5B"}
@@ -1,37 +1,4 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { NodeDependencyType } from '@schematics/angular/utility/dependencies';
3
- import type { PackageJson } from 'type-fest';
4
- import { SchematicOptionObject } from '../../interfaces';
5
- import type { NgAddPackageOptions } from '../../tasks/index';
6
- /**
7
- * Install via `ng add` a list of npm packages.
8
- * @param packages List of packages to be installed via `ng add`
9
- * @param options install options
10
- * @param packageJsonPath path of the package json of the project where they will be installed
11
- */
12
- export declare function ngAddPackages(packages: string[], options?: Omit<NgAddPackageOptions, 'version'> & {
13
- version?: string | (string | undefined)[];
14
- }, packageJsonPath?: string): Rule;
15
- /**
16
- * Look for the peer dependencies and run ng add on the package requested version
17
- * @param packages list of the name of the packages needed
18
- * @param packageJsonPath path to package json that needs the peer to be resolved
19
- * @param type how to install the dependency (dev, peer for a library or default for an application)
20
- * @param options
21
- * @param parentPackageInfo for logging purposes
22
- */
23
- export declare function ngAddPeerDependencyPackages(packages: string[], packageJsonPath: string, type: NodeDependencyType | undefined, options: NgAddPackageOptions, parentPackageInfo?: string): Rule;
24
- /**
25
- * Register the given package in the Angular CLI schematics
26
- * @param packageJson PackageJson of the project containing the collection to add to the project
27
- * @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
28
- */
29
- export declare function registerPackageCollectionSchematics(packageJson: PackageJson, angularJsonFile?: string): Rule;
30
- /**
31
- * Setup schematics default params in angular.json
32
- * @param schematicsDefaultParams default params to setup by schematic
33
- * @param overrideValue Define if the given value should override the one already defined in the workspace
34
- * @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
35
- */
36
- export declare function setupSchematicsDefaultParams(schematicsDefaultParams: Record<string, SchematicOptionObject>, overrideValue?: boolean, angularJsonFile?: string): Rule;
1
+ export * from './schematics-register';
2
+ export * from './dependencies';
3
+ export * from './ng-add.helpers';
37
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,IAAI,EAA+B,MAAM,4BAA4B,CAAC;AAG/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAI9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;CAAE,EAAE,eAAe,SAAkB,GAAG,IAAI,CA0HzL;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,gCAAiD,EAC5I,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,MAAM,QAgBzD;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,WAAW,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAY5G;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAAE,aAAa,UAAQ,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAgClK"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}