create-convex-monorepo 0.2.1 → 0.3.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 (54) hide show
  1. package/CONTRIBUTING.md +18 -0
  2. package/README.md +74 -3
  3. package/assets/setup/convex-setup.d.mts +16 -0
  4. package/dist/cli/index.js +3 -3
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/workspace.d.ts +2 -0
  7. package/dist/cli/workspace.js +19 -0
  8. package/dist/cli/workspace.js.map +1 -0
  9. package/dist/commands/create.d.ts +1 -1
  10. package/dist/commands/create.js +5 -0
  11. package/dist/commands/create.js.map +1 -1
  12. package/dist/commands/entry.d.ts +1 -0
  13. package/dist/commands/entry.js +93 -0
  14. package/dist/commands/entry.js.map +1 -0
  15. package/dist/commands/workspace.d.ts +20 -0
  16. package/dist/commands/workspace.js +272 -0
  17. package/dist/commands/workspace.js.map +1 -0
  18. package/dist/generator/context.js +5 -2
  19. package/dist/generator/context.js.map +1 -1
  20. package/dist/generator/format.d.ts +9 -0
  21. package/dist/generator/format.js +47 -0
  22. package/dist/generator/format.js.map +1 -0
  23. package/dist/index.d.ts +10 -0
  24. package/dist/index.js +6 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/templates/root/index.js +7 -1
  27. package/dist/templates/root/index.js.map +1 -1
  28. package/dist/templates/versions.d.ts +1 -0
  29. package/dist/templates/versions.js +1 -0
  30. package/dist/templates/versions.js.map +1 -1
  31. package/dist/workspace/add.d.ts +9 -0
  32. package/dist/workspace/add.js +326 -0
  33. package/dist/workspace/add.js.map +1 -0
  34. package/dist/workspace/changes.d.ts +23 -0
  35. package/dist/workspace/changes.js +157 -0
  36. package/dist/workspace/changes.js.map +1 -0
  37. package/dist/workspace/doctor.d.ts +16 -0
  38. package/dist/workspace/doctor.js +483 -0
  39. package/dist/workspace/doctor.js.map +1 -0
  40. package/dist/workspace/env.d.ts +12 -0
  41. package/dist/workspace/env.js +50 -0
  42. package/dist/workspace/env.js.map +1 -0
  43. package/dist/workspace/project.d.ts +28 -0
  44. package/dist/workspace/project.js +147 -0
  45. package/dist/workspace/project.js.map +1 -0
  46. package/dist/workspace/upgrade.d.ts +17 -0
  47. package/dist/workspace/upgrade.js +86 -0
  48. package/dist/workspace/upgrade.js.map +1 -0
  49. package/docs/adding-a-framework.md +6 -0
  50. package/docs/adding-an-auth-provider.md +8 -0
  51. package/docs/architecture.md +15 -1
  52. package/docs/releases.md +2 -1
  53. package/docs/verification.md +24 -0
  54. package/package.json +8 -5
package/CONTRIBUTING.md CHANGED
@@ -34,6 +34,24 @@ Describe the failing behavior, the generated combination involved, and the expec
34
34
 
35
35
  Check current upstream documentation before changing Convex generation, exports, bundler resolution, or SDK versions. Record compatibility findings in `docs/research.md`. Do not edit Convex-generated internals, cast away shared API types, or suppress errors to pass a build. Refresh official generated assets through supported Convex tooling when the example backend changes.
36
36
 
