@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
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { mkdirSync, rmSync } from "node:fs";
|
|
3
3
|
import { join, relative } from "node:path";
|
|
4
4
|
import { withBaseBackend } from "./base.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { newContext, screenshot } from "./browser.mjs";
|
|
6
6
|
import { startDatabase, stopDatabase } from "./database.mjs";
|
|
7
7
|
import { capturedMail } from "./mail.mjs";
|
|
8
|
-
import { abortMessage
|
|
9
|
-
import {
|
|
10
|
-
import { readRecordList } from "./json.mjs";
|
|
8
|
+
import { abortMessage } from "./journey-judge.mjs";
|
|
9
|
+
import { writeJson } from "./json.mjs";
|
|
11
10
|
import { saveRun } from "./run-state.mjs";
|
|
12
11
|
import {
|
|
13
12
|
adminCredentials,
|
|
@@ -16,22 +15,15 @@ import {
|
|
|
16
15
|
onboard,
|
|
17
16
|
recordedRequest,
|
|
18
17
|
} from "./session.mjs";
|
|
19
|
-
import {
|
|
20
|
-
import { ensureMail } from "./stack.mjs";
|
|
21
|
-
import {
|
|
22
|
-
assertForwardedRun,
|
|
23
|
-
freshDatabase,
|
|
24
|
-
restartBackend,
|
|
25
|
-
} from "./backend.mjs";
|
|
18
|
+
import { restartBackend } from "./backend.mjs";
|
|
26
19
|
import { Tab } from "./tab.mjs";
|
|
27
|
-
import {
|
|
20
|
+
import { timed } from "./timing.mjs";
|
|
28
21
|
|
|
29
22
|
/**
|
|
30
|
-
* @typedef {import("./
|
|
23
|
+
* @typedef {import("./types.mjs").JourneyCheck} Check
|
|
31
24
|
* @typedef {ReturnType<typeof capturedMail>[number]} CapturedMail
|
|
32
|
-
* @typedef {import("./
|
|
33
|
-
* @typedef {
|
|
34
|
-
* @typedef {import("./verify/types.mjs").JourneyStep} Step
|
|
25
|
+
* @typedef {import("./types.mjs").JourneyStep} Step
|
|
26
|
+
* @typedef {{ error: string | null, abortedAt: string | null }} JourneyEnd How a journey ended early: `abortedAt` names the critical step whose failure ended it, `error` what it threw
|
|
35
27
|
*/
|
|
36
28
|
|
|
37
29
|
const EXPECT_TIMEOUT_MS = 15_000;
|
|
@@ -59,14 +51,6 @@ function slug(text) {
|
|
|
59
51
|
.slice(0, 60);
|
|
60
52
|
}
|
|
61
53
|
|
|
62
|
-
/**
|
|
63
|
-
* @param {string} file The file
|
|
64
|
-
* @param {unknown} value The value
|
|
65
|
-
*/
|
|
66
|
-
function writeJson(file, value) {
|
|
67
|
-
writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
54
|
/**
|
|
71
55
|
* An equality check over JSON-serialisable values.
|
|
72
56
|
*
|
|
@@ -122,12 +106,12 @@ export class JourneyContext {
|
|
|
122
106
|
* @param {import("./run-state.mjs").RunState} state The run
|
|
123
107
|
* @param {string} feature The feature the journey belongs to
|
|
124
108
|
* @param {string} journey The journey id
|
|
125
|
-
* @param {import("playwright-core").Browser} browser The Playwright browser
|
|
126
|
-
* @param {import("./
|
|
109
|
+
* @param {Pick<import("playwright-core").Browser, "newContext">} browser The Playwright browser
|
|
110
|
+
* @param {import("./journeys-config.mjs").SuiteConfig | undefined} config The journeys config the journey belongs to, none for a browserless run
|
|
127
111
|
*/
|
|
128
|
-
constructor(state, feature, journey, browser,
|
|
112
|
+
constructor(state, feature, journey, browser, config) {
|
|
129
113
|
this.state = state;
|
|
130
|
-
this.
|
|
114
|
+
this.config = config;
|
|
131
115
|
this.feature = feature;
|
|
132
116
|
this.journey = journey;
|
|
133
117
|
this.browser = browser;
|
|
@@ -140,6 +124,8 @@ export class JourneyContext {
|
|
|
140
124
|
/** @type {Tab | undefined} */
|
|
141
125
|
this.lastTab = undefined;
|
|
142
126
|
this.databaseStopped = false;
|
|
127
|
+
/** @type {JourneyEnd} */
|
|
128
|
+
this.end = { error: null, abortedAt: null };
|
|
143
129
|
this.startedAt = new Date().toISOString();
|
|
144
130
|
this.equal = equal;
|
|
145
131
|
this.status = status;
|
|
@@ -324,7 +310,12 @@ export class JourneyContext {
|
|
|
324
310
|
* @returns {Promise<string>} The base commit
|
|
325
311
|
*/
|
|
326
312
|
async withBaseBackend(action) {
|
|
327
|
-
|
|
313
|
+
if (!this.config) {
|
|
314
|
+
throw new Error(
|
|
315
|
+
"ctx.withBaseBackend() needs a journeys config, and a browserless runJourney has none",
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
const sha = await withBaseBackend(this.state, this.config, action);
|
|
328
319
|
writeJson(join(this.step("base version"), "base.json"), {
|
|
329
320
|
baseRef: this.state.baseRef,
|
|
330
321
|
sha,
|
|
@@ -376,199 +367,49 @@ export class JourneyContext {
|
|
|
376
367
|
return { folder, messages, match: messages.findLast(accept) };
|
|
377
368
|
}
|
|
378
369
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
if (this.databaseStopped) await this.startDatabase();
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* @param {import("./run-state.mjs").RunState} state The run
|
|
389
|
-
* @param {string} feature The feature the journey belongs to
|
|
390
|
-
* @param {Journey} journey The journey
|
|
391
|
-
* @param {JourneyContext} context The journey's context
|
|
392
|
-
*/
|
|
393
|
-
async function prepare(state, feature, journey, context) {
|
|
394
|
-
const detail = { feature, journey: journey.id };
|
|
395
|
-
await ensureMail(state);
|
|
396
|
-
if (journey.database !== "shared") {
|
|
397
|
-
const index = String((state.journeyCount ?? 0) + 1).padStart(3, "0");
|
|
398
|
-
state.journeyCount = Number(index);
|
|
399
|
-
await timed(
|
|
400
|
-
state,
|
|
401
|
-
"fresh-database",
|
|
402
|
-
() => freshDatabase(state, `j${index}`, journey),
|
|
403
|
-
detail,
|
|
404
|
-
);
|
|
405
|
-
const backend = state.processes.find((entry) => entry.name === "backend");
|
|
406
|
-
writeJson(join(context.step("fresh database"), "database.json"), {
|
|
407
|
-
database: state.database,
|
|
408
|
-
backendMode: backend?.mode ?? "production",
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
if (journey.onboard === false || state.accounts?.admin) return;
|
|
412
|
-
const folder = context.step("onboard the administrator");
|
|
413
|
-
const answer = await timed(
|
|
414
|
-
state,
|
|
415
|
-
"onboard",
|
|
416
|
-
() => onboard(state, {}),
|
|
417
|
-
detail,
|
|
418
|
-
);
|
|
419
|
-
context.record(
|
|
420
|
-
folder,
|
|
421
|
-
[
|
|
422
|
-
holds(
|
|
423
|
-
"POST /api/onboarding/register answers 2xx",
|
|
424
|
-
answer.register.status === 200,
|
|
425
|
-
answer.register.status,
|
|
426
|
-
),
|
|
427
|
-
holds(
|
|
428
|
-
"the administrator signs in",
|
|
429
|
-
answer.login?.status === 200,
|
|
430
|
-
answer.login?.status,
|
|
431
|
-
),
|
|
432
|
-
],
|
|
433
|
-
{ critical: true },
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Runs one journey: by default on a fresh database with an onboarded
|
|
439
|
-
* administrator (`database: "shared"` keeps the current one, `onboard:
|
|
440
|
-
* false` skips the administrator), with fresh browser contexts, and writes
|
|
441
|
-
* its result.json. The contexts open in `browser`, which it leaves open, or
|
|
442
|
-
* else in a browser it launches and closes.
|
|
443
|
-
*
|
|
444
|
-
* @param {import("./run-state.mjs").RunState} state The run
|
|
445
|
-
* @param {string} feature The feature it belongs to
|
|
446
|
-
* @param {Journey} journey The journey
|
|
447
|
-
* @param {import("./verify/skill.mjs").Skill} skill The skill the journey belongs to
|
|
448
|
-
* @param {import("playwright-core").Browser} [browser] The browser to open its contexts in, such as Playwright Test's
|
|
449
|
-
* @returns {Promise<FeatureResult>} The result
|
|
450
|
-
*/
|
|
451
|
-
export async function runJourney(state, feature, journey, skill, browser) {
|
|
452
|
-
const stop = stopwatch();
|
|
453
|
-
const detail = { feature, journey: journey.id };
|
|
454
|
-
/** @type {Omit<FeatureResult, "ms"> | undefined} */
|
|
455
|
-
let result;
|
|
456
|
-
let lap = { ms: 0, startedAt: "" };
|
|
457
|
-
try {
|
|
458
|
-
result = await driveJourney(state, feature, journey, skill, browser);
|
|
459
|
-
} finally {
|
|
460
|
-
lap = stop();
|
|
461
|
-
recordTiming(state, "journey", lap, result?.status === "PASS", detail);
|
|
370
|
+
/** Whether a critical step or an error ended the journey early. */
|
|
371
|
+
get ended() {
|
|
372
|
+
return this.end.error !== null || this.end.abortedAt !== null;
|
|
462
373
|
}
|
|
463
|
-
const timedResult = { ...result, ms: lap.ms };
|
|
464
|
-
writeJson(join(state.evidence, result.folder, "result.json"), timedResult);
|
|
465
|
-
return timedResult;
|
|
466
|
-
}
|
|
467
374
|
|
|
468
|
-
/**
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
async function driveJourney(state, feature, journey, skill, given) {
|
|
479
|
-
const detail = { feature, journey: journey.id };
|
|
480
|
-
const browser =
|
|
481
|
-
given ??
|
|
482
|
-
(await timed(
|
|
483
|
-
state,
|
|
484
|
-
"browser-launch",
|
|
485
|
-
() => launchBrowser(resolutionFolders(state)),
|
|
486
|
-
detail,
|
|
487
|
-
));
|
|
488
|
-
const context = new JourneyContext(
|
|
489
|
-
state,
|
|
490
|
-
feature,
|
|
491
|
-
journey.id,
|
|
492
|
-
browser,
|
|
493
|
-
skill,
|
|
494
|
-
);
|
|
495
|
-
/** @type {string | null} */
|
|
496
|
-
let error = null;
|
|
497
|
-
/** @type {string | null} */
|
|
498
|
-
let abortedAt = null;
|
|
499
|
-
try {
|
|
500
|
-
await prepare(state, feature, journey, context);
|
|
501
|
-
await timed(state, "journey-run", () => journey.run(context), detail);
|
|
502
|
-
} catch (failure) {
|
|
503
|
-
if (failure instanceof JourneyAbort) abortedAt = failure.step;
|
|
504
|
-
else error = String(failure?.stack ?? failure);
|
|
505
|
-
} finally {
|
|
375
|
+
/**
|
|
376
|
+
* Runs a part of the journey unless the journey already ended. A critical
|
|
377
|
+
* step that fails in it, or an error it throws, ends the journey, and
|
|
378
|
+
* `judgeJourney` reads how.
|
|
379
|
+
*
|
|
380
|
+
* @param {() => Promise<unknown>} part The part
|
|
381
|
+
* @returns {Promise<void>} Resolves once it ran, whatever its outcome
|
|
382
|
+
*/
|
|
383
|
+
async attempt(part) {
|
|
384
|
+
if (this.ended) return;
|
|
506
385
|
try {
|
|
507
|
-
await
|
|
386
|
+
await part();
|
|
508
387
|
} catch (failure) {
|
|
509
|
-
|
|
510
|
-
error =
|
|
388
|
+
if (failure instanceof JourneyAbort) this.end.abortedAt = failure.step;
|
|
389
|
+
else this.end.error = String(failure?.stack ?? failure);
|
|
511
390
|
}
|
|
512
|
-
if (given === undefined) await browser.close();
|
|
513
391
|
}
|
|
514
|
-
const judged = judge(
|
|
515
|
-
context.steps,
|
|
516
|
-
{ error, abortedAt },
|
|
517
|
-
journey.knownFailures ?? {},
|
|
518
|
-
);
|
|
519
|
-
return {
|
|
520
|
-
feature,
|
|
521
|
-
journey: journey.id,
|
|
522
|
-
title: journey.title,
|
|
523
|
-
entryPoint: journey.entryPoint,
|
|
524
|
-
status: judged.status,
|
|
525
|
-
database: state.database,
|
|
526
|
-
steps: judged.steps,
|
|
527
|
-
error: judged.error,
|
|
528
|
-
folder: relative(state.evidence, context.folder),
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
392
|
|
|
532
|
-
/**
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
);
|
|
546
|
-
if (unknown.length > 0) {
|
|
547
|
-
throw new Error(
|
|
548
|
-
`Unknown journeys of ${request.feature}: ${unknown.join(", ")}`,
|
|
393
|
+
/**
|
|
394
|
+
* Drives a journey's body in this context, timed as `journey-run`, as
|
|
395
|
+
* {@link JourneyContext.attempt} runs a part: what ends it early is the
|
|
396
|
+
* judge's to read, so a critical step that fails at a known failure ends
|
|
397
|
+
* it without failing it.
|
|
398
|
+
*
|
|
399
|
+
* @param {(context: JourneyContext) => Promise<void>} run The body
|
|
400
|
+
* @returns {Promise<void>} Resolves once it ran, whatever its outcome
|
|
401
|
+
*/
|
|
402
|
+
drive(run) {
|
|
403
|
+
const detail = { feature: this.feature, journey: this.journey };
|
|
404
|
+
return this.attempt(() =>
|
|
405
|
+
timed(this.state, "journey-run", () => run(this), detail),
|
|
549
406
|
);
|
|
550
407
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
const results = [];
|
|
559
|
-
for (const journey of selected)
|
|
560
|
-
results.push(
|
|
561
|
-
await runJourney(state, request.feature, journey, request.skill),
|
|
562
|
-
);
|
|
563
|
-
const file = join(state.evidence, request.feature, "feature.json");
|
|
564
|
-
const earlier = existsSync(file) ? readRecordList(file) : [];
|
|
565
|
-
const merged = journeys.flatMap((journey) => {
|
|
566
|
-
const fresh = results.filter((result) => result.journey === journey.id);
|
|
567
|
-
return fresh.length > 0
|
|
568
|
-
? fresh
|
|
569
|
-
: earlier.filter((result) => result.journey === journey.id);
|
|
570
|
-
});
|
|
571
|
-
writeJson(file, merged);
|
|
572
|
-
saveRun(state);
|
|
573
|
-
return results;
|
|
408
|
+
|
|
409
|
+
async close() {
|
|
410
|
+
for (const context of this.contexts.values()) {
|
|
411
|
+
await context.close().catch(() => undefined);
|
|
412
|
+
}
|
|
413
|
+
if (this.databaseStopped) await this.startDatabase();
|
|
414
|
+
}
|
|
574
415
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { checkoutOf } from "./git.mjs";
|
|
6
|
+
import { arrayOf, decode, isRecord, isString, objectOf } from "./json.mjs";
|
|
7
|
+
import { stopwatch } from "./timing.mjs";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {{ playground: string, renderer?: string, prepare: string[][], smoke: string }} JourneysConfig The default export of a repository's `e2e/journeys.config.ts`: the playground folder and the built renderer checkout the run serves, relative to the repository root; the install and build commands that prepare a run; and the feature whose journeys run first. Each `*.mjs` file of `e2e/journeys/` is a feature, named after the file
|
|
11
|
+
* @typedef {{ source: string, repo: string, playground: string, renderer: string | undefined, prepare: string[][], smoke: string, journeysDir: string, features: string[] }} SuiteConfig A loaded journeys config, its paths absolute, read from `source`
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Where a repository declares its journeys suite, relative to its root. */
|
|
15
|
+
export const JOURNEYS_CONFIG = "e2e/journeys.config.ts";
|
|
16
|
+
|
|
17
|
+
const OUTPUT_LIMIT = 64 * 1024 * 1024;
|
|
18
|
+
|
|
19
|
+
const strings = arrayOf(isString);
|
|
20
|
+
|
|
21
|
+
const isJourneysConfig = objectOf(
|
|
22
|
+
{ playground: isString, prepare: arrayOf(strings), smoke: isString },
|
|
23
|
+
{ renderer: isString },
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} folder The journeys folder
|
|
28
|
+
* @returns {string[]} Its features: the names of its `*.mjs` files, sorted
|
|
29
|
+
*/
|
|
30
|
+
function featuresIn(folder) {
|
|
31
|
+
return readdirSync(folder)
|
|
32
|
+
.filter((file) => file.endsWith(".mjs"))
|
|
33
|
+
.map((file) => file.slice(0, -".mjs".length))
|
|
34
|
+
.sort();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} file The config file
|
|
39
|
+
* @param {string} repo The repository root
|
|
40
|
+
* @returns {Promise<SuiteConfig>} The suite it declares
|
|
41
|
+
*/
|
|
42
|
+
async function loadOwnConfig(file, repo) {
|
|
43
|
+
/** @type {unknown} */
|
|
44
|
+
const loaded = await import(pathToFileURL(file).href);
|
|
45
|
+
const config = decode(
|
|
46
|
+
isJourneysConfig,
|
|
47
|
+
isRecord(loaded) ? loaded.default : undefined,
|
|
48
|
+
file,
|
|
49
|
+
"a journeys config",
|
|
50
|
+
);
|
|
51
|
+
const journeysDir = join(dirname(file), "journeys");
|
|
52
|
+
return {
|
|
53
|
+
source: file,
|
|
54
|
+
repo,
|
|
55
|
+
playground: resolve(repo, config.playground),
|
|
56
|
+
renderer:
|
|
57
|
+
config.renderer === undefined
|
|
58
|
+
? undefined
|
|
59
|
+
: resolve(repo, config.renderer),
|
|
60
|
+
prepare: config.prepare,
|
|
61
|
+
smoke: config.smoke,
|
|
62
|
+
journeysDir,
|
|
63
|
+
features: existsSync(journeysDir) ? featuresIn(journeysDir) : [],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The journeys suite of the checkout holding `cwd`: the journeys config
|
|
69
|
+
* `config` names, else `e2e/journeys.config.ts`.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} cwd Where the suite runs
|
|
72
|
+
* @param {string} [config] A journeys config file, relative to the repository root, whose journeys are in `journeys/` beside it; `e2e/journeys.config.ts` by default
|
|
73
|
+
* @returns {Promise<SuiteConfig>} The suite
|
|
74
|
+
* @throws When the config does not exist or does not load
|
|
75
|
+
*/
|
|
76
|
+
export async function loadSuiteConfig(cwd, config) {
|
|
77
|
+
const repo = resolve(checkoutOf(cwd).root ?? cwd);
|
|
78
|
+
const own = resolve(repo, config ?? JOURNEYS_CONFIG);
|
|
79
|
+
if (!existsSync(own)) {
|
|
80
|
+
throw new Error(`the journeys config ${own} does not exist`);
|
|
81
|
+
}
|
|
82
|
+
return loadOwnConfig(own, repo);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The journeys module of a feature.
|
|
87
|
+
*
|
|
88
|
+
* @param {SuiteConfig} config The suite
|
|
89
|
+
* @param {string} feature The feature name
|
|
90
|
+
* @returns {string} Its path
|
|
91
|
+
*/
|
|
92
|
+
export function journeysFile(config, feature) {
|
|
93
|
+
return join(config.journeysDir, `${feature}.mjs`);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Runs the suite's `prepare` commands (install and build) in a checkout of
|
|
98
|
+
* the repository, so a run starts from a fresh build.
|
|
99
|
+
*
|
|
100
|
+
* @param {Pick<SuiteConfig, "prepare">} config The suite
|
|
101
|
+
* @param {string} cwd The checkout
|
|
102
|
+
* @returns {import("./timing.mjs").TimingEntry[]} One timing entry per command, for the run folder that does not exist yet
|
|
103
|
+
* @throws When a command fails, with its output
|
|
104
|
+
*/
|
|
105
|
+
export function runPrepare(config, cwd) {
|
|
106
|
+
return config.prepare.map(([program, ...args]) => {
|
|
107
|
+
const stop = stopwatch();
|
|
108
|
+
const result = spawnSync(program, args, {
|
|
109
|
+
cwd,
|
|
110
|
+
encoding: "utf8",
|
|
111
|
+
maxBuffer: OUTPUT_LIMIT,
|
|
112
|
+
env: { ...process.env, CI: "1" },
|
|
113
|
+
});
|
|
114
|
+
if (result.status !== 0) {
|
|
115
|
+
throw new Error(
|
|
116
|
+
`${program} ${args.join(" ")} failed in ${cwd}:\n${result.stdout}${result.stderr}`,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
phase: "prepare",
|
|
121
|
+
...stop(),
|
|
122
|
+
ok: true,
|
|
123
|
+
command: [program, ...args].join(" "),
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Reads of JSON a program received, narrowed through checks instead of typed
|
|
@@ -49,24 +49,6 @@ export function firstString(body) {
|
|
|
49
49
|
return isString(first) ? first : undefined;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* The objects a JSON file lists, kept as written.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} file The JSON file
|
|
56
|
-
* @returns {Record<string, unknown>[]} The listed objects
|
|
57
|
-
* @throws When the file holds anything but a list of objects
|
|
58
|
-
*/
|
|
59
|
-
export function readRecordList(file) {
|
|
60
|
-
/** @type {unknown} */
|
|
61
|
-
const stored = JSON.parse(readFileSync(file, "utf8"));
|
|
62
|
-
if (!Array.isArray(stored))
|
|
63
|
-
throw new Error(`${file} is not a list of objects`);
|
|
64
|
-
const records = stored.filter(isRecord);
|
|
65
|
-
if (records.length !== stored.length)
|
|
66
|
-
throw new Error(`${file} is not a list of objects`);
|
|
67
|
-
return records;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
52
|
/**
|
|
71
53
|
* @template T
|
|
72
54
|
* @typedef {(value: unknown) => value is T} Guard A check that narrows a parsed JSON value to `T`
|
|
@@ -159,19 +141,6 @@ export function oneOf(names) {
|
|
|
159
141
|
return (value) => isString(value) && names.some((name) => name === value);
|
|
160
142
|
}
|
|
161
143
|
|
|
162
|
-
/**
|
|
163
|
-
* @template T
|
|
164
|
-
* @param {new (...args: never[]) => T} constructor The class
|
|
165
|
-
* @returns {Guard<T>} A guard for its instances
|
|
166
|
-
*/
|
|
167
|
-
export function instanceOf(constructor) {
|
|
168
|
-
/**
|
|
169
|
-
* @param {unknown} value A value
|
|
170
|
-
* @returns {value is T} True for an instance
|
|
171
|
-
*/
|
|
172
|
-
return (value) => value instanceof constructor;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
144
|
/**
|
|
176
145
|
* @param {Record<string, unknown>} record An object
|
|
177
146
|
* @param {string} key The property
|
|
@@ -227,3 +196,13 @@ export function decode(guard, value, source, expected) {
|
|
|
227
196
|
if (guard(value)) return value;
|
|
228
197
|
throw new Error(`${source} is malformed: expected ${expected}`);
|
|
229
198
|
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Writes `value` to `file` as indented JSON with a final newline.
|
|
202
|
+
*
|
|
203
|
+
* @param {string} file The file
|
|
204
|
+
* @param {unknown} value The value
|
|
205
|
+
*/
|
|
206
|
+
export function writeJson(file, value) {
|
|
207
|
+
writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
|
|
208
|
+
}
|
|
@@ -5,11 +5,11 @@ import { RENDERER_CLI } from "./renderer.mjs";
|
|
|
5
5
|
|
|
6
6
|
const DROPPED_PREFIXES = ["ANTELOPEJS_", "npm_", "PNPM_", "DMS_", "MONGO_"];
|
|
7
7
|
|
|
8
|
-
/** This package's root, which resolves
|
|
9
|
-
export const PACKAGE_ROOT = resolve(import.meta.dirname, ".."
|
|
8
|
+
/** This package's root, which resolves the kit's own dependencies. */
|
|
9
|
+
export const PACKAGE_ROOT = resolve(import.meta.dirname, "..");
|
|
10
10
|
|
|
11
|
-
/** The
|
|
12
|
-
export const
|
|
11
|
+
/** The kit's service entry, which runs a service of a run (see `runService`). */
|
|
12
|
+
export const SERVICE_BIN = join(import.meta.dirname, "service.mjs");
|
|
13
13
|
|
|
14
14
|
/** The AntelopeJS environment every run builds and starts. */
|
|
15
15
|
export const ENVIRONMENT = "docs";
|
|
@@ -86,8 +86,8 @@ export function runEnv(state) {
|
|
|
86
86
|
NO_UPDATE_NOTIFIER: "1",
|
|
87
87
|
COREPACK_HOME:
|
|
88
88
|
process.env.COREPACK_HOME ?? join(cacheHome, "node", "corepack"),
|
|
89
|
-
npm_config_cache: join(cacheHome, "dms-
|
|
90
|
-
npm_config_store_dir: join(cacheHome, "dms-
|
|
89
|
+
npm_config_cache: join(cacheHome, "dms-e2e", "npm"),
|
|
90
|
+
npm_config_store_dir: join(cacheHome, "dms-e2e", "pnpm-store"),
|
|
91
91
|
PORT: String(state.apiPort),
|
|
92
92
|
DMS_CLIENT_BASE_URL: state.webUrl,
|
|
93
93
|
DMS_API_BASE_URL: state.apiUrl,
|
|
@@ -121,8 +121,7 @@ function saveMessage(folder, envelope, raw) {
|
|
|
121
121
|
*/
|
|
122
122
|
function command(state, socket, line) {
|
|
123
123
|
const verb = line.slice(0, 4).toUpperCase();
|
|
124
|
-
if (verb === "EHLO" || verb === "HELO")
|
|
125
|
-
return reply(socket, "250 dms-control");
|
|
124
|
+
if (verb === "EHLO" || verb === "HELO") return reply(socket, "250 dms-e2e");
|
|
126
125
|
if (verb === "MAIL") {
|
|
127
126
|
state.envelope = { from: line.slice(line.indexOf(":") + 1).trim(), to: [] };
|
|
128
127
|
return reply(socket, "250 OK");
|
|
@@ -147,7 +146,7 @@ function session(folder) {
|
|
|
147
146
|
return (/** @type {import("node:net").Socket} */ socket) => {
|
|
148
147
|
/** @type {SmtpSession} */
|
|
149
148
|
const state = { buffer: "", inData: false, envelope: { from: "", to: [] } };
|
|
150
|
-
reply(socket, "220 dms-
|
|
149
|
+
reply(socket, "220 dms-e2e mail sink");
|
|
151
150
|
socket.on("data", (/** @type {Buffer} */ chunk) => {
|
|
152
151
|
state.buffer += chunk.toString("latin1");
|
|
153
152
|
while (state.buffer.length > 0) {
|
|
@@ -20,9 +20,9 @@ function isAntelopeModule(folder) {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* The module a playground verifies: the nearest folder above it whose
|
|
23
|
-
* `package.json` declares `antelopeJs`, so a playground in a
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* `package.json` declares `antelopeJs`, so a playground in a subfolder of
|
|
24
|
+
* the repository (`e2e/playground`) verifies the repository's module, not
|
|
25
|
+
* that folder. The search stops at the playground's
|
|
26
26
|
* checkout, so a module above the checkout is never its module. Its parent
|
|
27
27
|
* when no folder in that range declares one.
|
|
28
28
|
*
|
|
@@ -41,7 +41,7 @@ const PRIMARY_POLL_MS = 100;
|
|
|
41
41
|
const ALREADY_INITIALIZED = 23;
|
|
42
42
|
|
|
43
43
|
/** The single-node replica set the run's mongod serves, so change streams work on it. */
|
|
44
|
-
const REPLICA_SET = "dms-
|
|
44
|
+
const REPLICA_SET = "dms-e2e";
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* @param {unknown} value
|
|
@@ -197,14 +197,14 @@ async function importNamespace(name, from) {
|
|
|
197
197
|
function missingPackage(name) {
|
|
198
198
|
const { optionalDependencies } = decode(
|
|
199
199
|
objectOf({ optionalDependencies: recordOf(isString) }),
|
|
200
|
-
createRequire(import.meta.url)("
|
|
200
|
+
createRequire(import.meta.url)("../package.json"),
|
|
201
201
|
"@antelopejs/dms package.json",
|
|
202
202
|
"optionalDependencies of version ranges",
|
|
203
203
|
);
|
|
204
204
|
if (!Object.hasOwn(optionalDependencies, name))
|
|
205
|
-
return `
|
|
205
|
+
return `the e2e kit needs ${name}: add it to the playground's devDependencies.`;
|
|
206
206
|
const spec = `${name}@${optionalDependencies[name]}`;
|
|
207
|
-
return `
|
|
207
|
+
return `the e2e kit needs ${name}, an optional dependency of @antelopejs/dms that this install skipped: run \`npm install --save-dev ${spec}\` (or \`pnpm add --save-dev ${spec}\`) in the module that runs the e2e suite.`;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
/**
|
|
@@ -228,16 +228,16 @@ function mongodOnPath() {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
|
-
* The mongod binary: `
|
|
231
|
+
* The mongod binary: `DMS_E2E_MONGOD`, else `mongod` on PATH, else the
|
|
232
232
|
* one mongodb-memory-server-core caches (and downloads once). A
|
|
233
|
-
* `
|
|
233
|
+
* `DMS_E2E_MONGOD` that names a JavaScript file, such as a stand-in,
|
|
234
234
|
* runs on this Node (see {@link startMongod}).
|
|
235
235
|
*
|
|
236
236
|
* @param {string[]} from Folders to resolve mongodb-memory-server-core from
|
|
237
237
|
* @returns {Promise<string>} The binary path
|
|
238
238
|
*/
|
|
239
239
|
export async function mongodBinary(from) {
|
|
240
|
-
const configured = process.env.
|
|
240
|
+
const configured = process.env.DMS_E2E_MONGOD ?? mongodOnPath();
|
|
241
241
|
if (configured) return configured;
|
|
242
242
|
const namespace = await importNamespace("mongodb-memory-server-core", from);
|
|
243
243
|
const binary = namespace.MongoBinary;
|
|
@@ -258,7 +258,7 @@ export async function mongodBinary(from) {
|
|
|
258
258
|
* under the run folder, as the only member of a replica set, so change
|
|
259
259
|
* streams work. A mongod that does not become primary is stopped before the
|
|
260
260
|
* error is thrown. A binary that is a JavaScript file runs on this Node, as
|
|
261
|
-
* every other process
|
|
261
|
+
* every other process the kit starts does, since Windows runs no script
|
|
262
262
|
* by its path alone.
|
|
263
263
|
*
|
|
264
264
|
* @param {{ mongo: string, logs: string }} paths The run's folders
|
|
@@ -15,6 +15,6 @@ import {
|
|
|
15
15
|
try {
|
|
16
16
|
buildInPreparedWorkspace(join(dirname(process.argv[1] ?? ""), ".."));
|
|
17
17
|
} catch (error) {
|
|
18
|
-
process.stderr.write(`dms-
|
|
18
|
+
process.stderr.write(`dms-e2e: ${describeFailure(error)}\n`);
|
|
19
19
|
process.exit(PREPARED_WORKSPACE_REFUSED);
|
|
20
20
|
}
|