@floatingpixels/supabase-nuxt 0.3.1 → 0.3.2
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.
package/dist/module.d.mts
CHANGED
|
@@ -6,7 +6,6 @@ declare module '@nuxt/schema' {
|
|
|
6
6
|
supabase: {
|
|
7
7
|
url: string;
|
|
8
8
|
anonKey: string;
|
|
9
|
-
serviceRoleKey: string;
|
|
10
9
|
redirect: boolean;
|
|
11
10
|
redirectOptions: RedirectOptions;
|
|
12
11
|
clientOptions: SupabaseClientOptions<string>;
|
|
@@ -30,23 +29,20 @@ interface RedirectOptions {
|
|
|
30
29
|
interface ModuleOptions {
|
|
31
30
|
/**
|
|
32
31
|
* Supabase API URL
|
|
33
|
-
* @default process.env.SUPABASE_URL
|
|
34
32
|
* @example 'https://*.supabase.co'
|
|
35
33
|
* @type string
|
|
36
34
|
* @docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
37
35
|
*/
|
|
38
|
-
url
|
|
36
|
+
url?: string;
|
|
39
37
|
/**
|
|
40
38
|
* Supabase Client API Key
|
|
41
|
-
* @default process.env.SUPABASE_KEY
|
|
42
39
|
* @example '123456789'
|
|
43
40
|
* @type string
|
|
44
41
|
* @docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
45
42
|
*/
|
|
46
|
-
anonKey
|
|
43
|
+
anonKey?: string;
|
|
47
44
|
/**
|
|
48
45
|
* Supabase Service key
|
|
49
|
-
* @default process.env.SUPABASE_SERVICE_KEY
|
|
50
46
|
* @example '123456789'
|
|
51
47
|
* @type string
|
|
52
48
|
* @docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
@@ -78,7 +74,7 @@ interface ModuleOptions {
|
|
|
78
74
|
},
|
|
79
75
|
}
|
|
80
76
|
* @type object
|
|
81
|
-
|
|
77
|
+
*@docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
82
78
|
*/
|
|
83
79
|
clientOptions?: SupabaseClientOptions<string>;
|
|
84
80
|
}
|
package/dist/module.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ declare module '@nuxt/schema' {
|
|
|
6
6
|
supabase: {
|
|
7
7
|
url: string;
|
|
8
8
|
anonKey: string;
|
|
9
|
-
serviceRoleKey: string;
|
|
10
9
|
redirect: boolean;
|
|
11
10
|
redirectOptions: RedirectOptions;
|
|
12
11
|
clientOptions: SupabaseClientOptions<string>;
|
|
@@ -30,23 +29,20 @@ interface RedirectOptions {
|
|
|
30
29
|
interface ModuleOptions {
|
|
31
30
|
/**
|
|
32
31
|
* Supabase API URL
|
|
33
|
-
* @default process.env.SUPABASE_URL
|
|
34
32
|
* @example 'https://*.supabase.co'
|
|
35
33
|
* @type string
|
|
36
34
|
* @docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
37
35
|
*/
|
|
38
|
-
url
|
|
36
|
+
url?: string;
|
|
39
37
|
/**
|
|
40
38
|
* Supabase Client API Key
|
|
41
|
-
* @default process.env.SUPABASE_KEY
|
|
42
39
|
* @example '123456789'
|
|
43
40
|
* @type string
|
|
44
41
|
* @docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
45
42
|
*/
|
|
46
|
-
anonKey
|
|
43
|
+
anonKey?: string;
|
|
47
44
|
/**
|
|
48
45
|
* Supabase Service key
|
|
49
|
-
* @default process.env.SUPABASE_SERVICE_KEY
|
|
50
46
|
* @example '123456789'
|
|
51
47
|
* @type string
|
|
52
48
|
* @docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
@@ -78,7 +74,7 @@ interface ModuleOptions {
|
|
|
78
74
|
},
|
|
79
75
|
}
|
|
80
76
|
* @type object
|
|
81
|
-
|
|
77
|
+
*@docs https://supabase.com/docs/reference/javascript/initializing#parameters
|
|
82
78
|
*/
|
|
83
79
|
clientOptions?: SupabaseClientOptions<string>;
|
|
84
80
|
}
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addServerHandler, addPlugin, addTypeTemplate, extendViteConfig } from '@nuxt/kit';
|
|
2
|
-
import { defu } from 'defu';
|
|
3
2
|
|
|
4
3
|
const module = defineNuxtModule({
|
|
5
4
|
meta: {
|
|
@@ -9,11 +8,10 @@ const module = defineNuxtModule({
|
|
|
9
8
|
nuxt: ">3.0.0"
|
|
10
9
|
}
|
|
11
10
|
},
|
|
12
|
-
// Default configuration options of the Nuxt module
|
|
13
11
|
defaults: {
|
|
14
|
-
url:
|
|
15
|
-
anonKey:
|
|
16
|
-
serviceRoleKey:
|
|
12
|
+
url: void 0,
|
|
13
|
+
anonKey: void 0,
|
|
14
|
+
serviceRoleKey: void 0,
|
|
17
15
|
redirect: false,
|
|
18
16
|
redirectOptions: {
|
|
19
17
|
login: "/login",
|
|
@@ -30,22 +28,22 @@ const module = defineNuxtModule({
|
|
|
30
28
|
},
|
|
31
29
|
setup(options, nuxt) {
|
|
32
30
|
const { resolve } = createResolver(import.meta.url);
|
|
33
|
-
if (!options.url) {
|
|
34
|
-
console.warn("Missing `
|
|
31
|
+
if (!process.env.NUXT_PUBLIC_SUPABASE_URL && !options.url) {
|
|
32
|
+
console.warn("Missing `NUXT_PUBLIC_SUPABASE_URL` in environment or `url` in module options");
|
|
35
33
|
}
|
|
36
|
-
if (!options.anonKey) {
|
|
37
|
-
console.warn("Missing `
|
|
34
|
+
if (!process.env.NUXT_PUBLIC_SUPABASE_ANON_KEY && !options.anonKey) {
|
|
35
|
+
console.warn("Missing `NUXT_PUBLIC_SUPABASE_ANON_KEY` in environment or `anonKey` in module options");
|
|
38
36
|
}
|
|
39
|
-
nuxt.options.runtimeConfig.public.supabase =
|
|
37
|
+
nuxt.options.runtimeConfig.public.supabase = {
|
|
40
38
|
url: options.url,
|
|
41
39
|
anonKey: options.anonKey,
|
|
42
40
|
redirect: options.redirect,
|
|
43
41
|
redirectOptions: options.redirectOptions,
|
|
44
42
|
clientOptions: options.clientOptions
|
|
45
|
-
}
|
|
46
|
-
nuxt.options.runtimeConfig.supabase =
|
|
43
|
+
};
|
|
44
|
+
nuxt.options.runtimeConfig.supabase = {
|
|
47
45
|
serviceRoleKey: options.serviceRoleKey
|
|
48
|
-
}
|
|
46
|
+
};
|
|
49
47
|
addServerHandler({
|
|
50
48
|
route: "/supabase/auth/confirm",
|
|
51
49
|
handler: resolve("./runtime/server/auth/confirm"),
|
|
@@ -67,9 +65,11 @@ const module = defineNuxtModule({
|
|
|
67
65
|
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
68
66
|
nitroConfig.alias = nitroConfig.alias || {};
|
|
69
67
|
nitroConfig.alias["#supabase/server"] = resolve("./runtime/server/services");
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
if (!nitroConfig.externals)
|
|
69
|
+
nitroConfig.externals = {};
|
|
70
|
+
if (!nitroConfig.externals.inline)
|
|
71
|
+
nitroConfig.externals.inline = [];
|
|
72
|
+
nitroConfig.externals.inline?.push(resolve("./runtime"));
|
|
73
73
|
});
|
|
74
74
|
addTypeTemplate({
|
|
75
75
|
filename: "types/supabase.d.ts",
|
|
@@ -85,7 +85,8 @@ const module = defineNuxtModule({
|
|
|
85
85
|
options2.references.push({ path: resolve(nuxt.options.buildDir, "types/supabase.d.ts") });
|
|
86
86
|
});
|
|
87
87
|
extendViteConfig((config) => {
|
|
88
|
-
config.optimizeDeps =
|
|
88
|
+
config.optimizeDeps = {
|
|
89
|
+
...typeof config.optimizeDeps === "object" ? config.optimizeDeps : {},
|
|
89
90
|
include: [
|
|
90
91
|
"@supabase/functions-js",
|
|
91
92
|
"@supabase/auth-js",
|
|
@@ -95,7 +96,7 @@ const module = defineNuxtModule({
|
|
|
95
96
|
"@supabase/supabase-js",
|
|
96
97
|
"@supabase/ssr"
|
|
97
98
|
]
|
|
98
|
-
}
|
|
99
|
+
};
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
});
|
|
@@ -9,7 +9,7 @@ export const supabaseServiceRole = async (event) => {
|
|
|
9
9
|
}
|
|
10
10
|
} = useRuntimeConfig();
|
|
11
11
|
if (!serviceRoleKey) {
|
|
12
|
-
throw new Error("Missing `
|
|
12
|
+
throw new Error("Missing `SUPABASE_SERVICE_ROLE_KEY` in `.env`");
|
|
13
13
|
}
|
|
14
14
|
let supabaseClient = event.context._supabaseServiceRole;
|
|
15
15
|
if (!supabaseClient) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floatingpixels/supabase-nuxt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Supabase module for Nuxt",
|
|
5
5
|
"repository": "floatingpixels/supabase-nuxt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test": "nuxi prepare playground && pnpm vitest",
|
|
44
44
|
"test:watch": "vitest watch",
|
|
45
45
|
"test:pw": "playwright test test/playwright/",
|
|
46
|
-
"test:e2e": "pnpm run --silent db:start && pnpm run --silent db:
|
|
46
|
+
"test:e2e": "pnpm run --silent db:start && pnpm run --silent db:reset && pnpm run --silent test:pw && pnpm run --silent db:stop",
|
|
47
47
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
48
48
|
"supa": "./node_modules/supabase/bin/supabase",
|
|
49
49
|
"db:fullreset": "pnpm run --silent db:reset && pnpm run --silent db:types && pnpm run --silent db:sync && pnpm run --silent db:seed",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"db:reset": "pnpm run --silent supa db reset",
|
|
56
56
|
"db:seed": "npx tsx seed.ts",
|
|
57
57
|
"db:sync": "npx @snaplet/seed sync",
|
|
58
|
-
"db:fullseed": "(npx @snaplet/seed sync) -and (npx tsx seed.ts)"
|
|
58
|
+
"db:fullseed": "(npx @snaplet/seed sync) -and (npx tsx seed.ts)",
|
|
59
|
+
"db:dump": "pg_dump -a -h localhost -U postgres -p 54322 -f ./supabase/seed.sql --schema=public --schema=auth --inserts"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"@supabase/ssr": "^0.5.2",
|
|
62
|
-
"@supabase/supabase-js": "^2.47.12"
|
|
63
|
-
"defu": "^6.1.4"
|
|
63
|
+
"@supabase/supabase-js": "^2.47.12"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@nuxt/devtools": "^1.7.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@nuxt/kit": "^3.15.1",
|
|
69
69
|
"@nuxt/module-builder": "^0.8.4",
|
|
70
70
|
"@nuxt/schema": "^3.15.1",
|
|
71
|
-
"@nuxt/test-utils": "3.15.
|
|
71
|
+
"@nuxt/test-utils": "3.15.4",
|
|
72
72
|
"@playwright/test": "^1.49.1",
|
|
73
73
|
"@snaplet/copycat": "^5.1.1",
|
|
74
74
|
"@snaplet/seed": "^0.98.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@vitest/coverage-v8": "2.1.8",
|
|
78
78
|
"@vue/test-utils": "^2.4.6",
|
|
79
79
|
"changelogen": "^0.5.7",
|
|
80
|
-
"eslint": "^9.
|
|
80
|
+
"eslint": "^9.18.0",
|
|
81
81
|
"eslint-config-prettier": "^9.1.0",
|
|
82
82
|
"happy-dom": "^16.5.3",
|
|
83
83
|
"nuxt": "^3.15.1",
|