-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4149 from Shopify/notifications
Notification system
- Loading branch information
Showing
19 changed files
with
930 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@shopify/cli-kit': minor | ||
'@shopify/app': minor | ||
'@shopify/cli': minor | ||
--- | ||
|
||
Notification system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"notifications":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export interface GlobalContext { | ||
currentCommandId: string | ||
} | ||
|
||
let _globalContext: GlobalContext | undefined | ||
|
||
/** | ||
* Get the global context. | ||
* | ||
* @returns Global context. | ||
*/ | ||
function getGlobalContext(): GlobalContext { | ||
if (!_globalContext) { | ||
_globalContext = {currentCommandId: ''} | ||
} | ||
return _globalContext | ||
} | ||
|
||
/** | ||
* Get the current command ID. | ||
* | ||
* @returns Current command ID. | ||
*/ | ||
export function getCurrentCommandId(): string { | ||
return getGlobalContext().currentCommandId | ||
} | ||
|
||
/** | ||
* Set the current command ID. | ||
* | ||
* @param commandId - Command ID. | ||
*/ | ||
export function setCurrentCommandId(commandId: string): void { | ||
getGlobalContext().currentCommandId = commandId | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.