Skip to content

Explicitly add chokidar, readdirp and yaml as dev dependencies to solve dependabot issues - #6186

Open
tdonohue wants to merge 1 commit into
DSpace:mainfrom
tdonohue:add_missing_dependencies
Open

Explicitly add chokidar, readdirp and yaml as dev dependencies to solve dependabot issues#6186
tdonohue wants to merge 1 commit into
DSpace:mainfrom
tdonohue:add_missing_dependencies

Conversation

@tdonohue

@tdonohue tdonohue commented Sep 4, 2026

Copy link
Copy Markdown
Member

Description

Recently, in every PR it creates, dependabot will attempt to remove the chokidar, readdirp and yaml dependencies from our package-lock.json file because they are not explicitly used in dspace-angular (as they are transitive dependencies).

However, removing these dependencies causes immediate errors in npm install because all three dependences are required by Angular (and a few other direct dependencies).

Examples of dependabot PRs which attempt to remove these dependencies include the following:

This PR attempts to resolve the issue by adding all three as development dependencies, which should make it clear to dependabot they are needed.

# The versions here correspond to the versions that are currently listed in our `package-lock.json` file.
npm install --save-dev chokidar@^4.0.3
npm install --save-dev readdirp@^4.1.2
npm install --save-dev yaml@^2.9.0

NOTE: Because this impacts several branches, this PR will need to be ported to dspace-10_x and dspace-9_x. It's likely it will need to be recreated on each branch using the above commands as these branches do not have identical dependencies. It does NOT need to be ported to 8.x because that uses yarn, and this dependabot issue seems to be specific to npm.

NOTE 2: After this PR is merged, every dependabot PR against main will need to be recreated via @dependabot recreate. That should tell dependabot to use the updated packaging settings & hopefully resolve the issues.

Instructions for Reviewers

  • Verify no change in behavior to the npm install process as well as the build (e.g. npm run build:prod) or running of the UI (e.g. npm run serve:ssr).
    • I've tested all these commands locally and found no differences in behavior.

@tdonohue tdonohue added this to the 11.0 milestone Sep 4, 2026
@tdonohue tdonohue added dependencies Pull requests that update a dependency file 1 APPROVAL pull request only requires a single approval to merge labels Sep 4, 2026
@tdonohue tdonohue added port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release labels Sep 4, 2026
@tdonohue

tdonohue commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

@alanorth : Pinging you on this because I think this should finally fix the dependabot issues we've been seeing. This PR is not ideal because it adds these transitive dependencies as dev dependencies, but the output of the PR is very promising. If you look closely it makes similar changes to package-lock.json which dependabot keeps trying to do...but then it also moves these dependencies to explicit dev dependencies.

Thoughts welcome. As I noted above, if we find this works for main, I think we'd need to build similar PRs for 10.x and 9.x. I'm not confident that this PR would port cleanly in an automated fashion...we may have to run the commands (see description) on each branch individually and create a new PR for each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge dependencies Pull requests that update a dependency file port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release port to dspace-10_x This PR needs to be ported to `dspace-10_x` branch for next bug-fix release

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant