@o3r/schematics 10.0.0-next.8 → 11.0.0-next.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. package/README.md +1 -1
  2. package/package.json +51 -41
  3. package/schematics/ng-add/index.d.ts.map +1 -1
  4. package/schematics/ng-add/index.js +3 -2
  5. package/schematics/ng-add/index.js.map +1 -1
  6. package/schematics/ng-add/schema.json +2 -2
  7. package/src/cli/environment.d.ts +2 -0
  8. package/src/cli/environment.d.ts.map +1 -0
  9. package/src/cli/environment.js +5 -0
  10. package/src/cli/environment.js.map +1 -0
  11. package/src/interfaces/angular-workspace.d.ts +11 -29
  12. package/src/interfaces/angular-workspace.d.ts.map +1 -1
  13. package/src/modules/index.d.ts +1 -0
  14. package/src/modules/index.d.ts.map +1 -1
  15. package/src/modules/index.js +1 -0
  16. package/src/modules/index.js.map +1 -1
  17. package/src/modules/modules.constants.d.ts +6 -2
  18. package/src/modules/modules.constants.d.ts.map +1 -1
  19. package/src/modules/modules.constants.js +5 -3
  20. package/src/modules/modules.constants.js.map +1 -1
  21. package/src/modules/modules.display.rule.d.ts +26 -0
  22. package/src/modules/modules.display.rule.d.ts.map +1 -0
  23. package/src/modules/modules.display.rule.js +45 -0
  24. package/src/modules/modules.display.rule.js.map +1 -0
  25. package/src/modules/modules.helpers.d.ts +2 -9
  26. package/src/modules/modules.helpers.d.ts.map +1 -1
  27. package/src/modules/modules.helpers.js +1 -6
  28. package/src/modules/modules.helpers.js.map +1 -1
  29. package/src/rule-factories/add-imports/index.d.ts +0 -1
  30. package/src/rule-factories/add-imports/index.d.ts.map +1 -1
  31. package/src/rule-factories/add-imports/index.js +0 -1
  32. package/src/rule-factories/add-imports/index.js.map +1 -1
  33. package/src/rule-factories/check-packages-peers/index.d.ts +0 -1
  34. package/src/rule-factories/check-packages-peers/index.d.ts.map +1 -1
  35. package/src/rule-factories/check-packages-peers/index.js +4 -7
  36. package/src/rule-factories/check-packages-peers/index.js.map +1 -1
  37. package/src/rule-factories/dev-tools/devtools-registration.d.ts +25 -0
  38. package/src/rule-factories/dev-tools/devtools-registration.d.ts.map +1 -0
  39. package/src/rule-factories/dev-tools/devtools-registration.js +89 -0
  40. package/src/rule-factories/dev-tools/devtools-registration.js.map +1 -0
  41. package/src/rule-factories/dev-tools/index.d.ts +2 -0
  42. package/src/rule-factories/dev-tools/index.d.ts.map +1 -0
  43. package/src/rule-factories/dev-tools/index.js +5 -0
  44. package/src/rule-factories/dev-tools/index.js.map +1 -0
  45. package/src/rule-factories/eslint-fix/index.d.ts +1 -18
  46. package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
  47. package/src/rule-factories/eslint-fix/index.js +17 -26
  48. package/src/rule-factories/eslint-fix/index.js.map +1 -1
  49. package/src/rule-factories/get-test-frameworks/index.d.ts +0 -1
  50. package/src/rule-factories/get-test-frameworks/index.d.ts.map +1 -1
  51. package/src/rule-factories/get-test-frameworks/index.js +0 -1
  52. package/src/rule-factories/get-test-frameworks/index.js.map +1 -1
  53. package/src/rule-factories/index.d.ts +1 -0
  54. package/src/rule-factories/index.d.ts.map +1 -1
  55. package/src/rule-factories/index.js +1 -0
  56. package/src/rule-factories/index.js.map +1 -1
  57. package/src/rule-factories/ng-add/index.d.ts +2 -5
  58. package/src/rule-factories/ng-add/index.d.ts.map +1 -1
  59. package/src/rule-factories/ng-add/index.js +107 -83
  60. package/src/rule-factories/ng-add/index.js.map +1 -1
  61. package/src/rule-factories/remove-packages/index.d.ts +0 -1
  62. package/src/rule-factories/remove-packages/index.d.ts.map +1 -1
  63. package/src/rule-factories/remove-packages/index.js +0 -1
  64. package/src/rule-factories/remove-packages/index.js.map +1 -1
  65. package/src/rule-factories/update-imports/list-of-vars.d.ts +1 -2
  66. package/src/rule-factories/update-imports/list-of-vars.d.ts.map +1 -1
  67. package/src/rule-factories/update-imports/list-of-vars.js.map +1 -1
  68. package/src/rule-factories/update-imports/update-imports-with-scope.d.ts +0 -1
  69. package/src/rule-factories/update-imports/update-imports-with-scope.d.ts.map +1 -1
  70. package/src/rule-factories/update-imports/update-imports-with-scope.js +0 -1
  71. package/src/rule-factories/update-imports/update-imports-with-scope.js.map +1 -1
  72. package/src/rule-factories/update-imports/update-ts-imports.d.ts +0 -1
  73. package/src/rule-factories/update-imports/update-ts-imports.d.ts.map +1 -1
  74. package/src/rule-factories/update-imports/update-ts-imports.js +0 -1
  75. package/src/rule-factories/update-imports/update-ts-imports.js.map +1 -1
  76. package/src/rule-factories/update-imports/v7-to-v8-map-object.js +1 -1
  77. package/src/rule-factories/update-imports/v7-to-v8-map-object.js.map +1 -1
  78. package/src/rule-factories/vscode-extensions/index.d.ts +0 -1
  79. package/src/rule-factories/vscode-extensions/index.d.ts.map +1 -1
  80. package/src/rule-factories/vscode-extensions/index.js +0 -1
  81. package/src/rule-factories/vscode-extensions/index.js.map +1 -1
  82. package/src/rules/install.d.ts +0 -1
  83. package/src/rules/install.d.ts.map +1 -1
  84. package/src/rules/install.js +0 -1
  85. package/src/rules/install.js.map +1 -1
  86. package/src/tasks/eslint/index.d.ts +17 -1
  87. package/src/tasks/eslint/index.d.ts.map +1 -1
  88. package/src/tasks/eslint/index.js +15 -6
  89. package/src/tasks/eslint/index.js.map +1 -1
  90. package/src/tasks/package-manager/add-dev-dependency.d.ts +1 -0
  91. package/src/tasks/package-manager/add-dev-dependency.d.ts.map +1 -1
  92. package/src/tasks/package-manager/add-dev-dependency.js +3 -1
  93. package/src/tasks/package-manager/add-dev-dependency.js.map +1 -1
  94. package/src/tasks/package-manager/interfaces.d.ts +9 -0
  95. package/src/tasks/package-manager/interfaces.d.ts.map +1 -1
  96. package/src/tasks/package-manager/npm-install.d.ts +2 -1
  97. package/src/tasks/package-manager/npm-install.d.ts.map +1 -1
  98. package/src/tasks/package-manager/npm-install.js +3 -1
  99. package/src/tasks/package-manager/npm-install.js.map +1 -1
  100. package/src/utility/ast.d.ts +4 -20
  101. package/src/utility/ast.d.ts.map +1 -1
  102. package/src/utility/ast.js +0 -18
  103. package/src/utility/ast.js.map +1 -1
  104. package/src/utility/builder.d.ts +11 -0
  105. package/src/utility/builder.d.ts.map +1 -0
  106. package/src/utility/builder.js +21 -0
  107. package/src/utility/builder.js.map +1 -0
  108. package/src/utility/collection.d.ts +2 -5
  109. package/src/utility/collection.d.ts.map +1 -1
  110. package/src/utility/collection.js +11 -9
  111. package/src/utility/collection.js.map +1 -1
  112. package/src/utility/component.d.ts +0 -6
  113. package/src/utility/component.d.ts.map +1 -1
  114. package/src/utility/component.js +4 -9
  115. package/src/utility/component.js.map +1 -1
  116. package/src/utility/dependencies.d.ts +0 -2
  117. package/src/utility/dependencies.d.ts.map +1 -1
  118. package/src/utility/dependencies.js +0 -2
  119. package/src/utility/dependencies.js.map +1 -1
  120. package/src/utility/environment.d.ts +27 -0
  121. package/src/utility/environment.d.ts.map +1 -0
  122. package/src/utility/environment.js +51 -0
  123. package/src/utility/environment.js.map +1 -0
  124. package/src/utility/error.d.ts +7 -0
  125. package/src/utility/error.d.ts.map +1 -0
  126. package/src/utility/error.js +17 -0
  127. package/src/utility/error.js.map +1 -0
  128. package/src/utility/file-info.d.ts +11 -1
  129. package/src/utility/file-info.d.ts.map +1 -1
  130. package/src/utility/file-info.js +46 -4
  131. package/src/utility/file-info.js.map +1 -1
  132. package/src/utility/generation.d.ts +0 -1
  133. package/src/utility/generation.d.ts.map +1 -1
  134. package/src/utility/generation.js +7 -11
  135. package/src/utility/generation.js.map +1 -1
  136. package/src/utility/gitignore.d.ts +0 -1
  137. package/src/utility/gitignore.d.ts.map +1 -1
  138. package/src/utility/gitignore.js +0 -1
  139. package/src/utility/gitignore.js.map +1 -1
  140. package/src/utility/index.d.ts +10 -7
  141. package/src/utility/index.d.ts.map +1 -1
  142. package/src/utility/index.js +10 -7
  143. package/src/utility/index.js.map +1 -1
  144. package/src/utility/loaders.d.ts +12 -50
  145. package/src/utility/loaders.d.ts.map +1 -1
  146. package/src/utility/loaders.js +34 -97
  147. package/src/utility/loaders.js.map +1 -1
  148. package/src/utility/logo.d.ts +0 -1
  149. package/src/utility/logo.d.ts.map +1 -1
  150. package/src/utility/logo.js +0 -1
  151. package/src/utility/logo.js.map +1 -1
  152. package/src/utility/matching-peers.d.ts +11 -3
  153. package/src/utility/matching-peers.d.ts.map +1 -1
  154. package/src/utility/matching-peers.js +26 -5
  155. package/src/utility/matching-peers.js.map +1 -1
  156. package/src/utility/modules.d.ts +4 -9
  157. package/src/utility/modules.d.ts.map +1 -1
  158. package/src/utility/modules.js +17 -22
  159. package/src/utility/modules.js.map +1 -1
  160. package/src/utility/monorepo.d.ts +0 -5
  161. package/src/utility/monorepo.d.ts.map +1 -1
  162. package/src/utility/monorepo.js +0 -5
  163. package/src/utility/monorepo.js.map +1 -1
  164. package/src/utility/package-manager-runner.d.ts +24 -7
  165. package/src/utility/package-manager-runner.d.ts.map +1 -1
  166. package/src/utility/package-manager-runner.js +70 -10
  167. package/src/utility/package-manager-runner.js.map +1 -1
  168. package/src/utility/package-version.d.ts +0 -2
  169. package/src/utility/package-version.d.ts.map +1 -1
  170. package/src/utility/package-version.js +0 -2
  171. package/src/utility/package-version.js.map +1 -1
  172. package/src/utility/question.d.ts +0 -1
  173. package/src/utility/question.d.ts.map +1 -1
  174. package/src/utility/question.js +0 -1
  175. package/src/utility/question.js.map +1 -1
  176. package/src/utility/routes.d.ts +0 -3
  177. package/src/utility/routes.d.ts.map +1 -1
  178. package/src/utility/routes.js +0 -5
  179. package/src/utility/routes.js.map +1 -1
  180. package/src/utility/sub-entry.d.ts +0 -2
  181. package/src/utility/sub-entry.d.ts.map +1 -1
  182. package/src/utility/sub-entry.js +0 -2
  183. package/src/utility/sub-entry.js.map +1 -1
  184. package/src/utility/template-property.helper.d.ts +0 -15
  185. package/src/utility/template-property.helper.d.ts.map +1 -1
  186. package/src/utility/template-property.helper.js +0 -16
  187. package/src/utility/template-property.helper.js.map +1 -1
  188. package/src/utility/update-imports.d.ts +0 -1
  189. package/src/utility/update-imports.d.ts.map +1 -1
  190. package/src/utility/update-imports.js +0 -1
  191. package/src/utility/update-imports.js.map +1 -1
