mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 08:01:20 +08:00
24 lines
706 B
TypeScript
24 lines
706 B
TypeScript
import { isAbsolute, join } from 'node:path';
|
|
|
|
import { checkAddonOrder, serverRequire } from 'storybook/internal/common';
|
|
|
|
export const checkActionsLoaded = (configDir: string) => {
|
|
checkAddonOrder({
|
|
before: {
|
|
name: '@storybook/addon-actions',
|
|
inEssentials: true,
|
|
},
|
|
after: {
|
|
name: '@storybook/addon-interactions',
|
|
inEssentials: false,
|
|
},
|
|
configFile: isAbsolute(configDir)
|
|
? join(configDir, 'main')
|
|
: join(process.cwd(), configDir, 'main'),
|
|
getConfig: (configFile) => serverRequire(configFile),
|
|
});
|
|
};
|
|
|
|
// This annotation is read by addon-test, so it can throw an error if both addons are used
|
|
export const ADDON_INTERACTIONS_IN_USE = true;
|