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

Remove mkdirp and rimraf in favor of Node.js builtins #31725

Closed
wants to merge 1 commit into from
Closed

Remove mkdirp and rimraf in favor of Node.js builtins #31725

wants to merge 1 commit into from

Conversation

wojtekmaj
Copy link

Why:

In Node.js v14.14.0, fs.rmSync was added. It's a built-in module that removes files and directories. The recursive option is used to remove directories and their contents.

Since this repository requires Node.js 18 and up, it's safe to assume mkdirp and rimraf can be safely replaced, thus reducing the number of dependencies in this project.

What's being changed (if available, include any code snippets, screenshots, or gifs):

  • mkdirp(PATH) -> (fs.)mkdir(PATH, { recursive: true })
  • rimraf(PATH) -> (fs.)rm(Sync)(PATH, { recursive: true, force: true })

Check off the following:

  • I have reviewed my changes in staging, available via the View deployment link in this PR's timeline (this link will be available after opening the PR).

    • For content changes, you will also see an automatically generated comment with links directly to pages you've modified. The comment won't appear if your PR only edits files in the data directory.
  • For content changes, I have completed the self-review checklist.

…ttps://nodejs.org/api/fs.html#fsmkdirsyncpath-options). This option allows you to create a directory and all its parent directories if they do not exist.

In Node.js v14.14.0, [`fs.rmSync`](https://nodejs.org/api/fs.html#fsrmsyncpath-options) was added. It's a built-in module that removes files and directories. The `recursive` option is used to remove directories and their contents.

Since this repository requires Node.js 18 and up, it's safe to assume `mkdirp` and `rimraf` can be safely replaced, thus reducing the number of dependencies in this project.
Copy link

welcome bot commented Feb 19, 2024

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Feb 19, 2024
Copy link
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:

  • package-lock.json
  • package.json
  • src/audit-logs/scripts/sync.js
  • src/codeql-cli/scripts/sync.js
  • src/early-access/scripts/symlink-from-local-repo.js
  • src/ghes-releases/scripts/archive-version.js
  • src/ghes-releases/scripts/remove-static-files.js
  • src/ghes-releases/scripts/sync-automated-pipeline-data.js
  • src/github-apps/scripts/sync.js
  • src/graphql/scripts/sync.js
  • src/rest/scripts/update-files.js
  • src/rest/scripts/utils/sync.js
  • src/tests/scripts/copy-fixture-data.js
  • src/webhooks/scripts/sync.js

You'll need to revert all of the files you changed that match that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

The complete list of files we can't accept are:

  • .devcontainer/**
  • .github/workflows/**
  • .github/CODEOWNERS
  • assets/fonts/**
  • data/graphql/**
  • data/reusables/rai/**
  • Dockerfile*
  • src/*/scripts/**
  • src/**.json
  • src/workflows/**
  • lib/redirects/**
  • package*.json
  • content/actions/deployment/security-hardening-your-deployments/**

We also can't accept contributions to files in the content directory with frontmatter type: rai.

@wojtekmaj wojtekmaj changed the title In Node.js v10.12.0, recursive option was added to [fs.mkdirSync](https://nodejs.org/api/fs.html#fsmkdirsyncpath-options). This option allows you to create a directory and all its parent directories if they do not exist. Remove mkdirp and rimraf in favor of Node.js builtins Feb 19, 2024
@nguyenalex836 nguyenalex836 removed the triage Do not begin working on this issue until triaged by the team label Feb 19, 2024
@nguyenalex836
Copy link
Contributor

@wojtekmaj Hi 👋 Unfortunately, per the automated response above, we are unable to accept this contribution. We appreciate your desire to contribute to GitHub Docs. I'll go ahead and close this PR 💛

@wojtekmaj wojtekmaj deleted the no-rimraf-mkdirp branch February 19, 2024 22:19
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