-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Improvements to generate #2492
Improvements to generate #2492
Conversation
Mention that functionality is minimal, point users to PkgTemplates.jl if more features are needed.
Could you remove |
Also thank you for working on this |
Done. I've had the same thought in the past. |
src/generate.jl
Outdated
""" | ||
module $pkg | ||
|
||
greet() = print("Hello World!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this? I like having some function in here that does something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just because of this comment. Personally, I always found greet() = print("Hello World!")
a bit weird, but I have no strong preference one way or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function should not remove, there is nothing weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I reverted it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boo 😔😔😔😔😔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't satisfy everyone 😄. We can do an emoji vote here to decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put it in the main issue this is buried
:arg_count => 1 => 1, | ||
:arg_parser => ((x,y) -> map(expanduser, unwrap(x))), | ||
:description => "generate files for a new project", | ||
:help => md""" | ||
generate pkgname | ||
|
||
Create a project called `pkgname` in the current folder. | ||
Create a minimal project called `pkgname` in the current folder. For more featureful package creation, please see `PkgTemplates.jl`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to not ship this redirection in the docstring, but instead in the documentation. We have no idea whether it is still PkgTemplates.jl
five years later. If someone is still using Julia 1.7 five years later for unknown reasons, he doesn't get directed to the wrong place then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but keep in mind that currently, ] generate
is deprecated in favor of PkgTemplates.jl with the deprecation warning: Pkg.generate is deprecated. Please use PkgTemplates.jl instead.
Incidentally, I think that makes a good case for having this "core" functionality built-in to Pkg.jl.
There were some conflicting opinions on whether the body of the generated module should contain What are people's opinions?
|
Following discussion in #1923, un-deprecates
] generate
and makes several improvements:.jl
in name? #1712 (] generate Tmp.jl
will create a package namedTmp
in a directory namedTmp.jl
)Also, points users to PkgTemplates in the docstrings if they need more than the minimal functionality provided by
generate
.Regarding #2168, perhaps the issue is not in
generate
and rather inparse_package_identifier
(specifically this regex does not match "∂xxxxx", butPkg.API.check_package_name("∂xxxxx")
does not give an error). I am not clear on whether "∂xxxxx" is supposed to be a valid package name or not.