create-m5kdev 0.33.0 → 0.35.0

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 (147) hide show
  1. package/dist/src/catalog.cjs +21 -1
  2. package/dist/src/catalog.cjs.map +1 -1
  3. package/dist/src/catalog.d.cts +3 -1
  4. package/dist/src/create.cjs +6 -2
  5. package/dist/src/create.cjs.map +1 -1
  6. package/dist/src/doctor.cjs.map +1 -1
  7. package/dist/src/fs.cjs +10 -5
  8. package/dist/src/fs.cjs.map +1 -1
  9. package/dist/src/prompts.cjs +32 -0
  10. package/dist/src/prompts.cjs.map +1 -1
  11. package/dist/src/prompts.d.cts +7 -1
  12. package/dist/src/template.cjs +23 -4
  13. package/dist/src/template.cjs.map +1 -1
  14. package/dist/src/template.d.cts +17 -3
  15. package/dist/src/types.d.cts +11 -4
  16. package/package.json +4 -1
  17. package/templates/minimal-app/.cursor/rules/frontend-data-guide.mdc +1 -0
  18. package/templates/minimal-app/.cursor/rules/module-dto-guide.mdc +1 -1
  19. package/templates/minimal-app/.cursor/rules/module-grants-guide.mdc +3 -3
  20. package/templates/minimal-app/.cursor/rules/module-module-guide.mdc +3 -2
  21. package/templates/minimal-app/.cursor/rules/module-service-guide.mdc +1 -1
  22. package/templates/minimal-app/.cursor/rules/server-event-emit.mdc +41 -0
  23. package/templates/minimal-app/.dockerignore.tpl +31 -0
  24. package/templates/minimal-app/.gitignore.tpl +1 -0
  25. package/templates/minimal-app/AGENTS.md.tpl +14 -10
  26. package/templates/minimal-app/CLAUDE.md.tpl +133 -131
  27. package/templates/minimal-app/README.md.tpl +51 -19
  28. package/templates/minimal-app/apps/e2e/package.json.tpl +23 -23
  29. package/templates/minimal-app/apps/e2e/playwright.config.ts.tpl +51 -39
  30. package/templates/minimal-app/apps/e2e/playwright.expo.config.ts.tpl +38 -38
  31. package/templates/minimal-app/apps/e2e/servers.ts.tpl +136 -112
  32. package/templates/minimal-app/apps/e2e/tests/conversation.spec.ts.tpl +22 -0
  33. package/templates/minimal-app/apps/e2e/tests/email.spec.ts.tpl +47 -47
  34. package/templates/minimal-app/apps/e2e/tests/expo-helpers.ts.tpl +73 -73
  35. package/templates/minimal-app/apps/e2e/tests/expo-standard.spec.ts.tpl +517 -517
  36. package/templates/minimal-app/apps/e2e/tests/expo-waitlist.spec.ts.tpl +94 -94
  37. package/templates/minimal-app/apps/e2e/tests/files.spec.ts.tpl +35 -0
  38. package/templates/minimal-app/apps/e2e/tests/helpers.ts.tpl +289 -289
  39. package/templates/minimal-app/apps/e2e/tests/standard.spec.ts.tpl +516 -516
  40. package/templates/minimal-app/apps/e2e/tests/waitlist.spec.ts.tpl +107 -107
  41. package/templates/minimal-app/apps/e2e/tests/workflow.spec.ts.tpl +26 -0
  42. package/templates/minimal-app/apps/e2e/tsconfig.json.tpl +10 -10
  43. package/templates/minimal-app/apps/email/package.json.tpl +34 -34
  44. package/templates/minimal-app/apps/email/src/emails/trialEndingEmail.tsx.tpl +40 -0
  45. package/templates/minimal-app/apps/email/src/index.ts.tpl +7 -0
  46. package/templates/minimal-app/apps/email/src/resources.ts.tpl +72 -65
  47. package/templates/minimal-app/apps/expo/app.json.tpl +36 -36
  48. package/templates/minimal-app/apps/expo/eslint.config.js.tpl +8 -8
  49. package/templates/minimal-app/apps/expo/metro.config.js.tpl +16 -16
  50. package/templates/minimal-app/apps/expo/src/app/_layout.tsx.tpl +31 -31
  51. package/templates/minimal-app/apps/expo/src/app/claim-account.tsx.tpl +151 -151
  52. package/templates/minimal-app/apps/expo/src/app/forgot-password.tsx.tpl +53 -53
  53. package/templates/minimal-app/apps/expo/src/app/index.tsx.tpl +8 -8
  54. package/templates/minimal-app/apps/expo/src/app/login.tsx.tpl +71 -71
  55. package/templates/minimal-app/apps/expo/src/app/logout.tsx.tpl +19 -19
  56. package/templates/minimal-app/apps/expo/src/app/organization/accept-invitation.tsx.tpl +85 -85
  57. package/templates/minimal-app/apps/expo/src/app/posts.tsx.tpl +40 -40
  58. package/templates/minimal-app/apps/expo/src/app/reset-password.tsx.tpl +75 -75
  59. package/templates/minimal-app/apps/expo/src/app/signup.tsx.tpl +193 -193
  60. package/templates/minimal-app/apps/expo/src/components/AuthScaffold.tsx.tpl +34 -34
  61. package/templates/minimal-app/apps/expo/src/components/FormTextField.tsx.tpl +37 -37
  62. package/templates/minimal-app/apps/expo/src/components/LoadingScreen.tsx.tpl +10 -10
  63. package/templates/minimal-app/apps/expo/src/components/StatusText.tsx.tpl +22 -22
  64. package/templates/minimal-app/apps/expo/src/config.ts.tpl +9 -9
  65. package/templates/minimal-app/apps/expo/src/global.css.tpl +11 -11
  66. package/templates/minimal-app/apps/expo/src/lib/trpc.ts.tpl +20 -20
  67. package/templates/minimal-app/apps/expo/tsconfig.json.tpl +11 -11
  68. package/templates/minimal-app/apps/expo/uniwind-env.d.ts.tpl +1 -1
  69. package/templates/minimal-app/apps/landing/.env.production.example.tpl +7 -0
  70. package/templates/minimal-app/apps/landing/Dockerfile.tpl +39 -0
  71. package/templates/minimal-app/apps/landing/fly.toml.tpl +20 -0
  72. package/templates/minimal-app/apps/landing/index.html.tpl +35 -0
  73. package/templates/minimal-app/apps/landing/package.json.tpl +34 -0
  74. package/templates/minimal-app/apps/landing/src/App.tsx.tpl +12 -0
  75. package/templates/minimal-app/apps/landing/src/LandingPage.tsx.tpl +37 -0
  76. package/templates/minimal-app/apps/landing/src/index.css.tpl +24 -0
  77. package/templates/minimal-app/apps/landing/src/main.tsx.tpl +16 -0
  78. package/templates/minimal-app/apps/landing/src/vite-env.d.ts.tpl +11 -0
  79. package/templates/minimal-app/apps/landing/tsconfig.json.tpl +12 -0
  80. package/templates/minimal-app/apps/landing/vite.config.ts.tpl +25 -0
  81. package/templates/minimal-app/apps/server/AGENTS.md.tpl +55 -46
  82. package/templates/minimal-app/apps/server/{drizzle/seed.e2e.ts.tpl → db.e2e.ts.tpl} +57 -40
  83. package/templates/minimal-app/apps/server/{drizzle/seed.ts.tpl → db.ts.tpl} +27 -20
  84. package/templates/minimal-app/apps/server/drizzle/0003_silly_the_liberteens.sql +27 -0
  85. package/templates/minimal-app/apps/server/drizzle/meta/0000_snapshot.json.tpl +56 -166
  86. package/templates/minimal-app/apps/server/drizzle/meta/0001_snapshot.json.tpl +1796 -1910
  87. package/templates/minimal-app/apps/server/drizzle/meta/0002_snapshot.json.tpl +1818 -1932
  88. package/templates/minimal-app/apps/server/drizzle/meta/0003_snapshot.json.tpl +2137 -0
  89. package/templates/minimal-app/apps/server/drizzle/meta/_journal.json.tpl +8 -1
  90. package/templates/minimal-app/apps/server/drizzle.config.ts.tpl +3 -33
  91. package/templates/minimal-app/apps/server/package.json.tpl +5 -3
  92. package/templates/minimal-app/apps/server/src/app.ts.tpl +36 -0
  93. package/templates/minimal-app/apps/server/src/modules/conversation/conversation.mastra.ts.tpl +26 -0
  94. package/templates/minimal-app/apps/server/src/modules/demo-workflow/demo-workflow.module.ts.tpl +51 -0
  95. package/templates/minimal-app/apps/server/src/modules/demo-workflow/demo-workflow.service.ts.tpl +51 -0
  96. package/templates/minimal-app/apps/server/src/modules/demo-workflow/demo-workflow.trpc.ts.tpl +16 -0
  97. package/templates/minimal-app/apps/server/src/modules/posts/posts.db.ts.tpl +28 -28
  98. package/templates/minimal-app/apps/server/src/modules/posts/posts.grants.ts.tpl +28 -28
  99. package/templates/minimal-app/apps/server/src/modules/posts/posts.module.ts.tpl +57 -54
  100. package/templates/minimal-app/apps/server/src/modules/posts/posts.repository.ts.tpl +67 -67
  101. package/templates/minimal-app/apps/server/src/modules/posts/posts.service.ts.tpl +116 -116
  102. package/templates/minimal-app/apps/server/src/modules/posts/posts.trpc.ts.tpl +37 -37
  103. package/templates/minimal-app/apps/server/src/modules/test-harness/test-harness.module.ts.tpl +279 -279
  104. package/templates/minimal-app/apps/server/src/schema.ts.tpl +31 -20
  105. package/templates/minimal-app/apps/server/src/types.ts.tpl +12 -12
  106. package/templates/minimal-app/apps/server/tsconfig.json.tpl +1 -1
  107. package/templates/minimal-app/apps/server/tsup.config.ts.tpl +23 -9
  108. package/templates/minimal-app/apps/shared/.env.example.tpl +5 -0
  109. package/templates/minimal-app/apps/shared/.env.production.example.tpl +23 -0
  110. package/templates/minimal-app/apps/shared/.env.tpl +5 -0
  111. package/templates/minimal-app/apps/shared/Dockerfile.tpl +48 -0
  112. package/templates/minimal-app/apps/shared/fly.toml.tpl +24 -0
  113. package/templates/minimal-app/apps/shared/package.json.tpl +26 -24
  114. package/templates/minimal-app/apps/shared/src/modules/app/app.constants.ts.tpl +28 -28
  115. package/templates/minimal-app/apps/shared/src/modules/conversation/conversation.constants.ts.tpl +1 -0
  116. package/templates/minimal-app/apps/shared/src/modules/demo-workflow/demo-workflow.constants.ts.tpl +1 -0
  117. package/templates/minimal-app/apps/shared/src/modules/notification/notification.schema.ts.tpl +3 -3
  118. package/templates/minimal-app/apps/shared/src/modules/posts/posts.constants.ts.tpl +5 -5
  119. package/templates/minimal-app/apps/shared/src/modules/posts/posts.schema.ts.tpl +25 -25
  120. package/templates/minimal-app/apps/webapp/package.json.tpl +53 -53
  121. package/templates/minimal-app/apps/webapp/public/push-sw.js.tpl +34 -34
  122. package/templates/minimal-app/apps/webapp/src/App.tsx.tpl +49 -44
  123. package/templates/minimal-app/apps/webapp/src/Layout.tsx.tpl +96 -65
  124. package/templates/minimal-app/apps/webapp/src/Router.tsx.tpl +114 -93
  125. package/templates/minimal-app/apps/webapp/src/StarterServerEventProvider.tsx.tpl +38 -0
  126. package/templates/minimal-app/apps/webapp/src/index.css.tpl +15 -15
  127. package/templates/minimal-app/apps/webapp/src/main.tsx.tpl +26 -26
  128. package/templates/minimal-app/apps/webapp/src/modules/conversation/ConversationRoute.tsx.tpl +36 -0
  129. package/templates/minimal-app/apps/webapp/src/modules/files/FilesRoute.tsx.tpl +88 -0
  130. package/templates/minimal-app/apps/webapp/src/modules/files/hooks/useFilesRoute.ts.tpl +50 -0
  131. package/templates/minimal-app/apps/webapp/src/modules/workflows/WorkflowsRoute.tsx.tpl +97 -0
  132. package/templates/minimal-app/apps/webapp/src/modules/workflows/hooks/useWorkflowsRoute.ts.tpl +64 -0
  133. package/templates/minimal-app/apps/webapp/src/utils/i18n.ts.tpl +13 -13
  134. package/templates/minimal-app/apps/webapp/src/utils/trpc.ts.tpl +10 -10
  135. package/templates/minimal-app/apps/webapp/src/vite-env.d.ts.tpl +1 -1
  136. package/templates/minimal-app/apps/webapp/translations/en/app.json.tpl +7 -7
  137. package/templates/minimal-app/apps/webapp/translations/en/{{APP_SLUG}}.json.tpl +193 -135
  138. package/templates/minimal-app/apps/webapp/tsconfig.json.tpl +17 -17
  139. package/templates/minimal-app/apps/webapp/vite.config.ts.tpl +31 -31
  140. package/templates/minimal-app/biome.json.tpl +17 -12
  141. package/templates/minimal-app/package.json.tpl +7 -2
  142. package/templates/minimal-app/pnpm-workspace.yaml.tpl +14 -7
  143. package/templates/minimal-app/template.manifest.json +93 -2
  144. package/templates/minimal-app/apps/server/drizzle/db.ts.tpl +0 -26
  145. package/templates/minimal-app/apps/server/drizzle/guard.ts.tpl +0 -36
  146. package/templates/minimal-app/apps/server/drizzle/reset.ts.tpl +0 -40
  147. package/templates/minimal-app/apps/server/drizzle/sync.ts.tpl +0 -16
