-
Notifications
You must be signed in to change notification settings - Fork 43
[WIP][APT-1673] Update regenerate scripts #155
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
Conversation
❌ Deploy Preview for pensive-meitner-faaeee failed. 🔨 Explore the source changes: 677d8a8 🔍 Inspect the deploy log: https://app.netlify.com/sites/pensive-meitner-faaeee/deploys/61f1762bf5b4fb0007b85592 |
"regenerate:local": "yarn regenerate --local", | ||
"regenerate:remote": "yarn regenerate --remote" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't these two lines need to update in accordance with the docs-sourcer
parameter adjustment? Something like…
"regenerate:local": "yarn regenerate --local", | |
"regenerate:remote": "yarn regenerate --remote" | |
"regenerate:local": "yarn regenerate --plugin local", | |
"regenerate:remote": "yarn regenerate --all" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or: maybe there's only…
"regenerate:local": "yarn regenerate --local", | |
"regenerate:remote": "yarn regenerate --remote" | |
"regenerate": "env-cmd docs-sourcer --all", | |
"regenerate:local": "env-cmd docs-sourcer --plugin local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive me, Ore, as I propose yet a third option. I'll add a little more context this time so you can follow my reasoning. While this all boils down to choosing the appropriate switches and defaults, that feels important to me because which we choose help to suggest the expected pattern of use, which makes it a UX concern.
In a standalone context, the tool is responsible for running a set of plugins in order to generate a docs site from various sources. The same can be said when running the tool in our cloud service — it's concerned with everything. For this reason, I think I may have misled in suggesting the need for a --all
in the first place. That should probably be the default for the docs-sourcer
itself.
In the context of the docs site, where we leverage yarn, it's more likely that a user will want to do local-only regeneration, to view content they just edited. That's even more true in the long run, when the cloud process will manage changes to remote content automatically. There are still use cases for running remote generation in the docs repo manually, but they seem secondary.
For these reasons, I would propose that the docs-sourcer
command runs all plugins by default, and accepts the --plugin
and --repo
arguments as a way to filter that to specific plugins. I'd then propose one of two options for the docs site itself
OPTION 1: Closest to standard usage, with just a shortcut for local generation as a convenience:
"regenerate": "env-cmd docs-sourcer",
"regenerate:local": "yarn regenerate --plugin local"
OPTION 2: Emphasizing the appropriate default for the context, at the risk of essentially reversing the default:
"regenerate": "env-cmd docs-sourcer --plugin local",
"regenerate:all": "env-cmd docs-sourcer"
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert to the default command running all plugins.
I am also leaning towards option 2 in the context of the docs repo. It is trivial to change so we test out any and switch if needed.
@eak12913 thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon reflection, I like option 2 best also. I think it reflects the pattern of use better, and no one but us will care that it follows a different pattern than the underlying docs-sourcer
tool itself.
Closing in favour of #156 |
What does this PR do?
NOTE: This has a WIP label because the docs-sourcer package reference needs
to be updated once the corresponding PR on the docs-sourcer repo is merged.
APT-1673