@o3r/core 11.6.0-prerelease.3 → 11.6.0-prerelease.30

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 (198) hide show
  1. package/builders/app-version/index.d.ts.map +1 -1
  2. package/builders/app-version/index.js +1 -1
  3. package/builders/app-version/schema.d.ts.map +1 -1
  4. package/builders/lib-build/index.d.ts +1 -2
  5. package/builders/lib-build/index.d.ts.map +1 -1
  6. package/builders/lib-build/index.js +10 -10
  7. package/builders/lib-build/schema.d.ts +1 -2
  8. package/builders/lib-build/schema.d.ts.map +1 -1
  9. package/builders/multi-watcher/index.d.ts.map +1 -1
  10. package/builders/multi-watcher/index.js +1 -0
  11. package/builders/multi-watcher/schema.d.ts.map +1 -1
  12. package/builders/ngc/index.d.ts.map +1 -1
  13. package/builders/ngc/index.js +4 -5
  14. package/builders/ngc/schema.d.ts.map +1 -1
  15. package/builders/pattern-replacement/index.d.ts.map +1 -1
  16. package/builders/pattern-replacement/index.js +2 -3
  17. package/builders/pattern-replacement/schema.d.ts.map +1 -1
  18. package/builders/run-script/index.d.ts.map +1 -1
  19. package/builders/run-script/index.js +3 -3
  20. package/builders/utils.d.ts.map +1 -1
  21. package/core/application/build-properties.d.ts +1 -1
  22. package/core/application/build-properties.d.ts.map +1 -1
  23. package/core/application/runtime.d.ts.map +1 -1
  24. package/core/common/interface-utils.d.ts.map +1 -1
  25. package/core/interfaces/configuration.d.ts.map +1 -1
  26. package/core/interfaces/context.d.ts.map +1 -1
  27. package/core/metadata/component.decorator.d.ts.map +1 -1
  28. package/core/metadata/index.d.ts +1 -1
  29. package/core/metadata/index.d.ts.map +1 -1
  30. package/esm2022/core/application/build-properties.mjs +2 -2
  31. package/esm2022/core/application/index.mjs +1 -1
  32. package/esm2022/core/application/runtime.mjs +1 -1
  33. package/esm2022/core/common/interface-utils.mjs +1 -1
  34. package/esm2022/core/devkit/devtools.interface.mjs +1 -1
  35. package/esm2022/core/interfaces/configuration.mjs +1 -1
  36. package/esm2022/core/interfaces/context.mjs +1 -2
  37. package/esm2022/core/metadata/component.decorator.mjs +2 -2
  38. package/esm2022/core/metadata/index.mjs +2 -2
  39. package/esm2022/messages/common-message.interface.mjs +1 -1
  40. package/esm2022/messages/index.mjs +1 -1
  41. package/esm2022/messages/message.helpers.mjs +7 -5
  42. package/esm2022/public_api.mjs +2 -2
  43. package/esm2022/store/async/async-entity.adapter.mjs +3 -3
  44. package/esm2022/store/async/async.adapter.mjs +8 -7
  45. package/esm2022/store/async/async.helpers.mjs +1 -1
  46. package/esm2022/store/async/async.interfaces.mjs +1 -1
  47. package/esm2022/store/async/async.operators.mjs +5 -5
  48. package/esm2022/store/async/async.props.mjs +3 -4
  49. package/esm2022/store/async/async.serializer.mjs +2 -2
  50. package/esm2022/store/async/index.mjs +4 -4
  51. package/esm2022/store/types.mjs +1 -1
  52. package/esm2022/utils/debug/debug.helper.mjs +1 -2
  53. package/esm2022/utils/deep-fill/deep-fill.mjs +3 -4
  54. package/esm2022/utils/rendering/rendering.helpers.mjs +3 -4
  55. package/fesm2022/o3r-core.mjs +48 -51
  56. package/fesm2022/o3r-core.mjs.map +1 -1
  57. package/messages/common-message.interface.d.ts.map +1 -1
  58. package/messages/message.helpers.d.ts.map +1 -1
  59. package/package.json +21 -14
  60. package/public_api.d.ts +1 -1
  61. package/public_api.d.ts.map +1 -1
  62. package/schematics/add-modules/index.d.ts.map +1 -1
  63. package/schematics/add-modules/index.js +2 -2
  64. package/schematics/add-modules/schema.d.ts.map +1 -1
  65. package/schematics/component/container/index.d.ts.map +1 -1
  66. package/schematics/component/container/index.js +13 -11
  67. package/schematics/component/container/schema.d.ts.map +1 -1
  68. package/schematics/component/index.d.ts.map +1 -1
  69. package/schematics/component/index.js +1 -3
  70. package/schematics/component/presenter/index.d.ts.map +1 -1
  71. package/schematics/component/presenter/index.js +13 -12
  72. package/schematics/component/presenter/schema.d.ts.map +1 -1
  73. package/schematics/component/schema.d.ts.map +1 -1
  74. package/schematics/component/structures.types.d.ts +3 -3
  75. package/schematics/component/structures.types.d.ts.map +1 -1
  76. package/schematics/component/structures.types.js +2 -0
  77. package/schematics/context-to-component/index.d.ts +0 -1
  78. package/schematics/context-to-component/index.d.ts.map +1 -1
  79. package/schematics/context-to-component/index.js +1 -2
  80. package/schematics/context-to-component/schema.d.ts.map +1 -1
  81. package/schematics/convert-component/index.d.ts +0 -1
  82. package/schematics/convert-component/index.d.ts.map +1 -1
  83. package/schematics/convert-component/index.js +0 -2
  84. package/schematics/convert-component/schema.d.ts.map +1 -1
  85. package/schematics/ng-add/component-decorator/index.d.ts.map +1 -1
  86. package/schematics/ng-add/component-decorator/index.js +4 -4
  87. package/schematics/ng-add/index.d.ts.map +1 -1
  88. package/schematics/ng-add/index.js +5 -6
  89. package/schematics/ng-add/project-setup/index.d.ts.map +1 -1
  90. package/schematics/ng-add/project-setup/index.js +5 -5
  91. package/schematics/ng-add/schema.d.ts.map +1 -1
  92. package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.d.ts.map +1 -1
  93. package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js +40 -41
  94. package/schematics/ng-add/updates-for-v8/generators/update-generators-names.d.ts.map +1 -1
  95. package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js +25 -27
  96. package/schematics/ng-add/utils/linter/index.d.ts +8 -3
  97. package/schematics/ng-add/utils/linter/index.d.ts.map +1 -1
  98. package/schematics/ng-add/utils/linter/index.js +11 -5
  99. package/schematics/ng-add-create/index.d.ts +0 -2
  100. package/schematics/ng-add-create/index.d.ts.map +1 -1
  101. package/schematics/ng-add-create/index.js +9 -15
  102. package/schematics/ng-add-create/schema.d.ts.map +1 -1
  103. package/schematics/ng-update/index.d.ts.map +1 -1
  104. package/schematics/ng-update/index.js +5 -3
  105. package/schematics/ng-update/v10.0/configuration.d.ts.map +1 -1
  106. package/schematics/ng-update/v10.0/configuration.js +2 -2
  107. package/schematics/ng-update/v8.2/import-map.d.ts.map +1 -1
  108. package/schematics/page/index.d.ts.map +1 -1
  109. package/schematics/page/index.js +16 -16
  110. package/schematics/page/schema.d.ts.map +1 -1
  111. package/schematics/renovate/index.d.ts.map +1 -1
  112. package/schematics/renovate/schema.d.ts.map +1 -1
  113. package/schematics/rule-factories/additional-modules/index.d.ts.map +1 -1
  114. package/schematics/rule-factories/additional-modules/index.js +3 -3
  115. package/schematics/rule-factories/component/analytics.d.ts.map +1 -1
  116. package/schematics/rule-factories/component/common.d.ts +0 -1
  117. package/schematics/rule-factories/component/common.d.ts.map +1 -1
  118. package/schematics/rule-factories/component/common.js +18 -15
  119. package/schematics/rule-factories/component/configuration.d.ts.map +1 -1
  120. package/schematics/rule-factories/component/context.d.ts.map +1 -1
  121. package/schematics/rule-factories/component/design-token.d.ts.map +1 -1
  122. package/schematics/rule-factories/component/fixture.d.ts.map +1 -1
  123. package/schematics/rule-factories/component/localization.d.ts.map +1 -1
  124. package/schematics/rule-factories/component/rules-engine.d.ts.map +1 -1
  125. package/schematics/rule-factories/component/theming.d.ts.map +1 -1
  126. package/schematics/rule-factories/customization-environment/index.d.ts.map +1 -1
  127. package/schematics/rule-factories/customization-environment/index.js +5 -7
  128. package/schematics/rule-factories/index.d.ts +1 -1
  129. package/schematics/rule-factories/index.d.ts.map +1 -1
  130. package/schematics/rule-factories/index.js +1 -1
  131. package/schematics/rule-factories/o3r-basic-updates/index.d.ts +0 -1
  132. package/schematics/rule-factories/o3r-basic-updates/index.d.ts.map +1 -1
  133. package/schematics/rule-factories/o3r-basic-updates/index.js +7 -8
  134. package/schematics/rule-factories/otter-environment/index.d.ts +1 -2
  135. package/schematics/rule-factories/otter-environment/index.d.ts.map +1 -1
  136. package/schematics/rule-factories/otter-environment/index.js +16 -18
  137. package/schematics/rule-factories/store/index.d.ts +3 -4
  138. package/schematics/rule-factories/store/index.d.ts.map +1 -1
  139. package/schematics/rule-factories/store/index.js +7 -8
  140. package/schematics/schematics-update/index.d.ts.map +1 -1
  141. package/schematics/schematics-update/index.js +3 -3
  142. package/schematics/schematics-update/schema.d.ts.map +1 -1
  143. package/schematics/service/index.d.ts.map +1 -1
  144. package/schematics/service/index.js +3 -3
  145. package/schematics/service/schema.d.ts.map +1 -1
  146. package/schematics/shared/presets/all.preset.d.ts.map +1 -1
  147. package/schematics/shared/presets/all.preset.js +2 -3
  148. package/schematics/shared/presets/basic.preset.d.ts.map +1 -1
  149. package/schematics/shared/presets/cms.preset.d.ts +0 -1
  150. package/schematics/shared/presets/cms.preset.d.ts.map +1 -1
  151. package/schematics/shared/presets/cms.preset.js +1 -3
  152. package/schematics/shared/presets/external.preset.d.ts.map +1 -1
  153. package/schematics/shared/presets/external.preset.js +1 -1
  154. package/schematics/shared/presets/helpers.d.ts.map +1 -1
  155. package/schematics/shared/presets/helpers.js +10 -8
  156. package/schematics/shared/presets/index.d.ts +1 -1
  157. package/schematics/shared/presets/index.d.ts.map +1 -1
  158. package/schematics/shared/presets/index.js +1 -1
  159. package/schematics/shared/presets/preset.interface.d.ts +1 -1
  160. package/schematics/shared/presets/preset.interface.d.ts.map +1 -1
  161. package/schematics/show-modules/index.d.ts.map +1 -1
  162. package/schematics/show-modules/schema.d.ts.map +1 -1
  163. package/schematics/store/common/helpers.d.ts.map +1 -1
  164. package/schematics/store/common/schema.d.ts.map +1 -1
  165. package/schematics/store/entity-async/index.d.ts.map +1 -1
  166. package/schematics/store/entity-async/index.js +3 -4
  167. package/schematics/store/entity-async/schema.d.ts.map +1 -1
  168. package/schematics/store/entity-sync/index.d.ts.map +1 -1
  169. package/schematics/store/entity-sync/index.js +3 -4
  170. package/schematics/store/entity-sync/schema.d.ts.map +1 -1
  171. package/schematics/store/index.d.ts.map +1 -1
  172. package/schematics/store/index.js +10 -5
  173. package/schematics/store/schema.d.ts.map +1 -1
  174. package/schematics/store/simple-async/index.d.ts.map +1 -1
  175. package/schematics/store/simple-async/index.js +2 -3
  176. package/schematics/store/simple-async/schema.d.ts.map +1 -1
  177. package/schematics/store/simple-sync/index.d.ts.map +1 -1
  178. package/schematics/store/simple-sync/index.js +2 -4
  179. package/schematics/store/simple-sync/schema.d.ts.map +1 -1
  180. package/schematics/store-action/index.d.ts.map +1 -1
  181. package/schematics/store-action/index.js +26 -22
  182. package/schematics/store-action/schema.d.ts.map +1 -1
  183. package/store/async/async-entity.adapter.d.ts.map +1 -1
  184. package/store/async/async.adapter.d.ts.map +1 -1
  185. package/store/async/async.helpers.d.ts.map +1 -1
  186. package/store/async/async.interfaces.d.ts.map +1 -1
  187. package/store/async/async.operators.d.ts +1 -0
  188. package/store/async/async.operators.d.ts.map +1 -1
  189. package/store/async/async.props.d.ts.map +1 -1
  190. package/store/async/async.serializer.d.ts.map +1 -1
  191. package/store/async/index.d.ts +3 -3
  192. package/store/async/index.d.ts.map +1 -1
  193. package/store/types.d.ts +9 -7
  194. package/store/types.d.ts.map +1 -1
  195. package/utils/debug/debug.helper.d.ts.map +1 -1
  196. package/utils/deep-fill/deep-fill.d.ts.map +1 -1
  197. package/utils/rendering/rendering.helpers.d.ts +0 -1
  198. package/utils/rendering/rendering.helpers.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/utils/linter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,YAAmB,gBAAgB,KAAG,OAAO,CAAC,OAAO,CAe7F,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../schematics/ng-add/utils/linter/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAChB,KAAK,IAAI,EACV,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAU,IAAI,4DAAgF,CAAC;AAE7H;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,YAAmB,gBAAgB,QAAQ,IAAI,KAAG,OAAO,CAAC,OAAO,CAezG,CAAC"}
