@antelopejs/dms 0.21.3 → 0.21.4-next.1000.g005d1ab
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/E2E.md +101 -10
- package/README.md +3 -3
- package/data/mockup-spec.schema.json +181 -0
- package/dist/config/internal/state.d.ts +4 -1
- package/dist/config/internal/state.js +5 -0
- package/dist/config/internal/state.js.map +1 -1
- package/dist/db/setup-token.d.ts +1 -1
- package/dist/db/setup-token.js +2 -2
- package/dist/db/setup-token.js.map +1 -1
- package/dist/{bin/control → e2e}/backend.d.mts +4 -4
- package/dist/{bin/control → e2e}/base.d.mts +5 -5
- package/dist/{bin/control → e2e}/browser.d.mts +2 -28
- package/dist/e2e/fixtures.d.mts +45 -0
- package/dist/{bin/control → e2e}/frontend-workspace.d.mts +9 -1
- package/dist/e2e/global-setup.d.mts +27 -0
- package/dist/{bin/control → e2e}/identity.d.mts +3 -4
- package/dist/e2e/index.d.mts +57 -0
- package/dist/{bin/control → e2e}/journey-judge.d.mts +8 -8
- package/dist/{bin/control → e2e}/journey-load.d.mts +0 -6
- package/dist/e2e/journey-run.d.mts +61 -0
- package/dist/{bin/control → e2e}/journey.d.mts +37 -38
- package/dist/e2e/journeys-config.d.mts +56 -0
- package/dist/{bin/control → e2e}/json.d.mts +7 -14
- package/dist/{bin/control → e2e}/launch.d.mts +3 -3
- package/dist/{bin/control → e2e}/module-root.d.mts +3 -3
- package/dist/{bin/control → e2e}/mongo.d.mts +3 -3
- package/dist/{bin/control → e2e}/renderer.d.mts +1 -1
- package/dist/{bin/control → e2e}/run-state.d.mts +8 -7
- package/dist/e2e/run.d.mts +53 -0
- package/dist/{bin/control → e2e}/stack.d.mts +0 -1
- package/dist/e2e/start.d.mts +50 -0
- package/dist/{bin/control/e2e-suite.d.mts → e2e/suite.d.mts} +13 -16
- package/dist/e2e/test-journey.d.mts +30 -0
- package/dist/{bin/control → e2e}/timing.d.mts +0 -29
- package/dist/e2e/types.d.mts +58 -0
- package/dist/implementations/dms-auth/database-deadline.d.ts +7 -0
- package/dist/implementations/dms-auth/database-deadline.js +45 -0
- package/dist/implementations/dms-auth/database-deadline.js.map +1 -0
- package/dist/implementations/dms-auth/index.js +14 -6
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/analysis.js +1 -0
- package/dist/implementations/dms-builder/engine/analysis.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +1 -0
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +2 -5
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/index.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/index.js +5 -1
- package/dist/implementations/dms-builder/engine/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/indexed-project.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/indexed-project.js +18 -3
- package/dist/implementations/dms-builder/engine/indexed-project.js.map +1 -1
- package/dist/implementations/dms-builder/engine/interface-capabilities.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/interface-capabilities.js +14 -5
- package/dist/implementations/dms-builder/engine/interface-capabilities.js.map +1 -1
- package/dist/implementations/dms-builder/engine/map-resources.js +2 -3
- package/dist/implementations/dms-builder/engine/map-resources.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-choices.js +9 -1
- package/dist/implementations/dms-builder/engine/mapped-choices.js.map +1 -1
- package/dist/implementations/dms-builder/engine/modules.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/modules.js +3 -2
- package/dist/implementations/dms-builder/engine/modules.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.js +1 -2
- package/dist/implementations/dms-builder/engine/ops-blocks.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops-categories.js +2 -4
- package/dist/implementations/dms-builder/engine/ops-categories.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops.js +3 -4
- package/dist/implementations/dms-builder/engine/ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/page-access.js +3 -1
- package/dist/implementations/dms-builder/engine/page-access.js.map +1 -1
- package/dist/implementations/dms-builder/engine/page-category-move.js +3 -3
- package/dist/implementations/dms-builder/engine/page-category-move.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-chain.d.ts +3 -1
- package/dist/implementations/dms-builder/engine/query-chain.js +10 -4
- package/dist/implementations/dms-builder/engine/query-chain.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-emit.d.ts +17 -2
- package/dist/implementations/dms-builder/engine/query-emit.js +72 -15
- package/dist/implementations/dms-builder/engine/query-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-ops-emit.js +6 -0
- package/dist/implementations/dms-builder/engine/query-ops-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-ops.js +29 -1
- package/dist/implementations/dms-builder/engine/query-ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-plan-execute.d.ts +1 -1
- package/dist/implementations/dms-builder/engine/query-plan-execute.js +11 -4
- package/dist/implementations/dms-builder/engine/query-plan-execute.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-plan.d.ts +14 -1
- package/dist/implementations/dms-builder/engine/query-plan.js +68 -28
- package/dist/implementations/dms-builder/engine/query-plan.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-preview.js +25 -15
- package/dist/implementations/dms-builder/engine/query-preview.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-route-response.js +3 -4
- package/dist/implementations/dms-builder/engine/query-route-response.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-structure.js +66 -15
- package/dist/implementations/dms-builder/engine/query-structure.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-template-emit.js +2 -0
- package/dist/implementations/dms-builder/engine/query-template-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-template-ratio.d.ts +2 -0
- package/dist/implementations/dms-builder/engine/query-template-ratio.js +140 -0
- package/dist/implementations/dms-builder/engine/query-template-ratio.js.map +1 -0
- package/dist/implementations/dms-builder/engine/query-template.d.ts +8 -1
- package/dist/implementations/dms-builder/engine/query-template.js +2 -3
- package/dist/implementations/dms-builder/engine/query-template.js.map +1 -1
- package/dist/implementations/dms-builder/engine/query-where.d.ts +2 -1
- package/dist/implementations/dms-builder/engine/query-where.js +4 -2
- package/dist/implementations/dms-builder/engine/query-where.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resolution-inputs.d.ts +8 -0
- package/dist/implementations/dms-builder/engine/resolution-inputs.js +85 -0
- package/dist/implementations/dms-builder/engine/resolution-inputs.js.map +1 -0
- package/dist/implementations/dms-builder/engine/resource-index.js +1 -1
- package/dist/implementations/dms-builder/engine/resource-index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-ops.js +2 -4
- package/dist/implementations/dms-builder/engine/resource-ops.js.map +1 -1
- package/dist/implementations/dms-builder/engine/save-check.d.ts +3 -0
- package/dist/implementations/dms-builder/engine/save-check.js +104 -0
- package/dist/implementations/dms-builder/engine/save-check.js.map +1 -0
- package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -2
- package/dist/implementations/dms-builder/engine/theme-scaffold.js.map +1 -1
- package/dist/implementations/dms-builder/engine/writable.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/writable.js +46 -42
- package/dist/implementations/dms-builder/engine/writable.js.map +1 -1
- package/dist/implementations/dms-html-render/index.js +1 -0
- package/dist/implementations/dms-html-render/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/analysis-summary.d.ts +3 -0
- package/dist/mcp/analysis-summary.js +23 -1
- package/dist/mcp/analysis-summary.js.map +1 -1
- package/dist/mcp/page-verify/mockup.js +2 -2
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/relation-groups.d.ts +7 -0
- package/dist/mcp/relation-groups.js +88 -0
- package/dist/mcp/relation-groups.js.map +1 -0
- package/dist/mcp/tools/builder-analysis.js +1 -1
- package/dist/mcp/tools/builder-analysis.js.map +1 -1
- package/dist/mcp/tools/builder-queries.js +3 -3
- package/dist/mcp/tools/builder-queries.js.map +1 -1
- package/dist/mcp/tools/builder-resources.js +1 -1
- package/dist/mcp/tools/builder-resources.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +1 -0
- package/dist/mcp/tools/index.js +3 -3
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/mockup-from-page.d.ts +2 -0
- package/dist/mcp/tools/mockup-from-page.js +28 -24
- package/dist/mcp/tools/mockup-from-page.js.map +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js +4 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-read-spec.js +14 -2
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-support.d.ts +2 -0
- package/dist/mcp/tools/mockup-support.js +13 -2
- package/dist/mcp/tools/mockup-support.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mockup/anchor.d.ts +1 -0
- package/dist/mockup/anchor.js +7 -0
- package/dist/mockup/anchor.js.map +1 -1
- package/dist/mockup/compile.d.ts +2 -1
- package/dist/mockup/compile.js +3 -0
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/from-page-routes.d.ts +4 -2
- package/dist/mockup/from-page-routes.js +3 -2
- package/dist/mockup/from-page-routes.js.map +1 -1
- package/dist/mockup/history-routes.d.ts +3 -1
- package/dist/mockup/history-routes.js +25 -11
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/index.d.ts +5 -0
- package/dist/mockup/index.js +11 -4
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema.js +8 -0
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/live-page.d.ts +2 -1
- package/dist/mockup/live-page.js +19 -10
- package/dist/mockup/live-page.js.map +1 -1
- package/dist/mockup/manage-routes.d.ts +1 -0
- package/dist/mockup/model.d.ts +8 -0
- package/dist/mockup/model.js +6 -0
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/modules.d.ts +11 -0
- package/dist/mockup/modules.js +38 -0
- package/dist/mockup/modules.js.map +1 -0
- package/dist/mockup/owner-controller.d.ts +2 -0
- package/dist/mockup/owner-controller.js +8 -0
- package/dist/mockup/owner-controller.js.map +1 -1
- package/dist/mockup/presence-board.d.ts +45 -0
- package/dist/mockup/presence-board.js +181 -0
- package/dist/mockup/presence-board.js.map +1 -0
- package/dist/mockup/presence-routes.d.ts +23 -0
- package/dist/mockup/presence-routes.js +169 -0
- package/dist/mockup/presence-routes.js.map +1 -0
- package/dist/mockup/presence.d.ts +83 -0
- package/dist/mockup/presence.js +168 -0
- package/dist/mockup/presence.js.map +1 -0
- package/dist/mockup/routes.d.ts +6 -0
- package/dist/mockup/routes.js +20 -4
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/source-routes.d.ts +6 -1
- package/dist/mockup/source-routes.js +36 -13
- package/dist/mockup/source-routes.js.map +1 -1
- package/dist/mockup/source.d.ts +1 -0
- package/dist/mockup/source.js +1 -0
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/store.d.ts +4 -0
- package/dist/mockup/store.js +3 -0
- package/dist/mockup/store.js.map +1 -1
- package/dist/pages/settings/users/role-preview.d.ts +1 -1
- package/dist/pages/settings/users/role-preview.js +2 -2
- package/dist/pages/settings/users/role-preview.js.map +1 -1
- package/dist/pages/settings/users/roles.js +1 -1
- package/dist/pages/settings/users/roles.js.map +1 -1
- package/dist/routes/auth/refresh.d.ts +1 -1
- package/dist/routes/auth/refresh.js +3 -25
- package/dist/routes/auth/refresh.js.map +1 -1
- package/dist/store/catalog.d.ts +1 -0
- package/dist/store/catalog.js +1 -0
- package/dist/store/catalog.js.map +1 -1
- package/dist/utils/auth-constants.d.ts +0 -1
- package/dist/utils/auth-constants.js +1 -2
- package/dist/utils/auth-constants.js.map +1 -1
- package/dist/utils/user-activity.js +1 -7
- package/dist/utils/user-activity.js.map +1 -1
- package/{bin/control → e2e}/backend.mjs +5 -5
- package/{bin/control → e2e}/base.mjs +11 -11
- package/{bin/control → e2e}/browser.mjs +1 -113
- package/{bin/control → e2e}/build-cache.mjs +3 -3
- package/{bin/control → e2e}/build-key.mjs +27 -3
- package/{bin/control → e2e}/dashboard.mjs +33 -6
- package/e2e/fixtures.mjs +154 -0
- package/{bin/control → e2e}/frontend-workspace.mjs +39 -5
- package/e2e/global-setup.mjs +74 -0
- package/{bin/control → e2e}/identity.mjs +4 -5
- package/e2e/index.mjs +110 -0
- package/{bin/control → e2e}/journey-judge.mjs +4 -4
- package/{bin/control → e2e}/journey-load.mjs +0 -13
- package/e2e/journey-run.mjs +190 -0
- package/{bin/control → e2e}/journey.mjs +57 -216
- package/e2e/journeys-config.mjs +126 -0
- package/{bin/control → e2e}/json.mjs +11 -32
- package/{bin/control → e2e}/launch.mjs +6 -6
- package/{bin/control → e2e}/mail.mjs +2 -3
- package/{bin/control → e2e}/module-root.mjs +3 -3
- package/{bin/control → e2e}/mongo.mjs +8 -8
- package/{bin/control → e2e}/prepared-workspace.mjs +1 -1
- package/{bin/control → e2e}/renderer.mjs +6 -4
- package/{bin/control → e2e}/run-state.mjs +15 -14
- package/e2e/run.mjs +96 -0
- package/e2e/service.mjs +11 -0
- package/e2e/services.mjs +64 -0
- package/{bin/control → e2e}/session.mjs +1 -3
- package/{bin/control → e2e}/stack.mjs +4 -5
- package/e2e/start.mjs +79 -0
- package/{bin/control/e2e-suite.mjs → e2e/suite.mjs} +25 -33
- package/e2e/test-journey.mjs +55 -0
- package/{bin/control → e2e}/timing.mjs +0 -112
- package/{bin/control/verify → e2e}/types.mjs +3 -7
- package/frontend-vue/eslint-globals.generated.mjs +20 -20
- package/frontend-vue/layers/dms-auth/server/session.ts +9 -2
- package/frontend-vue/layers/dms-core/app/build/utils/previewFrame.ts +12 -0
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +20 -14
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +2 -1
- package/frontend-vue/layers/dms-core/app/entries/utils/previewFrame.ts +1 -0
- package/frontend-vue/layers/dms-core/app/types/live.ts +1 -1
- package/frontend-vue/layers/dms-core/app/types/page.ts +1 -0
- package/frontend-vue/layers/dms-core/app/types/row-action.ts +2 -0
- package/frontend-vue/layers/dms-core/app/utils/http-status.ts +1 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +5 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +5 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/assets/css/foundation.css +1 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +30 -29
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +4 -8
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +4 -7
- package/frontend-vue/layers/dms-layout/app/error.vue +7 -0
- package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +2 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/public/images/antelope-logo/dark.svg +1 -1
- package/frontend-vue/layers/dms-layout/public/images/antelope-logo/light.svg +1 -1
- package/frontend-vue/layers/dms-onboarding/i18n/locales/onboarding-en-GB.json +2 -2
- package/frontend-vue/layers/dms-onboarding/i18n/locales/onboarding-fr-FR.json +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +29 -8
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupLayers.vue +10 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +46 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +26 -5
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +47 -3
- package/frontend-vue/layers/dms-ui/app/build/components/button/DisabledReason.vue +27 -0
- package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/build/components/stat/StatCell.vue +2 -11
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +17 -17
- package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardAvatar.vue +2 -10
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/IdentityCell.vue +15 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetContainers.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +14 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetUrl.ts +25 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +5 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDocument.ts +12 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +34 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupLocks.ts +268 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +39 -23
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +10 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +21 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +92 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +11 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexAxes.ts +11 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexCategoryFormat.ts +32 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +8 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +45 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationFilter.ts +17 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/page/pageUrlValues.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodDisplay.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +47 -31
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionRendering.ts +19 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnTypes.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionTypes.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewActions.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +10 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/types/tree.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/fetchStatus.ts +12 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/initials.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +24 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +18 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOutline.ts +7 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +15 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPresence.ts +117 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRebase.ts +139 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +16 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +13 -1
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +5 -3
- package/frontend-vue/layers/dms-ui/app/components/form/components/DatePicker.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputCalendar.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputRelation.vue +14 -1
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputRepeater.vue +23 -10
- package/frontend-vue/layers/dms-ui/app/components/kpi/KpiCard.vue +1 -6
- package/frontend-vue/layers/dms-ui/app/components/period/PeriodSelector.vue +9 -8
- package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +62 -16
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/button/DisabledReason.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/stat/StatCell.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupLocks.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/initials.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupPresence.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupRebase.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/row-action.ts +2 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +4 -1
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +4 -1
- package/frontend-vue/package.json +1 -1
- package/package.json +20 -18
- package/skills/dms/REFERENCE.md +1 -1
- package/skills/dms-module/SKILL.md +1 -1
- package/bin/control/backend-mode.test.mjs +0 -112
- package/bin/control/backend-records.test.mjs +0 -330
- package/bin/control/backend.test.mjs +0 -346
- package/bin/control/base.test.mjs +0 -88
- package/bin/control/browser-client.mjs +0 -65
- package/bin/control/browser-wire.mjs +0 -41
- package/bin/control/browser-wire.test.mjs +0 -96
- package/bin/control/build-cache.test.mjs +0 -270
- package/bin/control/build-key-refusals.test.mjs +0 -138
- package/bin/control/build-key.test.mjs +0 -417
- package/bin/control/build-layout.test.mjs +0 -357
- package/bin/control/commands-stack.mjs +0 -297
- package/bin/control/commands-verify.mjs +0 -157
- package/bin/control/consumer-install.test.mjs +0 -86
- package/bin/control/dashboard.test.mjs +0 -102
- package/bin/control/doctor.mjs +0 -346
- package/bin/control/e2e-run.mjs +0 -61
- package/bin/control/e2e-suite.test.mjs +0 -174
- package/bin/control/e2e.mjs +0 -178
- package/bin/control/forwarder.test.mjs +0 -267
- package/bin/control/frontend-check.mjs +0 -55
- package/bin/control/frontend-mode.test.mjs +0 -24
- package/bin/control/frontend-workspace.test.mjs +0 -133
- package/bin/control/helpers/env.mjs +0 -21
- package/bin/control/helpers/ephemeral-range.mjs +0 -18
- package/bin/control/helpers/evidence.mjs +0 -13
- package/bin/control/helpers/fake-run.mjs +0 -368
- package/bin/control/helpers/key-fixture.mjs +0 -85
- package/bin/control/helpers/narrow-range.mjs +0 -35
- package/bin/control/helpers/pids.mjs +0 -37
- package/bin/control/helpers/repo.mjs +0 -13
- package/bin/control/helpers/tree.mjs +0 -40
- package/bin/control/identity.test.mjs +0 -166
- package/bin/control/journey-judge.test.mjs +0 -106
- package/bin/control/journey.test.mjs +0 -392
- package/bin/control/json.test.mjs +0 -130
- package/bin/control/mail.test.mjs +0 -55
- package/bin/control/module-root.test.mjs +0 -69
- package/bin/control/mongo-server.test.mjs +0 -136
- package/bin/control/mongo.test.mjs +0 -298
- package/bin/control/namespaces.test.mjs +0 -263
- package/bin/control/options.mjs +0 -36
- package/bin/control/pid-guard.test.mjs +0 -202
- package/bin/control/pid-reuse.test.mjs +0 -278
- package/bin/control/processes.test.mjs +0 -289
- package/bin/control/renderer.test.mjs +0 -268
- package/bin/control/run-ports.test.mjs +0 -141
- package/bin/control/run-state.test.mjs +0 -171
- package/bin/control/tab.test.mjs +0 -444
- package/bin/control/timing.test.mjs +0 -186
- package/bin/control/verify/decode.mjs +0 -78
- package/bin/control/verify/decode.test.mjs +0 -123
- package/bin/control/verify/doors.mjs +0 -44
- package/bin/control/verify/doors.test.mjs +0 -87
- package/bin/control/verify/formal.mjs +0 -77
- package/bin/control/verify/formal.test.mjs +0 -94
- package/bin/control/verify/map.mjs +0 -236
- package/bin/control/verify/map.test.mjs +0 -212
- package/bin/control/verify/skill.mjs +0 -160
- package/bin/dms-control.mjs +0 -77
- package/dist/bin/control/browser-client.d.mts +0 -26
- package/dist/bin/control/browser-wire.d.mts +0 -4
- package/dist/bin/control/commands-stack.d.mts +0 -40
- package/dist/bin/control/doctor.d.mts +0 -18
- package/dist/bin/control/e2e-run.d.mts +0 -22
- package/dist/bin/control/e2e.d.mts +0 -47
- package/dist/bin/control/frontend-check.d.mts +0 -11
- package/dist/bin/control/options.d.mts +0 -95
- package/dist/bin/control/verify/decode.d.mts +0 -41
- package/dist/bin/control/verify/skill.d.mts +0 -69
- package/dist/bin/control/verify/types.d.mts +0 -106
- package/dist/mcp/tools/preview-blocks.d.ts +0 -1
- package/dist/mcp/tools/preview-blocks.js +0 -249
- package/dist/mcp/tools/preview-blocks.js.map +0 -1
- /package/dist/{bin/control → e2e}/build-cache.d.mts +0 -0
- /package/dist/{bin/control → e2e}/build-inputs.d.mts +0 -0
- /package/dist/{bin/control → e2e}/build-key.d.mts +0 -0
- /package/dist/{bin/control → e2e}/dashboard.d.mts +0 -0
- /package/dist/{bin/control → e2e}/database.d.mts +0 -0
- /package/dist/{bin/control → e2e}/failure.d.mts +0 -0
- /package/dist/{bin/control → e2e}/forwarder.d.mts +0 -0
- /package/dist/{bin/control → e2e}/git.d.mts +0 -0
- /package/dist/{bin/control → e2e}/mail.d.mts +0 -0
- /package/dist/{bin/control → e2e}/processes.d.mts +0 -0
- /package/dist/{bin/control → e2e}/run-copy.d.mts +0 -0
- /package/dist/{bin/control → e2e}/session.d.mts +0 -0
- /package/dist/{bin/control → e2e}/tab.d.mts +0 -0
- /package/{bin/control → e2e}/build-inputs.mjs +0 -0
- /package/{bin/control → e2e}/database.mjs +0 -0
- /package/{bin/control → e2e}/failure.mjs +0 -0
- /package/{bin/control → e2e}/forwarder.mjs +0 -0
- /package/{bin/control → e2e}/git.mjs +0 -0
- /package/{bin/control → e2e}/processes.mjs +0 -0
- /package/{bin/control → e2e}/run-copy.mjs +0 -0
- /package/{bin/control → e2e}/tab.mjs +0 -0
|
@@ -12,7 +12,7 @@ export const RENDERER_CLI = join("dist", "index.js");
|
|
|
12
12
|
* The renderer checkout a run serves: an absolute folder holding the
|
|
13
13
|
* `@antelopejs/dms-frontend` package with its build.
|
|
14
14
|
*
|
|
15
|
-
* @param {string} folder The
|
|
15
|
+
* @param {string} folder The journeys config's `renderer` folder
|
|
16
16
|
* @returns {string} Its absolute path
|
|
17
17
|
* @throws When the folder is not that package, or is not built
|
|
18
18
|
*/
|
|
@@ -20,19 +20,21 @@ export function resolveRenderer(folder) {
|
|
|
20
20
|
const root = resolve(folder);
|
|
21
21
|
const manifest = join(root, "package.json");
|
|
22
22
|
if (!existsSync(manifest)) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error(
|
|
24
|
+
`the journeys config's renderer ${root} has no package.json`,
|
|
25
|
+
);
|
|
24
26
|
}
|
|
25
27
|
/** @type {unknown} */
|
|
26
28
|
const parsed = JSON.parse(readFileSync(manifest, "utf8"));
|
|
27
29
|
const name = stringField(parsed, "name");
|
|
28
30
|
if (name !== RENDERER_PACKAGE) {
|
|
29
31
|
throw new Error(
|
|
30
|
-
|
|
32
|
+
`the journeys config's renderer ${root} is ${name ?? "unnamed"}, not ${RENDERER_PACKAGE}`,
|
|
31
33
|
);
|
|
32
34
|
}
|
|
33
35
|
if (!existsSync(join(root, RENDERER_CLI))) {
|
|
34
36
|
throw new Error(
|
|
35
|
-
|
|
37
|
+
`the journeys config's renderer ${root} has no ${RENDERER_CLI}: build it first (pnpm install, pnpm build)`,
|
|
36
38
|
);
|
|
37
39
|
}
|
|
38
40
|
return root;
|
|
@@ -30,19 +30,19 @@ const ID_BYTES = 3;
|
|
|
30
30
|
const TIMESTAMP_LENGTH = 15;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* @typedef {{ name: string, pid: number, startTime?: number | null, command: string, cwd: string, log: string, startedAt: string, port?: number, mode?: BackendMode }} ProcessRecord A process the run started. `startTime` is when the kernel started it, in clock ticks since boot: `null` where /proc could not tell, absent in a record an
|
|
33
|
+
* @typedef {{ name: string, pid: number, startTime?: number | null, command: string, cwd: string, log: string, startedAt: string, port?: number, mode?: BackendMode }} ProcessRecord A process the run started. `startTime` is when the kernel started it, in clock ticks since boot: `null` where /proc could not tell, absent in a record an older e2e kit wrote. Without it, `startedAt` tells the process apart. `mode` is a backend's, absent for production.
|
|
34
34
|
* @typedef {ProcessRecord & { port: number }} ServerRecord
|
|
35
35
|
* @typedef {ServerRecord & { database: string }} BackendRecord A backend the run started, with the database it serves
|
|
36
36
|
* @typedef {"production" | "dev" | "watch"} BackendMode How a backend runs: `production` runs `ajs project start` on the build, `dev` runs `ajs project dev`, the runtime's development mode, which serves what only development serves, and `watch` runs `ajs project dev -w`, which also reloads a local module when its source changes. A run or a record without one runs production.
|
|
37
37
|
* @typedef {{ email: string, password: string, userId?: string | null }} Account
|
|
38
|
-
* @typedef {{ dir: string, root: string, home: string, logs: string, mongo: string, browser?: ServerRecord, evidence: string, cache: string, id: string, createdAt: string, environment: string, playground: string, moduleRoot: string, repo: string | null, headSha: string | null, renderer?: string, baseRef: string,
|
|
38
|
+
* @typedef {{ dir: string, root: string, home: string, logs: string, mongo: string, browser?: ServerRecord, evidence: string, cache: string, id: string, createdAt: string, environment: string, playground: string, moduleRoot: string, repo: string | null, headSha: string | null, renderer?: string, baseRef: string, apiPort: number, webPort: number, smtpPort: number, mail: string, apiUrl: string, webUrl: string, databasePrefix: string, database: string, mongoUrl: string, ownsMongo: boolean, secrets: Record<string, string>, adminPassword: string, extraEnv: Record<string, string>, processes: ProcessRecord[], namespaces?: import("./identity.mjs").Namespaces, noStandby?: boolean, frontendMode?: FrontendMode, backendMode?: BackendMode, buildRoots?: string[], accounts: Record<string, Account>, tokens: Record<string, string>, ready: boolean, error?: string, runPlayground?: string, baseRoot?: string, resetCount?: number, journeyCount?: number, frontendBuild?: FrontendBuild, bakedEnv?: Record<string, string> }} RunState
|
|
39
39
|
* @typedef {"build" | "dev"} FrontendMode How the run serves its dashboard: `build` runs `ajs dms build` then `ajs dms start`, `dev` runs `ajs dms dev` on the sources. A run without one serves a build.
|
|
40
40
|
* @typedef {{ key: string | null, cached: boolean, reason?: string }} FrontendBuild The key of the inputs of the run's frontend build (null when it was not keyed), whether the build came from the build cache, and why the cache was not used or not filled when it should have been
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Where runs are created: `--runs`, else `
|
|
45
|
-
* `<tmpdir>/dms-
|
|
44
|
+
* Where runs are created: `--runs`, else `DMS_E2E_RUNS`, else
|
|
45
|
+
* `<tmpdir>/dms-e2e`. A run holds a playground copy and its frontend
|
|
46
46
|
* build, a few hundred megabytes, so prefer a folder on disk over a tmpfs.
|
|
47
47
|
*
|
|
48
48
|
* @param {string | undefined} option The `--runs` value
|
|
@@ -50,7 +50,7 @@ const TIMESTAMP_LENGTH = 15;
|
|
|
50
50
|
*/
|
|
51
51
|
export function runsRoot(option) {
|
|
52
52
|
return resolve(
|
|
53
|
-
option ?? process.env.
|
|
53
|
+
option ?? process.env.DMS_E2E_RUNS ?? join(tmpdir(), "dms-e2e"),
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -170,7 +170,6 @@ const isStoredRun = objectOf(
|
|
|
170
170
|
repo: nullable(isString),
|
|
171
171
|
headSha: nullable(isString),
|
|
172
172
|
baseRef: isString,
|
|
173
|
-
skill: nullable(isString),
|
|
174
173
|
apiPort: isNumber,
|
|
175
174
|
webPort: isNumber,
|
|
176
175
|
smtpPort: isNumber,
|
|
@@ -227,7 +226,7 @@ export function readRun(dir) {
|
|
|
227
226
|
const file = join(resolve(dir), RUN_FILE);
|
|
228
227
|
if (!existsSync(file)) {
|
|
229
228
|
throw new Error(
|
|
230
|
-
`No run at ${dir}: run.json is missing. Start one with
|
|
229
|
+
`No run at ${dir}: run.json is missing. Start one with startRun.`,
|
|
231
230
|
);
|
|
232
231
|
}
|
|
233
232
|
/** @type {unknown} */
|
|
@@ -265,16 +264,18 @@ export function loadRun(dir) {
|
|
|
265
264
|
|
|
266
265
|
/**
|
|
267
266
|
* Writes the run state, readable by its owner only since it holds the run's
|
|
268
|
-
* secrets and the admin password.
|
|
267
|
+
* secrets and the admin password. It replaces run.json in one rename, so a
|
|
268
|
+
* service that loads the run while it is saved reads the old state or the new
|
|
269
|
+
* one, never a truncated file.
|
|
269
270
|
*
|
|
270
271
|
* @param {StoredRunState} state The run state
|
|
271
272
|
*/
|
|
272
273
|
export function saveRun(state) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
);
|
|
274
|
+
const file = join(state.dir, RUN_FILE);
|
|
275
|
+
writeFileSync(`${file}.next`, `${JSON.stringify(state, null, 2)}\n`, {
|
|
276
|
+
mode: 0o600,
|
|
277
|
+
});
|
|
278
|
+
renameSync(`${file}.next`, file);
|
|
278
279
|
}
|
|
279
280
|
|
|
280
281
|
/**
|
|
@@ -341,7 +342,7 @@ function readBackend(file) {
|
|
|
341
342
|
if (!isMissing(error) && !reported.has(file)) {
|
|
342
343
|
reported.add(file);
|
|
343
344
|
process.stderr.write(
|
|
344
|
-
`dms-
|
|
345
|
+
`dms-e2e: skipped ${file}, which holds no backend record: ${describeFailure(error)}\n`,
|
|
345
346
|
);
|
|
346
347
|
}
|
|
347
348
|
return [];
|
package/e2e/run.mjs
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { runJourney as driveJourney } from "./journey-run.mjs";
|
|
2
|
+
import { loadRun } from "./run-state.mjs";
|
|
3
|
+
import { down } from "./stack.mjs";
|
|
4
|
+
import { startOptions, startStack } from "./start.mjs";
|
|
5
|
+
|
|
6
|
+
export { apiRequest, onboard } from "./session.mjs";
|
|
7
|
+
export { freshDatabase, restartBackend } from "./backend.mjs";
|
|
8
|
+
export { capturedMail } from "./mail.mjs";
|
|
9
|
+
export { loadRun, saveRun } from "./run-state.mjs";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("./run-state.mjs").RunState} RunState A running DMS: its `apiUrl`, `webUrl`, `accounts`, `secrets` and `evidence` folder
|
|
13
|
+
* @typedef {import("./start.mjs").RunOptions} RunOptions How a test starts a run
|
|
14
|
+
* @typedef {{ run: RunState, stop: () => Promise<void> }} StartedRun A ready run, and what stops it
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** @type {NodeJS.Signals[]} */
|
|
18
|
+
const STOP_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Starts a run of the checkout's playground, as the global setup of a
|
|
22
|
+
* Playwright suite does, for any test runner: a copy of the playground on
|
|
23
|
+
* free ports, its own MongoDB, a mail sink and the dashboard of the skill
|
|
24
|
+
* config's `renderer` or of the playground. `stop` stops every process the
|
|
25
|
+
* run started and keeps its `evidence/` and `logs/`. Loads no Playwright.
|
|
26
|
+
* The processes run detached, so a SIGINT or SIGTERM to this process stops
|
|
27
|
+
* the run too, then ends the process by that signal.
|
|
28
|
+
*
|
|
29
|
+
* @param {RunOptions} [options] How to start it
|
|
30
|
+
* @returns {Promise<StartedRun>} The ready run
|
|
31
|
+
* @throws When the skill, its prepare commands or the stack fail; nothing it started is left running
|
|
32
|
+
*/
|
|
33
|
+
export async function startRun(options = {}) {
|
|
34
|
+
const cwd = process.cwd();
|
|
35
|
+
const run = await startStack(startOptions(options, cwd), cwd);
|
|
36
|
+
const onSignal = (/** @type {NodeJS.Signals} */ signal) => {
|
|
37
|
+
release();
|
|
38
|
+
const reraise = () => process.kill(process.pid, signal);
|
|
39
|
+
stopRun(run.dir).then(reraise, reraise);
|
|
40
|
+
};
|
|
41
|
+
const release = () => {
|
|
42
|
+
for (const signal of STOP_SIGNALS) process.off(signal, onSignal);
|
|
43
|
+
};
|
|
44
|
+
for (const signal of STOP_SIGNALS) process.on(signal, onSignal);
|
|
45
|
+
return {
|
|
46
|
+
run,
|
|
47
|
+
stop: () => {
|
|
48
|
+
release();
|
|
49
|
+
return stopRun(run.dir);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Stops a run from what its `run.json` recorded last, which the journeys of
|
|
56
|
+
* other processes update, and reports what it could not do on stderr.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} dir The run folder
|
|
59
|
+
*/
|
|
60
|
+
async function stopRun(dir) {
|
|
61
|
+
const lines = await down(loadRun(dir));
|
|
62
|
+
for (const line of lines.filter((entry) => entry.startsWith("could not")))
|
|
63
|
+
process.stderr.write(`dms-e2e: ${line}\n`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @typedef {import("./journey-load.mjs").Journey} Journey A journey: its preparation fields and its `run(ctx)` body
|
|
68
|
+
* @typedef {import("./types.mjs").FeatureResult} FeatureResult The judged result: `status`, `error` and `steps[].checks[].verdict`
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/** A browser that refuses to open anything, so a browserless journey fails when it asks for a tab. */
|
|
72
|
+
const NO_BROWSER = {
|
|
73
|
+
close: () => Promise.resolve(),
|
|
74
|
+
newContext() {
|
|
75
|
+
return Promise.reject(
|
|
76
|
+
new Error(
|
|
77
|
+
"ctx.tab() needs a browser and runJourney of @antelopejs/dms/e2e/run opens none: drive the backend with ctx.api() instead",
|
|
78
|
+
),
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Runs one journey without a browser, as the Playwright `dms` fixture runs
|
|
85
|
+
* it: the run's fresh database, backend mode, standby and administrator
|
|
86
|
+
* come from the journey's `database`, `backend`, `standby` and `onboard`
|
|
87
|
+
* fields. A `ctx.tab()` call fails the journey with a message saying so.
|
|
88
|
+
*
|
|
89
|
+
* @param {RunState} run The run `startRun` returned
|
|
90
|
+
* @param {string} feature The feature the journey belongs to
|
|
91
|
+
* @param {Journey} journey The journey
|
|
92
|
+
* @returns {Promise<FeatureResult>} The judged result
|
|
93
|
+
*/
|
|
94
|
+
export function runJourney(run, feature, journey) {
|
|
95
|
+
return driveJourney(run, feature, journey, undefined, NO_BROWSER);
|
|
96
|
+
}
|
package/e2e/service.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describeFailure } from "./failure.mjs";
|
|
2
|
+
import { runService } from "./services.mjs";
|
|
3
|
+
|
|
4
|
+
const [name = "", ...args] = process.argv.slice(2);
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
await runService(name, args);
|
|
8
|
+
} catch (error) {
|
|
9
|
+
process.stderr.write(`dms e2e ${name}: ${describeFailure(error)}\n`);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
}
|
package/e2e/services.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { apiTargetFile, serveForwarder } from "./forwarder.mjs";
|
|
2
|
+
import { setUpFrontendWorkspace } from "./frontend-workspace.mjs";
|
|
3
|
+
import { serveMail } from "./mail.mjs";
|
|
4
|
+
import { loadRun } from "./run-state.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {"mail" | "api" | "prepare-frontend"} ServiceName A process a run starts from the kit's service entry
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* What each service runs, given the arguments after its name: `mail <run>`
|
|
12
|
+
* serves the run's mail sink and `api <run>` its API forwarder, both until
|
|
13
|
+
* the process is stopped; `prepare-frontend <dms-frontend> <workspace>
|
|
14
|
+
* <environment> install|sources` sets up a frontend workspace and returns.
|
|
15
|
+
*
|
|
16
|
+
* @type {Readonly<Record<ServiceName, (args: string[]) => Promise<unknown>>>}
|
|
17
|
+
*/
|
|
18
|
+
const SERVICES = {
|
|
19
|
+
mail: ([dir = ""]) => {
|
|
20
|
+
const state = loadRun(dir);
|
|
21
|
+
return serveMail(state.mail, state.smtpPort);
|
|
22
|
+
},
|
|
23
|
+
api: ([dir = ""]) => {
|
|
24
|
+
const state = loadRun(dir);
|
|
25
|
+
return serveForwarder(state.apiPort, apiTargetFile(state.dir));
|
|
26
|
+
},
|
|
27
|
+
"prepare-frontend": ([
|
|
28
|
+
frontend = "",
|
|
29
|
+
workspace = "",
|
|
30
|
+
environment = "",
|
|
31
|
+
install,
|
|
32
|
+
]) =>
|
|
33
|
+
setUpFrontendWorkspace(
|
|
34
|
+
frontend,
|
|
35
|
+
workspace,
|
|
36
|
+
environment,
|
|
37
|
+
install === "install",
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {string} name A service name
|
|
43
|
+
* @returns {name is ServiceName} True for a service the entry runs
|
|
44
|
+
*/
|
|
45
|
+
function isServiceName(name) {
|
|
46
|
+
return Object.hasOwn(SERVICES, name);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Runs a service of a run in this process.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} name The service
|
|
53
|
+
* @param {string[]} args Its arguments
|
|
54
|
+
* @returns {Promise<void>} Resolves once a server listens, which keeps the process alive, or once the setup is done
|
|
55
|
+
* @throws When `name` is no service, or the service fails to start
|
|
56
|
+
*/
|
|
57
|
+
export async function runService(name, args) {
|
|
58
|
+
if (!isServiceName(name)) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Unknown service ${name}; expected one of ${Object.keys(SERVICES).join(", ")}`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
await SERVICES[name](args);
|
|
64
|
+
}
|
|
@@ -149,9 +149,7 @@ export function isOk(answer) {
|
|
|
149
149
|
export async function signIn(state, account) {
|
|
150
150
|
const credentials = state.accounts?.[account];
|
|
151
151
|
if (!credentials) {
|
|
152
|
-
throw new Error(
|
|
153
|
-
`No account ${account} in the run; onboard first or add it with dms-control account.`,
|
|
154
|
-
);
|
|
152
|
+
throw new Error(`No account ${account} in the run; onboard first.`);
|
|
155
153
|
}
|
|
156
154
|
const folder = nextFolder(state, "auth", `login ${account}`);
|
|
157
155
|
const answer = await recordedRequest(folder, {
|
|
@@ -37,10 +37,10 @@ import { resolveRenderer } from "./renderer.mjs";
|
|
|
37
37
|
import { moduleRootOf } from "./module-root.mjs";
|
|
38
38
|
import {
|
|
39
39
|
cliPaths,
|
|
40
|
-
CONTROL_BIN,
|
|
41
40
|
ENVIRONMENT,
|
|
42
41
|
frontendPackage,
|
|
43
42
|
resolutionFolders,
|
|
43
|
+
SERVICE_BIN,
|
|
44
44
|
spec,
|
|
45
45
|
} from "./launch.mjs";
|
|
46
46
|
import { layOutCopy } from "./run-copy.mjs";
|
|
@@ -49,7 +49,7 @@ import { appendTiming, recordTiming, stopwatch, timed } from "./timing.mjs";
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* @typedef {import("./run-state.mjs").RunState} RunState
|
|
52
|
-
* @typedef {{ playground: string, renderer?: string, runs?: string, mongoUrl?: string, env?: string[], base?: string,
|
|
52
|
+
* @typedef {{ playground: string, renderer?: string, runs?: string, mongoUrl?: string, env?: string[], base?: string, prepared?: import("./timing.mjs").TimingEntry[], noStandby?: boolean, buildCache?: boolean, frontendMode?: import("./run-state.mjs").FrontendMode, backendMode?: BackendMode }} UpOptions Where the playground and the runs are, the `prepare` entries to record once the run exists, whether fresh databases start their backend on the spot, whether the frontend build may come from the build cache (it may unless `buildCache` is false), how the dashboard is served (a build unless `frontendMode` is `dev`), and how the backends run unless a journey says otherwise (production unless `backendMode` is `dev`)
|
|
53
53
|
* @typedef {import("./run-state.mjs").BackendMode} BackendMode
|
|
54
54
|
*/
|
|
55
55
|
|
|
@@ -131,7 +131,6 @@ async function initialState(options) {
|
|
|
131
131
|
repo: checkout.root,
|
|
132
132
|
headSha: verified.head,
|
|
133
133
|
baseRef: options.base ?? "origin/main",
|
|
134
|
-
skill: options.skill ?? null,
|
|
135
134
|
apiPort,
|
|
136
135
|
webPort,
|
|
137
136
|
smtpPort,
|
|
@@ -189,7 +188,7 @@ async function ensureService(state, name, port) {
|
|
|
189
188
|
const service = startDetached({
|
|
190
189
|
name,
|
|
191
190
|
program: process.execPath,
|
|
192
|
-
args: [
|
|
191
|
+
args: [SERVICE_BIN, name, state.dir],
|
|
193
192
|
cwd: state.dir,
|
|
194
193
|
env: process.env,
|
|
195
194
|
logs: state.logs,
|
|
@@ -382,7 +381,7 @@ export function workspaceSetup(state, name, project, install) {
|
|
|
382
381
|
spec(
|
|
383
382
|
state,
|
|
384
383
|
name,
|
|
385
|
-
|
|
384
|
+
SERVICE_BIN,
|
|
386
385
|
[
|
|
387
386
|
"prepare-frontend",
|
|
388
387
|
frontendPackage(state.playground, state.renderer),
|
package/e2e/start.mjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { checkoutOf } from "./git.mjs";
|
|
3
|
+
import { up } from "./stack.mjs";
|
|
4
|
+
import { loadSuiteConfig, runPrepare } from "./journeys-config.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Omit<import("./stack.mjs").UpOptions, "playground" | "prepared"> & { playground?: string, prepare?: boolean, config?: string }} StartOptions How to start a run: `config` is the absolute path of a journeys config file, `prepare` first runs the journeys config's install and build commands, `playground` and `renderer` win over the journeys config, and `noStandby` is also on with `DMS_E2E_NO_STANDBY=1`
|
|
8
|
+
* @typedef {{ config?: string, frontend?: "build" | "dev", prepare?: boolean }} RunOptions How a test starts a run: `config` is a journeys config file, relative to the repository root, whose journeys folder is `journeys/` beside it (`e2e/journeys.config.ts` by default); `frontend: "dev"` serves the dashboard with `ajs dms dev` instead of a build; `prepare` runs the journeys config's install and build commands first, which it does unless `DMS_E2E_PREBUILT=1`
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How the stack of a test's run starts, the journeys config resolved
|
|
13
|
+
* against the root of the checkout `cwd` is in.
|
|
14
|
+
*
|
|
15
|
+
* @param {RunOptions} options How the test starts its run
|
|
16
|
+
* @param {string} cwd Where the run starts from
|
|
17
|
+
* @returns {StartOptions} How its stack starts
|
|
18
|
+
*/
|
|
19
|
+
export function startOptions(options, cwd) {
|
|
20
|
+
const root = checkoutOf(cwd).root ?? cwd;
|
|
21
|
+
/** @type {StartOptions} */
|
|
22
|
+
const start = {
|
|
23
|
+
prepare: options.prepare ?? process.env.DMS_E2E_PREBUILT !== "1",
|
|
24
|
+
frontendMode: options.frontend ?? "build",
|
|
25
|
+
};
|
|
26
|
+
if (options.config !== undefined)
|
|
27
|
+
start.config = resolve(root, options.config);
|
|
28
|
+
return start;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The playground and the renderer checkout a run starts: the options, then
|
|
33
|
+
* the journeys config.
|
|
34
|
+
*
|
|
35
|
+
* @param {Pick<StartOptions, "playground" | "renderer" | "config">} options
|
|
36
|
+
* @param {string} cwd Where the run starts from, which finds the journeys config
|
|
37
|
+
* @returns {Promise<{ playground: string, renderer: string | undefined }>}
|
|
38
|
+
*/
|
|
39
|
+
export async function targetOf(options, cwd) {
|
|
40
|
+
const config =
|
|
41
|
+
options.playground && options.renderer
|
|
42
|
+
? null
|
|
43
|
+
: await loadSuiteConfig(cwd, options.config).catch(() => null);
|
|
44
|
+
return {
|
|
45
|
+
playground: options.playground ?? config?.playground ?? "playground",
|
|
46
|
+
renderer: options.renderer ?? config?.renderer,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Starts the stack of a run: with `prepare`, the journeys config's install
|
|
52
|
+
* and build commands first, then the stack on its playground and renderer.
|
|
53
|
+
*
|
|
54
|
+
* @param {StartOptions} options How to start it
|
|
55
|
+
* @param {string} cwd Where the run starts from, which finds the journeys config
|
|
56
|
+
* @returns {Promise<import("./run-state.mjs").RunState>} The ready run
|
|
57
|
+
*/
|
|
58
|
+
export async function startStack(options, cwd) {
|
|
59
|
+
const { prepare, config: journeysConfig, ...upOptions } = options;
|
|
60
|
+
/** @type {import("./timing.mjs").TimingEntry[]} */
|
|
61
|
+
let prepared = [];
|
|
62
|
+
if (prepare) {
|
|
63
|
+
const config = await loadSuiteConfig(cwd, journeysConfig);
|
|
64
|
+
prepared = runPrepare(config, config.repo);
|
|
65
|
+
}
|
|
66
|
+
const state = await up({
|
|
67
|
+
...upOptions,
|
|
68
|
+
...(await targetOf(options, cwd)),
|
|
69
|
+
prepared,
|
|
70
|
+
noStandby:
|
|
71
|
+
options.noStandby === true || process.env.DMS_E2E_NO_STANDBY === "1",
|
|
72
|
+
});
|
|
73
|
+
if (state.frontendBuild?.reason) {
|
|
74
|
+
process.stderr.write(
|
|
75
|
+
`dms-e2e: the frontend build was not cached: ${state.frontendBuild.reason}\n`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return state;
|
|
79
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import {
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
3
|
import { checkoutOf } from "./git.mjs";
|
|
4
4
|
import { isRecord, isString } from "./json.mjs";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {import("./journey-load.mjs").Journey} Journey
|
|
8
|
-
* @typedef {{
|
|
9
|
-
* @typedef {{
|
|
8
|
+
* @typedef {{ config?: string, frontend?: "dev" }} SuiteOptions What a journeys suite runs: `config` is a journeys config file, relative to the repository root, whose journeys folder is `journeys/` beside it (`e2e/journeys.config.ts` by default); `frontend: "dev"` serves the dashboard with `ajs dms dev` and runs only the journeys that ask for it
|
|
9
|
+
* @typedef {{ config: string | undefined, frontend: "build" | "dev" }} Suite The suite a config declared, its journeys config absolute
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
const SUITE = "DMS_E2E_SUITE";
|
|
@@ -18,9 +18,9 @@ const SUITE = "DMS_E2E_SUITE";
|
|
|
18
18
|
function isSuiteOptions(value) {
|
|
19
19
|
return (
|
|
20
20
|
isRecord(value) &&
|
|
21
|
-
Object.keys(value).every((key) => key === "
|
|
22
|
-
(value.
|
|
23
|
-
(isString(value.
|
|
21
|
+
Object.keys(value).every((key) => key === "config" || key === "frontend") &&
|
|
22
|
+
(value.config === undefined ||
|
|
23
|
+
(isString(value.config) && value.config !== "")) &&
|
|
24
24
|
(value.frontend === undefined || value.frontend === "dev")
|
|
25
25
|
);
|
|
26
26
|
}
|
|
@@ -31,27 +31,27 @@ function isSuiteOptions(value) {
|
|
|
31
31
|
* that loaded the config.
|
|
32
32
|
*
|
|
33
33
|
* @param {unknown} options The options of `e2eConfig`
|
|
34
|
-
* @
|
|
34
|
+
* @returns {Suite} The suite
|
|
35
|
+
* @throws When an option is unknown, its value is not one the suite takes, or `config` names no file
|
|
35
36
|
*/
|
|
36
37
|
export function declareSuite(options) {
|
|
37
38
|
if (!isSuiteOptions(options)) {
|
|
38
39
|
throw new Error(
|
|
39
|
-
`e2eConfig takes {
|
|
40
|
+
`e2eConfig takes { config?: <a journeys config file>, frontend?: "dev" }, got ${JSON.stringify(options)}`,
|
|
40
41
|
);
|
|
41
42
|
}
|
|
42
43
|
const root = checkoutOf(process.cwd()).root ?? process.cwd();
|
|
43
44
|
/** @type {Suite} */
|
|
44
45
|
const suite = {
|
|
45
|
-
|
|
46
|
-
options.
|
|
46
|
+
config:
|
|
47
|
+
options.config === undefined ? undefined : resolve(root, options.config),
|
|
47
48
|
frontend: options.frontend ?? "build",
|
|
48
49
|
};
|
|
49
|
-
if (suite.
|
|
50
|
-
throw new Error(
|
|
51
|
-
`e2eConfig's skill ${suite.skill} holds no verify.config.ts`,
|
|
52
|
-
);
|
|
50
|
+
if (suite.config && !existsSync(suite.config)) {
|
|
51
|
+
throw new Error(`e2eConfig's config ${suite.config} does not exist`);
|
|
53
52
|
}
|
|
54
53
|
process.env[SUITE] = JSON.stringify(suite);
|
|
54
|
+
return suite;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -78,35 +78,24 @@ export function declaredSuite() {
|
|
|
78
78
|
function isSuite(value) {
|
|
79
79
|
return (
|
|
80
80
|
isRecord(value) &&
|
|
81
|
-
(value.
|
|
81
|
+
(value.config === undefined || isString(value.config)) &&
|
|
82
82
|
(value.frontend === "build" || value.frontend === "dev")
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
export function upArgs(suite, prepared) {
|
|
92
|
-
return [
|
|
93
|
-
...(prepared ? [] : ["--prepare"]),
|
|
94
|
-
...(suite.skill ? ["--skill", suite.skill] : []),
|
|
95
|
-
...(suite.frontend === "dev" ? ["--dev-frontend"] : []),
|
|
96
|
-
];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The journeys a suite runs, in the order of its features and with those
|
|
101
|
-
* marked `last` after all others: a `frontend: "dev"` suite runs the
|
|
102
|
-
* journeys that ask for the development dashboard, any other the rest.
|
|
87
|
+
* The journeys a suite runs: those of the `smoke` feature first, then the
|
|
88
|
+
* others in the order of their features, and those marked `last` after all
|
|
89
|
+
* others. A `frontend: "dev"` suite runs the journeys that ask for the
|
|
90
|
+
* development dashboard, any other the rest.
|
|
103
91
|
*
|
|
104
92
|
* @param {{ name: string, journeys: Journey[] }[]} features The features and their journeys
|
|
105
93
|
* @param {Suite["frontend"]} frontend How the suite's run serves its dashboard
|
|
94
|
+
* @param {string} smoke The feature whose journeys run first, the journeys config's `smoke`
|
|
106
95
|
* @returns {{ feature: string, journey: Journey }[]} The journeys, each with its feature
|
|
107
96
|
* @throws When two journeys share an id
|
|
108
97
|
*/
|
|
109
|
-
export function suiteJourneys(features, frontend) {
|
|
98
|
+
export function suiteJourneys(features, frontend, smoke) {
|
|
110
99
|
const ids = features.flatMap((feature) =>
|
|
111
100
|
feature.journeys.map((journey) => journey.id),
|
|
112
101
|
);
|
|
@@ -114,7 +103,10 @@ export function suiteJourneys(features, frontend) {
|
|
|
114
103
|
if (repeated.length > 0) {
|
|
115
104
|
throw new Error(`Journey ids registered twice: ${repeated.join(", ")}`);
|
|
116
105
|
}
|
|
117
|
-
const entries =
|
|
106
|
+
const entries = [
|
|
107
|
+
...features.filter((feature) => feature.name === smoke),
|
|
108
|
+
...features.filter((feature) => feature.name !== smoke),
|
|
109
|
+
]
|
|
118
110
|
.flatMap((feature) =>
|
|
119
111
|
feature.journeys.map((journey) => ({ feature: feature.name, journey })),
|
|
120
112
|
)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Pick<import("./journey-load.mjs").Journey, "database" | "onboard" | "backend" | "standby" | "knownFailures">} DmsOptions How the `dms` fixture prepares a test, with the fields of a journey: a fresh database with a backend of its own unless `database` is `"shared"`, that backend run as `backend` says, started for the test rather than taken from the standby with `standby: false`, an onboarded administrator unless `onboard` is false, and the checks of `knownFailures` judged as known failures
|
|
5
|
+
* @typedef {Pick<import("@playwright/test").TestInfo, "title" | "titlePath" | "file" | "annotations">} TestIdentity What names a test
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A test title as one folder name: runs of other characters than letters,
|
|
10
|
+
* digits, `_` and `-` become `-`, so a title never names a folder outside
|
|
11
|
+
* the run's evidence.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} text The title
|
|
14
|
+
* @returns {string} The folder name, never empty
|
|
15
|
+
*/
|
|
16
|
+
function folderName(text) {
|
|
17
|
+
const name = text.replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
18
|
+
return name === "" ? "test" : name;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The feature a test records its evidence under: the titles of its
|
|
23
|
+
* `describe` blocks, or its file's name without its extensions.
|
|
24
|
+
*
|
|
25
|
+
* @param {TestIdentity} testInfo The test
|
|
26
|
+
* @returns {string} The feature's folder name
|
|
27
|
+
*/
|
|
28
|
+
export function featureOf(testInfo) {
|
|
29
|
+
const describes = testInfo.titlePath.slice(1, -1);
|
|
30
|
+
return folderName(
|
|
31
|
+
describes.length > 0
|
|
32
|
+
? describes.join(" ")
|
|
33
|
+
: basename(testInfo.file).split(".")[0],
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The journey a test is: its title as its id, the `title` and `entry
|
|
39
|
+
* point` annotations `registerJourneys` gives a journey's test, and its
|
|
40
|
+
* options.
|
|
41
|
+
*
|
|
42
|
+
* @param {TestIdentity} testInfo The test
|
|
43
|
+
* @param {DmsOptions} options Its options
|
|
44
|
+
* @returns {DmsOptions & { id: string, title: string, entryPoint: string }} The journey
|
|
45
|
+
*/
|
|
46
|
+
export function journeyOf(testInfo, options) {
|
|
47
|
+
const annotation = (/** @type {string} */ type) =>
|
|
48
|
+
testInfo.annotations.find((entry) => entry.type === type)?.description;
|
|
49
|
+
return {
|
|
50
|
+
...options,
|
|
51
|
+
id: folderName(testInfo.title),
|
|
52
|
+
title: annotation("title") ?? testInfo.title,
|
|
53
|
+
entryPoint: annotation("entry point") ?? "",
|
|
54
|
+
};
|
|
55
|
+
}
|