mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 17:40:09 +00:00
feat: add isNightly build flag for nightly-only features (#8149)
## Summary Adds a compile-time `__IS_NIGHTLY__` constant that detects whether the build is from the main branch (nightly) or a core/* branch (RC/stable). The detection logic in vite.config.mts auto-detects based on `GITHUB_REF_NAME === 'main'` in CI, with explicit override support via `IS_NIGHTLY` environment variable. Exports `isNightly` from `src/platform/distribution/types.ts` for use throughout the codebase. Includes unit tests for the detection logic. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8149-feat-add-isNightly-build-flag-for-nightly-only-features-2ec6d73d365081c09930edec1c6644f5) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -9,6 +9,7 @@ type Distribution = 'desktop' | 'localhost' | 'cloud'
|
||||
|
||||
declare global {
|
||||
const __DISTRIBUTION__: Distribution
|
||||
const __IS_NIGHTLY__: boolean
|
||||
}
|
||||
|
||||
/** Current distribution - replaced at compile time */
|
||||
@@ -18,3 +19,10 @@ const DISTRIBUTION: Distribution = __DISTRIBUTION__
|
||||
export const isDesktop = DISTRIBUTION === 'desktop' || isElectron() // TODO: replace with build var
|
||||
export const isCloud = DISTRIBUTION === 'cloud'
|
||||
// export const isLocalhost = DISTRIBUTION === 'localhost' || (!isDesktop && !isCloud)
|
||||
|
||||
/**
|
||||
* Whether this is a nightly build (from main branch).
|
||||
* Nightly builds may show experimental features and surveys.
|
||||
* @public
|
||||
*/
|
||||
export const isNightly = __IS_NIGHTLY__
|
||||
|
||||
Reference in New Issue
Block a user