@tech4good/angular-schematics 21.6.0 → 21.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +266 -1
  3. package/package.json +34 -7
  4. package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +4 -5
  5. package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +1 -1
  6. package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +14 -6
  7. package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +12 -6
  8. package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +18 -10
  9. package/src/entity/index.js +4 -49
  10. package/src/entity/index.js.map +1 -1
  11. package/src/guard/files/__name@dasherize__.guard.spec.ts.template +0 -1
  12. package/src/ng-add/files/.github/workflows/angular-github-ci.yml.template +3 -0
  13. package/src/ng-add/files/.gitignore.template +3 -0
  14. package/src/ng-add/files/analytics/datasets.js.template +206 -0
  15. package/src/ng-add/files/analytics/entity_sources.js.template +58 -0
  16. package/src/ng-add/files/analytics/entity_sources.test.js.template +57 -0
  17. package/src/ng-add/files/analytics/lib/api_query.js.template +87 -0
  18. package/src/ng-add/files/analytics/lib/api_query.test.js.template +84 -0
  19. package/src/ng-add/files/analytics/lib/bigquery_query_compatibility.test.js.template +53 -0
  20. package/src/ng-add/files/analytics/lib/dataset_schema.js.template +53 -0
  21. package/src/ng-add/files/analytics/lib/dataset_schema.test.js.template +34 -0
  22. package/src/ng-add/files/analytics/lib/entity_sync.js.template +397 -0
  23. package/src/ng-add/files/analytics/lib/entity_sync.test.js.template +212 -0
  24. package/src/ng-add/files/analytics/lib/identifier_salt.js.template +57 -0
  25. package/src/ng-add/files/analytics/lib/identifier_salt.test.js.template +36 -0
  26. package/src/ng-add/files/analytics/lib/snapshot_files.js.template +46 -0
  27. package/src/ng-add/files/analytics/lib/snapshot_files.test.js.template +67 -0
  28. package/src/ng-add/files/analytics/lib/sqlite.js.template +92 -0
  29. package/src/ng-add/files/analytics/lib/upload_entities.js.template +81 -0
  30. package/src/ng-add/files/analytics/lib/upload_entities.test.js.template +86 -0
  31. package/src/ng-add/files/analytics/proxy.conf.json.template +7 -0
  32. package/src/ng-add/files/analytics/scripts/refresh_snapshot.js.template +518 -0
  33. package/src/ng-add/files/analytics/scripts/start.js.template +88 -0
  34. package/src/ng-add/files/analytics/server/server.js.template +212 -0
  35. package/src/ng-add/files/angular.json.template +80 -1
  36. package/src/ng-add/files/bigquery/queries/active_time_by_route.sql.template +27 -8
  37. package/src/ng-add/files/bigquery/queries/active_user_windows.sql.template +67 -0
  38. package/src/ng-add/files/bigquery/queries/dashboard_route_visits.sql.template +47 -0
  39. package/src/ng-add/files/bigquery/queries/data_quality.sql.template +323 -0
  40. package/src/ng-add/files/bigquery/queries/onboarding_funnel.sql.template +512 -0
  41. package/src/ng-add/files/bigquery/queries/onboarding_stage_observations.sql.template +134 -0
  42. package/src/ng-add/files/bigquery/queries/weekly_retention_cohorts.sql.template +90 -0
  43. package/src/ng-add/files/bigquery/scripts/export_entities.js.template +120 -0
  44. package/src/ng-add/files/bigquery/scripts/init_views.js.template +57 -0
  45. package/src/ng-add/files/bigquery/scripts/run_query.js.template +141 -0
  46. package/src/ng-add/files/bigquery/views/events_flat.sql.template +27 -12
  47. package/src/ng-add/files/bigquery/views/logs_latest.sql.template +16 -3
  48. package/src/ng-add/files/docs-infra/analytics-guide.md.template +270 -25
  49. package/src/ng-add/files/docs-infra/analytics-workbench-guide.md.template +307 -0
  50. package/src/ng-add/files/docs-infra/authentication-architecture.md.template +54 -24
  51. package/src/ng-add/files/docs-infra/email-infrastructure.md.template +43 -0
  52. package/src/ng-add/files/docs-infra/firestore-index-checker.md.template +87 -0
  53. package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +108 -29
  54. package/src/ng-add/files/docs-infra/load-system-architecture.md.template +15 -1
  55. package/src/ng-add/files/docs-infra/querying-strategy.md.template +14 -0
  56. package/src/ng-add/files/docs-infra/stream-system-architecture.md.template +21 -7
  57. package/src/ng-add/files/eslint.config.js.template +22 -3
  58. package/src/ng-add/files/functions/package.json.template +1 -0
  59. package/src/ng-add/files/functions/src/email.ts.template +23 -0
  60. package/src/ng-add/files/jest.config.ts.template +3 -2
  61. package/src/ng-add/files/package.json.template +39 -16
  62. package/src/ng-add/files/projects/analytics/src/app/analytics-api.service.ts.template +130 -0
  63. package/src/ng-add/files/projects/analytics/src/app/app.component.html.template +77 -0
  64. package/src/ng-add/files/projects/analytics/src/app/app.component.scss.template +240 -0
  65. package/src/ng-add/files/projects/analytics/src/app/app.component.ts.template +96 -0
  66. package/src/ng-add/files/projects/analytics/src/app/app.routes.ts.template +11 -0
  67. package/src/ng-add/files/projects/analytics/src/app/dashboard-pages.spec.ts.template +151 -0
  68. package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.html.template +39 -0
  69. package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.scss.template +1 -0
  70. package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.ts.template +95 -0
  71. package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.html.template +47 -0
  72. package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.scss.template +1 -0
  73. package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.ts.template +120 -0
  74. package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.html.template +40 -0
  75. package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.scss.template +1 -0
  76. package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.ts.template +98 -0
  77. package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.html.template +35 -0
  78. package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.scss.template +1 -0
  79. package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.ts.template +84 -0
  80. package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.html.template +42 -0
  81. package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.scss.template +1 -0
  82. package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.ts.template +110 -0
  83. package/src/ng-add/files/projects/analytics/src/app/shared/analytics-utils.ts.template +43 -0
  84. package/src/ng-add/files/projects/analytics/src/app/shared/chart-theme.ts.template +42 -0
  85. package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-layout.scss.template +239 -0
  86. package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.html.template +76 -0
  87. package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.scss.template +128 -0
  88. package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.spec.ts.template +31 -0
  89. package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.ts.template +153 -0
  90. package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.html.template +16 -0
  91. package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.scss.template +63 -0
  92. package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.ts.template +52 -0
  93. package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.html.template +5 -0
  94. package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.scss.template +56 -0
  95. package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.spec.ts.template +30 -0
  96. package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.ts.template +15 -0
  97. package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.html.template +9 -0
  98. package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.scss.template +43 -0
  99. package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.ts.template +62 -0
  100. package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.html.template +9 -0
  101. package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.scss.template +33 -0
  102. package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.ts.template +82 -0
  103. package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.html.template +15 -0
  104. package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.scss.template +45 -0
  105. package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.ts.template +55 -0
  106. package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.html.template +18 -0
  107. package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.scss.template +45 -0
  108. package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.ts.template +15 -0
  109. package/src/ng-add/files/projects/analytics/src/app/vega-chart/vega-chart.component.ts.template +121 -0
  110. package/src/ng-add/files/projects/analytics/src/index.html.template +19 -0
  111. package/src/ng-add/files/projects/analytics/src/main.ts.template +16 -0
  112. package/src/ng-add/files/projects/analytics/src/styles.scss.template +28 -0
  113. package/src/ng-add/files/projects/analytics/tsconfig.app.json.template +13 -0
  114. package/src/ng-add/files/projects/analytics/tsconfig.spec.json.template +15 -0
  115. package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +4 -5
  116. package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.spec.ts.template +4 -5
  117. package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.spec.ts.template +11 -12
  118. package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.ts.template +7 -7
  119. package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.spec.ts.template +8 -10
  120. package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.ts.template +3 -2
  121. package/src/ng-add/files/src/app/app.component.html.template +1 -1
  122. package/src/ng-add/files/src/app/app.component.scss.template +1 -1
  123. package/src/ng-add/files/src/app/app.component.spec.ts.template +4 -5
  124. package/src/ng-add/files/src/app/app.component.ts.template +1 -2
  125. package/src/ng-add/files/src/app/app.config.ts.template +21 -15
  126. package/src/ng-add/files/src/app/auth-routing.spec.ts.template +4 -5
  127. package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +46 -29
  128. package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +27 -18
  129. package/src/ng-add/files/src/app/core/auth/auth.providers.spec.ts.template +112 -0
  130. package/src/ng-add/files/src/app/core/auth/auth.providers.ts.template +48 -0
  131. package/src/ng-add/files/src/app/core/auth/auth.service.ts.template +9 -23
  132. package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.spec.ts.template +3 -14
  133. package/src/ng-add/files/src/app/core/firebase/data.providers.prod.ts.template +21 -0
  134. package/src/ng-add/files/src/app/core/firebase/data.providers.ts.template +13 -0
  135. package/src/ng-add/files/src/app/core/local-storage/session.service.spec.ts.template +43 -0
  136. package/src/ng-add/files/src/app/core/local-storage/session.service.ts.template +7 -0
  137. package/src/ng-add/files/src/app/core/store/app-data.spec.ts.template +76 -0
  138. package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +19 -67
  139. package/src/ng-add/files/src/app/core/store/auth/auth.store.spec.ts.template +102 -12
  140. package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +32 -237
  141. package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +17 -12
  142. package/src/ng-add/files/src/app/core/store/user/user.model.ts.template +6 -7
  143. package/src/ng-add/files/src/app/core/store/user/user.store.ts.template +14 -10
  144. package/src/ng-add/files/src/app/core/store/user-context/user-context.mock.ts.template +20 -8
  145. package/src/ng-add/files/src/app/core/store/user-context/user-context.model.ts.template +5 -6
  146. package/src/ng-add/files/src/app/core/store/user-context/user-context.store.ts.template +14 -10
  147. package/src/ng-add/files/src/app/core/store/user-private/user-private.mock.ts.template +20 -7
  148. package/src/ng-add/files/src/app/core/store/user-private/user-private.model.ts.template +5 -6
  149. package/src/ng-add/files/src/app/core/store/user-private/user-private.store.ts.template +14 -10
  150. package/src/ng-add/files/src/app/core/testing/app-mocks.ts.template +42 -0
  151. package/src/ng-add/files/src/app/first-time/consent/consent.component.html.template +2 -1
  152. package/src/ng-add/files/src/app/first-time/consent/consent.component.scss.template +7 -3
  153. package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +31 -11
  154. package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +16 -1
  155. package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +15 -15
  156. package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +11 -3
  157. package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.html.template +2 -1
  158. package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.scss.template +7 -3
  159. package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.spec.ts.template +20 -6
  160. package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.ts.template +2 -0
  161. package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.spec.ts.template +4 -5
  162. package/src/ng-add/files/src/app/first-time/email-link/email-link.component.spec.ts.template +17 -1
  163. package/src/ng-add/files/src/app/first-time/email-link/email-link.component.ts.template +15 -0
  164. package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +4 -5
  165. package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.ts.template +15 -0
  166. package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +2 -0
  167. package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +21 -3
  168. package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +26 -0
  169. package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +4 -2
  170. package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.ts.template +1 -1
  171. package/src/ng-add/files/src/app/main/account-profile/account-profile.component.spec.ts.template +2 -2
  172. package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.spec.ts.template +2 -2
  173. package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.spec.ts.template +4 -4
  174. package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.spec.ts.template +2 -2
  175. package/src/ng-add/files/src/app/main/home/home.component.spec.ts.template +4 -5
  176. package/src/ng-add/files/src/app/main/home/home.component.ts.template +1 -1
  177. package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.spec.ts.template +4 -4
  178. package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +2 -2
  179. package/src/ng-add/files/tsconfig.spec.json.template +3 -1
  180. package/src/ng-add/index.js +7 -0
  181. package/src/ng-add/index.js.map +1 -1
  182. package/src/shared/entity-registry.d.ts +8 -0
  183. package/src/shared/entity-registry.js +28 -0
  184. package/src/shared/entity-registry.js.map +1 -0
  185. package/.agents/skills/publish-npm/SKILL.md +0 -37
  186. package/.agents/skills/publish-npm/eval.yaml +0 -32
  187. package/.agents/skills/publish-npm/fixtures/package-v21.json.template +0 -8
  188. package/.husky/commit-msg +0 -1
  189. package/.husky/pre-commit +0 -1
  190. package/.t4g/agent-memory.db +0 -0
  191. package/src/component/index_spec.d.ts +0 -1
  192. package/src/component/index_spec.js +0 -68
  193. package/src/component/index_spec.js.map +0 -1
  194. package/src/entity/index_spec.d.ts +0 -1
  195. package/src/entity/index_spec.js +0 -153
  196. package/src/entity/index_spec.js.map +0 -1
  197. package/src/guard/index_spec.d.ts +0 -1
  198. package/src/guard/index_spec.js +0 -64
  199. package/src/guard/index_spec.js.map +0 -1
  200. package/src/ng-add/files/bigquery/scripts/export_entities.py.template +0 -143
  201. package/src/ng-add/files/bigquery/scripts/run_query.py.template +0 -167
  202. package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +0 -500
  203. package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +0 -73
  204. package/src/ng-add/files/src/app/core/firebase/email-link-context.service.spec.ts.template +0 -59
  205. package/src/ng-add/files/src/app/core/firebase/email-link-context.service.ts.template +0 -147
  206. package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +0 -453
  207. package/src/ng-add/files/src/app/core/firebase/firebase.service.spec.ts.template +0 -116
  208. package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +0 -639
  209. package/src/ng-add/files/src/app/core/firebase/simulate-load.spec.ts.template +0 -104
  210. package/src/ng-add/files/src/app/core/firebase/simulate-stream.spec.ts.template +0 -127
  211. package/src/ng-add/files/src/app/core/firebase/simulation.mock.ts.template +0 -38
  212. package/src/ng-add/files/src/app/core/firebase/stream-multiplexer.ts.template +0 -445
  213. package/src/ng-add/files/src/app/core/logging/logging.service.spec.ts.template +0 -118
  214. package/src/ng-add/files/src/app/core/logging/logging.service.ts.template +0 -168
  215. package/src/ng-add/files/src/app/core/store/app.model.ts.template +0 -21
  216. package/src/ng-add/files/src/app/core/store/app.store.spec.ts.template +0 -920
  217. package/src/ng-add/files/src/app/core/store/app.store.ts.template +0 -1320
  218. package/src/ng-add/files/src/app/core/store/batch-write.firebase.service.ts.template +0 -58
  219. package/src/ng-add/files/src/app/core/store/batch-write.mock.service.ts.template +0 -105
  220. package/src/ng-add/files/src/app/core/store/batch-write.service.ts.template +0 -126
  221. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +0 -9
  222. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.scss.template +0 -46
  223. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +0 -69
  224. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +0 -39
  225. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.spec.ts.template +0 -122
  226. package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +0 -88
  227. package/src/ng-add/index_spec.d.ts +0 -1
  228. package/src/ng-add/index_spec.js +0 -108
  229. package/src/ng-add/index_spec.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## [21.7.0](https://github.com/tech4good-lab/angular-schematics/compare/v21.6.0...v21.7.0) (2026-11-20)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * **ng-add:** Entity generation now targets platform-data models and
