Move util module from src/modules/util to src/utils#1382
Conversation
Co-authored-by: alexanmtz <88840+alexanmtz@users.noreply.github.com>
alexanmtz
left a comment
There was a problem hiding this comment.
Lot of build errors
src/modules/orders/orderRefund.ts:4:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations.
4 import { handleAmount } from '../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/modules/payouts/payoutRequest.ts:3:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations.
3 import { handleAmount } from '../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/modules/users/userBankAccountCreate.ts:4:29 - error TS2307: Cannot find module '../util/currency-map' or its corresponding type declarations.
4 import { currencyMap } from '../util/currency-map'
~~~~~~~~~~~~~~~~~~~~~~
src/modules/walletOrders/walletOrderBuilds.ts:3:40 - error TS2307: Cannot find module '../util/customer' or its corresponding type declarations.
3 import { createOrUpdateCustomer } from '../util/customer'
~~~~~~~~~~~~~~~~~~
src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts:4:30 - error TS2307: Cannot find module '../../../util/handle-amount/handle-amount' or its corresponding type declarations.
4 import { handleAmount } from '../../../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/modules/webhooks/checkoutSessionCompleted.ts:7:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations.
7 import { handleAmount } from '../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/utils/customer.ts:1:26 - error TS2307: Cannot find module '../../client/payment/stripe' or its corresponding type declarations.
1 import stripeModule from '../../client/payment/stripe'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/utils/customer.ts:3:20 - error TS2307: Cannot find module '../../models' or its corresponding type declarations.
3 import models from '../../models'
~~~~~~~~~~~~~~
Found 8 errors in 7 files.
Errors Files
1 src/modules/orders/orderRefund.ts:4
1 src/modules/payouts/payoutRequest.ts:3
1 src/modules/users/userBankAccountCreate.ts:4
1 src/modules/walletOrders/walletOrderBuilds.ts:3
1 src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts:4
1 src/modules/webhooks/checkoutSessionCompleted.ts:7
2 src/utils/customer.ts:1
Exited with code exit status 1
Co-authored-by: alexanmtz <88840+alexanmtz@users.noreply.github.com>
Fixed all build errors in commit 1506888. Updated 7 additional files:
All imports now correctly reference the new |
Thank you for your contribution!
Description
Refactored directory structure by relocating
src/modules/utiltosrc/utilsto follow standard Node.js/TypeScript conventions where utility modules live at the project root level rather than nested undermodules.Changes
Directory relocation: Moved all files from
src/modules/util/tosrc/utils/currency-info.ts,currency-map.ts,customer.ts,formatDate.tshandle-amount/handle-amount.ts,index.tsImport path updates: Updated import statements across 13 files:
src/services/payments/disputes/disputeService.tssrc/scripts/sync/sync_payment_requests.tssrc/mail/payout.ts(2 imports)src/mail/paymentRequest.ts(3 imports)src/mail/templates/issue/claim.tstest/handle-amount.test.tssrc/modules/orders/orderRefund.tssrc/modules/payouts/payoutRequest.tssrc/modules/users/userBankAccountCreate.tssrc/modules/walletOrders/walletOrderBuilds.tssrc/modules/webhooks/checkoutSessionCompleted.tssrc/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.tssrc/utils/customer.ts(fixed relative paths after move)All imports changed from various
../util/*and../modules/util/*patterns to the correct../../utils/*or../utils/*pattern based on file location.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.