Problem/Motivation

Current Node.js can parse command-line arguments with util.parseArgs().
Drupal core uses minimist for CSS building and some Nightwatch tests.
Some Nightwatch tests use minimist to specify theme from command-line arguments.
In /core/scripts/css/postcss-build.js which works CSS building, uses minimist to build a specific file or check script from command-line arguments.
I think Node.js native function seems to be enough for Drupal core.

Proposed resolution

Remove minimist from devDependencies in /core/package.json and use Node.js native util.parseArgs().

Note:

The minimist library is not removed from node_modules directory at this point because other libraries require minimist as a dependency.

Remaining tasks

User interface changes

No.

API changes

No.

Data model changes

No.

Release notes snippet

No.

CommentFileSizeAuthor
#9 3481095-nr-bot.txt90 bytesneeds-review-queue-bot

Issue fork drupal-3481095

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tom konda created an issue. See original summary.

tom konda’s picture

Status: Active » Needs work

tom konda’s picture

Status: Needs work » Needs review
tom konda’s picture

Status: Needs review » Needs work

I found minimist was called in Nightwatch testing codes.
Need to fix these codes.

tom konda’s picture

Status: Needs work » Needs review
tom konda’s picture

Title: Prefer to replace minimist with util.parseArgs() from CSS building script » Prefer to replace minimist with util.parseArgs() from Node.js scripts in core
Issue summary: View changes
smustgrave’s picture

Question what's the pro of making this change since the dependency still exists?

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

larowlan’s picture

Agree with #8 could we get the output from `npm ls minimist` or whatever the yarn equivalent is so we can ascertain why we still end up installing it.

I agree it is better to use the built in parseArgs regardless

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.