Skip to content

Commit

Permalink
chore: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed May 12, 2024
1 parent 2c625d7 commit c62e6b7
Show file tree
Hide file tree
Showing 49 changed files with 527 additions and 477 deletions.
21 changes: 5 additions & 16 deletions packages/storybook-nuxt/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,17 @@
"esModuleInterop": true,
"isolatedModules": true,
"strictBindCallApply": true,
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"noUnusedLocals": true,

"strict": true
},
"exclude": [
"dist",
"**/dist",
"node_modules",
"**/node_modules"
],
"exclude": ["dist", "**/dist", "node_modules", "**/node_modules"],
"ts-node": {
"transpileOnly": true,
"files": true,
"compilerOptions": {
"types": [
"node"
]
"types": ["node"]
}
}
}
}
2 changes: 0 additions & 2 deletions packages/storybook-nuxt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Changelog


## v0.2.6

[compare changes](https://github.com/storybook-vue/storybook-nuxt/compare/v0.2.6-alpha.0...v0.2.6)
Expand Down Expand Up @@ -44,4 +43,3 @@
## v0.1.3

[compare changes](https://github.com/storybook-vue/storybook-nuxt/compare/v0.1.3-alpha.0...v0.1.3)

18 changes: 3 additions & 15 deletions packages/storybook-nuxt/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Storybook for Nuxt framework <!-- omit in toc -->


![sb-nuxt (2)](https://github.com/storybook-vue/nuxt/assets/711292/6cd06c77-1b6e-4a45-9666-a97d091a27c0)


Storybook package for [**Nuxt framework**](https://nuxt.com/) with zero configs. seamless integration supporting all Nuxt fancy features


Storybook package for [**Nuxt framework**](https://nuxt.com/) with zero configs. seamless integration supporting all Nuxt fancy features

https://github.com/storybook-vue/nuxt/assets/711292/e66a1899-ab7c-42dd-b358-59e22ff0f609



## Supported Features

👉 [Nuxt Modules](#nuxts-image-component)
Expand All @@ -38,20 +32,17 @@ https://github.com/storybook-vue/nuxt/assets/711292/e66a1899-ab7c-42dd-b358-59e2

👉 [Nuxt DevTools](https://devtools.nuxtjs.org/) : finally as Bonus, Nuxt DevTools works amazingly with your Storybook, full features


https://github.com/storybook-vue/nuxt/assets/711292/63cc1fb3-ec6b-4df2-ad61-d87e5692f385



## Requirements

- [Nuxt](https://nuxt.com/) >= 3.x
- [Storybook](https://storybook.js.org/) >= 7.x

## Demo
## Demo

Checkout the demo repo [storybook7-nuxt3-demo](https://github.com/storybook-vue/storybook-nuxt-demo)
or try it on [Stackblitz](https://stackblitz.com/~/github.com/storybook-vue/storybook-nuxt-demo)
or try it on [Stackblitz](https://stackblitz.com/~/github.com/storybook-vue/storybook-nuxt-demo)

## Getting Started

Expand All @@ -69,8 +60,6 @@ npx storybook-nuxt init

When running the `upgrade` command above, you should get a prompt asking you to migrate to `@storybook-vue/nuxt`, which should handle everything for you. In case auto-migration does not work for your project, refer to the manual migration below.



Update your `main.js` to change the framework property:

```js
Expand Down Expand Up @@ -99,4 +88,3 @@ This repository is licensed under the [MIT License](LICENSE). Feel free to use t
💬 Discord: ChakAs3

🐦‍⬛ Twitter: [@ChakirQatab](https://twitter.com/ChakirQatab)

6 changes: 4 additions & 2 deletions packages/storybook-nuxt/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ export default defineBuildConfig({
{ input: 'src/preview' },
{ input: 'src/preset', outDir: 'dist/', format: 'cjs', ext: 'js' },
{
input: 'src/runtime/', outDir: 'dist/runtime', format: 'esm', ext: 'js',
input: 'src/runtime/',
outDir: 'dist/runtime',
format: 'esm',
ext: 'js',
},

],

rollup: {
Expand Down
25 changes: 12 additions & 13 deletions packages/storybook-nuxt/playground/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import type { StorybookConfig } from "@storybook-vue/nuxt";

import type { StorybookConfig } from '@storybook-vue/nuxt'

const config: StorybookConfig = {
stories: [
"../stories/**/*.mdx",
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
'../stories/**/*.mdx',
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: "@storybook-vue/nuxt",
options: {
docgen :"vue-component-meta"
name: '@storybook-vue/nuxt',
options: {
docgen: 'vue-component-meta',
},
},
docs: {
autodocs: "tag",
autodocs: 'tag',
},
};
export default config;
}
export default config
9 changes: 4 additions & 5 deletions packages/storybook-nuxt/playground/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { type Preview } from "@storybook/vue3";
import { type Preview } from '@storybook/vue3'

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},

};
}
console.log('.storybook Preview =============')
export default preview;
export default preview
2 changes: 1 addition & 1 deletion packages/storybook-nuxt/playground/app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<h1> My Nuxt App</h1>
<h1>My Nuxt App</h1>
<MyNuxtPage />
</div>
</template>
44 changes: 23 additions & 21 deletions packages/storybook-nuxt/playground/components/MyButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@ import { computed } from 'vue'
type Sizes = 'small' | 'medium' | 'large' | 'xlarge'
const props = withDefaults(defineProps<{
/**
* The label of the button
*/
label?: string
/**
* primary or secondary button
*/
primary?: boolean
/**
* size of the button
*/
size?: Sizes
/**
* background color of the button
*/
backgroundColor?: string
union?: string | number | boolean
}>(), { primary: false })
const props = withDefaults(
defineProps<{
/**
* The label of the button
*/
label?: string
/**
* primary or secondary button
*/
primary?: boolean
/**
* size of the button
*/
size?: Sizes
/**
* background color of the button
*/
backgroundColor?: string
union?: string | number | boolean
}>(),
{ primary: false },
)
const emit = defineEmits<{
(e: 'click', id: number): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { config } = useMyComposable()
</script>

<template>
<h1> Using composables : </h1>
<h1>Using composables :</h1>
<h5>runtime config :</h5>
<pre>{{ JSON.stringify(config, null, 2) }}</pre>
</template>
6 changes: 2 additions & 4 deletions packages/storybook-nuxt/playground/components/MyNuxtImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
height="200"
class="rounded"
/>
<br>
<h4>
responsive image with nuxt-image component:
</h4>
<br />
<h4>responsive image with nuxt-image component:</h4>
<NuxtPicture
src="/images/sb-nuxt-logo.jpg"
width="1204"
Expand Down
28 changes: 13 additions & 15 deletions packages/storybook-nuxt/playground/components/MyNuxtPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,30 @@ const route = useRoute()
</script>

<template>
<div class="overflow-visible" style="height: 56px;display: flex;gap: 10px;">
<div class="overflow-visible" style="height: 56px; display: flex; gap: 10px">
<my-button @click="router.push(`/`)">
<NuxtLink to="/" class="n-link-base">
Home
</NuxtLink>
<NuxtLink to="/" class="n-link-base"> Home </NuxtLink>
</my-button>
<my-button @click="router.push(`/about`)">
<NuxtLink to="/about" class="n-link-base">
About
</NuxtLink>
<NuxtLink to="/about" class="n-link-base"> About </NuxtLink>
</my-button>

<my-button @click="router.push(`/parent`)">
<NuxtLink to="/parent" class="n-link-base">
Parent (index)
</NuxtLink>
<NuxtLink to="/parent" class="n-link-base"> Parent (index) </NuxtLink>
</my-button>
<my-button>
<NuxtLink to="/parent/b" class="n-link-base">
Parent (b)
</NuxtLink>
<NuxtLink to="/parent/b" class="n-link-base"> Parent (b) </NuxtLink>
</my-button>
<my-button class="n-link-base" @click="router.push(`/parent/reload-${(Math.random() * 100).toFixed()}`)">
<my-button
class="n-link-base"
@click="router.push(`/parent/reload-${(Math.random() * 100).toFixed()}`)"
>
Keyed child
</my-button>
<my-button class="n-link-base" @click="router.push(`/parent/static-${(Math.random() * 100).toFixed()}`)">
<my-button
class="n-link-base"
@click="router.push(`/parent/static-${(Math.random() * 100).toFixed()}`)"
>
Non-keyed child
</my-button>
</div>
Expand Down
33 changes: 17 additions & 16 deletions packages/storybook-nuxt/playground/components/PinButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ import { computed } from 'vue'
type Sizes = 'small' | 'medium' | 'large' | 'xlarge'
const props = withDefaults(defineProps<{
primary?: boolean
/**
* size of the button
*/
size?: Sizes
/**
* background color of the button
*/
backgroundColor?: string
dataTestid?: string
}>(), { primary: false })
const props = withDefaults(
defineProps<{
primary?: boolean
/**
* size of the button
*/
size?: Sizes
/**
* background color of the button
*/
backgroundColor?: string
dataTestid?: string
}>(),
{ primary: false },
)
const emit = defineEmits<{
(e: 'click', id: number): void
Expand All @@ -41,7 +42,7 @@ function onClick() {
</script>

<template>
<div class="storybook storybook-button">
<div class="storybook storybook-button">
<MyButton label="" class="classes" :style="style" @click="onClick">
<slot />
</MyButton>
Expand Down
Loading

0 comments on commit c62e6b7

Please sign in to comment.