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

upgraded TypeScript to 5.4.5 #2207

Closed

Conversation

VanshikaSabharwal
Copy link

@VanshikaSabharwal VanshikaSabharwal commented Aug 20, 2024

What kind of change does this PR introduce?

Bugfix

Issue Number:

Fixes #2016

Did you add tests for your changes?

No

Snapshots/Videos:

Summary

This PR addresses a bug caused by an upgrade to the TypeScript version. The issue should be resolved with the updates made in this PR.
Issue#2016

Does this PR introduce a breaking change?

No

Other information

This issue arose after an automated dependabot job attempted to upgrade TypeScript from version 4.9.5 to 5.4.5, which led to failing PR tests. This PR includes the necessary updates to resolve these issues and ensure compatibility.

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • New Features
    • Upgraded TypeScript version to improve type safety and introduce new language features.
  • Bug Fixes
    • Resolved potential conflicts by managing TypeScript versioning in scripts.

Anvita0305 and others added 30 commits February 10, 2024 13:03
- Implemented validation for the `formState.link` field to ensure that it represents a valid URL.
- Proper The validation checks have been added to prevent users from submitting arbitrary or
  invalid strings when creating a new advertisement.
- Added tests for the modified code.
- Ensured no other functionality or tests fail after the changes.

Signed-off-by: Akhilender <akhilenderb9@gmail.com>
* add mutations and queries

* add translations

* add tests

* add dropdown for toggling settings on small screens

* minor corrections

* minor change

* minor change and refactor

* Update documentation

* Revert "Update documentation"

This reverts commit 13a638b.

* Update documentation

* Revert "Update documentation"

This reverts commit 4293627.

* Update documentation

* Revert "Update documentation"

This reverts commit bddc63d.
* add mutations and queries

* add translations

* add tests

* add dropdown for toggling settings on small screens

* minor corrections

* minor change

* minor change and refactor

* Update documentation

* Revert "Update documentation"

This reverts commit 13a638b.

* Update documentation

* Revert "Update documentation"

This reverts commit 4293627.

* Update documentation

* Revert "Update documentation"

This reverts commit bddc63d.

* add wait to tests
* Upgraded prettier from 2.3.2 to 3.2.5

- Upgraded prettier to latest version and matched the version to that of talawa-api
- Ensured all the tests are passing
- Ensured no other functionality got affected

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* feat: Changed all instances in code according to latest prettier format

- Upgraded eslint-plugin-prettier to latest version as it was depended on the prettier version
- Made sure no other functionality got affected and all the tests are passing

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

---------

Signed-off-by: Akhilender <akhilenderb9@gmail.com>
* Create authorized-change.py

* Update authorized-changes-detection.yml

* Update authorized-changes-detection.yml

* Update count_changed_files.py

* Update count_changed_files.py

* Update count_changed_files.py

* Create sensitive_files.txt

* Update pull-requests.yml

* Update pull-requests.yml

* Update pull-requests.yml

* Update pull-requests.yml

* Update pull-requests.yml

* Update pull-requests.yml

* Update pull-requests.yml

* Update count_changed_files.py

* Update count_changed_files.py

* Update count_changed_files.py

* Delete .github/workflows/authorized-changes-detection.yml

* Delete .github/workflows/authorized-change.py

* reviews changes done

* fetch-depth testing

* Update pull-requests.yml

* Update check_files.py

* Update pull-requests.yml

* renamed

* changes

* ..

* reviewed changes

* optimize system exits

* added node-version path

* black formatting added
* Workflow Test 1708236296

* Workflow Test 1708236792

* Test

* Upgraded github actions to the latest versions

---------

Co-authored-by: Peter Harrison <peter@colovore.com>
)

* Updated the scroll Bar of the event calendar and the side navbar.

* Changed the import location of Scroll Bar CSS file.

