Skip to content

Commit

Permalink
Rename @storybook/themes to @storybook/addon-themes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Mar 7, 2024
1 parent a712a94 commit cbea302
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('[@storybook/addon-themes] CODEMOD: Emotion configuration', () => {
"import type { StorybookConfig } from \\"@storybook/react-vite\\";
const config: StorybookConfig = {
stories: [\\"../stories/**/*.stories.@(js|jsx|ts|tsx)\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/themes\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/addon-themes\\"],
framework: {
name: \\"@storybook/react-vite\\",
options: {},
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('[@storybook/addon-themes] CODEMOD: Emotion configuration', () => {
"import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/themes'],
addons: ['@storybook/addon-essentials', '@storybook/addon-themes'],
framework: {
name: '@storybook/react-webpack5',
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export const emotionStrategy: AddonThemesConfigurationStrategy = {
};

const hasThemesAddon = mainConfig.getFieldValue(['addons']).some((addon: string | { name: string }) => {
if (typeof addon === 'string') return addon === '@storybook/themes';
return addon.name === '@storybook/themes';
if (typeof addon === 'string') return addon === '@storybook/addon-themes';
return addon.name === '@storybook/addon-themes';
});

if (!hasThemesAddon) {
mainConfig.appendValueToArray(['addons'], '@storybook/themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/themes')} to your addons`);
mainConfig.appendValueToArray(['addons'], '@storybook/addon-themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/addon-themes')} to your addons`);
}

return summary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('[@storybook/addon-themes] CODEMOD: Material UI configuration', () => {
"import type { StorybookConfig } from \\"@storybook/react-vite\\";
const config: StorybookConfig = {
stories: [\\"../stories/**/*.stories.@(js|jsx|ts|tsx)\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/themes\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/addon-themes\\"],
framework: {
name: \\"@storybook/react-vite\\",
options: {},
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('[@storybook/addon-themes] CODEMOD: Material UI configuration', () => {
"import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/themes'],
addons: ['@storybook/addon-essentials', '@storybook/addon-themes'],
framework: {
name: '@storybook/react-webpack5',
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export const materialUIStrategy: AddonThemesConfigurationStrategy = {
};

const hasThemesAddon = mainConfig.getFieldValue(['addons']).some((addon: string | { name: string }) => {
if (typeof addon === 'string') return addon === '@storybook/themes';
return addon.name === '@storybook/themes';
if (typeof addon === 'string') return addon === '@storybook/addon-themes';
return addon.name === '@storybook/addon-themes';
});

if (!hasThemesAddon) {
mainConfig.appendValueToArray(['addons'], '@storybook/themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/themes')} to your addons`);
mainConfig.appendValueToArray(['addons'], '@storybook/addon-themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/addon-themes')} to your addons`);
}

return summary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('[@storybook/addon-themes] CODEMOD: Styled Components configuration', (
"import type { StorybookConfig } from \\"@storybook/react-vite\\";
const config: StorybookConfig = {
stories: [\\"../stories/**/*.stories.@(js|jsx|ts|tsx)\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/themes\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/addon-themes\\"],
framework: {
name: \\"@storybook/react-vite\\",
options: {},
Expand Down Expand Up @@ -78,7 +78,7 @@ describe('[@storybook/addon-themes] CODEMOD: Styled Components configuration', (
"import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/themes'],
addons: ['@storybook/addon-essentials', '@storybook/addon-themes'],
framework: {
name: '@storybook/react-webpack5',
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export const styledComponentsStrategy: AddonThemesConfigurationStrategy = {
};

const hasThemesAddon = mainConfig.getFieldValue(['addons']).some((addon: string | { name: string }) => {
if (typeof addon === 'string') return addon === '@storybook/themes';
return addon.name === '@storybook/themes';
if (typeof addon === 'string') return addon === '@storybook/addon-themes';
return addon.name === '@storybook/addon-themes';
});

if (!hasThemesAddon) {
mainConfig.appendValueToArray(['addons'], '@storybook/themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/themes')} to your addons`);
mainConfig.appendValueToArray(['addons'], '@storybook/addon-themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/addon-themes')} to your addons`);
}

return summary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('[@storybook/addon-themes] CODEMOD: tailwind configuration', () => {
"import type { StorybookConfig } from \\"@storybook/react-webpack5\\";
const config: StorybookConfig = {
stories: [\\"../stories/**/*.stories.@(js|jsx|ts|tsx)\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/themes\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/addon-themes\\"],
framework: {
name: \\"@storybook/react-webpack5\\",
options: {},
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('[@storybook/addon-themes] CODEMOD: tailwind configuration', () => {
"import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/themes'],
addons: ['@storybook/addon-essentials', '@storybook/addon-themes'],
framework: {
name: '@storybook/react-webpack5',
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export const tailwindStrategy: AddonThemesConfigurationStrategy = {
};

const hasThemesAddon = mainConfig.getFieldValue(['addons']).some((addon: string | { name: string }) => {
if (typeof addon === 'string') return addon === '@storybook/themes';
return addon.name === '@storybook/themes';
if (typeof addon === 'string') return addon === '@storybook/addon-themes';
return addon.name === '@storybook/addon-themes';
});

if (!hasThemesAddon) {
mainConfig.appendValueToArray(['addons'], '@storybook/themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/themes')} to your addons`);
mainConfig.appendValueToArray(['addons'], '@storybook/addon-themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/addon-themes')} to your addons`);
}

return summary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('[@storybook/addon-themes] CODEMOD: vanilla-extract configuration', ()
"import type { StorybookConfig } from \\"@storybook/react-webpack5\\";
const config: StorybookConfig = {
stories: [\\"../stories/**/*.stories.@(js|jsx|ts|tsx)\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/themes\\"],
addons: [\\"@storybook/addon-essentials\\", \\"@storybook/addon-themes\\"],
framework: {
name: \\"@storybook/react-webpack5\\",
options: {},
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('[@storybook/addon-themes] CODEMOD: vanilla-extract configuration', ()
"import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/themes'],
addons: ['@storybook/addon-essentials', '@storybook/addon-themes'],
framework: {
name: '@storybook/react-webpack5',
options: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export const vanillaExtractStrategy: AddonThemesConfigurationStrategy = {
};

const hasThemesAddon = mainConfig.getFieldValue(['addons']).some((addon: string | { name: string }) => {
if (typeof addon === 'string') return addon === '@storybook/themes';
return addon.name === '@storybook/themes';
if (typeof addon === 'string') return addon === '@storybook/addon-themes';
return addon.name === '@storybook/addon-themes';
});

if (!hasThemesAddon) {
mainConfig.appendValueToArray(['addons'], '@storybook/themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/themes')} to your addons`);
mainConfig.appendValueToArray(['addons'], '@storybook/addon-themes');
summary.changed.push(`Added ${colors.pink.bold('@storybook/addon-themes')} to your addons`);
}

return summary;
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/main.with-themes.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/themes'],
addons: ['@storybook/addon-essentials', '@storybook/addon-themes'],
framework: {
name: '@storybook/react-webpack5',
options: {},
Expand Down

0 comments on commit cbea302

Please sign in to comment.