create-convex-monorepo 0.2.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 (93) hide show
  1. package/CONTRIBUTING.md +55 -0
  2. package/LICENSE +21 -0
  3. package/README.md +213 -0
  4. package/assets/backend/PROVENANCE.md +3 -0
  5. package/assets/backend/convex/_generated/api.d.ts +51 -0
  6. package/assets/backend/convex/_generated/api.js +23 -0
  7. package/assets/backend/convex/_generated/dataModel.d.ts +60 -0
  8. package/assets/backend/convex/_generated/server.d.ts +162 -0
  9. package/assets/backend/convex/_generated/server.js +101 -0
  10. package/assets/backend/convex/messages.ts +38 -0
  11. package/assets/backend/convex/schema.ts +9 -0
  12. package/assets/backend/convex/tsconfig.json +26 -0
  13. package/assets/backend-blank/PROVENANCE.md +3 -0
  14. package/assets/backend-blank/convex/_generated/api.d.ts +45 -0
  15. package/assets/backend-blank/convex/_generated/api.js +23 -0
  16. package/assets/backend-blank/convex/_generated/dataModel.d.ts +60 -0
  17. package/assets/backend-blank/convex/_generated/server.d.ts +162 -0
  18. package/assets/backend-blank/convex/_generated/server.js +101 -0
  19. package/assets/backend-blank/convex/schema.ts +3 -0
  20. package/assets/setup/convex-setup.mjs +250 -0
  21. package/dist/cli/index.d.ts +2 -0
  22. package/dist/cli/index.js +19 -0
  23. package/dist/cli/index.js.map +1 -0
  24. package/dist/commands/create.d.ts +8 -0
  25. package/dist/commands/create.js +182 -0
  26. package/dist/commands/create.js.map +1 -0
  27. package/dist/generator/context.d.ts +3 -0
  28. package/dist/generator/context.js +81 -0
  29. package/dist/generator/context.js.map +1 -0
  30. package/dist/generator/index.d.ts +12 -0
  31. package/dist/generator/index.js +123 -0
  32. package/dist/generator/index.js.map +1 -0
  33. package/dist/generator/options.d.ts +15 -0
  34. package/dist/generator/options.js +85 -0
  35. package/dist/generator/options.js.map +1 -0
  36. package/dist/generator/types.d.ts +47 -0
  37. package/dist/generator/types.js +2 -0
  38. package/dist/generator/types.js.map +1 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.js +3 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/integrations/auth/clerk/index.d.ts +2 -0
  43. package/dist/integrations/auth/clerk/index.js +114 -0
  44. package/dist/integrations/auth/clerk/index.js.map +1 -0
  45. package/dist/integrations/auth/index.d.ts +2 -0
  46. package/dist/integrations/auth/index.js +7 -0
  47. package/dist/integrations/auth/index.js.map +1 -0
  48. package/dist/integrations/auth/none/index.d.ts +2 -0
  49. package/dist/integrations/auth/none/index.js +18 -0
  50. package/dist/integrations/auth/none/index.js.map +1 -0
  51. package/dist/integrations/auth/shared.d.ts +11 -0
  52. package/dist/integrations/auth/shared.js +40 -0
  53. package/dist/integrations/auth/shared.js.map +1 -0
  54. package/dist/package-manager/index.d.ts +6 -0
  55. package/dist/package-manager/index.js +22 -0
  56. package/dist/package-manager/index.js.map +1 -0
  57. package/dist/templates/apps/expo/index.d.ts +2 -0
  58. package/dist/templates/apps/expo/index.js +91 -0
  59. package/dist/templates/apps/expo/index.js.map +1 -0
  60. package/dist/templates/apps/index.d.ts +2 -0
  61. package/dist/templates/apps/index.js +11 -0
  62. package/dist/templates/apps/index.js.map +1 -0
  63. package/dist/templates/apps/next/index.d.ts +2 -0
  64. package/dist/templates/apps/next/index.js +66 -0
  65. package/dist/templates/apps/next/index.js.map +1 -0
  66. package/dist/templates/apps/shared.d.ts +24 -0
  67. package/dist/templates/apps/shared.js +124 -0
  68. package/dist/templates/apps/shared.js.map +1 -0
  69. package/dist/templates/apps/tanstack-start/index.d.ts +2 -0
  70. package/dist/templates/apps/tanstack-start/index.js +82 -0
  71. package/dist/templates/apps/tanstack-start/index.js.map +1 -0
  72. package/dist/templates/apps/vite/index.d.ts +2 -0
  73. package/dist/templates/apps/vite/index.js +42 -0
  74. package/dist/templates/apps/vite/index.js.map +1 -0
  75. package/dist/templates/backend/index.d.ts +2 -0
  76. package/dist/templates/backend/index.js +58 -0
  77. package/dist/templates/backend/index.js.map +1 -0
  78. package/dist/templates/root/index.d.ts +2 -0
  79. package/dist/templates/root/index.js +178 -0
  80. package/dist/templates/root/index.js.map +1 -0
  81. package/dist/templates/versions.d.ts +18 -0
  82. package/dist/templates/versions.js +19 -0
  83. package/dist/templates/versions.js.map +1 -0
  84. package/dist/version.d.ts +1 -0
  85. package/dist/version.js +11 -0
  86. package/dist/version.js.map +1 -0
  87. package/docs/adding-a-framework.md +27 -0
  88. package/docs/adding-an-auth-provider.md +31 -0
  89. package/docs/architecture.md +49 -0
  90. package/docs/releases.md +78 -0
  91. package/docs/research.md +76 -0
  92. package/docs/verification.md +78 -0
  93. package/package.json +77 -0