@@ -6,7 +6,6 @@ const change_1 = require("@schematics/angular/utility/change");
6
6
  const ts = require("typescript");
7
7
  /**
8
8
  * Rule to add imports to a file
9
- *
10
9
  * @param filePath
11
10
  * @param imports
12
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/add-imports/index.ts"],"names":[],"mappings":";;;AACA,qEAAqE;AACrE,+DAAmF;AACnF,iCAAiC;AAEjC;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,OAGG,EACG,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IAC3B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC1B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,QAAQ,kBAAkB,CAAC,CAAC;QACrF,OAAO;KACR;IACD,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,QAAQ,EACR,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACvB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAa,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CACjF,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAA,wBAAY,EAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CACtF,EAAE,EAAE,CAAC,CAAC;IACP,IAAA,8BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAxBW,QAAA,cAAc,kBAwBzB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/add-imports/index.ts"],"names":[],"mappings":";;;AACA,qEAAqE;AACrE,+DAAmF;AACnF,iCAAiC;AAEjC;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,OAGG,EACG,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IAC3B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC1B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,QAAQ,kBAAkB,CAAC,CAAC;QACrF,OAAO;KACR;IACD,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,QAAQ,EACR,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACvB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAa,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CACjF,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAA,wBAAY,EAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CACtF,EAAE,EAAE,CAAC,CAAC;IACP,IAAA,8BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAxBW,QAAA,cAAc,kBAwBzB"}
@@ -1,7 +1,6 @@
1
1
  import { SchematicContext, Tree } from '@angular-devkit/schematics';
2
2
  /**
3
3
  * List peer deps packages of the given package, display a warning if version mismatch, error if peer dep is missing
4
- *
5
4
  * @param packageName The package to check peer deps for
6
5
  */
