@team-codeme/crud-forge 0.0.0-stage → 1.0.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/.cursor/agents/generator-engineer.md +31 -0
- package/.cursor/agents/keycloak-engineer.md +33 -0
- package/.cursor/agents/qa-engineer.md +32 -0
- package/.cursor/agents/security-reviewer.md +30 -0
- package/.cursor/mcp.json +13 -0
- package/.cursor/rules/crudforge-precautions.mdc +16 -0
- package/.cursor/rules/playwright-browser.mdc +30 -0
- package/.cursor/rules/readme-todo-sync.mdc +13 -0
- package/.env.qa.example +19 -0
- package/.github/workflows/qa-live.yml +32 -0
- package/.github/workflows/qa.yml +27 -0
- package/.vscode/settings.json +32 -0
- package/QA/IAM-PLAN.md +25 -0
- package/QA/IAM-RESULTS.md +39 -0
- package/QA/IAM-TESTCASES.md +36 -0
- package/QA/IAM-TODO.md +7 -0
- package/QA/KEYCLOAK-BOOTSTRAP.md +105 -0
- package/QA/PLAN.md +43 -0
- package/QA/RESULTS.md +59 -0
- package/QA/TESTCASES.md +65 -0
- package/QA/TODO.md +14 -0
- package/QA/pmb-dev/README.md +49 -0
- package/QA/pmb-dev/config/config.yml +152 -0
- package/QA/pmb-dev/gdl/i.gdl +17 -0
- package/README.md +851 -2
- package/Todo.md +207 -0
- package/assets/branding/crudforge-logo.png +0 -0
- package/assets/branding/crudforge-mark.png +0 -0
- package/branding/poster-crudforge.jpg +0 -0
- package/chat/last-chat/Investigating Mock Data Configuration.md +428 -0
- package/cli.js +167 -0
- package/config/default-config.yml +245 -0
- package/docs/performance/README.md +217 -0
- package/docs/performance/after.json +111 -0
- package/docs/performance/before.json +111 -0
- package/docs/quality/README.md +276 -0
- package/e2e/crudforge.e2e.yml +47 -0
- package/e2e/crudforge.field-profile.yml +33 -0
- package/e2e/crudforge.iam-live.yml +124 -0
- package/e2e/crudforge.iam.yml +62 -0
- package/e2e/tests/field-profile.spec.js +152 -0
- package/e2e/tests/generated-crud.spec.js +251 -0
- package/e2e/tests/iam-live.spec.js +149 -0
- package/e2e/tests/iam-pack.spec.js +151 -0
- package/e2e/tests/list-state.spec.js +73 -0
- package/features.csv +27 -0
- package/fuse-starter-pack/branding/crudforge-mark-source.jpg +0 -0
- package/fuse-starter-pack/branding/crudforge-mark-source.png +0 -0
- package/fuse-starter-pack/branding/crudforge-mark.png +0 -0
- package/fuse-starter-pack/branding/crudforge-wordmark-source.jpg +0 -0
- package/fuse-starter-pack/branding/crudforge-wordmark-source.png +0 -0
- package/fuse-starter-pack/branding/crudforge-wordmark.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/Dockerfile +14 -0
- package/fuse-starter-pack/fuse-v21.1/LICENSE.md +6 -0
- package/fuse-starter-pack/fuse-v21.1/README.md +59 -0
- package/fuse-starter-pack/fuse-v21.1/angular.json +113 -0
- package/fuse-starter-pack/fuse-v21.1/eslint.config.ts +150 -0
- package/fuse-starter-pack/fuse-v21.1/nginx.conf +23 -0
- package/fuse-starter-pack/fuse-v21.1/nginx.dev.conf +18 -0
- package/fuse-starter-pack/fuse-v21.1/package-lock.json +11513 -0
- package/fuse-starter-pack/fuse-v21.1/package.json +69 -0
- package/fuse-starter-pack/fuse-v21.1/postcss.config.json +5 -0
- package/fuse-starter-pack/fuse-v21.1/prettier.config.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/proxy.conf.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/proxy.dev.conf.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/public/favicon.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/Geist-Italic.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/Geist.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/GeistMono-Italic.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/fonts/geist/GeistMono.woff2 +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/i18n/en.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/public/i18n/es.json +8 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/flags/ES.svg +79 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/flags/US.svg +14 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/flags/where-to-find-other-flags.txt +5 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/logo/logo-mark.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/public/images/logo/logo.png +0 -0
- package/fuse-starter-pack/fuse-v21.1/push.sh +27 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.config.server.ts +10 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.config.ts +64 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.routes.server.ts +8 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.routes.ts +39 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/app.ts +22 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/icons/index.ts +1 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/icons/lucide.ts +1 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/icons/provider.ts +23 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/local-storage/index.ts +2 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/local-storage/local-storage.ts +109 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/local-storage/provider.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/media/index.ts +2 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/media/media.ts +64 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/media/provider.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/index.ts +3 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/models/theming.ts +13 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/palette.ts +209 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/provider.ts +24 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/theming/theming.ts +129 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/core/transloco/transloco-http-loader.ts +12 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/data/navigation.ts +176 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/layout.ts +77 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/language-switcher.ts +91 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/navigation.ts +238 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/notifications.ts +252 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/scheme-switcher.ts +58 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/sidebar.ts +31 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/layout/ui/user.ts +132 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/data/academy.ts +753 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/data/model.ts +27 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/features/course.ts +318 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/features/courses.ts +228 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/academy/routes.ts +14 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/data/contacts.ts +4372 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/data/model.ts +34 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/features/contact.ts +239 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/features/contacts.ts +185 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/contacts/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/data/file-manager.ts +261 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/data/model.ts +12 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/features/file-manager.ts +131 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/routes.ts +15 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/file-manager/ui/list.ts +164 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/faq.ts +288 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/guide.ts +134 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/home.ts +219 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/features/support.ts +161 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/help-center/routes.ts +33 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/data/model.ts +18 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/data/notes.ts +324 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/features/note.ts +152 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/features/notes.ts +118 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/notes/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/data/model.ts +17 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/data/tasks.ts +562 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/features/task.ts +195 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/features/tasks.ts +271 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/apps/tasks/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/data/analytics.ts +1620 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/data/finance.ts +1065 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/data/project.ts +376 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/analytics/analytics.ts +1096 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/finance/finance.ts +658 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/project/budget-table.ts +188 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/features/project/project.ts +565 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/dashboards/routes.ts +23 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/changelog/changelog.ts +932 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/getting-started/building.ts +33 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/getting-started/development.ts +42 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/features/getting-started/installation.ts +47 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/documentation/routes.ts +45 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/error/features/error-page.ts +70 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/error/routes.ts +21 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/notifications/features/notifications.ts +262 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/notifications/routes.ts +10 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/account.ts +238 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/notifications.ts +134 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/plan-and-billing.ts +238 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/security.ts +211 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/features/team.ts +188 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/layout.ts +109 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/settings/routes.ts +37 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/modules/extras/welcome/welcome.component.ts +22 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/admin/routes.ts +95 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/forgot-password/forgot-password.html +54 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/forgot-password/forgot-password.ts +51 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/reset-password/reset-password.html +82 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/reset-password/reset-password.ts +69 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-in/sign-in.html +132 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-in/sign-in.ts +54 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-up/sign-up.html +183 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/features/sign-up/sign-up.ts +56 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/auth/routes.ts +34 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/coming-soon/features/coming-soon.ts +156 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/coming-soon/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/coming-soon/routes.ts +16 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/layout/layout.ts +9 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/modules/home/features/home.ts +23 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/modules/home/routes.ts +10 -0
- package/fuse-starter-pack/fuse-v21.1/src/app/domains/website/routes.ts +30 -0
- package/fuse-starter-pack/fuse-v21.1/src/environments/environment.mock.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/environments/environment.prod.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/environments/environment.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/index.html +66 -0
- package/fuse-starter-pack/fuse-v21.1/src/main.server.ts +11 -0
- package/fuse-starter-pack/fuse-v21.1/src/main.ts +5 -0
- package/fuse-starter-pack/fuse-v21.1/src/server.ts +70 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/base/base.css +63 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/base/typography.css +54 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/a.css +18 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/input.css +22 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/kbd.css +55 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/components/material.css +1149 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/styles.css +31 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/tailwind/theme.css +147 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/tailwind/utilities.css +563 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/tailwind/variants.css +4 -0
- package/fuse-starter-pack/fuse-v21.1/src/styles/third-party/lucide-icons.css +12 -0
- package/fuse-starter-pack/fuse-v21.1/tsconfig.app.json +16 -0
- package/fuse-starter-pack/fuse-v21.1/tsconfig.json +37 -0
- package/fuse-starter-pack/fuse-v21.1/tsconfig.spec.json +10 -0
- package/generator/README.md +12 -0
- package/generator/issues/.gitkeep +0 -0
- package/package.json +56 -4
- package/playwright.config.js +29 -0
- package/playwright.field-profile.config.js +6 -0
- package/playwright.iam-live.config.js +31 -0
- package/playwright.iam.config.js +29 -0
- package/playwright.list-state.config.js +6 -0
- package/playwright.performance.config.js +1 -0
- package/run-config-tests.sh +5 -0
- package/scripts/e2e-paths.js +89 -0
- package/scripts/e2e-prepare-field-profile.js +17 -0
- package/scripts/e2e-prepare-iam-live.js +135 -0
- package/scripts/e2e-prepare-iam.js +65 -0
- package/scripts/e2e-prepare.js +72 -0
- package/scripts/e2e-serve-iam-live.js +28 -0
- package/scripts/e2e-serve-iam.js +28 -0
- package/scripts/e2e-serve.js +28 -0
- package/scripts/performance/generate.js +17 -0
- package/scripts/performance/measure.js +55 -0
- package/scripts/postinstall.js +9 -0
- package/scripts/prepare-quality-apps.js +34 -0
- package/scripts/run-config-tests.js +63 -0
- package/src/assets/logo-with-lable.jpeg +0 -0
- package/src/assets/logo.jpeg +0 -0
- package/src/commands/bootstrap.js +92 -0
- package/src/commands/doctor.js +403 -0
- package/src/commands/generate.js +301 -0
- package/src/commands/init-config.js +310 -0
- package/src/commands/keycloak-options.js +182 -0
- package/src/commands/validate.js +52 -0
- package/src/config/auth-config.js +183 -0
- package/src/config/default-values.js +235 -0
- package/src/config/env-refs.js +71 -0
- package/src/config/field-preferences.js +99 -0
- package/src/config/input-sources.js +104 -0
- package/src/config/load-config.js +166 -0
- package/src/config/proxy-routes.js +44 -0
- package/src/generator/access-control-tools.js +334 -0
- package/src/generator/ai-docs.js +691 -0
- package/src/generator/application-tests.js +252 -0
- package/src/generator/auth-pack.js +965 -0
- package/src/generator/embed-config.js +431 -0
- package/src/generator/entity-layout.js +30 -0
- package/src/generator/fuse-build.js +57 -0
- package/src/generator/fuse-runtime.js +344 -0
- package/src/generator/generated-banner.js +137 -0
- package/src/generator/index.js +874 -0
- package/src/generator/project-output.js +126 -0
- package/src/generator/team-pack.js +220 -0
- package/src/index.js +68 -0
- package/src/parser/gdl-parser.js +169 -0
- package/src/parser/jdl-parser.js +171 -0
- package/src/presets/pmb-test.js +139 -0
- package/src/presets/static-source.js +73 -0
- package/src/presets/store.js +96 -0
- package/src/provision/admin-service.js +148 -0
- package/src/provision/bootstrap.js +147 -0
- package/src/provision/http.js +123 -0
- package/src/provision/keycloak-admin-rest.js +335 -0
- package/src/provision/state.js +51 -0
- package/src/provision/token.js +52 -0
- package/src/templates/angular/auth/access-control.service.ts.ejs +179 -0
- package/src/templates/angular/auth/access-ctrl.pipe.ts.ejs +20 -0
- package/src/templates/angular/auth/auth.guard.ts.ejs +27 -0
- package/src/templates/angular/auth/auth.interceptor.ts.ejs +53 -0
- package/src/templates/angular/auth/auth.service.ts.ejs +594 -0
- package/src/templates/angular/auth/auth.utils.ts.ejs +28 -0
- package/src/templates/angular/auth/current-user.ts.ejs +24 -0
- package/src/templates/angular/auth/disabled-account-overlay.component.css.ejs +95 -0
- package/src/templates/angular/auth/disabled-account-overlay.component.html.ejs +33 -0
- package/src/templates/angular/auth/disabled-account-overlay.component.ts.ejs +23 -0
- package/src/templates/angular/auth/fuse-account.ts.ejs +234 -0
- package/src/templates/angular/auth/fuse-user.ts.ejs +264 -0
- package/src/templates/angular/auth/has-permission.directive.ts.ejs +51 -0
- package/src/templates/angular/auth/index.ts.ejs +24 -0
- package/src/templates/angular/auth/keycloak-admin.service.ts.ejs +670 -0
- package/src/templates/angular/auth/landing.guard.ts.ejs +61 -0
- package/src/templates/angular/auth/no-auth.guard.ts.ejs +19 -0
- package/src/templates/angular/auth/permission-attribute.util.ts.ejs +182 -0
- package/src/templates/angular/auth/sign-in.ts.ejs +60 -0
- package/src/templates/angular/entity/_entity_.model.ts.ejs +64 -0
- package/src/templates/angular/entity/_entity_.routes.ts.ejs +9 -0
- package/src/templates/angular/entity/components/forms/form/_entity_-form.component.html.ejs +168 -0
- package/src/templates/angular/entity/components/forms/form/_entity_-form.component.ts.ejs +175 -0
- package/src/templates/angular/entity/components/forms/form-page/_entity_-form-page.component.html.ejs +10 -0
- package/src/templates/angular/entity/components/forms/form-page/_entity_-form-page.component.ts.ejs +86 -0
- package/src/templates/angular/entity/components/forms/update/_entity_-form.service.ts.ejs +136 -0
- package/src/templates/angular/entity/components/interaction/actions/_entity_-actions.component.html.ejs +68 -0
- package/src/templates/angular/entity/components/interaction/actions/_entity_-actions.component.ts.ejs +69 -0
- package/src/templates/angular/entity/components/interaction/filter/_entity_-filter.component.html.ejs +111 -0
- package/src/templates/angular/entity/components/interaction/filter/_entity_-filter.component.ts.ejs +102 -0
- package/src/templates/angular/entity/components/presentation/card/_entity_-card.component.css.ejs +33 -0
- package/src/templates/angular/entity/components/presentation/card/_entity_-card.component.html.ejs +29 -0
- package/src/templates/angular/entity/components/presentation/card/_entity_-card.component.ts.ejs +93 -0
- package/src/templates/angular/entity/components/presentation/detail/_entity_-detail.component.css.ejs +54 -0
- package/src/templates/angular/entity/components/presentation/detail/_entity_-detail.component.html.ejs +58 -0
- package/src/templates/angular/entity/components/presentation/detail/_entity_-detail.component.ts.ejs +47 -0
- package/src/templates/angular/entity/components/presentation/list/_entity_-list.component.html.ejs +419 -0
- package/src/templates/angular/entity/components/presentation/list/_entity_-list.component.scss.ejs +48 -0
- package/src/templates/angular/entity/components/presentation/list/_entity_-list.component.ts.ejs +592 -0
- package/src/templates/angular/entity/service/_entity_.service.ts.ejs +153 -0
- package/src/templates/angular/entity/settings/_entity_.settings.ts.ejs +49 -0
- package/src/templates/angular/enums/_enum_.model.ts.ejs +11 -0
- package/src/templates/angular/iam/change-password.component.html.ejs +39 -0
- package/src/templates/angular/iam/change-password.component.ts.ejs +44 -0
- package/src/templates/angular/iam/no-access.component.ts.ejs +17 -0
- package/src/templates/angular/iam/role-list.component.html.ejs +331 -0
- package/src/templates/angular/iam/role-list.component.scss.ejs +107 -0
- package/src/templates/angular/iam/role-list.component.ts.ejs +597 -0
- package/src/templates/angular/iam/role-management/role-header.component.html.ejs +51 -0
- package/src/templates/angular/iam/role-management/role-header.component.ts.ejs +45 -0
- package/src/templates/angular/iam/role-management/role-inheritance.component.html.ejs +15 -0
- package/src/templates/angular/iam/role-management/role-inheritance.component.ts.ejs +19 -0
- package/src/templates/angular/iam/role-management/role-permissions-panel.component.css.ejs +24 -0
- package/src/templates/angular/iam/role-management/role-permissions-panel.component.html.ejs +108 -0
- package/src/templates/angular/iam/role-management/role-permissions-panel.component.ts.ejs +122 -0
- package/src/templates/angular/iam/role-management/role-users.component.html.ejs +104 -0
- package/src/templates/angular/iam/role-management/role-users.component.ts.ejs +53 -0
- package/src/templates/angular/iam/role-management/user-select-dialog.component.html.ejs +113 -0
- package/src/templates/angular/iam/role-management/user-select-dialog.component.ts.ejs +157 -0
- package/src/templates/angular/iam/role-permission-matrix.component.html.ejs +355 -0
- package/src/templates/angular/iam/role-permission-matrix.component.scss.ejs +217 -0
- package/src/templates/angular/iam/role-permission-matrix.component.ts.ejs +800 -0
- package/src/templates/angular/iam/screen-catalog.ts.ejs +147 -0
- package/src/templates/angular/iam/shared/confirm-dialog.component.ts.ejs +83 -0
- package/src/templates/angular/iam/shared/matrix-hierarchy.util.ts.ejs +196 -0
- package/src/templates/angular/iam/shared/permission-matrix-sound.ts.ejs +59 -0
- package/src/templates/angular/iam/shared/role-display.util.ts.ejs +43 -0
- package/src/templates/angular/iam/shared/role-permission-skeleton.component.ts.ejs +54 -0
- package/src/templates/angular/iam/shared/screen-matrix.util.ts.ejs +554 -0
- package/src/templates/angular/iam/shared/screen-navigation-map.ts.ejs +187 -0
- package/src/templates/angular/iam/shared/screen-navigation.registry.ts.ejs +64 -0
- package/src/templates/angular/iam/shared/text-highlight.pipe.ts.ejs +39 -0
- package/src/templates/angular/iam/user-access-matrix.component.html.ejs +212 -0
- package/src/templates/angular/iam/user-access-matrix.component.scss.ejs +34 -0
- package/src/templates/angular/iam/user-access-matrix.component.ts.ejs +239 -0
- package/src/templates/angular/iam/user-detail.component.html.ejs +143 -0
- package/src/templates/angular/iam/user-detail.component.ts.ejs +108 -0
- package/src/templates/angular/iam/user-form.component.html.ejs +63 -0
- package/src/templates/angular/iam/user-form.component.ts.ejs +100 -0
- package/src/templates/angular/iam/user-list.component.html.ejs +369 -0
- package/src/templates/angular/iam/user-list.component.scss.ejs +242 -0
- package/src/templates/angular/iam/user-list.component.ts.ejs +446 -0
- package/src/templates/angular/iam/user-management.routes.ts.ejs +47 -0
- package/src/templates/angular/iam/user-permission-matrix.component.html.ejs +231 -0
- package/src/templates/angular/iam/user-permission-matrix.component.scss.ejs +216 -0
- package/src/templates/angular/iam/user-permission-matrix.component.ts.ejs +516 -0
- package/src/templates/angular/shared/base/audit-user-name.pipe.ts.ejs +69 -0
- package/src/templates/angular/shared/base/base-filter.component.ts.ejs +245 -0
- package/src/templates/angular/shared/base/base-form.component.ts.ejs +109 -0
- package/src/templates/angular/shared/base/base-list.component.ts.ejs +507 -0
- package/src/templates/angular/shared/base/filter-types.ts.ejs +55 -0
- package/src/templates/angular/shared/base/input-format.directive.ts.ejs +47 -0
- package/src/templates/angular/shared/base/input-format.ts.ejs +15 -0
- package/src/templates/angular/shared/confirm-with-input-dialog.component.ts.ejs +91 -0
- package/src/templates/angular/shared/confirmation-dialog.component.ts.ejs +80 -0
- package/src/templates/angular/shared/list-styles.css.ejs +103 -0
- package/src/templates/angular/shared/loading-overlay.component.ts.ejs +24 -0
- package/src/templates/angular/shared/resizable.directive.ts.ejs +115 -0
- package/src/templates/angular/shared/snackbar-styles.css.ejs +11 -0
- package/src/templates/fuse-packs/access-control-tools/access-control-sync.js +819 -0
- package/src/templates/fuse-packs/access-control-tools/build-rename-map.js +67 -0
- package/src/templates/fuse-packs/access-control-tools/inject-qa-ids.js +14 -0
- package/src/templates/fuse-packs/access-control-tools/lib/hierarchy-scanner.js +628 -0
- package/src/templates/fuse-packs/access-control-tools/lib/hierarchy-scanner.test.js +323 -0
- package/src/templates/fuse-packs/access-control-tools/lib/html-scanner.js +362 -0
- package/src/templates/fuse-packs/access-control-tools/lib/id-rules.duplicate.test.js +136 -0
- package/src/templates/fuse-packs/access-control-tools/lib/id-rules.js +1095 -0
- package/src/templates/fuse-packs/access-control-tools/lib/ts-component-index.js +482 -0
- package/src/templates/fuse-packs/access-control-tools/output/.gitkeep +0 -0
- package/src/templates/fuse-packs/access-control-tools/run.sh +223 -0
- package/src/templates/fuse-packs/access-control-tools/scan-access-control.js +14 -0
- package/src/templates/fuse-packs/iam-assets/sound/apple-play.mp3 +0 -0
- package/src/templates/fuse-packs/iam-assets/sound/remove.mp3 +0 -0
- package/src/templates/generator/README.md +12 -0
- package/src/templates/testing/ci.cjs +45 -0
- package/src/templates/testing/mock.cjs +149 -0
- package/src/templates/testing/playwright.config.cjs +25 -0
- package/src/templates/testing/serve.cjs +22 -0
- package/src/templates/testing/smoke.spec.cjs +180 -0
- package/src/utils/branding.js +39 -0
- package/src/utils/colors.js +18 -0
- package/src/utils/diff.js +109 -0
- package/src/utils/merger.js +115 -0
- package/src/validator/backend-diagnostics.js +30 -0
- package/src/validator/blueprint-validator.js +276 -0
- package/src/validator/diagnostics.js +608 -0
- package/src/validator/pattern.js +28 -0
- package/test/auth-interceptor.js +84 -0
- package/test/auth-provision-checks.js +297 -0
- package/test/field-preferences.js +145 -0
- package/test/fixtures/field-profile.gdl +7 -0
- package/test/fixtures/mock.jdl +17 -0
- package/test/fixtures/mock.png +0 -0
- package/test/fixtures/performance/config.yml +33 -0
- package/test/fixtures/performance/large.gdl +199 -0
- package/test/fixtures/performance/small.gdl +7 -0
- package/test/fixtures/quality/custom.yml +22 -0
- package/test/fixtures/quality/go-duck.yml +22 -0
- package/test/fixtures/quality/jhipster.yml +30 -0
- package/test/fixtures/quality/representative.gdl +14 -0
- package/test/list-state.js +138 -0
- package/test/micro-functions-layout.js +95 -0
- package/test/performance-generation.js +32 -0
- package/test/pmb-preset.js +127 -0
- package/test/project-workflow.js +111 -0
- package/test/quality-features.js +250 -0
- package/test/verify-commands.js +83 -0
- package/test/verify.js +959 -0
- package/test-files/GDL/example.gdl +15 -0
- package/test-files/JDL/example.jdl +15 -0
- package/test-files/config/crudforge.config.yml +127 -0
- package/test-run.sh +272 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Prefer access-control-sync.js
|
|
5
|
+
* Thin wrapper kept for existing docs / habits.
|
|
6
|
+
*/
|
|
7
|
+
const { spawnSync } = require('child_process');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
const syncScript = path.join(__dirname, 'access-control-sync.js');
|
|
11
|
+
const result = spawnSync(process.execPath, [syncScript, '--write', '--access-only'], {
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
});
|
|
14
|
+
process.exit(result.status ?? 1);
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Generator issues
|
|
2
|
+
|
|
3
|
+
Agents and developers should record generator issues in the `issues/` folder beside this README.
|
|
4
|
+
|
|
5
|
+
Create one Markdown file per issue with a descriptive filename. Include:
|
|
6
|
+
|
|
7
|
+
- A description of the problem and the expected behavior.
|
|
8
|
+
- Steps to reproduce, including the schema and configuration involved.
|
|
9
|
+
- Relevant errors, generated file paths, or screenshots.
|
|
10
|
+
- The issue status and any proposed or completed fix.
|
|
11
|
+
|
|
12
|
+
Do not include credentials or other secrets in issue reports.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Shared commands for GitHub Actions or any CI runner. No credentials are required.
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const pkg = require("../../package.json");
|
|
5
|
+
const files = {
|
|
6
|
+
npm: "package-lock.json",
|
|
7
|
+
pnpm: "pnpm-lock.yaml",
|
|
8
|
+
yarn: "yarn.lock",
|
|
9
|
+
};
|
|
10
|
+
const locks = Object.keys(files).filter((manager) =>
|
|
11
|
+
fs.existsSync(files[manager]),
|
|
12
|
+
);
|
|
13
|
+
const manager = pkg.packageManager?.split("@")[0] || locks[0];
|
|
14
|
+
if (locks.length !== 1 || manager !== locks[0])
|
|
15
|
+
throw Error(
|
|
16
|
+
"Keep exactly one lockfile matching package.json packageManager.",
|
|
17
|
+
);
|
|
18
|
+
const command = process.argv[2];
|
|
19
|
+
const args =
|
|
20
|
+
command === "browsers"
|
|
21
|
+
? manager === "npm"
|
|
22
|
+
? ["exec", "--", "playwright", "install", "--with-deps", "chromium"]
|
|
23
|
+
: ["exec", "playwright", "install", "--with-deps", "chromium"]
|
|
24
|
+
: command === "install"
|
|
25
|
+
? manager === "npm"
|
|
26
|
+
? ["ci"]
|
|
27
|
+
: manager === "pnpm"
|
|
28
|
+
? ["install", "--frozen-lockfile"]
|
|
29
|
+
: [
|
|
30
|
+
"install",
|
|
31
|
+
pkg.packageManager?.startsWith("yarn@1.")
|
|
32
|
+
? "--frozen-lockfile"
|
|
33
|
+
: "--immutable",
|
|
34
|
+
]
|
|
35
|
+
: command === "build"
|
|
36
|
+
? ["run", "build"]
|
|
37
|
+
: command === "test"
|
|
38
|
+
? ["run", "test:smoke"]
|
|
39
|
+
: null;
|
|
40
|
+
if (!args)
|
|
41
|
+
throw Error("Usage: node tests/generated/ci.cjs install|build|browsers|test");
|
|
42
|
+
execFileSync(manager, args, {
|
|
43
|
+
stdio: "inherit",
|
|
44
|
+
shell: process.platform === "win32",
|
|
45
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
const { test: base, expect } = require("@playwright/test");
|
|
2
|
+
const schema = require("./schema.json");
|
|
3
|
+
const test = base.extend({
|
|
4
|
+
backend: async ({ page, context }, use) => {
|
|
5
|
+
const rows = {},
|
|
6
|
+
writes = [],
|
|
7
|
+
blocked = [];
|
|
8
|
+
const errors = [];
|
|
9
|
+
page.on("pageerror", (error) => errors.push(error.message));
|
|
10
|
+
await page.routeWebSocket("**/*", (socket) => {
|
|
11
|
+
if (new URL(socket.url()).origin === "ws://127.0.0.1:4297")
|
|
12
|
+
socket.connectToServer();
|
|
13
|
+
else socket.close();
|
|
14
|
+
});
|
|
15
|
+
let fail = false,
|
|
16
|
+
delay = 0;
|
|
17
|
+
for (const entity of schema.entities)
|
|
18
|
+
rows[entity.name] = Array.from({ length: 12 }, (_, i) =>
|
|
19
|
+
Object.fromEntries([
|
|
20
|
+
["id", i + 1],
|
|
21
|
+
...entity.fields.map((f) => [f.fieldName, f.value]),
|
|
22
|
+
]),
|
|
23
|
+
);
|
|
24
|
+
for (const entity of schema.entities)
|
|
25
|
+
for (const row of rows[entity.name])
|
|
26
|
+
for (const rel of entity.relationships) {
|
|
27
|
+
const target = { ...rows[rel.target][0] };
|
|
28
|
+
row[rel.field] = rel.many ? [target] : target;
|
|
29
|
+
}
|
|
30
|
+
await context.route("**/*", async (route) => {
|
|
31
|
+
const request = route.request(),
|
|
32
|
+
url = new URL(request.url());
|
|
33
|
+
const entity = schema.entities.find(
|
|
34
|
+
(e) => url.pathname === e.url || url.pathname.startsWith(e.url + "/"),
|
|
35
|
+
);
|
|
36
|
+
if (entity) {
|
|
37
|
+
if (delay) await new Promise((r) => setTimeout(r, delay));
|
|
38
|
+
if (fail)
|
|
39
|
+
return route.fulfill({
|
|
40
|
+
status: 503,
|
|
41
|
+
json: { message: "Synthetic service unavailable" },
|
|
42
|
+
});
|
|
43
|
+
const collection = rows[entity.name],
|
|
44
|
+
id = Number(url.pathname.split("/").pop()),
|
|
45
|
+
method = request.method();
|
|
46
|
+
if (method === "POST") {
|
|
47
|
+
const data = {
|
|
48
|
+
...request.postDataJSON(),
|
|
49
|
+
id: Math.max(...collection.map((r) => r.id)) + 1,
|
|
50
|
+
};
|
|
51
|
+
collection.push(data);
|
|
52
|
+
writes.push({ method, data });
|
|
53
|
+
return route.fulfill({ status: 201, json: data });
|
|
54
|
+
}
|
|
55
|
+
if (method === "PUT") {
|
|
56
|
+
const data = request.postDataJSON();
|
|
57
|
+
const at = collection.findIndex((r) => r.id === id);
|
|
58
|
+
collection[at] = data;
|
|
59
|
+
writes.push({ method, data });
|
|
60
|
+
return route.fulfill({ json: data });
|
|
61
|
+
}
|
|
62
|
+
if (method === "DELETE") {
|
|
63
|
+
rows[entity.name] = collection.filter((r) => r.id !== id);
|
|
64
|
+
return route.fulfill({ status: 204 });
|
|
65
|
+
}
|
|
66
|
+
if (method !== "GET") return route.fulfill({ status: 405 });
|
|
67
|
+
if (Number.isFinite(id)) {
|
|
68
|
+
const row = collection.find((r) => r.id === id);
|
|
69
|
+
return route.fulfill({ status: row ? 200 : 404, json: row || {} });
|
|
70
|
+
}
|
|
71
|
+
const start =
|
|
72
|
+
Number(url.searchParams.get("page") || 0) *
|
|
73
|
+
Number(url.searchParams.get("size") || 10),
|
|
74
|
+
size = Number(url.searchParams.get("size") || 10);
|
|
75
|
+
return route.fulfill({
|
|
76
|
+
headers: { "X-Total-Count": String(collection.length) },
|
|
77
|
+
json: collection.slice(start, start + size),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (schema.auth && url.pathname.endsWith("/token")) {
|
|
81
|
+
const claims = {
|
|
82
|
+
sub: "smoke-user",
|
|
83
|
+
name: "Smoke User",
|
|
84
|
+
email: "smoke@example.test",
|
|
85
|
+
exp: Math.floor(Date.now() / 1000) + 3600,
|
|
86
|
+
realm_access: { roles: ["ROLE_ADMIN"] },
|
|
87
|
+
};
|
|
88
|
+
return route.fulfill({
|
|
89
|
+
json: {
|
|
90
|
+
access_token:
|
|
91
|
+
"test." +
|
|
92
|
+
Buffer.from(JSON.stringify(claims)).toString("base64url") +
|
|
93
|
+
".test",
|
|
94
|
+
refresh_token: "test-only",
|
|
95
|
+
expires_in: 3600,
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (schema.auth && url.pathname.endsWith("/logout"))
|
|
100
|
+
return route.fulfill({ status: 204 });
|
|
101
|
+
if (
|
|
102
|
+
schema.auth &&
|
|
103
|
+
(url.pathname.includes("/services/keycloak-admin/") ||
|
|
104
|
+
/^\/admin\/realms\/[^/]+\/(users\/smoke-user|roles\/[^/]+)$/.test(
|
|
105
|
+
url.pathname,
|
|
106
|
+
))
|
|
107
|
+
)
|
|
108
|
+
return route.fulfill({
|
|
109
|
+
json: { id: "smoke-user", enabled: true, attributes: {} },
|
|
110
|
+
});
|
|
111
|
+
const local = url.origin === "http://127.0.0.1:4297";
|
|
112
|
+
const asset =
|
|
113
|
+
/^(\/src\/|\/@|\/node_modules\/|\/assets\/|\/fonts\/|\/images\/|\/favicon|\/styles|\/main|\/chunk|\/polyfills)/.test(
|
|
114
|
+
url.pathname,
|
|
115
|
+
);
|
|
116
|
+
if (local && (asset || request.resourceType() === "document"))
|
|
117
|
+
return route.continue();
|
|
118
|
+
blocked.push(url.pathname);
|
|
119
|
+
return route.abort("blockedbyclient");
|
|
120
|
+
});
|
|
121
|
+
async function login(page) {
|
|
122
|
+
await page.goto("/auth/sign-in");
|
|
123
|
+
const username = page.getByLabel("Username or email");
|
|
124
|
+
if (schema.auth) {
|
|
125
|
+
await username.fill("smoke");
|
|
126
|
+
await page
|
|
127
|
+
.getByLabel("Password", { exact: true })
|
|
128
|
+
.fill("synthetic-only");
|
|
129
|
+
}
|
|
130
|
+
await page.getByRole("button", { name: "Sign in", exact: true }).click();
|
|
131
|
+
await page.waitForURL(/\/admin/);
|
|
132
|
+
}
|
|
133
|
+
await use({
|
|
134
|
+
rows,
|
|
135
|
+
writes,
|
|
136
|
+
blocked,
|
|
137
|
+
login,
|
|
138
|
+
setFailure: (value) => {
|
|
139
|
+
fail = value;
|
|
140
|
+
},
|
|
141
|
+
setDelay: (value) => {
|
|
142
|
+
delay = value;
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
expect(errors).toEqual([]);
|
|
146
|
+
expect(blocked.filter((url) => url !== "/do-not-send")).toEqual([]);
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
module.exports = { test, expect, schema };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { defineConfig } = require("@playwright/test");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
module.exports = defineConfig({
|
|
4
|
+
testDir: path.resolve(__dirname, ".."),
|
|
5
|
+
testMatch: "**/*.spec.cjs",
|
|
6
|
+
workers: 1,
|
|
7
|
+
timeout: 30000,
|
|
8
|
+
outputDir: path.resolve(__dirname, "../../test-results"),
|
|
9
|
+
reporter: [["list"], ["html", { open: "never" }]],
|
|
10
|
+
use: {
|
|
11
|
+
baseURL: "http://127.0.0.1:4297",
|
|
12
|
+
serviceWorkers: "block",
|
|
13
|
+
screenshot: "only-on-failure",
|
|
14
|
+
trace: "off",
|
|
15
|
+
video: "off",
|
|
16
|
+
channel: process.env.CRUDFORGE_BROWSER_CHANNEL || undefined,
|
|
17
|
+
},
|
|
18
|
+
webServer: {
|
|
19
|
+
cwd: path.resolve(__dirname, "../.."),
|
|
20
|
+
command: "node tests/generated/serve.cjs",
|
|
21
|
+
url: "http://127.0.0.1:4297",
|
|
22
|
+
reuseExistingServer: false,
|
|
23
|
+
timeout: 180000,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { spawn } = require("child_process");
|
|
2
|
+
const child = spawn(
|
|
3
|
+
process.execPath,
|
|
4
|
+
[
|
|
5
|
+
"node_modules/@angular/cli/bin/ng.js",
|
|
6
|
+
"serve",
|
|
7
|
+
"--configuration",
|
|
8
|
+
"crudforge-test",
|
|
9
|
+
"--host",
|
|
10
|
+
"127.0.0.1",
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
stdio: "inherit",
|
|
14
|
+
env: {
|
|
15
|
+
...process.env,
|
|
16
|
+
NG_BUILD_MAX_WORKERS: process.env.NG_BUILD_MAX_WORKERS || "2",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
for (const signal of ["SIGTERM", "SIGINT"])
|
|
21
|
+
process.on(signal, () => child.kill(signal));
|
|
22
|
+
child.on("exit", (code) => (process.exitCode = code || 0));
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
const { test, expect, schema } = require("./mock.cjs");
|
|
2
|
+
test("application starts", async ({ page, backend }) => {
|
|
3
|
+
await backend.login(page);
|
|
4
|
+
await expect(page.locator("body")).toBeVisible();
|
|
5
|
+
});
|
|
6
|
+
if (schema.auth)
|
|
7
|
+
test("authenticated identity survives refresh", async ({ page, backend }) => {
|
|
8
|
+
await backend.login(page);
|
|
9
|
+
await expect(page.locator("user").first()).toContainText("Smoke User");
|
|
10
|
+
await page.reload();
|
|
11
|
+
await expect(page.locator("user").first()).toContainText("Smoke User");
|
|
12
|
+
});
|
|
13
|
+
async function fill(form, entity, page) {
|
|
14
|
+
for (const field of entity.fields) {
|
|
15
|
+
const control = form.locator(`[formControlName="${field.fieldName}"]`);
|
|
16
|
+
if (!(await control.count())) continue;
|
|
17
|
+
if (field.fieldTypeIsEnum) {
|
|
18
|
+
await control.click();
|
|
19
|
+
await page
|
|
20
|
+
.getByRole("option", { name: String(field.value), exact: true })
|
|
21
|
+
.click();
|
|
22
|
+
} else if (field.fieldType === "Boolean") {
|
|
23
|
+
const input = control.locator("input");
|
|
24
|
+
await input.setChecked(!!field.value);
|
|
25
|
+
} else if (
|
|
26
|
+
["LocalDate", "Instant", "ZonedDateTime"].includes(field.fieldType)
|
|
27
|
+
) {
|
|
28
|
+
const date = new Date(field.value);
|
|
29
|
+
await control.fill(
|
|
30
|
+
`${date.getUTCMonth() + 1}/${date.getUTCDate()}/${date.getUTCFullYear()}`,
|
|
31
|
+
);
|
|
32
|
+
await control.press("Tab");
|
|
33
|
+
} else await control.fill(String(field.value));
|
|
34
|
+
}
|
|
35
|
+
for (const rel of entity.relationships) {
|
|
36
|
+
const select = form.locator(`[formControlName="${rel.field}"]`);
|
|
37
|
+
await select.click();
|
|
38
|
+
const option = page.getByRole("option").first();
|
|
39
|
+
await expect(option).toBeVisible();
|
|
40
|
+
if (!rel.many || (await option.getAttribute("aria-selected")) !== "true")
|
|
41
|
+
await option.click();
|
|
42
|
+
if (rel.many) await page.keyboard.press("Escape");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function openEntity(page, entity) {
|
|
46
|
+
await page.goto("/admin/" + entity.slug);
|
|
47
|
+
await expect(
|
|
48
|
+
page.getByRole("heading", {
|
|
49
|
+
name: entity.name + " Management",
|
|
50
|
+
exact: true,
|
|
51
|
+
}),
|
|
52
|
+
).toBeVisible();
|
|
53
|
+
const toggle = page.getByRole("button", { name: "Switch to Table View" });
|
|
54
|
+
if (await toggle.isVisible()) await toggle.click();
|
|
55
|
+
}
|
|
56
|
+
for (const entity of schema.entities) {
|
|
57
|
+
test(`${entity.name}: navigation and pagination`, async ({
|
|
58
|
+
page,
|
|
59
|
+
backend,
|
|
60
|
+
}) => {
|
|
61
|
+
await backend.login(page);
|
|
62
|
+
await openEntity(page, entity);
|
|
63
|
+
await expect(
|
|
64
|
+
page.getByRole("heading", {
|
|
65
|
+
name: entity.name + " Management",
|
|
66
|
+
exact: true,
|
|
67
|
+
}),
|
|
68
|
+
).toBeVisible();
|
|
69
|
+
await expect(page.locator("td.mat-column-id").first()).toHaveText("1");
|
|
70
|
+
await page.getByRole("button", { name: "Next page" }).click();
|
|
71
|
+
await expect(page.locator("td.mat-column-id").first()).toHaveText("11");
|
|
72
|
+
});
|
|
73
|
+
test(`${entity.name}: create, required validation and edit`, async ({
|
|
74
|
+
page,
|
|
75
|
+
backend,
|
|
76
|
+
}) => {
|
|
77
|
+
await backend.login(page);
|
|
78
|
+
await openEntity(page, entity);
|
|
79
|
+
await page.getByRole("button", { name: "New", exact: true }).click();
|
|
80
|
+
let form = page
|
|
81
|
+
.locator("form")
|
|
82
|
+
.filter({ has: page.getByRole("button", { name: "Save", exact: true }) });
|
|
83
|
+
await expect(form).toBeVisible();
|
|
84
|
+
const required = entity.fields.find(
|
|
85
|
+
(f) =>
|
|
86
|
+
f.fieldValidateRules.includes("required") &&
|
|
87
|
+
["String", "TextBlob", "Integer", "Long"].includes(f.fieldType),
|
|
88
|
+
);
|
|
89
|
+
if (required) {
|
|
90
|
+
await form.locator(`[formControlName="${required.fieldName}"]`).fill("");
|
|
91
|
+
await expect(
|
|
92
|
+
form.getByRole("button", { name: "Save", exact: true }),
|
|
93
|
+
).toBeDisabled();
|
|
94
|
+
}
|
|
95
|
+
await fill(form, entity, page);
|
|
96
|
+
await expect(
|
|
97
|
+
form.getByRole("button", { name: "Save", exact: true }),
|
|
98
|
+
).toBeEnabled();
|
|
99
|
+
backend.setFailure(true);
|
|
100
|
+
await form.getByRole("button", { name: "Save", exact: true }).click();
|
|
101
|
+
await expect(
|
|
102
|
+
form.getByText("Unable to save record. Please try again."),
|
|
103
|
+
).toBeVisible();
|
|
104
|
+
backend.setFailure(false);
|
|
105
|
+
await form.getByRole("button", { name: "Save", exact: true }).click();
|
|
106
|
+
await expect
|
|
107
|
+
.poll(() => backend.writes.filter((w) => w.method === "POST").length)
|
|
108
|
+
.toBe(1);
|
|
109
|
+
await openEntity(page, entity);
|
|
110
|
+
await page
|
|
111
|
+
.locator(`button[matTooltip="Edit ${entity.name}"]`)
|
|
112
|
+
.first()
|
|
113
|
+
.click();
|
|
114
|
+
const confirm = page.getByRole("button", { name: "Confirm", exact: true });
|
|
115
|
+
if (await confirm.isVisible()) await confirm.click();
|
|
116
|
+
await expect(form).toBeVisible();
|
|
117
|
+
await fill(form, entity, page);
|
|
118
|
+
const textField = entity.fields.find(
|
|
119
|
+
(f) =>
|
|
120
|
+
String(f.value).length > 0 &&
|
|
121
|
+
["String", "TextBlob"].includes(f.fieldType) &&
|
|
122
|
+
!f.fieldValidateRules.some((r) => r.startsWith("pattern(")),
|
|
123
|
+
);
|
|
124
|
+
if (textField) {
|
|
125
|
+
const changed = String(textField.value).replace(/./, "Z");
|
|
126
|
+
await form
|
|
127
|
+
.locator(`[formControlName="${textField.fieldName}"]`)
|
|
128
|
+
.fill(changed);
|
|
129
|
+
}
|
|
130
|
+
await form.getByRole("button", { name: "Save", exact: true }).click();
|
|
131
|
+
await expect
|
|
132
|
+
.poll(() => backend.writes.filter((w) => w.method === "PUT").length)
|
|
133
|
+
.toBe(1);
|
|
134
|
+
if (textField)
|
|
135
|
+
expect(
|
|
136
|
+
backend.writes.find((w) => w.method === "PUT").data[
|
|
137
|
+
textField.fieldName
|
|
138
|
+
],
|
|
139
|
+
).not.toBe(
|
|
140
|
+
backend.writes.find((w) => w.method === "POST").data[
|
|
141
|
+
textField.fieldName
|
|
142
|
+
],
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
test(`${entity.name}: loading and failed request recovery`, async ({
|
|
146
|
+
page,
|
|
147
|
+
backend,
|
|
148
|
+
}) => {
|
|
149
|
+
await backend.login(page);
|
|
150
|
+
await openEntity(page, entity);
|
|
151
|
+
backend.setDelay(500);
|
|
152
|
+
await page.reload();
|
|
153
|
+
await expect(page.locator(".animate-pulse").first()).toBeVisible();
|
|
154
|
+
await expect(page.locator("td.mat-column-id").first()).toHaveText("1");
|
|
155
|
+
backend.setDelay(0);
|
|
156
|
+
backend.setFailure(true);
|
|
157
|
+
await page.reload();
|
|
158
|
+
await expect(page.locator("td.mat-column-id")).toHaveCount(0);
|
|
159
|
+
backend.setFailure(false);
|
|
160
|
+
await page.reload();
|
|
161
|
+
await expect(page.locator("td.mat-column-id").first()).toHaveText("1");
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
test("unmapped requests cannot reach a backend", async ({ page, backend }) => {
|
|
166
|
+
await backend.login(page);
|
|
167
|
+
const result = await page.evaluate(async () => {
|
|
168
|
+
try {
|
|
169
|
+
await fetch("https://unmapped-backend.invalid/do-not-send", {
|
|
170
|
+
method: "POST",
|
|
171
|
+
body: "synthetic",
|
|
172
|
+
});
|
|
173
|
+
return "unexpected";
|
|
174
|
+
} catch {
|
|
175
|
+
return "blocked";
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
expect(result).toBe("blocked");
|
|
179
|
+
expect(backend.blocked).toContain("/do-not-send");
|
|
180
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const colors = require('./colors');
|
|
2
|
+
const packageJson = require('../../package.json');
|
|
3
|
+
|
|
4
|
+
const BANNER = `
|
|
5
|
+
____ ____ _ _ ____ _____ _ ___
|
|
6
|
+
/ ___| _ \\| | | | _ \\| ___|__ _ __ __ _ ___ | | |_ _|
|
|
7
|
+
| | | |_) | | | | | | | |_ / _ \\| '__/ _\` |/ _ \\ | | | |
|
|
8
|
+
| |___| _ <| |_| | |_| | _| (_) | | | (_| | __/ | |___ | |
|
|
9
|
+
\\____|_| \\_\\\\___/|____/|_| \\___/|_| \\__, |\\___| |_____|___|
|
|
10
|
+
|___/
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const DEVELOPER_INFO = "Developed by TeamCodeMe";
|
|
14
|
+
const TEAMCODEME_URL = "https://www.teamcodeme.com/";
|
|
15
|
+
|
|
16
|
+
function printBanner(config = {}) {
|
|
17
|
+
const brandingOpts = config.branding || {};
|
|
18
|
+
if (brandingOpts.banner === false) return;
|
|
19
|
+
|
|
20
|
+
const colorName = brandingOpts.bannerColor || 'green';
|
|
21
|
+
const bannerColorFn = colors[colorName] || colors.green;
|
|
22
|
+
|
|
23
|
+
console.log(bannerColorFn(BANNER));
|
|
24
|
+
console.log(colors.cyan(` ${DEVELOPER_INFO}`));
|
|
25
|
+
console.log(colors.dim(` ${TEAMCODEME_URL}\n`));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function printSuccessFooter() {
|
|
29
|
+
console.log(colors.cyan(` ${DEVELOPER_INFO} · ${TEAMCODEME_URL}\n`));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
BANNER,
|
|
34
|
+
DEVELOPER_INFO,
|
|
35
|
+
TEAMCODEME_URL,
|
|
36
|
+
printBanner,
|
|
37
|
+
printSuccessFooter,
|
|
38
|
+
version: packageJson.version
|
|
39
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const NO_COLOR = process.env.NO_COLOR !== undefined;
|
|
2
|
+
const IS_CI = process.env.CI !== undefined && process.env.CI !== 'false';
|
|
3
|
+
const HAS_NO_TTY = !process.stdout.isTTY;
|
|
4
|
+
|
|
5
|
+
// Enable color if not overridden by NO_COLOR, non-TTY, or CI (unless forced)
|
|
6
|
+
const colorsEnabled = !NO_COLOR && !HAS_NO_TTY && (!IS_CI || process.env.FORCE_COLOR);
|
|
7
|
+
|
|
8
|
+
const colors = {
|
|
9
|
+
green: (text) => colorsEnabled ? `\x1b[32m${text}\x1b[0m` : text,
|
|
10
|
+
cyan: (text) => colorsEnabled ? `\x1b[36m${text}\x1b[0m` : text,
|
|
11
|
+
yellow: (text) => colorsEnabled ? `\x1b[33m${text}\x1b[0m` : text,
|
|
12
|
+
bold: (text) => colorsEnabled ? `\x1b[1m${text}\x1b[0m` : text,
|
|
13
|
+
dim: (text) => colorsEnabled ? `\x1b[2m${text}\x1b[0m` : text,
|
|
14
|
+
red: (text) => colorsEnabled ? `\x1b[31m${text}\x1b[0m` : text,
|
|
15
|
+
colorsEnabled // Expose for testing
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
module.exports = colors;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const colors = require('./colors');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Computes line-level differences using Longest Common Subsequence (LCS).
|
|
5
|
+
* @param {string[]} oldLines
|
|
6
|
+
* @param {string[]} newLines
|
|
7
|
+
* @returns {object[]}
|
|
8
|
+
*/
|
|
9
|
+
function diffLines(oldLines, newLines) {
|
|
10
|
+
const n = oldLines.length;
|
|
11
|
+
const m = newLines.length;
|
|
12
|
+
|
|
13
|
+
const dp = Array.from({ length: n + 1 }, () => Array(m + 1).fill(0));
|
|
14
|
+
for (let i = 1; i <= n; i++) {
|
|
15
|
+
for (let j = 1; j <= m; j++) {
|
|
16
|
+
if (oldLines[i - 1] === newLines[j - 1]) {
|
|
17
|
+
dp[i][j] = dp[i - 1][j - 1] + 1;
|
|
18
|
+
} else {
|
|
19
|
+
dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const result = [];
|
|
25
|
+
let i = n, j = m;
|
|
26
|
+
while (i > 0 || j > 0) {
|
|
27
|
+
if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
|
|
28
|
+
result.unshift({ type: 'common', value: oldLines[i - 1] });
|
|
29
|
+
i--;
|
|
30
|
+
j--;
|
|
31
|
+
} else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
|
|
32
|
+
result.unshift({ type: 'added', value: newLines[j - 1] });
|
|
33
|
+
j--;
|
|
34
|
+
} else {
|
|
35
|
+
result.unshift({ type: 'removed', value: oldLines[i - 1] });
|
|
36
|
+
i--;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Formats a list of changes into a unified diff showing modifications and context.
|
|
44
|
+
* @param {string} oldText
|
|
45
|
+
* @param {string} newText
|
|
46
|
+
* @returns {object[]} - Formatted line objects.
|
|
47
|
+
*/
|
|
48
|
+
function formatDiff(oldText, newText) {
|
|
49
|
+
const oldLines = oldText.split(/\r?\n/);
|
|
50
|
+
const newLines = newText.split(/\r?\n/);
|
|
51
|
+
const diff = diffLines(oldLines, newLines);
|
|
52
|
+
|
|
53
|
+
const lines = [];
|
|
54
|
+
const contextSize = 2; // Context lines to show around changes
|
|
55
|
+
|
|
56
|
+
for (let idx = 0; idx < diff.length; idx++) {
|
|
57
|
+
const item = diff[idx];
|
|
58
|
+
if (item.type === 'added') {
|
|
59
|
+
lines.push({ type: 'added', text: `+ ${item.value}` });
|
|
60
|
+
} else if (item.type === 'removed') {
|
|
61
|
+
lines.push({ type: 'removed', text: `- ${item.value}` });
|
|
62
|
+
} else {
|
|
63
|
+
// Check if a change resides within the context window
|
|
64
|
+
const start = Math.max(0, idx - contextSize);
|
|
65
|
+
const end = Math.min(diff.length - 1, idx + contextSize);
|
|
66
|
+
let hasChangeNearby = false;
|
|
67
|
+
for (let k = start; k <= end; k++) {
|
|
68
|
+
if (diff[k].type !== 'common') {
|
|
69
|
+
hasChangeNearby = true;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (hasChangeNearby) {
|
|
75
|
+
lines.push({ type: 'common', text: ` ${item.value}` });
|
|
76
|
+
} else {
|
|
77
|
+
if (lines.length > 0 && lines[lines.length - 1].type !== 'ellipsis') {
|
|
78
|
+
lines.push({ type: 'ellipsis', text: ' ...' });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return lines;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Colorizes a list of formatted diff lines.
|
|
88
|
+
* @param {object[]} diffLines
|
|
89
|
+
* @returns {string}
|
|
90
|
+
*/
|
|
91
|
+
function colorizeDiff(diffLines) {
|
|
92
|
+
return diffLines.map(line => {
|
|
93
|
+
if (line.type === 'added') {
|
|
94
|
+
return colors.green(line.text);
|
|
95
|
+
} else if (line.type === 'removed') {
|
|
96
|
+
return colors.red(line.text);
|
|
97
|
+
} else if (line.type === 'ellipsis') {
|
|
98
|
+
return colors.dim(line.text);
|
|
99
|
+
} else {
|
|
100
|
+
return line.text;
|
|
101
|
+
}
|
|
102
|
+
}).join('\n');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = {
|
|
106
|
+
diffLines,
|
|
107
|
+
formatDiff,
|
|
108
|
+
colorizeDiff
|
|
109
|
+
};
|