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

add: dynamic template function #841

Conversation

Mr-Ao-Dragon
Copy link
Contributor

  • 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 }
Copy link
Collaborator

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

Copy link
Contributor Author

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?

Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. looks like this template won't compile because it lacks Main component
  2. name package is a little bit ambiguous. what exactly this template should be?

Copy link
Contributor Author

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

Copy link
Collaborator

@emil14 emil14 Jan 22, 2025

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?

@emil14
Copy link
Collaborator

emil14 commented Jan 22, 2025

Hey there, thanks for the PR. Please answer these two questions, before we merge this:

  1. What problem are we trying to solve?
  2. Can we add e2e tests that ensure that this functionality works?

Number 1 is the most important, please do not proceed to make changes before we agreed on that 🙏

@Mr-Ao-Dragon
Copy link
Contributor Author

Let me fix the syntax of the template first

@Mr-Ao-Dragon
Copy link
Contributor Author

Can we add e2e tests that ensure that this functionality works?

yes, i will

@Mr-Ao-Dragon
Copy link
Contributor Author

What problem are we trying to solve?

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.
@Mr-Ao-Dragon Mr-Ao-Dragon force-pushed the feat/code-template/update-create-template branch from c9c397d to f3fd666 Compare January 22, 2025 08:06
@emil14
Copy link
Collaborator

emil14 commented Jan 22, 2025

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.

Let's discuss on Discord

@Mr-Ao-Dragon Mr-Ao-Dragon marked this pull request as draft January 22, 2025 12:19
@Mr-Ao-Dragon
Copy link
Contributor Author

neva doesn't have an ecosystem at the moment and this pr is currently unnecessary, so I decided to close it.

@Mr-Ao-Dragon Mr-Ao-Dragon deleted the feat/code-template/update-create-template branch January 22, 2025 13:10
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.

2 participants