@tech4good/angular-schematics 21.5.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.
- package/CHANGELOG.md +44 -0
- package/README.md +266 -1
- package/package.json +34 -7
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +4 -5
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +1 -1
- package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +16 -7
- package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +13 -6
- package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +18 -10
- package/src/entity/index.js +61 -49
- package/src/entity/index.js.map +1 -1
- package/src/entity/schema.json +4 -0
- package/src/guard/files/__name@dasherize__.guard.spec.ts.template +0 -1
- package/src/ng-add/files/.github/workflows/angular-github-ci.yml.template +3 -0
- package/src/ng-add/files/.gitignore.template +5 -0
- package/src/ng-add/files/analytics/datasets.js.template +206 -0
- package/src/ng-add/files/analytics/entity_sources.js.template +58 -0
- package/src/ng-add/files/analytics/entity_sources.test.js.template +57 -0
- package/src/ng-add/files/analytics/lib/api_query.js.template +87 -0
- package/src/ng-add/files/analytics/lib/api_query.test.js.template +84 -0
- package/src/ng-add/files/analytics/lib/bigquery_query_compatibility.test.js.template +53 -0
- package/src/ng-add/files/analytics/lib/dataset_schema.js.template +53 -0
- package/src/ng-add/files/analytics/lib/dataset_schema.test.js.template +34 -0
- package/src/ng-add/files/analytics/lib/entity_sync.js.template +397 -0
- package/src/ng-add/files/analytics/lib/entity_sync.test.js.template +212 -0
- package/src/ng-add/files/analytics/lib/identifier_salt.js.template +57 -0
- package/src/ng-add/files/analytics/lib/identifier_salt.test.js.template +36 -0
- package/src/ng-add/files/analytics/lib/snapshot_files.js.template +46 -0
- package/src/ng-add/files/analytics/lib/snapshot_files.test.js.template +67 -0
- package/src/ng-add/files/analytics/lib/sqlite.js.template +92 -0
- package/src/ng-add/files/analytics/lib/upload_entities.js.template +81 -0
- package/src/ng-add/files/analytics/lib/upload_entities.test.js.template +86 -0
- package/src/ng-add/files/analytics/proxy.conf.json.template +7 -0
- package/src/ng-add/files/analytics/scripts/refresh_snapshot.js.template +518 -0
- package/src/ng-add/files/analytics/scripts/start.js.template +88 -0
- package/src/ng-add/files/analytics/server/server.js.template +212 -0
- package/src/ng-add/files/angular.json.template +80 -1
- package/src/ng-add/files/bigquery/queries/active_time_by_route.sql.template +27 -8
- package/src/ng-add/files/bigquery/queries/active_user_windows.sql.template +67 -0
- package/src/ng-add/files/bigquery/queries/dashboard_route_visits.sql.template +47 -0
- package/src/ng-add/files/bigquery/queries/data_quality.sql.template +323 -0
- package/src/ng-add/files/bigquery/queries/onboarding_funnel.sql.template +512 -0
- package/src/ng-add/files/bigquery/queries/onboarding_stage_observations.sql.template +134 -0
- package/src/ng-add/files/bigquery/queries/weekly_retention_cohorts.sql.template +90 -0
- package/src/ng-add/files/bigquery/scripts/export_entities.js.template +120 -0
- package/src/ng-add/files/bigquery/scripts/init_views.js.template +57 -0
- package/src/ng-add/files/bigquery/scripts/run_query.js.template +141 -0
- package/src/ng-add/files/bigquery/views/events_flat.sql.template +27 -12
- package/src/ng-add/files/bigquery/views/logs_latest.sql.template +16 -3
- package/src/ng-add/files/docs-infra/analytics-guide.md.template +270 -25
- package/src/ng-add/files/docs-infra/analytics-workbench-guide.md.template +307 -0
- package/src/ng-add/files/docs-infra/authentication-architecture.md.template +300 -0
- package/src/ng-add/files/docs-infra/email-infrastructure.md.template +43 -0
- package/src/ng-add/files/docs-infra/firestore-index-checker.md.template +87 -0
- package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +123 -38
- package/src/ng-add/files/docs-infra/load-system-architecture.md.template +15 -1
- package/src/ng-add/files/docs-infra/querying-strategy.md.template +14 -0
- package/src/ng-add/files/docs-infra/stream-system-architecture.md.template +21 -7
- package/src/ng-add/files/eslint.config.js.template +22 -3
- package/src/ng-add/files/firebase.json.template +6 -0
- package/src/ng-add/files/firestore.indexes.json.template +23 -0
- package/src/ng-add/files/firestore.rules.spec.ts.template +84 -15
- package/src/ng-add/files/firestore.rules.template +29 -17
- package/src/ng-add/files/functions/.gitignore.template +3 -0
- package/src/ng-add/files/functions/package.json.template +13 -0
- package/src/ng-add/files/functions/src/email.ts.template +23 -0
- package/src/ng-add/files/functions/src/index.ts.template +44 -0
- package/src/ng-add/files/functions/tsconfig.json.template +13 -0
- package/src/ng-add/files/jest.config.ts.template +3 -2
- package/src/ng-add/files/package.json.template +41 -16
- package/src/ng-add/files/projects/analytics/src/app/analytics-api.service.ts.template +130 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.html.template +77 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.scss.template +240 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.ts.template +96 -0
- package/src/ng-add/files/projects/analytics/src/app/app.routes.ts.template +11 -0
- package/src/ng-add/files/projects/analytics/src/app/dashboard-pages.spec.ts.template +151 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.html.template +39 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.ts.template +95 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.html.template +47 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.ts.template +120 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.html.template +40 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.ts.template +98 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.html.template +35 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.ts.template +84 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.html.template +42 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.ts.template +110 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/analytics-utils.ts.template +43 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/chart-theme.ts.template +42 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-layout.scss.template +239 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.html.template +76 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.scss.template +128 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.spec.ts.template +31 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.ts.template +153 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.html.template +16 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.scss.template +63 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.ts.template +52 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.html.template +5 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.scss.template +56 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.spec.ts.template +30 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.ts.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.html.template +9 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.scss.template +43 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.ts.template +62 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.html.template +9 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.scss.template +33 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.ts.template +82 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.html.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.scss.template +45 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.ts.template +55 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.html.template +18 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.scss.template +45 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.ts.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/vega-chart/vega-chart.component.ts.template +121 -0
- package/src/ng-add/files/projects/analytics/src/index.html.template +19 -0
- package/src/ng-add/files/projects/analytics/src/main.ts.template +16 -0
- package/src/ng-add/files/projects/analytics/src/styles.scss.template +28 -0
- package/src/ng-add/files/projects/analytics/tsconfig.app.json.template +13 -0
- package/src/ng-add/files/projects/analytics/tsconfig.spec.json.template +15 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.html.template +3 -1
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +10 -13
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.ts.template +2 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.spec.ts.template +11 -12
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.ts.template +7 -7
- 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
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.ts.template +3 -2
- package/src/ng-add/files/src/app/app.component.html.template +3 -3
- package/src/ng-add/files/src/app/app.component.scss.template +1 -1
- package/src/ng-add/files/src/app/app.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/app.component.ts.template +3 -2
- package/src/ng-add/files/src/app/app.config.ts.template +21 -15
- package/src/ng-add/files/src/app/app.routes.ts.template +6 -0
- package/src/ng-add/files/src/app/auth-routing.spec.ts.template +13 -9
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +46 -29
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +27 -18
- package/src/ng-add/files/src/app/core/auth/auth.providers.spec.ts.template +112 -0
- package/src/ng-add/files/src/app/core/auth/auth.providers.ts.template +48 -0
- package/src/ng-add/files/src/app/core/auth/auth.service.ts.template +14 -23
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.spec.ts.template +27 -0
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.ts.template +3 -2
- package/src/ng-add/files/src/app/core/auth/guards/require-auth-and-consent.guard.ts.template +7 -2
- package/src/ng-add/files/src/app/core/firebase/data.providers.prod.ts.template +21 -0
- package/src/ng-add/files/src/app/core/firebase/data.providers.ts.template +13 -0
- package/src/ng-add/files/src/app/core/local-storage/session.service.spec.ts.template +43 -0
- package/src/ng-add/files/src/app/core/local-storage/session.service.ts.template +7 -0
- package/src/ng-add/files/src/app/core/store/app-data.spec.ts.template +76 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +20 -82
- package/src/ng-add/files/src/app/core/store/auth/auth.store.spec.ts.template +217 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +36 -172
- package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +18 -15
- package/src/ng-add/files/src/app/core/store/user/user.model.ts.template +7 -8
- package/src/ng-add/files/src/app/core/store/user/user.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/store/user-context/user-context.mock.ts.template +20 -8
- package/src/ng-add/files/src/app/core/store/user-context/user-context.model.ts.template +5 -6
- package/src/ng-add/files/src/app/core/store/user-context/user-context.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/store/user-private/user-private.mock.ts.template +20 -7
- package/src/ng-add/files/src/app/core/store/user-private/user-private.model.ts.template +6 -6
- package/src/ng-add/files/src/app/core/store/user-private/user-private.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/testing/app-mocks.ts.template +42 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.html.template +4 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.scss.template +1 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.ts.template +38 -0
- package/src/ng-add/files/src/app/first-time/consent/consent.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/consent/consent.component.scss.template +7 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +31 -11
- package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +16 -1
- package/src/ng-add/files/src/app/first-time/consent/consent.guard.ts.template +5 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +27 -16
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +102 -49
- package/src/ng-add/files/src/app/first-time/early-access/early-access.guard.ts.template +5 -1
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.scss.template +7 -3
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.spec.ts.template +20 -6
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.ts.template +2 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.html.template +18 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.scss.template +2 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.spec.ts.template +56 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.ts.template +91 -0
- package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +11 -7
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.html.template +19 -7
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.scss.template +51 -0
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.ts.template +44 -5
- package/src/ng-add/files/src/app/first-time/landing/landing.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.scss.template +12 -8
- package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +33 -10
- package/src/ng-add/files/src/app/first-time/landing/landing.component.ts.template +6 -19
- package/src/ng-add/files/src/app/first-time/login/login.component.html.template +58 -6
- package/src/ng-add/files/src/app/first-time/login/login.component.scss.template +151 -22
- package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +30 -32
- package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +85 -31
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +4 -2
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.ts.template +1 -1
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.html.template +12 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.scss.template +39 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.spec.ts.template +68 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.ts.template +20 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.html.template +24 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.scss.template +50 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.spec.ts.template +65 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.ts.template +59 -0
- package/src/ng-add/files/src/app/main/account-profile/guest-deletion-dialog.component.ts.template +51 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.html.template +50 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.scss.template +137 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.spec.ts.template +57 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.ts.template +59 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.html.template +133 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.scss.template +207 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.spec.ts.template +74 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.ts.template +130 -0
- package/src/ng-add/files/src/app/main/home/home.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/main/home/home.component.ts.template +1 -6
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.html.template +15 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.scss.template +79 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.spec.ts.template +59 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.ts.template +44 -0
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.html.template +45 -15
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.scss.template +103 -19
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +73 -9
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.ts.template +46 -18
- package/src/ng-add/files/src/environments/environment.prod.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.test.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.ts.template +1 -1
- package/src/ng-add/files/tsconfig.spec.json.template +3 -1
- package/src/ng-add/index.js +7 -0
- package/src/ng-add/index.js.map +1 -1
- package/src/shared/entity-registry.d.ts +8 -0
- package/src/shared/entity-registry.js +28 -0
- package/src/shared/entity-registry.js.map +1 -0
- package/tsconfig.json +2 -2
- package/.agents/skills/publish-npm/SKILL.md +0 -37
- package/.agents/skills/publish-npm/eval.yaml +0 -32
- package/.agents/skills/publish-npm/fixtures/package-v21.json.template +0 -8
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.t4g/agent-memory.db +0 -0
- package/src/component/index_spec.d.ts +0 -1
- package/src/component/index_spec.js +0 -68
- package/src/component/index_spec.js.map +0 -1
- package/src/entity/index_spec.d.ts +0 -1
- package/src/entity/index_spec.js +0 -153
- package/src/entity/index_spec.js.map +0 -1
- package/src/guard/index_spec.d.ts +0 -1
- package/src/guard/index_spec.js +0 -64
- package/src/guard/index_spec.js.map +0 -1
- package/src/ng-add/files/bigquery/scripts/export_entities.py.template +0 -143
- package/src/ng-add/files/bigquery/scripts/run_query.py.template +0 -167
- package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +0 -494
- package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +0 -56
- package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +0 -366
- package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +0 -342
- package/src/ng-add/files/src/app/core/firebase/simulate-load.spec.ts.template +0 -104
- package/src/ng-add/files/src/app/core/firebase/simulate-stream.spec.ts.template +0 -127
- package/src/ng-add/files/src/app/core/firebase/simulation.mock.ts.template +0 -38
- package/src/ng-add/files/src/app/core/firebase/stream-multiplexer.ts.template +0 -445
- package/src/ng-add/files/src/app/core/logging/logging.service.spec.ts.template +0 -118
- package/src/ng-add/files/src/app/core/logging/logging.service.ts.template +0 -168
- package/src/ng-add/files/src/app/core/store/app.model.ts.template +0 -21
- package/src/ng-add/files/src/app/core/store/app.store.spec.ts.template +0 -920
- package/src/ng-add/files/src/app/core/store/app.store.ts.template +0 -1317
- package/src/ng-add/files/src/app/core/store/batch-write.firebase.service.ts.template +0 -58
- package/src/ng-add/files/src/app/core/store/batch-write.mock.service.ts.template +0 -105
- package/src/ng-add/files/src/app/core/store/batch-write.service.ts.template +0 -126
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +0 -9
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.scss.template +0 -46
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +0 -69
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +0 -39
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.spec.ts.template +0 -122
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +0 -88
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/angular';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
|
-
import { Provider } from '@angular/core';
|
|
3
|
+
import { Injectable, Provider, signal } from '@angular/core';
|
|
4
|
+
import { provideRouter } from '@angular/router';
|
|
5
|
+
import { provideAppMocks } from 'src/app/core/testing/app-mocks';
|
|
4
6
|
|
|
5
7
|
import { NavbarComponent } from './navbar.component';
|
|
6
8
|
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
@@ -13,7 +15,9 @@ async function setup(providers: Provider[] = []) {
|
|
|
13
15
|
|
|
14
16
|
const view = await render(NavbarComponent, {
|
|
15
17
|
providers: [
|
|
18
|
+
provideRouter([]),
|
|
16
19
|
{ provide: AuthStore, useClass: AuthMockDB },
|
|
20
|
+
...provideAppMocks({ disableLatency: true }),
|
|
17
21
|
...providers,
|
|
18
22
|
],
|
|
19
23
|
});
|
|
@@ -26,19 +30,36 @@ async function setup(providers: Provider[] = []) {
|
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
describe('NavbarComponent', () => {
|
|
33
|
+
it('should show the application brand', async () => {
|
|
34
|
+
await setup();
|
|
35
|
+
expect(screen.getByText('<%= classify(project) %>')).toBeVisible();
|
|
36
|
+
});
|
|
37
|
+
|
|
29
38
|
it('should not show profile picture when logged out', async () => {
|
|
30
39
|
await setup();
|
|
31
|
-
expect(screen.
|
|
40
|
+
expect(screen.queryByAltText('Profile Picture')).toBeNull();
|
|
32
41
|
});
|
|
33
42
|
|
|
34
|
-
it('should show profile picture when logged in, and clicking it opens menu
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
it('should show profile picture when logged in with a photo URL, and clicking it opens menu', async () => {
|
|
44
|
+
@Injectable()
|
|
45
|
+
class AuthWithPhotoMockDB extends AuthLoggedInMockDB {
|
|
46
|
+
override user = signal({ ...USER_DB[0], photoURL: 'https://example.com/avatar.jpg' });
|
|
47
|
+
override afUser = signal({
|
|
48
|
+
uid: USER_DB[0].__id,
|
|
49
|
+
email: 'user@example.com',
|
|
50
|
+
displayName: 'User A',
|
|
51
|
+
photoURL: 'https://example.com/avatar.jpg',
|
|
52
|
+
isAnonymous: false,
|
|
53
|
+
emailVerified: true,
|
|
54
|
+
emailLinkEnabled: false,
|
|
55
|
+
providerIds: ['google.com'],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const { user, authStore } = await setup([{ provide: AuthStore, useClass: AuthWithPhotoMockDB }]);
|
|
38
59
|
|
|
39
|
-
const profilePic = screen.
|
|
60
|
+
const profilePic = screen.getByAltText('Profile Picture');
|
|
40
61
|
expect(profilePic).toBeVisible();
|
|
41
|
-
expect(profilePic).toHaveAttribute('src',
|
|
62
|
+
expect(profilePic).toHaveAttribute('src', 'https://example.com/avatar.jpg');
|
|
42
63
|
|
|
43
64
|
// Menu should not be in the document initially
|
|
44
65
|
expect(screen.queryByText(/Logout/i)).toBeNull();
|
|
@@ -46,7 +67,8 @@ describe('NavbarComponent', () => {
|
|
|
46
67
|
// Click profile pic to open menu
|
|
47
68
|
await user.click(profilePic);
|
|
48
69
|
|
|
49
|
-
// Logout should be visible now
|
|
70
|
+
// Profile & Settings link & Logout button should be visible now
|
|
71
|
+
expect(screen.getByText(/Profile & Settings/i)).toBeVisible();
|
|
50
72
|
const logoutBtn = screen.getByText(/Logout/i);
|
|
51
73
|
expect(logoutBtn).toBeVisible();
|
|
52
74
|
|
|
@@ -55,4 +77,46 @@ describe('NavbarComponent', () => {
|
|
|
55
77
|
expect(logoutSpy).toHaveBeenCalled();
|
|
56
78
|
logoutSpy.mockRestore();
|
|
57
79
|
});
|
|
80
|
+
|
|
81
|
+
it('renders initial letter avatar fallback when user has no photoURL', async () => {
|
|
82
|
+
@Injectable()
|
|
83
|
+
class AuthLoggedInNoPhotoMockDB extends AuthLoggedInMockDB {
|
|
84
|
+
override user = signal({ ...USER_DB[0], photoURL: null as string | null });
|
|
85
|
+
}
|
|
86
|
+
const { user } = await setup([{ provide: AuthStore, useClass: AuthLoggedInNoPhotoMockDB }]);
|
|
87
|
+
|
|
88
|
+
expect(screen.queryByAltText('Profile Picture')).toBeNull();
|
|
89
|
+
const avatarFallback = screen.getByRole('button', { name: /User Profile Menu/i });
|
|
90
|
+
expect(avatarFallback).toBeVisible();
|
|
91
|
+
expect(avatarFallback).toHaveTextContent(USER_DB[0].name.charAt(0).toUpperCase());
|
|
92
|
+
|
|
93
|
+
await user.click(avatarFallback);
|
|
94
|
+
expect(screen.getByText(/Profile & Settings/i)).toBeVisible();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('falls back to initial letter avatar if photoURL triggers an error event', async () => {
|
|
98
|
+
@Injectable()
|
|
99
|
+
class AuthWithPhotoMockDB extends AuthLoggedInMockDB {
|
|
100
|
+
override user = signal({ ...USER_DB[0], photoURL: 'https://example.com/broken.jpg' });
|
|
101
|
+
override afUser = signal({
|
|
102
|
+
uid: USER_DB[0].__id,
|
|
103
|
+
email: 'user@example.com',
|
|
104
|
+
displayName: 'User A',
|
|
105
|
+
photoURL: 'https://example.com/broken.jpg',
|
|
106
|
+
isAnonymous: false,
|
|
107
|
+
emailVerified: true,
|
|
108
|
+
emailLinkEnabled: false,
|
|
109
|
+
providerIds: ['google.com'],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const { fixture } = await setup([{ provide: AuthStore, useClass: AuthWithPhotoMockDB }]);
|
|
113
|
+
|
|
114
|
+
const profilePic = screen.getByAltText('Profile Picture');
|
|
115
|
+
profilePic.dispatchEvent(new Event('error'));
|
|
116
|
+
fixture.detectChanges();
|
|
117
|
+
|
|
118
|
+
expect(screen.queryByAltText('Profile Picture')).toBeNull();
|
|
119
|
+
const avatarFallback = screen.getByRole('button', { name: /User Profile Menu/i });
|
|
120
|
+
expect(avatarFallback).toBeVisible();
|
|
121
|
+
});
|
|
58
122
|
});
|
|
@@ -1,39 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Component, ChangeDetectionStrategy, computed, inject, signal } from '@angular/core';
|
|
2
|
+
import { AccessState } from 'src/app/core/store/user/user.model';
|
|
3
3
|
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
4
|
-
import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
|
|
4
|
+
import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu';
|
|
5
|
+
import { RouterLink } from '@angular/router';
|
|
5
6
|
|
|
7
|
+
function isValidPhotoUrl(url: string | null | undefined): boolean {
|
|
8
|
+
if (!url || typeof url !== 'string') return false;
|
|
9
|
+
const trimmed = url.trim();
|
|
10
|
+
if (trimmed === '' || trimmed === 'null' || trimmed === 'undefined') return false;
|
|
11
|
+
if (trimmed.includes('loremflickr.com')) return false;
|
|
12
|
+
return trimmed.startsWith('http://') || trimmed.startsWith('https://') || trimmed.startsWith('/');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Shared top navigation bar component across the application.
|
|
17
|
+
* Displays the application brand and provides a user account profile menu with logout.
|
|
18
|
+
*/
|
|
6
19
|
@Component({
|
|
7
20
|
selector: 'app-navbar',
|
|
8
21
|
templateUrl: './navbar.component.html',
|
|
9
22
|
styleUrl: './navbar.component.scss',
|
|
10
23
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
imports: [MatMenuTrigger, MatMenu],
|
|
24
|
+
imports: [MatMenuTrigger, MatMenu, MatMenuItem, RouterLink],
|
|
12
25
|
})
|
|
13
|
-
export class NavbarComponent
|
|
26
|
+
export class NavbarComponent {
|
|
14
27
|
readonly authStore = inject(AuthStore);
|
|
15
28
|
|
|
16
29
|
// --------------- INPUTS AND OUTPUTS ------------------
|
|
17
30
|
|
|
18
|
-
/**
|
|
19
|
-
|
|
31
|
+
/** Track image load errors to fallback to initial letter avatar if photoURL fails to load. */
|
|
32
|
+
readonly hasPhotoError = signal(false);
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
onPhotoError() {
|
|
35
|
+
this.hasPhotoError.set(true);
|
|
36
|
+
}
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
/** The current signed in user (with fallback to afUser session if store entity is loading). */
|
|
39
|
+
readonly currentUser = computed(() => {
|
|
40
|
+
const user = this.authStore.user();
|
|
41
|
+
if (user) return user;
|
|
42
|
+
const afUser = this.authStore.afUser?.();
|
|
43
|
+
if (!afUser) return null;
|
|
44
|
+
return {
|
|
45
|
+
__id: afUser.uid,
|
|
46
|
+
name: afUser.displayName || afUser.email || (afUser.isAnonymous ? 'Guest' : 'Learner'),
|
|
47
|
+
photoURL: afUser.photoURL,
|
|
48
|
+
isAdmin: false,
|
|
49
|
+
consented: false,
|
|
50
|
+
accessState: AccessState.SUBMIT_INTEREST,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/** Validated image photo URL to render (or null for letter avatar fallback). */
|
|
55
|
+
readonly userPhotoUrl = computed(() => {
|
|
56
|
+
if (this.hasPhotoError()) return null;
|
|
57
|
+
const user = this.currentUser();
|
|
58
|
+
return user && isValidPhotoUrl(user.photoURL) ? user.photoURL! : null;
|
|
59
|
+
});
|
|
24
60
|
|
|
25
61
|
// --------------- EVENT HANDLING ----------------------
|
|
26
62
|
|
|
27
|
-
/** Logout. */
|
|
63
|
+
/** Logout current user. */
|
|
28
64
|
logout() {
|
|
29
65
|
this.authStore.logout();
|
|
30
66
|
}
|
|
31
|
-
|
|
32
|
-
// --------------- OTHER -------------------------------
|
|
33
|
-
|
|
34
|
-
constructor() {
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
ngOnInit(): void {
|
|
38
|
-
}
|
|
39
67
|
}
|
package/src/ng-add/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAdd = ngAdd;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
//import { InsertChange } from '@schematics/angular/utility/change';
|
|
6
7
|
//import { buildRelativePath, findModuleFromOptions } from '@schematics/angular/utility/find-module';
|
|
@@ -8,6 +9,10 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
8
9
|
//import { validateHtmlSelector } from '@schematics/angular/utility/validation';
|
|
9
10
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
10
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
|
+
const fs_1 = require("fs");
|
|
13
|
+
const path = tslib_1.__importStar(require("path"));
|
|
14
|
+
const entity_registry_1 = require("../shared/entity-registry");
|
|
15
|
+
const schematicsVersion = JSON.parse((0, fs_1.readFileSync)(path.join(__dirname, '../../package.json'), 'utf8')).version;
|
|
11
16
|
//import { getSourceText, simpleInsert } from '../shared/statements-adder';
|
|
12
17
|
function ngAdd(options) {
|
|
13
18
|
return async (tree, context) => {
|
|
@@ -30,6 +35,7 @@ function ngAdd(options) {
|
|
|
30
35
|
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
31
36
|
(0, schematics_1.applyTemplates)({
|
|
32
37
|
...core_1.strings,
|
|
38
|
+
schematicsVersion,
|
|
33
39
|
...options,
|
|
34
40
|
}),
|
|
35
41
|
//move(parsedPath.path),
|
|
@@ -54,6 +60,7 @@ function ngAdd(options) {
|
|
|
54
60
|
return tree;
|
|
55
61
|
},
|
|
56
62
|
(0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.Overwrite),
|
|
63
|
+
(0, entity_registry_1.updateEntityRegistry)(),
|
|
57
64
|
]);
|
|
58
65
|
};
|
|
59
66
|
}
|
package/src/ng-add/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAsBA,sBAwDC;;AA9ED,2DAIoC;AACpC,oEAAoE;AACpE,qGAAqG;AACrG,qEAAqE;AACrE,gFAAgF;AAChF,qEAAuF;AAEvF,+CAA+C;AAC/C,2BAAkC;AAClC,mDAA6B;AAC7B,+DAAiE;AAEjE,MAAM,iBAAiB,GAAW,IAAI,CAAC,KAAK,CAC1C,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,CACjE,CAAC,OAAO,CAAC;AAEV,2EAA2E;AAE3E,SAAgB,KAAK,CAAC,OAAY;IAChC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QAErD,wFAAwF;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iIAAiI,CAAC,CAAC;YACvJ,OAAO,IAAA,iBAAI,GAAE,CAAC;QAChB,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,OA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BAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,SAAS,CAAC;YAClD,IAAA,sCAAoB,GAAE;SACvB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Refresh app registries after ng-add/entity templates merge into the virtual Tree.
|
|
4
|
+
* Read the Tree instead of disk because newly generated files are not written yet.
|
|
5
|
+
* Both schematics and the development CLI use the tooling package's same discovery
|
|
6
|
+
* rules; only this integration is responsible for applying results to a Tree.
|
|
7
|
+
*/
|
|
8
|
+
export declare function updateEntityRegistry(): Rule;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateEntityRegistry = updateEntityRegistry;
|
|
4
|
+
const platform_tooling_1 = require("@tech4good/platform-tooling");
|
|
5
|
+
/**
|
|
6
|
+
* Refresh app registries after ng-add/entity templates merge into the virtual Tree.
|
|
7
|
+
* Read the Tree instead of disk because newly generated files are not written yet.
|
|
8
|
+
* Both schematics and the development CLI use the tooling package's same discovery
|
|
9
|
+
* rules; only this integration is responsible for applying results to a Tree.
|
|
10
|
+
*/
|
|
11
|
+
function updateEntityRegistry() {
|
|
12
|
+
return (tree) => {
|
|
13
|
+
const sources = {};
|
|
14
|
+
tree.visit(file => {
|
|
15
|
+
if (/\.(model|mock)\.ts$/.test(file))
|
|
16
|
+
sources[file] = tree.read(file).toString();
|
|
17
|
+
});
|
|
18
|
+
const result = (0, platform_tooling_1.generateEntityRegistrySources)(sources);
|
|
19
|
+
for (const [file, source] of Object.entries(result.files)) {
|
|
20
|
+
if (tree.exists(file))
|
|
21
|
+
tree.overwrite(file, source);
|
|
22
|
+
else
|
|
23
|
+
tree.create(file, source);
|
|
24
|
+
}
|
|
25
|
+
return tree;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=entity-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-registry.js","sourceRoot":"","sources":["entity-registry.ts"],"names":[],"mappings":";;AASA,oDAaC;AArBD,kEAA4E;AAE5E;;;;;GAKG;AACH,SAAgB,oBAAoB;IAClC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAChB,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,QAAQ,EAAE,CAAC;QACpF,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,gDAA6B,EAAC,OAAO,CAAC,CAAC;QACtD,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1D,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;;gBAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
package/tsconfig.json
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: publish-npm
|
|
3
|
-
description: Automates semantic versioning and internal package.json.template updates for @tech4good/angular-schematics before npm publishing. Analyzes git history to recommend major/minor/patch bumps. Should trigger when user asks to publish to npm, release a new version, or bump versions. Should NOT trigger for standard git commits or if the user is asking about publishing in a different repository.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# NPM Publish Skill
|
|
7
|
-
|
|
8
|
-
This skill assists with the process of publishing a new version of the `@tech4good/angular-schematics` package. Since sandbox constraints prevent the agent from running `npm` publish commands directly, this skill focuses on the preparation and hand-off.
|
|
9
|
-
|
|
10
|
-
## Step 1: Analyze Git Logs and Recommend Version Bump
|
|
11
|
-
1. Use the `mcp_git_git_log` tool to review the git commit history since the last git tag.
|
|
12
|
-
2. Analyze the commit messages to determine the appropriate semantic version bump:
|
|
13
|
-
- **Major**: If there are any `BREAKING CHANGE` footers or `!` in the type/scope (e.g., `feat!: ...`).
|
|
14
|
-
- **Minor**: If there are any new features (`feat: ...`).
|
|
15
|
-
- **Patch**: If there are only bug fixes (`fix: ...`), documentation, or chore updates.
|
|
16
|
-
3. Read the current version from `package.json` at the root of the workspace. Also inspect the Angular dependencies (e.g., `@angular/core`) in `src/ng-add/files/package.json.template`. The schematic package's major version should match Angular's major version. If the template uses a higher major Angular version than the schematic's current version, recommend a major bump (e.g., `20.4.0` -> `21.0.0`) to match it.
|
|
17
|
-
4. Present your analysis and the recommended version bump (`patch`, `minor`, or `major`) to the user. State what the *new* version number will be.
|
|
18
|
-
5. **Halt execution** and wait for the user to approve the version bump type.
|
|
19
|
-
|
|
20
|
-
## Step 2: Update the Internal Template
|
|
21
|
-
1. Once the user approves the version bump (and the resulting new version number), calculate the exact new version (e.g., `20.1.0` -> `20.1.1` for patch).
|
|
22
|
-
2. Use the `replace_file_content` tool to update the `@tech4good/angular-schematics` dependency version in `src/ng-add/files/package.json.template`.
|
|
23
|
-
- Ensure the prefix (like `^`) is preserved if it exists. For example, change `"@tech4good/angular-schematics": "^20.1.0"` to `"@tech4good/angular-schematics": "^20.1.1"`.
|
|
24
|
-
3. Trigger the `git-commit` skill to commit this template update (e.g., `build(ng-add): bump template dependency for release`). This is required because `npm version` requires a clean git working directory. Be sure to follow all `git-commit` artifact planning requirements.
|
|
25
|
-
|
|
26
|
-
## Step 3: Handoff Instructions
|
|
27
|
-
1. Inform the user that the template has been updated successfully.
|
|
28
|
-
2. Provide the user with the following exact commands to run in their local terminal to complete the release process:
|
|
29
|
-
```bash
|
|
30
|
-
npm run release:<type>
|
|
31
|
-
npm run build
|
|
32
|
-
npm login
|
|
33
|
-
npm publish
|
|
34
|
-
```
|
|
35
|
-
*(Replace `<type>` with the agreed-upon bump type: `patch`, `minor`, or `major`)*.
|
|
36
|
-
3. Remind them that `npm run release:<type>` will automatically bump the root `package.json`, update the `CHANGELOG.md`, stage the files, and create a new git tag.
|
|
37
|
-
4. Remind the user they must have access to the `@tech4good` organization to publish successfully.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
version: "1"
|
|
2
|
-
tasks:
|
|
3
|
-
- name: test-publish-npm-recommendation
|
|
4
|
-
instruction: |
|
|
5
|
-
Use the publish-npm skill to analyze the recent git history and recommend a semantic version bump, then update the template file based on my approval. I approve of a "patch" bump to "20.1.1".
|
|
6
|
-
workspace:
|
|
7
|
-
- src: src/ng-add/files/package.json.template
|
|
8
|
-
dest: src/ng-add/files/package.json.template
|
|
9
|
-
graders:
|
|
10
|
-
- type: llm_rubric
|
|
11
|
-
rubric: |
|
|
12
|
-
Did the agent correctly check the git logs?
|
|
13
|
-
Did the agent correctly recommend a version bump type and wait for user approval?
|
|
14
|
-
Did the agent correctly update the "@tech4good/angular-schematics" dependency version in "src/ng-add/files/package.json.template" while preserving the semver prefix?
|
|
15
|
-
Did the agent trigger the git-commit skill to commit the template update?
|
|
16
|
-
Did the agent provide the final npm run release, build, npm login, and npm publish commands?
|
|
17
|
-
weight: 1.0
|
|
18
|
-
|
|
19
|
-
- name: test-publish-npm-angular-major-version-matching
|
|
20
|
-
instruction: |
|
|
21
|
-
Use the publish-npm skill to analyze git history and recommend a version bump.
|
|
22
|
-
workspace:
|
|
23
|
-
- src: fixtures/package-v21.json.template
|
|
24
|
-
dest: src/ng-add/files/package.json.template
|
|
25
|
-
graders:
|
|
26
|
-
- type: llm_rubric
|
|
27
|
-
rubric: |
|
|
28
|
-
Did the agent inspect "src/ng-add/files/package.json.template" for the Angular version?
|
|
29
|
-
Did the agent notice that Angular is at major version 21?
|
|
30
|
-
Did the agent recommend a "major" version bump to "21.0.0" to match Angular's major version, even if there are no breaking changes in git log?
|
|
31
|
-
weight: 1.0
|
|
32
|
-
|
package/.husky/commit-msg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx --no-install commitlint --edit "$1"
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/.t4g/agent-memory.db
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
7
|
-
const collectionPath = path.join(__dirname, '../collection.json');
|
|
8
|
-
/**
|
|
9
|
-
* Creates a minimal workspace tree with angular.json to satisfy
|
|
10
|
-
* getWorkspace() and buildDefaultPath() calls in the schematic.
|
|
11
|
-
*/
|
|
12
|
-
function createWorkspaceTree() {
|
|
13
|
-
const tree = new testing_1.UnitTestTree(schematics_1.Tree.empty());
|
|
14
|
-
tree.create('/angular.json', JSON.stringify({
|
|
15
|
-
version: 1,
|
|
16
|
-
projects: {
|
|
17
|
-
'test-app': {
|
|
18
|
-
projectType: 'application',
|
|
19
|
-
root: '',
|
|
20
|
-
sourceRoot: 'src',
|
|
21
|
-
prefix: 'app',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
}));
|
|
25
|
-
return tree;
|
|
26
|
-
}
|
|
27
|
-
describe('component', () => {
|
|
28
|
-
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
29
|
-
it('should generate component files when given a name', async () => {
|
|
30
|
-
const tree = await runner.runSchematic('component', {
|
|
31
|
-
name: 'test-widget',
|
|
32
|
-
project: 'test-app',
|
|
33
|
-
inDirectory: true,
|
|
34
|
-
path: 'src/app',
|
|
35
|
-
selector: 'app-test-widget',
|
|
36
|
-
}, createWorkspaceTree());
|
|
37
|
-
// Verify the expected component files are generated
|
|
38
|
-
expect(tree.files).toContain('/src/app/test-widget/test-widget.component.ts');
|
|
39
|
-
expect(tree.files).toContain('/src/app/test-widget/test-widget.component.html');
|
|
40
|
-
expect(tree.files).toContain('/src/app/test-widget/test-widget.component.scss');
|
|
41
|
-
expect(tree.files).toContain('/src/app/test-widget/test-widget.component.spec.ts');
|
|
42
|
-
});
|
|
43
|
-
it('should use the classified name in the component class', async () => {
|
|
44
|
-
const tree = await runner.runSchematic('component', {
|
|
45
|
-
name: 'test-widget',
|
|
46
|
-
project: 'test-app',
|
|
47
|
-
inDirectory: true,
|
|
48
|
-
path: 'src/app',
|
|
49
|
-
selector: 'app-test-widget',
|
|
50
|
-
}, createWorkspaceTree());
|
|
51
|
-
const content = tree.readContent('/src/app/test-widget/test-widget.component.ts');
|
|
52
|
-
expect(content).toContain('export class TestWidgetComponent');
|
|
53
|
-
expect(content).toContain("selector: 'app-test-widget'");
|
|
54
|
-
expect(content).toContain("styleUrl: './test-widget.component.scss'");
|
|
55
|
-
});
|
|
56
|
-
it('should abort when inDirectory is false', async () => {
|
|
57
|
-
const tree = await runner.runSchematic('component', {
|
|
58
|
-
name: 'test-widget',
|
|
59
|
-
project: 'test-app',
|
|
60
|
-
inDirectory: false,
|
|
61
|
-
path: 'src/app',
|
|
62
|
-
selector: 'app-test-widget',
|
|
63
|
-
}, createWorkspaceTree());
|
|
64
|
-
// When inDirectory is false, the schematic returns noop — no files generated
|
|
65
|
-
expect(tree.files).not.toContain('/src/app/test-widget/test-widget.component.ts');
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=index_spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_sp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