@storyblok/nuxt 5.2.0 → 5.3.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.
package/README.md CHANGED
@@ -206,9 +206,9 @@ You can also set a **custom Schema and component resolver** by passing the optio
206
206
 
207
207
  ### 3. Working with preview and/or production environments
208
208
 
209
- Remember that the bridge only works using `version: { 'draft' }` and the _Preview Access Token_.
209
+ Remember that the bridge only works using `version: 'draft'` and the _Preview Access Token_.
210
210
 
211
- For the production site, NOT used as a preview for content editors, `version: { 'published' }` and _Public Access Token_ should be used.
211
+ For the production site, NOT used as a preview for content editors, `version: 'published'` and _Public Access Token_ should be used.
212
212
 
213
213
  > If you're using production as a preview for marketeers and your public site, you will need a plugin to handle different .env variables, or versions using the _Preview Access Token_, checking if you are inside Storyblok or not. For example, something like `if (window.location.search.includes(_storyblok_tk[token]=<YOUR_TOKEN>)`.
214
214
 
package/dist/module.d.ts CHANGED
@@ -1,38 +1,11 @@
1
- import { defineNuxtModule, createResolver, addComponentsDir, addPlugin, addImports, addImportsDir } from '@nuxt/kit';
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
- var module = defineNuxtModule({
4
- meta: {
5
- name: "@storyblok/nuxt",
6
- configKey: "storyblok"
7
- },
8
- defaults: {
9
- usePlugin: true
10
- },
11
- setup(options, nuxt) {
12
- const resolver = createResolver(import.meta.url);
13
- nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
14
- nuxt.options.vite.optimizeDeps.include.push("@storyblok/nuxt");
15
- nuxt.options.vite.optimizeDeps.include.push("@storyblok/vue");
16
- addComponentsDir({ path: "~/storyblok", global: true, pathPrefix: false });
17
- nuxt.options.build.transpile.push(resolver.resolve("./runtime"));
18
- nuxt.options.build.transpile.push("@storyblok/nuxt");
19
- nuxt.options.build.transpile.push("@storyblok/vue");
20
- nuxt.options.runtimeConfig.public.storyblok = options;
21
- if (options.usePlugin !== false) {
22
- addPlugin(resolver.resolve("./runtime/plugin"));
23
- }
24
- const names = [
25
- "useStoryblok",
26
- "useStoryblokApi",
27
- "useStoryblokBridge",
28
- "renderRichText",
29
- "RichTextSchema"
30
- ];
31
- for (const name of names) {
32
- addImports({ name, as: name, from: "@storyblok/vue" });
33
- }
34
- addImportsDir(resolver.resolve("./runtime/composables"));
35
- }
36
- });
3
+ interface ModuleOptions {
4
+ accessToken: string;
5
+ usePlugin: boolean;
6
+ bridge: boolean;
7
+ apiOptions: any;
8
+ }
9
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
37
10
 
38
- export { module as default };
11
+ export { ModuleOptions, _default as default };
package/dist/module.mjs CHANGED
@@ -6,7 +6,10 @@ const module = defineNuxtModule({
6
6
  configKey: "storyblok"
7
7
  },
8
8
  defaults: {
9
- usePlugin: true
9
+ accessToken: "",
10
+ usePlugin: true,
11
+ bridge: true,
12
+ apiOptions: {}
10
13
  },
11
14
  setup(options, nuxt) {
12
15
  const resolver = createResolver(import.meta.url);
@@ -1,2 +1,2 @@
1
- declare var _default: any;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -1,6 +1,5 @@
1
1
  import { StoryblokVue, apiPlugin } from "@storyblok/vue";
2
2
  import { defineNuxtPlugin, useRuntimeConfig } from "#app";
3
-
4
3
  export default defineNuxtPlugin(({ vueApp }) => {
5
4
  let { storyblok } = useRuntimeConfig();
6
5
  storyblok = JSON.parse(JSON.stringify(storyblok));
package/dist/types.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
- import { } from './module'
2
+ import { ModuleOptions } from './module'
3
3
 
4
+ declare module '@nuxt/schema' {
5
+ interface NuxtConfig { ['storyblok']?: Partial<ModuleOptions> }
6
+ interface NuxtOptions { ['storyblok']?: ModuleOptions }
7
+ }
4
8
 
5
9
 
6
10
  export { default } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/nuxt",
3
- "version": "5.2.0",
3
+ "version": "5.3.1",
4
4
  "description": "Storyblok Nuxt module",
5
5
  "type": "module",
6
6
  "exports": {
@@ -27,18 +27,19 @@
27
27
  "test:e2e-watch": "start-server-and-test playground:run http://localhost:3000 cy:open"
28
28
  },
29
29
  "dependencies": {
30
- "@storyblok/vue": "^7.0.0",
31
- "@nuxt/kit": "^3.0.0"
30
+ "@nuxt/kit": "^3.2.3",
31
+ "@storyblok/vue": "^7.1.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@babel/core": "^7.15.0",
34
+ "@babel/core": "^7.21.0",
35
+ "@cypress/vite-dev-server": "^5.0.4",
35
36
  "@nuxt/module-builder": "latest",
36
- "babel-jest": "^28.1.3",
37
- "cypress": "^8.3.0",
37
+ "babel-jest": "^29.4.3",
38
+ "cypress": "^12.8.1",
38
39
  "eslint-plugin-cypress": "^2.12.1",
39
- "jest": "^29.3.1",
40
- "start-server-and-test": "^1.14.0",
41
- "vite": "^2.9.14"
40
+ "jest": "^29.4.3",
41
+ "start-server-and-test": "^2.0.0",
42
+ "vite": "^4.2.1"
42
43
  },
43
44
  "release": {
44
45
  "branches": [