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

refactor(server/upload): convert js to ts #2618

Merged
merged 26 commits into from
Aug 9, 2024
Merged

Conversation

iainsproat
Copy link
Contributor

@iainsproat iainsproat commented Aug 8, 2024

Description & motivation

Typescript all the things 🧹 , well packages/server/modules/core/rest/upload.js at least

Changes:

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

@iainsproat iainsproat marked this pull request as ready for review August 9, 2024 08:51
@iainsproat iainsproat merged commit e9f7286 into main Aug 9, 2024
22 of 24 checks passed
@iainsproat iainsproat deleted the iain/upload-typescript branch August 9, 2024 09:00
const { ObjectHandlingError } = require('@/modules/core/errors/object')
const { estimateStringMegabyteSize } = require('@/modules/core/utils/chunking')
const { toMegabytesWith1DecimalPlace } = require('@/modules/core/utils/formatting')
} from '@/modules/core/services/objects'
Copy link
Contributor

Choose a reason for hiding this comment

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

Do make sure to test this, sometimes imports don't act as expected when converting from require() to import(), e.g. const XXX = require('asd') is not necessarily always translated to a default import.

@@ -69,7 +78,7 @@ module.exports = (app) => {
}
let totalObjectsProcessed = 0

const promises = []
const promises: Promise<boolean | void | string[]>[] = []
Copy link
Contributor

Choose a reason for hiding this comment

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

if the promise result is irrelevant you can just do Promise<unknown>

iainsproat added a commit that referenced this pull request Aug 12, 2024
iainsproat added a commit that referenced this pull request Aug 12, 2024
iainsproat added a commit that referenced this pull request Aug 12, 2024
* Revert "refactor(server/upload): convert js to ts (#2618)"

This reverts commit e9f7286.

* Revert "feat(logging): pass request logger to core/services/objects (#2599)"

This reverts commit ee3e9af.

* Revert "feat(server): configurable maximum objects POST size and improved logging (#2594)"

This reverts commit 55cad96.
iainsproat added a commit that referenced this pull request Aug 12, 2024
* Revert "refactor(server/upload): convert js to ts (#2618)"

This reverts commit e9f7286.

* Revert "feat(logging): pass request logger to core/services/objects (#2599)"

This reverts commit ee3e9af.

* Revert "feat(server): configurable maximum objects POST size and improved logging (#2594)"

This reverts commit 55cad96.
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.

3 participants