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

Prompt for creation of subdirectory on netlify functions:create #5026

Open
1 task
whitep4nth3r opened this issue Sep 5, 2022 · 1 comment
Open
1 task
Labels
area: command: functions area: dx good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@whitep4nth3r
Copy link
Contributor

Which problem is this feature request solving?

Currently, when running netlify functions:create, the CLI creates a subdirectory for the new function file. Despite being a perfectly valid approach, this is an opinionated way to create a new function file.

To developers who prefer NOT to nest their function files in subdirectories, this unexpected outcome results in them needing to do extra work to put their files where they want them, and clean up afterwards.

Describe the solution you'd like

It would be preferable to give users the option to either create a subdirectory or skip creation of a subdirectory when running the command.

Pull request (optional)

  • I can submit a pull request.
@whitep4nth3r whitep4nth3r added type: feature code contributing to the implementation of a feature and/or user facing functionality area: command: functions area: dx labels Sep 5, 2022
@eduardoboucas
Copy link
Member

We could default to creating single function files unless the function has any supporting files (e.g. a util.js file that is imported from the main file). It should be very straightforward for the CLI to look at the files in the template and make this decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: command: functions area: dx good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

3 participants