@@ -0,0 +1,78 @@
1
+ # v0.1 verification
2
+
3
+ Executed on 2026-09-09 on macOS with Node 24.17.0 and pnpm 10.34.5. Results refer to the implementation in this repository, not every future upstream release.
4
+
5
+ ## Repository checks
6
+
7
+ | Command | Result |
8
+ | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | `pnpm install --frozen-lockfile` | Passed |
10
+ | `pnpm lint` | Passed |
11
+ | `pnpm format:check` | Passed |
12
+ | `pnpm typecheck` | Passed |
13
+ | `pnpm test` | 98 passed: 41 core, 13 generator/golden, 14 setup, 11 blank, 14 release, 5 backend |
14
+ | `pnpm build` | Passed |
15
+ | `pnpm pack` | Passed |
16
+ | `node scripts/pack-smoke.mjs` | Installed the tarball outside the checkout and generated Next + Expo + Clerk through its bin; official generated assets and standalone URL linking passed |
17
+
18
+ The twelve golden combinations cover every requested fixture plus Vite + Clerk and Start + Clerk. An additional regression test covers numeric-leading names, matching native auth redirects, ten applications, dev concurrency and tracked environment examples. Filesystem tests cover traversal, symlinks, existing content, cancellation, collisions, and failed install/git recovery.
19
+
20
+ Backend tests execute generated functions with `convex-test`. They check persistence, trimming, input length, the fifty-message bound, unauthenticated rejection and isolation between identities.
21
+
22
+ ## Generated-project checks
23
+
24
+ `pnpm test:e2e` generates into a fresh OS temporary directory, installs dependencies, and runs root `pnpm typecheck`, `pnpm lint` and `pnpm build`. It supplies syntactically valid public test configuration so bundlers compile the actual providers. Test Clerk keys are synthetic and cannot authenticate. Set `CCM_APPS` and `CCM_AUTH` to choose the case. A failed fixture is retained and its path printed; successful fixtures are removed unless `CCM_KEEP_FIXTURE` is set.
25
+
26
+ Completed all-four-framework workspaces with both `none` and `clerk`. Next builds used Turbopack; Vite produced client bundles; Start produced client and server bundles. Expo exported iOS and Android Metro/Hermes bundles using isolated pnpm workspace links and the default Metro resolver. Client output scans also reject the backend index name, backend validation text and synthetic server-secret marker in shipped JavaScript or Hermes bundles. Each frontend's standalone TypeScript program checked the concrete shared API argument, document and return types, plus negative API-key assertions.
27
+
28
+ The six definition-of-done combinations are also checked individually: Next, Vite, Start, Expo, Next + Expo, and Next + Expo + Clerk. The GitHub Actions matrix repeats these combinations and adds Vite + Start + Clerk. CI has been authored but has not run on a hosted GitHub runner in this session.
29
+
30
+ ## Live checks
31
+
32
+ `CONVEX_AGENT_MODE=anonymous convex dev --once` compiled and pushed the example to a local deployment using Convex 1.45.0. The unmodified official generated files were captured from that workflow. The generated workspace's `pnpm convex:setup` also pushed successfully from packages/backend.
33
+
34
+ The generated all-four workspace's `pnpm dev` started Convex, Next, Vite, Start and Metro together with streamed logs. A `ConvexHttpClient` sent and queried a message; a separate `ConvexClient` subscription observed that mutation. The Next, Vite and Start development servers each returned HTTP 200. Creating environment files during a Start server restart caused one transient request failure; a subsequent request succeeded.
35
+
36
+ The interactive CLI was exercised in a PTY and created a Next + Expo project. The noninteractive CLI and installed tarball bin were also exercised.
37
+
38
+ ## Limits
39
+
40
+ No browser was available through the browser-control tool, so page interaction and visual review were not performed. Fable was unavailable; no independent UI/UX review is claimed. Fresh technical review found scheme and task-concurrency defects, which were fixed and checked again.
41
+
42
+ Real Clerk sessions, Google OAuth, MFA/session tasks, native Xcode/Gradle builds and physical devices were not tested. Metro exports prove JavaScript module resolution and bundling, not native binary execution. Start's Convex data is client-driven; authenticated server prefetching is not configured. Optional upstream peer warnings are recorded in research.md.
43
+
44
+ Windows and Node 22 checks are configured in CI but were not executed locally. No npm publication, remote repository creation or production deployment occurred.
45
+
46
+ ## Initialization and release automation checks
47
+
48
+ The initialization follow-up passed repository install, lint, formatting, typecheck, all 73 tests, build, pack, and installed-tarball smoke checks. Setup tests cover option conflicts, dependency ordering, preserving failed projects, all four environment prefixes, existing multiline settings, secret exclusion, invalid URLs, symlinks, child-process failure, and cancellation. The tarball test runs the copied URL linker without installing the generated project's dependencies.
49
+
50
+ Ran the built CLI with `--apps web:next,admin:vite,app:tanstack-start,mobile:expo --auth none --init-convex --no-git` in a fresh temporary directory with `CONVEX_AGENT_MODE=anonymous`. It installed dependencies, pushed to a real local Convex deployment and linked every frontend. Each generated environment file contained exactly its public URL assignment. Re-running `pnpm convex:link` preserved their modification times. The resulting root `pnpm typecheck`, `pnpm lint` and `pnpm build` passed for all four apps, including iOS and Android Metro/Hermes exports.
51
+
52
+ A separate PTY run accepted the new initialization prompt for Next + Expo. Dependencies installed automatically, Convex pushed successfully, and both URLs linked. Anonymous mode exercised local setup; browser account login and cloud project selection were not tested.
53
+
54
+ Fresh technical review reproduced a cancellation race during URL linking. The fix passes the abort signal through the linking stage and checks it before each write and before reporting completion. A focused reviewer follow-up reran the reproduction and confirmed rejection after cancellation, with the remaining app untouched. Partial completed writes stay available and linking can be rerun.
55
+
56
+ The release-please configuration passed validation against its upstream schema, and the PR-title rule accepted five valid titles and rejected five invalid titles. CLI and generated metadata versions now come from package.json. GitHub Actions, repository permissions and release creation have not been exercised on a remote repository.
57
+
58
+ ## Blank starter checks
59
+
60
+ The blank starter follow-up passed lint, formatting, typecheck, all 84 tests, build, pack, and the installed-tarball smoke test for both starter choices. Eleven new tests cover selection/defaults, invalid values, all four frameworks individually, and combined workspaces with no auth and Clerk. They check for absent demo files and stale imports while retaining providers and auth configuration.
61
+
62
+ `CCM_EXAMPLE=none CCM_AUTH=none pnpm test:e2e` and `CCM_EXAMPLE=none CCM_AUTH=clerk pnpm test:e2e` both passed installation, typecheck, lint and build for all four frameworks. Builds included Next, Vite, Start client/server, and Expo iOS/Android Metro exports. The test runner injected exact empty API/table-name assertions, non-any assertions and negative unknown-module assertions into each disposable frontend. Those test files are not included in normal blank generation. Clerk build configuration was synthetic; real sign-in remains untested.
63
+
64
+ The empty schema and unmodified generated assets came from a successful official `convex dev --once` run. A generated blank workspace then completed its own `pnpm convex:setup` against an anonymous local deployment and linked all four frontend URLs. The interactive starter-content prompt also created a blank Next + Expo project in a PTY.
65
+
66
+ Fresh technical review independently compiled the empty API/data-model assertions and found a Windows path-separator error in the new file assertions. That error was fixed before the final test run. Windows execution and hosted CI remain untested locally.
67
+
68
+ ## npm publishing preparation
69
+
70
+ On 2026-09-10, the publishing follow-up passed frozen installation, lint, formatting, typecheck, all 98 tests, build, package smoke tests and `actionlint`. The packed CLI ran through npx and pnpm dlx using the local tarball. The release package validator checked its real manifest and registry status, and `npm publish --dry-run --ignore-scripts --access public` accepted the archive without publishing.
71
+
72
+ Fresh review checked the release dispatch, provenance commit identity, bootstrap flow, artifact transfer and publishing permissions. It identified a cross-version publishing race; the publish job now serializes npm updates across releases. The repository was created at `adamtrip-solutions/create-convex-monorepo`, with the npm environment restricted to release tags and automated npm publishing disabled pending account/trust setup. Hosted [CI run 34415619159](https://github.com/adamtrip-solutions/create-convex-monorepo/actions/runs/34415619159) passed all jobs on release infrastructure commit `3e1943b`, including Windows and Linux generator checks and every generated-project build. The first hosted run exposed CRLF checkout formatting on Windows; `.gitattributes` now fixes LF endings across platforms. The automatically generated changelog uses release-please formatting and is excluded from Prettier. Actual npm OIDC publication remains untested until account and trusted-publisher setup is complete.
73
+
74
+ ## CI bootstrap publishing
75
+
76
+ Compared both the local checkout and GitHub workflow of `adamtrip-solutions/convex-cloudflare-email`, whose first npm release workflow succeeded. Its publish step supports `NPM_BOOTSTRAP_TOKEN` for initial package creation. This repository now supports the same token-to-OIDC transition and no longer gates publishing behind `NPM_PUBLISHING_ENABLED`. The token is passed only to the final npm publish step. No secret values were read or transferred from the reference repository, and this package has not been published.
77
+
78
+ A later Windows run exposed an intermittent cancellation failure: setup rejected on the child's abort error before the process closed, leaving the backend directory locked during cleanup. The regression test reproduced the early return locally. Setup now waits for the child close event before settling, preserving the original error. The corrected test and all 98 repository tests passed, together with typecheck, lint, formatting, build, and package smoke checks. Hosted Windows confirmation of this fix is pending.
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "create-convex-monorepo",
3
+ "version": "0.2.0",
4
+ "description": "Generate typed Convex monorepos with composable frontend and authentication adapters.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "create-convex-monorepo": "dist/cli/index.js"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "assets",
19
+ "docs",
20
+ "README.md",
21
+ "CONTRIBUTING.md",
22
+ "LICENSE"
23
+ ],
24
+ "engines": {
25
+ "node": ">=22.12.0"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "dependencies": {
31
+ "@clack/prompts": "1.8.0",
32
+ "cross-spawn": "7.0.6"
33
+ },
34
+ "devDependencies": {
35
+ "@types/cross-spawn": "6.0.6",
36
+ "@types/node": "24.12.2",
37
+ "convex": "1.45.0",
38
+ "convex-test": "0.0.54",
39
+ "eslint": "10.10.0",
40
+ "prettier": "3.8.3",
41
+ "tsx": "4.21.0",
42
+ "typescript": "6.0.3",
43
+ "typescript-eslint": "8.70.0",
44
+ "vite": "8.2.2",
45
+ "vitest": "5.0.0"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/adamtrip-solutions/create-convex-monorepo.git"
50
+ },
51
+ "homepage": "https://github.com/adamtrip-solutions/create-convex-monorepo#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/adamtrip-solutions/create-convex-monorepo/issues"
54
+ },
55
+ "keywords": [
56
+ "convex",
57
+ "monorepo",
58
+ "create",
59
+ "turborepo",
60
+ "nextjs",
61
+ "expo",
62
+ "vite",
63
+ "tanstack"
64
+ ],
65
+ "scripts": {
66
+ "dev": "tsx src/cli/index.ts",
67
+ "build": "tsc -p tsconfig.build.json && node scripts/executable.mjs",
68
+ "typecheck": "tsx scripts/backend-fixtures.ts && tsc --noEmit",
69
+ "lint": "eslint .",
70
+ "format": "prettier --write .",
71
+ "format:check": "prettier --check .",
72
+ "test": "vitest run && pnpm test:backend",
73
+ "test:e2e": "node scripts/e2e.mjs",
74
+ "test:backend": "tsx scripts/backend-fixtures.ts && vitest run --config vitest.backend.config.ts",
75
+ "test:package": "node scripts/pack-smoke.mjs"
76
+ }
77
+ }