@o3r/core 14.0.0-next.2 → 14.0.0-next.4

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 (331) hide show
  1. package/README.md +1 -1
  2. package/fesm2022/o3r-core.mjs.map +1 -1
  3. package/index.d.ts.map +1 -1
  4. package/migration.json +5 -0
  5. package/package.json +28 -25
  6. package/schematics/component/container/index.d.ts.map +1 -1
  7. package/schematics/component/container/index.js +22 -35
  8. package/schematics/component/container/schema.d.ts +2 -0
  9. package/schematics/component/container/schema.d.ts.map +1 -1
  10. package/schematics/component/container/schema.json +4 -0
  11. package/schematics/component/container/templates/index.ts.template +2 -2
  12. package/schematics/component/presenter/index.d.ts.map +1 -1
  13. package/schematics/component/presenter/index.js +10 -39
  14. package/schematics/component/presenter/schema.d.ts +2 -0
  15. package/schematics/component/presenter/schema.d.ts.map +1 -1
  16. package/schematics/component/presenter/schema.json +4 -0
  17. package/schematics/component/presenter/templates/index.ts.template +2 -2
  18. package/schematics/component/schema.d.ts +2 -0
  19. package/schematics/component/schema.d.ts.map +1 -1
  20. package/schematics/component/schema.json +4 -0
  21. package/schematics/component/templates/fixtures.ts.template +2 -2
  22. package/schematics/context-to-component/index.d.ts.map +1 -1
  23. package/schematics/context-to-component/index.js +8 -6
  24. package/schematics/ng-add/component-decorator/index.js +1 -1
  25. package/schematics/ng-add/index.d.ts.map +1 -1
  26. package/schematics/ng-add/index.js +0 -7
  27. package/schematics/ng-add-create/templates/schematics/ng-add/index.ts.template +1 -1
  28. package/schematics/ng-update/index.d.ts +4 -0
  29. package/schematics/ng-update/index.d.ts.map +1 -1
  30. package/schematics/ng-update/index.js +5 -1
  31. package/schematics/page/index.d.ts.map +1 -1
  32. package/schematics/page/index.js +11 -34
  33. package/schematics/page/schema.d.ts +2 -0
  34. package/schematics/page/schema.d.ts.map +1 -1
  35. package/schematics/page/schema.json +4 -0
  36. package/schematics/page/templates/index.ts.template +1 -1
  37. package/schematics/service/index.d.ts.map +1 -1
  38. package/schematics/service/index.js +14 -2
  39. package/schematics/service/schema.d.ts +4 -0
  40. package/schematics/service/schema.d.ts.map +1 -1
  41. package/schematics/service/schema.json +9 -0
  42. package/schematics/service/templates/base/__name__/__featureName__/{__name__.__featureName__.service.spec.ts.template → __name__-__featureName__.spec.ts.template} +1 -1
  43. package/schematics/service/templates/base/__name__/__featureName__/{__name__.__featureName__.service.ts.template → __name__-__featureName__.ts.template} +1 -1
  44. package/schematics/service/templates/base/__name__/__featureName__/index.ts.template +2 -2
  45. package/schematics/service/templates/jasmine-core/__name__/fixture/jasmine/index.ts.template +2 -2
  46. package/schematics/service/templates/jest/__name__/fixture/jest/index.ts.template +2 -2
  47. package/schematics/shared/presets/{all.preset.d.ts → all-preset.d.ts} +2 -2
  48. package/schematics/shared/presets/all-preset.d.ts.map +1 -0
  49. package/schematics/shared/presets/{all.preset.js → all-preset.js} +1 -1
  50. package/schematics/shared/presets/{basic.preset.d.ts → basic-preset.d.ts} +1 -1
  51. package/schematics/shared/presets/basic-preset.d.ts.map +1 -0
  52. package/schematics/shared/presets/{basic.preset.js → basic-preset.js} +1 -1
  53. package/schematics/shared/presets/{cms.preset.d.ts → cms-preset.d.ts} +2 -2
  54. package/schematics/shared/presets/cms-preset.d.ts.map +1 -0
  55. package/schematics/shared/presets/{cms.preset.js → cms-preset.js} +1 -1
  56. package/schematics/shared/presets/{external.preset.d.ts → external-preset.d.ts} +2 -2
  57. package/schematics/shared/presets/{external.preset.d.ts.map → external-preset.d.ts.map} +1 -1
  58. package/schematics/shared/presets/{external.preset.js → external-preset.js} +1 -1
  59. package/schematics/shared/presets/helpers.d.ts +1 -1
  60. package/schematics/shared/presets/index.d.ts +3 -3
  61. package/schematics/shared/presets/index.js +6 -6
  62. package/schematics/shared/presets/{preset.interface.d.ts → preset-interface.d.ts} +1 -1
  63. package/schematics/shared/presets/{preset.interface.d.ts.map → preset-interface.d.ts.map} +1 -1
  64. package/schematics/shared/presets/{preset.interface.js → preset-interface.js} +1 -1
  65. package/schematics/shared/presets/{recommended.preset.d.ts → recommended-preset.d.ts} +2 -2
  66. package/schematics/shared/presets/recommended-preset.d.ts.map +1 -0
  67. package/schematics/shared/presets/{recommended.preset.js → recommended-preset.js} +1 -1
  68. package/schematics/store/common/templates/index.ts.template +1 -1
  69. package/builders/app-version/index.js.map +0 -1
  70. package/builders/app-version/schema.js.map +0 -1
  71. package/builders/lib-build/index.js.map +0 -1
  72. package/builders/lib-build/schema.js.map +0 -1
  73. package/builders/multi-watcher/index.js.map +0 -1
  74. package/builders/multi-watcher/schema.js.map +0 -1
  75. package/builders/ngc/index.js.map +0 -1
  76. package/builders/ngc/schema.js.map +0 -1
  77. package/builders/pattern-replacement/index.js.map +0 -1
  78. package/builders/pattern-replacement/schema.js.map +0 -1
  79. package/builders/run-script/index.js.map +0 -1
  80. package/builders/run-script/schema.js.map +0 -1
  81. package/builders/utils.js.map +0 -1
  82. package/core/application/build-properties.d.ts +0 -50
  83. package/core/application/build-properties.d.ts.map +0 -1
  84. package/core/application/build-properties.js +0 -17
  85. package/core/application/build-properties.js.map +0 -1
  86. package/core/application/dgp.interfaces.d.ts +0 -35
  87. package/core/application/dgp.interfaces.d.ts.map +0 -1
  88. package/core/application/dgp.interfaces.js +0 -2
  89. package/core/application/dgp.interfaces.js.map +0 -1
  90. package/core/application/index.d.ts +0 -4
  91. package/core/application/index.d.ts.map +0 -1
  92. package/core/application/index.js +0 -4
  93. package/core/application/index.js.map +0 -1
  94. package/core/application/runtime.d.ts +0 -14
  95. package/core/application/runtime.d.ts.map +0 -1
  96. package/core/application/runtime.js +0 -2
  97. package/core/application/runtime.js.map +0 -1
  98. package/core/common/index.d.ts +0 -3
  99. package/core/common/index.d.ts.map +0 -1
  100. package/core/common/index.js +0 -3
  101. package/core/common/index.js.map +0 -1
  102. package/core/common/interface-utils.d.ts +0 -7
  103. package/core/common/interface-utils.d.ts.map +0 -1
  104. package/core/common/interface-utils.js +0 -2
  105. package/core/common/interface-utils.js.map +0 -1
  106. package/core/common/label-value.d.ts +0 -8
  107. package/core/common/label-value.d.ts.map +0 -1
  108. package/core/common/label-value.js +0 -2
  109. package/core/common/label-value.js.map +0 -1
  110. package/core/devkit/devtools.interface.d.ts +0 -34
  111. package/core/devkit/devtools.interface.d.ts.map +0 -1
  112. package/core/devkit/devtools.interface.js +0 -2
  113. package/core/devkit/devtools.interface.js.map +0 -1
  114. package/core/devkit/index.d.ts +0 -2
  115. package/core/devkit/index.d.ts.map +0 -1
  116. package/core/devkit/index.js +0 -2
  117. package/core/devkit/index.js.map +0 -1
  118. package/core/index.d.ts +0 -7
  119. package/core/index.d.ts.map +0 -1
  120. package/core/index.js +0 -7
  121. package/core/index.js.map +0 -1
  122. package/core/interfaces/configuration.d.ts +0 -90
  123. package/core/interfaces/configuration.d.ts.map +0 -1
  124. package/core/interfaces/configuration.js +0 -2
  125. package/core/interfaces/configuration.js.map +0 -1
  126. package/core/interfaces/context.d.ts +0 -57
  127. package/core/interfaces/context.d.ts.map +0 -1
  128. package/core/interfaces/context.js +0 -2
  129. package/core/interfaces/context.js.map +0 -1
  130. package/core/interfaces/index.d.ts +0 -5
  131. package/core/interfaces/index.d.ts.map +0 -1
  132. package/core/interfaces/index.js +0 -5
  133. package/core/interfaces/index.js.map +0 -1
  134. package/core/interfaces/item-identifier.d.ts +0 -14
  135. package/core/interfaces/item-identifier.d.ts.map +0 -1
  136. package/core/interfaces/item-identifier.js +0 -2
  137. package/core/interfaces/item-identifier.js.map +0 -1
  138. package/core/interfaces/translation.d.ts +0 -7
  139. package/core/interfaces/translation.d.ts.map +0 -1
  140. package/core/interfaces/translation.js +0 -2
  141. package/core/interfaces/translation.js.map +0 -1
  142. package/core/metadata/component.decorator.d.ts +0 -32
  143. package/core/metadata/component.decorator.d.ts.map +0 -1
  144. package/core/metadata/component.decorator.js +0 -18
  145. package/core/metadata/component.decorator.js.map +0 -1
  146. package/core/metadata/component.identifier.d.ts +0 -7
  147. package/core/metadata/component.identifier.d.ts.map +0 -1
  148. package/core/metadata/component.identifier.js +0 -9
  149. package/core/metadata/component.identifier.js.map +0 -1
  150. package/core/metadata/index.d.ts +0 -4
  151. package/core/metadata/index.d.ts.map +0 -1
  152. package/core/metadata/index.js +0 -4
  153. package/core/metadata/index.js.map +0 -1
  154. package/core/metadata/metadata.interface.d.ts +0 -10
  155. package/core/metadata/metadata.interface.d.ts.map +0 -1
  156. package/core/metadata/metadata.interface.js +0 -2
  157. package/core/metadata/metadata.interface.js.map +0 -1
  158. package/core/rules-engine/index.d.ts +0 -2
  159. package/core/rules-engine/index.d.ts.map +0 -1
  160. package/core/rules-engine/index.js +0 -2
  161. package/core/rules-engine/index.js.map +0 -1
  162. package/core/rules-engine/rules-engine.interfaces.d.ts +0 -24
  163. package/core/rules-engine/rules-engine.interfaces.d.ts.map +0 -1
  164. package/core/rules-engine/rules-engine.interfaces.js +0 -2
  165. package/core/rules-engine/rules-engine.interfaces.js.map +0 -1
  166. package/log/index.d.ts +0 -2
  167. package/log/index.d.ts.map +0 -1
  168. package/log/index.js +0 -2
  169. package/log/index.js.map +0 -1
  170. package/log/logger.d.ts +0 -36
  171. package/log/logger.d.ts.map +0 -1
  172. package/log/logger.js +0 -2
  173. package/log/logger.js.map +0 -1
  174. package/messages/common-message.interface.d.ts +0 -17
  175. package/messages/common-message.interface.d.ts.map +0 -1
  176. package/messages/common-message.interface.js +0 -2
  177. package/messages/common-message.interface.js.map +0 -1
  178. package/messages/index.d.ts +0 -4
  179. package/messages/index.d.ts.map +0 -1
  180. package/messages/index.js +0 -4
  181. package/messages/index.js.map +0 -1
  182. package/messages/message.helpers.d.ts +0 -24
  183. package/messages/message.helpers.d.ts.map +0 -1
  184. package/messages/message.helpers.js +0 -54
  185. package/messages/message.helpers.js.map +0 -1
  186. package/messages/message.interfaces.d.ts +0 -26
  187. package/messages/message.interfaces.d.ts.map +0 -1
  188. package/messages/message.interfaces.js +0 -5
  189. package/messages/message.interfaces.js.map +0 -1
  190. package/public_api.d.ts +0 -6
  191. package/public_api.d.ts.map +0 -1
  192. package/public_api.js +0 -6
  193. package/public_api.js.map +0 -1
  194. package/schematics/add-modules/index.js.map +0 -1
  195. package/schematics/add-modules/schema.js.map +0 -1
  196. package/schematics/component/container/index.js.map +0 -1
  197. package/schematics/component/container/schema.js.map +0 -1
  198. package/schematics/component/index.js.map +0 -1
  199. package/schematics/component/presenter/index.js.map +0 -1
  200. package/schematics/component/presenter/schema.js.map +0 -1
  201. package/schematics/component/schema.js.map +0 -1
  202. package/schematics/component/structures.types.js.map +0 -1
  203. package/schematics/context-to-component/index.js.map +0 -1
  204. package/schematics/context-to-component/schema.js.map +0 -1
  205. package/schematics/convert-component/index.js.map +0 -1
  206. package/schematics/convert-component/schema.js.map +0 -1
  207. package/schematics/ng-add/component-decorator/index.js.map +0 -1
  208. package/schematics/ng-add/index.js.map +0 -1
  209. package/schematics/ng-add/project-setup/index.js.map +0 -1
  210. package/schematics/ng-add/schema.js.map +0 -1
  211. package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js.map +0 -1
  212. package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js.map +0 -1
  213. package/schematics/ng-add/updates-for-v8/replaced-packages.js.map +0 -1
  214. package/schematics/ng-add-create/index.js.map +0 -1
  215. package/schematics/ng-add-create/schema.js.map +0 -1
  216. package/schematics/ng-update/index.js.map +0 -1
  217. package/schematics/ng-update/v10.0/configuration.js.map +0 -1
  218. package/schematics/ng-update/v8.2/import-map.js.map +0 -1
  219. package/schematics/page/index.js.map +0 -1
  220. package/schematics/page/schema.js.map +0 -1
  221. package/schematics/renovate/index.js.map +0 -1
  222. package/schematics/renovate/schema.js.map +0 -1
  223. package/schematics/rule-factories/additional-modules/index.js.map +0 -1
  224. package/schematics/rule-factories/component/analytics.js.map +0 -1
  225. package/schematics/rule-factories/component/common.js.map +0 -1
  226. package/schematics/rule-factories/component/configuration.js.map +0 -1
  227. package/schematics/rule-factories/component/context.js.map +0 -1
  228. package/schematics/rule-factories/component/design-token.js.map +0 -1
  229. package/schematics/rule-factories/component/fixture.js.map +0 -1
  230. package/schematics/rule-factories/component/localization.js.map +0 -1
  231. package/schematics/rule-factories/component/rules-engine.js.map +0 -1
  232. package/schematics/rule-factories/component/theming.js.map +0 -1
  233. package/schematics/rule-factories/customization-environment/index.js.map +0 -1
  234. package/schematics/rule-factories/index.js.map +0 -1
  235. package/schematics/rule-factories/o3r-basic-updates/index.js.map +0 -1
  236. package/schematics/rule-factories/otter-environment/index.js.map +0 -1
  237. package/schematics/rule-factories/store/index.js.map +0 -1
  238. package/schematics/rule-factories/update-package-json/index.js.map +0 -1
  239. package/schematics/schematics-update/index.js.map +0 -1
  240. package/schematics/schematics-update/schema.js.map +0 -1
  241. package/schematics/service/index.js.map +0 -1
  242. package/schematics/service/schema.js.map +0 -1
  243. package/schematics/shared/presets/all.preset.d.ts.map +0 -1
  244. package/schematics/shared/presets/all.preset.js.map +0 -1
  245. package/schematics/shared/presets/basic.preset.d.ts.map +0 -1
  246. package/schematics/shared/presets/basic.preset.js.map +0 -1
  247. package/schematics/shared/presets/cms.preset.d.ts.map +0 -1
  248. package/schematics/shared/presets/cms.preset.js.map +0 -1
  249. package/schematics/shared/presets/external.preset.js.map +0 -1
  250. package/schematics/shared/presets/helpers.js.map +0 -1
  251. package/schematics/shared/presets/index.js.map +0 -1
  252. package/schematics/shared/presets/preset.interface.js.map +0 -1
  253. package/schematics/shared/presets/recommended.preset.d.ts.map +0 -1
  254. package/schematics/shared/presets/recommended.preset.js.map +0 -1
  255. package/schematics/show-modules/index.js.map +0 -1
  256. package/schematics/show-modules/schema.js.map +0 -1
  257. package/schematics/store/common/helpers.js.map +0 -1
  258. package/schematics/store/common/schema.js.map +0 -1
  259. package/schematics/store/entity-async/index.js.map +0 -1
  260. package/schematics/store/entity-async/schema.js.map +0 -1
  261. package/schematics/store/entity-sync/index.js.map +0 -1
  262. package/schematics/store/entity-sync/schema.js.map +0 -1
  263. package/schematics/store/index.js.map +0 -1
  264. package/schematics/store/schema.js.map +0 -1
  265. package/schematics/store/simple-async/index.js.map +0 -1
  266. package/schematics/store/simple-async/schema.js.map +0 -1
  267. package/schematics/store/simple-sync/index.js.map +0 -1
  268. package/schematics/store/simple-sync/schema.js.map +0 -1
  269. package/schematics/store-action/index.js.map +0 -1
  270. package/schematics/store-action/schema.js.map +0 -1
  271. package/store/async/async-entity.adapter.d.ts +0 -62
  272. package/store/async/async-entity.adapter.d.ts.map +0 -1
  273. package/store/async/async-entity.adapter.js +0 -49
  274. package/store/async/async-entity.adapter.js.map +0 -1
  275. package/store/async/async.adapter.d.ts +0 -91
  276. package/store/async/async.adapter.d.ts.map +0 -1
  277. package/store/async/async.adapter.js +0 -94
  278. package/store/async/async.adapter.js.map +0 -1
  279. package/store/async/async.helpers.d.ts +0 -17
  280. package/store/async/async.helpers.d.ts.map +0 -1
  281. package/store/async/async.helpers.js +0 -25
  282. package/store/async/async.helpers.js.map +0 -1
  283. package/store/async/async.interfaces.d.ts +0 -91
  284. package/store/async/async.interfaces.d.ts.map +0 -1
  285. package/store/async/async.interfaces.js +0 -2
  286. package/store/async/async.interfaces.js.map +0 -1
  287. package/store/async/async.operators.d.ts +0 -22
  288. package/store/async/async.operators.d.ts.map +0 -1
  289. package/store/async/async.operators.js +0 -75
  290. package/store/async/async.operators.js.map +0 -1
  291. package/store/async/async.props.d.ts +0 -7
  292. package/store/async/async.props.d.ts.map +0 -1
  293. package/store/async/async.props.js +0 -10
  294. package/store/async/async.props.js.map +0 -1
  295. package/store/async/async.serializer.d.ts +0 -29
  296. package/store/async/async.serializer.d.ts.map +0 -1
  297. package/store/async/async.serializer.js +0 -34
  298. package/store/async/async.serializer.js.map +0 -1
  299. package/store/async/index.d.ts +0 -8
  300. package/store/async/index.d.ts.map +0 -1
  301. package/store/async/index.js +0 -8
  302. package/store/async/index.js.map +0 -1
  303. package/store/index.d.ts +0 -3
  304. package/store/index.d.ts.map +0 -1
  305. package/store/index.js +0 -3
  306. package/store/index.js.map +0 -1
  307. package/store/types.d.ts +0 -95
  308. package/store/types.d.ts.map +0 -1
  309. package/store/types.js +0 -11
  310. package/store/types.js.map +0 -1
  311. package/utils/debug/debug.helper.d.ts +0 -14
  312. package/utils/debug/debug.helper.d.ts.map +0 -1
  313. package/utils/debug/debug.helper.js +0 -19
  314. package/utils/debug/debug.helper.js.map +0 -1
  315. package/utils/deep-fill/deep-fill.d.ts +0 -37
  316. package/utils/deep-fill/deep-fill.d.ts.map +0 -1
  317. package/utils/deep-fill/deep-fill.js +0 -71
  318. package/utils/deep-fill/deep-fill.js.map +0 -1
  319. package/utils/index.d.ts +0 -4
  320. package/utils/index.d.ts.map +0 -1
  321. package/utils/index.js +0 -4
  322. package/utils/index.js.map +0 -1
  323. package/utils/rendering/rendering.helpers.d.ts +0 -10
  324. package/utils/rendering/rendering.helpers.d.ts.map +0 -1
  325. package/utils/rendering/rendering.helpers.js +0 -31
  326. package/utils/rendering/rendering.helpers.js.map +0 -1
  327. /package/schematics/context-to-component/templates/{__name__.context.ts.template → __name__-context.ts.template} +0 -0
  328. /package/schematics/service/templates/base/__name__/__featureName__/{__name__.__featureName__.module.ts.template → __name__-__featureName__-module.ts.template} +0 -0
  329. /package/schematics/service/templates/jasmine-core/__name__/fixture/jasmine/{__name__.__featureName__.fixture.jasmine.ts.template → __name__-__featureName__-fixture-jasmine.ts.template} +0 -0
  330. /package/schematics/service/templates/jest/__name__/fixture/jest/{__name__.__featureName__.fixture.jest.ts.template → __name__-__featureName__-fixture-jest.ts.template} +0 -0
  331. /package/schematics/store/common/templates/{__storeName@dasherize__.module.ts.template → __storeName@dasherize__-module.ts.template} +0 -0
