nuxt-convex-module 0.0.1 → 0.9.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 (73) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +40 -200
  3. package/dist/chunks/index.mjs +1 -1
  4. package/dist/devtools-client/200.html +1 -1
  5. package/dist/devtools-client/404.html +1 -1
  6. package/dist/devtools-client/_nuxt/{CgIEvOQU.js → 71bSMC-_.js} +1 -1
  7. package/dist/devtools-client/_nuxt/{C2KGYsR4.js → BhmjAr2Q.js} +1 -1
  8. package/dist/devtools-client/_nuxt/{D2ksFYuU.js → C6YdTgGl.js} +2 -2
  9. package/dist/devtools-client/_nuxt/{CtxksWnu.js → _Lf3mfPR.js} +1 -1
  10. package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
  11. package/dist/devtools-client/_nuxt/builds/meta/f9d540d6-1746-4214-8384-31e7759da89f.json +1 -0
  12. package/dist/devtools-client/_nuxt/error-404.CLlwiMp-.css +1 -0
  13. package/dist/devtools-client/_nuxt/error-500.Bxr6fpDU.css +1 -0
  14. package/dist/devtools-client/_nuxt/queries.DNBUjWk2.css +1 -0
  15. package/dist/devtools-client/auth/index.html +1 -1
  16. package/dist/devtools-client/index.html +1 -1
  17. package/dist/devtools-client/logs/index.html +1 -1
  18. package/dist/devtools-client/queries/index.html +1 -1
  19. package/dist/module.d.mts +29 -105
  20. package/dist/module.json +2 -2
  21. package/dist/module.mjs +329 -221
  22. package/dist/runtime/auth0/vue/index.d.ts +3 -3
  23. package/dist/runtime/better-auth/nuxt/middleware.d.ts +0 -6
  24. package/dist/runtime/better-auth/nuxt/middleware.js +4 -5
  25. package/dist/runtime/better-auth/nuxt/proxy.d.ts +18 -2
  26. package/dist/runtime/better-auth/nuxt/proxy.js +7 -7
  27. package/dist/runtime/better-auth/nuxt/server.d.ts +6 -6
  28. package/dist/runtime/better-auth/vue/auth-boundary.d.ts +1 -0
  29. package/dist/runtime/better-auth/vue/cross-domain.js +7 -2
  30. package/dist/runtime/better-auth/vue/hydration.d.ts +1 -1
  31. package/dist/runtime/better-auth/vue/index.d.ts +1 -1
  32. package/dist/runtime/better-auth/vue/index.js +1 -1
  33. package/dist/runtime/better-auth/vue/plugin.client.d.ts +1 -5
  34. package/dist/runtime/better-auth/vue/plugin.client.js +6 -10
  35. package/dist/runtime/better-auth/vue/plugin.server.d.ts +5 -16
  36. package/dist/runtime/better-auth/vue/plugin.server.js +3 -6
  37. package/dist/runtime/better-auth/vue/redirect.d.ts +2 -14
  38. package/dist/runtime/better-auth/vue/{use-auth.d.ts → use-better-auth.d.ts} +31 -11
  39. package/dist/runtime/better-auth/vue/{use-auth.js → use-better-auth.js} +2 -2
  40. package/dist/runtime/clerk/vue/index.d.ts +4 -4
  41. package/dist/runtime/nuxt/app.d.ts +48 -0
  42. package/dist/runtime/nuxt/app.js +8 -0
  43. package/dist/runtime/nuxt/composables/use-async-paginated-query.d.ts +88 -0
  44. package/dist/runtime/nuxt/composables/use-async-paginated-query.js +90 -0
  45. package/dist/runtime/nuxt/composables/use-async-query.d.ts +7 -16
  46. package/dist/runtime/nuxt/composables/use-async-query.js +14 -9
  47. package/dist/runtime/nuxt/config.d.ts +11 -0
  48. package/dist/runtime/nuxt/config.js +1 -0
  49. package/dist/runtime/nuxt/index.d.ts +2 -5
  50. package/dist/runtime/polar/vue/components.d.ts +8 -1
  51. package/dist/runtime/polar/vue/components.js +2 -2
  52. package/dist/runtime/vue/auth/index.d.ts +4 -4
  53. package/dist/runtime/vue/client.d.ts +5 -57
  54. package/dist/runtime/vue/client.js +2 -0
  55. package/dist/runtime/vue/components/convex-image.d.ts +50 -0
  56. package/dist/runtime/vue/components/convex-image.js +21 -0
  57. package/dist/runtime/vue/composables/use-connection-state.d.ts +1 -0
  58. package/dist/runtime/vue/composables/use-paginated-query.d.ts +5 -1
  59. package/dist/runtime/vue/composables/use-paginated-query.js +2 -2
  60. package/dist/runtime/vue/composables/use-query.d.ts +2 -0
  61. package/dist/runtime/vue/composables/use-subscription.d.ts +1 -15
  62. package/dist/runtime/vue/composables/use-upload-queue.d.ts +2 -3
  63. package/dist/runtime/vue/hydration.d.ts +3 -24
  64. package/dist/runtime/vue/index.d.ts +2 -2
  65. package/dist/runtime/vue/index.js +1 -0
  66. package/dist/runtime/vue/plugin.js +1 -1
  67. package/dist/runtime/vue/provide.d.ts +5 -5
  68. package/dist/types.d.mts +2 -2
  69. package/package.json +52 -16
  70. package/dist/devtools-client/_nuxt/builds/meta/23303226-2230-4d14-87ce-87b0f562de6c.json +0 -1
  71. package/dist/devtools-client/_nuxt/error-404.BpRUKU69.css +0 -1
  72. package/dist/devtools-client/_nuxt/error-500.DuDYJ5TI.css +0 -1
  73. package/dist/devtools-client/_nuxt/queries.BmISPDaV.css +0 -1
