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

[dspace-8_x] Minor fixes to dependencies in package.json #3310

Closed
wants to merge 4 commits into from

Conversation

alanorth
Copy link
Contributor

@alanorth alanorth commented Sep 7, 2024

Description

Minor fixes for two dependencies in package.json.

Strangely, this results in webpack being downgraded. Seems there might be more work to make sure our dependencies are fresh. For example, if you do yarn upgrade to force the resolver to re-evaluate all the semver strings for each package, there are lint errors and the build breaks. Something is clearly not right.

Instructions for Reviewers

Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.

List of changes in this PR:

  • Change the semver pin for @angular/localize from 17.3.11 to ^17.3.11 to match all the other Angular packages in package.json
  • Use eslint-plugin-unused-imports v3.x.x to match our eslint and tslint versions

Include guidance for how to test or review your PR.

Try to run yarn install and build the site in dev and production modes.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@alanorth alanorth added dependencies Pull requests that update a dependency file affects: 8.x Issue impacts 8.x releases labels Sep 7, 2024
@alanorth alanorth added this to the 8.1 milestone Sep 7, 2024
@alanorth alanorth changed the title package.json: fix semver for @angular/localize [dspace-8_x] Minor fixes to dependencies in package.json Sep 7, 2024
@tdonohue
Copy link
Member

tdonohue commented Sep 9, 2024

@alanorth : Something odd is going on with this PR itself, as these changes cause Unit Tests (specs) to no longer be able to run. It might be the accidental downgrade to webpack.

I'm not sure what is going on with this either, and it's unclear to me why these dependencies need fixing in the first place. But, this PR currently seems to cause more issues by accident.

Fix error due to newer @typescript-eslint/eslint-plugin:

    error TS2314: Generic type 'RuleMetaData<MessageIds, Options>' requires 2 type argument(s).

    16 export type Meta = RuleMetaData<string>;
According to the docs we should be using v3.x.x:

> * Version 3.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 6 - 7
> * Version 2.x.x is for eslint 8 with @typescript-eslint/eslint-plugin 5

This fixes a lint error.

See: https://www.npmjs.com/package/eslint-plugin-unused-imports
@angular/localize is the only angular package not using a caret (^)
for its range for some reason.
@alanorth
Copy link
Contributor Author

alanorth commented Sep 9, 2024

Dependency solvers in yarn and npm should be idempotent. I agree something strange is going on. I've done this again from scratch and not had the webpack downgrade.

it's unclear to me why these dependencies need fixing in the first place.

The reasons are:

  1. angular/localize is pinned at an exact version, but all our other Angular dependencies use a caret (^). When all our other Angular deps move on to 17.3.12 or newer, localize will be stuck on 17.3.11. Seems unintentional...?
  2. We are using an eslint-plugin-unused-imports meant for an older version of eslint, which causes a lint error. We haven't hit the error yet because we haven't bumped our lockfile in a while and therefore haven't hit the version of eslint that triggers it.

I will close this in favor of #3311.

@alanorth alanorth closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: 8.x Issue impacts 8.x releases dependencies Pull requests that update a dependency file
Projects
Development

Successfully merging this pull request may close these issues.

2 participants