* Changed some file names.
…nStore.tsx file (#1614)

* Added tests for AddOnStore/AddOnStore.tsx

* Fixed linting errors

* Fixed warnings due to linting errors

* Removed commented code
… advertisements (#1529)

* feat: implemented support to upload media in advertisement register component

* fix: failing tests

* fix: failing tests

* removed commented code

* fix: failing tests

* renamed link variable to mediaUrl

* updated the type of mediaUrl

* updated schema and mutation for createAdvertisement

* removed unused variables

* Added support to display advertisement image/video in user portal

* fix: failing tests

* fix: failing tests

* reverted unwanted changes

* fix: failing tests

* fix: failing tests

* added translations for different languages and improved variable names

* Updated variable name and input fields for creating advertisements

* fix: failing tests

* fix: failing tests

* updated get advertisement query

* fix: update advertisement feature

* removed unwanted curly braces

* fix failing tests

* updated type of file

* fix: formatting issues

* fix: formatting issues

* updated variable name and fix cross origin error

* removed: unwanted curly braces

* fix: failing tests

* added oragnization resolver for advertisement

* removed unwanted code

* fix: failing tests

* fix: formatting issues

* fix: formatting issues

* fix: formatting issues

* fix: failing tests

* fix: advertisements not rendering

* fix: removed unused imports

* fix: linting errors

* Update documentation

* Updated mutation to delete advertisement

* Update documentation

* fix: formatting issues

* fix: type error

* fix: lint errors

* fix: error

* fix: advertisements not rendering on user portal

* fix: not same origin error while rendering video

* Updated deleteAdvertisement mutation and advertisementsConnection mutation

* fix: failing tests
* feat: Integrated Dicebear Library To Enhance Security

- Added the Dicebear library as a dependency to the project.
- Imported the necessary functions from the library.
- Created a new `Avatar` component that utilizes the Dicebear library locally.
- Updated the component to accept `name`, `alt`, and `size` as props.
- Utilized the Dicebear library to generate avatars with initials.
- Removed direct HTTP API calls from the codebase.
- Replaced instances of direct HTTP API calls with the newly created `Avatar` component.
- Updated the exisiting tests and ensured the tests are still valid.
- Mitigated security risks associated with SSRF and XSS attacks by eliminating direct HTTP API calls.
- By using the Dicebear library locally, we reduce potential vulnerabilities.
- Ensured no other functionality is affected.

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* fix: Reverted changes in the tests

- Reverted the Avatar component in all the tests as they are redundant in tests except where it is needed.
- Ensured all the remaning tests are succesfully passing.

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* fix: Added dynamic style

- Handled case where no alt tag is provided by adding default alt value.
- dynamic rendering for className for img tag in avatar component
- Dynamic rendering for test-id
- Replaced suitable changes for the above properties added

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* fix: modified test

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

* fix: resolved conflict

Signed-off-by: Akhilender <akhilenderb9@gmail.com>

---------

Signed-off-by: Akhilender <akhilenderb9@gmail.com>
* add mutations and queries

* add translations

* add tests

* add dropdown for toggling settings on small screens

* minor corrections

* minor change

* initial changes

* basic design

* add basic modals

* add create action item functionality

* add update functionality

* add delete functionality

* add details modal

* extract modals and restructure

* add sorting

* remove unnecessary files

* add filters and design adjustments

* add translations

* don't show disabled action item categories

* add tests for OrganizationActionItems.tsx

* add tests for ActionItemContainer.tsx

* add filters section

* minor adjustments

* move mutations and queries into separate files

* fix failing test

* format files

* use css variables for colors

* write test for IconComponent.tsx
palisadoes and others added 13 commits August 11, 2024 14:43
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.25.1 to 6.26.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.26.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [web-vitals](https://github.com/GoogleChrome/web-vitals) from 4.2.2 to 4.2.3.
- [Changelog](https://github.com/GoogleChrome/web-vitals/blob/main/CHANGELOG.md)
- [Commits](GoogleChrome/web-vitals@v4.2.2...v4.2.3)

---
updated-dependencies:
- dependency-name: web-vitals
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sass](https://github.com/sass/dart-sass) from 1.77.4 to 1.77.8.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.77.4...1.77.8)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.2.7 to 15.2.8.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v15.2.7...v15.2.8)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add organization tags UI

* corrections

* add tag serial number

* remove unwanted change

* minor changes
* add organization tags UI

* corrections

* add tag serial number

* remove unwanted change

* minor changes

* add manageTag screen

* improve test coverage
* fix the loading state

* changes after review
* Merged latest code from remote

* upgraded emotion/styled version

* fix: reverted the unnencessary change in the contributing file
* upgraded apollo client

* Update src/screens/OrgPost/OrgPost.tsx

Lowercase primitives for consistency.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Added Dockerfile and .dockerignore

* Update added latest node version to dockerfile

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Updated Dockerfile and removed redundancy

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Updated dockerignore

* fixed failed tests

* Deleted Dockerfile

* Deleted .dockerignore

* updated package-lock.json

* Updated apollo-client version

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link

coderabbitai bot commented Aug 20, 2024

Caution

Review failed

The head commit changed during the review from 5ed3808 to 6f65709.

Walkthrough

The changes primarily involve upgrading the TypeScript dependency in the project from version ^4.3.5 to ^5.4.5. This upgrade aims to enhance type safety and introduce new language features. The TypeScript dependency has been removed from the main dependencies list and added to the scripts section, indicating a shift in how it will be utilized within the project.

Changes

Files Change Summary
package.json Updated TypeScript from ^4.3.5 to ^5.4.5 (removed from dependencies, added to scripts).

Assessment against linked issues

Objective Addressed Explanation
Upgrade TypeScript ( #2016 )
Resolve Previous Failures ( #2016 ) Unclear if past failures are resolved.
Update Codebase ( #2016 ) No evidence of code modifications.
Assess Package Usage ( #2016 ) No assessment of TypeScript necessity.
Documentation of Background Failures ( #2016 ) No documentation referenced.

Poem

🐰 Oh, hop and skip, with joy I see,
TypeScript's fresh, as bright can be!
From four to five, we leap with glee,
New features await, just wait for me!
Code will dance, bugs will flee,
A happy codebase, full of harmony! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 15c8753 and f93130f.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (1)
  • package.json (2 hunks)
Additional comments not posted (1)
package.json (1)

132-132: Confirm TypeScript is only used in development.

The TypeScript dependency has been moved from dependencies to devDependencies. Ensure that TypeScript is only used during development and is not required in production builds.

Verification successful

TypeScript is used only in development.

The search results indicate that TypeScript is primarily involved in development tasks, such as linting and code quality checks. This supports the decision to move TypeScript to devDependencies.

  • TypeScript-related entries are found in ESLint configurations and are used with @typescript-eslint plugins, which are development tools.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify TypeScript usage in the codebase to ensure it is only used in development scripts.

# Test: Search for TypeScript usage in scripts. Expect: TypeScript should only be used in scripts related to development.
rg --type js --type ts --type json -A 5 'typescript'

Length of output: 31515

coderabbitai[bot]
coderabbitai bot previously approved these changes Aug 20, 2024
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.34.1 to 7.35.0.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](jsx-eslint/eslint-plugin-react@v7.34.1...v7.35.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/sanitize-html](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sanitize-html) from 2.11.0 to 2.13.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sanitize-html)

---
updated-dependencies:
- dependency-name: "@types/sanitize-html"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.11.11 to 1.11.12.
- [Release notes](https://github.com/iamkun/dayjs/releases)
- [Changelog](https://github.com/iamkun/dayjs/blob/dev/CHANGELOG.md)
- [Commits](iamkun/dayjs@v1.11.11...v1.11.12)

---
updated-dependencies:
- dependency-name: dayjs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.16.4 to 5.16.7.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/v5.16.7/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.16.7/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@dicebear/core](https://github.com/dicebear/dicebear) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/dicebear/dicebear/releases)
- [Changelog](https://github.com/dicebear/dicebear/blob/9.x/CHANGELOG.md)
- [Commits](dicebear/dicebear@v8.0.1...v8.0.2)

---
updated-dependencies:
- dependency-name: "@dicebear/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@palisadoes
Copy link
Contributor

This PR has too many submitted files.

Please ensure the following:

Make your PR modifications based on the current develop branch
Submit your PRs against our develop branch.

Closing

@palisadoes palisadoes closed this Aug 20, 2024
@VanshikaSabharwal VanshikaSabharwal deleted the develop branch August 20, 2024 17:42
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.

Upgrade package typescript from 4.9.5 to 5.4.5