-
Notifications
You must be signed in to change notification settings - Fork 25
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
add: dynamic template function #841
add: dynamic template function #841
Conversation
Mr-Ao-Dragon
commented
Jan 22, 2025
- Added an advanced template system.
- Update hello-world to the latest version.
- Add an empty program to quickly start writing.
- Added a package template.
@@ -0,0 +1,7 @@ | |||
import { fmt } |
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.
Please move to internal/cli/templates
, this and the next one
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.
Maybe I should just move all the templates to internal\cli\templates?
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.
Yes, that's was my intention :)
@@ -0,0 +1,7 @@ | |||
// don't forget modify i/o type and name |
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.
- looks like this template won't compile because it lacks
Main
component - name
package
is a little bit ambiguous. what exactly this template should be?
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 template is intended to be reference ready and is not intended to be compilable
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.
So what will happen if user will run neva new --template=package
? It will create neva module without executable package? It's like for developing libraries?
Hey there, thanks for the PR. Please answer these two questions, before we merge this:
Number |
Let me fix the syntax of the template first |
yes, i will |
By adding this feature, users can choose their own faster templates for development, and we don't have to do anything to new.go when we add new templates, we can just write them. |
… template files - Modified empty.neva, hello-world.neva, and package.neva template files. - Optimized code structure and clarified placement of node and network definitions. - Updated the naming convention to use a more neva-compliant naming scheme. Updated naming conventions to be more in line with the neva language. -Adjusted the format of import statements and function definitions.
c9c397d
to
f3fd666
Compare
Let's discuss on Discord |
neva doesn't have an ecosystem at the moment and this pr is currently unnecessary, so I decided to close it. |