package/dist/module.d.mts CHANGED
@@ -38,6 +38,13 @@ interface BetterAuthModuleOptions {
38
38
  */
39
39
  loginPath?: string;
40
40
  }
41
+ /**
42
+ * Options for the `convex` key in `nuxt.config`. Every key is optional: the
43
+ * URLs default to the environment, and each integration auto-enables from
44
+ * your `package.json`.
45
+ *
46
+ * @public
47
+ */
41
48
  interface ModuleOptions {
42
49
  /**
43
50
  * Convex deployment URL. Defaults to `NUXT_PUBLIC_CONVEX_URL`, then to the
@@ -50,30 +57,31 @@ interface ModuleOptions {
50
57
  */
51
58
  siteUrl?: string;
52
59
  /**
53
- * Better Auth integration. Auto-enabled when `@convex-dev/better-auth` is
54
- * installed; set `false` to force it off, `true` to require it, or a
60
+ * Better Auth integration. Auto-enabled when `@convex-dev/better-auth` is a
61
+ * dependency of your app; set `false` to force it off, `true` to require it
62
+ * (a package a layer or workspace root provides counts then), or a
55
63
  * {@link BetterAuthModuleOptions} object to point at a custom auth client.
56
64
  */
57
65
  betterAuth?: boolean | BetterAuthModuleOptions;
58
66
  /**
59
- * Polar billing components. Auto-enabled when `@convex-dev/polar` is
60
- * installed; set `false` to force it off (or `true` to require it).
67
+ * Polar billing components. Auto-enabled when `@convex-dev/polar` is a
68
+ * dependency of your app; set `false` to force it off (or `true` to require it).
61
69
  */
62
70
  polar?: boolean;
63
71
  /**
64
72
  * Clerk auth adapter (`provideConvexAuthFromClerk` / `<ConvexProviderWithClerk>`).
65
- * Auto-enabled when `@clerk/vue` is installed; set `false` to force it off.
73
+ * Auto-enabled when `@clerk/vue` is a dependency of your app; set `false` to force it off.
66
74
  */
67
75
  clerk?: boolean;
68
76
  /**
69
77
  * Auth0 auth adapter (`provideConvexAuthFromAuth0` / `<ConvexProviderWithAuth0>`).
70
- * Auto-enabled when `@auth0/auth0-vue` is installed; set `false` to force it off.
78
+ * Auto-enabled when `@auth0/auth0-vue` is a dependency of your app; set `false` to force it off.
71
79
  */
72
80
  auth0?: boolean;
73
81
  /**
74
82
  * Convex-aware security headers through [`nuxt-security`](https://nuxt-security.vercel.app).
75
- * Auto-enabled when `nuxt-security` is installed — the module registers it
76
- * as a module dependency (no `modules` entry needed) and extends its
83
+ * Auto-enabled when `nuxt-security` is a dependency of your app (or listed in
84
+ * `modules`) — the module registers it as a module dependency and extends its
77
85
  * Content Security Policy with your deployment's origins at runtime. Set
78
86
  * `false` to leave nuxt-security's CSP alone, or `true` to require the
79
87
  * package. Disabling nuxt-security itself (`security: false` in
@@ -88,6 +96,17 @@ interface ModuleOptions {
88
96
  * Nuxt DevTools is; set `false` to disable just the Convex tab.
89
97
  */
90
98
  devtools?: boolean;
99
+ /**
100
+ * Run Convex beside Nuxt with one command. On the first `nuxt dev` (or
101
+ * `nuxt prepare`) in an app whose `dev` script is still the plain
102
+ * `nuxt dev`, the module rewrites it to `convex dev --start 'nuxt dev'`:
103
+ * the Convex CLI starts the dev deployment, starts Nuxt next to it, and
104
+ * hands it `CONVEX_URL` / `CONVEX_SITE_URL` in the environment — no `.env`
105
+ * needed for local development. A `dev` script you have already changed,
106
+ * or one that runs `convex dev` somewhere, is left alone. Set `false` to
107
+ * never touch `package.json`.
108
+ */
109
+ devScript?: boolean;
91
110
  }