@@ -25,11 +25,11 @@ const getTemplateProperties = (options, componentStructureDef, prefix) => {
25
25
  const structure = componentStructureDef === structures_types_1.ComponentStructureDef.Simple ? '' : componentStructureDef;
26
26
  return {
27
27
  ...options,
28
- componentName: (0, schematics_2.getComponentName)(inputComponentName, structure).replace(/Component$/, ''),
28
+ componentName: (0, schematics_2.getComponentBaseName)(inputComponentName, structure),
29
29
  componentSelector: (0, schematics_2.getComponentSelectorWithoutSuffix)(options.componentName, prefix || null),
30
30
  projectName: options.projectName || (0, schematics_2.getLibraryNameFromPath)(options.path),
31
31
  folderName,
32
- name: (0, schematics_2.getComponentFileName)(options.componentName, structure),
32
+ name: (0, schematics_2.getComponentFileName)(options.componentName, structure, options.type),
33
33
  suffix: structure.toLowerCase(),
34
34
  description: options.description || ''
35
35
  };
@@ -44,15 +44,10 @@ function ngGenerateComponentPresenterFn(options) {
44
44
  const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
45
45
  const properties = getTemplateProperties(options, options.componentStructure === 'simple' ? structures_types_1.ComponentStructureDef.Simple : structures_types_1.ComponentStructureDef.Pres, options.prefix || workspaceProject?.prefix);
46
46
  const destination = (0, schematics_2.getDestinationPath)('@o3r/core:component', options.path, tree, options.projectName);
47
- const componentDestination = path.posix.join(destination, fullStructureRequested ? path.posix.join(properties.folderName, exports.PRESENTER_FOLDER) : properties.folderName);
48
- const componentPath = path.posix.join(componentDestination, `${properties.name}.component.ts`);
49
- const ngSpecPath = path.posix.join(componentDestination, `${properties.name}.component.spec.ts`);
50
- const o3rSpecPath = path.posix.join(componentDestination, `${properties.name}.spec.ts`);
51
- const ngStylePath = path.posix.join(componentDestination, `${properties.name}.component.scss`);
52
- const o3rStylePath = path.posix.join(componentDestination, `${properties.name}.style.scss`);
47
+ const componentDestination = path.posix.join(destination, fullStructureRequested ? path.posix.join(properties.folderName, exports.PRESENTER_FOLDER) : `${properties.folderName}${properties.suffix ? ('-' + properties.suffix) : ''}`);
48
+ const componentPath = path.posix.join(componentDestination, `${properties.name}.ts`);
49
+ const stylePath = path.posix.join(componentDestination, `${properties.name}.scss`);
53
50
  const o3rDesignTokenPath = path.posix.join(componentDestination, `${properties.name}.theme.json`);
54
- const ngTemplatePath = path.posix.join(componentDestination, `${properties.name}.component.html`);
55
- const o3rTemplatePath = path.posix.join(componentDestination, `${properties.name}.template.html`);
56
51
  const componentSelector = `${properties.componentSelector}${properties.suffix ? ('-' + properties.suffix) : ''}`;
57
52
  const rules = [];
58
53
  if (!options.standalone) {
@@ -60,8 +55,7 @@ function ngGenerateComponentPresenterFn(options) {
60
55
  project: properties.projectName,
61
56
  path: componentDestination,
62
57
  flat: true,
63
- name: properties.componentName,
64
- typeSeparator: '.'
58
+ name: properties.componentName
65
59
  }));
66
60
  }
