@nuucognition/cli-core 0.0.1-beta.2 → 0.0.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -3
- package/dist/index.js +3 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -104,8 +104,6 @@ declare function hasFeature(registry: FeatureRegistry, id: string): boolean;
|
|
|
104
104
|
declare function isTierEnabled(featureTier: "prod" | "exp" | "dev", mode: RuntimeMode): boolean;
|
|
105
105
|
declare function resolveRuntime(config: ModeConfig): Promise<ResolvedRuntime>;
|
|
106
106
|
declare function resolveRuntimeSync(config: ModeConfig): ResolvedRuntime;
|
|
107
|
-
declare function setMode(config: ModeConfig, mode: RuntimeMode): Promise<void>;
|
|
108
|
-
declare function resetMode(config: ModeConfig): Promise<void>;
|
|
109
107
|
declare function setExperimental(config: ModeConfig, enabled: boolean): Promise<void>;
|
|
110
108
|
declare function resetExperimental(config: ModeConfig): Promise<void>;
|
|
111
109
|
declare function setFeatureEnabled(config: ModeConfig, featureId: string, enabled: boolean): Promise<void>;
|
|
@@ -155,4 +153,4 @@ declare class AuthRequiredError extends CliError {
|
|
|
155
153
|
constructor(featureId: string, cliname: string);
|
|
156
154
|
}
|
|
157
155
|
|
|
158
|
-
export { type AuthCommandFactoryConfig, type AuthEnvironment, AuthRequiredError, CliError, type ConfigOptions, type FeatureCheck, type FeatureContext, type FeatureDefinition, FeatureNotAvailableError, type FeatureRegistry, type FeatureTier, type FeatureType, type LoginConfig, type ModeConfig, NUU_ACCOUNT_URL_DEV, NUU_ACCOUNT_URL_PROD, type NuuCredentials, type ResolvedRuntime, type RuntimeMode, TIER_ALIASES, bold, checkFeature, clearAuth, createFeatureRegistry, createLoginCommand, createLogoutCommand, createWhoamiCommand, dim, ensureConfigDir, ensureConfigDirSync, ensureNuuDir, error, getCommandFeatures, getConfigDir, getConfigPath, getFeature, getFeaturesByTier, getFeaturesByType, getNuuDir, getValidAuth, hasAuth, hasFeature, info, isAuthExpired, isFeatureEnabled, isTierEnabled, isValidTier, loadAuth, loadAuthSync, normalizeRuntimeMode, normalizeTier, readConfigFile, readConfigFileSync, refreshAuth, removeConfigField, removeFeatureOverride, requireFeature, requireValidAuth, resetExperimental, resetFeatureEnabled,
|
|
156
|
+
export { type AuthCommandFactoryConfig, type AuthEnvironment, AuthRequiredError, CliError, type ConfigOptions, type FeatureCheck, type FeatureContext, type FeatureDefinition, FeatureNotAvailableError, type FeatureRegistry, type FeatureTier, type FeatureType, type LoginConfig, type ModeConfig, NUU_ACCOUNT_URL_DEV, NUU_ACCOUNT_URL_PROD, type NuuCredentials, type ResolvedRuntime, type RuntimeMode, TIER_ALIASES, bold, checkFeature, clearAuth, createFeatureRegistry, createLoginCommand, createLogoutCommand, createWhoamiCommand, dim, ensureConfigDir, ensureConfigDirSync, ensureNuuDir, error, getCommandFeatures, getConfigDir, getConfigPath, getFeature, getFeaturesByTier, getFeaturesByType, getNuuDir, getValidAuth, hasAuth, hasFeature, info, isAuthExpired, isFeatureEnabled, isTierEnabled, isValidTier, loadAuth, loadAuthSync, normalizeRuntimeMode, normalizeTier, readConfigFile, readConfigFileSync, refreshAuth, removeConfigField, removeFeatureOverride, requireFeature, requireValidAuth, resetExperimental, resetFeatureEnabled, resolveConfig, resolveConfigSync, resolveRuntime, resolveRuntimeSync, saveAuth, scopedEnvVar, scopedEnvVarTrue, setAuthVerbose, setConfigField, setExperimental, setFeatureEnabled, setFeatureOverride, shouldRefreshAuth, startLoginFlow, success, warn, writeConfigFile };
|
package/dist/index.js
CHANGED
|
@@ -638,10 +638,6 @@ function isTierEnabled(featureTier, mode) {
|
|
|
638
638
|
if (featureTier === "exp") return false;
|
|
639
639
|
return false;
|
|
640
640
|
}
|
|
641
|
-
function resolveModeFromRecord(record) {
|
|
642
|
-
const raw = record.mode;
|
|
643
|
-
return typeof raw === "string" ? normalizeRuntimeMode(raw) : void 0;
|
|
644
|
-
}
|
|
645
641
|
function resolveExperimentalFromRecord(record) {
|
|
646
642
|
const raw = record.experimental;
|
|
647
643
|
return typeof raw === "boolean" ? raw : void 0;
|
|
@@ -652,11 +648,11 @@ function resolveEnabledFeaturesFromRecord(record) {
|
|
|
652
648
|
}
|
|
653
649
|
return Object.entries(record.features).filter(([, enabled]) => enabled === true).map(([featureId]) => featureId);
|
|
654
650
|
}
|
|
655
|
-
function
|
|
651
|
+
function getBuildMode() {
|
|
656
652
|
return normalizeRuntimeMode(process.env.BUILD_MODE ?? "") ?? "dev";
|
|
657
653
|
}
|
|
658
|
-
function readRuntimeSync(
|
|
659
|
-
const mode =
|
|
654
|
+
function readRuntimeSync(_config, resolvedConfig) {
|
|
655
|
+
const mode = getBuildMode();
|
|
660
656
|
const configExperimental = resolveExperimentalFromRecord(resolvedConfig);
|
|
661
657
|
const experimental = mode === "dev" ? true : configExperimental ?? false;
|
|
662
658
|
const enabledFeatures = resolveEnabledFeaturesFromRecord(resolvedConfig);
|
|
@@ -676,12 +672,6 @@ function resolveRuntimeSync(config) {
|
|
|
676
672
|
const resolvedConfig = resolveConfigSync({ cliname: config.cliname });
|
|
677
673
|
return readRuntimeSync(config, resolvedConfig);
|
|
678
674
|
}
|
|
679
|
-
async function setMode(config, mode) {
|
|
680
|
-
await setConfigField(getConfigPath(config.cliname), "mode", mode);
|
|
681
|
-
}
|
|
682
|
-
async function resetMode(config) {
|
|
683
|
-
await removeConfigField(getConfigPath(config.cliname), "mode");
|
|
684
|
-
}
|
|
685
675
|
async function setExperimental(config, enabled) {
|
|
686
676
|
await setConfigField(getConfigPath(config.cliname), "experimental", enabled);
|
|
687
677
|
}
|
|
@@ -993,7 +983,6 @@ export {
|
|
|
993
983
|
requireValidAuth,
|
|
994
984
|
resetExperimental,
|
|
995
985
|
resetFeatureEnabled,
|
|
996
|
-
resetMode,
|
|
997
986
|
resolveConfig,
|
|
998
987
|
resolveConfigSync,
|
|
999
988
|
resolveRuntime,
|
|
@@ -1006,7 +995,6 @@ export {
|
|
|
1006
995
|
setExperimental,
|
|
1007
996
|
setFeatureEnabled,
|
|
1008
997
|
setFeatureOverride,
|
|
1009
|
-
setMode,
|
|
1010
998
|
shouldRefreshAuth,
|
|
1011
999
|
startLoginFlow,
|
|
1012
1000
|
success,
|