@lwrjs/shared-utils
Advanced tools
Comparing version 0.16.2 to 0.16.3
@@ -16,2 +16,14 @@ import type { EnvironmentContext, FeatureFlags, Headers, RuntimeParams } from '@lwrjs/types'; | ||
/** | ||
* This function is used to determine if lwr is running in the context of local preview. | ||
* | ||
* @returns true if running in preview mode | ||
*/ | ||
export declare function isLocalPreview(): boolean; | ||
/** | ||
* This function is used to determine if lwr is running with an authenticated context locally | ||
* | ||
* @returns true if local dev/preview authentication is enabled | ||
*/ | ||
export declare function isLocalAuthEnabled(): boolean; | ||
/** | ||
* Create a serializable context for user-land exposed environment variables | ||
@@ -18,0 +30,0 @@ */ |
@@ -76,2 +76,18 @@ if (getFeatureFlags().REEVALUATE_MODULES && !getFeatureFlags().LEGACY_LOADER) { | ||
/** | ||
* This function is used to determine if lwr is running in the context of local preview. | ||
* | ||
* @returns true if running in preview mode | ||
*/ | ||
export function isLocalPreview() { | ||
return process.env.LOCAL_PREVIEW_MODE === 'true'; | ||
} | ||
/** | ||
* This function is used to determine if lwr is running with an authenticated context locally | ||
* | ||
* @returns true if local dev/preview authentication is enabled | ||
*/ | ||
export function isLocalAuthEnabled() { | ||
return process.env.AUTH_TOKEN !== undefined; | ||
} | ||
/** | ||
* Create a serializable context for user-land exposed environment variables | ||
@@ -78,0 +94,0 @@ */ |
@@ -25,3 +25,3 @@ import { release } from 'os'; | ||
const protocol = https ? 'https' : 'http'; | ||
const url = `${protocol}://localhost:${port}${finalPath}`; | ||
const url = `${protocol}://localhost:${port}${finalPath}/`; | ||
exec(`${cmd} ${url}`); | ||
@@ -28,0 +28,0 @@ return url; |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.16.2", | ||
"version": "0.16.3", | ||
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview", | ||
@@ -41,3 +41,3 @@ "repository": { | ||
"dependencies": { | ||
"@lwrjs/diagnostics": "0.16.2", | ||
"@lwrjs/diagnostics": "0.16.3", | ||
"es-module-lexer": "^1.5.4", | ||
@@ -55,3 +55,3 @@ "fast-json-stable-stringify": "^2.1.0", | ||
"devDependencies": { | ||
"@lwrjs/types": "0.16.2", | ||
"@lwrjs/types": "0.16.3", | ||
"@types/mime-types": "2.1.4", | ||
@@ -64,3 +64,3 @@ "@types/path-to-regexp": "^1.7.0", | ||
}, | ||
"gitHead": "062cc0e7d23b70b1c97cdd8acde90caee4e644f8" | ||
"gitHead": "91bc46c88ff7201851f02fc4a3d38d39e81885c6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
201705
4689
+ Added@lwrjs/diagnostics@0.16.3(transitive)
- Removed@lwrjs/diagnostics@0.16.2(transitive)
Updated@lwrjs/diagnostics@0.16.3