Skip to content

Conversation

oredavids
Copy link
Contributor

@oredavids oredavids commented Jan 26, 2022

What does this PR do?

  • Updates the docs site to use new docs-sourcer features

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

@netlify
Copy link

netlify bot commented Jan 26, 2022

❌ 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

Comment on lines +17 to +18
"regenerate:local": "yarn regenerate --local",
"regenerate:remote": "yarn regenerate --remote"
Copy link
Contributor

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…

Suggested change
"regenerate:local": "yarn regenerate --local",
"regenerate:remote": "yarn regenerate --remote"
"regenerate:local": "yarn regenerate --plugin local",
"regenerate:remote": "yarn regenerate --all"

Copy link
Contributor

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…

Suggested change
"regenerate:local": "yarn regenerate --local",
"regenerate:remote": "yarn regenerate --remote"
"regenerate": "env-cmd docs-sourcer --all",
"regenerate:local": "env-cmd docs-sourcer --plugin local"

Copy link
Contributor

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?

Copy link
Contributor Author

@oredavids oredavids Jan 27, 2022

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?

Copy link
Contributor

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.

@oredavids
Copy link
Contributor Author

oredavids commented Jan 27, 2022

Closing in favour of #156

@oredavids oredavids closed this Jan 27, 2022
@oredavids oredavids deleted the apt-1673-regenerate-remote-content branch May 17, 2023 16:07
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.

2 participants