feat(housekeeping): deliver content vertical
This commit is contained in:
1 parent
bdab924bdf
commit
fd68819d9b
67 files changed
+5742
-1916
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import "server-only";
|
||||
|
||||
import { CONTENT_COMMANDS } from "../../domains/content/commands/content-commands";
|
||||
import { COMMUNITY_COMMANDS } from "../../domains/people/commands/community-commands";
|
||||
import { MODERATION_COMMANDS } from "../../domains/people/commands/moderation-commands";
|
||||
import { SUPPORT_COMMANDS } from "../../domains/people/commands/support-commands";
|
||||
@@ -40,6 +41,7 @@ export function registerHousekeepingCommands<
|
||||
}
|
||||
|
||||
const currentHousekeepingCommands = defineHousekeepingCommands(
|
||||
...CONTENT_COMMANDS,
|
||||
...USER_COMMANDS,
|
||||
...COMMUNITY_COMMANDS,
|
||||
...SUPPORT_COMMANDS,
|
||||
|
||||
@@ -4,6 +4,7 @@ import { join, posix } from "node:path";
|
||||
import { createElement, type ReactElement } from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { CONTENT_ROUTE_IDS } from "../domains/content/routes";
|
||||
import { PEOPLE_ROUTE_IDS } from "../domains/people/routes";
|
||||
import { SYSTEM_ROUTE_IDS } from "../domains/system/routes";
|
||||
import { HOUSEKEEPING_MANIFESTS } from "../manifests";
|
||||
@@ -208,6 +209,177 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
|
||||
"src/features/housekeeping/domains/people/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/commands/content-commands.ts",
|
||||
new Set(["src/features/housekeeping/domains/content/services/mutations"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/inbox-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/inbox.ts",
|
||||
new Set(["src/features/housekeeping/domains/content/inbox-production"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/manifest.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/inbox",
|
||||
"src/features/housekeeping/domains/content/routes",
|
||||
"src/features/housekeeping/domains/content/search",
|
||||
"src/features/housekeeping/domains/content/widgets",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/brand.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form",
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame",
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form.tsx",
|
||||
new Set(["src/actions/housekeeping-command"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
"src/features/housekeeping/domains/content/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/editorial.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form",
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame",
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/engagement.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form",
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame",
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/help.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form",
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame",
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/localization.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form",
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame",
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/pages/media.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/content-command-form",
|
||||
"src/features/housekeeping/domains/content/pages/content-page-frame",
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/queries/content-queries-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
"src/features/housekeeping/domains/content/routes",
|
||||
"src/lib/db",
|
||||
"drizzle-orm",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/queries/content-queries.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/queries/content-queries-production",
|
||||
"src/features/housekeeping/domains/content/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/route-handlers.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/pages/brand",
|
||||
"src/features/housekeeping/domains/content/pages/editorial",
|
||||
"src/features/housekeeping/domains/content/pages/engagement",
|
||||
"src/features/housekeeping/domains/content/pages/help",
|
||||
"src/features/housekeeping/domains/content/pages/localization",
|
||||
"src/features/housekeeping/domains/content/pages/media",
|
||||
"src/features/housekeeping/domains/content/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/search-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
"src/features/housekeeping/domains/content/search",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/search.ts",
|
||||
new Set(["src/features/housekeeping/domains/content/search-production"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/services/mutation-runtime-database.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/services/mutations",
|
||||
"src/lib/db",
|
||||
"drizzle-orm",
|
||||
"mysql2",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/services/mutation-runtime-external.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/services/mutations",
|
||||
"src/features/housekeeping/domains/content/services/mutations-production",
|
||||
"src/lib/db",
|
||||
"drizzle-orm",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/services/mutations-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/services/mutations",
|
||||
"src/features/housekeeping/domains/content/services/mutations-runtime",
|
||||
"src/lib/db",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/services/mutations-runtime.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/services/mutation-runtime-database",
|
||||
"src/features/housekeeping/domains/content/services/mutation-runtime-external",
|
||||
"src/features/housekeeping/domains/content/services/mutations",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/services/mutations.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/services/mutations-production",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/widgets-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/queries/content-queries",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/content/widgets.ts",
|
||||
new Set(["src/features/housekeeping/domains/content/widgets-production"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/system/commands/system-commands.ts",
|
||||
new Set(["src/features/housekeeping/domains/system/services/mutations"]),
|
||||
@@ -316,6 +488,7 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
|
||||
[
|
||||
"src/features/housekeeping/foundation/commands/bootstrap.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/commands/content-commands",
|
||||
"src/features/housekeeping/domains/people/commands/community-commands",
|
||||
"src/features/housekeeping/domains/people/commands/moderation-commands",
|
||||
"src/features/housekeeping/domains/people/commands/support-commands",
|
||||
@@ -326,6 +499,7 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
|
||||
[
|
||||
"src/features/housekeeping/route-handlers.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/route-handlers",
|
||||
"src/features/housekeeping/domains/people/route-handlers",
|
||||
"src/features/housekeeping/domains/system/route-handlers",
|
||||
]),
|
||||
@@ -725,6 +899,12 @@ describe("housekeeping runtime import boundary", () => {
|
||||
});
|
||||
|
||||
it("allows only approved domain vertical runtime edges", () => {
|
||||
expect(
|
||||
findHousekeepingImportBoundaryViolations(
|
||||
'import { contentMutationService } from "../services/mutations";',
|
||||
"src/features/housekeeping/domains/content/commands/content-commands.ts",
|
||||
),
|
||||
).toEqual([]);
|
||||
expect(
|
||||
findHousekeepingImportBoundaryViolations(
|
||||
'import { peopleMutationService } from "../services/mutations";',
|
||||
@@ -920,7 +1100,7 @@ describe("housekeeping foundation completion contracts", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("creates the real six-domain registry with People primary and System routes enabled", () => {
|
||||
it("creates the real six-domain registry with People, Content, and System routes enabled", () => {
|
||||
const registry = createHousekeepingRegistry(HOUSEKEEPING_MANIFESTS);
|
||||
|
||||
expect(registry.domains.map((domain) => domain.id)).toEqual([
|
||||
@@ -933,7 +1113,7 @@ describe("housekeeping foundation completion contracts", () => {
|
||||
]);
|
||||
expect(
|
||||
registry.domains
|
||||
.filter((domain) => !["people", "system"].includes(domain.id))
|
||||
.filter((domain) => !["people", "content", "system"].includes(domain.id))
|
||||
.every((domain) => domain.routes.length === 0),
|
||||
).toBe(true);
|
||||
expect(
|
||||
@@ -941,6 +1121,11 @@ describe("housekeeping foundation completion contracts", () => {
|
||||
.find((domain) => domain.id === "people")
|
||||
?.routes.map((route) => route.id),
|
||||
).toEqual(PEOPLE_ROUTE_IDS);
|
||||
expect(
|
||||
registry.domains
|
||||
.find((domain) => domain.id === "content")
|
||||
?.routes.map((route) => route.id),
|
||||
).toEqual(CONTENT_ROUTE_IDS);
|
||||
expect(
|
||||
registry.domains
|
||||
.find((domain) => domain.id === "system")
|
||||
|
||||
@@ -27,6 +27,45 @@ const routeMocks = vi.hoisted(() => {
|
||||
"domains.hotel.description": "Localized Hotel description",
|
||||
"domains.system.title": "HK::system-title",
|
||||
"domains.system.description": "Localized System description",
|
||||
"routes.content.editorial.articles": "HK::content-editorial-articles",
|
||||
"routes.content.editorial.article-create":
|
||||
"HK::content-editorial-article-create",
|
||||
"routes.content.editorial.article-detail":
|
||||
"HK::content-editorial-article-detail",
|
||||
"routes.content.media.photos": "HK::content-media-photos",
|
||||
"routes.content.media.library": "HK::content-media-library",
|
||||
"routes.content.media.banners": "HK::content-media-banners",
|
||||
"routes.content.media.ads": "HK::content-media-ads",
|
||||
"routes.content.media.ad-create": "HK::content-media-ad-create",
|
||||
"routes.content.media.ad-detail": "HK::content-media-ad-detail",
|
||||
"routes.content.engagement.events": "HK::content-engagement-events",
|
||||
"routes.content.engagement.event-create":
|
||||
"HK::content-engagement-event-create",
|
||||
"routes.content.engagement.event-types":
|
||||
"HK::content-engagement-event-types",
|
||||
"routes.content.engagement.event-detail":
|
||||
"HK::content-engagement-event-detail",
|
||||
"routes.content.engagement.polls": "HK::content-engagement-polls",
|
||||
"routes.content.engagement.poll-create":
|
||||
"HK::content-engagement-poll-create",
|
||||
"routes.content.engagement.poll-detail":
|
||||
"HK::content-engagement-poll-detail",
|
||||
"routes.content.help.questions": "HK::content-help-questions",
|
||||
"routes.content.help.question-create": "HK::content-help-question-create",
|
||||
"routes.content.help.question-detail": "HK::content-help-question-detail",
|
||||
"routes.content.editorial.tags": "HK::content-editorial-tags",
|
||||
"routes.content.engagement.prefixes": "HK::content-engagement-prefixes",
|
||||
"routes.content.editorial.writeable-boxes":
|
||||
"HK::content-editorial-writeable-boxes",
|
||||
"routes.content.help.email-templates": "HK::content-help-email-templates",
|
||||
"routes.content.brand.theme": "HK::content-brand-theme",
|
||||
"routes.content.brand.favicon": "HK::content-brand-favicon",
|
||||
"routes.content.localization.overview":
|
||||
"HK::content-localization-overview",
|
||||
"routes.content.localization.client": "HK::content-localization-client",
|
||||
"routes.content.localization.cms": "HK::content-localization-cms",
|
||||
"routes.content.localization.emulator":
|
||||
"HK::content-localization-emulator",
|
||||
"routes.system.access.permissions": "HK::system-access-permissions",
|
||||
"routes.system.access.permission-detail":
|
||||
"HK::system-access-permission-detail",
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { PERMS } from "@/lib/permission-slugs";
|
||||
import { CONTENT_INBOX_SOURCES } from "../domains/content/inbox";
|
||||
import { CONTENT_ROUTES } from "../domains/content/routes";
|
||||
import { CONTENT_SEARCH_PROVIDERS } from "../domains/content/search";
|
||||
import { CONTENT_WIDGETS } from "../domains/content/widgets";
|
||||
import { PEOPLE_INBOX_SOURCES } from "../domains/people/inbox";
|
||||
import { PEOPLE_ROUTES } from "../domains/people/routes";
|
||||
import { PEOPLE_SEARCH_PROVIDERS } from "../domains/people/search";
|
||||
@@ -361,18 +365,32 @@ describe("housekeeping registry", () => {
|
||||
expect(actual.routes).toEqual(
|
||||
expected.id === "people"
|
||||
? PEOPLE_ROUTES
|
||||
: expected.id === "content"
|
||||
? CONTENT_ROUTES
|
||||
: expected.id === "system"
|
||||
? SYSTEM_ROUTES
|
||||
: [],
|
||||
);
|
||||
expect(actual.searchProviders).toEqual(
|
||||
expected.id === "people" ? PEOPLE_SEARCH_PROVIDERS : [],
|
||||
expected.id === "people"
|
||||
? PEOPLE_SEARCH_PROVIDERS
|
||||
: expected.id === "content"
|
||||
? CONTENT_SEARCH_PROVIDERS
|
||||
: [],
|
||||
);
|
||||
expect(actual.inboxSources).toEqual(
|
||||
expected.id === "people" ? PEOPLE_INBOX_SOURCES : [],
|
||||
expected.id === "people"
|
||||
? PEOPLE_INBOX_SOURCES
|
||||
: expected.id === "content"
|
||||
? CONTENT_INBOX_SOURCES
|
||||
: [],
|
||||
);
|
||||
expect(actual.widgets).toEqual(
|
||||
expected.id === "people" ? PEOPLE_WIDGETS : [],
|
||||
expected.id === "people"
|
||||
? PEOPLE_WIDGETS
|
||||
: expected.id === "content"
|
||||
? CONTENT_WIDGETS
|
||||
: [],
|
||||
);
|
||||
expect(actual.capability).toEqual({ mode: "any", slugs: expected.slugs });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user