nuxt-convex-module 0.11.0 → 0.12.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.
@@ -32,16 +32,16 @@ export type CheckoutArgs = {
32
32
  /**
33
33
  * The subset of the Polar component's action references these components need —
34
34
  * a Vue port mirror of `@convex-dev/polar`'s `PolarComponentApi`
35
- * (`Pick<…, 'generateCheckoutLink' | 'generateCustomerPortalUrl'>`). Supplied
36
- * via the auto-provided `api.billing` namespace, or passed through `:polar-api`.
35
+ * (`Pick<…, 'generateCheckoutLink' | 'generateCustomerPortalUrl'>`), passed
36
+ * through `:polar-api` — usually the app's `api.billing`.
37
37
  *
38
38
  * @public
39
39
  */
40
40
  export interface PolarComponentApi {
41
- generateCheckoutLink?: FunctionReference<'action', 'public', CheckoutArgs, {
41
+ generateCheckoutLink: FunctionReference<'action', 'public', CheckoutArgs, {
42
42
  url: string;
43
43
  }>;
44
- generateCustomerPortalUrl?: FunctionReference<'action', 'public', {
44
+ generateCustomerPortalUrl: FunctionReference<'action', 'public', {
45
45
  returnUrl?: string;
46
46
  }, {
47
47
  url: string;
@@ -53,15 +53,15 @@ export interface PolarComponentApi {
53
53
  *
54
54
  * @example
55
55
  * ```vue
56
- * <CustomerPortalLink>Manage subscription</CustomerPortalLink>
56
+ * <CustomerPortalLink :polar-api="api.billing">Manage subscription</CustomerPortalLink>
57
57
  * ```
58
58
  *
59
59
  * @public
60
60
  */
61
61
  export declare const CustomerPortalLink: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
62
62
  polarApi: {
63
- type: PropType<PolarComponentApi>;
64
- default: undefined;
63
+ type: PropType<Pick<PolarComponentApi, "generateCustomerPortalUrl">>;
64
+ required: true;
65
65
  };
66
66
  returnUrl: {
67
67
  type: StringConstructor;
@@ -71,8 +71,8 @@ export declare const CustomerPortalLink: import("vue").DefineComponent<import("v
71
71
  [key: string]: any;
72
72
  }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
73
73
  polarApi: {
74
- type: PropType<PolarComponentApi>;
75
- default: undefined;
74
+ type: PropType<Pick<PolarComponentApi, "generateCustomerPortalUrl">>;
75
+ required: true;
76
76
  };
77
77
  returnUrl: {
78
78
  type: StringConstructor;
@@ -80,14 +80,13 @@ export declare const CustomerPortalLink: import("vue").DefineComponent<import("v
80
80
  };
81
81
  }>> & Readonly<{}>, {
82
82
  returnUrl: string;
83
- polarApi: PolarComponentApi;
84
83
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
85
84
  /**
86
85
  * Renders a checkout link. Supports embedded or redirect checkout, with optional lazy loading and trial configuration.
87
86
  *
88
87
  * @example
89
88
  * ```vue
90
- * <CheckoutLink :product-ids="[productId]" :trial-interval-count="7" trial-interval="day">
89
+ * <CheckoutLink :polar-api="api.billing" :product-ids="[productId]" :trial-interval-count="7" trial-interval="day">
91
90
  * Start free trial
92
91
  * </CheckoutLink>
93
92
  * ```
@@ -96,8 +95,8 @@ export declare const CustomerPortalLink: import("vue").DefineComponent<import("v
96
95
  */
97
96
  export declare const CheckoutLink: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
98
97
  polarApi: {
99
- type: PropType<PolarComponentApi>;
100
- default: undefined;
98
+ type: PropType<Pick<PolarComponentApi, "generateCheckoutLink">>;
99
+ required: true;
101
100
  };
102
101
  productIds: {
103
102
  type: PropType<string[]>;
@@ -139,8 +138,8 @@ export declare const CheckoutLink: import("vue").DefineComponent<import("vue").E
139
138
  [key: string]: any;
140
139
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
141
140
  polarApi: {
142
- type: PropType<PolarComponentApi>;
143
- default: undefined;
141
+ type: PropType<Pick<PolarComponentApi, "generateCheckoutLink">>;
142
+ required: true;
144
143
  };
145
144
  productIds: {
146
145
  type: PropType<string[]>;
@@ -186,6 +185,5 @@ export declare const CheckoutLink: import("vue").DefineComponent<import("vue").E
186
185
  trialInterval: "day" | "week" | "month" | "year" | null;
187
186
  trialIntervalCount: number | null;
188
187
  locale: string;
189
- polarApi: PolarComponentApi;
190
188
  theme: "dark" | "light";
191
189
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,19 +1,16 @@
1
1
  import { defineComponent, h, mergeProps, ref, watch } from "vue";
2
2
  import { useAction } from "../../vue/composables/use-action.js";
3
- import { useConvexNamespace } from "../../vue/provide.js";
4
3
  export const CustomerPortalLink = /* @__PURE__ */ defineComponent({
5
4
  name: "CustomerPortalLink",
6
5
  inheritAttrs: false,
7
6
  props: {
8
- // Optional in the port: defaults to the auto-provided `api.billing` namespace.
9
- polarApi: { type: Object, default: void 0 },
7
+ polarApi: { type: Object, required: true },
10
8
  returnUrl: { type: String, default: void 0 }
11
9
  },
12
10
  setup(props, { slots, attrs }) {
13
- const polarApi = props.polarApi ?? useConvexNamespace("billing");
14
- const generateCustomerPortalUrl = polarApi?.generateCustomerPortalUrl ? useAction(polarApi.generateCustomerPortalUrl) : void 0;
11
+ const generateCustomerPortalUrl = useAction(props.polarApi.generateCustomerPortalUrl);
15
12
  const portalUrl = ref();
16
- if (!import.meta.server && generateCustomerPortalUrl) {
13
+ if (!import.meta.server) {
17
14
  watch(
18
15
  () => props.returnUrl,
19
16
  (returnUrl) => {
@@ -38,8 +35,7 @@ export const CheckoutLink = /* @__PURE__ */ defineComponent({
38
35
  name: "CheckoutLink",
39
36
  inheritAttrs: false,
40
37
  props: {
41
- // Optional in the port: defaults to the auto-provided `api.billing` namespace.
42
- polarApi: { type: Object, default: void 0 },
38
+ polarApi: { type: Object, required: true },
43
39
  productIds: { type: Array, required: true },
44
40
  subscriptionId: { type: String, default: void 0 },
45
41
  metadata: { type: Object, default: void 0 },
@@ -51,11 +47,10 @@ export const CheckoutLink = /* @__PURE__ */ defineComponent({
51
47
  lazy: { type: Boolean, default: false }
52
48
  },
53
49
  setup(props, { slots, attrs }) {
54
- const polarApi = props.polarApi ?? useConvexNamespace("billing");
55
- const generateCheckoutLink = polarApi?.generateCheckoutLink ? useAction(polarApi.generateCheckoutLink) : void 0;
50
+ const generateCheckoutLink = useAction(props.polarApi.generateCheckoutLink);
56
51
  const checkoutLink = ref();
57
52
  const isLoading = ref(false);
58
- if (!import.meta.server && generateCheckoutLink) {
53
+ if (!import.meta.server) {
59
54
  watch(
60
55
  () => [props.lazy, props.productIds, props.subscriptionId, props.metadata, props.embed, props.trialInterval, props.trialIntervalCount, props.locale],
61
56
  async () => {
@@ -80,7 +75,7 @@ export const CheckoutLink = /* @__PURE__ */ defineComponent({
80
75
  { immediate: true }
81
76
  );
82
77
  }
83
- const handleClick = generateCheckoutLink ? async (e) => {
78
+ const handleClick = async (e) => {
84
79
  e.preventDefault();
85
80
  if (isLoading.value) return;
86
81
  isLoading.value = true;
@@ -104,7 +99,7 @@ export const CheckoutLink = /* @__PURE__ */ defineComponent({
104
99
  } finally {
105
100
  isLoading.value = false;
106
101
  }
107
- } : void 0;
102
+ };
108
103
  return () => h("a", mergeProps(attrs, {
109
104
  "href": checkoutLink.value ?? (props.lazy ? "#" : void 0),
110
105
  "onClick": props.lazy ? handleClick : void 0,
@@ -91,4 +91,3 @@ export { useUpload, useConvexUpload, uploadFile, type VueUpload, type UseUploadO
91
91
  export { useUploadQueue, useConvexUploadQueue, type VueUploadQueue, type UseUploadQueueOptions, type UploadQueueItem, type UploadItemStatus, type EnqueueInput, } from './composables/use-upload-queue.js';
92
92
  export { useStorageUrl, useConvexStorageUrl, type GetStorageUrl, } from './composables/use-storage-url.js';
93
93
  export { ConvexImage } from './components/convex-image.js';
94
- export { provideConvexApi, useConvexApi, useConvexNamespace, ConvexApiKey, type ConvexApi, } from './provide.js';
@@ -35,9 +35,3 @@ export {
35
35
  useConvexStorageUrl
36
36
  } from "./composables/use-storage-url.js";
37
37
  export { ConvexImage } from "./components/convex-image.js";
38
- export {
39
- provideConvexApi,
40
- useConvexApi,
41
- useConvexNamespace,
42
- ConvexApiKey
43
- } from "./provide.js";
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "nuxt-convex-module",
4
- "version": "0.11.0",
5
- "description": "Connects a Nuxt app to a Convex backend: live queries, mutations, actions, pagination, file storage and SSR, auto-imported and typed against your deployment. The same Vue client runs without Nuxt; Better Auth, Clerk, Auth0 and Polar are opt-in.",
4
+ "version": "0.12.1",
5
+ "description": "Convex backend integration with live queries, mutations, actions, pagination, file storage and SSR, auto-imported and typed against your deployment. The same Vue client runs without Nuxt; Better Auth, Clerk, Auth0 and Polar are opt-in.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/qruto/nuxt-convex-module.git"
@@ -151,19 +151,18 @@
151
151
  "node": ">=24.11.0"
152
152
  },
153
153
  "dependencies": {
154
- "@nuxt/kit": "^4.5.2",
155
- "h3": "^1.15.11",
154
+ "@nuxt/kit": "^4.6.2",
156
155
  "std-env": "^4.2.0"
157
156
  },
158
157
  "peerDependencies": {
159
- "@auth0/auth0-vue": ">=2.0.0",
160
- "@clerk/vue": ">=2.0.0",
158
+ "@auth0/auth0-vue": "^2.0.0",
159
+ "@clerk/vue": "^2.0.0",
161
160
  "@convex-dev/better-auth": ">=0.12.0 <0.13.0",
162
161
  "@convex-dev/polar": ">=0.9.0 <0.10.0",
163
- "@polar-sh/checkout": ">=0.4.0",
162
+ "@polar-sh/checkout": "^0.4.0",
164
163
  "better-auth": "~1.6.11",
165
164
  "convex": "^1.46.0",
166
- "nuxt-security": ">=2.6.0",
165
+ "nuxt-security": "^2.6.0",
167
166
  "vue": "^3.5.0"
168
167
  },
169
168
  "peerDependenciesMeta": {
@@ -192,44 +191,45 @@
192
191
  "devDependencies": {
193
192
  "@arethetypeswrong/cli": "^0.18.5",
194
193
  "@auth0/auth0-vue": "^2.11.0",
195
- "@clerk/vue": "2.5.10",
196
- "@commitlint/cli": "^21.2.3",
197
- "@commitlint/config-conventional": "^21.2.3",
194
+ "@clerk/vue": "2.5.13",
195
+ "@commitlint/cli": "^21.2.4",
196
+ "@commitlint/config-conventional": "^21.2.4",
198
197
  "@convex-dev/better-auth": "^0.12.5",
199
198
  "@convex-dev/polar": "^0.9.2",
200
- "@nuxt/devtools": "^3.4.2",
201
- "@nuxt/devtools-kit": "^3.4.2",
199
+ "@nuxt/devtools": "4.0.0-beta.7",
200
+ "@nuxt/devtools-kit": "4.0.0-beta.7",
202
201
  "@nuxt/eslint": "^1.17.0",
203
202
  "@nuxt/eslint-config": "^1.17.0",
204
203
  "@nuxt/module-builder": "^1.0.3",
205
- "@nuxt/schema": "^4.5.2",
206
- "@nuxt/test-utils": "^4.3.2",
207
- "@polar-sh/checkout": "^0.4.1",
208
- "@types/node": "^26.6.3",
204
+ "@nuxt/schema": "^4.6.2",
205
+ "@nuxt/test-utils": "^4.3.4",
206
+ "@polar-sh/checkout": "^0.4.3",
207
+ "@types/node": "^26.6.5",
209
208
  "@types/ws": "^8.18.2",
210
209
  "@unhead/vue": "^3.4.2",
211
- "@vitest/coverage-v8": "^5.0.3",
210
+ "@vitejs/devtools-kit": "^0.8.0",
211
+ "@vitest/coverage-v8": "^5.0.5",
212
212
  "@vue/test-utils": "^2.5.1",
213
213
  "better-auth": "~1.6.33",
214
214
  "changelogen": "^0.6.2",
215
- "convex": "^1.46.0",
216
- "eslint": "^10.11.0",
217
- "fallow": "3.31.0",
218
- "happy-dom": "^20.14.5",
215
+ "convex": "^1.48.0",
216
+ "eslint": "^10.13.0",
217
+ "fallow": "3.34.1",
218
+ "happy-dom": "^21.0.4",
219
219
  "installed-check": "^11.0.0",
220
- "nuxt": "^4.5.2",
220
+ "nuxt": "^4.6.2",
221
221
  "nuxt-security": "^2.6.0",
222
- "pkg-pr-new": "^0.0.90",
223
- "playwright-core": "^1.63.0",
224
- "portless": "0.15.7",
222
+ "pkg-pr-new": "^0.0.91",
223
+ "playwright-core": "^1.64.1",
224
+ "portless": "0.15.8",
225
225
  "publint": "^0.3.24",
226
226
  "taze": "^21.3.0",
227
227
  "typedoc": "^0.28.20",
228
- "typedoc-plugin-frontmatter": "^1.3.2",
229
- "typedoc-plugin-markdown": "^4.13.1",
228
+ "typedoc-plugin-frontmatter": "^1.3.3",
229
+ "typedoc-plugin-markdown": "^4.14.1",
230
230
  "typescript": "~6.0.3",
231
- "vitest": "^5.0.3",
232
- "vue-tsc": "^3.3.11",
231
+ "vitest": "^5.0.5",
232
+ "vue-tsc": "^3.3.13",
233
233
  "ws": "^8.22.0"
234
234
  },
235
235
  "publishConfig": {
@@ -276,6 +276,7 @@
276
276
  "check:manifest": "installed-check -d --no-workspaces",
277
277
  "check:tarball": "node scripts/check-tarball.mjs",
278
278
  "check:rulesets": "node scripts/check-rulesets.mjs",
279
+ "parity:diff": "node scripts/parity-diff.mjs",
279
280
  "check:consumer-types": "node scripts/check-consumer-types.mjs"
280
281
  }
281
282
  }