docs: note about Storybook

This commit is contained in:
Acid Chicken (硫酸鶏)
2023-03-24 23:22:49 +09:00
parent c2d8759812
commit bd7cc6ac38
6 changed files with 90 additions and 47 deletions

View File

@@ -1,7 +1,6 @@
import { resolve } from 'node:path';
import type { StorybookConfig } from '@storybook/vue3-vite';
import { mergeConfig } from 'vite';
import { getConfig } from '../vite.config';
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
@@ -22,18 +21,9 @@ const config = {
disableTelemetry: true,
},
async viteFinal(config, options) {
const { plugins, build: { rollupOptions, ...build }, ...original } = getConfig();
console.dir(config, {depth:Infinity});
console.dir(original, {depth:Infinity});
const x = mergeConfig(config, {
...original,
build,
return mergeConfig(config, {
assetsInclude: [resolve(__dirname, '../node_modules/@tabler/icons-webfont/**/*.{css,eot,ttf,woff,woff2}')],
server: {
hmr: false,
},
});
return x;
},
} satisfies StorybookConfig;
export default config;

View File

@@ -0,0 +1,2 @@
import MkCaptcha from './MkCaptcha.vue';
void MkCaptcha;

View File

@@ -1,34 +1,10 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkCaptcha from './MkCaptcha.vue';
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/MkCaptcha',
component: MkCaptcha,
} satisfies Meta<typeof MkCaptcha>;
export const Default = {
render(args) {
return {
components: {
MkCaptcha,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkCaptcha v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkCaptcha>;
export default meta;
import MkCaptcha from './MkCaptcha.vue';
void MkCaptcha;

View File

@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
/* eslint-disable import/no-duplicates */
import { StoryObj } from '@storybook/vue3';
import MkAvatar from './MkAvatar.vue';

View File

@@ -7,7 +7,6 @@ const meta = {
} satisfies Meta<typeof MkAvatar>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
/* eslint-disable import/no-duplicates */
import { StoryObj } from '@storybook/vue3';
import MkAvatar from './MkAvatar.vue';
@@ -68,13 +67,6 @@ export const ProfilePageCat = {
user: {
...ProfilePage.args.user,
isCat: true,
// avatarUrl: 'https://millionlive-theaterdays.idolmaster-official.jp/assets/data/webp/common/footer/icon_app.png.webp',
// avatarUrl: 'https://cdn.imastodon.net/accounts/avatars/000/144/021/original/8137afa4114ab85f.png',
// avatarUrl: 'https://avatars.githubusercontent.com/u/4439005?v=4',
// avatarUrl: 'https://avatars.githubusercontent.com/u/7973572?v=4',
// avatarUrl: 'https://avatars.githubusercontent.com/u/6533808?v=4',
// avatarUrl: 'https://avatars.githubusercontent.com/u/7106976?v=4',
avatarUrl: 'https://avatars.githubusercontent.com/u/3396686?v=4',
},
},
};