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

request: Add init command to bootstrap a melos project #773

Open
1 task done
exaby73 opened this issue Oct 10, 2024 · 8 comments · May be fixed by #780
Open
1 task done

request: Add init command to bootstrap a melos project #773

exaby73 opened this issue Oct 10, 2024 · 8 comments · May be fixed by #780
Assignees

Comments

@exaby73
Copy link

exaby73 commented Oct 10, 2024

Is there an existing feature request for this?

  • I have searched the existing issues.

Command

melos init

Description

Running melos init should in theory automate the steps defined in Getting Started

Reasoning

Currently setting up a melos project is very manual having to create your pubspec.yaml and melos.yaml. This new init command would solve that

Additional context and comments

No response

@spydon
Copy link
Collaborator

spydon commented Oct 10, 2024

Should I assign you to it @exaby73? :)

@exaby73 exaby73 self-assigned this Oct 10, 2024
@exaby73
Copy link
Author

exaby73 commented Oct 10, 2024

I got it :) I'll cook up something soon thank you

@exaby73 exaby73 linked a pull request Oct 23, 2024 that will close this issue
7 tasks
@albinpk
Copy link

albinpk commented Nov 14, 2024

I've made a Mason brick to bootstrap a Melos project structure with poly-repo support, maybe useful while the melos init command is in progress.
https://brickhub.dev/bricks/melos

@spydon
Copy link
Collaborator

spydon commented Nov 14, 2024

There is also this brick: https://github.com/ubuntu/flutter_project_template

But we don't want to depend on mason for the init command.

@spydon
Copy link
Collaborator

spydon commented Nov 14, 2024

@albinpk ah now I get the comment, you meant as a work-around until melos init is out? That's a good idea. :)

@albinpk
Copy link

albinpk commented Nov 14, 2024

@albinpk ah now I get the comment, you meant as a work-around until melos init is out? That's a good idea. :)

Yes, exactly; it's a workaround until melos init is available.

@spydon I’m actually using Melos in my smaller projects without a monorepo structure as well, since Melos is really useful for versioning, tagging, and changelog generation. I set it up with a simple melos.yaml like this:

name: <name>

packages:
  - ./

command:
  version:
    workspaceChangelog: false

Is there another recommended way to set up Melos for projects that aren’t monorepos, or could we add an option for this setup in the init command?

@spydon
Copy link
Collaborator

spydon commented Nov 14, 2024

It isn't recommended to have a project directly in the root, because the dependencies of the project (and vice versa) then need to conform to the Melos version and its dependency constraints.
So even with only one app/package I would recommend to use a subdirectory.

It would be good if this could be done in a better manner, but not sure how that would be possible (and that would be related to another issue and not this one).

@albinpk
Copy link

albinpk commented Nov 14, 2024

Ya, that makes sense about the dependencies. Thanks for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants