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

Option in the Yeoman Generator to generate a "blank" project (without "hello world") #1764

Open
ebousse opened this issue Nov 29, 2024 · 1 comment
Labels
proposal yeoman Yeoman generator related issue

Comments

@ebousse
Copy link

ebousse commented Nov 29, 2024

Problem

The Langium Yeoman generator is great to kickstart a working project around a small "hello world" DSL, and the provided examples of code to be written around the AST (eg. the example validator) are very useful to understand Langium.

However, a typical flow is:

  1. generate a langium project with yo langium
  2. modify the default .langium file,
  3. run npm run langium:generate
  4. run npm run build

If no other change is done, step 4 will always fail because the provided examples of generator, validator and CLI won't compile anymore. This is because these examples are made for the "hello world" default DSL, which is not there anymore because of step 2.

This means that two extra steps are in fact always required:

  1. modify generator, validator and CLI by commenting/changing/removing the parts that cannot compile
  2. run npm run build once again, and hope it compiles

A problem I encountered when I was starting with Langium, and that I now currently encounter when I try to teach Langium to students, is that the additional step 5 is quite difficult for people who are just starting with Langium. Because at this stage one does not know how things works, it is hard to know how to make the changes, and it is easy to make mistakes (eg. commenting too many things).

Idea

I would find very useful to be offered the choice, in the Yeoman generator, to either kickstart a project with the "hello world" example DSL (and accompanying generator, validator and CLI), or to have a "blank" project without any semantic model nor grammar rules. Such blank project could still provide files for the generator, validator and CLI, but where one would simply find // TODO in each place where a change will be required for the component to work in the future.

This would allow kickstarting a project with steps 1 to 4, avoiding the hazardous steps 5-6 (especially for beginners).

@msujew msujew added yeoman Yeoman generator related issue proposal labels Dec 4, 2024
@msujew
Copy link
Member

msujew commented Dec 4, 2024

I agree, this makes a lot of sense. I've talked with a few people at conferences in the past who had this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal yeoman Yeoman generator related issue
Projects
None yet
Development

No branches or pull requests

2 participants