67
61
  rules.push((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
@@ -78,7 +72,7 @@ function ngGenerateComponentPresenterFn(options) {
78
72
  viewEncapsulation: 'None',
79
73
  changeDetection: 'OnPush',
80
74
  style: 'scss',
81
- type: 'component',
75
+ type: options.type,
82
76
  skipSelector: false,
83
77
  standalone: options.standalone,
84
78
  ...(options.standalone
@@ -86,37 +80,14 @@ function ngGenerateComponentPresenterFn(options) {
86
80
  skipImport: true
87
81
  }
88
82
  : {
89
- module: `${properties.name}.module.ts`,
83
+ module: `${properties.name}-module.ts`,
90
84
  export: true
91
85
  }),
92
86
  flat: true
93
- }),
94
- // Angular schematics generate spec file with this pattern: component-name.component.spec.ts
95
- (0, schematics_1.move)(ngSpecPath, o3rSpecPath),
96
- // Angular schematics generate style file with this pattern: component-name.component.scss
97
- (0, schematics_1.chain)([
98
- (0, schematics_1.move)(ngStylePath, o3rStylePath),
99
- (t) => {
100
- // Styling file is empty by default, as we create component with `viewEncapsulation` set to 'None', we should wrap the styling into the selector of the component
101
- t.overwrite(o3rStylePath, `${componentSelector} {\n\t// Your component custom SCSS\n}\n`);
102
- return t;
103
- },
104
- (t) => {
105
- t.overwrite(componentPath, t.readText(componentPath).replace(path.basename(ngStylePath), path.basename(o3rStylePath)));
106
- return t;
107
- }
108
- ]),
109
- // Angular schematics generate template file with this pattern: component-name.component.html
110
- (0, schematics_1.chain)([
111
- (0, schematics_1.move)(ngTemplatePath, o3rTemplatePath),
112
- (t) => {
113
- t.overwrite(componentPath, t.readText(componentPath).replace(path.basename(ngTemplatePath), path.basename(o3rTemplatePath)));
114
- return t;
115
- }
116
- ]), (0, schematics_1.schematic)('convert-component', {
87
+ }), (0, schematics_1.schematic)('convert-component', {
117
88
  path: componentPath,
118
89
  skipLinter: options.skipLinter
119
- }), (0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(o3rStylePath, options), (0, design_token_1.getAddDesignTokenRules)(o3rStylePath, o3rDesignTokenPath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, options), (0, analytics_1.getAddAnalyticsRules)(componentPath, options), (0, context_1.getAddContextRules)(componentPath, options));
90
+ }), (0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(stylePath, options), (0, design_token_1.getAddDesignTokenRules)(stylePath, o3rDesignTokenPath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, options), (0, analytics_1.getAddAnalyticsRules)(componentPath, options), (0, context_1.getAddContextRules)(componentPath, options));
120
91
  return (0, schematics_1.chain)(rules);
