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

feat(docs): consolidate single commands #642

Merged
merged 17 commits into from
Oct 27, 2022

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Oct 24, 2022

🚥 Fix RM-5580

🧰 Changes

This removes our :single commands and extends the functionality of the changelogs, custompages, and docs commands to intelligently determine whether the input is a directory vs. a single file.

The following commands have been removed in favor of their standard counterparts:

  • changelogs:single
  • custompages:single
  • docs:single

🧬 QA & Testing

I've left the test suites separated out so single file tests vs. directory tests are in separate files. Do they pass?

@kanadgupta kanadgupta added enhancement New feature or request refactor Issues about tackling technical debt command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands labels Oct 24, 2022
@kanadgupta kanadgupta added this to the v8 milestone Oct 27, 2022
@kanadgupta kanadgupta marked this pull request as ready for review October 27, 2022 18:31
@kanadgupta
Copy link
Member Author

@garrett-wade FYI!

return expect(changelogs.run({ key })).rejects.toThrow(
'No folder provided. Usage `rdme changelogs <folder> [options]`.'
it('should error if no path provided', () => {
return expect(changelogs.run({ key })).rejects.toStrictEqual(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do .toThrow here anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.toThrow is technically a partial match on err.message, .toStrictEqual(<full error object>) is a stricter check

this.args = [
this.getKeyArg(),
this.getVersionArg(),
{
name: 'folder',
name: 'filePath',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this accept a path to a file or a path to a folder?

Copy link
Member Author

@kanadgupta kanadgupta Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both! This variable isn't user-facing since it's the default arg (i.e. it won't show up in the help commands or anything), but I wasn't sure what to call it.

@kanadgupta kanadgupta merged commit 7552501 into main Oct 27, 2022
@kanadgupta kanadgupta deleted the kanad/rm-5580-consolidate-docs-and-docssingle branch October 27, 2022 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:docs Issues pertaining to the `docs`, `changelogs`, or `custompages` commands enhancement New feature or request refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants