Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Aug 11, 2024
1 parent ca4d322 commit b28ec22
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/core/scripts/helpers/sourcefiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function generateVersionsFile(prettierConfig: prettier.Options | null): Pr
}

async function generateFrameworksFile(prettierConfig: prettier.Options | null): Promise<void> {
const thirdPartyFrameworks = ['qwik', 'solid'];
const thirdPartyFrameworks = ['qwik', 'solid', 'react-rsbuild', 'vue3-rsbuild'];
const location = join(__dirname, '..', '..', 'src', 'types', 'modules', 'frameworks.ts');
const frameworksDirectory = join(__dirname, '..', '..', '..', 'frameworks');

Expand Down
10 changes: 8 additions & 2 deletions code/core/src/cli/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import stripJsonComments from 'strip-json-comments';
import invariant from 'tiny-invariant';

import { getRendererDir } from './dirs';
import { CoreBuilder, SupportedLanguage } from './project_types';
import { CommunityBuilder, CoreBuilder, SupportedLanguage } from './project_types';

const logger = console;

Expand Down Expand Up @@ -138,7 +138,10 @@ type CopyTemplateFilesOptions = {
*/
export const frameworkToRenderer = CoreFrameworkToRenderer;

export const frameworkToDefaultBuilder: Record<SupportedFrameworks, CoreBuilder> = {
export const frameworkToDefaultBuilder: Record<
SupportedFrameworks,
CoreBuilder | CommunityBuilder
> = {
angular: CoreBuilder.Webpack5,
ember: CoreBuilder.Webpack5,
'html-vite': CoreBuilder.Vite,
Expand All @@ -158,6 +161,9 @@ export const frameworkToDefaultBuilder: Record<SupportedFrameworks, CoreBuilder>
'vue3-webpack5': CoreBuilder.Webpack5,
'web-components-vite': CoreBuilder.Vite,
'web-components-webpack5': CoreBuilder.Webpack5,
// Only to pass type checking, will never be used
'react-rsbuild': CommunityBuilder.Rsbuild,
'vue3-rsbuild': CommunityBuilder.Rsbuild,
};

export async function copyTemplateFiles({
Expand Down
4 changes: 4 additions & 0 deletions code/core/src/cli/project_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export enum CoreWebpackCompilers {
SWC = 'swc',
}

export enum CommunityBuilder {
Rsbuild = 'rsbuild',
}

export const compilerNameToCoreCompiler: Record<string, CoreWebpackCompilers> = {
'@storybook/addon-webpack5-compiler-babel': CoreWebpackCompilers.Babel,
'@storybook/addon-webpack5-compiler-swc': CoreWebpackCompilers.SWC,
Expand Down
2 changes: 2 additions & 0 deletions code/core/src/common/utils/framework-to-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const frameworkToRenderer: Record<
'vue3-webpack5': 'vue3',
'web-components-vite': 'web-components',
'web-components-webpack5': 'web-components',
'react-rsbuild': 'react',
'vue3-rsbuild': 'vue3',
// renderers
html: 'html',
preact: 'preact',
Expand Down
4 changes: 2 additions & 2 deletions code/core/src/common/utils/get-storybook-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const frameworkPackages: Record<string, SupportedFrameworks> = {
// community (outside of monorepo)
'storybook-framework-qwik': 'qwik',
'storybook-solidjs-vite': 'solid',
'storybook-react-rsbuild': 'react',
'storybook-vue3-rsbuild': 'vue3',
'storybook-react-rsbuild': 'react-rsbuild',
'storybook-vue3-rsbuild': 'vue3-rsbuild',
};

export const builderPackages = ['@storybook/builder-webpack5', '@storybook/builder-vite'];
Expand Down
4 changes: 3 additions & 1 deletion code/core/src/types/modules/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export type SupportedFrameworks =
| 'web-components-vite'
| 'web-components-webpack5'
| 'qwik'
| 'solid';
| 'solid'
| 'react-rsbuild'
| 'vue3-rsbuild';

0 comments on commit b28ec22

Please sign in to comment.