7
6
  export declare function checkPackagesRule(packageName: string): (tree: Tree, context: SchematicContext) => import("@angular-devkit/schematics/src/tree/interface").Tree;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA+FpE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,UACrC,IAAI,6FAKnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA4FpE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,UACrC,IAAI,6FAKnB"}
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkPackagesRule = void 0;
4
4
  const path = require("node:path");
5
5
  const semver_1 = require("semver");
6
- const utility_1 = require("../../utility");
6
+ const index_1 = require("../../utility/index");
7
7
  /**
8
8
  * Check if the first level of peer deps of a given package are installed.
9
9
  * List all not installed packages or packages with version mismatch
10
- *
11
10
  * @param packageName
12
11
  */
13
12
  function getPackagesToInstallOrUpdate(packageName) {
@@ -16,7 +15,7 @@ function getPackagesToInstallOrUpdate(packageName) {
16
15
  installedPackage = require(`${packageName}${path.posix.sep}package.json`);
17
16
  }
18
17
  catch (err) {
19
- throw new Error(`The provided package is not installed: ${packageName}`);
18
+ throw new index_1.O3rCliError(`The provided package is not installed: ${packageName}`);
20
19
  }
21
20
  const packagesToInstall = [];
22
21
  const packagesWrongVersion = [];
@@ -46,13 +45,12 @@ function getPackagesToInstallOrUpdate(packageName) {
46
45
  }
47
46
  /**
48
47
  * Log an instruction with the packages to install or update to match a package peer dependencies
49
- *
50
48
  * @param packageName
51
49
  * @param angularJsonString
52
50
  * @param logger
53
51
  */
54
52
  function checkPackagesToInstallOrUpdate(packageName, logger, angularJsonString) {
55
- const packageManager = (0, utility_1.getPackageManager)({ workspaceConfig: angularJsonString });
53
+ const packageManager = (0, index_1.getPackageManager)({ workspaceConfig: angularJsonString });
56
54
  const { packagesToInstall, packagesWrongVersion } = getPackagesToInstallOrUpdate(packageName);
57
55
  if (packagesWrongVersion.length) {
58
56
  logger.warn('');
@@ -68,7 +66,7 @@ function checkPackagesToInstallOrUpdate(packageName, logger, angularJsonString)
68
66
  logger.error('');
69
67
  logger.error(`The following packages need to be installed to have "${packageName}" working. Run the commands one by one:`);
70
68
  packagesToInstall.forEach((dep) => logger.error(`${packageManager} run ng add ${dep.packageName}@${dep.version}`));
71
- throw new Error('Missing peer dependencies');
69
+ throw new index_1.O3rCliError('Missing peer dependencies');
72
70
  }
73
71
  if (!packagesToInstall.length && !packagesWrongVersion.length) {
74
72
  logger.info(`The package ${packageName} has all peer deps installed.\n`);
@@ -76,7 +74,6 @@ function checkPackagesToInstallOrUpdate(packageName, logger, angularJsonString)
76
74
  }
77
75
  /**
78
76
  * List peer deps packages of the given package, display a warning if version mismatch, error if peer dep is missing
79
- *
80
77
  * @param packageName The package to check peer deps for
81
78
  */
82
79
  function checkPackagesRule(packageName) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,mCAAmC;AAEnC,2CAAkD;AAalD;;;;;GAKG;AACH,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,gBAA6B,CAAC;IAClC,IAAI;QACF,gBAAgB,GAAG,OAAO,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC;KAC3E;IAAC,OAAO,GAAG,EAAE;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AAe,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACnH,MAAM,IAAI,mBAAW,CAAC,2BAA2B,CAAC,CAAC;KACpD;IAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;QAC7D,MAAM,CAAC,IAAI,CAAC,eAAe,WAAW,iCAAiC,CAAC,CAAC;KAC1E;AAEH,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,WAAmB;IACnD,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/C,8BAA8B,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAND,8CAMC"}
@@ -0,0 +1,25 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ /** Options for the devtools register rule factory */
3
+ export interface DevtoolRegisterOptions {
4
+ /** Name of the devtool module */
5
+ moduleName: string;
6
+ /** Package name from which the devtools is exposed */
7
+ packageName: string;
8
+ /** Name of the workspace project name */
9
+ projectName?: string;
10
+ /** Name of the devtools service (if available) */
11
+ serviceName?: string;
12
+ }
13
+ /**
14
+ * Rule to inject a service after `bootstrapModule` or `bootstrapApplication`
15
+ * @param options
16
+ */
17
+ export declare const injectServiceInMain: (options: DevtoolRegisterOptions) => Rule;
18
+ /**
19
+ * Register Devtools to the application
20
+ * @param tree
21
+ * @param context
22
+ * @param options
23
+ */
24
+ export declare const registerDevtoolsToApplication: (options: DevtoolRegisterOptions) => Rule;
25
+ //# sourceMappingURL=devtools-registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-registration.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/devtools-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAQzD,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACrC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoCD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,sBAAsB,KAAG,IAoDrE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,YAAa,sBAAsB,KAAG,IAsB/E,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerDevtoolsToApplication = exports.injectServiceInMain = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const ts = require("typescript");
6
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
7
+ const utility_1 = require("../../utility");
8
+ const utility_2 = require("../../utility");
9
+ const change_1 = require("@schematics/angular/utility/change");
10
+ const registerModule = (options) => (tree, context) => {
11
+ const moduleFilePath = (0, utility_1.getAppModuleFilePath)(tree, context, options.projectName);
12
+ if (!moduleFilePath) {
13
+ return tree;
14
+ }
15
+ const sourceFileContent = tree.read(moduleFilePath).toString();
16
+ const sourceFile = ts.createSourceFile(moduleFilePath, sourceFileContent, ts.ScriptTarget.ES2015, true);
17
+ if ((0, ast_utils_1.isImported)(sourceFile, options.moduleName, options.packageName)) {
18
+ return tree;
19
+ }
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);
23
+ addImportToModuleFile(options.moduleName, options.packageName, '.instrument({isActivatedOnBootstrap: true})');
24
+ tree.commitUpdate(recorder);
25
+ return tree;
26
+ };
27
+ /**
28
+ * Rule to inject a service after `bootstrapModule` or `bootstrapApplication`
29
+ * @param options
30
+ */
31
+ const injectServiceInMain = (options) => (tree, context) => {
32
+ if (!options.serviceName) {
33
+ return tree;
34
+ }
35
+ const mainFilePath = (0, utility_1.getMainFilePath)(tree, context, options.projectName);
36
+ if (!mainFilePath || !tree.exists(mainFilePath)) {
37
+ return tree;
38
+ }
39
+ const content = tree.readText(mainFilePath);
40
+ if (content.includes(`inject(${options.serviceName})`)) {
41
+ return tree;
42
+ }
43
+ const match = /bootstrap(Module|Application)\([^)]*\)/.exec(content);
44
+ if (!match) {
45
+ return tree;
46
+ }
47
+ const sourceFile = ts.createSourceFile(mainFilePath, content, ts.ScriptTarget.ES2015, true);
48
+ const recorder = tree.beginUpdate(mainFilePath);
49
+ const changes = [];
50
+ if (!(0, ast_utils_1.isImported)(sourceFile, options.serviceName, options.packageName)) {
51
+ changes.push((0, ast_utils_1.insertImport)(sourceFile, mainFilePath, options.serviceName, options.packageName));
52
+ }
53
+ if (!(0, ast_utils_1.isImported)(sourceFile, 'inject', '@angular/core')) {
54
+ changes.push((0, ast_utils_1.insertImport)(sourceFile, mainFilePath, 'inject', '@angular/core'));
55
+ }
56
+ if (!(0, ast_utils_1.isImported)(sourceFile, 'runInInjectionContext', '@angular/core')) {
57
+ changes.push((0, ast_utils_1.insertImport)(sourceFile, mainFilePath, 'runInInjectionContext', '@angular/core'));
58
+ }
59
+ changes.push(new change_1.InsertChange(mainFilePath, match.index + match[0].length, `\n .then((m) => { runInInjectionContext(m.injector, () => { inject(${options.serviceName}); }); return m; })`));
60
+ (0, change_1.applyToUpdateRecorder)(recorder, changes);
61
+ tree.commitUpdate(recorder);
62
+ return tree;
63
+ };
64
+ exports.injectServiceInMain = injectServiceInMain;
65
+ /**
66
+ * Register Devtools to the application
67
+ * @param tree
68
+ * @param context
69
+ * @param options
70
+ */
71
+ const registerDevtoolsToApplication = (options) => (tree, context) => {
72
+ const workspace = (0, utility_1.getWorkspaceConfig)(tree);
73
+ const project = options.projectName ? workspace?.projects[options.projectName] : undefined;
74
+ if (!workspace || !project || project.projectType !== 'application') {
75
+ context.logger.warn(`Failed to determine the application to update, the devtool modules ${options.moduleName}.`);
76
+ return tree;
77
+ }
78
+ const schematicConfig = (0, utility_1.getDefaultOptionsForSchematic)(workspace, options.packageName, 'ng-add', options);
79
+ if (!schematicConfig?.registerDevtool) {
80
+ return tree;
81
+ }
82
+ return (0, schematics_1.chain)([
83
+ registerModule(options),
84
+ (0, exports.injectServiceInMain)(options),
85
+ (_, ctx) => ctx.logger.info(`The devtools module ${options.moduleName} has been registered and automatically activated${options.serviceName ? ', its activation can be driven via ' + options.serviceName : ''}.`)
86
+ ])(tree, context);
87
+ };
88
+ exports.registerDevtoolsToApplication = registerDevtoolsToApplication;
89
+ //# sourceMappingURL=devtools-registration.js.map
@@ -0,0 +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,iB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KACF,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpB,CAAC,CAAC;AAtBW,QAAA,6BAA6B,iCAsBxC"}
@@ -0,0 +1,2 @@
1
+ export * from './devtools-registration';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./devtools-registration"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/index.ts"],"names":[],"mappings":";;;AAAA,kEAAwC"}
@@ -1,24 +1,7 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
- /**
3
- * Linter options
4
- */
5
- export interface LinterOptions {
6
- /**
7
- * Indicates if the linter process should succeed even if there are lint errors remaining
8
- *
9
- * @default true
10
- */
11
- force?: boolean;
12
- /**
13
- * If enabled, only errors are reported (--quiet option of ESLint CLI)
14
- *
15
- * @default true
16
- */
17
- hideWarnings?: boolean;
18
- }
2
+ import { LinterOptions } from '../../tasks';
19
3
  /**
20
4
  * Apply EsLint fix
21
- *
22
5
  * @param prootPath Root path
23
6
  * @param _prootPath
24
7
  * @param extension List of file extensions to lint
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKpF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IAEH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAM,EAAE,SAAS,GAAE,MAAM,EAAW,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAoE5G"}
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,28 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.applyEsLintFix = void 0;
4
- const node_child_process_1 = require("node:child_process");
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
5
  const node_path_1 = require("node:path");
6
- const package_manager_runner_1 = require("../../utility/package-manager-runner");
6
+ const tasks_1 = require("../../tasks");
7
7
  /**
8
8
  * Apply EsLint fix
9
- *
10
9
  * @param prootPath Root path
11
10
  * @param _prootPath
12
11
  * @param extension List of file extensions to lint
13
12
  * @param options Linter options
14
13
  */
