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

Add root parameter #41

Merged
merged 3 commits into from
May 4, 2021
Merged

Add root parameter #41

merged 3 commits into from
May 4, 2021

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented May 3, 2021

The root parameter allows specifying the root project directory. This is used to resolve the changelog file path (unless an absolute path is specified), and it's used by the update command to ensure the search for changes since the last release only includes changes in the given root directory.

This new option is exposed via the API only on the update function, with the rootProjectDirectory option.

This was the last feature required for monorepo support.

Closes #34

The `root` parameter allows specifying the root project directory. This
is used to resolve the changelog file path (unless an absolute path is
specified), and it's used by the `update` command to ensure the search
for changes since the last release only includes changes in the given
root directory.

This new option is exposed via the API only on the `update` function,
with the `rootProjectDirectory` option.

This was the last feature required for monorepo support.

Closes #34
@Gudahtt Gudahtt requested a review from a team as a code owner May 3, 2021 15:23
rekmarks
rekmarks previously approved these changes May 3, 2021
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

console.error(
`Project root must be a directory: '${projectRootDirectory}'`,
);
process.exit(1);
Copy link
Member

Choose a reason for hiding this comment

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

This is probably out of scope for this PR, but I recently realized how strongly Node advises against the log-and-process.exit pattern: https://nodejs.org/api/process.html#process_process_exit_code

Going through snaps-cli and getting rid of 17 cases of the same is on my TODO-list 😑

Copy link
Member Author

Choose a reason for hiding this comment

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

TIL. Easy enough to avoid this pattern in this case at least. I can fix this in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Resolved here: #43

If `root` was set on the CLI, it wasn't being properly passed through
to the `update` function.
@Gudahtt
Copy link
Member Author

Gudahtt commented May 4, 2021

Found a couple of silly mistakes in further testing - see the newest two commits.

@Gudahtt Gudahtt merged commit bf91610 into main May 4, 2021
@Gudahtt Gudahtt deleted the add-root-parameter branch May 4, 2021 13:10
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.

Monorepo support
2 participants