Skip to content

Commit a659a26

Browse files
authored
Merge pull request #6621 from Shopify/fix_use_of_globalThis
Fix CLI loading on Node 25.2.0
2 parents 4394067 + ba28d3a commit a659a26

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

packages/cli-kit/src/private/node/context/deprecations-store.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@ interface DeprecationsStore {
22
nextDeprecationDate: Date | undefined
33
}
44

5-
interface GlobalWithDeprecationsStore {
6-
deprecationsStore: DeprecationsStore
7-
}
8-
9-
const globalWithDeprecationsStore: GlobalWithDeprecationsStore = {
10-
...globalThis,
11-
deprecationsStore: {
12-
nextDeprecationDate: undefined,
13-
},
5+
const deprecationsStore: DeprecationsStore = {
6+
nextDeprecationDate: undefined,
147
}
158

169
/**
@@ -19,7 +12,7 @@ const globalWithDeprecationsStore: GlobalWithDeprecationsStore = {
1912
* @returns The next deprecation date.
2013
*/
2114
export function getNextDeprecationDate(): Date | undefined {
22-
return globalWithDeprecationsStore.deprecationsStore.nextDeprecationDate
15+
return deprecationsStore.nextDeprecationDate
2316
}
2417

2518
/**
@@ -35,7 +28,7 @@ export function setNextDeprecationDate(dates: Date[]): Date | undefined {
3528

3629
const nextDeprecationDate = getNextDeprecationDate()
3730
if (!nextDeprecationDate || earliestFutureDateTime < nextDeprecationDate.getTime()) {
38-
globalWithDeprecationsStore.deprecationsStore.nextDeprecationDate = new Date(earliestFutureDateTime)
31+
deprecationsStore.nextDeprecationDate = new Date(earliestFutureDateTime)
3932
}
4033
}
4134

0 commit comments

Comments
 (0)