@scalar/nuxt 0.0.15 → 0.0.16

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
@@ -1,7 +1,14 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { ReferenceConfiguration } from '@scalar/api-reference';
3
3
 
4
- type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate'>;
4
+ type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate'> & {
5
+ /**
6
+ * Whether to show scalar in Nuxt DevTools
7
+ *
8
+ * @default true
9
+ */
10
+ devtools: boolean;
11
+ };
5
12
 
6
13
  type ModuleOptions = Configuration;
7
14
  declare const _default: _nuxt_schema.NuxtModule<Configuration>;
package/dist/module.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { ReferenceConfiguration } from '@scalar/api-reference';
3
3
 
4
- type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate'>;
4
+ type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onSpecUpdate'> & {
5
+ /**
6
+ * Whether to show scalar in Nuxt DevTools
7
+ *
8
+ * @default true
9
+ */
10
+ devtools: boolean;
11
+ };
5
12
 
6
13
  type ModuleOptions = Configuration;
7
14
  declare const _default: _nuxt_schema.NuxtModule<Configuration>;
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@scalar/nuxt",
3
3
  "configKey": "scalar",
4
- "version": "0.0.15"
4
+ "version": "0.0.16"
5
5
  }
package/dist/module.mjs CHANGED
@@ -14,7 +14,8 @@ const module = defineNuxtModule({
14
14
  pathRouting: {
15
15
  basePath: "/docs"
16
16
  },
17
- showSidebar: true
17
+ showSidebar: true,
18
+ devtools: true
18
19
  },
19
20
  setup(_options, _nuxt) {
20
21
  const resolver = createResolver(import.meta.url);
@@ -48,6 +49,20 @@ const module = defineNuxtModule({
48
49
  file: resolver.resolve("./runtime/pages/ScalarPage.vue")
49
50
  });
50
51
  });
52
+ if (_nuxt.options.dev && _options.devtools) {
53
+ _nuxt.hook("devtools:customTabs", (tabs) => {
54
+ tabs.push({
55
+ name: "scalar",
56
+ title: "Scalar",
57
+ icon: "https://gist.githubusercontent.com/cameronrohani/0fa020f6dcf957266bff49e7b6b7c05e/raw/17fce1ef37bbb036dca36b778c8b422056ad6fdf/scalar-logo-nuxt-color.svg",
58
+ category: "server",
59
+ view: {
60
+ type: "iframe",
61
+ src: _options.pathRouting.basePath
62
+ }
63
+ });
64
+ });
65
+ }
51
66
  addPlugin(resolver.resolve("./runtime/plugins/hydrateClient"));
52
67
  }
53
68
  });
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "testing",
16
16
  "vue"
17
17
  ],
18
- "version": "0.0.15",
18
+ "version": "0.0.16",
19
19
  "engines": {
20
20
  "node": ">=18"
21
21
  },