37
+ ## Workspace command development
38
+
39
+ `pnpm dev:workspace --help` runs the management CLI from source. Run it inside a generated fixture by invoking the built `convex-monorepo` binary or using the exported planning APIs in tests. `pnpm test:workspace:e2e` generates one app, adds the remaining frameworks, adds Clerk, syncs URLs, installs dependencies, and runs doctor, typechecks, lint, and builds. Set `CCM_EXAMPLE=none` to test adding apps after Clerk configuration on a blank project.
40
+
41
+ Changes to mutation commands need tests for customized files, preflight conflicts, dry runs, cancellation, and preservation of unrelated content. Diagnostic tests should include both missing dependencies and real installed type resolution. Mock registry responses in unit tests for upgrade checks.
42
+
43
+ ## Contribution and review process
44
+
45
+ Fork the repository, make changes on a branch in your fork, and open a pull request against `main`. A fork is your own copy; creating one or pushing to it does not change this repository or grant access to it.
46
+
47
+ Outside-contributor workflows require maintainer approval before they run. Approval to run CI only permits the tests to execute; it does not approve or merge the change. Fork PR workflows run with read-only repository permissions and do not receive repository secrets.
48
+
49
+ The normal merge requirements are a passing `CI passed` check, a passing `Conventional PR title` check, an approving review, and resolved review conversations. New commits dismiss previous approvals. `.github/CODEOWNERS` names `@adamtrip` for all files, including itself and the release workflows. GitHub reads code ownership from the PR's target branch, so this requirement starts applying once the file is on `main`.
50
+
51
+ Auto-merge is disabled. The `main` push allowlist contains only `@adamtrip`; passing CI does not give contributors permission to merge. Release-please creates release PRs, but does not merge them. The maintainer decides when a release PR is ready, and merging it starts automated npm publication.
52
+
53
+ Repository administrators retain GitHub's branch-protection override. This permits the sole maintainer to merge their own PRs, which GitHub does not let them approve. The override also applies to tools authenticated as that administrator; it is not a separate human-approval mechanism. Adding another administrator or granting access to an admin credential grants that power too. Routine contributions should use PRs, and automation should not use the override to merge contributions without the maintainer's explicit instruction.
54
+
37
55
  ## Tests and pull requests
38
56
 
39
57
  Add focused regression tests for the behavior being fixed. Run generated-app typechecks and builds for affected frameworks and auth choices. For Expo, include Metro export evidence. Report exact checks run, failures, skipped checks, and whether real backend/auth interaction was exercised. Never include deployment keys or personal environment files in fixtures or logs.
