mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:31:49 +08:00
Vue3: Move docs preset to framework
This commit is contained in:
parent
3a21143172
commit
e6f379d8c5
@ -49,6 +49,7 @@
|
|||||||
"@storybook/core": "6.5.0-alpha.47",
|
"@storybook/core": "6.5.0-alpha.47",
|
||||||
"@storybook/core-common": "6.5.0-alpha.47",
|
"@storybook/core-common": "6.5.0-alpha.47",
|
||||||
"@storybook/csf": "0.0.2--canary.87bc651.0",
|
"@storybook/csf": "0.0.2--canary.87bc651.0",
|
||||||
|
"@storybook/docs-tools": "6.5.0-alpha.47",
|
||||||
"@storybook/store": "6.5.0-alpha.47",
|
"@storybook/store": "6.5.0-alpha.47",
|
||||||
"@types/node": "^14.14.20 || ^16.0.0",
|
"@types/node": "^14.14.20 || ^16.0.0",
|
||||||
"@types/webpack-env": "^1.16.0",
|
"@types/webpack-env": "^1.16.0",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
import { extractComponentDescription, enhanceArgTypes } from '@storybook/docs-tools';
|
||||||
import { extractArgTypes } from './extractArgTypes';
|
import { extractArgTypes } from './extractArgTypes';
|
||||||
import { extractComponentDescription } from '../../lib/docgen';
|
|
||||||
import { prepareForInline } from './prepareForInline';
|
import { prepareForInline } from './prepareForInline';
|
||||||
|
|
||||||
export const parameters = {
|
export const parameters = {
|
||||||
@ -10,3 +10,5 @@ export const parameters = {
|
|||||||
extractComponentDescription,
|
extractComponentDescription,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const argTypesEnhancers = [enhanceArgTypes];
|
@ -1,7 +1,6 @@
|
|||||||
import type { StrictArgTypes } from '@storybook/csf';
|
import type { StrictArgTypes } from '@storybook/csf';
|
||||||
import { hasDocgen, extractComponentProps } from '../../lib/docgen';
|
import type { ArgTypesExtractor } from '@storybook/docs-tools';
|
||||||
import type { ArgTypesExtractor } from '../../lib/docgen';
|
import { hasDocgen, extractComponentProps, convert } from '@storybook/docs-tools';
|
||||||
import { convert } from '../../lib/convert';
|
|
||||||
|
|
||||||
const SECTIONS = ['props', 'events', 'slots'];
|
const SECTIONS = ['props', 'events', 'slots'];
|
||||||
|
|
@ -1,8 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import * as Vue from 'vue';
|
import * as Vue from 'vue';
|
||||||
import { app } from '@storybook/vue3';
|
import { StoryContext, PartialStoryFn } from '@storybook/csf';
|
||||||
import type { StoryContext, PartialStoryFn } from '@storybook/csf';
|
import { app, VueFramework } from '../index';
|
||||||
import type { VueFramework } from '@storybook/vue3';
|
|
||||||
|
|
||||||
// This is cast as `any` to workaround type errors caused by Vue 2 types
|
// This is cast as `any` to workaround type errors caused by Vue 2 types
|
||||||
const { render, h } = Vue as any;
|
const { render, h } = Vue as any;
|
@ -1,4 +1,4 @@
|
|||||||
import type { Options } from '@storybook/core-common';
|
import { findDistEsm, Options, StorybookConfig } from '@storybook/core-common';
|
||||||
|
|
||||||
export function webpackFinal(webpackConfig: any = {}, options: Options) {
|
export function webpackFinal(webpackConfig: any = {}, options: Options) {
|
||||||
let vueDocgenOptions = {};
|
let vueDocgenOptions = {};
|
||||||
@ -26,3 +26,7 @@ export function webpackFinal(webpackConfig: any = {}, options: Options) {
|
|||||||
});
|
});
|
||||||
return webpackConfig;
|
return webpackConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const config: StorybookConfig['config'] = (entry = []) => {
|
||||||
|
return [...entry, findDistEsm(__dirname, 'client/docs/config')];
|
||||||
|
};
|
@ -4,5 +4,8 @@ import type { LoadOptions } from '@storybook/core-common';
|
|||||||
export default {
|
export default {
|
||||||
packageJson: sync({ cwd: __dirname }).packageJson,
|
packageJson: sync({ cwd: __dirname }).packageJson,
|
||||||
framework: 'vue3',
|
framework: 'vue3',
|
||||||
frameworkPresets: [require.resolve('./framework-preset-vue3')],
|
frameworkPresets: [
|
||||||
|
require.resolve('./framework-preset-vue3'),
|
||||||
|
require.resolve('./framework-preset-vue3-docs'),
|
||||||
|
],
|
||||||
} as LoadOptions;
|
} as LoadOptions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user