Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Aug 29, 2024
1 parent d6bd213 commit f369f07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ export const addStories: Task['run'] = async (
const cwd = sandboxDir;
const storiesPath = await findFirstPath([join('src', 'stories'), 'stories'], { cwd });

const mainConfig = await readConfig({ cwd });
const mainConfig = await readConfig({ fileName: 'main', cwd });
const packageManager = JsPackageManagerFactory.getPackageManager({}, sandboxDir);

// Ensure that we match the right stories in the stories directory
Expand Down Expand Up @@ -709,7 +709,7 @@ export const addStories: Task['run'] = async (

export const extendMain: Task['run'] = async ({ template, sandboxDir, key }, { disableDocs }) => {
logger.log('📝 Extending main.js');
const mainConfig = await readConfig({ cwd: sandboxDir });
const mainConfig = await readConfig({ fileName: 'main', cwd: sandboxDir });

if (key === 'react-vite/default-ts') {
addRefs(mainConfig);
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/main-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getInterpretedFile } from '../../code/core/src/common';
import type { ConfigFile } from '../../code/core/src/csf-tools';
import { readConfig as csfReadConfig } from '../../code/core/src/csf-tools';

export async function readConfig({ fileName = 'main', cwd }: { fileName?: string; cwd: string }) {
export async function readConfig({ fileName, cwd }: { fileName: string; cwd: string }) {
const configDir = join(cwd, '.storybook');
if (!existsSync(configDir)) {
throw new Error(
Expand Down

0 comments on commit f369f07

Please sign in to comment.