Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass api host to @netlify/build #6424

Merged
merged 3 commits into from Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/utils/run-build.ts
Expand Up @@ -57,7 +57,7 @@ const cleanInternalDirectory = async (basePath) => {
*/
// @ts-expect-error TS(7031) FIXME: Binding element 'command' implicitly has an 'any' ... Remove this comment to see the full error message
export const runNetlifyBuild = async ({ command, env = {}, options, settings, timeline = 'build' }) => {
const { cachedConfig, site } = command.netlify
const { apiOpts, cachedConfig, site } = command.netlify

const { default: buildSite, startDev } = await netlifyBuildPromise

Expand All @@ -66,6 +66,7 @@ export const runNetlifyBuild = async ({ command, env = {}, options, settings, ti
configPath: cachedConfig.configPath,
siteId: cachedConfig.siteInfo.id,
token: cachedConfig.token,
host: apiOpts.host,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the property called apiHost instead of host? https://github.com/netlify/build/blob/2d10996ee91e7640be0e4b53105ae30cb42752fe/packages/build/src/core/normalize_flags.ts#L94

Also, we're already doing something similar here. I understand these are currently different entry points into @netlify/build, but it'd be nice to at least standardise the way we pass these properties so it's easier for us to consolidate things into a single entry point in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, not sure what happened there!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re standardization - apiOpts seemed like the best way because it's defined in base-command, but open for suggestions 😄

dry: options.dry,
debug: options.debug,
context: options.context,
Expand Down