package/README.md CHANGED
@@ -26,6 +26,66 @@ Both commands run the same CLI. You can also install it globally with `npm insta
26
26
 
27
27
  Contributors can run the checkout with `pnpm dev`; see [CONTRIBUTING.md](CONTRIBUTING.md).
28
28
 
29
+ ## Manage an existing workspace
30
+
31
+ Run the same CLI from the workspace root or any subdirectory. No global or project installation is needed:
32
+
33
+ ```sh
34
+ npx create-convex-monorepo@latest
35
+ ```
36
+
37
+ With a terminal attached, it detects `convex-monorepo.json` and offers a menu to add an app, add Clerk, check the workspace, sync frontend URLs, or check for updates. Without a terminal, it prints management help without changing files.
38
+
39
+ You can also run each command directly:
40
+
41
+ ```sh
42
+ npx create-convex-monorepo@latest add app admin --framework vite --example none --dry-run
43
+ npx create-convex-monorepo@latest add app admin --framework vite --example none --install
44
+ npx create-convex-monorepo@latest add app mobile --framework expo --no-install
45
+ npx create-convex-monorepo@latest add auth clerk --dry-run
46
+ npx create-convex-monorepo@latest add auth clerk --install
47
+ npx create-convex-monorepo@latest env sync --app mobile
48
+ npx create-convex-monorepo@latest doctor
49
+ npx create-convex-monorepo@latest upgrade --check
50
+ ```
51
+
52
+ The same commands work through pnpm:
53
+
54
+ ```sh
55
+ pnpm create convex-monorepo@latest add app admin --framework vite --no-install
56
+ pnpm create convex-monorepo@latest doctor
57
+ ```
58
+
59
+ The separate `convex-monorepo` binary remains available for users who install the package locally or globally. For example, after `pnpm add -Dw create-convex-monorepo@latest`, run `pnpm exec convex-monorepo doctor`.
60
+
61
+ To explicitly generate a new project, use `create <project-name>`. This also lets you use a command name such as `doctor` as the project name:
62
+
63
+ ```sh
64
+ npx create-convex-monorepo@latest create doctor --apps vite --no-install --no-git
65
+ ```
66
+
67
+ | Command | Behavior |
68
+ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
69
+ | `add app` | Creates an app using the existing backend and auth, updates root scripts and metadata, and links the public backend URL when configured. |
70
+ | `add auth clerk` | Adds Clerk to generated app providers and the backend auth configuration. Customized files that need replacement cause a conflict. |
71
+ | `env sync` | Links only the public backend URL, using each framework's variable prefix. Supports `--app` and `--dry-run`. |
72
+ | `doctor` | Checks workspace configuration, installed dependencies, environment settings, and shared API types. Supports `--json`; errors exit with status 1. |
73
+ | `upgrade --check` | Compares generator versions with npm's latest stable release and reports the running CLI's tested dependency baseline through `--json`. Makes no changes. |
74
+
75
+ The add commands support `--dry-run`, `--install`, `--no-install`, and `--yes`. Without prompts, provide the app name and framework; dependency installation defaults to off. `--yes` enables installation unless `--no-install` is set, and never overrides conflicts. A dry run shows file paths without printing environment values or installing dependencies.
76
+
77
+ Existing workspaces with metadata version 1, including projects created with 0.2.1, are supported. Preserve `convex-monorepo.json`; the CLI reads it rather than guessing which directories belong to your project. Per-app starter choices are recorded there when they differ from the original selection.
78
+
79
+ ### Changes and conflicts
80
+
81
+ Commands plan every file before applying changes. They reject unsafe paths, symlinks, existing app directories, conflicting scripts or dependencies, and customized auth files that would need replacement. App addition requires the generated `apps/*` and `packages/*` workspace layout and Turbo dev script. Adding a messages UI also requires the generated messages backend contract; use `--example none` with a customized backend.
82
+
83
+ Auth addition supports `none` to Clerk. It preserves backend schemas, functions, generated internals, unrelated package fields, and existing README content. Follow the new `CLERK_SETUP.md` for account configuration. Existing public messages do not acquire an owner automatically and will not appear in authenticated accounts. Review stored-data migration separately. Already configured Clerk is a no-op; replacing an auth provider is not supported.
84
+
85
+ A workspace lock prevents two CLI edits from running together. Each planned file is checked again before writing. Failed edits roll back files that still contain this command's output; observed concurrent edits are preserved and reported. Filesystem checks are optimistic, so avoid editing affected files while a command is applying. A failed dependency installation leaves the applied files available for retry with `pnpm install`.
86
+
87
+ Doctor is read-only and uses an in-memory TypeScript probe. It does not run application scripts, start services, configure a deployment, validate a real Clerk session, or prove a native Expo build works. Missing installation or environment configuration is reported with suggested steps. The upgrade command does not rewrite files, migrate templates, or update dependency versions.
88
+
29
89
  ## Interactive usage
30
90
 
31
91
  With a terminal attached, the CLI asks for missing choices:
@@ -118,7 +178,7 @@ my-app/
118
178
  └── package.json
119
179
  ```
120
180
 
121
- `convex-monorepo.json` records the selected applications and auth provider. It is metadata for later tooling; it does not implement upgrade or add commands.
181
+ `convex-monorepo.json` records the selected applications and auth provider. The workspace commands use this metadata to locate apps and plan changes. `upgrade --check` reports versions without applying migrations.
122
182
 
123
183
  ## Multiple frontends
124
184
 
@@ -128,7 +188,7 @@ Use explicit names to choose folders and repeat a framework:
128
188
  pnpm create convex-monorepo@latest acme --apps web:next,admin:next,mobile:expo --yes
129
189
  ```
130
190
 
131
- Apps become `@acme/web`, `@acme/admin`, and `@acme/mobile`. All depend on `@acme/backend` through `workspace:*`. The generator assigns distinct web development ports. v0.1 creates a new workspace; adding an app to an existing workspace is not implemented.
191
+ Apps become `@acme/web`, `@acme/admin`, and `@acme/mobile`. All depend on `@acme/backend` through `workspace:*`. The generator assigns distinct web development ports. Use `npx create-convex-monorepo@latest add app` to add another frontend later.
132
192
 
133
193
  ## First run and development
134
194
 
@@ -154,6 +214,17 @@ pnpm build
154
214
 
155
215
  Complete setup in a normal terminal before starting Turbo. Stop a separately running backend watcher before `pnpm dev`, which starts its own. Public environment values are embedded at build time; rebuild frontends when they change. Backend build checks types and does not deploy.
156
216
 
217
+ ## Code formatting
218
+
219
+ Generated source and configuration files are formatted with Prettier before they are written, including when using `--no-install`. New workspaces include a pinned Prettier dependency and matching configuration:
220
+
221
+ ```sh
222
+ pnpm format
223
+ pnpm format:check
224
+ ```
225
+
226
+ Convex `_generated` files, TanStack's generated route tree, build output, lockfiles, and environment files are excluded. Adding an app formats its new files; it does not reformat existing application code. Auth migration accepts formatting differences in older starters while still rejecting customized code that would be replaced.
227
+
157
228
  ## Convex backend sharing
158
229
 
159
230
  ```ts
@@ -204,7 +275,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md), [adding a framework](docs/adding-a-frame
204
275
 
205
276
  ## Roadmap
206
277
 
207
- The next release should add `doctor` to check deployment URLs, generated types, version alignment, and auth setup in an existing workspace. Later candidates are `add app`, another auth provider, and additional package-manager adapters. These commands are not available in v0.1.
278
+ Next candidates are reviewed upgrade migrations, additional auth providers, and more package-manager adapters. `upgrade --check` currently reports versions without changing dependencies.
208
279
 
209
280
  MIT licensed. See [LICENSE](LICENSE).
210
281
 
@@ -0,0 +1,16 @@
1
+ /** Shared runtime helpers, also copied into generated projects as plain JavaScript. */
2
+ export function publicVariable(framework: string): string;
3
+ export function deploymentUrl(value: string | undefined): string;
4
+ export function linkEnvironment(
5
+ contents: string,
6
+ variable: string,
7
+ url: string,
8
+ ): string;
9
+ export function linkFrontends(
10
+ root: string,
11
+ signal?: AbortSignal,
12
+ ): Promise<void>;
13
+ export function initializeConvex(
14
+ root: string,
15
+ signal?: AbortSignal,
16
+ ): Promise<void>;
package/dist/cli/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { getPackageVersion } from '../version.js';
3
- import { runCreate } from '../commands/create.js';
3
+ import { runEntry } from '../commands/entry.js';
4
4
  const controller = new AbortController();