@@ -1,94 +1,94 @@
1
- import { expect, test } from "@playwright/test";
2
- import { createExpoTrpcClient, expoLogin, expoLogout } from "./expo-helpers";
3
- import { clearEmails, emailUrl, getUserState, latestEmail, profiles } from "./helpers";
4
-
5
- const profile = "expoWaitlist" as const;
6
-
7
- test.beforeEach(async ({ request }) => {
8
- await clearEmails(request, profile);
9
- });
10
-
11
- test("public waitlist join stores confirmation email", async ({ page, request }) => {
12
- const email = `expo.waitlist.${Date.now()}@auth-e2e.local`;
13
-
14
- await page.goto("/signup");
15
- await page.getByTestId("waitlist-email").fill(email);
16
- await page.getByTestId("waitlist-submit").click();
17
-
18
- const confirmation = await latestEmail(request, profile, {
19
- to: email,
20
- templateId: "waitlist-confirmation",
21
- });
22
- expect(confirmation.subject).toContain("waitlist");
23
-
24
- const systemNotification = await latestEmail(request, profile, {
25
- to: "ops@auth-e2e.local",
26
- templateId: "system-waitlist-notification",
27
- });
28
- expect(systemNotification.props.email).toBe(email);
29
- });
30
-
31
- test("admin waitlist invitation creates a signup link that can be accepted", async ({
32
- page,
33
- request,
34
- }) => {
35
- const email = `expo.invited.${Date.now()}@auth-e2e.local`;
36
-
37
- await expoLogin(page, profiles[profile].adminEmail, profiles[profile].adminPassword);
38
- const trpc = await createExpoTrpcClient(page, profile);
39
- const waitlist = await trpc.auth.addToWaitlist.mutate({ email });
40
- await trpc.auth.inviteFromWaitlist.mutate({ id: waitlist.id });
41
-
42
- const invite = await latestEmail(request, profile, { to: email, templateId: "waitlist-invite" });
43
-
44
- await expoLogout(page);
45
- await page.goto(emailUrl(invite));
46
- await page.getByTestId("signup-password").fill("password1234");
47
- await page.getByTestId("signup-submit").click();
48
- await expect(page.getByTestId("session-email")).toContainText(email);
49
-
50
- const state = await getUserState(request, profile, email);
51
- expect(state.user.emailVerified).toBe(true);
52
- expect(state.organizations).toHaveLength(1);
53
-
54
- await expoLogout(page);
55
- await page.goto(emailUrl(invite));
56
- await expect(page.getByTestId("waitlist-code-status")).toContainText(
57
- /invalid|expired|invitation code not found/i
58
- );
59
- });
60
-
61
- test("signed-in user invite skips the waitlist", async ({ page, request }) => {
62
- const email = `expo.friend.${Date.now()}@auth-e2e.local`;
63
-
64
- await expoLogin(page, profiles[profile].adminEmail, profiles[profile].adminPassword);
65
- const trpc = await createExpoTrpcClient(page, profile);
66
- await trpc.auth.inviteToWaitlist.mutate({ email });
67
-
68
- const invite = await latestEmail(request, profile, {
69
- to: email,
70
- templateId: "waitlist-user-invite",
71
- });
72
-
73
- await expoLogout(page);
74
- await page.goto(emailUrl(invite));
75
- await page.getByTestId("signup-password").fill("password1234");
76
- await page.getByTestId("signup-submit").click();
77
- await expect(page.getByTestId("session-email")).toContainText(email);
78
-
79
- const state = await getUserState(request, profile, email);
80
- expect(state.user.emailVerified).toBe(true);
81
- expect(state.organizations).toHaveLength(1);
82
- });
83
-
84
- test("expired waitlist codes are rejected before signup", async ({ page }) => {
85
- await page.goto("/signup?code=expired-waitlist-code");
86
- await expect(page.getByTestId("waitlist-code-status")).toContainText(/expired/i);
87
- });
88
-
89
- test("unknown waitlist codes are rejected before signup", async ({ page }) => {
90
- await page.goto("/signup?code=unknown-waitlist-code");
91
- await expect(page.getByTestId("waitlist-code-status")).toContainText(
92
- /invalid|expired|invitation code not found/i
93
- );
94
- });
1
+ import { expect, test } from "@playwright/test";
2
+ import { createExpoTrpcClient, expoLogin, expoLogout } from "./expo-helpers";
3
+ import { clearEmails, emailUrl, getUserState, latestEmail, profiles } from "./helpers";
4
+
5
+ const profile = "expoWaitlist" as const;
6
+
7
+ test.beforeEach(async ({ request }) => {
8
+ await clearEmails(request, profile);
9
+ });
10
+
11
+ test("public waitlist join stores confirmation email", async ({ page, request }) => {
12
+ const email = `expo.waitlist.${Date.now()}@auth-e2e.local`;
13
+
14
+ await page.goto("/signup");
15
+ await page.getByTestId("waitlist-email").fill(email);
16
+ await page.getByTestId("waitlist-submit").click();
17
+
18
+ const confirmation = await latestEmail(request, profile, {
19
+ to: email,
20
+ templateId: "waitlist-confirmation",
21
+ });
22
+ expect(confirmation.subject).toContain("waitlist");
23
+
24
+ const systemNotification = await latestEmail(request, profile, {
25
+ to: "ops@auth-e2e.local",
26
+ templateId: "system-waitlist-notification",
27
+ });
28
+ expect(systemNotification.props.email).toBe(email);
29
+ });
30
+
31
+ test("admin waitlist invitation creates a signup link that can be accepted", async ({
32
+ page,
33
+ request,
34
+ }) => {
35
+ const email = `expo.invited.${Date.now()}@auth-e2e.local`;
36
+
37
+ await expoLogin(page, profiles[profile].adminEmail, profiles[profile].adminPassword);
38
+ const trpc = await createExpoTrpcClient(page, profile);
39
+ const waitlist = await trpc.auth.addToWaitlist.mutate({ email });
40
+ await trpc.auth.inviteFromWaitlist.mutate({ id: waitlist.id });
41
+
42
+ const invite = await latestEmail(request, profile, { to: email, templateId: "waitlist-invite" });
43
+
44
+ await expoLogout(page);
45
+ await page.goto(emailUrl(invite));
46
+ await page.getByTestId("signup-password").fill("password1234");
47
+ await page.getByTestId("signup-submit").click();
48
+ await expect(page.getByTestId("session-email")).toContainText(email);
49
+
50
+ const state = await getUserState(request, profile, email);
51
+ expect(state.user.emailVerified).toBe(true);
52
+ expect(state.organizations).toHaveLength(1);
53
+
54
+ await expoLogout(page);
55
+ await page.goto(emailUrl(invite));
56
+ await expect(page.getByTestId("waitlist-code-status")).toContainText(
57
+ /invalid|expired|invitation code not found/i
58
+ );
59
+ });
60
+
61
+ test("signed-in user invite skips the waitlist", async ({ page, request }) => {
62
+ const email = `expo.friend.${Date.now()}@auth-e2e.local`;
63
+
64
+ await expoLogin(page, profiles[profile].adminEmail, profiles[profile].adminPassword);
65
+ const trpc = await createExpoTrpcClient(page, profile);
66
+ await trpc.auth.inviteToWaitlist.mutate({ email });
67
+
68
+ const invite = await latestEmail(request, profile, {
69
+ to: email,
70
+ templateId: "waitlist-user-invite",
71
+ });
72
+
73
+ await expoLogout(page);
74
+ await page.goto(emailUrl(invite));
75
+ await page.getByTestId("signup-password").fill("password1234");
76
+ await page.getByTestId("signup-submit").click();
77
+ await expect(page.getByTestId("session-email")).toContainText(email);
78
+
79
+ const state = await getUserState(request, profile, email);
80
+ expect(state.user.emailVerified).toBe(true);
81
+ expect(state.organizations).toHaveLength(1);
82
+ });
83
+
84
+ test("expired waitlist codes are rejected before signup", async ({ page }) => {
85
+ await page.goto("/signup?code=expired-waitlist-code");
86
+ await expect(page.getByTestId("waitlist-code-status")).toContainText(/expired/i);
87
+ });
88
+
89
+ test("unknown waitlist codes are rejected before signup", async ({ page }) => {
90
+ await page.goto("/signup?code=unknown-waitlist-code");
91
+ await expect(page.getByTestId("waitlist-code-status")).toContainText(
92
+ /invalid|expired|invitation code not found/i
93
+ );
94
+ });
@@ -0,0 +1,35 @@
1
+ import { expect, test } from "@playwright/test";
2
+ import { clearEmails, login, signUp, verifyLatestEmail } from "./helpers";
3
+
4
+ const profile = "standard" as const;
5
+
6
+ const PNG_1X1 = Buffer.from(
7
+ "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==",
8
+ "base64"
9
+ );
10
+
11
+ test.beforeEach(async ({ request }) => {
12
+ await clearEmails(request, profile);
13
+ });
14
+
15
+ test("upload a file and see it inventoried", async ({ page, request }) => {
16
+ const email = `files.${Date.now()}@auth-e2e.local`;
17
+ const password = "password1234";
18
+
19
+ await signUp(page, email, password);
20
+ await verifyLatestEmail(request, profile, email);
21
+ await login(page, email, password);
22
+
23
+ await page.goto("/files");
24
+ await expect(page.getByTestId("files-route")).toBeVisible();
25
+
26
+ await page.getByTestId("file-upload-input").setInputFiles({
27
+ name: "hello.png",
28
+ mimeType: "image/png",
29
+ buffer: PNG_1X1,
30
+ });
31
+
32
+ await expect(page.getByTestId("file-row").first()).toContainText("hello.png", {
33
+ timeout: 15_000,
34
+ });
35
+ });