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

Update Config parsing to work with netlify build #616

Merged
merged 13 commits into from
Dec 6, 2019
Merged

Conversation

DavidWells
Copy link
Contributor

Update Config parsing to work with netlify build.

@DavidWells
Copy link
Contributor Author

There are some minor differences in config shape. Mainly command is gone. I've searched for references to this and came up empty.

The other difference is build.publish is a fully resolved path. This appears to work everywhere it's referenced

Before:

{
  build: {
    command: 'npm install && cd site && npm install && npm run build',
    publish: 'site/dist'
  },
  dev: {
    command: 'yarn start'
  }
}

After

{
  build: {
    publish: '/Users/davidwells/Netlify/repos/cli/site/dist',
    lifecycle: {
      build: [Array]
    }
  },
  plugins: [],
  dev: {
    command: 'yarn start'
  },
}

})
} catch (err) {
// Suppress config not found error for CLI. @TODO Revisit
if (err.message.indexOf('No netlify configuration file was found') === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why suppress this error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not every site needs netlify config file. They might have build settings set in the UI

The @netlify/build config package was throwing hard errors when config was missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be updated in build? @ehmicky did you update how config handles this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes this try/catch should not be needed anymore. Missing configuration files do not throw anymore.

Copy link
Contributor

@RaeesBhatti RaeesBhatti left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants