create-nwire 0.9.2 → 0.10.1

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.
Files changed (38) hide show
  1. package/README.md +7 -8
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.js +0 -1
  4. package/package.json +1 -1
  5. package/templates/enterprise/__tests__/auto-moderate.test.ts +6 -14
  6. package/templates/enterprise/__tests__/submit-flow.test.ts +6 -14
  7. package/templates/enterprise/app/api.ts +11 -18
  8. package/templates/enterprise/app/app.ts +37 -21
  9. package/templates/enterprise/app/main.ts +40 -21
  10. package/templates/enterprise/modules/posts/routes/approve-post.ts +10 -6
  11. package/templates/enterprise/modules/posts/routes/get-post.ts +8 -4
  12. package/templates/enterprise/modules/posts/routes/list-queue.ts +12 -6
  13. package/templates/enterprise/modules/posts/routes/reject-post.ts +8 -4
  14. package/templates/enterprise/modules/posts/routes/submit-post.ts +9 -9
  15. package/templates/enterprise/package.json +7 -6
  16. package/templates/minimal/__tests__/hello.test.ts +19 -15
  17. package/templates/minimal/app/api.ts +11 -14
  18. package/templates/minimal/app/main.ts +26 -15
  19. package/templates/minimal/app/routes/hello.ts +6 -13
  20. package/templates/minimal/package.json +4 -2
  21. package/templates/service/README.md +1 -1
  22. package/templates/service/__tests__/todo-api.test.ts +21 -20
  23. package/templates/service/app/api.ts +11 -20
  24. package/templates/service/app/main.ts +31 -20
  25. package/templates/service/app/middleware/require-user.ts +10 -11
  26. package/templates/service/app/routes/complete-todo.ts +8 -11
  27. package/templates/service/app/routes/create-todo.ts +9 -10
  28. package/templates/service/app/routes/delete-todo.ts +9 -9
  29. package/templates/service/app/routes/list-todos.ts +8 -11
  30. package/templates/service/app/store/todo-store.ts +3 -3
  31. package/templates/service/package.json +7 -5
  32. package/dist/__tests__/scaffold.test.d.ts +0 -7
  33. package/dist/__tests__/scaffold.test.d.ts.map +0 -1
  34. package/dist/__tests__/scaffold.test.js +0 -113
  35. package/dist/__tests__/scaffold.test.js.map +0 -1
  36. package/dist/index.d.ts.map +0 -1
  37. package/dist/index.js.map +0 -1
  38. package/templates/enterprise/modules/posts/posts.module.ts +0 -36
@@ -1,36 +0,0 @@
1
- /**
2
- * The posts module — collects every domain piece for this bounded
3
- * context. `defineModule` is purely organizational: it groups events,
4
- * actions, workflows, projections, and queries that belong to one part
5
- * of the business, marks which are public (callable from other modules /
6
- * apps), and gives the runtime a single value to register.
7
- *
8
- * `.public()` controls cross-module visibility. Here every action +
9
- * query is public because we have one module; in a multi-module app
10
- * you'd be more selective — only what's part of the BC's contract
11
- * stays public.
12
- */
13
-
14
- import { defineModule } from "@nwire/forge";
15
-
16
- import { PostWasSubmitted } from "./events/post-was-submitted";
17
- import { PostWasApproved } from "./events/post-was-approved";
18
- import { PostWasRejected } from "./events/post-was-rejected";
19
-
20
- import { submitPost } from "./actions/submit-post";
21
- import { approvePost } from "./actions/approve-post";
22
- import { rejectPost } from "./actions/reject-post";
23
-
24
- import { autoModerate } from "./workflows/auto-moderate";
25
-
26
- import { queueDashboard, listPending, queueTotals, getPost } from "./projections/queue-dashboard";
27
- import { postsByAuthor } from "./queries/posts-by-author";
28
-
29
- export const postsModule = defineModule("posts", {
30
- description: "Post moderation queue — submit, auto-check, decide, dashboard.",
31
- events: [PostWasSubmitted, PostWasApproved, PostWasRejected],
32
- actions: [submitPost.public(), approvePost.public(), rejectPost.public()],
33
- workflows: [autoModerate],
34
- projections: [queueDashboard],
35
- queries: [listPending.public(), queueTotals.public(), getPost.public(), postsByAuthor.public()],
36
- });