Skip to content

Rename pathSlashModel to model and remove path flag#559

Merged
thedavidprice merged 2 commits intoredwoodjs:masterfrom
jtoar:fix-scaffold-path
May 19, 2020
Merged

Rename pathSlashModel to model and remove path flag#559
thedavidprice merged 2 commits intoredwoodjs:masterfrom
jtoar:fix-scaffold-path

Conversation

@jtoar
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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]

Comment thread packages/cli/src/commands/generate/scaffold/scaffold.js Outdated
Comment thread packages/cli/src/commands/generate/scaffold/scaffold.js Outdated
@jtoar
Copy link
Copy Markdown
Contributor Author

jtoar commented May 19, 2020

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

@thedavidprice
Copy link
Copy Markdown
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?

Comment thread packages/cli/src/commands/generate/scaffold/scaffold.js Outdated
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