@storyblok/nuxt 4.0.1 → 4.1.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 +5 -5
- package/dist/module.d.ts +6 -1
- package/dist/module.mjs +6 -1
- package/package.json +3 -3
- package/src/module.js +6 -1
package/README.md
CHANGED
|
@@ -46,13 +46,13 @@ npm install @storyblok/nuxt
|
|
|
46
46
|
# yarn add @storyblok/nuxt
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Add following code to
|
|
49
|
+
Add following code to modules section of `nuxt.config.js` and replace the accessToken with API token from Storyblok space.
|
|
50
50
|
|
|
51
51
|
```js
|
|
52
52
|
import { defineNuxtConfig } from "nuxt";
|
|
53
53
|
|
|
54
54
|
export default defineNuxtConfig({
|
|
55
|
-
|
|
55
|
+
modules: [
|
|
56
56
|
["@storyblok/nuxt", { accessToken: "<your-access-token>" }]
|
|
57
57
|
// ...
|
|
58
58
|
]
|
|
@@ -65,7 +65,7 @@ You can also use the `storyblok` config if you prefer:
|
|
|
65
65
|
import { defineNuxtConfig } from "nuxt";
|
|
66
66
|
|
|
67
67
|
export default defineNuxtConfig({
|
|
68
|
-
|
|
68
|
+
modules: ["@storyblok/nuxt"],
|
|
69
69
|
storyblok: {
|
|
70
70
|
accessToken: "<your-access-token>"
|
|
71
71
|
}
|
|
@@ -102,7 +102,7 @@ To link your Vue components to their equivalent you created in Storyblok:
|
|
|
102
102
|
<div v-editable="blok" / >
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
- Finally, use `<StoryblokComponent>` which available globally in the Nuxt app:
|
|
105
|
+
- Finally, use `<StoryblokComponent>` which is available globally in the Nuxt app:
|
|
106
106
|
|
|
107
107
|
```html
|
|
108
108
|
<StoryblokComponent :blok="blok" />
|
|
@@ -114,7 +114,7 @@ To link your Vue components to their equivalent you created in Storyblok:
|
|
|
114
114
|
|
|
115
115
|
#### Composition API
|
|
116
116
|
|
|
117
|
-
The simplest way is by using the `useStoryblok` one-liner composable (it's autoimported):
|
|
117
|
+
The simplest way is by using the `useStoryblok` one-liner composable (it's autoimported) and passing as a first parameter a name of your content page from Storyblok (in this case, our content page name is `vue`, by default you get a content page named `home`):
|
|
118
118
|
|
|
119
119
|
```html
|
|
120
120
|
<script setup>
|
package/dist/module.d.ts
CHANGED
|
@@ -29,7 +29,12 @@ var module = defineNuxtModule({
|
|
|
29
29
|
nuxt.options.build.transpile.push(runtimeDir);
|
|
30
30
|
nuxt.options.runtimeConfig.public.storyblok = options;
|
|
31
31
|
addPlugin(resolve(__dirname, "runtime", `./plugin`));
|
|
32
|
-
const names = [
|
|
32
|
+
const names = [
|
|
33
|
+
"useStoryblok",
|
|
34
|
+
"useStoryblokApi",
|
|
35
|
+
"useStoryblokBridge",
|
|
36
|
+
"renderRichText"
|
|
37
|
+
];
|
|
33
38
|
names.forEach((name) => addAutoImport({ name, as: name, from: "@storyblok/vue" }));
|
|
34
39
|
}
|
|
35
40
|
});
|
package/dist/module.mjs
CHANGED
|
@@ -29,7 +29,12 @@ const module = defineNuxtModule({
|
|
|
29
29
|
nuxt.options.build.transpile.push(runtimeDir);
|
|
30
30
|
nuxt.options.runtimeConfig.public.storyblok = options;
|
|
31
31
|
addPlugin(resolve(__dirname, "runtime", `./plugin`));
|
|
32
|
-
const names = [
|
|
32
|
+
const names = [
|
|
33
|
+
"useStoryblok",
|
|
34
|
+
"useStoryblokApi",
|
|
35
|
+
"useStoryblokBridge",
|
|
36
|
+
"renderRichText"
|
|
37
|
+
];
|
|
33
38
|
names.forEach((name) => addAutoImport({ name, as: name, from: "@storyblok/vue" }));
|
|
34
39
|
}
|
|
35
40
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/nuxt",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Storyblok Nuxt.js module",
|
|
5
5
|
"main": "./src/module.js",
|
|
6
6
|
"module": "./src/module.js",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nuxt/kit": "^3.0.0-rc.2",
|
|
31
|
-
"@storyblok/vue": "^6.0
|
|
31
|
+
"@storyblok/vue": "^6.2.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/core": "^7.15.0",
|
|
35
35
|
"@nuxt/module-builder": "latest",
|
|
36
|
-
"babel-jest": "^
|
|
36
|
+
"babel-jest": "^28.1.3",
|
|
37
37
|
"cypress": "^8.3.0",
|
|
38
38
|
"eslint-plugin-cypress": "^2.12.1",
|
|
39
39
|
"jest": "^26.6.3",
|
package/src/module.js
CHANGED
|
@@ -36,7 +36,12 @@ export default defineNuxtModule({
|
|
|
36
36
|
addPlugin(resolve(__dirname, "runtime", `./plugin`));
|
|
37
37
|
|
|
38
38
|
// Autoimports
|
|
39
|
-
const names = [
|
|
39
|
+
const names = [
|
|
40
|
+
"useStoryblok",
|
|
41
|
+
"useStoryblokApi",
|
|
42
|
+
"useStoryblokBridge",
|
|
43
|
+
"renderRichText"
|
|
44
|
+
];
|
|
40
45
|
names.forEach((name) =>
|
|
41
46
|
addAutoImport({ name, as: name, from: "@storyblok/vue" })
|
|
42
47
|
);
|