121
92
  };
122
93
  return (0, schematics_1.chain)([
@@ -31,5 +31,7 @@ export interface NgGenerateComponentPresenterSchematicsSchema extends SchematicO
31
31
  skipLinter: boolean;
32
32
  /** Whether the generated component is standalone */
33
33
  standalone: boolean;
34
+ /** Custom type to append to the component's file name */
35
+ type?: string;
34
36
  }
35
37
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/component/presenter/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,4CAA6C,SAAQ,qBAAqB;IACzF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IAEzB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IAEvB,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../schematics/component/presenter/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,4CAA6C,SAAQ,qBAAqB;IACzF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IAEzB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IAEvB,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IAEpB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -86,6 +86,10 @@
86
86
  "type": "boolean",
87
87
  "description": "Whether the generated component is standalone.",
88
88
  "default": true
89
+ },
90
+ "type": {
91
+ "type": "string",
92
+ "description": "Custom type to append to the component's file name"
89
93
  }
90
94
  },
91
95
  "additionalProperties": true,
@@ -1,3 +1,3 @@
1
- export * from './<%= name %>.component';
2
- <% if (!standalone) { %>export * from './<%= name %>.module';
1
+ export * from './<%= name %>';
2
+ <% if (!standalone) { %>export * from './<%= name %>-module';
3
3
  <% } %>
@@ -35,5 +35,7 @@ export interface NgGenerateComponentSchematicsSchema extends SchematicOptionObje
35
35
  skipLinter: boolean;
36
36
  /** Whether the generated component is standalone */
37
37
  standalone: boolean;
38
+ /** Custom type to append to the component's file name */
39
+ type?: string;
38
40
  }
