@vue-storefront/nuxt 6.2.0 → 7.0.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/README.md +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/plugin.template +18 -9
- package/dist/runtime/useSdk.template +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
package/dist/module.json
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { initSDK } from "@vue-storefront/sdk"
|
|
2
|
-
import sdkConfig from "~/sdk.config"
|
|
3
|
-
import {
|
|
1
|
+
import { initSDK, type SDKApi } from "@vue-storefront/sdk";
|
|
2
|
+
import sdkConfig from "~/sdk.config";
|
|
3
|
+
import type { SdkConfig } from "./sdk.config";
|
|
4
|
+
import { defineNuxtPlugin } from '#app';
|
|
4
5
|
|
|
5
6
|
export default defineNuxtPlugin(() => {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
let sdk: SDKApi<ReturnType<SdkConfig>>;
|
|
8
|
+
|
|
9
|
+
const getSdk = () => {
|
|
10
|
+
if (!sdk) {
|
|
11
|
+
const config = sdkConfig();
|
|
12
|
+
sdk = initSDK(config);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return sdk;
|
|
16
|
+
};
|
|
8
17
|
|
|
9
18
|
return {
|
|
10
19
|
provide: {
|
|
11
|
-
alokai: {
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
})
|
|
20
|
+
alokai: { getSdk },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -4,7 +4,7 @@ import { useNuxtApp } from "#imports";
|
|
|
4
4
|
|
|
5
5
|
export const useSdk = () => {
|
|
6
6
|
const nuxtApp = useNuxtApp();
|
|
7
|
-
const {
|
|
7
|
+
const { getSdk } = nuxtApp.$alokai as { getSdk: ()=> SDKApi<ReturnType<SdkConfig>> };
|
|
8
8
|
|
|
9
|
-
return
|
|
9
|
+
return getSdk();
|
|
10
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-storefront/nuxt",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Alokai dedicated features for Nuxt",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"build": "nuxt-module-build build",
|
|
21
21
|
"lint": "biome ci .",
|
|
22
22
|
"format": "prettier --write .",
|
|
23
|
-
"prepare": "nuxi prepare"
|
|
23
|
+
"prepare": "nuxi prepare",
|
|
24
|
+
"version": "cp CHANGELOG.md ../../docs/content/storefront/6.change-log/nuxt.md"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@nuxt/kit": "^3.7.4",
|