@@ -1,26 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shouldOtterLinterBeInstalled = void 0;
3
+ exports.shouldOtterLinterBeInstalled = exports.isUsingFlatConfig = void 0;
4
4
  const prompt_1 = require("@angular/cli/src/utilities/prompt");
5
+ /**
6
+ * If the ESLint FlatConfig is used in the repository
7
+ * @param tree
8
+ */
9
+ const isUsingFlatConfig = (tree) => tree.root.subfiles.find((file) => /eslint\.config\.{m,c,}[jt]s/.test(file));
10
+ exports.isUsingFlatConfig = isUsingFlatConfig;
5
11
  /**
6
12
  * Checks if `eslint` package is installed. If so, ask the user for otter linter rules install.
7
13
  * Otherwise displays a message to inform the user that otter linter rules can be added later.
8
- *
9
14
  * @param context Schematics context
15
+ * @param tree
10
16
  */
11
- const shouldOtterLinterBeInstalled = async (context) => {
17
+ const shouldOtterLinterBeInstalled = async (context, tree) => {
12
18
  const linterPackageName = 'eslint';
13
19
  let useOtterLinter = false;
14
20
  try {
15
21
  require.resolve(`${linterPackageName}/package.json`);
16
22
  if (context.interactive) {
17
23
  useOtterLinter = await (0, prompt_1.askConfirmation)(`You already have ESLint installed. Would you like to add otter config rules for ESLint?
18
- Otherwise, you can add them later via this command: ng add @o3r/eslint-config-otter`, true);
24
+ Otherwise, you can add them later via this command: ng add @o3r/eslint-config${(0, exports.isUsingFlatConfig)(tree) ? '' : '-otter'}`, true);
19
25
  }
20
26
  }
21
27
  catch {
22
28
  context.logger.info(`ESLint package not installed. Skipping Otter linter phase!
23
- You can add Otter linter config rules later to the project via this command: ng add @o3r/eslint-config-otter`);
29
+ You can add Otter linter config rules later to the project via this command: ng add @o3r/eslint-config`);
24
30
  }
25
31
  return useOtterLinter;
26
32
  };
@@ -2,13 +2,11 @@ import { Rule } from '@angular-devkit/schematics';
2
2
  import { NgGenerateUpdateSchematicsSchema } from './schema';
3
3
  /**
4
4
  * Rule factory to include `ng add` skeleton
5
- *
6
5
  * @param options
7
6
  */
8
7
  export declare const updateTemplates: (options: NgGenerateUpdateSchematicsSchema) => Rule;
9
8
  /**
10
9
  * add a new ngUpdate function
11
- *
12
10
  * @param options
13
11
  */
14
12
  export declare const ngAddCreate: (options: NgGenerateUpdateSchematicsSchema) => Rule;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAMvF,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAiE5D;;;;GAIG;AACH,eAAO,MAAM,eAAe,qDAA2D,CAAC;AAaxF;;;;GAIG;AACH,eAAO,MAAM,WAAW,qDAAuD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AASpC,OAAO,EACL,gCAAgC,EACjC,MAAM,UAAU,CAAC;AA6DlB;;;GAGG;AACH,eAAO,MAAM,eAAe,qDAA2D,CAAC;AAYxF;;;GAGG;AACH,eAAO,MAAM,WAAW,qDAAuD,CAAC"}
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAddCreate = exports.updateTemplates = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const path = require("node:path");
6
4
  const fs = require("node:fs");
5
+ const path = require("node:path");
6
+ const schematics_1 = require("@angular-devkit/schematics");
7
7
  const schematics_2 = require("@o3r/schematics");
8
- const schematics_3 = require("@angular-devkit/schematics");
9
8
  /**
10
9
  * Rule factory to include `ng add` skeleton
11
- *
12
10
  * @param options
13
11
  */
14
12
  function updateTemplatesFn(options) {
@@ -29,10 +27,9 @@ function updateTemplatesFn(options) {
29
27
  const otterVersion = o3rCorePackageJson.dependencies['@o3r/schematics'];
30
28
  const packageManagerRunner = (0, schematics_2.getPackageManagerRunner)();
31
29
  packageJson.scripts ||= {};
32
- packageJson.scripts['build:schematics'] =
33
- `tsc -b tsconfig.builders.json --pretty && ${packageManagerRunner} cpy 'schematics/**/*.json' dist/schematics && ${packageManagerRunner} cpy 'collection.json' dist`;
34
- // eslint-disable-next-line @typescript-eslint/dot-notation, dot-notation
35
- packageJson['schematics'] = './collection.json';
30
+ // eslint-disable-next-line @stylistic/max-len -- keep the command on the same line
31
+ packageJson.scripts['build:schematics'] = `tsc -b tsconfig.builders.json --pretty && ${packageManagerRunner} cpy 'schematics/**/*.json' dist/schematics && ${packageManagerRunner} cpy 'collection.json' dist`;
32
+ packageJson.schematics = './collection.json';
36
33
  packageJson.peerDependencies ||= {};
37
34
  packageJson.peerDependencies['@angular-devkit/schematics'] = angularVersion;
38
35
  packageJson.peerDependencies['@angular-devkit/core'] = angularVersion;
@@ -50,27 +47,25 @@ function updateTemplatesFn(options) {
50
47
  }
51
48
  // generate skeleton
52
49
  const featureName = options.name || path.basename(process.cwd());
53
- const templateSource = (0, schematics_3.apply)((0, schematics_3.url)('./templates'), [
54
- (0, schematics_3.template)({
50
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
51
+ (0, schematics_1.template)({
55
52
  featureName,
56
53
  tsconfigBuildPath: (0, schematics_2.findConfigFileRelativePath)(tree, ['tsconfig.build.json', 'tsconfig.base.json', 'tsconfig.json'], targetPath)
57
54
  }),
58
- (0, schematics_3.renameTemplateFiles)(),
55
+ (0, schematics_1.renameTemplateFiles)(),
59
56
  (0, schematics_1.move)(targetPath)
60
57
  ]);
61
- const rule = (0, schematics_3.mergeWith)(templateSource, schematics_3.MergeStrategy.AllowCreationConflict);
58
+ const rule = (0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.AllowCreationConflict);
62
59
  return rule(tree, context);
63
60
  };
64
61
  }
65
62
  /**
66
63
  * Rule factory to include `ng add` skeleton
67
- *
68
64
  * @param options
69
65
  */
70
66
  exports.updateTemplates = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateTemplatesFn);
71
67
  /**
72
68
  * add a new ngUpdate function
73
- *
74
69
  * @param options
75
70
  */
76
71
  function ngAddCreateFn(options) {
@@ -80,7 +75,6 @@ function ngAddCreateFn(options) {
80
75
  }
81
76
  /**
82
77
  * add a new ngUpdate function
83
- *
84
78
  * @param options
85
79
  */
86
80
  exports.ngAddCreate = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddCreateFn);
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,gCAAiC,SAAQ,qBAAqB;IAC7E,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAE3B"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add-create/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,gCAAiC,SAAQ,qBAAqB;IAC7E,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAE3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAmBjF;;GAEG;AACH,eAAO,MAAM,UAAU,4BAAsD,CAAC;AAkB9E;;GAEG;AACH,eAAO,MAAM,WAAW,4BAAuD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AA0BpC;;GAEG;AAEH,eAAO,MAAM,UAAU,4BAAsD,CAAC;AAkB9E;;GAEG;AAEH,eAAO,MAAM,WAAW,4BAAuD,CAAC"}
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/naming-convention */
3
- /* eslint-disable camelcase */
4
2
  Object.defineProperty(exports, "__esModule", { value: true });
5
3
  exports.updateV10_0 = exports.updateV8_2 = void 0;
6
4
  const schematics_1 = require("@angular-devkit/schematics");
7
5
  const schematics_2 = require("@o3r/schematics");
8
- const import_map_1 = require("./v8.2/import-map");
9
6
  const configuration_1 = require("./v10.0/configuration");
7
+ const import_map_1 = require("./v8.2/import-map");
10
8
  /**
11
9
  * Update of Otter library V8.2
12
10
  */
11
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
13
12
  function updateV8_2Fn() {
14
13
  return (tree, context) => {
15
14
  const updateRules = [
@@ -21,10 +20,12 @@ function updateV8_2Fn() {
21
20
  /**
22
21
  * Update of Otter library V8.2
23
22
  */
23
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
24
24
  exports.updateV8_2 = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateV8_2Fn);
25
25
  /**
26
26
  * Update of Otter library V10.0
27
27
  */
28
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
28
29
  function updateV10_0Fn() {
29
30
  return (tree, context) => {
30
31
  const updateRules = [
@@ -38,5 +39,6 @@ function updateV10_0Fn() {
38
39
  /**
39
40
  * Update of Otter library V10.0
40
41
  */
42
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
41
43
  exports.updateV10_0 = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateV10_0Fn);
42
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v10.0/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,4BAA4B,CAAC;AAK7D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,IAYjC,CAAC"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v10.0/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AAOpC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,IAYjC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateConfiguration = void 0;
4
4
  const schematics_1 = require("@o3r/schematics");
5
- const matchingRegex = /(Configuration)<\s*['"](?:strict|legacy)['"]\s*>/g;
5
+ const matchingRegex = /(Configuration)<\s*["'](?:strict|legacy)["']\s*>/g;
6
6
  /**
7
7
  * Rule to update the configuration declaration
8
8
  * As configuration cannot be legacy anymore,
@@ -14,7 +14,7 @@ const updateConfiguration = (tree) => {
14
14
  files.forEach((file) => {
15
15
  const text = tree.readText(file);
16
16
  const matches = Array.from(text.matchAll(matchingRegex));
17
- if (matches.length) {
17
+ if (matches.length > 0) {
18
18
  tree.overwrite(file, text.replaceAll(matchingRegex, '$1'));
19
19
  }
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v8.2/import-map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,EAAE,cAoCjC,CAAC"}
1
+ {"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v8.2/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,EAAE,cAoCjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA8F,IAAI,EAAoD,MAAM,4BAA4B,CAAC;AAehM,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AA6O1D;;;GAGG;AACH,eAAO,MAAM,cAAc,mDAA0D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AA0BpC,OAAO,EACL,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAsOlB;;;GAGG;AACH,eAAO,MAAM,cAAc,mDAA0D,CAAC"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngGeneratePage = void 0;
4
+ const path = require("node:path");
4
5
  const core_1 = require("@angular-devkit/core");
5
6
  const schematics_1 = require("@angular-devkit/schematics");
6
7
  const schematics_2 = require("@o3r/schematics");
7
- const path = require("node:path");
8
8
  const ts = require("typescript");
9
9
  const configuration_1 = require("../rule-factories/component/configuration");
10
- const theming_1 = require("../rule-factories/component/theming");
11
- const localization_1 = require("../rule-factories/component/localization");
12
10
  const fixture_1 = require("../rule-factories/component/fixture");
11
+ const localization_1 = require("../rule-factories/component/localization");
12
+ const theming_1 = require("../rule-factories/component/theming");
13
13
  /**
14
14
  * Add a Page to an Otter project
15
15
  * @param options
@@ -77,12 +77,14 @@ function ngGeneratePageFn(options) {
77
77
  type: 'Component',
78
78
  skipSelector: false,
79
79
  standalone: options.standalone,
80
- ...(options.standalone ? {
81
- skipImport: true
82
- } : {
83
- module: `${dasherizedPageName}.module.ts`,
84
- export: true
85
- }),
80
+ ...(options.standalone
81
+ ? {
82
+ skipImport: true
83
+ }
84
+ : {
85
+ module: `${dasherizedPageName}.module.ts`,
86
+ export: true
87
+ }),
86
88
  flat: true
87
89
  }),
88
90
  // Angular schematics generate spec file with this pattern: component-name.component.spec.ts
@@ -106,8 +108,7 @@ function ngGeneratePageFn(options) {
106
108
  path: componentPath,
107
109
  skipLinter: options.skipLinter,
108
110
  componentType: 'Page'
109
- }));
110
- rules.push((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
111
+ }), (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
111
112
  (0, schematics_1.template)({
112
113
  ...core_1.strings,
113
114
  ...options,
@@ -115,8 +116,7 @@ function ngGeneratePageFn(options) {
115
116
  }),
116
117
  (0, schematics_1.renameTemplateFiles)(),
117
118
  (0, schematics_1.move)(pagePath)
118
- ]), schematics_1.MergeStrategy.Overwrite));
119
- rules.push((0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, {
119
+ ]), schematics_1.MergeStrategy.Overwrite), (0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, {
120
120
  skipLinter: options.skipLinter,
121
121
  useComponentFixtures: options.usePageFixtures
122
122
  }, true));
@@ -131,7 +131,7 @@ function ngGeneratePageFn(options) {
131
131
  const indexFilePath = path.posix.join(core_1.strings.dasherize(options.scope), core_1.strings.dasherize(options.name), 'index');
132
132
  const route = {
133
133
  path: core_1.strings.dasherize(options.name),
134
- import: `./${indexFilePath.replace(/[\\/]/g, '/')}`,
134
+ import: `./${indexFilePath.replace(/[/\\]/g, '/')}`,
135
135
  module: `${pageName}${options.standalone ? 'Component' : 'Module'}`
136
136
  };
137
137
  if (options.appRoutingModulePath) {
@@ -140,7 +140,7 @@ function ngGeneratePageFn(options) {
140
140
  const appModuleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, options.projectName);
141
141
  if (appModuleFilePath) {
142
142
  const text = tree.readText(appModuleFilePath);
143
- const match = text.match(/(provideRouter|RouterModule\.forRoot)\((\s*)?(?<routeVarName>[^,\s)]*)/);
143
+ const match = text.match(/(provideRouter|RouterModule\.forRoot)\((\s*)?(?<routeVarName>[^\s),]*)/);
144
144
  const routeVariableName = match?.groups?.routeVarName;
145
145
  if (routeVariableName) {
146
146
  const sourceFile = ts.createSourceFile(appModuleFilePath, text, ts.ScriptTarget.ES2015, true);
@@ -149,7 +149,7 @@ function ngGeneratePageFn(options) {
149
149
  && ts.isStringLiteral(statement.moduleSpecifier)
150
150
  && !!statement.importClause?.namedBindings
151
151
  && ts.isNamedImports(statement.importClause.namedBindings)
152
- && statement.importClause.namedBindings.elements.some((element) => element.name.escapedText === routeVariableName));
152
+ && statement.importClause.namedBindings.elements.some((element) => element.name.escapedText.toString() === routeVariableName));
153
153
  const importRouteVariablePath = importStatement?.moduleSpecifier?.text;
154
154
  // If importRouteVariablePath is undefined it is because the variable is defined in this file
155
155
  const appRoutingModulePath = importRouteVariablePath ? path.join(path.dirname(appModuleFilePath), `${importRouteVariablePath}.ts`) : appModuleFilePath;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/page/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,8BAA+B,SAAQ,qBAAqB;IAC3E,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,sCAAsC;IACtC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,kEAAkE;IAClE,eAAe,EAAE,OAAO,CAAC;IAEzB,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IAExB,oDAAoD;IACpD,eAAe,EAAE,OAAO,CAAC;IAEzB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IAEpB,uCAAuC;IACvC,eAAe,EAAE,OAAO,CAAC;IAEzB,4BAA4B;IAC5B,aAAa,EAAE,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/page/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,8BAA+B,SAAQ,qBAAqB;IAC3E,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,sCAAsC;IACtC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,kEAAkE;IAClE,eAAe,EAAE,OAAO,CAAC;IAEzB,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IAExB,oDAAoD;IACpD,eAAe,EAAE,OAAO,CAAC;IAEzB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IAEpB,uCAAuC;IACvC,eAAe,EAAE,OAAO,CAAC;IAEzB,4BAA4B;IAC5B,aAAa,EAAE,OAAO,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAwD,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AAE/I,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AA0BjE;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0DAA0E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,qCAAqC,EACtC,MAAM,UAAU,CAAC;AAyBlB;;;GAGG;AACH,eAAO,MAAM,8BAA8B,0DAA0E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,qCAAsC,SAAQ,qBAAqB;IAClF,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/renovate/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,qCAAsC,SAAQ,qBAAqB;IAClF,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAczB;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,uBAAuB,EAAE,wBAAwB,GAAG,IAAI,CA6MrL"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/additional-modules/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAuBzB;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,uBAAuB,EAAE,wBAAwB,GAAG,IAAI,CA4MrL"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateAdditionalModules = updateAdditionalModules;
4
+ const fs = require("node:fs");
5
+ const path = require("node:path");
4
6
  const schematics_1 = require("@angular-devkit/schematics");
5
7
  const schematics_2 = require("@o3r/schematics");
6
- const ts = require("typescript");
7
8
  const utility_1 = require("@schematics/angular/utility");
8
9
  const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
9
10
  const change_1 = require("@schematics/angular/utility/change");
10
- const path = require("node:path");
11
- const fs = require("node:fs");
12
11
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
12
+ const ts = require("typescript");
13
13
  const packageJsonPath = path.resolve(__dirname, '..', '..', '..', 'package.json');
14
14
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));
15
15
  const ngrxStoreDevtoolsDep = '@ngrx/store-devtools';
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,oBAAoB,kBAChB,MAAM,WACZ,mCAAmC,KAC3C,IAaF,CAAC"}
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,oBAAoB,kBAChB,MAAM,WACZ,mCAAmC,KAC3C,IAaF,CAAC"}
@@ -2,7 +2,6 @@ import { Rule } from '@angular-devkit/schematics';
2
2
  /**
3
3
  * Ask questions to get rules to execute
4
4
  * or throw if the package is not installed
5
- *
6
5
  * @param path file path
7
6
  * @param optionName name of the option to setup
8
7
  * @param defaultApplyRule should the rule be applied by default
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,IAAI,EAAqC,MAAM,4BAA4B,CAAC;AAKrH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kDAAkD,SACvD,MAAM,cACA,MAAM,oBACA,OAAO,GAAG,IAAI,GAAG,SAAS,gBAC9B,MAAM,0BACI,MAAM,EAAE,eACnB,MAAM,iBACJ,MAAM,qBACH,GAAG,KACpB,IA6DF,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/common.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,IAAI,EAIL,MAAM,4BAA4B,CAAC;AAUpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kDAAkD,SACvD,MAAM,cACA,MAAM,oBACA,OAAO,GAAG,IAAI,GAAG,SAAS,gBAC9B,MAAM,0BACI,MAAM,EAAE,eACnB,MAAM,iBACJ,MAAM,qBACH,GAAG,KACpB,IAiEF,CAAC"}
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.askQuestionsToGetRulesOrThrowIfPackageNotAvailable = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
4
  const prompt_1 = require("@angular/cli/src/utilities/prompt");
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
6
  const schematics_2 = require("@o3r/schematics");
7
7
  /**
8
8
  * Ask questions to get rules to execute
9
9
  * or throw if the package is not installed
10
- *
11
10
  * @param path file path
12
11
  * @param optionName name of the option to setup
13
12
  * @param defaultApplyRule should the rule be applied by default
@@ -61,19 +60,23 @@ const askQuestionsToGetRulesOrThrowIfPackageNotAvailable = (path, optionName, de
61
60
  ...schematicOptions,
62
61
  path
63
62
  };
64
- return applyRule ? (0, schematics_1.chain)([
65
- packageName !== '@o3r/core'
66
- ? (0, schematics_1.externalSchematic)(packageName, schematicName, options)
67
- : (0, schematics_1.schematic)(schematicName, options),
68
- ...(alwaysApplyRule !== 'ask-again' ? [
69
- (0, schematics_2.setupSchematicsParamsForProject)(schematicsNameToUpdate.reduce((acc, schematicToUpdateName) => {
70
- acc[schematicToUpdateName] = {
71
- [optionName]: alwaysApplyRule === 'yes'
72
- };
73
- return acc;
74
- }, {}), options.projectName)
75
- ] : [])
76
- ]) : schematics_1.noop;
63
+ return applyRule
64
+ ? (0, schematics_1.chain)([
65
+ packageName === '@o3r/core'
66
+ ? (0, schematics_1.schematic)(schematicName, options)
67
+ : (0, schematics_1.externalSchematic)(packageName, schematicName, options),
68
+ ...(alwaysApplyRule === 'ask-again'
69
+ ? []
70
+ : [
71
+ (0, schematics_2.setupSchematicsParamsForProject)(schematicsNameToUpdate.reduce((acc, schematicToUpdateName) => {
72
+ acc[schematicToUpdateName] = {
73
+ [optionName]: alwaysApplyRule === 'yes'
74
+ };
75
+ return acc;
76
+ }, {}), options.projectName)
77
+ ])
78
+ ])
79
+ : schematics_1.noop;
77
80
  };
78
81
  };
79
82
  exports.askQuestionsToGetRulesOrThrowIfPackageNotAvailable = askQuestionsToGetRulesOrThrowIfPackageNotAvailable;
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,wBAAwB,kBACpB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,oBAAoB,CAAC,CAAC,KAC7K,IAcF,CAAC"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,wBAAwB,kBACpB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,oBAAoB,CAAC,CAAC,KAC7K,IAcF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,kBAAkB,kBACd,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,YAAY,GAAG,YAAY,CAAC,KAC9E,IAYF,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,kBAAkB,kBACd,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,YAAY,GAAG,YAAY,CAAC,KAC9E,IAYF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"design-token.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/design-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,sBAAsB,oBAChB,MAAM,aACZ,MAAM,WACR,IAAI,CAAC,mCAAmC,EAAE,qBAAqB,CAAC,KACxE,IAYF,CAAC"}
1
+ {"version":3,"file":"design-token.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/design-token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,sBAAsB,oBAChB,MAAM,aACZ,MAAM,WACR,IAAI,CAAC,mCAAmC,EAAE,qBAAqB,CAAC,KACxE,IAYF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,kBAAkB,kBACd,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,sBAAsB,GAAG,YAAY,CAAC,uBAExF,IAaF,CAAC"}
1
+ {"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,kBAAkB,kBACd,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,sBAAsB,GAAG,YAAY,CAAC,uBAExF,IAaF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/localization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,uBAAuB,kBACnB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,iBAAiB,GAAG,YAAY,GAAG,eAAe,CAAC,KACrG,IAaF,CAAC"}
1
+ {"version":3,"file":"localization.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/localization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,uBAAuB,kBACnB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,iBAAiB,GAAG,YAAY,GAAG,eAAe,CAAC,KACrG,IAaF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules-engine.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/rules-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,sBAAsB,kBAClB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,oBAAoB,CAAC,KACzH,IAaF,CAAC"}
1
+ {"version":3,"file":"rules-engine.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/rules-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,sBAAsB,kBAClB,MAAM,WACZ,IAAI,CAAC,mCAAmC,EAAE,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,oBAAoB,CAAC,KACzH,IAaF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/theming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAGlF,eAAO,MAAM,kBAAkB,cAClB,MAAM,WACR,IAAI,CAAC,mCAAmC,EAAE,iBAAiB,CAAC,KACpE,IAQF,CAAC"}
1
+ {"version":3,"file":"theming.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/component/theming.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,mCAAmC,EACpC,MAAM,wBAAwB,CAAC;AAKhC,eAAO,MAAM,kBAAkB,cAClB,MAAM,WACR,IAAI,CAAC,mCAAmC,EAAE,iBAAiB,CAAC,KACpE,IAQF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAUpC;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAkGnK"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/customization-environment/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAOL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAoBpC;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAoGnK"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateCustomizationEnvironment = updateCustomizationEnvironment;
4
+ const node_path_1 = require("node:path");
4
5
  const schematics_1 = require("@angular-devkit/schematics");
5
6
  const schematics_2 = require("@o3r/schematics");
6
7
  const utility_1 = require("@schematics/angular/utility");
7
8
  const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
8
9
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
9
- const node_path_1 = require("node:path");
10
10
  /**
11
11
  * Enable customization capabilities
12
12
  * @param rootPath @see RuleFactory.rootPath
@@ -22,7 +22,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
22
22
  * @param context
23
23
  */
24
24
  const generateC11nFolder = (tree, context) => {
25
- const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
25
+ const workingDirectory = (options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
26
26
  if (tree.exists(node_path_1.posix.join(workingDirectory, 'src', 'customization', 'presenters-map.empty.ts'))) {
27
27
  return tree;
28
28
  }
@@ -48,7 +48,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
48
48
  if ((0, ast_utils_1.isImported)(fileInfo.sourceFile, 'C11nModule', '@otter/common') || (0, ast_utils_1.isImported)(fileInfo.sourceFile, 'C11nModule', '@o3r/components')) {
49
49
  return tree;
50
50
  }
51
- const fileContent = tree.readText(fileInfo.moduleFilePath).replace(/[\r\n ]*/g, '');
51
+ const fileContent = tree.readText(fileInfo.moduleFilePath).replace(/\s*/g, '');
52
52
  const recorder = tree.beginUpdate(fileInfo.moduleFilePath);
53
53
  const moduleIndex = fileInfo.moduleIndex;
54
54
  /**
@@ -70,9 +70,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
70
70
  updatedRecorder = insertImportToModuleFile(updatedRecorder, 'registerCustomComponents', '../customization/presenters-map.empty');
71
71
  updatedRecorder = insertImportToModuleFile(updatedRecorder, 'Provider', '@angular/core');
72
72
  updatedRecorder = insertImportToModuleFile(updatedRecorder, 'initializeCustomProviders', '../customization/custom-providers.empty');
73
- additionalRules.push((0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `...entry.customComponentsModules`));
74
- additionalRules.push((0, utility_1.addRootProvider)(options?.projectName, ({ code }) => code `...customProviders`));
75
- additionalRules.push((0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `C11nModule.forRoot({registerCompFunc: registerCustomComponents})`));
73
+ additionalRules.push((0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `...entry.customComponentsModules`), (0, utility_1.addRootProvider)(options?.projectName, ({ code }) => code `...customProviders`), (0, utility_1.addRootImport)(options?.projectName, ({ code }) => code `C11nModule.forRoot({registerCompFunc: registerCustomComponents})`));
76
74
  updatedRecorder = insertImportToModuleFile(updatedRecorder, 'C11nModule', '@o3r/components');
77
75
  updatedRecorder = insertBeforeModule(updatedRecorder, 'const entry = initializeEntryComponents();');
78
76
  updatedRecorder = insertBeforeModule(updatedRecorder, 'const customProviders: Provider[] = initializeCustomProviders();');
@@ -80,7 +78,7 @@ function updateCustomizationEnvironment(rootPath, o3rCoreVersion, options, isLib
80
78
  return (0, schematics_1.chain)(additionalRules)(tree, context);
81
79
  };
82
80
  return (tree, _context) => {
83
- const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
81
+ const workingDirectory = (options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
84
82
  return (0, schematics_1.chain)([
85
83
  generateC11nFolder,
86
84
  registerModules,
@@ -1,6 +1,6 @@
1
- export * from './o3r-basic-updates/index';
2
1
  export * from './additional-modules/index';
3
2
  export * from './customization-environment/index';
3
+ export * from './o3r-basic-updates/index';
4
4
  export * from './otter-environment/index';
5
5
  export * from './store/index';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./o3r-basic-updates/index"), exports);
5
4
  tslib_1.__exportStar(require("./additional-modules/index"), exports);
6
5
  tslib_1.__exportStar(require("./customization-environment/index"), exports);
6
+ tslib_1.__exportStar(require("./o3r-basic-updates/index"), exports);
7
7
  tslib_1.__exportStar(require("./otter-environment/index"), exports);
8
8
  tslib_1.__exportStar(require("./store/index"), exports);
9
9
  //# sourceMappingURL=index.js.map
@@ -3,7 +3,6 @@ import { WorkspaceProject } from '@o3r/schematics';
3
3
  /**
4
4
  * Package.json updates to include o3r ng update script
5
5
  * @param pName project name
6
- * @param o3rCoreVersion
7
6
  * @param _o3rCoreVersion
8
7
  * @param projectType
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/o3r-basic-updates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,IAAI,CAqC/I"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/rule-factories/o3r-basic-updates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAezB;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,IAAI,CAyB/I"}
@@ -2,21 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.o3rBasicUpdates = o3rBasicUpdates;
4
4
  const schematics_1 = require("@o3r/schematics");
5
+ const ngUpdateScript = (tree, packageJsonObj, packageJsonPath = '/package.json') => {
6
+ if (!packageJsonObj.scripts) {
7
+ packageJsonObj.scripts = {};
8
+ }
9
+ packageJsonObj.scripts['update:otter'] = 'ng update @o3r/core';
10
+ tree.overwrite(packageJsonPath, JSON.stringify(packageJsonObj, null, 2));
11
+ };
5
12
  /**
6
13
  * Package.json updates to include o3r ng update script
7
14
  * @param pName project name
8
- * @param o3rCoreVersion
9
15
  * @param _o3rCoreVersion
10
16
  * @param projectType
11
17
  */
12
18
  function o3rBasicUpdates(pName, _o3rCoreVersion, projectType) {
13
- const ngUpdateScript = (tree, packageJsonObj, packageJsonPath = '/package.json') => {
14
- if (!packageJsonObj.scripts) {
15
- packageJsonObj.scripts = {};
16
- }
17
- packageJsonObj.scripts['update:otter'] = 'ng update @o3r/core';
18
- tree.overwrite(packageJsonPath, JSON.stringify(packageJsonObj, null, 2));
19
- };
20
19
  return (tree, context) => {
21
20
  const workspace = (0, schematics_1.getWorkspaceConfig)(tree);
22
21
  if (!workspace) {
@@ -2,13 +2,12 @@ import { Rule } from '@angular-devkit/schematics';
2
2
  /**
3
3
  * Update Otter environment variable for schematics
4
4
  * @param options @see RuleFactory.options
5
- * @param rootPath @see RuleFactory.rootPath
6
5
  * @param options.projectName
7
6
  * @param options.enableStorybook
8
7
  * @param options.enableStyling
9
8
  * @param options.enableAnalytics
10
9
  * @param options.workingDirectory
11
- * @param _rootPath
10
+ * @param _rootPath @see RuleFactory.rootPath
12
11
  */
13
12
  export declare function updateOtterEnvironmentAdapter(options: {
14
13
  projectName?: string | null | undefined;