92
111
  declare module '@nuxt/schema' {
93
112
  interface RuntimeConfig {
@@ -106,100 +125,5 @@ declare module '@nuxt/schema' {
106
125
  }
107
126
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
108
127
 
109
- /**
110
- * Which opt-in integrations ended up enabled — returned by
111
- * {@link registerIntegrations} for the dev startup summary (and the DevTools
112
- * panel, which reports the active adapter).
113
- */
114
- interface IntegrationFlags {
115
- betterAuth: boolean;
116
- clerk: boolean;
117
- auth0: boolean;
118
- polar: boolean;
119
- /** nuxt-security registered and its CSP extended with the Convex origins. */
120
- security: boolean;
121
- }
122
- /**
123
- * Decide whether an opt-in integration is enabled, distinguishing the
124
- * misconfiguration case: explicitly enabled but the backing package is not
125
- * installed (`missingPackage`), where silently registering the runtime would
126
- * surface as an opaque Vite import error instead of an actionable message.
127
- * Auto-detection (option unset) treats package absence as the normal case.
128
- */
129
- declare function resolveIntegrationState(explicit: boolean | object | undefined, installed: boolean): {
130
- enabled: boolean;
131
- missingPackage: boolean;
132
- };
133
- /** Result of {@link validateModuleOptions}: findings plus normalized values. */
134
- interface ModuleOptionDiagnostics {
135
- errors: string[];
136
- warnings: string[];
137
- /** `authRoute` with a leading slash ensured and any trailing slash stripped. */
138
- authRoute: string;
139
- }
140
- /**
141
- * Validate the resolved module configuration, turning silent misconfiguration
142
- * (swapped `.convex.cloud`/`.convex.site` URLs, malformed URLs, an `authRoute`
143
- * that would produce a broken server-handler route, a `betterAuth.authClient`
144
- * path that doesn't exist) into actionable messages. Pure — the caller logs
145
- * the findings and applies the normalized `authRoute`. Exported for tests.
146
- */
147
- declare function validateModuleOptions(input: {
148
- url: string;
149
- siteUrl: string;
150
- authRoute: string;
151
- authClient?: string;
152
- rootDir: string;
153
- }): ModuleOptionDiagnostics;
154
- /**
155
- * The dev-mode one-line startup summary: resolved deployment URL, functions
156
- * directory, and which opt-in integrations are active.
157
- */
158
- declare function formatStartupSummary(url: string, functionsDir: string, integrations: IntegrationFlags): string;
159
- /**
160
- * Resolve the deployment and site URLs from module options, then environment.
161
- *
162
- * The `NUXT_PUBLIC_*` names come first: they are the Nuxt-shaped ones, and the
163
- * only ones Nitro will also apply as a runtime override on a built app. The
164
- * unprefixed names are read after them because that is what `npx convex dev`
165
- * writes — the Convex CLI picks its variable name per framework and has no Nuxt
166
- * case, so it falls back to `CONVEX_URL`. Reading both means someone who has
167
- * only ever run the CLI needs no `convex.url` in `nuxt.config` at all.
168
- *
169
- * Exported for tests.
170
- */
171
- declare function resolveDeploymentUrls(options: Pick<ModuleOptions, 'url' | 'siteUrl'>, env: Record<string, string | undefined>): {
172
- url: string;
173
- siteUrl: string;
174
- };
175
- /**
176
- * Build the ordered import-alias map for the Convex functions folder and its
177
- * generated modules, so user code and server routes can `import from
178
- * '#convex/...'` without spelling out `_generated`.
179
- *
180
- * - `#convex/api` -> _generated/api (`api`, `internal`, `components`)
181
- * - `#convex/server` -> _generated/server (`query`, `mutation`, `action`, `*Ctx`, ...)
182
- * - `#convex/dataModel` -> _generated/dataModel (`DataModel`, `Doc`, `Id`, `TableNames`)
183
- * - `#convex/_generated` -> _generated (long form, covers every generated file)
184
- * - `#convex` -> <rootDir>/<functionsDir>
185
- *
186
- * Order is significant: both Vite and Nitro resolve aliases with
187
- * `@rollup/plugin-alias`, which is first-match-wins and treats `#convex` as a
188
- * prefix of `#convex/api`. The specific generated-module aliases must come
189
- * before the catch-all `#convex`, otherwise `#convex/api` would resolve to
190
- * `<functionsDir>/api` instead of `<functionsDir>/_generated/api` (and would
191
- * shadow any user function file literally named `api.ts` / `server.ts`).
192
- */
193
- declare function getConvexAliases(rootDir: string): Record<string, string>;
194
- /**
195
- * Contents of the fallback type template: placeholder (`any`-typed) ambient
196
- * declarations for the generated `#convex/*` modules while `convex dev`
197
- * hasn't emitted codegen yet, so a fresh project typechecks instead of failing
198
- * on every `#convex/api` import. Once codegen exists the template goes empty
199
- * and the real generated types win via the tsconfig `paths` the aliases
200
- * already produce.
201
- */
202
- declare function convexTypeFallbackContents(hasApi: boolean, functionsDir: string): string;
203
-
204
- export { convexTypeFallbackContents, _default as default, formatStartupSummary, getConvexAliases, resolveDeploymentUrls, resolveIntegrationState, validateModuleOptions };
205
- export type { BetterAuthModuleOptions, IntegrationFlags, ModuleOptionDiagnostics, ModuleOptions };
128
+ export { _default as default };
129
+ export type { BetterAuthModuleOptions, ModuleOptions };
package/dist/module.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "nuxt-convex-module",
3
3
  "configKey": "convex",
4
- "docs": "https://github.com/qruto/nuxt-convex-module#readme",
4
+ "docs": "https://nuxt-convex-module.dev",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.1.0"
7
7
  },
8
- "version": "0.0.1",
8
+ "version": "0.9.1",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.3",
11
11
  "unbuild": "unknown"