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

chore: remove dependency shelljs #61

Merged
merged 2 commits into from
Feb 19, 2024
Merged

chore: remove dependency shelljs #61

merged 2 commits into from
Feb 19, 2024

Conversation

fasttime
Copy link
Member

This PR removes the dependency shelljs and replaces its usages with native Node.js API calls. It also adds unit tests to ensure that the behavior of writeChangelog() hasn't changed.

ShellJS in versions prior to 0.8.5 has a high rated vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2022-0144.

@fasttime fasttime marked this pull request as ready for review February 15, 2024 19:25
nzakas
nzakas previously approved these changes Feb 16, 2024
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Would like @mdjermanovic to review before merging.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

Code LGTM. I also tested it with eslint/eslint project.

One suggestion about the tests.


beforeEach(() => {
sandbox = sinon.sandbox.create();
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "writeChangelog-"));
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to remove this directory in afterEach so that running the tests doesn't leave temporary directories behind.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in fc24c33.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit e419afd into main Feb 19, 2024
10 checks passed
@mdjermanovic mdjermanovic deleted the drop-shelljs branch February 19, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants