Skip to content

Commit fcf0d86

Browse files
authored
Merge pull request #6623 from Shopify/fix_use_of_globalThis_stable
[Stable] Fix use of global this
2 parents f1e9d76 + ce1854c commit fcf0d86

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

.changeset/tough-donkeys-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/cli': patch
3+
---
4+
5+
Fix CLI loading on Node 25

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)