Skip to content

Consolidate index.js + index.d.ts #3625

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

Merged

Conversation

bradenmacdonald
Copy link
Contributor

@bradenmacdonald bradenmacdonald commented Jun 2, 2025

Description

When I first added substantial TypeScript support to Paragon, I created an src/index.d.ts type declaration file that needs to be kept in sync with the "real" src/index.js file. However, I realize now that there's a much simpler way to do this in a single file, although it requires adding a lot of @ts-ignore comments where things haven't yet been converted to TypeScript.

Note: it would be better to use @ts-expect-error because then it will warn us when we should remove those directives (i.e. when we try to ignore types that actually exist), but for some reason that's giving me an "unused expect-error" error, so I stuck with @ts-ignore.

Deploy Preview

TBD

Merge Checklist

n/a - no changes to components themselves

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jun 2, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @bradenmacdonald!

This repository is currently maintained by @openedx/paragon-working-group.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for paragon-openedx-v22 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 95e2fd0
🔍 Latest deploy log https://app.netlify.com/projects/paragon-openedx-v22/deploys/6841c8ea25d77f0008ef384d
😎 Deploy Preview https://deploy-preview-3625--paragon-openedx-v22.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Jun 2, 2025
@bradenmacdonald bradenmacdonald force-pushed the braden/simplify-index-ts branch from fd48e45 to b9d2281 Compare June 2, 2025 20:35
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.39%. Comparing base (2346e92) to head (95e2fd0).
Report is 2 commits behind head on release-22.x.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-22.x    #3625      +/-   ##
================================================
+ Coverage         93.18%   93.39%   +0.20%     
================================================
  Files               253      253              
  Lines              4743     4799      +56     
  Branches           1112     1075      -37     
================================================
+ Hits               4420     4482      +62     
+ Misses              320      310      -10     
- Partials              3        7       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bradenmacdonald bradenmacdonald force-pushed the braden/simplify-index-ts branch from b9d2281 to de51d56 Compare June 2, 2025 20:49
@bradenmacdonald
Copy link
Contributor Author

bradenmacdonald commented Jun 3, 2025

@PKulkoRaccoonGang Would you be able to review this?

@brian-smith-tcril I'm seeing a problem again where the lint check is failing (edit: it was a legitimate failure caused by changes in this PR, now fixed), but GitHub is showing the tests as passing. Seems to be the same issue as #3329 (comment)

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jun 3, 2025
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

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

Once conflicts are resolved let's :shipit:!

@bradenmacdonald bradenmacdonald merged commit 625b7ed into openedx:release-22.x Jun 5, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Jun 5, 2025
@bradenmacdonald bradenmacdonald deleted the braden/simplify-index-ts branch June 5, 2025 16:53
@bradenmacdonald
Copy link
Contributor Author

@brian-smith-tcril Thanks! I merged this, but accidentally made a typo in the squash commit message, so it starts with * refactor: instead of refactor:. Is that gonna break anything?

@brian-smith-tcril
Copy link
Contributor

@bradenmacdonald I checked https://github.com/openedx/paragon/actions/runs/15472796847/job/43561207176 and it looks like semantic release is fine with it

[5:00:17 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: * refactor: consolidate index.js + index.d.ts (#3625)
[5:00:17 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release

I then made a sync 22 -> 23 PR (#3633) that resolved the conflicts in #3628 to see how commitlint handles it and it seems commitlint is not happy https://github.com/openedx/paragon/actions/runs/15478303670/job/43578949222?pr=3633

⧗   input: * refactor: consolidate index.js + index.d.ts (#3625)
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]

This isn't the first time we've had a commit that commitlint isn't happy about, it'll just lead to a couple commitlint failures until it makes it's way from 22 -> 23 -> next, but it won't trigger any unintentional releases or prevent any releases from being created.

tl;dr - we'll see a couple commitlint CI failures on sync PRs but nothing will actually break.

@bradenmacdonald
Copy link
Contributor Author

@brian-smith-tcril Thanks for checking, and sorry about that! :/

@openedx-semantic-release-bot

🎉 This PR is included in version 22.20.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@openedx-semantic-release-bot

🎉 This PR is included in version 23.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U released on @22.x released
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants