@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
|
@@ -4,31 +4,31 @@ import { basename, join, relative } from "node:path";
|
|
|
4
4
|
import { git } from "./git.mjs";
|
|
5
5
|
import { runToEnd } from "./processes.mjs";
|
|
6
6
|
import { saveRun } from "./run-state.mjs";
|
|
7
|
-
import { runPrepare } from "./
|
|
7
|
+
import { runPrepare } from "./journeys-config.mjs";
|
|
8
8
|
import { COPY_SKIPPED, layOutCopy } from "./run-copy.mjs";
|
|
9
9
|
import { cliPaths, ENVIRONMENT, spec } from "./launch.mjs";
|
|
10
10
|
import { restartBackend } from "./backend.mjs";
|
|
11
11
|
import { moduleRootOf } from "./module-root.mjs";
|
|
12
12
|
|
|
13
|
-
const READY_MARK = ".dms-
|
|
13
|
+
const READY_MARK = ".dms-e2e-ready";
|
|
14
14
|
|
|
15
15
|
function baseCache() {
|
|
16
16
|
const cacheHome = process.env.XDG_CACHE_HOME ?? join(homedir(), ".cache");
|
|
17
|
-
return join(cacheHome, "dms-
|
|
17
|
+
return join(cacheHome, "dms-e2e", "base");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* A prepared worktree of the run's base ref, built once per commit under
|
|
22
|
-
* `~/.cache/dms-
|
|
22
|
+
* `~/.cache/dms-e2e/base/<sha>` with the journeys config's `prepare` commands.
|
|
23
23
|
* When the base ref has no playground folder, as in the change that adds
|
|
24
24
|
* it, the worktree gets a copy of the run's playground before `prepare`,
|
|
25
25
|
* and is built again on every call so the copy follows the run's.
|
|
26
26
|
*
|
|
27
27
|
* @param {import("./run-state.mjs").RunState} state The run
|
|
28
|
-
* @param {import("./
|
|
28
|
+
* @param {Pick<import("./journeys-config.mjs").SuiteConfig, "prepare">} config The journeys config
|
|
29
29
|
* @returns {{ sha: string, dir: string, playground: string }} The base commit, its worktree and its playground
|
|
30
30
|
*/
|
|
31
|
-
export function baseCheckout(state,
|
|
31
|
+
export function baseCheckout(state, config) {
|
|
32
32
|
const sha = git(["rev-parse", `${state.baseRef}^{commit}`], state.repo);
|
|
33
33
|
const dir = join(baseCache(), sha);
|
|
34
34
|
const path = relative(state.repo, state.playground);
|
|
@@ -48,7 +48,7 @@ export function baseCheckout(state, skill) {
|
|
|
48
48
|
filter: (source) => !COPY_SKIPPED.has(basename(source)),
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
runPrepare(
|
|
51
|
+
runPrepare(config, dir);
|
|
52
52
|
writeFileSync(join(dir, READY_MARK), `${sha}\n`);
|
|
53
53
|
return { sha, dir, playground };
|
|
54
54
|
}
|
|
@@ -60,17 +60,17 @@ export function baseCheckout(state, skill) {
|
|
|
60
60
|
* back with the head version after it.
|
|
61
61
|
*
|
|
62
62
|
* @param {import("./run-state.mjs").RunState} state The run
|
|
63
|
-
* @param {import("./
|
|
63
|
+
* @param {Pick<import("./journeys-config.mjs").SuiteConfig, "prepare">} config The journeys config, whose `prepare` builds the base
|
|
64
64
|
* @param {(sha: string) => Promise<void>} action What to do against the base backend
|
|
65
65
|
* @returns {Promise<string>} The base commit
|
|
66
66
|
*/
|
|
67
|
-
export async function withBaseBackend(state,
|
|
67
|
+
export async function withBaseBackend(state, config, action) {
|
|
68
68
|
if (state.renderer) {
|
|
69
69
|
throw new Error(
|
|
70
|
-
"A run with
|
|
70
|
+
"A run with a journeys config renderer has no base backend: the journeys config's prepare builds the renderer's repository, not the playground's.",
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
const base = baseCheckout(state,
|
|
73
|
+
const base = baseCheckout(state, config);
|
|
74
74
|
const { playground } = base;
|
|
75
75
|
state.baseRoot = join(state.dir, "base-root");
|
|
76
76
|
rmSync(state.baseRoot, { recursive: true, force: true });
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { writeFileSync } from "node:fs";
|
|
2
|
-
import { createServer } from "node:http";
|
|
3
2
|
import { join, relative } from "node:path";
|
|
4
|
-
import { isBrowserRequest } from "./browser-wire.mjs";
|
|
5
3
|
import { describeFailure } from "./failure.mjs";
|
|
6
|
-
import { decode } from "./json.mjs";
|
|
7
4
|
import { importFrom } from "./mongo.mjs";
|
|
8
|
-
import { loadRun } from "./run-state.mjs";
|
|
9
5
|
import { timed } from "./timing.mjs";
|
|
10
6
|
|
|
11
7
|
/**
|
|
@@ -15,7 +11,6 @@ import { timed } from "./timing.mjs";
|
|
|
15
11
|
* @typedef {import("playwright-core").Page} Page
|
|
16
12
|
* @typedef {{ ok: boolean, url: string, error: string | null, aria: string }} Outcome
|
|
17
13
|
* @typedef {{ do: string, baseUrl: string, target?: Target, value?: string, key?: string, path?: string, state?: "attached" | "detached" | "visible" | "hidden", timeoutMs?: number }} Action
|
|
18
|
-
* @typedef {Omit<Action, "baseUrl"> & { account: string, tab: string, folder: string }} BrowserRequest
|
|
19
14
|
*/
|
|
20
15
|
|
|
21
16
|
const ACTION_TIMEOUT_MS = 15_000;
|
|
@@ -62,7 +57,7 @@ export async function launchBrowser(from) {
|
|
|
62
57
|
* A new browser context: one per account, so cookies never leak between
|
|
63
58
|
* the users a journey plays.
|
|
64
59
|
*
|
|
65
|
-
* @param {Browser} browser The Playwright browser
|
|
60
|
+
* @param {Pick<Browser, "newContext">} browser The Playwright browser
|
|
66
61
|
* @returns {Promise<BrowserContext>} The context
|
|
67
62
|
*/
|
|
68
63
|
export function newContext(browser) {
|
|
@@ -370,110 +365,3 @@ export async function signInThroughForm(page, credentials, options) {
|
|
|
370
365
|
else await screenshot(page, folder, options.state);
|
|
371
366
|
return { ...outcome, url: page.url(), ok };
|
|
372
367
|
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @param {unknown} error What the action threw
|
|
376
|
-
* @returns {Outcome} The failed outcome
|
|
377
|
-
*/
|
|
378
|
-
function failedOutcome(error) {
|
|
379
|
-
return { ok: false, url: "", error: describeFailure(error), aria: "" };
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Decodes a posted request and answers it. A body that is no valid request
|
|
384
|
-
* is answered as a failed action, like any action that throws.
|
|
385
|
-
*
|
|
386
|
-
* @param {string} body What the client posted
|
|
387
|
-
* @param {(request: BrowserRequest) => Promise<Outcome>} handle Runs one action
|
|
388
|
-
* @returns {Promise<string>} The outcome as JSON
|
|
389
|
-
*/
|
|
390
|
-
export function answerRequest(body, handle) {
|
|
391
|
-
return Promise.resolve()
|
|
392
|
-
.then(() => {
|
|
393
|
-
/** @type {unknown} */
|
|
394
|
-
const posted = JSON.parse(body);
|
|
395
|
-
return handle(
|
|
396
|
-
decode(isBrowserRequest, posted, "browser request", "a browser action"),
|
|
397
|
-
);
|
|
398
|
-
})
|
|
399
|
-
.catch(failedOutcome)
|
|
400
|
-
.then((outcome) => JSON.stringify(outcome));
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Serves the run's browser for `dms-control browser`: one context per
|
|
405
|
-
* account and one page per tab name, kept between commands, driven by JSON
|
|
406
|
-
* posted to a loopback port. A GET answers 200 once it listens. It exits
|
|
407
|
-
* when the browser closes, which Playwright does on SIGTERM.
|
|
408
|
-
*
|
|
409
|
-
* @param {string} dir The run folder
|
|
410
|
-
* @param {string[]} from Folders to resolve playwright-core from
|
|
411
|
-
* @param {number} port The loopback port
|
|
412
|
-
* @returns {Promise<void>} Resolves once listening
|
|
413
|
-
*/
|
|
414
|
-
export async function serveBrowser(dir, from, port) {
|
|
415
|
-
const browser = await launchBrowser(from);
|
|
416
|
-
browser.on("disconnected", () => process.exit(0));
|
|
417
|
-
/** @type {Map<string, BrowserContext>} */
|
|
418
|
-
const contexts = new Map();
|
|
419
|
-
/** @type {Map<string, Page>} */
|
|
420
|
-
const pages = new Map();
|
|
421
|
-
/**
|
|
422
|
-
* @param {string} account The account
|
|
423
|
-
* @param {string} tab The tab name
|
|
424
|
-
* @returns {Promise<Page>} The tab's page
|
|
425
|
-
*/
|
|
426
|
-
const pageFor = async (account, tab) => {
|
|
427
|
-
const key = `${account}/${tab}`;
|
|
428
|
-
if (!pages.has(key)) {
|
|
429
|
-
if (!contexts.has(account))
|
|
430
|
-
contexts.set(account, await newContext(browser));
|
|
431
|
-
pages.set(key, await contexts.get(account).newPage());
|
|
432
|
-
}
|
|
433
|
-
return pages.get(key);
|
|
434
|
-
};
|
|
435
|
-
/**
|
|
436
|
-
* @param {BrowserRequest} request What the client posted
|
|
437
|
-
* @returns {Promise<Outcome>} The outcome
|
|
438
|
-
*/
|
|
439
|
-
const handle = async (request) => {
|
|
440
|
-
const state = loadRun(dir);
|
|
441
|
-
const page = await pageFor(request.account, request.tab);
|
|
442
|
-
if (request.do === "login") {
|
|
443
|
-
const credentials = state.accounts?.[request.account];
|
|
444
|
-
if (!credentials)
|
|
445
|
-
return {
|
|
446
|
-
ok: false,
|
|
447
|
-
url: page.url(),
|
|
448
|
-
error: `no account ${request.account}; run dms-control onboard first`,
|
|
449
|
-
aria: "",
|
|
450
|
-
};
|
|
451
|
-
return signInThroughForm(page, credentials, {
|
|
452
|
-
baseUrl: state.webUrl,
|
|
453
|
-
folder: () => request.folder,
|
|
454
|
-
state,
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
return perform(
|
|
458
|
-
page,
|
|
459
|
-
{ ...request, baseUrl: state.webUrl },
|
|
460
|
-
request.folder,
|
|
461
|
-
state,
|
|
462
|
-
);
|
|
463
|
-
};
|
|
464
|
-
const server = createServer((incoming, outgoing) => {
|
|
465
|
-
if (incoming.method !== "POST") {
|
|
466
|
-
outgoing.end("ok");
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
/** @type {Buffer[]} */
|
|
470
|
-
const chunks = [];
|
|
471
|
-
incoming.on("data", (/** @type {Buffer} */ chunk) => chunks.push(chunk));
|
|
472
|
-
incoming.on("end", () => {
|
|
473
|
-
answerRequest(Buffer.concat(chunks).toString("utf8"), handle)
|
|
474
|
-
.then((answer) => outgoing.end(answer))
|
|
475
|
-
.catch(() => outgoing.destroy());
|
|
476
|
-
});
|
|
477
|
-
});
|
|
478
|
-
await new Promise((resolve) => server.listen(port, "127.0.0.1", resolve));
|
|
479
|
-
}
|
|
@@ -26,7 +26,7 @@ import { describeFailure } from "./failure.mjs";
|
|
|
26
26
|
import { PREPARED_WORKSPACE_REFUSED } from "./frontend-workspace.mjs";
|
|
27
27
|
import { ExitError } from "./processes.mjs";
|
|
28
28
|
|
|
29
|
-
const READY_MARK = ".dms-
|
|
29
|
+
const READY_MARK = ".dms-e2e-ready";
|
|
30
30
|
const OUTPUTS = "outputs";
|
|
31
31
|
const INPUTS = "inputs.json";
|
|
32
32
|
const PENDING_PREFIX = ".pending-";
|
|
@@ -43,14 +43,14 @@ export const KEPT_BUILDS = 5;
|
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Where frontend builds are cached: `dms-
|
|
46
|
+
* Where frontend builds are cached: `dms-e2e/frontend` under
|
|
47
47
|
* `XDG_CACHE_HOME`, else `~/.cache`.
|
|
48
48
|
*
|
|
49
49
|
* @returns {string} The cache folder
|
|
50
50
|
*/
|
|
51
51
|
function frontendCache() {
|
|
52
52
|
const cacheHome = process.env.XDG_CACHE_HOME ?? join(homedir(), ".cache");
|
|
53
|
-
return join(cacheHome, "dms-
|
|
53
|
+
return join(cacheHome, "dms-e2e", "frontend");
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
realpathSync,
|
|
9
9
|
} from "node:fs";
|
|
10
10
|
import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
11
|
+
import { isRecord } from "./json.mjs";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* @typedef {{ format: number, node: string, frontend: string, environment: string, env: string[], envFiles: string, sources: string, installed: string, outside: string }} BuildInputs Everything a frontend build reads, with the run's own values left out: the code of the dms-frontend that builds, the variables Vite bakes in, the project's `.env` files, the sources the workspace setup wrote, the versions its install resolved and the installs above the workspace a bare import can resolve from
|
|
@@ -303,17 +304,40 @@ function upFrom(folder, top) {
|
|
|
303
304
|
return folders;
|
|
304
305
|
}
|
|
305
306
|
|
|
307
|
+
/**
|
|
308
|
+
* @param {string} content A `.modules.yaml`
|
|
309
|
+
* @returns {Record<string, unknown> | null} Its fields, when it is the JSON object pnpm 12 writes
|
|
310
|
+
*/
|
|
311
|
+
function jsonRecord(content) {
|
|
312
|
+
try {
|
|
313
|
+
/** @type {unknown} */
|
|
314
|
+
const parsed = JSON.parse(content);
|
|
315
|
+
return isRecord(parsed) ? parsed : null;
|
|
316
|
+
} catch {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
306
321
|
/**
|
|
307
322
|
* The content of an install record the key reads. Of `.modules.yaml`, only
|
|
308
|
-
* the fields that say what pnpm linked where
|
|
323
|
+
* the fields that say what pnpm linked where, read from the JSON pnpm 12
|
|
324
|
+
* writes or the YAML of top-level fields pnpm 10 writes.
|
|
309
325
|
*
|
|
310
326
|
* @param {string} path The record
|
|
311
327
|
* @returns {string} What the key hashes
|
|
312
|
-
* @throws When `.modules.yaml` is
|
|
328
|
+
* @throws When `.modules.yaml` is neither, or has no `layoutVersion` field, since its layout fields could not be told apart
|
|
313
329
|
*/
|
|
314
330
|
function installRecord(path) {
|
|
315
331
|
const content = readFileSync(path, "utf8");
|
|
316
332
|
if (!path.endsWith(MODULES_RECORD)) return content;
|
|
333
|
+
const json = jsonRecord(content);
|
|
334
|
+
if (json !== null && "layoutVersion" in json) {
|
|
335
|
+
const layout = Object.keys(json)
|
|
336
|
+
.filter((field) => LAYOUT_FIELDS.has(field))
|
|
337
|
+
.sort()
|
|
338
|
+
.map((field) => [field, json[field]]);
|
|
339
|
+
return JSON.stringify(layout);
|
|
340
|
+
}
|
|
317
341
|
const lines = content.split("\n");
|
|
318
342
|
const unread = lines.findIndex(
|
|
319
343
|
(line) => TOP_LEVEL_FIELD.test(line) && !FIELD_LINE.test(line),
|
|
@@ -323,7 +347,7 @@ function installRecord(path) {
|
|
|
323
347
|
!lines.some((line) => line.startsWith("layoutVersion:"))
|
|
324
348
|
) {
|
|
325
349
|
throw new Error(
|
|
326
|
-
`${path} is
|
|
350
|
+
`${path} is neither the JSON nor the YAML layout the build cache reads (${unread === -1 ? "no layoutVersion field" : `line ${unread + 1}`})`,
|
|
327
351
|
);
|
|
328
352
|
}
|
|
329
353
|
let layout = false;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { get } from "node:http";
|
|
2
3
|
import { createRequire } from "node:module";
|
|
3
4
|
import { join } from "node:path";
|
|
4
5
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
@@ -84,6 +85,32 @@ function isFingerprint(value) {
|
|
|
84
85
|
return typeof value === "function";
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
/**
|
|
89
|
+
* GETs `url` on a connection of its own. The run's API forwarder binds a
|
|
90
|
+
* connection to the backend it reached when it opened, so a pooled one can
|
|
91
|
+
* still lead to a backend `freshDatabase` has stopped.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} url The URL
|
|
94
|
+
* @param {Record<string, string>} headers The request headers
|
|
95
|
+
* @returns {Promise<{ status: number, body: string }>} The status and the body
|
|
96
|
+
*/
|
|
97
|
+
function getOnOwnConnection(url, headers) {
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
99
|
+
const request = get(url, { agent: false, headers }, (response) => {
|
|
100
|
+
let body = "";
|
|
101
|
+
response.setEncoding("utf8");
|
|
102
|
+
response.on("data", (chunk) => {
|
|
103
|
+
body += chunk;
|
|
104
|
+
});
|
|
105
|
+
response.on("error", reject);
|
|
106
|
+
response.on("end", () =>
|
|
107
|
+
resolve({ status: response.statusCode ?? 0, body }),
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
request.on("error", reject);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
87
114
|
/**
|
|
88
115
|
* The fingerprint of the frontend module set the run's API serves now, as
|
|
89
116
|
* the dev dashboard reads it: through the API, with the run's bootstrap
|
|
@@ -99,15 +126,15 @@ async function servedModuleSet(state, fingerprint) {
|
|
|
99
126
|
const secret = state.secrets.DMS_BOOTSTRAP_SECRET;
|
|
100
127
|
const deadline = Date.now() + SETTLE_TIMEOUT_MS;
|
|
101
128
|
for (;;) {
|
|
102
|
-
const response = await
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
129
|
+
const response = await getOnOwnConnection(
|
|
130
|
+
url,
|
|
131
|
+
secret ? { [BOOTSTRAP_HEADER]: secret } : {},
|
|
132
|
+
);
|
|
133
|
+
if (response.status < 200 || response.status > 299) {
|
|
107
134
|
throw new Error(`${url} answered ${response.status}`);
|
|
108
135
|
}
|
|
109
136
|
/** @type {unknown} */
|
|
110
|
-
const body =
|
|
137
|
+
const body = JSON.parse(response.body);
|
|
111
138
|
const manifest = decode(isManifest, body, url, "a frontend manifest");
|
|
112
139
|
if (!manifest.settling) return fingerprint(manifest.modules);
|
|
113
140
|
if (Date.now() > deadline) {
|
package/e2e/fixtures.mjs
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { test as base, expect } from "@playwright/test";
|
|
4
|
+
import { currentRun } from "./global-setup.mjs";
|
|
5
|
+
import { judgeJourney, openJourney, timedJourney } from "./journey-run.mjs";
|
|
6
|
+
import { saveRun } from "./run-state.mjs";
|
|
7
|
+
import { featureOf, journeyOf } from "./test-journey.mjs";
|
|
8
|
+
import { loadSuiteConfig } from "./journeys-config.mjs";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import("./suite.mjs").Suite} Suite
|
|
12
|
+
* @typedef {import("./test-journey.mjs").DmsOptions} DmsOptions How the `dms` fixture prepares a test
|
|
13
|
+
* @typedef {{ dmsSuite: Suite, run: import("./run-state.mjs").RunState, journeysConfig: import("./journeys-config.mjs").SuiteConfig }} DmsWorkerFixtures What a worker shares: the suite its config declared, the run its global setup started, and the journeys config of the suite
|
|
14
|
+
* @typedef {{ dmsOptions: DmsOptions, dms: import("./journey.mjs").JourneyContext, adminPage: import("@playwright/test").Page }} DmsTestFixtures What one test gets: its options, the journey context it drives the run through, and a page the administrator signed in on
|
|
15
|
+
* @typedef {import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions} PlaywrightTestFixtures The fixtures Playwright gives a test
|
|
16
|
+
* @typedef {import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions} PlaywrightWorkerFixtures The fixtures Playwright gives a worker
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const STEP_EVIDENCE = [
|
|
20
|
+
["screenshot.png", "image/png"],
|
|
21
|
+
["aria.yml", "text/yaml"],
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
/** @type {Suite} */
|
|
25
|
+
const UNDECLARED_SUITE = {
|
|
26
|
+
config: undefined,
|
|
27
|
+
frontend: "build",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Replays a judged test into the Playwright report: a step per recorded
|
|
32
|
+
* step, in which a `fail` check is a soft failure with its detail, a
|
|
33
|
+
* `fixed` check a soft failure asking to remove it from `knownFailures`,
|
|
34
|
+
* and a `known` check a "known failure" annotation. A step with a failing
|
|
35
|
+
* check attaches its screenshot and ARIA snapshot. A failed test attaches
|
|
36
|
+
* the serving backend's log and names its evidence folder. The judged error
|
|
37
|
+
* is thrown last.
|
|
38
|
+
*
|
|
39
|
+
* @param {import("./types.mjs").FeatureResult} result The judged test
|
|
40
|
+
* @param {import("./run-state.mjs").RunState} state The run
|
|
41
|
+
* @param {import("@playwright/test").TestInfo} testInfo The test
|
|
42
|
+
* @returns {Promise<void>}
|
|
43
|
+
*/
|
|
44
|
+
async function report(result, state, testInfo) {
|
|
45
|
+
for (const step of result.steps) {
|
|
46
|
+
await base.step(step.name, async () => {
|
|
47
|
+
for (const check of step.checks) {
|
|
48
|
+
if (check.verdict === "fail") {
|
|
49
|
+
expect.soft(check.pass, `${check.name}: ${check.detail}`).toBe(true);
|
|
50
|
+
} else if (check.verdict === "fixed") {
|
|
51
|
+
expect
|
|
52
|
+
.soft(
|
|
53
|
+
check.pass,
|
|
54
|
+
`${check.name} passes: remove it from knownFailures (${check.finding})`,
|
|
55
|
+
)
|
|
56
|
+
.toBe(false);
|
|
57
|
+
} else if (check.verdict === "known") {
|
|
58
|
+
testInfo.annotations.push({
|
|
59
|
+
type: "known failure",
|
|
60
|
+
description: `${check.name}: ${check.finding}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const failing = step.checks.some(
|
|
65
|
+
(check) => check.verdict === "fail" || check.verdict === "fixed",
|
|
66
|
+
);
|
|
67
|
+
if (!failing) return;
|
|
68
|
+
for (const [file, contentType] of STEP_EVIDENCE) {
|
|
69
|
+
const path = join(state.evidence, step.folder, file);
|
|
70
|
+
if (existsSync(path)) {
|
|
71
|
+
await testInfo.attach(`${step.name}/${file}`, { path, contentType });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (result.status === "FAIL" || testInfo.status !== testInfo.expectedStatus) {
|
|
77
|
+
testInfo.annotations.push({
|
|
78
|
+
type: "evidence",
|
|
79
|
+
description: join(state.evidence, result.folder),
|
|
80
|
+
});
|
|
81
|
+
const backend = state.processes.find((entry) => entry.name === "backend");
|
|
82
|
+
if (backend && existsSync(backend.log)) {
|
|
83
|
+
await testInfo.attach("backend.log", {
|
|
84
|
+
path: backend.log,
|
|
85
|
+
contentType: "text/plain",
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (result.error) throw new Error(result.error);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @type {import("@playwright/test").Fixtures<DmsTestFixtures, DmsWorkerFixtures, PlaywrightTestFixtures, PlaywrightWorkerFixtures>} */
|
|
93
|
+
const FIXTURES = {
|
|
94
|
+
dmsSuite: [UNDECLARED_SUITE, { option: true, scope: "worker" }],
|
|
95
|
+
run: [
|
|
96
|
+
async ({ dmsSuite }, use) => {
|
|
97
|
+
await use(currentRun(dmsSuite));
|
|
98
|
+
},
|
|
99
|
+
{ scope: "worker" },
|
|
100
|
+
],
|
|
101
|
+
journeysConfig: [
|
|
102
|
+
async ({ dmsSuite }, use) => {
|
|
103
|
+
await use(await loadSuiteConfig(process.cwd(), dmsSuite.config));
|
|
104
|
+
},
|
|
105
|
+
{ scope: "worker" },
|
|
106
|
+
],
|
|
107
|
+
dmsOptions: [{}, { option: true }],
|
|
108
|
+
baseURL: async ({ run }, use) => {
|
|
109
|
+
await use(run.webUrl);
|
|
110
|
+
},
|
|
111
|
+
dms: async ({ run, journeysConfig, browser, dmsOptions }, use, testInfo) => {
|
|
112
|
+
const journey = journeyOf(testInfo, dmsOptions);
|
|
113
|
+
const feature = featureOf(testInfo);
|
|
114
|
+
const result = await timedJourney(
|
|
115
|
+
run,
|
|
116
|
+
{ feature, journey: journey.id },
|
|
117
|
+
async () => {
|
|
118
|
+
const context = await openJourney(
|
|
119
|
+
run,
|
|
120
|
+
feature,
|
|
121
|
+
journey,
|
|
122
|
+
journeysConfig,
|
|
123
|
+
browser,
|
|
124
|
+
);
|
|
125
|
+
if (!context.ended) await use(context);
|
|
126
|
+
return judgeJourney(context, journey);
|
|
127
|
+
},
|
|
128
|
+
);
|
|
129
|
+
saveRun(run);
|
|
130
|
+
await report(result, run, testInfo);
|
|
131
|
+
},
|
|
132
|
+
adminPage: async ({ dms }, use) => {
|
|
133
|
+
const tab = await dms.tab("admin");
|
|
134
|
+
await tab.signIn("admin");
|
|
135
|
+
await use(tab.page);
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Playwright's `test` with the fixtures of a DMS run. `run` is the run the
|
|
141
|
+
* global setup started, which `baseURL` serves, so `page.goto("/settings")`
|
|
142
|
+
* opens the dashboard. `dms` prepares the run for one test as a journey's
|
|
143
|
+
* run does (by default a fresh database with a backend of its own and an
|
|
144
|
+
* onboarded administrator; `test.use({ dmsOptions })` changes it), records
|
|
145
|
+
* its evidence under `<run>/evidence/<feature>/<test>/`, and after the test
|
|
146
|
+
* closes its tabs, judges its `verify` steps, and replays them into the
|
|
147
|
+
* report with their failing evidence. `adminPage` is a tab of `dms` the
|
|
148
|
+
* administrator signed in on. A test whose preparation fails does not run.
|
|
149
|
+
*
|
|
150
|
+
* @type {import("@playwright/test").TestType<PlaywrightTestFixtures & DmsTestFixtures, PlaywrightWorkerFixtures & DmsWorkerFixtures>}
|
|
151
|
+
*/
|
|
152
|
+
export const test = base.extend(FIXTURES);
|
|
153
|
+
|
|
154
|
+
export { expect };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
4
5
|
import { describeFailure } from "./failure.mjs";
|
|
5
6
|
import { isRecord } from "./json.mjs";
|
|
6
7
|
|
|
@@ -19,8 +20,31 @@ const WORKSPACE_STEP = "./dist/commands/workspace-task.js";
|
|
|
19
20
|
*/
|
|
20
21
|
export const PREPARED_WORKSPACE_REFUSED = 75;
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* How long the setup waits before each new attempt once its install got a
|
|
25
|
+
* 404 on a tarball. The npm registry lists a version before every mirror
|
|
26
|
+
* serves its tarball: prosemirror-inputrules 1.7.0, published at 12:47:14Z
|
|
27
|
+
* on 2026-11-19, still answered 404 at 12:49:30Z.
|
|
28
|
+
*/
|
|
29
|
+
export const REGISTRY_404_RETRY_DELAYS_MS = Object.freeze([
|
|
30
|
+
30_000, 60_000, 90_000,
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
const TARBALL_404 = "ERR_PNPM_FETCH_404";
|
|
34
|
+
|
|
22
35
|
class StoppedBeforeInstall extends Error {}
|
|
23
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @param {unknown} error What the dms-frontend's `setupWorkspace` threw
|
|
39
|
+
* @returns {boolean} True when it is the install failure of a pnpm that got a 404 on a tarball, whose output tail the failure's `problem.details` holds
|
|
40
|
+
*/
|
|
41
|
+
function fetchedUnpublishedTarball(error) {
|
|
42
|
+
if (!(error instanceof Error) || !("problem" in error)) return false;
|
|
43
|
+
const { problem } = error;
|
|
44
|
+
if (!isRecord(problem) || !Array.isArray(problem.details)) return false;
|
|
45
|
+
return problem.details.join("\n").includes(TARBALL_404);
|
|
46
|
+
}
|
|
47
|
+
|
|
24
48
|
/**
|
|
25
49
|
* @param {unknown} value
|
|
26
50
|
* @returns {value is (options: SetupOptions) => Promise<unknown>}
|
|
@@ -81,7 +105,7 @@ export function buildInPreparedWorkspace(frontendPackage) {
|
|
|
81
105
|
const prepared = (options) => {
|
|
82
106
|
const workspaceDir = resolve(options.workspaceDir);
|
|
83
107
|
if (!existsSync(join(workspaceDir, INSTALL_MARK))) {
|
|
84
|
-
process.stderr.write(`dms-
|
|
108
|
+
process.stderr.write(`dms-e2e: ${workspaceDir} is not prepared\n`);
|
|
85
109
|
process.exit(PREPARED_WORKSPACE_REFUSED);
|
|
86
110
|
}
|
|
87
111
|
return Promise.resolve({ workspaceDir, layers: [] });
|
|
@@ -109,6 +133,7 @@ export function buildInPreparedWorkspace(frontendPackage) {
|
|
|
109
133
|
* @param {string} workspace The workspace folder
|
|
110
134
|
* @param {string} environment The AntelopeJS environment
|
|
111
135
|
* @param {boolean} install Whether to install the workspace's dependencies
|
|
136
|
+
* @param {readonly number[]} [retryDelaysMs] How long to wait before each new setup after its install got a 404 on a tarball (see {@link REGISTRY_404_RETRY_DELAYS_MS})
|
|
112
137
|
* @returns {Promise<void>} Resolves once it is set up
|
|
113
138
|
* @throws When this dms-frontend cannot set a workspace up, or build in one set up beforehand
|
|
114
139
|
*/
|
|
@@ -117,6 +142,7 @@ export async function setUpFrontendWorkspace(
|
|
|
117
142
|
workspace,
|
|
118
143
|
environment,
|
|
119
144
|
install,
|
|
145
|
+
retryDelaysMs = REGISTRY_404_RETRY_DELAYS_MS,
|
|
120
146
|
) {
|
|
121
147
|
buildInPreparedWorkspace(frontendPackage);
|
|
122
148
|
const loadProjectEnv = exported(
|
|
@@ -142,9 +168,17 @@ export async function setUpFrontendWorkspace(
|
|
|
142
168
|
if (!install) {
|
|
143
169
|
options.beforeInstall = () => Promise.reject(new StoppedBeforeInstall());
|
|
144
170
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
171
|
+
for (const delay of [...retryDelaysMs, null]) {
|
|
172
|
+
try {
|
|
173
|
+
await setupWorkspace(options);
|
|
174
|
+
return;
|
|
175
|
+
} catch (error) {
|
|
176
|
+
if (error instanceof StoppedBeforeInstall) return;
|
|
177
|
+
if (delay === null || !fetchedUnpublishedTarball(error)) throw error;
|
|
178
|
+
process.stderr.write(
|
|
179
|
+
`dms e2e prepare-frontend: the registry answered 404 for a tarball it lists; installing again in ${delay / 1000}s\n`,
|
|
180
|
+
);
|
|
181
|
+
await sleep(delay);
|
|
182
|
+
}
|
|
149
183
|
}
|
|
150
184
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { assertForwardedRun } from "./backend.mjs";
|
|
2
|
+
import { declaredSuite } from "./suite.mjs";
|
|
3
|
+
import { loadRun } from "./run-state.mjs";
|
|
4
|
+
import { startRun } from "./run.mjs";
|
|
5
|
+
|
|
6
|
+
/** @typedef {import("./suite.mjs").Suite} Suite */
|
|
7
|
+
|
|
8
|
+
const RUN = "DMS_E2E_RUN";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Playwright's global setup of a journeys suite, once per `playwright test`.
|
|
12
|
+
* With `DMS_E2E_RUN` set, the tests drive that run and it stops nothing; a
|
|
13
|
+
* run whose dashboard is not served the way the suite asks is refused.
|
|
14
|
+
* Otherwise it starts a run on the journeys config through `startRun`: its
|
|
15
|
+
* prepare commands (none with `DMS_E2E_PREBUILT=1`), then the
|
|
16
|
+
* stack, whose dashboard is the development one for a `frontend: "dev"`
|
|
17
|
+
* suite. It publishes the run's folder in `DMS_E2E_RUN` for the workers,
|
|
18
|
+
* and returns the teardown that stops it.
|
|
19
|
+
* The run outlives the worker Playwright replaces after a failed test.
|
|
20
|
+
*
|
|
21
|
+
* @returns {Promise<(() => Promise<void>) | undefined>} The teardown of the run it started
|
|
22
|
+
* @throws When the adopted run serves its dashboard another way than the suite asks
|
|
23
|
+
*/
|
|
24
|
+
export default async function globalSetup() {
|
|
25
|
+
const suite = declaredSuite();
|
|
26
|
+
const adopted = process.env[RUN];
|
|
27
|
+
if (adopted) {
|
|
28
|
+
assertServes(loadRun(adopted), suite);
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const { run, stop } = await startRun({
|
|
32
|
+
config: suite.config,
|
|
33
|
+
frontend: suite.frontend,
|
|
34
|
+
});
|
|
35
|
+
process.env[RUN] = run.dir;
|
|
36
|
+
return stop;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param {import("./run-state.mjs").RunState} state A run
|
|
41
|
+
* @param {Suite} suite The suite that drives it
|
|
42
|
+
* @throws When the run serves its dashboard another way than the suite asks
|
|
43
|
+
*/
|
|
44
|
+
function assertServes(state, suite) {
|
|
45
|
+
const mode = state.frontendMode ?? "build";
|
|
46
|
+
if (mode !== suite.frontend) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
`${RUN} serves a ${mode} dashboard, and this suite runs the journeys of a ${suite.frontend} one`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The run this `playwright test` drives, which its global setup published.
|
|
55
|
+
* A worker reads it once: tests run one at a time, each saves the run when
|
|
56
|
+
* it ends, and the worker Playwright starts after a failed test reads it
|
|
57
|
+
* again.
|
|
58
|
+
*
|
|
59
|
+
* @param {Suite} suite The suite that drives it
|
|
60
|
+
* @returns {import("./run-state.mjs").RunState} The run
|
|
61
|
+
* @throws When no global setup published a run, an older e2e kit started it, or it serves its dashboard another way than the suite asks
|
|
62
|
+
*/
|
|
63
|
+
export function currentRun(suite) {
|
|
64
|
+
const dir = process.env[RUN];
|
|
65
|
+
if (!dir) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`${RUN} is not set: run the suite through its config, whose global setup starts a run, or set it to a run startRun started`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const state = loadRun(dir);
|
|
71
|
+
assertServes(state, suite);
|
|
72
|
+
assertForwardedRun(state);
|
|
73
|
+
return state;
|
|
74
|
+
}
|