15
14
  function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
15
+ try {
16
+ require.resolve('eslint/package.json');
17
+ }
18
+ catch {
19
+ return (0, schematics_1.noop)();
20
+ }
16
21
  const linterOptions = {
17
- force: true,
22
+ continueOnError: true,
18
23
  hideWarnings: true,
19
24
  ...options
20
25
  };
21
26
  return (tree, context) => {
27
+ const filesToBeLint = tree.actions
28
+ .filter((a) => a.kind !== 'd')
29
+ .map((action) => action.path.substring(1));
22
30
  // directory of the deepest file
23
- let dir = tree.getDir((0, node_path_1.dirname)(tree.actions
24
- .map((action) => action.path.substr(1))
25
- .reduce((acc, path) => {
31
+ let dir = tree.getDir((0, node_path_1.dirname)(filesToBeLint.reduce((acc, path) => {
26
32
  const level = path.split('/').length;
27
33
  if (acc.level < level) {
28
34
  return { level, path };
@@ -33,7 +39,7 @@ function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
33
39
  do {
34
40
  eslintFile = dir.subfiles.find((f) => f.startsWith('.eslintrc'));
35
41
  if (eslintFile) {
36
- eslintFile = (0, node_path_1.join)(dir.path.substr(1), eslintFile);
42
+ eslintFile = (0, node_path_1.join)(dir.path.substring(1), eslintFile);
37
43
  break;
38
44
  }
39
45
  dir = dir.parent;
@@ -42,28 +48,13 @@ function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
42
48
  context.logger.warn(`Asked to run lint fixes, but could not find a eslintrc config file.
43
49
  You can consider to run later the following command to add otter linter rules: ng add @o3r/eslint-config-otter`);
44
50
  }
45
- const files = tree.actions.reduce((acc, action) => {
46
- const filePath = action.path.substr(1);
47
- if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && action.path.startsWith(dir.path)) {
51
+ const files = filesToBeLint.reduce((acc, filePath) => {
52
+ if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && filePath.startsWith(dir.path)) {
48
53
  acc.add(filePath);
49
54
  }
50
55
  return acc;
51
56
  }, new Set());
52
- try {
53
- (0, node_child_process_1.exec)(`${(0, package_manager_runner_1.getPackageManagerExecutor)()} eslint ` +
54
- Array.from(files).map((file) => `"${file}"`).join(' ') +
55
- ' --fix --color' +
56
- (linterOptions.hideWarnings ? ' --quiet' : '') +
57
- (eslintFile ? ` --config ${eslintFile} --parser-options=tsconfigRootDir:${(0, node_path_1.resolve)(process.cwd(), (0, node_path_1.dirname)(eslintFile))}` : ''), (_error, stdout, stderr) => {
58
- context.logger.info(stdout);
59
- if (!linterOptions.force) {
60
- context.logger.error(stderr);
61
- }
62
- });
63
- }
64
- catch {
65
- context.logger.error('Could not run eslint');
66
- }
57
+ context.addTask(new tasks_1.EslintFixTask(Array.from(files), undefined, eslintFile, linterOptions));
67
58
  return tree;
68
59
  };
69
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AACA,2DAA0C;AAC1C,yCAAmD;AACnD,iFAAiF;AAqBjF;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,UAAU,GAAG,GAAG,EAAE,YAAsB,CAAC,IAAI,CAAC,EAAE,OAAuB;IACpG,MAAM,aAAa,GAAG;QACpB,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,IAAI;QAClB,GAAG,OAAO;KACX,CAAC;IAEF,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAE/C,gCAAgC;QAChC,IAAI,GAAG,GAAoB,IAAI,CAAC,MAAM,CACpC,IAAA,mBAAO,EACL,IAAI,CAAC,OAAO;aACT,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aACtC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACpB,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,CAChC,CACF,CAAC;QAEF,IAAI,UAA8B,CAAC;QACnC,GAAG;YACD,UAAU,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;YACjE,IAAI,UAAU,EAAE;gBACd,UAAU,GAAG,IAAA,gB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,CAAC,IAAI,CAAC,EAAE;gBACjG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;aACnB;YAED,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC;QAEtB,OAAO,CAAC,OAAO,CACb,IAAI,qBAAa,CACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,SAAS,EACT,UAAU,EACV,aAAa,CACd,CACF,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAlED,wCAkEC"}
@@ -2,7 +2,6 @@ import type { SchematicContext } from '@angular-devkit/schematics';
2
2
  import type { AvailableTestFrameworks, WorkspaceSchema } from '../../interfaces';
3
3
  /**
4
4
  * Get the test framework
5
- *
6
5
  * @param workspaceOptions the workspace options
7
6
  * @param context
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/get-test-frameworks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASjF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,GAAG,IAAI,EAAE,OAAO,EAAE,gBAAgB,GAAG,uBAAuB,GAAG,SAAS,CAiBzI"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/get-test-frameworks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASjF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,GAAG,IAAI,EAAE,OAAO,EAAE,gBAAgB,GAAG,uBAAuB,GAAG,SAAS,CAiBzI"}
@@ -8,7 +8,6 @@ const testPackageMaps = {
8
8
  };
9
9
  /**
10
10
  * Get the test framework
11
- *
12
11
  * @param workspaceOptions the workspace options
13
12
  * @param context
14
13
  */
@@ -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;;;;;GAKG;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,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"}
@@ -7,4 +7,5 @@ export * from './ng-add/index';
7
7
  export * from './remove-packages/index';
8
8
  export * from './update-imports/index';
9
9
  export * from './vscode-extensions/index';
10
+ export * from './dev-tools/index';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
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"}
@@ -10,4 +10,5 @@ tslib_1.__exportStar(require("./ng-add/index"), exports);
10
10
  tslib_1.__exportStar(require("./remove-packages/index"), exports);
11
11
  tslib_1.__exportStar(require("./update-imports/index"), exports);
12
12
  tslib_1.__exportStar(require("./vscode-extensions/index"), exports);
13
+ tslib_1.__exportStar(require("./dev-tools/index"), exports);
13
14
  //# sourceMappingURL=index.js.map
@@ -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"}
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"}
@@ -5,7 +5,6 @@ import { SchematicOptionObject } from '../../interfaces';
5
5
  import type { NgAddPackageOptions } from '../../tasks/index';
6
6
  /**
7
7
  * Install via `ng add` a list of npm packages.
8
- *
9
8
  * @param packages List of packages to be installed via `ng add`
10
9
  * @param options install options
11
10
  * @param packageJsonPath path of the package json of the project where they will be installed
@@ -15,7 +14,6 @@ export declare function ngAddPackages(packages: string[], options?: Omit<NgAddPa
15
14
  }, packageJsonPath?: string): Rule;
16
15
  /**
17
16
  * Look for the peer dependencies and run ng add on the package requested version
18
- *
19
17
  * @param packages list of the name of the packages needed
20
18
  * @param packageJsonPath path to package json that needs the peer to be resolved
21
19
  * @param type how to install the dependency (dev, peer for a library or default for an application)
@@ -25,16 +23,15 @@ export declare function ngAddPackages(packages: string[], options?: Omit<NgAddPa
25
23
  export declare function ngAddPeerDependencyPackages(packages: string[], packageJsonPath: string, type: NodeDependencyType | undefined, options: NgAddPackageOptions, parentPackageInfo?: string): Rule;
26
24
  /**
27
25
  * Register the given package in the Angular CLI schematics
28
- *
29
26
  * @param packageJson PackageJson of the project containing the collection to add to the project
30
27
  * @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
31
28
  */
32
29
  export declare function registerPackageCollectionSchematics(packageJson: PackageJson, angularJsonFile?: string): Rule;
33
30
  /**
34
31
  * Setup schematics default params in angular.json
35
- *
36
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
37
34
  * @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
38
35
  */
39
- export declare function setupSchematicsDefaultParams(schematicsDefaultParams: Record<string, SchematicOptionObject>, angularJsonFile?: string): Rule;
36
+ export declare function setupSchematicsDefaultParams(schematicsDefaultParams: Record<string, SchematicOptionObject>, overrideValue?: boolean, angularJsonFile?: string): Rule;
40
37
  //# 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,EAAqC,MAAM,4BAA4B,CAAC;AAGrH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAA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