39
41
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,mCAAoC,SAAQ,qBAAqB;IAChF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE1C,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IAEzB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IAEvB,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,mCAAoC,SAAQ,qBAAqB;IAChF,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B,0BAA0B;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3C,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEtC,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE1C,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAErC,yDAAyD;IACzD,eAAe,EAAE,OAAO,CAAC;IAEzB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,oDAAoD;IACpD,aAAa,EAAE,OAAO,CAAC;IAEvB,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAExC,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IAEpB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -91,6 +91,10 @@
91
91
  "type": "boolean",
92
92
  "description": "Whether the generated component is standalone.",
93
93
  "default": true
94
+ },
95
+ "type": {
96
+ "type": "string",
97
+ "description": "Custom type to append to the component's file name"
94
98
  }
95
99
  },
96
100
  "additionalProperties": true,
@@ -1,3 +1,3 @@
1
- <% if (generateComponentIndex) { %><% if (!useComponentFixtures) { %>// <% } %>export * from './container/<%=folderName%>-cont.fixture';
2
- <% if (!useComponentFixtures) { %>// <% } %>export * from './presenter/<%=folderName%>-pres.fixture';
1
+ <% if (generateComponentIndex) { %><% if (!useComponentFixtures) { %>// <% } %>export * from './container/<%=folderName%>-cont-fixture';
2
+ <% if (!useComponentFixtures) { %>// <% } %>export * from './presenter/<%=folderName%>-pres-fixture';
3
3
  <% } else { %><% if (!useComponentFixtures) { %>// <% } %>export * from './<%=folderName%>/fixtures';<% } %>
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/context-to-component/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAQL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAapC,OAAO,KAAK,EACV,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAWlB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAsEzE;AAED,eAAO,MAAM,YAAY,wBAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/context-to-component/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAepC,OAAO,KAAK,EACV,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAWlB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAwEzE;AAED,eAAO,MAAM,YAAY,wBAAuC,CAAC"}
@@ -6,9 +6,9 @@ const node_path_1 = require("node:path");
6
6
  const schematics_1 = require("@angular-devkit/schematics");
7
7
  const schematics_2 = require("@o3r/schematics");
8
8
  const ts = require("typescript");
9
- const checkContext = (componentPath, tree) => {
9
+ const checkContext = (componentPath, tree, baseFileName) => {
10
10
  const files = [
11
- node_path_1.posix.join((0, node_path_1.dirname)(componentPath), `${(0, node_path_1.basename)(componentPath, '.component.ts')}.context.ts`)
11
+ node_path_1.posix.join((0, node_path_1.dirname)(componentPath), `${baseFileName}-context.ts`)
12
12
  ];
13
13
  if (files.some((file) => tree.exists(file))) {
14
14
  throw new schematics_2.O3rCliError(`Unable to add context to this component because it already has at least one of these files: ${files.join(', ')}.`);
@@ -22,11 +22,13 @@ function ngAddContextFn(options) {
22
22
  return async (tree, context) => {
23
23
  const componentPath = options.path;
24
24
  try {
25
+ const baseFileName = (0, schematics_2.getComponentBaseFileName)(componentPath);
25
26
  const { name } = (0, schematics_2.getO3rComponentInfoOrThrowIfNotFound)(tree, componentPath);
26
- checkContext(componentPath, tree);
27
+ checkContext(componentPath, tree, baseFileName);
27
28
  const properties = {
28
- componentContext: name.concat('Context'),
29
- name: (0, node_path_1.basename)(componentPath, '.component.ts')
29
+ componentContext: (0, schematics_2.getComponentContextName)(baseFileName),
30
+ componentName: name,
31
+ name: baseFileName
30
32
  };
31
33
  const createConfigFilesRule = (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
32
34
  (0, schematics_1.template)(properties),
@@ -36,7 +38,7 @@ function ngAddContextFn(options) {
36
38
  const updateComponentRule = (0, schematics_1.chain)([
37
39
  (0, schematics_2.addImportsRule)(componentPath, [
38
40
  {
39
- from: `./${properties.name}.context`,
41
+ from: `./${properties.name}-context`,
40
42
  importNames: [
41
43
  properties.componentContext
42
44
  ]
@@ -19,7 +19,7 @@ const removeImport = (source, symbolName, fileName) => {
19
19
  * @param tree Tree
20
20
  */
21
21
  const updateComponentDecorators = (tree) => {
22
- const componentFiles = new Set((0, schematics_1.getFilesInFolderFromWorkspaceProjectsInTree)(tree, '', 'component.ts'));
22
+ const componentFiles = new Set((0, schematics_1.getComponentFilesInFolderFromWorkspaceProjectsInTree)(tree, ''));
23
23
  componentFiles.forEach((filePath) => {
24
24
  const source = ts.createSourceFile(filePath, tree.readText(filePath), ts.ScriptTarget.ES2015, true);
25
25
  const recorder = tree.beginUpdate(filePath);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AA+IpC;;;GAGG;AACH,eAAO,MAAM,KAAK,wBAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAwIpC;;;GAGG;AACH,eAAO,MAAM,KAAK,wBAAgC,CAAC"}
@@ -82,13 +82,6 @@ function ngAddFn(options) {
82
82
  command: 'npx',
83
83
  args: ['@angular/cli', 'mcp']
84
84
  },
85
- 'o3r-docs': {
86
- type: 'stdio',
87
- command: 'npx',
88
- args: [
89
- '-y', '@buger/docs-mcp', '--gitUrl', 'https://github.com/AmadeusITGroup/otter'
90
- ]
91
- },
92
85
  o3r: {
93
86
  type: 'stdio',
94
87
  command: 'npx',
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
12
12
 
13
- const doCustomAction = (options: NgAddSchematicsSchema): Rule => (tree) => {
13
+ const doCustomAction = (_options: NgAddSchematicsSchema): Rule => (tree) => {
14
14
  // your custom code here
15
15
  return tree;
16
16
  };
@@ -15,4 +15,8 @@ export declare const updateV12_0: (options: any) => Rule;
15
15
  * Update of Otter library V12.1
16
16
  */
17
17
  export declare const updateV12_1: (options: any) => Rule;
18
+ /**
19
+ * Update of All versions
20
+ */
21
+ export declare const updateAll: (options: any) => Rule;
18
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AA6BpC;;GAEG;AAEH,eAAO,MAAM,UAAU,wBAAqC,CAAC;AAkB7D;;GAEG;AAEH,eAAO,MAAM,WAAW,wBAAsC,CAAC;AAE/D;;GAEG;AAEH,eAAO,MAAM,WAAW,wBAEvB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,WAAW,wBAEvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-update/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AA6BpC;;GAEG;AAEH,eAAO,MAAM,UAAU,wBAAqC,CAAC;AAkB7D;;GAEG;AAEH,eAAO,MAAM,WAAW,wBAAsC,CAAC;AAE/D;;GAEG;AAEH,eAAO,MAAM,WAAW,wBAEvB,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,WAAW,wBAEvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,wBAErB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateV12_1 = exports.updateV12_0 = exports.updateV10_0 = exports.updateV8_2 = void 0;
3
+ exports.updateAll = exports.updateV12_1 = exports.updateV12_0 = exports.updateV10_0 = exports.updateV8_2 = void 0;
4
4
  const node_path_1 = require("node:path");
5
5
  const schematics_1 = require("@angular-devkit/schematics");
6
6
  const schematics_2 = require("@o3r/schematics");
@@ -53,4 +53,8 @@ exports.updateV12_0 = (0, schematics_2.createOtterSchematic)(() => (0, schematic
53
53
  */
54
54
  // eslint-disable-next-line @typescript-eslint/naming-convention -- version is in the function name
55
55
  exports.updateV12_1 = (0, schematics_2.createOtterSchematic)(() => (0, schematics_2.updatePackageGroup)(o3rPackageJsonPath));
56
+ /**
57
+ * Update of All versions
58
+ */
59
+ exports.updateAll = (0, schematics_2.createOtterSchematic)(() => (0, schematics_2.updatePackageGroup)(o3rPackageJsonPath));
56
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAmQpC;;;GAGG;AACH,eAAO,MAAM,cAAc,wBAAyC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/page/index.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAgOpC;;;GAGG;AACH,eAAO,MAAM,cAAc,wBAAyC,CAAC"}
@@ -34,18 +34,14 @@ function ngGeneratePageFn(options) {
34
34
  context.logger.warn('No application detected in this project, the page cannot be generated');
35
35
  return schematics_1.noop;
36
36
  }
37
+ options.type ??= '';
37
38
  const destination = (0, schematics_2.getDestinationPath)('@o3r/core:page', options.path, tree, options.projectName);
38
39
  const pagePath = path.posix.join(destination, core_1.strings.dasherize(options.scope), core_1.strings.dasherize(options.name));
39
40
  const dasherizedPageName = core_1.strings.dasherize(options.name);
40
41
  const projectName = options.projectName;
41
- const componentPath = path.posix.join(pagePath, `${dasherizedPageName}.component.ts`);
42
- const ngSpecPath = path.posix.join(pagePath, `${dasherizedPageName}.component.spec.ts`);
43
- const o3rSpecPath = path.posix.join(pagePath, `${dasherizedPageName}.spec.ts`);
44
- const ngStylePath = path.posix.join(pagePath, `${dasherizedPageName}.component.scss`);
45
- const o3rStylePath = path.posix.join(pagePath, `${dasherizedPageName}.style.scss`);
46
- const ngTemplatePath = path.posix.join(pagePath, `${dasherizedPageName}.component.html`);
47
- const o3rTemplatePath = path.posix.join(pagePath, `${dasherizedPageName}.template.html`);
48
- const moduleFileName = `${dasherizedPageName}.module.ts`;
42
+ const componentPath = path.posix.join(pagePath, `${dasherizedPageName}${options.type ? '.' + options.type : ''}.ts`);
43
+ const stylePath = path.posix.join(pagePath, `${dasherizedPageName}${options.type ? '.' + options.type : ''}.scss`);
44
+ const moduleFileName = `${dasherizedPageName}-module.ts`;
49
45
  const moduleFilePath = path.posix.join(pagePath, moduleFileName);
50
46
  const rules = [];
51
47
  if (!options.standalone) {
@@ -53,14 +49,13 @@ function ngGeneratePageFn(options) {
53
49
  project: projectName,
54
50
  path: pagePath,
55
51
  flat: true,
56
- name: pageName,
57
- typeSeparator: '.'
52
+ name: pageName
58
53
  }), () => {
59
54
  const sourceFileContent = tree.readText(moduleFilePath);
60
55
  const sourceFile = ts.createSourceFile(moduleFilePath, sourceFileContent, ts.ScriptTarget.ES2015, true);
61
56
  const recorder = tree.beginUpdate(moduleFilePath);
62
57
  const { moduleIndex } = (0, schematics_2.getModuleIndex)(sourceFile, sourceFileContent);
63
- (0, schematics_2.addImportToModuleFile)('RouterModule', '@angular/router', sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, `.forChild([{path: '', component: ${core_1.strings.classify(pageName)}Component}])`, true);
58
+ (0, schematics_2.addImportToModuleFile)('RouterModule', '@angular/router', sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, `.forChild([{path: '', component: ${core_1.strings.classify(pageName)}}])`, true);
64
59
  tree.commitUpdate(recorder);
65
60
  return tree;
66
61
  });
@@ -75,7 +70,7 @@ function ngGeneratePageFn(options) {
75
70
  viewEncapsulation: 'None',
76
71
  changeDetection: 'OnPush',
77
72
  style: 'scss',
78
- type: 'component',
73
+ type: options.type,
79
74
  skipSelector: false,
80
75
  standalone: options.standalone,
81
76
  ...(options.standalone
@@ -83,29 +78,11 @@ function ngGeneratePageFn(options) {
83
78
  skipImport: true
84
79
  }
85
80
  : {
86
- module: `${dasherizedPageName}.module.ts`,
81
+ module: `${dasherizedPageName}-module.ts`,
87
82
  export: true
88
83
  }),
89
84
  flat: true
90
- }),
91
- // Angular schematics generate spec file with this pattern: component-name.component.spec.ts
92
- (0, schematics_1.move)(ngSpecPath, o3rSpecPath),
93
- // Angular schematics generate style file with this pattern: component-name.component.scss
94
- (0, schematics_1.chain)([
95
- (0, schematics_1.move)(ngStylePath, o3rStylePath),
96
- (t) => {
97
- t.overwrite(componentPath, t.readText(componentPath).replace(path.basename(ngStylePath), path.basename(o3rStylePath)));
98
- return t;
99
- }
100
- ]),
101
- // Angular schematics generate template file with this pattern: component-name.component.html
102
- (0, schematics_1.chain)([
103
- (0, schematics_1.move)(ngTemplatePath, o3rTemplatePath),
104
- (t) => {
105
- t.overwrite(componentPath, t.readText(componentPath).replace(path.basename(ngTemplatePath), path.basename(o3rTemplatePath)));
106
- return t;
107
- }
108
- ]), (0, schematics_1.schematic)('convert-component', {
85
+ }), (0, schematics_1.schematic)('convert-component', {
109
86
  path: componentPath,
110
87
  skipLinter: options.skipLinter,
111
88
  componentType: 'Page'
@@ -117,7 +94,7 @@ function ngGeneratePageFn(options) {
117
94
  }),
118
95
  (0, schematics_1.renameTemplateFiles)(),
119
96
  (0, schematics_1.move)(pagePath)
120
- ]), 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, {
97
+ ]), schematics_1.MergeStrategy.Overwrite), (0, configuration_1.getAddConfigurationRules)(componentPath, options), (0, theming_1.getAddThemingRules)(stylePath, options), (0, localization_1.getAddLocalizationRules)(componentPath, options), (0, fixture_1.getAddFixtureRules)(componentPath, {
121
98
  skipLinter: options.skipLinter,
122
99
  useComponentFixtures: options.usePageFixtures
123
100
  }, true));
@@ -133,7 +110,7 @@ function ngGeneratePageFn(options) {
133
110
  const route = {
134
111
  path: core_1.strings.dasherize(options.name),
135
112
  import: `./${indexFilePath.replace(/[/\\]/g, '/')}`,
136
- module: `${pageName}${options.standalone ? 'Component' : 'Module'}`
113
+ module: `${pageName}${options.standalone ? (options.type ? core_1.strings.classify(options.type) : '') : 'Module'}`
137
114
  };
138
115
  if (options.appRoutingModulePath) {
139
116
  return (0, schematics_2.insertRoute)(tree, context, options.appRoutingModulePath, route, options.standalone);
@@ -26,5 +26,7 @@ export interface NgGeneratePageSchematicsSchema extends SchematicOptionObject {
26
26
  usePageFixtures: boolean;
27
27
  /** Generate dummy values */
28
28
  activateDummy: boolean;
29
+ /** Custom type to append to the page's file name */
30
+ type?: string;
29
31
  }
30
32
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
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,sFAAsF;IACtF,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,sFAAsF;IACtF,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;IAEvB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -73,6 +73,10 @@
73
73
  "type": "boolean",
74
74
  "description": "Generate dummy values",
75
75
  "default": false
76
+ },
77
+ "type": {
78
+ "type": "string",
79
+ "description": "Custom type to append to the page's file name"
76
80
  }
77
81
  },
78
82
  "additionalProperties": true,
@@ -1 +1 @@
1
- export * from './<%= dasherize(name) %>.<%= standalone ? 'component' : 'module' %>';
1
+ export * from './<%= dasherize(name) %><%= standalone ? (type ? '.' + type : '') : '-module' %>';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/service/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AA+GpC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wBAA4C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/service/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,IAAI,EAKL,MAAM,4BAA4B,CAAC;AA6HpC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wBAA4C,CAAC"}
@@ -14,6 +14,7 @@ function ngGenerateServiceFn(options) {
14
14
  const destination = (0, schematics_2.getDestinationPath)('@o3r/core:service', options.path, tree, options.projectName);
15
15
  const featureName = core_1.strings.dasherize(options.featureName);
16
16
  const name = core_1.strings.dasherize(options.name);
17
+ const type = options.type ? core_1.strings.dasherize(options.type) : '';
17
18
  let currentServiceIndex = '';
18
19
  const barrelPath = path.join(destination, 'index.ts');
19
20
  if (tree.exists(barrelPath) && !(0, schematics_2.moduleHasSubEntryPoints)(tree, destination)) {
@@ -51,6 +52,10 @@ function ngGenerateServiceFn(options) {
51
52
  }
52
53
  packageName = JSON.parse(tree.read(path.join(currentDirectory, 'package.json')).toString()).name?.split('/')[0] || destination;
53
54
  }
55
+ const servicePath = path.posix.join(destination, name, featureName, `${core_1.strings.dasherize(name)}-${core_1.strings.dasherize(featureName)}.ts`);
56
+ const serviceSpecPath = path.posix.join(destination, name, featureName, `${core_1.strings.dasherize(name)}-${core_1.strings.dasherize(featureName)}.spec.ts`);
57
+ const servicePathWithType = path.posix.join(destination, name, featureName, `${core_1.strings.dasherize(name)}-${core_1.strings.dasherize(featureName)}.${core_1.strings.dasherize(type)}.ts`);
58
+ const serviceSpecPathWithType = path.posix.join(destination, name, featureName, `${core_1.strings.dasherize(name)}-${core_1.strings.dasherize(featureName)}.${core_1.strings.dasherize(type)}.spec.ts`);
54
59
  const templateData = {
55
60
  ...core_1.strings,
56
61
  ...options,
@@ -58,13 +63,20 @@ function ngGenerateServiceFn(options) {
58
63
  currentServiceIndex,
59
64
  currentFixtureJasmineIndex,
60
65
  currentFixtureJestIndex,
61
- serviceName: core_1.strings.capitalize(core_1.strings.camelize(options.name + ' ' + options.featureName)),
66
+ serviceName: core_1.strings.capitalize(core_1.strings.camelize(options.name + ' ' + options.featureName + (options.addTypeToClassName && type ? ' ' + type : ''))),
67
+ type,
62
68
  packageName
63
69
  };
64
70
  const baseTemplateSource = (0, schematics_1.apply)((0, schematics_1.url)('./templates/base'), [
65
71
  (0, schematics_1.template)(templateData),
66
72
  (0, schematics_1.renameTemplateFiles)(),
67
- (0, schematics_1.move)(destination)
73
+ (0, schematics_1.move)(destination),
74
+ ...(type
75
+ ? [
76
+ (0, schematics_1.move)(servicePath, servicePathWithType),
77
+ (0, schematics_1.move)(serviceSpecPath, serviceSpecPathWithType)
78
+ ]
79
+ : [])
68
80
  ]);
69
81
  const rules = [(0, schematics_1.mergeWith)(baseTemplateSource, schematics_1.MergeStrategy.Overwrite)];
70
82
  const testFramework = (0, schematics_2.getTestFramework)(workspaceConfig, context);
@@ -10,5 +10,9 @@ export interface NgGenerateServiceSchematicsSchema extends SchematicOptionObject
10
10
  path?: string | undefined;
11
11
  /** Skip the linter process which includes the run of EsLint and EditorConfig rules */
12
12
  skipLinter: boolean;
13
+ /** Custom type to append to the service's file name */
14
+ type?: string;
15
+ /** Append the 'type' option to the generated class name */
16
+ addTypeToClassName: boolean;
13
17
  }
14
18
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/service/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iCAAkC,SAAQ,qBAAqB;IAC9E,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/service/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iCAAkC,SAAQ,qBAAqB;IAC9E,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IAEpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,2DAA2D;IAC3D,kBAAkB,EAAE,OAAO,CAAC;CAC7B"}
@@ -36,6 +36,15 @@
36
36
  "type": "boolean",
37
37
  "description": "Skip the linter process which includes EsLint and EditorConfig rules applying",
38
38
  "default": false
39
+ },
40
+ "type": {
41
+ "type": "string",
42
+ "description": "Custom type to append to the service's file name"
43
+ },
44
+ "addTypeToClassName": {
45
+ "type": "boolean",
46
+ "description": "Append the 'type' option to the generated class name",
47
+ "default": true
39
48
  }
40
49
  },
41
50
  "additionalProperties": true,
@@ -1,6 +1,6 @@
1
1
  import {getTestBed, TestBed} from '@angular/core/testing';
2
2
  import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
3
- import {<%= serviceName %>} from './<%= name %>.<%= featureName %>.service';
3
+ import {<%= serviceName %>} from './<%= name %>-<%= featureName %><% if (type) { %>.<%= type %><% } %>';
4
4
 
5
5
  let service: <%= serviceName %>;
6
6
 
@@ -1,5 +1,5 @@
1
1
  import {Injectable} from '@angular/core';
2
- import {<%= serviceName %>Module} from './<%= name %>.<%= featureName %>.module';
2
+ import {<%= serviceName %>Module} from './<%= name %>-<%= featureName %>-module';
3
3
 
4
4
  /**
5
5
  * <%= name %> service
@@ -1,2 +1,2 @@
1
- export * from './<%= name %>.<%= featureName %>.module';
2
- export * from './<%= name %>.<%= featureName %>.service';
1
+ export * from './<%= name %>-<%= featureName %><% if (type) { %>.<%= type %><% } %>';
2
+ export * from './<%= name %>-<%= featureName %>-module';
@@ -1,2 +1,2 @@
1
- export * from './<%= name %>.<%= featureName %>.fixture.jasmine';
2
- <%= currentFixtureJasmineIndex %>
1
+ export * from './<%= name %>-<%= featureName %>-fixture-jasmine';
2
+ <%= currentFixtureJasmineIndex %>
@@ -1,2 +1,2 @@
1
- export * from './<%= name %>.<%= featureName %>.fixture.jest';
2
- <%= currentFixtureJestIndex %>
1
+ export * from './<%= name %>-<%= featureName %>-fixture-jest';
2
+ <%= currentFixtureJestIndex %>
@@ -1,4 +1,4 @@
1
- import type { PresetOptions } from './preset.interface';
1
+ import type { PresetOptions } from './preset-interface';
2
2
  /**
3
3
  * Preset Installing all the Otter modules
4
4
  * @param options
@@ -7,4 +7,4 @@ export declare function allPreset(options: PresetOptions): {
7
7
  modules: string[];
8
8
  rule: import("@angular-devkit/schematics").Rule;
9
9
  };
10
- //# sourceMappingURL=all.preset.d.ts.map
10
+ //# sourceMappingURL=all-preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-preset.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/all-preset.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa;;;EA6B/C"}
@@ -36,4 +36,4 @@ function allPreset(options) {
36
36
  ])
37
37
  };
38
38
  }
39
- //# sourceMappingURL=all.preset.js.map
39
+ //# sourceMappingURL=all-preset.js.map
@@ -4,4 +4,4 @@
4
4
  export declare function basicPreset(): {
5
5
  rule: import("@angular-devkit/schematics").Rule;
6
6
  };
7
- //# sourceMappingURL=basic.preset.d.ts.map
7
+ //# sourceMappingURL=basic-preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic-preset.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/basic-preset.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,wBAAgB,WAAW;;EAO1B"}
@@ -20,4 +20,4 @@ function basicPreset() {
20
20
  ])
21
21
  };
22
22
  }
23
- //# sourceMappingURL=basic.preset.js.map
23
+ //# sourceMappingURL=basic-preset.js.map
@@ -1,4 +1,4 @@
1
- import type { PresetOptions } from './preset.interface';
1
+ import type { PresetOptions } from './preset-interface';
2
2
  /**
3
3
  * Preset Installing the minimum modules to fully administrated the application via CMS
4
4
  * @param options
@@ -7,4 +7,4 @@ export declare function cmsPreset(options: PresetOptions): {
7
7
  modules: string[];
8
8
  rule: import("@angular-devkit/schematics").Rule;
9
9
  };
10
- //# sourceMappingURL=cms.preset.d.ts.map
10
+ //# sourceMappingURL=cms-preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cms-preset.d.ts","sourceRoot":"","sources":["../../../../schematics/shared/presets/cms-preset.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa;;;EAmB/C"}
@@ -26,4 +26,4 @@ function cmsPreset(options) {
26
26
  ])
27
27
  };
28
28
  }
29
- //# sourceMappingURL=cms.preset.js.map
29
+ //# sourceMappingURL=cms-preset.js.map