Skip to content

Commit

Permalink
fix: improve log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
davbree committed May 5, 2024
1 parent cef0ed0 commit 2bf5ff8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/commands/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ async function selectWorkspace(project: Project, filter?: string): Promise<strin

if (isCI) {
throw new Error(
`Configure the site you want to work with and try again. Sites detected: ${(project.workspace?.packages || [])
`Sites detected: ${(project.workspace?.packages || [])
.map((pkg) => pkg.name || pkg.path)
.join(', ')}.`,
.join(
', ',
)}. Configure the site you want to work with and try again. See docs at: https://docs.netlify.com/configure-builds/monorepos/#manual-configuration`,
)
}

Expand Down
6 changes: 4 additions & 2 deletions src/utils/build-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ export const detectFrameworkSettings = async (
if (isCI) {
log(`Multiple possible ${type} commands found`)
throw new Error(
`Update your settings to specify which to use. Detected commands for: ${settings
`Detected commands for: ${settings
.map((setting) => setting.framework.name)
.join(', ')}.`,
.join(
', ',
)}. Update your settings to specify which to use. See docs at: https://docs.netlify.com/configure-builds/file-based-configuration/#netlify-dev`,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`frameworks/framework-detection > should detect a known framework 1`] =
exports[`frameworks/framework-detection > should fail in CI when multiple frameworks are detected 1`] = `
"◈ Netlify Dev ◈
Multiple possible dev commands found
◈ Update your settings to specify which to use. Detected commands for: Gatsby, Create React App."
Detected commands for: Gatsby, Create React App. Update your settings to specify which to use. See docs at: https://docs.netlify.com/configure-builds/file-based-configuration/#netlify-dev"
`;

exports[`frameworks/framework-detection > should filter frameworks with no dev command 1`] = `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`commands/dev-miscellaneous > should fail in CI with multiple projects 1`] = `"› Error: Configure the site you want to work with and try again. Sites detected: package1, package2."`;
exports[`commands/dev-miscellaneous > should fail in CI with multiple projects 1`] = `"› Error: Sites detected: package1, package2. Configure the site you want to work with and try again. See docs at: https://docs.netlify.com/configure-builds/monorepos/#manual-configuration"`;

0 comments on commit 2bf5ff8

Please sign in to comment.