6
+ stores. Existing applications must follow packages/data/MIGRATION.md before
7
+ using the updated entity schematic; old local infrastructure import paths
8
+ and resetAllStores are not compatibility APIs.
9
+
10
+ ### Features
11
+
12
+ * **ng-add:** add analytics workbench infrastructure to schematic template ([362f0e4](https://github.com/tech4good-lab/angular-schematics/commit/362f0e42e6d1b707a3b28f095e999831de1bfb84))
13
+ * **ng-add:** add firestore index validation ([9b9fc6e](https://github.com/tech4good-lab/angular-schematics/commit/9b9fc6edeb0360ebc8f8f186bf3b95e74ea71c36))
14
+ * **ng-add:** add telemetry tracking to auth and onboarding components ([5df7935](https://github.com/tech4good-lab/angular-schematics/commit/5df7935918093ada91285a729bc567609d99fa74))
15
+ * **ng-add:** generate apps with shared platform infrastructure ([bfff917](https://github.com/tech4good-lab/angular-schematics/commit/bfff917ddf983a1346d1046d0f47b2b0b18f7f18))
16
+ * **ng-add:** integrate platform email in generated functions ([2e40f5b](https://github.com/tech4good-lab/angular-schematics/commit/2e40f5b3cc28094668a8afefbbfe5bff3234e549))
17
+ * **ng-add:** use platform auth in generated applications ([cd3288e](https://github.com/tech4good-lab/angular-schematics/commit/cd3288e48d192ee912eaff9f95224902501f263b))
18
+ * **ng-add:** use platform ui in generated applications ([e96772b](https://github.com/tech4good-lab/angular-schematics/commit/e96772b3cc33d75095efb82c3d21dd290f4ff681))
19
+ * **shared:** add platform email package ([97fae7c](https://github.com/tech4good-lab/angular-schematics/commit/97fae7c12fbb62eea6583ec3ce4a6b6995e83a7a))
20
+ * **shared:** extract platform auth package ([e6c66cd](https://github.com/tech4good-lab/angular-schematics/commit/e6c66cd18b319ea8c5c556ce33991f474e81d41e))
21
+ * **shared:** extract platform data and runtime logging packages ([bde1d13](https://github.com/tech4good-lab/angular-schematics/commit/bde1d132410d5fc7775ca3a9e0137a088442ffef))
22
+ * **shared:** extract platform tooling package ([fda18e3](https://github.com/tech4good-lab/angular-schematics/commit/fda18e3ab5909a025552bc359e4bafcc12a5c10e))
23
+ * **shared:** extract platform ui package ([94f97c4](https://github.com/tech4good-lab/angular-schematics/commit/94f97c4f527a79f41c215e7e150b9049a32fab2e))
24
+ * **shared:** generate app entity registries with platform tooling ([89cbbeb](https://github.com/tech4good-lab/angular-schematics/commit/89cbbeb57001d2836fac5efbd0f29da9a55c280a))
25
+
26
+ ### Bug Fixes
27
+
28
+ * **ng-add:** replace remote icongr.am arrows with Material icons ([5496577](https://github.com/tech4good-lab/angular-schematics/commit/54965770949d8defa7f06e7c67c905ce5584da29))
1
29
  ## [21.6.0](https://github.com/tech4good-lab/angular-schematics/compare/v21.5.0...v21.6.0) (2026-07-28)
2
30
 
3
31
  ### Features
package/README.md CHANGED
@@ -34,7 +34,193 @@ ng generate @tech4good/angular-schematics:<schematic>
34
34
 
35
35
  `npm run test` will run the unit tests, using Jasmine as a runner and test framework.
36
36
 
37
- ### Publishing
37
+ Run `npm run test:indexes` for the Firestore index checker regression and CLI
38
+ integration suites. The CLI tests generate temporary projects and run their real
39
+ `npm run check:indexes` and `npm run fix:indexes` commands. They verify exit codes,
40
+ missing-index diagnostics, correct index generation, configuration preservation,
41
+ idempotence, and failure handling for unresolved queries or invalid input.
42
+ Fixtures install locally packed tooling and TypeScript tarballs offline, then run
43
+ the compiled CLI in ESM and CommonJS projects. They do not use a TypeScript
44
+ loader or a symlink to the workspace package. No Firebase credentials, emulator,
45
+ or deployed database are required.
46
+
47
+ ### Shared tooling package
48
+
49
+ The index checker is maintained in `packages/tooling` as `@tech4good/platform-tooling`.
50
+ New applications receive a versioned dev dependency and scripts that invoke
51
+ `t4g-check-firestore-indexes`; the checker implementation is no longer copied
52
+ into generated apps. See [the package README](packages/tooling/README.md) for
53
+ CLI options, API usage, limitations, and local adoption instructions.
54
+
55
+ ```bash
56
+ npm install
57
+ npm run build:tooling
58
+ npm run test:indexes
59
+ npm run pack:tooling
60
+ ```
61
+
62
+ The pilot keeps the existing schematics package at the repository root and adds
63
+ one npm workspace. Moving schematics into `packages/schematics` and making the
64
+ root private can wait until further packages justify that restructuring.
65
+
66
+ The tooling version prepared here is `0.1.0-alpha.1`. Before releasing schematics
67
+ that reference it, publish that tooling version and verify registry availability.
68
+ Packaging locally does not publish anything. Use the tooling workspace for its
69
+ release; the existing root version/release scripts belong to schematics.
70
+
71
+ ### Testing packages in another repo before publishing
72
+
73
+ Packages can be tested locally before their first npm release and while developing
74
+ updates. A version bump or alpha publication is not needed for each local edit.
75
+
76
+ **What the tooling command does**
77
+
78
+ From this repository, the following builds the index checker and runs it on MathPets:
79
+
80
+ ```bash
81
+ npm run build:tooling
82
+ node packages/tooling/dist/cli.js --project-root /path/to/math-pets
83
+ ```
84
+
85
+ `node` executes the compiled JavaScript CLI. `--project-root` is an option we
86
+ implemented in this checker: it selects the application whose `src/app` queries
87
+ and `firestore.indexes.json` are analyzed. This is a read-only index check. It does
88
+ not install the package into MathPets, start the application, or run MathPets'
89
+ tests. The flag is specific to this CLI, not a general npm package-testing feature.
90
+ See the [tooling development instructions](packages/tooling/README.md#run-against-mathpets-while-developing)
91
+ for watch mode and testing its installed executable.
92
+
93
+ **General workflows for any shared package**
94
+
95
+ For a runtime library such as `@tech4good/platform-data`, test the
96
+ library by making the consuming application use the local version, then building,
97
+ testing, and exercising that application.
98
+
99
+ | Method | What the application uses | When to use it |
100
+ | --- | --- | --- |
101
+ | Local tarball (`npm pack` + `npm install`) | A snapshot of the package's distributable files | Default integration check and verification before publishing |
102
+ | Local link (`npm link`) | A filesystem link to the package's local build | Frequent edits across the package and application |
103
+ | Published alpha | A version downloaded from npm | Shared testing by teammates, CI, or deployments |
104
+
105
+ For our packages, start with local testing, verify a tarball before release, and
106
+ publish an alpha when other machines need to install a reproducible version.
107
+ Local linking and tarball installation are supported by
108
+ [npm link](https://docs.npmjs.com/cli/v11/commands/npm-link/) and
109
+ [npm install](https://docs.npmjs.com/cli/v10/commands/npm-install/).
110
+
111
+ The data-package examples below are illustrative; that package does not exist
112
+ yet. They assume MathPets imports the package's public API. During first adoption,
113
+ we must also update the relevant imports and provider setup to use the package.
114
+ Installing it alone does not replace the app's existing copied infrastructure.
115
+
116
+ **Option 1: Install a local tarball**
117
+
118
+ Build the package, then pack its publishable directory: the folder containing
119
+ its package manifest and built entry points. For tooling, use `npm run pack:tooling`
120
+ from this repository. For an Angular library built with `ng-packagr`, that
121
+ directory is usually its output folder, such as `dist/platform-data`.
122
+
123
+ After building the future data library, the workflow would be:
124
+
125
+ ```bash
126
+ # In the package repository; use its actual build-output path.
127
+ npm pack /path/to/built-platform-data
128
+
129
+ # In a MathPets development checkout; use the archive path printed by npm pack.
130
+ cd /path/to/math-pets
131
+ npm install --no-save --package-lock=false /path/to/tech4good-platform-data-0.1.0-alpha.0.tgz
132
+ npm run build
133
+ npm test
134
+ npm start
135
+ ```
136
+
137
+ The application imports `@tech4good/platform-data` normally, and npm supplies
138
+ the local snapshot. Exercise the affected behavior in the running app as well
139
+ as its tests, such as store loading, updates, and subscription cleanup.
140
+ After another library change, rebuild, repack, reinstall, and rerun the relevant
141
+ checks. No npm publication is involved. Restart an already-running development
142
+ server after replacing the installed snapshot.
143
+
144
+ The install flags keep the local archive out of the application's manifest and
145
+ lockfile, while changing `node_modules`. A later `npm ci` restores dependencies
146
+ from the application's lockfile and removes the temporary installation. Use a
147
+ disposable checkout if you want to keep the main checkout's dependencies intact.
148
+
149
+ **Option 2: Link a local build for faster iteration**
150
+
151
+ Build the library once, then register and consume its publishable directory:
152
+
153
+ ```bash
154
+ cd /path/to/built-platform-data
155
+ npm link
156
+
157
+ cd /path/to/math-pets
158
+ npm link --no-save --package-lock=false @tech4good/platform-data
159
+ npm start
160
+ ```
161
+
162
+ The first command registers a link on your machine; the second makes MathPets
163
+ resolve the package through that link. Keep the library's build running in watch
164
+ mode in another terminal (for an Angular library, for example,
165
+ `ng build platform-data --watch` from its Angular workspace). Changes become
166
+ available after compilation; linking itself does not compile TypeScript. Restart
167
+ the app server if it does not detect rebuilt files.
168
+
169
+ Angular libraries should be linked from their built output and declare the
170
+ Angular packages they use as peer dependencies so the app supplies Angular.
171
+ Linked Angular libraries can also require consumer settings for symlink handling
172
+ and dev-server prebundling; configure these for the app's actual builder when
173
+ setting up the future data package. See
174
+ [Angular's library development guide](https://angular.dev/tools/libraries/creating-libraries#linking-libraries-for-local-development).
175
+ A successful linked run should be followed by a tarball trial, which also checks
176
+ the files and exports included in the distributable package.
177
+
178
+ To return MathPets to its recorded dependencies, run `npm ci` there. To remove
179
+ the corresponding global link when finished, run
180
+ `npm unlink --global @tech4good/platform-data`.
181
+
182
+ **Option 3: Publish an alpha for shared testing**
183
+
184
+ An alpha is useful when teammates or CI need to install a specific test version
185
+ without access to your local folders. Choose a new prerelease version, publish
186
+ with `--tag alpha`, and have consumers install that exact version. Each published
187
+ iteration needs a new version; local edits do not update an already-published
188
+ package. See the [release guide](packages/tooling/README.md#releasing-and-publishing)
189
+ for the current tooling package's concrete commands.
190
+
191
+ ### Publishing @tech4good/platform-tooling
192
+
193
+ Run these commands from the repository root. This checkout is prepared for
194
+ `0.1.0-alpha.1`; it does not need another version bump to publish this release.
195
+
196
+ First validate the release and preview its package contents:
197
+
198
+ ```bash
199
+ npm test
200
+ npm pack --workspace @tech4good/platform-tooling --dry-run
201
+ ```
202
+
203
+ Review and commit the release changes before publishing. Then log in with an
204
+ npm account that can publish under `@tech4good` and complete npm's authentication
205
+ prompts:
206
+
207
+ ```bash
208
+ npm login
209
+ npm publish --workspace @tech4good/platform-tooling --access public --tag alpha
210
+ npm view @tech4good/platform-tooling@0.1.0-alpha.1 version
211
+ ```
212
+
213
+ `--workspace` selects tooling; `--access public` makes it publicly installable;
214
+ `--tag alpha` labels the pilot as a prerelease. Plain `npm publish` at this
215
+ repository root publishes angular-schematics. The tooling package's `prepack`
216
+ script builds its compiled output automatically during packing and publishing.
217
+
218
+ For later releases, use the [tooling release guide](packages/tooling/README.md#releasing-and-publishing)
219
+ to update its version, generated dependency, changelog, and Git tag. Tooling
220
+ versions are independent of the Angular/schematics version. Publish tooling and
221
+ verify its availability before publishing schematics that reference that version.
222
+
223
+ ### Publishing @tech4good/angular-schematics
38
224
 
39
225
  **Option 1: Agent-Assisted Workflow (Recommended)**
40
226
 
@@ -56,3 +242,82 @@ npm run build
56
242
  npm login
57
243
  npm publish # will ask for a OTP (see Google Authenticator: npm)
58
244
  ```
245
+
246
+
247
+ ### Shared data infrastructure
248
+
249
+ `@tech4good/platform-data` is the Angular library for shared entity stores,
250
+ Firestore data access, mock collections, listeners and batch writes. Applications
251
+ continue to define their own entities, auth policy and Firebase configuration.
252
+ See the [package guide](packages/data/README.md),
253
+ [existing-app migration](packages/data/MIGRATION.md), and
254
+ [review/extraction plan](docs-plans/platform-data-extraction.md).
255
+
256
+ Run `npm run test:data` for the library or `npm test` for all packages/schematics.
257
+ `npm run pack:data` builds and packs an installable local tarball. Publish this
258
+ Angular library from `packages/data/dist`; its release guide includes the
259
+ required build and publication commands.
260
+
261
+
262
+ Entity registration now lives beside each interface in `<entity>.model.ts` using
263
+ `defineEntity<T>({ collection: 'name' })`. The entity schematic refreshes generated
264
+ registries instead of editing `app.model.ts` or adding entries to the Firebase
265
+ mock facade. Tooling alpha.2 supplies `t4g-entities` for generation, watch mode,
266
+ and stale-output checks; generated apps integrate it with development and build
267
+ commands. See the [registry workflow](packages/tooling/README.md#entity-discovery-and-generated-registries)
268
+ and [existing-app migration](packages/data/MIGRATION.md).
269
+
270
+
271
+ ### Shared runtime logging
272
+
273
+ `@tech4good/platform-logging` provides `injectLogger(namespace)` and app-wide
274
+ `providePlatformLogging(options)`. It owns namespace filtering, custom output,
275
+ and optional browser persistence/DevTools controls. `platform-data` consumes the
276
+ `data` namespace; logging is independent of the data and tooling packages.
277
+
278
+ Newly generated apps import the package directly. See the
279
+ [logging guide](packages/logging/README.md) for usage, migration, local tarball
280
+ testing and publishing instructions.
281
+
282
+ Run `npm run test:logging` or `npm run pack:logging` from this repository root.
283
+ Logging targets Angular 21 and starts at `0.1.0-alpha.0`. Publish it before data
284
+ or schematics versions requiring it. While testing unpublished packages, install
285
+ their local tarballs together to satisfy the logging peer dependency.
286
+
287
+ ### Shared authentication
288
+
289
+ `@tech4good/platform-auth` provides auth operations, email-link context, shared
290
+ profile assurance and session coordination. Its `/firebase`, `/profiles` and
291
+ `/testing` entry points ship together. Generated apps retain their guards,
292
+ routes, profile defaults, logout dialogs and account-deletion backend.
293
+
294
+ Start with the [auth package README](packages/auth/README.md),
295
+ [existing-app migration](packages/auth/MIGRATION.md),
296
+ [behavior changes beyond extraction](packages/auth/EXTRACTION-CHANGES.md), and
297
+ [future work/adoption checks](packages/auth/FUTURE-WORK.md).
298
+
299
+ `npm run test:auth` builds the dependency packages and tests the public auth API.
300
+ `npm run pack:auth` produces a local installable tarball. Publish the built
301
+ `packages/auth/dist` directory with `--tag alpha`; the README includes complete
302
+ commands. The app template pins `0.1.0-alpha.0`, so publish that version before
303
+ releasing schematics that depend on it. MathPets and Mentor adoption remains a
304
+ separate migration.
305
+
306
+
307
+ ### Shared UI package
308
+
309
+ `@tech4good/platform-ui` starts with the redeployment warning and its polling
310
+ service. Generated apps import the standalone component from the package;
311
+ existing apps can replace their copied warning using the
312
+ [migration guide](packages/ui/MIGRATION.md). The UI package has no auth or data dependency.
313
+
314
+ ```bash
315
+ npm run build:ui
316
+ npm run test:ui
317
+ npm run pack:ui
318
+ ```
319
+
320
+ See the [UI package README](packages/ui/README.md) for integration, configuration,
321
+ and styling, and the [extraction decision](docs-plans/platform-ui-extraction.md)
322
+ for the pilot scope. The referenced UI alpha must be published before releasing
323
+ schematics that depend on it. These commands only build, test, and pack locally.
package/package.json CHANGED
@@ -1,17 +1,38 @@
1
1
  {
2
2
  "name": "@tech4good/angular-schematics",
3
- "version": "21.6.0",
3
+ "version": "21.7.0",
4
4
  "description": "A set of schematics for generating modules, containers, components, and entities",
5
5
  "scripts": {
6
- "build": "tsc -p tsconfig.json",
7
- "test": "npm run build && jasmine src/**/*_spec.js",
6
+ "build": "npm run build:tooling && npm run build:email && npm run build:auth && npm run build:ui && npm run build:schematics",
7
+ "test": "npm run build && npm run test --workspace @tech4good/platform-tooling && npm run test --workspace @tech4good/platform-email && npm run test --workspace @tech4good/platform-logging && npm run test --workspace @tech4good/platform-data && npm run test --workspace @tech4good/platform-auth && npm run test --workspace @tech4good/platform-ui && jasmine \"src/**/*_spec.js\"",
8
+ "test:indexes": "npm run build && npm run test --workspace @tech4good/platform-tooling && jasmine src/ng-add/check-firestore-indexes-cli_spec.js",
8
9
  "changelog": "conventional-changelog --config changelog.config.json -i CHANGELOG.md -s",
9
10
  "changelog:all": "conventional-changelog -r 0 --config changelog.config.json -i CHANGELOG.md -s",
10
11
  "version": "npm run changelog && git add CHANGELOG.md",
11
12
  "release:patch": "npm version patch",
12
13
  "release:minor": "npm version minor",
13
14
  "release:major": "npm version major",
14
- "prepare": "husky"
15
+ "prepare": "husky",
16
+ "build:schematics": "tsc -p tsconfig.json",
17
+ "build:tooling": "npm run build --workspace @tech4good/platform-tooling",
18
+ "pack:tooling": "npm pack --workspace @tech4good/platform-tooling",
19
+ "build:email": "npm run build --workspace @tech4good/platform-email",
20
+ "test:email": "npm run build:email && npm run test --workspace @tech4good/platform-email",
21
+ "pack:email": "npm pack --workspace @tech4good/platform-email",
22
+ "build:data": "npm run build:logging && npm run build --workspace @tech4good/platform-data",
23
+ "test:data": "npm run build:data && npm run test --workspace @tech4good/platform-data",
24
+ "pack:data": "npm run build:data && npm pack ./packages/data/dist",
25
+ "test:data:firestore": "npm run build:data && npm run test:firestore --workspace @tech4good/platform-data",
26
+ "build:logging": "npm run build --workspace @tech4good/platform-logging",
27
+ "test:logging": "npm run build:logging && npm run test --workspace @tech4good/platform-logging",
28
+ "pack:logging": "npm run build:logging && npm pack ./packages/logging/dist",
29
+ "build:auth": "npm run build:data && npm run build --workspace @tech4good/platform-auth",
30
+ "test:auth": "npm run build:auth && npm run test --workspace @tech4good/platform-auth",
31
+ "pack:auth": "npm run build:auth && npm pack ./packages/auth/dist",
32
+ "test:auth:emulator": "npm run build:auth && npm run test:emulator --workspace @tech4good/platform-auth",
33
+ "build:ui": "npm run build --workspace @tech4good/platform-ui",
34
+ "test:ui": "npm run build:ui && npm run test --workspace @tech4good/platform-ui",
35
+ "pack:ui": "npm run build:ui && npm pack ./packages/ui/dist"
15
36
  },
16
37
  "keywords": [
17
38
  "schematics"
@@ -25,7 +46,8 @@
25
46
  "@angular-devkit/schematics-cli": "^21.2.0",
26
47
  "@schematics/angular": "^21.2.0",
27
48
  "inquirer": "^13.2.5",
28
- "typescript": "~5.8.3"
49
+ "typescript": "~5.9.3",
50
+ "@tech4good/platform-tooling": "0.1.0-alpha.2"
29
51
  },
30
52
  "devDependencies": {
31
53
  "@commitlint/cli": "^21.0.1",
@@ -35,6 +57,11 @@
35
57
  "conventional-changelog-cli": "^5.0.0",
36
58
  "conventional-changelog-conventionalcommits": "^8.0.0",
37
59
  "husky": "^9.1.7",
38
- "jasmine": "^5.1.0"
39
- }
60
+ "jasmine": "^5.1.0",
61
+ "ts-node": "^10.9.2",
62
+ "@angular/cli": "^21.2.0"
63
+ },
64
+ "workspaces": [
65
+ "packages/*"
66
+ ]
40
67
  }
@@ -2,10 +2,9 @@ import { render } from '@testing-library/angular';
2
2
  import userEvent from '@testing-library/user-event';
3
3
 
4
4
  import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
5
- import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
6
- import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
7
- import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
8
- import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
5
+ import { provideAppMocks } from 'src/app/core/testing/app-mocks';
6
+ import { BatchWriteMockService } from '@tech4good/platform-data/testing';
7
+ import { BATCH_WRITE_SERVICE } from '@tech4good/platform-data';
9
8
 
10
9
  /** Sets up the testing environment for <%= classify(name) %>Component using render.*/
11
10
  async function setup() {
@@ -15,7 +14,7 @@ async function setup() {
15
14
  const view = await render(<%= classify(name) %>Component, {
16
15
  imports: [],
17
16
  providers: [
18
- { provide: DATABASE_SERVICE, useClass: FirebaseMockService },
17
+ ...provideAppMocks(),
19
18
  { provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
20
19
  ],
21
20
  componentInputs: {},
@@ -1,7 +1,7 @@
1
1
  import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
2
2
  import { User } from 'src/app/core/store/user/user.model';
3
3
  import { AuthStore } from 'src/app/core/store/auth/auth.store';
4
- import { BatchWriteService, BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
4
+ import { BatchWriteService, BATCH_WRITE_SERVICE } from '@tech4good/platform-data';
5
5
 
6
6
  @Component({
7
7
  selector: 'app-<%= dasherize(name) %>',
@@ -1,11 +1,12 @@
1
- import { Timestamp } from '@angular/fire/firestore';
2
- import { <%= classify(name) %> } from './<%= dasherize(name) %>.model';
3
- import { withEntitiesForMockDB } from 'src/app/core/store/app.store';
1
+ import { dataTimestampNow } from '@tech4good/platform-data';
2
+ import { <%= classify(name) %>, <%= camelize(name) %>Entity } from './<%= dasherize(name) %>.model';
3
+ import { defineEntityMock, withEntitiesForMockDB } from '@tech4good/platform-data/testing';
4
4
  import { signalStore } from '@ngrx/signals';
5
5
 
6
+ /** Mock backend storage, separate from the frontend store populated by load/stream. */
6
7
  export const <%= classify(name) %>MockDB = signalStore(
7
8
  { providedIn: 'root' },
8
- withEntitiesForMockDB<<%= classify(name) %>>('<%= camelize(name) %>s'),
9
+ withEntitiesForMockDB<<%= classify(name) %>>(<%= camelize(name) %>Entity.collection),
9
10
  );
10
11
 
11
12
  /**
@@ -16,12 +17,19 @@ export function createMock<%= classify(name) %>(overrides?: Partial<<%= classify
16
17
  return {
17
18
  __id: '<%= dasherize(name) %>-default',<% if (parsedForeignKeys && parsedForeignKeys.length > 0) { parsedForeignKeys.forEach(function(fk) { %>
18
19
  __<%= fk %>: '<%= fk %>-default',<% }); } %>
19
- _createdAt: Timestamp.now(),
20
- _updatedAt: Timestamp.now(),
20
+ _createdAt: dataTimestampNow(),
21
+ _updatedAt: dataTimestampNow(),
21
22
  _deleted: false,
22
23
  ...overrides,
23
24
  };
24
25
  }
25
26
 
27
+ /** Default development fixtures; tests can override this collection's records. */
26
28
  export const <%= classify(name).toUpperCase() %>_DB: <%= classify(name) %>[] = [
27
29
  ];
30
+
31
+ /** Discovered by t4g-entities; keep mock imports in development/test provider composition. */
32
+ export const <%= camelize(name) %>Mock = defineEntityMock(<%= camelize(name) %>Entity, {
33
+ store: <%= classify(name) %>MockDB,
34
+ seeds: <%= classify(name).toUpperCase() %>_DB,
35
+ });
@@ -1,9 +1,15 @@
1
- import { Timestamp } from '@angular/fire/firestore';
1
+ import { DataEntity, defineEntity } from '@tech4good/platform-data';
2
2
 
3
- export interface <%= classify(name) %> {
4
- __id: string;<% if (parsedForeignKeys && parsedForeignKeys.length > 0) { parsedForeignKeys.forEach(function(fk) { %>
3
+ /** Stored <%= classify(name) %> fields; DataEntity supplies required identity/timestamp/deletion metadata. */
4
+ export interface <%= classify(name) %> extends DataEntity {<% if (parsedForeignKeys && parsedForeignKeys.length > 0) { parsedForeignKeys.forEach(function(fk) { %>
5
5
  __<%= fk %>: string;<% }); } %>
6
- _createdAt?: Timestamp;
7
- _updatedAt?: Timestamp;
8
- _deleted?: boolean;
9
6
  }
7
+
8
+ /**
9
+ * Collection identity shared by the store and generated registries.
10
+ * Keep this exported literal in the model file so t4g-entities can discover it.
11
+ * Adding an entity needs no central type union or mock-service registration.
12
+ */
13
+ export const <%= camelize(name) %>Entity = defineEntity<<%= classify(name) %>>({
14
+ collection: '<%= camelize(name) %>s',
15
+ });
@@ -1,41 +1,49 @@
1
1
  import { inject, effect, WritableSignal } from '@angular/core';
2
2
  import { signalStore, withState, withMethods } from '@ngrx/signals';
3
3
  import { withEntities, removeEntity, updateEntity, setEntity, removeEntities, setEntities } from '@ngrx/signals/entities';
4
- import { EntityLoadQuery, EntityStreamQuery, selectEntities, processLoadQueries, withEntitiesAndDBMethods } from 'src/app/core/store/app.store';
5
- import { QueryParams, QueryOptions, AnyEntity } from 'src/app/core/store/app.model';
6
- import { <%= classify(name) %> } from './<%= dasherize(name) %>.model';
4
+ import { EntityLoadQuery, EntityStreamQuery, selectEntities, processLoadQueries, withEntitiesAndDBMethods } from '@tech4good/platform-data';
5
+ import { QueryParams, QueryOptions } from '@tech4good/platform-data';
6
+ import { DataEntity } from '@tech4good/platform-data';
7
+ import { <%= classify(name) %>, <%= camelize(name) %>Entity } from './<%= dasherize(name) %>.model';
7
8
 
9
+ /** Describes a nested one-shot load; constructing it does not fetch data. */
8
10
  export class Load<%= classify(name) %> extends EntityLoadQuery<<%= classify(name) %>> {
9
11
  constructor(
10
12
  store,
11
13
  queryParams: QueryParams,
12
14
  queryOptions: QueryOptions,
13
- loadQueries?: (entity: <%= classify(name) %>) => EntityLoadQuery<AnyEntity>[],
15
+ loadQueries?: (entity: <%= classify(name) %>) => EntityLoadQuery<DataEntity>[],
14
16
  ) {
15
- super('<%= camelize(name) %>s', store, queryParams, queryOptions, loadQueries);
17
+ super(<%= camelize(name) %>Entity.collection, store, queryParams, queryOptions, loadQueries);
16
18
  }
17
19
 
18
- static create(store, queryParams: QueryParams, queryOptions: QueryOptions, loadQueries?: (entity: <%= classify(name) %>) => EntityLoadQuery<AnyEntity>[]): Load<%= classify(name) %> {
20
+ static create(store, queryParams: QueryParams, queryOptions: QueryOptions, loadQueries?: (entity: <%= classify(name) %>) => EntityLoadQuery<DataEntity>[]): Load<%= classify(name) %> {
19
21
  return new Load<%= classify(name) %>(store, queryParams, queryOptions, loadQueries);
20
22
  }
21
23
  }
22
24
 
25
+ /** Describes a nested live query whose listener follows the calling component's lifetime. */
23
26
  export class Stream<%= classify(name) %> extends EntityStreamQuery<<%= classify(name) %>> {
24
27
  constructor(
25
28
  store,
26
29
  queryParams: QueryParams,
27
30
  queryOptions: QueryOptions,
28
- streamQueries?: (entity: <%= classify(name) %>) => EntityStreamQuery<AnyEntity>[],
31
+ streamQueries?: (entity: <%= classify(name) %>) => EntityStreamQuery<DataEntity>[],
29
32
  ) {
30
- super('<%= camelize(name) %>s', store, queryParams, queryOptions, streamQueries);
33
+ super(<%= camelize(name) %>Entity.collection, store, queryParams, queryOptions, streamQueries);
31
34
  }
32
35
 
33
- static create(store, queryParams: QueryParams, queryOptions: QueryOptions, streamQueries?: (entity: <%= classify(name) %>) => EntityStreamQuery<AnyEntity>[]): Stream<%= classify(name) %> {
36
+ static create(store, queryParams: QueryParams, queryOptions: QueryOptions, streamQueries?: (entity: <%= classify(name) %>) => EntityStreamQuery<DataEntity>[]): Stream<%= classify(name) %> {
34
37
  return new Stream<%= classify(name) %>(store, queryParams, queryOptions, streamQueries);
35
38
  }
36
39
  }
37
40
 
41
+ /**
42
+ * Frontend entity state plus shared selectors, loading, streaming and writes.
43
+ * The app's DATA_ACCESS provider selects the real or mock backend. Components
44
+ * share this root store; its records survive navigation and listener teardown.
45
+ */
38
46
  export const <%= classify(name) %>Store = signalStore(
39
47
  { providedIn: 'root' },
40
- withEntitiesAndDBMethods<<%= classify(name) %>>('<%= camelize(name) %>s'),
48
+ withEntitiesAndDBMethods<<%= classify(name) %>>(<%= camelize(name) %>Entity.collection),
41
49
  );
@@ -3,58 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.entity = entity;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const change_1 = require("@schematics/angular/utility/change");
6
- const find_module_1 = require("@schematics/angular/utility/find-module");
7
6
  const parse_name_1 = require("@schematics/angular/utility/parse-name");
8
7
  const workspace_1 = require("@schematics/angular/utility/workspace");
9
8
  const core_1 = require("@angular-devkit/core");
10
9
  const statements_adder_1 = require("../shared/statements-adder");
10
+ const entity_registry_1 = require("../shared/entity-registry");
11
11
  function addInserts(options) {
12
12
  return (host, context) => {
13
13
  const classifiedName = core_1.strings.classify(options.name);
14
14
  const camelizedName = core_1.strings.camelize(options.name);
15
- const dasherizedName = core_1.strings.dasherize(options.name);
16
- const allcapsName = core_1.strings.classify(options.name).toUpperCase();
17
- context.logger.info(`names: ${classifiedName}, ${camelizedName}`);
18
- // app.model.ts changes
19
- const appModelPath = '/src/app/core/store/app.model.ts';
20
- const appModelText = (0, statements_adder_1.getSourceText)(host, appModelPath);
21
- context.logger.info(`appModelPath: ${appModelPath}`);
22
- const entityModelPath = `/${options.path}/` +
23
- dasherizedName + '/' +
24
- dasherizedName + '.model';
25
- context.logger.info(`entityModelPath: ${entityModelPath}`);
26
- const appToEntityModelPath = (0, find_module_1.buildRelativePath)(appModelPath, entityModelPath);
27
- context.logger.info(`appToEntityPath: ${appToEntityModelPath}`);
28
- let insertChangesInAppModel = (0, statements_adder_1.simpleInsert)(appModelText, appModelPath, [
29
- '// Entity Models',
30
- 'export type AnyEntity =',
31
- ], [
32
- `import { ${classifiedName} } from '${appToEntityModelPath}';`,
33
- ` ${classifiedName} |`
34
- ]);
35
- // firebase.mock.service.ts changes
36
- const fbMockPath = '/src/app/core/firebase/firebase.mock.service.ts';
37
- const fbMockText = (0, statements_adder_1.getSourceText)(host, fbMockPath);
38
- const entityMockPath = `/${options.path}/` +
39
- dasherizedName + '/' +
40
- dasherizedName + '.mock';
41
- const fbToEntityMockPath = (0, find_module_1.buildRelativePath)(fbMockPath, entityMockPath);
42
- context.logger.info(`fbMockPath: ${fbMockPath}`);
43
- let insertChangesInFbMock = (0, statements_adder_1.simpleInsert)(fbMockText, fbMockPath, [
44
- '// Entity Model DB Data',
45
- 'readonly DB = {',
46
- '// Init Entity Models',
47
- 'export function provideFirebaseMock({',
48
- '}: {',
49
- 'const service = new FirebaseMockService(injector);',
50
- ], [
51
- `import { ${classifiedName}MockDB, ${allcapsName}_DB } from '${fbToEntityMockPath}';`,
52
- ` '${camelizedName}s': inject(${classifiedName}MockDB),`,
53
- ` this.DB['${camelizedName}s'].init(${allcapsName}_DB);`,
54
- ` ${camelizedName}s,`,
55
- ` ${camelizedName}s?: any[];`,
56
- ` if (${camelizedName}s) service.DB['${camelizedName}s'].init(${camelizedName}s);`
57
- ]);
58
15
  // firestore.rules changes
59
16
  const rulesPath = '/firestore.rules';
60
17
  let rulesInsertChanges = [];
@@ -69,10 +26,7 @@ function addInserts(options) {
69
26
  }
70
27
  context.logger.info(`about to start committing`);
71
28
  // For each of the files and corresponding set of changes, commit to the tree
72
- const fileChanges = [
73
- [appModelPath, insertChangesInAppModel],
74
- [fbMockPath, insertChangesInFbMock],
75
- ];
29
+ const fileChanges = [];
76
30
  if (rulesInsertChanges.length > 0) {
77
31
  fileChanges.push([rulesPath, rulesInsertChanges]);
78
32
  }
@@ -189,7 +143,8 @@ function entity(options) {
189
143
  return (0, schematics_1.chain)([
190
144
  addInserts(options),
191
145
  addFirestoreIndex(options),
192
- (0, schematics_1.mergeWith)(templateSource)
146
+ (0, schematics_1.mergeWith)(templateSource),
147
+ (0, entity_registry_1.updateEntityRegistry)(),
193
148
  ]);
194
149
  };
195
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AA4KA,wBA4EC;AAxPD,2DAIoC;AAEpC,+DAA0E;AAC1E,yEAA4E;AAC5E,uEAAmE;AACnE,qEAAuF;AACvF,+CAA+C;AAE/C,iEAAuF;AAEvF,SAAS,UAAU,CAA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