5
- const interrupt = () => controller.abort(new Error('Generation interrupted.'));
5
+ const interrupt = () => controller.abort(new Error('Command interrupted.'));
6
6
  process.once('SIGINT', interrupt);
7
7
  process.once('SIGTERM', interrupt);
8
8
  try {
9
- await runCreate(process.argv.slice(2), await getPackageVersion(), controller.signal);
9
+ await runEntry(process.argv.slice(2), await getPackageVersion(), controller.signal);
10
10
  }
11
11
  catch (error) {
12
12
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;AACzC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAC/E,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,IAAI,CAAC;IACH,MAAM,SAAS,CACb,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EACrB,MAAM,iBAAiB,EAAE,EACzB,UAAU,CAAC,MAAM,CAClB,CAAC;AACJ,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,KAAK,CACX,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACnE,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;QAAS,CAAC;IACT,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC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
2
+ import { getPackageVersion } from '../version.js';
3
+ import { runWorkspace } from '../commands/workspace.js';
4
+ const controller = new AbortController();
5
+ const interrupt = () => controller.abort(new Error('Workspace command interrupted.'));
6
+ process.once('SIGINT', interrupt);
7
+ process.once('SIGTERM', interrupt);
8
+ try {
9
+ await runWorkspace(process.argv.slice(2), await getPackageVersion(), controller.signal);
10
+ }
11
+ catch (error) {
12
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
13
+ process.exitCode = controller.signal.aborted ? 130 : 1;
14
+ }
15
+ finally {
16
+ process.removeListener('SIGINT', interrupt);
17
+ process.removeListener('SIGTERM', interrupt);
18
+ }
19
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/cli/workspace.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;AACzC,MAAM,SAAS,GAAG,GAAG,EAAE,CACrB,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAC;AAChE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,IAAI,CAAC;IACH,MAAM,YAAY,CAChB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EACrB,MAAM,iBAAiB,EAAE,EACzB,UAAU,CAAC,MAAM,CAClB,CAAC;AACJ,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,KAAK,CACX,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACnE,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;QAAS,CAAC;IACT,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC5C,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAC/C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type RawOptions } from '../generator/options.js';
2
- export declare const help = "create-convex-monorepo [project-name] [options]\n\nGenerate a pnpm + Turborepo workspace sharing one Convex backend.\n\n --apps <list> next,vite,tanstack-start,expo or web:next,admin:vite\n --example <name> messages (default) or none for blank apps\n --auth <provider> none (default) or clerk\n --package-manager <name> pnpm (v0.1)\n --install / --no-install Install generated dependencies\n --init-convex / --no-init-convex Set up Convex and link URLs (requires install)\n --git / --no-git Initialize a git repository\n --yes, -y Accept defaults, including installation and git\n --help, -h Show usage\n --version, -v Show version\n\nWithout a terminal, prompts are disabled. Installation and git default to off\nunless explicitly enabled or --yes is passed. Convex setup requires --init-convex\nwhen prompts are skipped; --yes does not opt into Convex account setup.\nNamed apps may repeat a framework.\n";
2
+ export declare const help = "create-convex-monorepo [project-name] [options]\n\nGenerate a pnpm + Turborepo workspace sharing one Convex backend.\n\nUse create <project-name> to explicitly create a project, including names such\nas add or doctor. Inside an existing workspace, running without arguments opens\nthe management menu. Commands: add app, add auth clerk, doctor, env sync,\nupgrade --check. No global or project installation is required.\n\n --apps <list> next,vite,tanstack-start,expo or web:next,admin:vite\n --example <name> messages (default) or none for blank apps\n --auth <provider> none (default) or clerk\n --package-manager <name> pnpm (v0.1)\n --install / --no-install Install generated dependencies\n --init-convex / --no-init-convex Set up Convex and link URLs (requires install)\n --git / --no-git Initialize a git repository\n --yes, -y Accept defaults, including installation and git\n --help, -h Show usage\n --version, -v Show version\n\nWithout a terminal, prompts are disabled. Installation and git default to off\nunless explicitly enabled or --yes is passed. Convex setup requires --init-convex\nwhen prompts are skipped; --yes does not opt into Convex account setup.\nNamed apps may repeat a framework.\n";
3
3
  export declare function parseCommand(args: string[]): {
4
4
  raw: RawOptions;
5
5
  help: boolean;
@@ -6,6 +6,11 @@ export const help = `create-convex-monorepo [project-name] [options]
6
6
 
7
7
  Generate a pnpm + Turborepo workspace sharing one Convex backend.
8
8
 
9
+ Use create <project-name> to explicitly create a project, including names such
10
+ as add or doctor. Inside an existing workspace, running without arguments opens
11
+ the management menu. Commands: add app, add auth clerk, doctor, env sync,
12
+ upgrade --check. No global or project installation is required.
13
+
9
14
  --apps <list> next,vite,tanstack-start,expo or web:next,admin:vite
10
15
  --example <name> messages (default) or none for blank apps
11
16
  --auth <provider> none (default) or clerk
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;CAmBnB,CAAC;AACF,MAAM,UAAU,YAAY,CAAC,IAAc;IAKzC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;QACxC,IAAI;QACJ,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACP,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACrC,aAAa,EAAE,EAAE,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AU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iCAAiC,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,kFAAkF,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,oFAAoF,CAAC,CAAC,CAAC,EAAE,EAAE,CAC7b,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function runEntry(args: string[], version: string, signal?: AbortSignal): Promise<void>;
@@ -0,0 +1,93 @@
1
+ import * as prompts from '@clack/prompts';
2
+ import { lstat } from 'node:fs/promises';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { isMissing, loadWorkspace } from '../workspace/project.js';
5
+ import { help, parseCommand, runCreate } from './create.js';
6
+ import { runWorkspace, workspaceHelp } from './workspace.js';
7
+ const managementCommands = new Set(['add', 'doctor', 'env', 'upgrade']);
8
+ const actions = [
9
+ { value: 'app', label: 'Add an application', args: ['add', 'app'] },
10
+ {
11
+ value: 'auth',
12
+ label: 'Add Clerk authentication',
13
+ args: ['add', 'auth', 'clerk'],
14
+ },
15
+ { value: 'doctor', label: 'Check workspace setup', args: ['doctor'] },
16
+ { value: 'env', label: 'Sync frontend Convex URLs', args: ['env', 'sync'] },
17
+ {
18
+ value: 'upgrade',
19
+ label: 'Check for CLI updates',
20
+ args: ['upgrade', '--check'],
21
+ },
22
+ ];
23
+ const managementHelp = workspaceHelp.replace('convex-monorepo <command>', 'npx create-convex-monorepo@latest <command>');
24
+ /** Absence is optional; malformed or unsafe metadata must still fail. */
25
+ async function existingWorkspace() {
26
+ let directory = resolve(process.cwd());
27
+ while (true) {
28
+ try {
29
+ await lstat(join(directory, 'convex-monorepo.json'));
30
+ return loadWorkspace(directory);
31
+ }
32
+ catch (error) {
33
+ if (!isMissing(error))
34
+ throw error;
35
+ }
36
+ const parent = dirname(directory);
37
+ if (parent === directory)
38
+ return null;
39
+ directory = parent;
40
+ }
41
+ }
42
+ export async function runEntry(args, version, signal) {
43
+ if (args[0] === 'create') {
44
+ await runCreate(args.slice(1), version, signal);
45
+ return;
46
+ }
47
+ if (args[0] && managementCommands.has(args[0])) {
48
+ await runWorkspace(args, version, signal);
49
+ return;
50
+ }
51
+ if (args[0] === 'help') {
52
+ // Let the existing parser reject extra arguments and unknown flags.
53
+ await runWorkspace(args, version, signal);
54
+ console.log(help);
55
+ return;
56
+ }
57
+ const parsed = parseCommand(args);
58
+ if (parsed.help) {
59
+ console.log(`${help}\n${managementHelp}`);
60
+ return;
61
+ }
62
+ if (parsed.version) {
63
+ console.log(version);
64
+ return;
65
+ }
66
+ signal?.throwIfAborted();
67
+ if (parsed.raw.name === undefined) {
68
+ const workspace = await existingWorkspace();
69
+ if (workspace) {
70
+ if (args.length)
71
+ throw new Error('An existing Convex monorepo was found. Choose a workspace command, or use create <project-name> to generate another project. Run npx create-convex-monorepo@latest --help.');
72
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
73
+ console.log(`Existing workspace: ${workspace.config.name}\n\n${managementHelp}`);
74
+ return;
75
+ }
76
+ signal?.throwIfAborted();
77
+ const action = await prompts.select({
78
+ message: `Manage ${workspace.config.name}: what would you like to do?`,
79
+ options: actions.map(({ value, label }) => ({ value, label })),
80
+ });
81
+ if (prompts.isCancel(action))
82
+ throw new Error('Workspace command cancelled.');
83
+ signal?.throwIfAborted();
84
+ const selected = actions.find(({ value }) => value === action);
85
+ if (!selected)
86
+ throw new Error('Unknown workspace action.');
87
+ await runWorkspace([...selected.args], version, signal);
88
+ return;
89
+ }
90
+ }
91
+ await runCreate(args, version, signal);
92
+ }
93
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/commands/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,E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,CAAC;YAC5D,MAAM,YAAY,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YACxD,OAAO;QACT,CAAC;IACH,CAAC;IACD,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { Example, Framework } from '../generator/types.js';
2
+ export declare const workspaceHelp = "convex-monorepo <command> [options]\n\nManage an existing Convex monorepo from its root or any subdirectory.\n\n add Choose an app or authentication interactively\n add app [name] Add an application\n --framework <name> next, vite, tanstack-start, or expo\n --example <name> none or messages (defaults to workspace example)\n add auth [clerk] Add Clerk authentication\n doctor [--json] Check workspace configuration and setup\n env sync [--app name] Copy public Convex URLs to frontend env files\n upgrade --check [--json] Check the latest stable generator version\n\nAdd options:\n --install / --no-install Install dependencies after applying changes\n --yes, -y Skip prompts and install unless --no-install\n\nAdd and env sync options:\n --dry-run Show planned paths without writing or installing\n\n --help, -h Show usage\n --version, -v Show CLI version\n\nWithout a terminal, add app requires a name and --framework. Installation\nis off unless --install or --yes is passed. Existing files are never forced.\n";
3
+ type CommandKind = 'help' | 'add' | 'add-app' | 'add-auth' | 'doctor' | 'env-sync' | 'upgrade';
4
+ export interface WorkspaceCommand {
5
+ command: CommandKind;
6
+ help: boolean;
7
+ version: boolean;
8
+ name?: string;
9
+ framework?: Framework;
10
+ example?: Example;
11
+ provider?: 'clerk';
12
+ app?: string;
13
+ install?: boolean;
14
+ yes: boolean;
15
+ dryRun: boolean;
16
+ json: boolean;
17
+ }
18
+ export declare function parseWorkspaceCommand(args: string[]): WorkspaceCommand;
19
+ export declare function runWorkspace(args: string[], version: string, signal?: AbortSignal): Promise<void>;
20
+ export {};