Skip to content

Commit

Permalink
deps: upgrade uuid to v9.0.0 for jest+esm issue
Browse files Browse the repository at this point in the history
Issue is described well here: microsoft/accessibility-insights-web#5421 (comment)

They originally fixed the issue with a custom resolver
(microsoft/accessibility-insights-web@9ad4e61#diff-10ce3d2c4d812be4f9bbaceb999b48c91538e4ccfc23dc585c59deb316d0d689),
but then replaced that workaround with an upgrade to uuid v9.0.0 when it
became available
(microsoft/accessibility-insights-web@6d1c3a3).

uuid v9.0.0 https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md#900-2022-09-05
  • Loading branch information
jbranchaud authored and kodiakhq[bot] committed Jun 21, 2023
1 parent 82e83aa commit d93fe71
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 44 deletions.
1 change: 1 addition & 0 deletions packages/commerce-server/package.json
Expand Up @@ -37,6 +37,7 @@
"@types/node": "^18.16.13",
"eslint": "^8.12.0",
"eslint-config-custom": "workspace:*",
"jest": "^29.5.0",
"rimraf": "^3.0.2",
"tsup": "^5.11.13",
"tsx": "^3.7.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/database/package.json
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@prisma/client": "^4.5.0",
"uuid": "^8.3.2"
"uuid": "^9.0.0"
},
"devDependencies": {
"@skillrecordings/tsconfig": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/database/src/prisma-api.ts
@@ -1,5 +1,5 @@
import {Context, defaultContext} from './context'
import {v4} from 'uuid'
import {v4 as uuidv4} from 'uuid'
import {Prisma, Purchase, PurchaseUserTransferState, User} from '@prisma/client'

type SDKOptions = {ctx?: Context}
Expand Down Expand Up @@ -416,8 +416,8 @@ export function getSdk(
// we are using uuids so we can generate this!
// this is needed because the following actions
// are dependant
const merchantChargeId = v4()
const purchaseId = v4()
const merchantChargeId = uuidv4()
const purchaseId = uuidv4()

const merchantCharge = ctx.prisma.merchantCharge.create({
data: {
Expand Down Expand Up @@ -473,7 +473,7 @@ export function getSdk(

if (isBulkPurchase) {
bulkCouponId =
existingBulkCoupon !== null ? existingBulkCoupon.id : v4()
existingBulkCoupon !== null ? existingBulkCoupon.id : uuidv4()

// Create or Update Bulk Coupon Record
if (existingBulkCoupon) {
Expand Down Expand Up @@ -503,7 +503,7 @@ export function getSdk(
}
}

const merchantSessionId = v4()
const merchantSessionId = uuidv4()

const merchantSession = ctx.prisma.merchantSession.create({
data: {
Expand Down

0 comments on commit d93fe71

Please sign in to comment.