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

Rename pathSlashModel to model and remove path flag #559

Merged
merged 2 commits into from
May 19, 2020
Merged

Rename pathSlashModel to model and remove path flag #559

merged 2 commits into from
May 19, 2020

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented May 19, 2020

This PR resolves a sub-discussion of #487, and is a continuation of #423. @thedavidprice @cannikin @antonmoiseev

The functionality introduced in #423 remains unchanged--you can still specify a path in the model, but we're no longer calling it pathSlashModel. Just model now, and the functionality will be revealed in a help message:

Output for yarn rw g scaffold --help
~/redwood-app$ yarn rw g scaffold --help
yarn run v1.22.4
$ /redwood-app/node_modules/.bin/rw g scaffold --help
rw g scaffold <model>

Generate Pages, SDL, and Services files based on a given DB schema Model.

Positionals:
  model  Model to scaffold. Optionally may use "path/model" to nest files by
         type at the given path directory (or directories)            [required]

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
  --force                                             [boolean] [default: false]

We're also taking out the path flag here, so now there's only one way to do it.

@jtoar jtoar mentioned this pull request May 19, 2020
@thedavidprice
Copy link
Contributor

🚀

yarn rw g scaffold --help looks ✅

yarn rw g --help --> What about adding a hint at the end re: path/model. So:
Generate Pages, SDL, and Services files based on a given DB schema Model. Optionally <path/model> (see 'scaffold --help').

Or something like that. It's getting long. But still needs hint at top-level -- agreed, thoughts?

@jtoar
Copy link
Contributor Author

jtoar commented May 19, 2020

Agreed, because I'm not sure if users would look for yarn rw g scaffold --help unless prompted / really stuck, and since yarn rw g --help already gives you most of the information you need to use the commands, it's pretty hidden.

@jtoar
Copy link
Contributor Author

jtoar commented May 19, 2020

@thedavidprice new help messages for yarn rw g --help and yarn rw g scaffold --help respectively are (showing only the relevant parts here):

  rw g scaffold <model>    Generate Pages, SDL, and Services files based on a
                           given DB schema Model. Also accepts <path/model> (see
                           'scaffold --help').
rw g scaffold <model>

Generate Pages, SDL, and Services files based on a given DB schema Model. Also
accepts <path/model> (see 'scaffold --help').

Positionals:
  model  Model to scaffold. You can also use <path/model> to nest files by type
         at the given path directory (or directories)--e.g. admin/post[required]

@jtoar
Copy link
Contributor Author

jtoar commented May 19, 2020

@thedavidprice Barring anything else, I think this one's ready.

@thedavidprice
Copy link
Contributor

Thanks for the rapid turnaround! This is good on my end. Tested locally and works 💯

@cannikin want to give it a look through before merging?

Dominic and others added 2 commits May 19, 2020 12:40
You can still specify a path in the model, but we're no longer
calling it pathSlashModel--the functionality will be
revealed in the help message instead.

We're also taking out the path flag here,
so there's only one way to do it
@thedavidprice thedavidprice merged commit 1194d3f into redwoodjs:master May 19, 2020
@thedavidprice thedavidprice added this to the next release milestone May 19, 2020
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.

4 participants