mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-10 00:12:22 +08:00
Format file outputs in postinstall of addon-test
This commit is contained in:
parent
d099241c48
commit
a6be1e6bfa
@ -6,6 +6,7 @@ import { traverse } from 'storybook/internal/babel';
|
|||||||
import {
|
import {
|
||||||
JsPackageManagerFactory,
|
JsPackageManagerFactory,
|
||||||
extractProperFrameworkName,
|
extractProperFrameworkName,
|
||||||
|
formatFileContent,
|
||||||
loadAllPresets,
|
loadAllPresets,
|
||||||
loadMainConfig,
|
loadMainConfig,
|
||||||
serverResolve,
|
serverResolve,
|
||||||
@ -461,7 +462,9 @@ export default async function postInstall(options: PostinstallOptions) {
|
|||||||
|
|
||||||
await writeFile(
|
await writeFile(
|
||||||
browserWorkspaceFile,
|
browserWorkspaceFile,
|
||||||
dedent`
|
await formatFileContent(
|
||||||
|
browserWorkspaceFile,
|
||||||
|
dedent`
|
||||||
import { defineWorkspace } from 'vitest/config';
|
import { defineWorkspace } from 'vitest/config';
|
||||||
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport}
|
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport}
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
@ -489,6 +492,7 @@ export default async function postInstall(options: PostinstallOptions) {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
`.replace(/\s+extends: '',/, '')
|
`.replace(/\s+extends: '',/, '')
|
||||||
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// If there's no existing Vitest/Vite config, we create a new Vitest config file.
|
// If there's no existing Vitest/Vite config, we create a new Vitest config file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user