@croct/plug-nuxt 0.2.0 → 0.3.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.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -68,8 +68,7 @@ const module = defineNuxtModule({
|
|
|
68
68
|
getContents: () => clientOptionsCode
|
|
69
69
|
});
|
|
70
70
|
nuxt.options.alias["#croct/client-options"] = join(nuxt.options.buildDir, "croct/client-options");
|
|
71
|
-
addPlugin(resolver.resolve("./runtime/plugin
|
|
72
|
-
addPlugin(resolver.resolve("./runtime/plugin.client"));
|
|
71
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
73
72
|
addServerHandler({
|
|
74
73
|
handler: resolver.resolve("./runtime/server/middleware/croct"),
|
|
75
74
|
middleware: true
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { createCroct } from "@croct/plug-vue";
|
|
2
|
-
import { defineNuxtPlugin, useRuntimeConfig, useState } from "#app";
|
|
2
|
+
import { defineNuxtPlugin, useRuntimeConfig, useRequestEvent, useState } from "#app";
|
|
3
3
|
import { urlSanitizer } from "#croct/client-options";
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
const config = useRuntimeConfig().public.croct;
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const appId = useState("croct:app-id", () => {
|
|
7
|
+
const event = useRequestEvent();
|
|
8
|
+
return event?.context.croctCredentials?.appId ?? config.appId;
|
|
9
|
+
});
|
|
8
10
|
const plugin = createCroct({
|
|
9
|
-
appId,
|
|
11
|
+
appId: appId.value !== void 0 && appId.value !== "" ? appId.value : config.appId,
|
|
10
12
|
disableCidMirroring: true,
|
|
11
13
|
...config.debug === true ? { debug: true } : {},
|
|
12
14
|
...config.test === true ? { test: true } : {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@croct/plug-nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Nuxt module to plug your Nuxt 3 applications into Croct.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Croct",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"nuxt": "^3.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@croct/plug": "^0.
|
|
60
|
-
"@croct/plug-vue": "^0.
|
|
59
|
+
"@croct/plug": "^0.24.0",
|
|
60
|
+
"@croct/plug-vue": "^0.2.0",
|
|
61
61
|
"@croct/sdk": "^0.22.0",
|
|
62
62
|
"@nuxt/kit": "^3.17.5"
|
|
63
63
|
},
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useRuntimeConfig, useRequestEvent, useState } from "#app";
|
|
2
|
-
export default defineNuxtPlugin(() => {
|
|
3
|
-
const event = useRequestEvent();
|
|
4
|
-
const fallback = useRuntimeConfig().public.croct.appId;
|
|
5
|
-
useState("croct:app-id", () => event?.context.croctCredentials?.appId ?? fallback);
|
|
6
|
-
});
|
|
File without changes
|