UpliftGames / wally

Wally is a modern package manager for Roblox projects inspired by Cargo
https://wally.run
Mozilla Public License 2.0
309 stars 100 forks source link

`wally init` should generate a `default.project.json` if one doesn't exist #42

Open magnalite opened 2 years ago

magnalite commented 2 years ago

While originally I didn't like the idea of assuming we would be syncing packages via Rojo (Wally should only manage packages and not care what happens outside of it) I think we could add conveniences for working with other tools. We sort of already do this with automatic renaming of default.project.json files.

I think it would be helpful to have wally init generate a sane default.project.json file if one doesn't currently exist. At the moment I'm not sure how you would even use Wally without Rojo. It would give a better "works straight out of the box" experience and help encourage people to use the correct project/package structure. We could also include a src folder and init.lua file so that is already handled for you. Knowing to have packages be siblings to each other is probably a strange concept to people brand new to Wally and/or Rojo.

nottirb commented 2 years ago

By sane default.project.json, do you mean one similar to what you might find when you call rojo init in a CLI? Or, do you mean a default.project.json that might be used to create a Wally package?

I, atleast when initially using Rojo, found that the way the latter is structured was really confusing.. as you are unable to runrojo serve on it, and must instead create a test.project.json file that then allows you to run rojo serve test.project.json.

I guess it just depends what you're looking for, but based on what you said I'd imagine you'd want the former? Another question would be whether we want to include Packages in the default.project.json file, since if a user doesn't actually run wally install, or they only install server/dev dependencies, Packages won't exist and will instead throw an error that can be extremely confusing for new users. Perhaps we should generate an empty Packages folder on wally init?

It might also be useful to add 2 flags like --raw, --package, wherein the --raw flag would only generate the wally.toml file, as it does currently, and the --package flag would generate a default.project.json file that matches how uploaded packages should be setup, a test.project.json file that lets you serve your package to studio for testing, and the Packages/src folder aswell.

Just some thoughts for whoever implements this.