Skip to content

Commit

Permalink
Further work on making SB setup work
Browse files Browse the repository at this point in the history
  • Loading branch information
arimendelow committed Oct 4, 2024
1 parent cf20ab7 commit c784247
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const addSBAddonsToMain = (
logTaskOutput(
task,
c.info(
`Adding Storybook addons to your main config: ${addOnsToAdd.join(', ')}...`,
`Confirming Storybook has the following addons: ${addOnsToAdd.join(', ')}...`,
),
)
const addonsArrayMatch = sbMainContent.match(/addons\s*:\s*\[([^\]]*)\]/)
Expand All @@ -125,9 +125,13 @@ export const addSBAddonsToMain = (
)

if (addonsToAdd.length > 0) {
logTaskOutput(
task,
c.info(`Adding addons: ${addonsToAdd.join(', ')} to your Storybook...`),
)
const updatedAddonsArray = addonsArray.trim()
? `${addonsArray} ${addonsToAdd.map((addon) => `'${addon}'`).join(', ')},`
: `${addonsArray}, ${addonsToAdd.map((addon) => `'${addon}'`).join(', ')},`
? `${addonsArray}, ${addonsToAdd.map((addon) => `'${addon}'`).join(', ')}`
: `${addonsToAdd.map((addon) => `'${addon}'`).join(', ')}`
return sbMainContent.replace(
addonsArrayMatch[0],
`addons: [${updatedAddonsArray}]`,
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/commands/setup/ui/libraries/redwoodui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@ class RWUIInstallHandler {
return // skip to next iteration
}

// ARI YOU ARE HERE:
// - also look in root package.json for installed packages
// - figure out why the dev dep packages aren't being installed
const projectPackageJsonPath = path.join(
this.rwPaths.web.base,
'package.json',
Expand Down

0 comments on commit c784247

Please sign in to comment.