diff --git a/packages/cli/src/logger/index.ts b/packages/cli/src/logger/index.ts index 995befab29..fc62c49fe4 100644 --- a/packages/cli/src/logger/index.ts +++ b/packages/cli/src/logger/index.ts @@ -29,7 +29,7 @@ const PRIVATE_PARAMS = ['-k', '--key']; let _isInfoEnabled = false; let _infoFilter: Array = []; // let _c: RnvContext; -// let _isMono = false; +let _isMono = false; let _defaultColor: any = _chalkCols.white; let _highlightColor = _chalkCols.white; // let _analytics: AnalyticsApi; @@ -47,8 +47,9 @@ export const logInitialize = () => { // _analytics = analytics; if (ctx.program.opts().mono) { + _isMono = true; currentChalk = _chalkMono; - chalkBlue = _chalkMono; + chalkBlue = _chalkMono.white; } _updateDefaultColors(); // RNV = getCurrentCommand(); @@ -57,7 +58,7 @@ export const logInitialize = () => { export const logWelcome = () => { const ctx = getContext(); - if (ctx.program?.opts().help) return; + if (ctx.program?.opts().help || ctx.program?.opts().noIntro) return; const shortLen = 64; // prettier-ignore let str = _defaultColor(` @@ -74,7 +75,9 @@ export const logWelcome = () => { ctx.rnvVersion = ctx.files.rnv.package.version; str += printIntoBox( currentChalk.grey( - `${ICN_ROCKET} v:${ctx.rnvVersion} | ${'renative.org'} | ${ctx.timeStart.toLocaleString()}` + `${!_isMono ? ICN_ROCKET : 'RNV'} v:${ + ctx.rnvVersion + } | ${'renative.org'} | ${ctx.timeStart.toLocaleString()}` ), shortLen ); @@ -89,7 +92,7 @@ export const logWelcome = () => { // shortLen // ); // str += printIntoBox(` ${ICN_ROCKET} ${currentChalk.yellow('Firing up!...')}`); - str += printIntoBox(`$ ${currentChalk.bold(getCurrentCommand(true))}`, shortLen); + str += printIntoBox(`$ ${_highlightColor(getCurrentCommand(true))}`, shortLen); if (ctx.timeStart) { // str += printIntoBox(` Start Time: ${currentChalk.grey(ctx.timeStart.toLocaleString())}`); } @@ -144,8 +147,8 @@ export function stripAnsi(string: string) { // }; const _updateDefaultColors = () => { - _defaultColor = currentChalk; - _highlightColor = currentChalk.bold; //currentChalk.bold; + _defaultColor = currentChalk.white; + _highlightColor = currentChalk.bold.white; //currentChalk.bold; }; _updateDefaultColors(); @@ -207,8 +210,39 @@ export const logRaw = (...args: Array) => { export const logSummary = (opts?: { header?: string; headerStyle?: 'success' | 'warning' | 'error' | 'none' }) => { const ctx = getContext(); if (ctx.program?.opts().help) return; + if (_jsonOnly) { + if (!ctx.logging.logMessages || !ctx.logging.logMessages.length) { + return; + } else { + const cleanedMessages = ctx.logging.logMessages + .map(stripAnsi) + .map((msg) => { + const headerEndIndex = msg.indexOf(':') + 1; + const header = msg.slice(0, headerEndIndex).trim(); + const items = msg + .slice(headerEndIndex) + .split('\n') + .map((line) => line.trim()) + .filter((line) => line); + return `${header} ${items.join(', ')}`; + }) + .join(''); + return _printJson({ + type: 'summaryLog', + task: stripAnsi(_getCurrentTask()), + message: cleanedMessages, + }); + } + } - if (_jsonOnly) return; + if (ctx.program?.opts().noSummary) { + if (!ctx.logging.logMessages || !ctx.logging.logMessages.length) { + return; + } else { + console.log(ctx.logging.logMessages.join('').replace(/\n\s*\n\s*\n/g, '\n\n')); + return; + } + } if (ctx.paths.project.configExists && !ctx.paths.IS_NPX_MODE && !ctx.paths.IS_LINKED) { logAndSave(chalk().yellow('You are trying to run global rnv command in your current project.'), true); @@ -243,14 +277,20 @@ export const logSummary = (opts?: { header?: string; headerStyle?: 'success' | ' const headerPrefix = headerStyle === 'success' ? '✔ ' : headerStyle === 'warning' ? '⚠ ' : headerStyle === 'error' ? '⨯ ' : ''; const headerTextPlain = `${headerPrefix}${opts?.header || 'SUMMARY'}`; - const headerChalk = - headerStyle === 'success' - ? currentChalk.green.bold - : headerStyle === 'warning' - ? currentChalk.yellow.bold - : headerStyle === 'error' - ? currentChalk.green.red - : (v: string) => v; + let headerChalk; + + if (_isMono) { + headerChalk = currentChalk.white; + } else { + headerChalk = + headerStyle === 'success' + ? currentChalk.green.bold + : headerStyle === 'warning' + ? currentChalk.yellow.bold + : headerStyle === 'error' + ? currentChalk.green.red + : (v: string) => v; + } let str = printBoxStart( `${headerChalk(headerTextPlain)} ${timeString} | rnv@${ctx.rnvVersion}`, getCurrentCommand() @@ -469,8 +509,9 @@ export const logInitTask = (task: string) => { message: stripAnsi(_sanitizePaths(task)), }); } - - const msg = `${chalkBlue.bold('task:')} ○ ${task} ${taskCount}`; + const msg = !_isMono + ? `${chalkBlue.bold('task:')} ○ ${task} ${taskCount}` + : `${currentChalk.white('task:')} ○ ${task} ${taskCount}`; console.log(msg); }; @@ -536,7 +577,7 @@ export const logInfo = (msg: string) => { message: stripAnsi(_sanitizePaths(msg)), }); } - console.log(`${currentChalk.bold('info:')} ${_sanitizePaths(msg)}`); + console.log(`${_highlightColor('info:')} ${_sanitizePaths(msg)}`); }; export const logDebug = (...args: Array) => { @@ -616,7 +657,7 @@ export const logError = (e: Error | string | unknown, opts?: { skipAnalytics: bo export const logAppInfo = (c: RnvContext) => { if (!_jsonOnly) { - logInfo(`Current app config: ${currentChalk.bold(c.runtime.appId)}`); + logInfo(`Current app config: ${_highlightColor(c.runtime.appId)}`); } }; diff --git a/packages/core/src/configs/index.ts b/packages/core/src/configs/index.ts index 4b90b978b8..dfb150dbd2 100644 --- a/packages/core/src/configs/index.ts +++ b/packages/core/src/configs/index.ts @@ -210,7 +210,9 @@ export const loadDefaultConfigTemplates = async () => { if (!configTemplatesPath) { return Promise.reject( - `RNV Cannot find package: ${chalk().bold(pkgName)}. Looked in: ${chalk().gray(pathLookups.join(', '))}` + `RNV Cannot find package: ${chalk().bold.white(pkgName)}. Looked in: ${chalk().gray( + pathLookups.join(', ') + )}` ); } } diff --git a/packages/core/src/configs/workspaces.ts b/packages/core/src/configs/workspaces.ts index ec64f16d26..1d6633e0ad 100644 --- a/packages/core/src/configs/workspaces.ts +++ b/packages/core/src/configs/workspaces.ts @@ -54,11 +54,11 @@ export const getWorkspaceDirPath = async (c: RnvContext) => { const { conf } = await inquirerPrompt({ name: 'conf', type: 'confirm', - message: `Your project belongs to workspace ${chalk().bold( + message: `Your project belongs to workspace ${chalk().bold.white( ws - )}. do you want to add new workspace ${chalk().bold(ws)} to your local system at ${chalk().bold( - wsDir - )}?`, + )}. do you want to add new workspace ${chalk().bold.white( + ws + )} to your local system at ${chalk().bold.white(wsDir)}?`, warningMessage: 'No app configs found for this project', }); confirm = conf; @@ -88,7 +88,7 @@ export const getWorkspaceOptions = () => { return generateOptions(c.files.dotRnv.configWorkspaces?.workspaces, false, null, (i, obj, mapping, defaultVal) => { logDebug('getWorkspaceOptions'); - return ` [${chalk().grey(i + 1)}]> ${chalk().bold(defaultVal)} ${getWorkspaceConnectionString(obj)}\n`; + return ` [${chalk().grey(i + 1)}]> ${chalk().bold.white(defaultVal)} ${getWorkspaceConnectionString(obj)}\n`; }); }; diff --git a/packages/core/src/context/contextProps.ts b/packages/core/src/context/contextProps.ts index af480d32e4..24ba901c7e 100644 --- a/packages/core/src/context/contextProps.ts +++ b/packages/core/src/context/contextProps.ts @@ -142,7 +142,7 @@ export const getAppConfigBuildsFolder = (customPath?: string) => { const pp = customPath || c.paths.appConfig.dir; if (!pp) { logWarning( - `getAppConfigBuildsFolder: Path ${chalk().bold( + `getAppConfigBuildsFolder: Path ${chalk().bold.white( 'c.paths.appConfig.dir' )} not defined! can't return path. You might not be in renative project` ); diff --git a/packages/core/src/engines/index.ts b/packages/core/src/engines/index.ts index 7e36ad30a5..262f365e6a 100644 --- a/packages/core/src/engines/index.ts +++ b/packages/core/src/engines/index.ts @@ -207,9 +207,9 @@ export const loadEnginePluginDeps = async (engineConfigs: Array) => { if (v) { Object.keys(v).forEach((k) => { if (dupCheck[k]) { - logWarning(`Key ${chalk().bold(k)} is duplicated in your package.json`); + logWarning(`Key ${chalk().bold.white(k)} is duplicated in your package.json`); } dupCheck[k] = true; }); diff --git a/packages/core/src/platforms/index.ts b/packages/core/src/platforms/index.ts index 2e769f2ea8..72e97313a8 100644 --- a/packages/core/src/platforms/index.ts +++ b/packages/core/src/platforms/index.ts @@ -99,7 +99,7 @@ const _isPlatformSupportedSync = (platform: RnvPlatform, resolve?: () => void, r if (reject) { reject( chalk().red( - `Platform ${platform} is not supported. Use one of the following: ${chalk().bold( + `Platform ${platform} is not supported. Use one of the following: ${chalk().bold.white( c.runtime.availablePlatforms.join(', ') )} .` ) @@ -117,7 +117,9 @@ export const isPlatformActive = (resolve?: () => void) => { if (!c.buildConfig || !c.buildConfig.platforms) { logError( - `Your appConfigFile is not configured properly! check ${chalk().bold(c.paths.appConfig.config)} location.` + `Your appConfigFile is not configured properly! check ${chalk().bold.white( + c.paths.appConfig.config + )} location.` ); if (resolve) resolve(); return false; diff --git a/packages/core/src/plugins/index.ts b/packages/core/src/plugins/index.ts index 3be6a5cfc7..ecdea919d8 100644 --- a/packages/core/src/plugins/index.ts +++ b/packages/core/src/plugins/index.ts @@ -201,9 +201,9 @@ export const configurePlugins = async () => { // Skip Warning as this is intentional "plugin":null override } else { logWarning( - `Plugin with name ${chalk().bold( + `Plugin with name ${chalk().bold.white( k - )} does not exists in ReNative source:rnv scope. you need to define it manually here: ${chalk().bold( + )} does not exists in ReNative source:rnv scope. you need to define it manually here: ${chalk().bold.white( c.paths.project.builds.config )}` ); @@ -415,9 +415,9 @@ const _resolvePluginDependencies = async ( const { confirm } = await inquirerPrompt({ type: 'confirm', message: `Install ${key}?`, - warningMessage: `Plugin ${chalk().bold(key)} source:${chalk().bold(scope)} required by ${chalk().red( - parentKey - )} is not installed`, + warningMessage: `Plugin ${chalk().bold.white(key)} source:${chalk().bold.white( + scope + )} required by ${chalk().red(parentKey)} is not installed`, }); if (confirm && c.files.project.config_original?.plugins) { c.files.project.config_original.plugins[key] = `source:${scope}`; @@ -427,7 +427,9 @@ const _resolvePluginDependencies = async ( } } else { logWarning( - `Plugin ${chalk().bold(parentKey)} requires ${chalk().red(key)} which is not available in your system` + `Plugin ${chalk().bold.white(parentKey)} requires ${chalk().red( + key + )} which is not available in your system` ); } } else { @@ -533,13 +535,13 @@ export const parsePlugins = ( // ); // } } else { - logError(`You have no plugins defined in ${chalk().bold(c.paths.project.builds.config)}`); + logError(`You have no plugins defined in ${chalk().bold.white(c.paths.project.builds.config)}`); } } else { logWarning( - `You haven't included any ${chalk().bold('{ common: { includedPlugins: [] }}')} in your ${chalk().bold( - c.paths.appConfig.config - )}. Your app might not work correctly` + `You haven't included any ${chalk().bold.white( + '{ common: { includedPlugins: [] }}' + )} in your ${chalk().bold.white(c.paths.appConfig.config)}. Your app might not work correctly` ); } } @@ -684,7 +686,9 @@ const _overridePlugin = (c: RnvContext, pluginsPath: string, dir: string) => { // }); } else { logDebug( - `Your plugin configuration has no override path ${chalk().bold(source)}. skipping folder override action` + `Your plugin configuration has no override path ${chalk().bold.white( + source + )}. skipping folder override action` ); } @@ -761,7 +765,7 @@ export const overrideFileContents = (dest: string, override: Record { } } else { logInfo( - `Plugin overrides disabled for: ${chalk().bold(key)} with disablePluginTemplateOverrides. SKIPPING` + `Plugin overrides disabled for: ${chalk().bold.white( + key + )} with disablePluginTemplateOverrides. SKIPPING` ); } }, true); diff --git a/packages/core/src/projects/assets.ts b/packages/core/src/projects/assets.ts index c459904327..6bbb858907 100644 --- a/packages/core/src/projects/assets.ts +++ b/packages/core/src/projects/assets.ts @@ -28,9 +28,9 @@ export const copyRuntimeAssets = async () => { if (!c.buildConfig?.common) { logDebug('BUILD_CONFIG', c.buildConfig); logWarning( - `Your ${chalk().bold( + `Your ${chalk().bold.white( c.paths.appConfig.config - )} is misconfigured. (Maybe you have older version?). Missing ${chalk().bold( + )} is misconfigured. (Maybe you have older version?). Missing ${chalk().bold.white( '{ common: {} }' )} object at root` ); diff --git a/packages/core/src/projects/mutations.ts b/packages/core/src/projects/mutations.ts index f697e01754..c585748833 100644 --- a/packages/core/src/projects/mutations.ts +++ b/packages/core/src/projects/mutations.ts @@ -30,7 +30,7 @@ export const handleMutations = async () => { ); let msg = ''; mutations.forEach((m) => { - msg += `- ${chalk().bold(m.name)} (${chalk().red(m.original?.version || 'N/A')}) => (${chalk().green( + msg += `- ${chalk().bold.white(m.name)} (${chalk().red(m.original?.version || 'N/A')}) => (${chalk().green( m.updated.version )}) ${chalk().gray(`${m.msg} | ${m.source}`)}\n`; }); diff --git a/packages/core/src/projects/version.ts b/packages/core/src/projects/version.ts index 3bfe936d01..9b8434b26d 100644 --- a/packages/core/src/projects/version.ts +++ b/packages/core/src/projects/version.ts @@ -24,7 +24,7 @@ export const versionCheck = async (c: RnvContext) => { ); if (c.runtime.rnvVersionRunner && c.runtime.rnvVersionProject) { if (c.runtime.rnvVersionRunner !== c.runtime.rnvVersionProject && !c.program.opts().skipRnvCheck) { - const recCmd = chalk().bold(`$ npx ${getCurrentCommand(true)}`); + const recCmd = chalk().bold.white(`$ npx ${getCurrentCommand(true)}`); const actionNoUpdate = 'Continue and skip updating package.json'; const actionWithUpdate = 'Continue and update package.json'; const actionUpgrade = `Upgrade project to ${c.runtime.rnvVersionRunner}`; diff --git a/packages/core/src/system/exec.ts b/packages/core/src/system/exec.ts index 08afe82617..e8f228f15b 100755 --- a/packages/core/src/system/exec.ts +++ b/packages/core/src/system/exec.ts @@ -275,9 +275,9 @@ const execCLI = (cli: string, command: string, opts: ExecOptions = {}) => { c.buildConfig?.sdks ); return Promise.reject( - `Location of your cli ${chalk().bold(p)} does not exist. check your ${chalk().bold( + `Location of your cli ${chalk().bold.white(p)} does not exists. check your ${chalk().bold.white( c.paths.workspace.config - )} file if your ${chalk().bold('sdks')} paths are correct` + )} file if your ${chalk().bold.white('sdks')} paths are correct` ); } diff --git a/packages/core/src/system/fs.ts b/packages/core/src/system/fs.ts index bd5207c509..5f443cd9e6 100755 --- a/packages/core/src/system/fs.ts +++ b/packages/core/src/system/fs.ts @@ -520,7 +520,7 @@ export const readObjectSync = (filePath?: string, sanitize?: boolean } } } catch (e) { - logError(`readObjectSync: Parsing of ${chalk().bold(filePath)} failed with ${e}`); + logError(`readObjectSync: Parsing of ${chalk().bold.white(filePath)} failed with ${e}`); return null; } return obj as T; @@ -541,7 +541,7 @@ export const updateObjectSync = (filePath: string, updateObj: object) => { export const getRealPath = (p: string | undefined, key = 'undefined', original?: string) => { if (!p) { if (original) { - logDebug(`Path ${chalk().bold(key)} is not defined. using default: ${chalk().bold(original)}`); + logDebug(`Path ${chalk().bold.white(key)} is not defined. using default: ${chalk().bold.white(original)}`); } return original; } @@ -576,7 +576,7 @@ const _refToValue = (ref: string, key: string) => { const output = lGet(obj, valPath); return output; } else { - logWarning(`_refToValue: ${chalk().bold(realPath)} does not exist!`); + logWarning(`_refToValue: ${chalk().bold.white(realPath)} does not exist!`); } } return ref; diff --git a/packages/core/src/tasks/creators.ts b/packages/core/src/tasks/creators.ts index 84f3b5a11f..181dcd7c40 100644 --- a/packages/core/src/tasks/creators.ts +++ b/packages/core/src/tasks/creators.ts @@ -11,7 +11,11 @@ type TaskOptionsMap = Record, RnvTaskOption>; export const createTaskOptionsMap = (opts: ReadonlyArray>) => { const map: Partial> = {}; opts.forEach((opt) => { - map[opt.key] = opt; + if (opt.altKey) { + map[opt.altKey] = opt; + } else { + map[opt.key] = opt; + } }); return map as TaskOptionsMap; }; diff --git a/packages/core/src/tasks/taskExecutors.ts b/packages/core/src/tasks/taskExecutors.ts index 1542dc942c..7acc598f72 100644 --- a/packages/core/src/tasks/taskExecutors.ts +++ b/packages/core/src/tasks/taskExecutors.ts @@ -67,10 +67,11 @@ export const initializeTask = async (taskInstance: RnvTask | undefined) => { c.runtime.engine = getEngineRunnerByOwnerID(taskInstance); c.runtime.runtimeExtraProps = c.runtime.engine?.runtimeExtraProps || {}; } - if (c.runtime.engine?.config) { logInfo( - `Current engine: ${chalk().bold(c.runtime.engine?.id)} ${chalk().grey(`(${c.runtime.engine?.rootPath})`)}` + `Current engine: ${chalk().bold.white(c.runtime.engine?.id)} ${chalk().grey( + `(${c.runtime.engine?.rootPath})` + )}` ); } else { logInfo(`Current engine: n/a`); diff --git a/packages/core/src/tasks/taskHelpers.ts b/packages/core/src/tasks/taskHelpers.ts index ac0e39e4e0..7bcbdca252 100644 --- a/packages/core/src/tasks/taskHelpers.ts +++ b/packages/core/src/tasks/taskHelpers.ts @@ -6,7 +6,7 @@ import { RnvTask, RnvTaskOption } from './types'; const printCurrentPlatform = () => { const ctx = getContext(); - const msg = `Current platform: ${chalk().white.bold(ctx.platform)}`; + const msg = `Current platform: ${chalk().bold.white(ctx.platform)}`; logInfo(msg); }; @@ -68,6 +68,9 @@ export const generateStringFromTaskOption = (opt: RnvTaskOption) => { cmd += `-${opt.shortcut}, `; } cmd += `--${opt.key}`; + if (opt.altKey) { + cmd += `, --${opt.altKey}`; + } if (opt.isVariadic) { if (opt.isRequired) { cmd += ` `; diff --git a/packages/core/src/tasks/taskOptions.ts b/packages/core/src/tasks/taskOptions.ts index 8e034befd5..08a9b64ff0 100644 --- a/packages/core/src/tasks/taskOptions.ts +++ b/packages/core/src/tasks/taskOptions.ts @@ -14,10 +14,12 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'Show full debug Info', }, { - key: 'printExec', - // key: 'print-exec', + key: 'print-exec', + altKey: 'printExec', description: 'Print exec commands in full', }, + { key: 'no-summary', altKey: 'noSummary', description: 'Omit summary box in output' }, + { key: 'no-intro', altKey: 'noIntro', description: 'Omit intro box in output' }, { key: 'platform', shortcut: 'p', @@ -25,8 +27,8 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'select specific Platform', }, { - key: 'skipTasks', - // key: 'skip-tasks', + key: 'skip-tasks', + altKey: 'skipTasks', isValueType: true, isRequired: true, description: 'List tasks which you want to skip during rnv execution', @@ -46,8 +48,8 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'Monochrome console output without chalk', }, { - key: 'maxErrorLength', - // key: 'max-error-length', + key: 'max-error-length', + altKey: 'maxErrorLength', isValueType: true, isRequired: true, description: 'Specify how many characters each error should display. Default 200', @@ -61,15 +63,15 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'Default all prompts to yes', }, { - key: 'telemetryDebug', - // key: 'telemetry-debug', + key: 'telemetry-debug', + altKey: 'telemetryDebug', description: 'If you have telemetry enabled, will print out exactly what is being collected into the console', }, // OTHERS 1st -------------------------------- // Still present in core { - key: 'packageManager', - // key: 'package-manager', + key: 'package-manager', + altKey: 'packageManager', isValueType: true, isRequired: true, // options: ['yarn', 'npm'], @@ -77,8 +79,8 @@ export const RnvTaskOptions = createTaskOptionsMap([ examples: ['--packageManager yarn', '--packageManager npm'], }, { - key: 'npxMode', - // key: 'npx-mode', + key: 'npx-mode', + altKey: 'npxMode', description: 'Ensures you can use local npx rnv version after the command is done', }, { @@ -86,27 +88,27 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'Force engines to be loaded from node_modules rather than locally', }, { - key: 'configName', - // key: 'config-name', + key: 'config-name', + altKey: 'configName', isValueType: true, isRequired: true, description: 'Use custom name for ./renative.json. (applies only at root level)', }, { - key: 'skipDependencyCheck', - // key: 'skip-dependency-check', + key: 'skip-dependency-check', + altKey: 'skipDependencyCheck', description: 'Skips auto update of npm dependencies if mismatch found', }, { - key: 'appConfigID', - // key: 'app-config-id', + key: 'app-config-ID', + altKey: 'appConfigID', shortcut: 'c', isValueType: true, description: 'select specific app Config id', }, { - key: 'skipRnvCheck', - // key: 'skip-rnv-check', + key: 'skip-rnv-check', + altKey: 'skipRnvCheck', description: 'Skips auto update of rnv dependencies if mismatch found', }, { @@ -123,8 +125,8 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'engine to be used ie "engine-rn"', }, { - key: 'exeMethod', - // key: 'exe-method', + key: 'exe-method', + altKey: 'exeMethod', shortcut: 'x', isValueType: true, description: 'eXecutable method in buildHooks', @@ -135,14 +137,14 @@ export const RnvTaskOptions = createTaskOptionsMap([ description: 'also perform reset of platform build', }, { - key: 'resetHard', - // key: 'reset-hard', + key: 'reset-hard', + altKey: 'resetHard', shortcut: 'R', description: 'also perform reset of platform platform and platform assets', }, { - key: 'resetAssets', - // key: 'reset-assets', + key: 'reset-assets', + altKey: 'resetAssets', shortcut: 'a', description: 'also perform reset of platform assets', }, @@ -153,8 +155,8 @@ export const RnvTaskOptions = createTaskOptionsMap([ // OTHERS 2nd -------------------------------- // Still present in core but ONLY in runtime defaults { - // key: 'host-ip', - key: 'hostIp', + key: 'host-ip', + altKey: 'hostIp', isValueType: true, isRequired: true, description: 'Custom IP override', @@ -191,8 +193,8 @@ export const RnvTaskOptions = createTaskOptionsMap([ }, // SDK-WEBPACK -------------------------------- { - // key: 'debug-ip', - key: 'debugIp', + key: 'debug-ip', + altKey: 'debugIp', isValueType: true, isRequired: true, description: '(optional) overwrite the ip to which the remote debugger will connect', @@ -227,6 +229,9 @@ export const RnvTaskCoreOptionPresets = createTaskOptionsPreset({ RnvTaskOptions.help, RnvTaskOptions.printExec, RnvTaskOptions.telemetryDebug, + RnvTaskOptions.json, + RnvTaskOptions.noSummary, + RnvTaskOptions.noIntro, ], }); diff --git a/packages/core/src/tasks/types.ts b/packages/core/src/tasks/types.ts index 020fd4c9a0..43ea832096 100644 --- a/packages/core/src/tasks/types.ts +++ b/packages/core/src/tasks/types.ts @@ -66,6 +66,7 @@ export type TaskPromptOption = { export type RnvTaskOption = { shortcut?: string; key: OKey extends string ? OKey : never; + altKey?: OKey extends string ? OKey : never; isRequired?: boolean; isValueType?: boolean; isVariadic?: boolean; diff --git a/packages/core/src/templates/index.ts b/packages/core/src/templates/index.ts index 269b5a9d61..ba0e057579 100644 --- a/packages/core/src/templates/index.ts +++ b/packages/core/src/templates/index.ts @@ -99,9 +99,9 @@ const _applyTemplate = async (c: RnvContext) => { } if (!fsExistsSync(c.paths.template.configTemplate)) { logWarning( - `Template file ${chalk().bold(c.paths.template.configTemplate)} does not exist. check your ${chalk().bold( - c.paths.template.dir - )}. skipping` + `Template file ${chalk().bold.white( + c.paths.template.configTemplate + )} does not exist. check your ${chalk().bold.white(c.paths.template.dir)}. skipping` ); return true; } @@ -139,10 +139,10 @@ const _copyIncludedPaths = (c: RnvContext, name: string) => { if (!fsExistsSync(destPath) && fsExistsSync(sourcePath)) { try { if (fsLstatSync(sourcePath).isDirectory()) { - logInfo(`Missing directory ${chalk().bold(`${destPath}.js`)}. COPYING from TEMPLATE...DONE`); + logInfo(`Missing directory ${chalk().bold.white(`${destPath}.js`)}. COPYING from TEMPLATE...DONE`); copyFolderContentsRecursiveSync(sourcePath, destPath); } else { - logInfo(`Missing file ${chalk().bold(`${destPath}.js`)}. COPYING from TEMPLATE...DONE`); + logInfo(`Missing file ${chalk().bold.white(`${destPath}.js`)}. COPYING from TEMPLATE...DONE`); copyFileSync(sourcePath, destPath); } } catch (e) { diff --git a/packages/engine-core/src/buildSchemes.ts b/packages/engine-core/src/buildSchemes.ts index 3a882a6460..30fcc95c8d 100644 --- a/packages/engine-core/src/buildSchemes.ts +++ b/packages/engine-core/src/buildSchemes.ts @@ -55,6 +55,6 @@ export const isBuildSchemeSupported = async () => { c.program.opts().scheme = schemeVals[selectedScheme]; c.runtime.scheme = c.program.opts().scheme; } - logInfo(`Current Build Scheme: ${chalk().bold(c.runtime.scheme)}`); + logInfo(`Current Build Scheme: ${chalk().bold.white(c.runtime.scheme)}`); return true; }; diff --git a/packages/engine-core/src/taskOptions.ts b/packages/engine-core/src/taskOptions.ts index aa3d261110..c25568bdfa 100644 --- a/packages/engine-core/src/taskOptions.ts +++ b/packages/engine-core/src/taskOptions.ts @@ -9,7 +9,8 @@ export const TaskOptions = createTaskOptionsMap([ description: 'Pass the key/password', }, { - key: 'gitEnabled', + key: 'git-enabled', + altKey: 'gitEnabled', description: 'Enable git in your newly created project', isValueType: true, }, @@ -33,17 +34,20 @@ export const TaskOptions = createTaskOptionsMap([ description: 'select specific template', }, { - key: 'projectName', + key: 'project-name', + altKey: 'projectName', isValueType: true, description: 'select the name of the new project', }, { - key: 'projectTemplate', + key: 'project-template', + altKey: 'projectTemplate', isValueType: true, description: 'select the template of new project', }, { - key: 'templateVersion', + key: 'template-version', + altKey: 'templateVersion', isValueType: true, description: 'select the template version', }, @@ -53,7 +57,8 @@ export const TaskOptions = createTaskOptionsMap([ description: 'select the title of the app', }, { - key: 'appVersion', + key: 'app-version', + altKey: 'appVersion', isValueType: true, description: 'select the version of the app', }, diff --git a/packages/engine-core/src/tasks/app/taskAppConfigure.ts b/packages/engine-core/src/tasks/app/taskAppConfigure.ts index 8c1e6784f7..76dc129d13 100644 --- a/packages/engine-core/src/tasks/app/taskAppConfigure.ts +++ b/packages/engine-core/src/tasks/app/taskAppConfigure.ts @@ -117,7 +117,7 @@ const _findAndSwitchAppConfigDir = async (ctx: RnvContext) => { if (appConfigsDirNames.length) { if (appConfigsDirNames.length === 1) { // we have only one, skip the question - logInfo(`Found only one app config available. Will use ${chalk().bold(appConfigsDirNames[0])}`); + logInfo(`Found only one app config available. Will use ${chalk().bold.white(appConfigsDirNames[0])}`); _setAppId(ctx, appConfigsDirNames[0]); return true; } @@ -182,7 +182,7 @@ const appConfigure = async () => { } else if (ctx.program.opts().appConfigID) { const aid = await matchAppConfigID(ctx, ctx.program.opts().appConfigID); if (!aid) { - logWarning(`Cannot find app config ${chalk().bold(ctx.program.opts().appConfigID)}`); + logWarning(`Cannot find app config ${chalk().bold.white(ctx.program.opts().appConfigID)}`); const hasAppConfig = await _findAndSwitchAppConfigDir(ctx); if (!hasAppConfig) { // await executeTask(c, RnvTaskName.appCreate, RnvTaskName.appConfigure); diff --git a/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts b/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts index 994cfc963c..716a26eb99 100644 --- a/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts +++ b/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts @@ -189,7 +189,7 @@ export const generateProjectOverview = (data: NewProjectData) => { Enabled Platforms: ${highlight((inputs.supportedPlatforms || []).join(', '))} ------------------------- ${chalk().green('✔ Your project is ready!')} Run it with: -${chalk().bold(` +${chalk().bold.white(` cd ${inputs.projectFolderName}${installAddon} npx rnv run`)}`; diff --git a/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts b/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts index 477d0761ab..37447e5770 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts @@ -26,9 +26,9 @@ const Question = async (data: NewProjectData): Promise => { appConfig.common.id = inputs.appID; appConfig.common.description = `This is ${inputs.appTitle} app!`; logInfo( - `Updating appConfig ${chalk().bold(appConfigID)} with title: ${chalk().bold( + `Updating appConfig ${chalk().bold.white(appConfigID)} with title: ${chalk().bold.white( inputs.appTitle - )} and id: ${chalk().bold(inputs.appID)}` + )} and id: ${chalk().bold.white(inputs.appID)}` ); writeFileSync(appCnfPath, appConfig); } diff --git a/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts b/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts index 641416f77d..7bfe26fa59 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts @@ -23,7 +23,7 @@ const Question = async (data: NewProjectData) => { const { confirmAddTemplate } = await inquirerPrompt({ name: 'confirmAddTemplate', type: 'confirm', - message: `Would you like to add ${chalk().bold(inputs.template.packageName)} to your ${ + message: `Would you like to add ${chalk().bold.white(inputs.template.packageName)} to your ${ inputs.workspaceID } workspace template list?`, }); diff --git a/packages/engine-core/src/tasks/crypto/common.ts b/packages/engine-core/src/tasks/crypto/common.ts index c4bec2af82..48e15d19f5 100644 --- a/packages/engine-core/src/tasks/crypto/common.ts +++ b/packages/engine-core/src/tasks/crypto/common.ts @@ -16,9 +16,9 @@ import path from 'path'; export const getEnvExportCmd = (envVar: string, key: string) => { if (isSystemWin) { - return `${chalk().bold(`setx ${envVar} "${key}"`)}`; + return `${chalk().bold.white(`setx ${envVar} "${key}"`)}`; } - return `${chalk().bold(`export ${envVar}="${key}"`)}`; + return `${chalk().bold.white(`export ${envVar}="${key}"`)}`; }; export const getEnvVar = () => { diff --git a/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts b/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts index 225074c803..e5e60f236e 100644 --- a/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts +++ b/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts @@ -72,7 +72,7 @@ export default createTask({ name: 'option', type: 'list', choices: options, - message: `How to decrypt to ${chalk().bold(destFolder)} ?`, + message: `How to decrypt to ${chalk().bold.white(destFolder)} ?`, }); if (option === options[0]) { shouldCleanFolder = true; @@ -86,7 +86,7 @@ export default createTask({ if (fsExistsSync(destTemp)) { const { confirm } = await inquirerPrompt({ type: 'confirm', - message: `Found existing decrypted file at ${chalk().bold( + message: `Found existing decrypted file at ${chalk().bold.white( destTemp )}. want to use it and skip decrypt ?`, }); @@ -98,7 +98,7 @@ export default createTask({ const key = ctx.program.opts().key || ctx.process.env[envVar]; if (!key) { - return Promise.reject(`encrypt: You must pass ${chalk().bold('--key')} or have env var defined: + return Promise.reject(`encrypt: You must pass ${chalk().bold.white('--key')} or have env var defined: ${getEnvExportCmd(envVar, 'REPLACE_WITH_ENV_VARIABLE')} @@ -106,7 +106,7 @@ Make sure you take into account special characters that might need to be escaped `); } if (!fsExistsSync(source)) { - return Promise.reject(`Can't decrypt. ${chalk().bold(source)} is missing!`); + return Promise.reject(`Can't decrypt. ${chalk().bold.white(source)} is missing!`); } let data; @@ -124,14 +124,16 @@ ${e} ${chalk().green('SUGGESTION:')} ${chalk().yellow('STEP 1:')} - run: ${chalk().bold('rnv crypto encrypt')} locally at least once and commit the result back to your repository + run: ${chalk().bold.white( + 'rnv crypto encrypt' + )} locally at least once and commit the result back to your repository ${chalk().yellow('STEP 2:')} - you should be able to use: ${chalk().bold('rnv crypto decrypt')} properly now + you should be able to use: ${chalk().bold.white('rnv crypto decrypt')} properly now ${chalk().yellow('IF ALL HOPE IS LOST:')} Raise new issue and copy this SUMMARY box output at: - ${chalk().bold('https://github.com/flexn-io/renative/issues')} + ${chalk().bold.white('https://github.com/flexn-io/renative/issues')} and we will try to help! `; @@ -148,14 +150,14 @@ ${chalk().green('SUGGESTION:')} ${chalk().yellow('STEP 1:')} check if your ENV VAR is correct: ${getEnvExportCmd(envVar, '***********')} Make sure you take into account special characters that might need to be escaped -or if someone did not encrypt ${chalk().bold(source)} with a different key +or if someone did not encrypt ${chalk().bold.white(source)} with a different key ${chalk().yellow('STEP 2:')} run crypto decrypt again ${chalk().yellow('IF ALL HOPE IS LOST:')} Raise new issue and copy this SUMMARY box output at: -${chalk().bold('https://github.com/flexn-io/renative/issues')} +${chalk().bold.white('https://github.com/flexn-io/renative/issues')} and we will try to help! `); @@ -195,7 +197,7 @@ and we will try to help! await _unzipAndCopy(ctx, shouldCleanFolder, destTemp, wsPath, ts, destFolder); } else { - logWarning(`You don't have {{ crypto.path }} specificed in ${chalk().bold(ctx.paths.appConfigBase)}`); + logWarning(`You don't have {{ crypto.path }} specificed in ${chalk().bold.white(ctx.paths.appConfigBase)}`); return true; } }, diff --git a/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts b/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts index 7915d4497e..62f3111346 100644 --- a/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts +++ b/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts @@ -123,7 +123,7 @@ const _checkAndConfigureCrypto = async () => { if (!fsExistsSync(sourceFolder)) { logInfo( - `It seems you are running encrypt for the first time. Directory ${chalk().bold( + `It seems you are running encrypt for the first time. Directory ${chalk().bold.white( sourceFolder )} does not exist yet. RNV will create it for you, make sure you add whatever you want encrypted in it and then run the command again` @@ -151,7 +151,7 @@ RNV will create it for you, make sure you add whatever you want encrypted in it key = generateRandomKey(20); keyGenerated = true; } else { - return Promise.reject(`encrypt: You must pass ${chalk().bold('--key')} or have env var defined: + return Promise.reject(`encrypt: You must pass ${chalk().bold.white('--key')} or have env var defined: ${getEnvExportCmd(envVar, 'REPLACE_WITH_ENV_VARIABLE')} @@ -232,7 +232,7 @@ export default createTask({ fsWriteFileSync(`${tsWorkspacePath}`, `${timestamp}`); logSuccess(`Files successfully encrypted into ${dest}`); } else { - logWarning(`You don't have {{ crypto.path }} specificed in ${chalk().bold(ctx.paths.appConfigBase)}`); + logWarning(`You don't have {{ crypto.path }} specificed in ${chalk().bold.white(ctx.paths.appConfigBase)}`); } }, options: [TaskOptions.key], diff --git a/packages/engine-core/src/tasks/global/taskHelp.ts b/packages/engine-core/src/tasks/global/taskHelp.ts index 9328512231..d2948a8a44 100644 --- a/packages/engine-core/src/tasks/global/taskHelp.ts +++ b/packages/engine-core/src/tasks/global/taskHelp.ts @@ -30,11 +30,11 @@ export default createTask({ const cmdsString = commands.join(', '); logToSummary(` -${chalk().bold('COMMANDS:')} +${chalk().bold.white('COMMANDS:')} ${cmdsString} -${chalk().bold('OPTIONS:')} +${chalk().bold.white('OPTIONS:')} ${optsString} `); diff --git a/packages/engine-core/src/tasks/global/taskKill.ts b/packages/engine-core/src/tasks/global/taskKill.ts index a40544fda0..3391cf6a5e 100644 --- a/packages/engine-core/src/tasks/global/taskKill.ts +++ b/packages/engine-core/src/tasks/global/taskKill.ts @@ -48,7 +48,7 @@ export default createTask({ type: 'confirm', message: 'Processes attached to the ports will be killed. Continue?', warningMessage: `Found active ports: -${usedPorts.map((v) => chalk().bold(`> ${v.port} (${v.platform})`)).join('\n')}`, +${usedPorts.map((v) => chalk().bold.white(`> ${v.port} (${v.platform})`)).join('\n')}`, }); if (confirm) { const killPromise = []; diff --git a/packages/engine-core/src/tasks/linking/linker.ts b/packages/engine-core/src/tasks/linking/linker.ts index caa828500e..ebf0c32137 100644 --- a/packages/engine-core/src/tasks/linking/linker.ts +++ b/packages/engine-core/src/tasks/linking/linker.ts @@ -72,7 +72,7 @@ export const getSourceDir = () => { const dirOption = ctx.program.opts().dir; if (dirOption) { - logInfo(`Using custom source directory: ${chalk().bold(dirOption)}`); + logInfo(`Using custom source directory: ${chalk().bold.white(dirOption)}`); } // As default we'll use the development source directory which is a monorepo diff --git a/packages/engine-core/src/tasks/linking/taskLink.ts b/packages/engine-core/src/tasks/linking/taskLink.ts index 0a9efc7ef0..1cc044473f 100644 --- a/packages/engine-core/src/tasks/linking/taskLink.ts +++ b/packages/engine-core/src/tasks/linking/taskLink.ts @@ -54,7 +54,7 @@ export default createTask({ const choices: { name: string; value: LinkablePackage }[] = []; linkablePackages.forEach((pkg) => { - const title = `${pkg.nmPath.replace(pkg.name, chalk().bold(pkg.name))} ${ + const title = `${pkg.nmPath.replace(pkg.name, chalk().bold.white(pkg.name))} ${ pkg.isBrokenLink ? chalk().red('(broken)') : pkg.isLinked ? chalk().green('(linked)') : '(unlinked)' }\n`; diff --git a/packages/engine-core/src/tasks/linking/taskUnlink.ts b/packages/engine-core/src/tasks/linking/taskUnlink.ts index bb6c631e4a..610cbbcb31 100644 --- a/packages/engine-core/src/tasks/linking/taskUnlink.ts +++ b/packages/engine-core/src/tasks/linking/taskUnlink.ts @@ -25,7 +25,7 @@ export default createTask({ let msg = 'Found following source packages:\n\n'; linkablePackages.forEach((pkg) => { - msg += `${pkg.nmPath.replace(pkg.name, chalk().bold(pkg.name))} ${ + msg += `${pkg.nmPath.replace(pkg.name, chalk().bold.white(pkg.name))} ${ pkg.isBrokenLink ? chalk().red('(broken)') : pkg.isLinked ? chalk().green('(linked)') : '(unlinked)' }\n`; }); diff --git a/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts b/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts index f715721eb7..33d452ee56 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts @@ -35,9 +35,9 @@ export default createTask({ if (!fsExistsSync(dest)) { if (!entryFile) { logWarning( - `Missing ${chalk().red(entryFile)} key for ${chalk().bold( + `Missing ${chalk().red(entryFile)} key for ${chalk().bold.white( ctx.platform - )} platform in your ${chalk().bold(ctx.paths.appConfig.config)}.` + )} platform in your ${chalk().bold.white(ctx.paths.appConfig.config)}.` ); } } @@ -57,7 +57,7 @@ export default createTask({ if ((program.opts().reset || program.opts().resetHard) && !ctx.runtime.disableReset) { logInfo( - `You passed ${chalk().bold(program.opts().reset ? '-r' : '-R')} argument. "${chalk().bold( + `You passed ${chalk().bold.white(program.opts().reset ? '-r' : '-R')} argument. "${chalk().bold.white( getAppFolder() )}" CLEANING...DONE` ); diff --git a/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts b/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts index cd1f51b01f..705f3ddaac 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts @@ -75,7 +75,7 @@ export default createTask({ } logSuccess( - `${chalk().bold( + `${chalk().bold.white( selectedPlatforms.join(',') )} now using ReNative platformTemplates located associated platform engines.` ); diff --git a/packages/engine-core/src/tasks/platform/taskPlatformEject.ts b/packages/engine-core/src/tasks/platform/taskPlatformEject.ts index 92354289c1..649dddb71f 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformEject.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformEject.ts @@ -25,7 +25,7 @@ export default createTask({ if (ctx.platform) { selectedPlatforms = [ctx.platform]; } else { - logInfo(`Preparing to eject engine platforms to local ${chalk().bold('./platformTemplates')}`); + logInfo(`Preparing to eject engine platforms to local ${chalk().bold.white('./platformTemplates')}`); const { ejectedPlatforms } = await inquirerPrompt({ name: 'ejectedPlatforms', message: 'Select platforms you would like to eject (use SPACE key)', @@ -54,13 +54,15 @@ export default createTask({ }); logSuccess( - `${chalk().bold(selectedPlatforms.join(','))} platform templates are located in ${chalk().bold( + `${chalk().bold.white( + selectedPlatforms.join(',') + )} platform templates are located in ${chalk().bold.white( ctx.files.project.config?.paths?.platformTemplatesDirs?.[selectedPlatforms[0]] )} now. You can edit them directly!` ); } else { logError(`You haven't selected any platform to eject. -TIP: You can select options with ${chalk().bold('SPACE')} key before pressing ENTER!`); +TIP: You can select options with ${chalk().bold.white('SPACE')} key before pressing ENTER!`); } }, task: RnvTaskName.platformEject, diff --git a/packages/engine-core/src/tasks/platform/taskPlatformList.ts b/packages/engine-core/src/tasks/platform/taskPlatformList.ts index b9e7f2e038..f15d544cb8 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformList.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformList.ts @@ -4,7 +4,7 @@ export default createTask({ description: 'List all available platforms', dependsOn: [RnvTaskName.projectConfigure], fn: async () => { - const opts = generatePlatformChoices().map((v, i) => ` [${chalk().bold(i + 1)}]> ${v.name}`); + const opts = generatePlatformChoices().map((v, i) => ` [${chalk().bold.white(i + 1)}]> ${v.name}`); logToSummary(`Platforms:\n\n${opts.join('\n')}`); return true; }, diff --git a/packages/engine-core/src/tasks/plugin/taskHelpers.ts b/packages/engine-core/src/tasks/plugin/taskHelpers.ts index 36cca370e1..6c5a573f5e 100644 --- a/packages/engine-core/src/tasks/plugin/taskHelpers.ts +++ b/packages/engine-core/src/tasks/plugin/taskHelpers.ts @@ -43,7 +43,7 @@ export const getPluginList = (isUpdate = false) => { } else { versionString = `(${chalk().green(installedPluginVersion)})`; } - output.asString += ` [${i}]> ${chalk().bold(k)} ${versionString}\n`; + output.asString += ` [${i}]> ${chalk().bold.white(k)} ${versionString}\n`; output.asArray.push({ name: `${k} ${versionString}`, value: k, @@ -52,7 +52,7 @@ export const getPluginList = (isUpdate = false) => { i++; } else if (!isUpdate) { output.plugins.push(k); - output.asString += ` [${i}]> ${chalk().bold(k)} (${chalk().grey( + output.asString += ` [${i}]> ${chalk().bold.white(k)} (${chalk().grey( plugin.disableNpm ? '(no npm)' : plugin.version )}) [${platforms}] - ${installedString}\n`; output.asArray.push({ diff --git a/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts b/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts index 152b83b3e6..c883048d39 100644 --- a/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts +++ b/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts @@ -35,10 +35,10 @@ export default createTask({ }); selectedPlugins[plugin] = o.allPlugins[plugin]; - installMessage.push(`${chalk().bold(plugin)} v(${chalk().green(o.allPlugins[plugin].version)})`); + installMessage.push(`${chalk().bold.white(plugin)} v(${chalk().green(o.allPlugins[plugin].version)})`); } else { selectedPlugins[selPluginKey] = selPlugin; - installMessage.push(`${chalk().bold(selPluginKey)} v(${chalk().green(selPlugin.version)})`); + installMessage.push(`${chalk().bold.white(selPluginKey)} v(${chalk().green(selPlugin.version)})`); } const questionPlugins: Record = {}; diff --git a/packages/engine-core/src/tasks/project/taskProjectConfigure.ts b/packages/engine-core/src/tasks/project/taskProjectConfigure.ts index 14fab37026..fef016e25f 100644 --- a/packages/engine-core/src/tasks/project/taskProjectConfigure.ts +++ b/packages/engine-core/src/tasks/project/taskProjectConfigure.ts @@ -34,9 +34,9 @@ const checkIsRenativeProject = async () => { const { paths } = c; if (!paths.project.configExists) { return Promise.reject( - `This directory is not ReNative project. Project config ${chalk().bold( + `This directory is not ReNative project. Project config ${chalk().bold.white( paths.project.config - )} is missing!. You can create new project with ${chalk().bold('rnv new')}` + )} is missing!. You can create new project with ${chalk().bold.white('rnv new')}` ); } return true; @@ -114,14 +114,14 @@ export default createTask({ if (!runtime.disableReset) { if (program.opts().resetHard) { logInfo( - `You passed ${chalk().bold('-R, --resetHard')} argument. "${chalk().bold( + `You passed ${chalk().bold.white('-R, --resetHard')} argument. "${chalk().bold.white( './platformAssets' )}" will be cleaned up first` ); await cleanPlaformAssets(); } else if (program.opts().resetAssets) { logInfo( - `You passed ${chalk().bold('-a, --resetAssets')} argument. "${chalk().bold( + `You passed ${chalk().bold.white('-a, --resetAssets')} argument. "${chalk().bold.white( './platformAssets' )}" will be cleaned up first` ); diff --git a/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts b/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts index 766ffbef6d..3d5235da6a 100644 --- a/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts +++ b/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts @@ -47,13 +47,13 @@ export default createTask({ if (files.workspace.config?.appConfigsPath) { if (!fsExistsSync(files.workspace.config.appConfigsPath)) { logWarning( - `Your custom global appConfig is pointing to ${chalk().bold( + `Your custom global appConfig is pointing to ${chalk().bold.white( files.workspace.config.appConfigsPath )} which doesn't exist! Make sure you create one in that location` ); } else { logInfo( - `Found custom appConfing location pointing to ${chalk().bold( + `Found custom appConfing location pointing to ${chalk().bold.white( files.workspace.config.appConfigsPath )}. ReNativewill now swith to that location!` ); @@ -64,7 +64,7 @@ export default createTask({ // Check config sanity if (files.workspace.config?.defaultTargets === undefined) { logWarning( - `You're missing defaultTargets in your config ${chalk().bold( + `You're missing defaultTargets in your config ${chalk().bold.white( paths.workspace.config )}. Let's add them!` ); diff --git a/packages/engine-core/src/tasks/workspace/taskWorkspaceList.ts b/packages/engine-core/src/tasks/workspace/taskWorkspaceList.ts index 776e63ab58..09743cff53 100644 --- a/packages/engine-core/src/tasks/workspace/taskWorkspaceList.ts +++ b/packages/engine-core/src/tasks/workspace/taskWorkspaceList.ts @@ -10,7 +10,7 @@ export default createTask({ null, (i, obj, mapping, defaultVal) => { const isConnected = ''; - return ` [${chalk().grey(i + 1)}]> ${chalk().bold(defaultVal)}${isConnected} \n`; + return ` [${chalk().grey(i + 1)}]> ${chalk().bold.white(defaultVal)}${isConnected} \n`; } ); diff --git a/packages/engine-rn-electron/src/sdk/runner.ts b/packages/engine-rn-electron/src/sdk/runner.ts index 400f1827f5..eea898ac04 100644 --- a/packages/engine-rn-electron/src/sdk/runner.ts +++ b/packages/engine-rn-electron/src/sdk/runner.ts @@ -92,7 +92,7 @@ const configureProject = (exitOnFail?: boolean) => if (!fsExistsSync(packagePath)) { if (exitOnFail) { - logWarning(`Your ${chalk().bold(platform)} platformBuild is misconfigured!. let's repair it.`); + logWarning(`Your ${chalk().bold.white(platform)} platformBuild is misconfigured!. let's repair it.`); createPlatformBuild(platform) .then(() => configureElectronProject(true)) .then(() => resolve()) @@ -333,7 +333,7 @@ export const runElectron = async () => { const isPortActive = await checkPortInUse(port); if (!isPortActive) { logInfo( - `Your ${chalk().bold(platform)} devServer at port ${chalk().bold( + `Your ${chalk().bold.white(platform)} devServer at port ${chalk().bold.white( port )} is not running. Starting it up for you...` ); @@ -395,7 +395,7 @@ const _generateICNS = (c: RnvContext) => // It's ok if icns are not generated as png is also valid https://www.electron.build/icons.html#macos if (!source) { logWarning( - `You are missing AppIcon.iconset in ${chalk().bold( + `You are missing AppIcon.iconset in ${chalk().bold.white( c.paths.appConfig.dir )}. icon.icns will not be generated!` ); @@ -404,7 +404,7 @@ const _generateICNS = (c: RnvContext) => } if (!fsExistsSync(source)) { - logWarning(`Your app config is missing ${chalk().bold(source)}. icon.icns will not be generated!`); + logWarning(`Your app config is missing ${chalk().bold.white(source)}. icon.icns will not be generated!`); resolve(); return; } diff --git a/packages/engine-rn-next/src/sdk/env.ts b/packages/engine-rn-next/src/sdk/env.ts index 0df661cc36..9b55563db0 100644 --- a/packages/engine-rn-next/src/sdk/env.ts +++ b/packages/engine-rn-next/src/sdk/env.ts @@ -51,7 +51,7 @@ const _checkPagesDir = () => { const pagesDirPath = path.join(c.paths.project.dir, pagesDir); if (!fsExistsSync(pagesDirPath)) { logWarning( - `You configured custom ${c.platform}pagesDir: ${chalk().bold( + `You configured custom ${c.platform}pagesDir: ${chalk().bold.white( pagesDir )} in your renative.json but it is missing at ${chalk().red(pagesDirPath)}` ); @@ -63,7 +63,7 @@ const _checkPagesDir = () => { const fallbackPagesDirPath = path.join(c.paths.project.dir, fallbackPagesDir); if (!fsExistsSync(fallbackPagesDirPath)) { - logWarning(`Folder ${chalk().bold( + logWarning(`Folder ${chalk().bold.white( fallbackPagesDir )} is missing. make sure your entry code is located there in order for next to work correctly! Alternatively you can configure custom entry folder via ${c.platform}.pagesDir in renative.json`); diff --git a/packages/engine-rn-next/src/sdk/runner.ts b/packages/engine-rn-next/src/sdk/runner.ts index f3a6ba92b4..44ab753d99 100644 --- a/packages/engine-rn-next/src/sdk/runner.ts +++ b/packages/engine-rn-next/src/sdk/runner.ts @@ -46,9 +46,9 @@ export const runWebNext = async () => { if (!isPortActive) { logInfo( - `Your ${chalk().bold(platform)} devServerHost ${chalk().bold(devServerHost)} at port ${chalk().bold( - port - )} is not running. Starting it up for you...` + `Your ${chalk().bold.white(platform)} devServerHost ${chalk().bold.white( + devServerHost + )} at port ${chalk().bold.white(port)} is not running. Starting it up for you...` ); await _runWebBrowser(devServerHost, port, false); @@ -104,7 +104,6 @@ export const buildWebNext = async () => { const c = getContext(); logDefault('buildWebNext'); - // On Windows npx does not always resolve correct path, hence we manually resolve it here // https://github.com/flexn-io/renative/issues/1409#issuecomment-2095531486 const nextCmnd = `node ${path.join(path.dirname(require.resolve('next/package.json')), 'dist', 'bin', 'next')}`; diff --git a/packages/integration-docker/src/docker.ts b/packages/integration-docker/src/docker.ts index d7d61bae21..f717bd2b12 100644 --- a/packages/integration-docker/src/docker.ts +++ b/packages/integration-docker/src/docker.ts @@ -95,16 +95,16 @@ class Docker { logDefault('docker:Dockerfile:build'); await executeAsync(`docker save -o ${dockerSaveFile} ${imageName}:${appVersion}`); logSuccess( - `${imageName}_${appVersion}.tar file has been saved in ${chalk().bold( + `${imageName}_${appVersion}.tar file has been saved in ${chalk().bold.white( dockerDestination - )}. You can import it on another machine by running ${chalk().bold( + )}. You can import it on another machine by running ${chalk().bold.white( `'docker load -i ${imageName}_${appVersion}.tar'` )}` ); logSuccess( - `You can also test it locally by running the following command: ${chalk().bold( + `You can also test it locally by running the following command: ${chalk().bold.white( `'docker run -d --rm -p 8081:80 -p 8443:443 ${imageName}:${appVersion}'` - )} and then opening ${chalk().bold('http://localhost:8081')}` + )} and then opening ${chalk().bold.white('http://localhost:8081')}` ); const deployOptions = getConfigProp('custom').deploy; diff --git a/packages/sdk-android/src/deviceManager.ts b/packages/sdk-android/src/deviceManager.ts index cb32b11016..ff6ffa2c0e 100644 --- a/packages/sdk-android/src/deviceManager.ts +++ b/packages/sdk-android/src/deviceManager.ts @@ -162,7 +162,7 @@ const _getDeviceAsString = (device: AndroidDevice, i: number): string => { const { name, udid, isDevice, isActive, arch } = device; const deviceIcon = getDeviceIcon(device); - const deviceString = `${chalk().bold(name)} | ${deviceIcon} | arch: ${arch} | udid: ${chalk().grey(udid)}${ + const deviceString = `${chalk().bold.white(name)} | ${deviceIcon} | arch: ${arch} | udid: ${chalk().grey(udid)}${ isDevice ? chalk().red(' (device)') : '' } ${isActive ? chalk().magenta(' (active)') : ''}`; @@ -173,7 +173,7 @@ const _getDeviceAsObject = (device: AndroidDevice): DeviceInfo => { const { name, udid, isDevice, isActive, arch } = device; const deviceIcon = getDeviceIcon(device); - const deviceString = `${chalk().bold(name)} | ${deviceIcon} | arch: ${arch} | udid: ${chalk().grey(udid)}${ + const deviceString = `${chalk().bold.white(name)} | ${deviceIcon} | arch: ${arch} | udid: ${chalk().grey(udid)}${ isDevice ? chalk().red(' (device)') : '' } ${isActive ? chalk().magenta(' (active)') : ''}`; @@ -625,7 +625,7 @@ export const askForNewEmulator = async () => { const { confirm } = await inquirerPrompt({ name: 'confirm', type: 'confirm', - message: `Do you want ReNative to create new Emulator (${chalk().bold( + message: `Do you want ReNative to create new Emulator (${chalk().bold.white( emuName )}) for you? Warning: created simulator can malfunction.`, }); @@ -743,11 +743,11 @@ export const checkForActiveEmulator = (emulatorName?: string) => logDebug('Available devices after filtering', simsOnly); const found = emulatorName && simsOnly.find((v) => v.name === emulatorName); if (found) { - logSuccess(`Found active emulator! ${chalk().bold(found.udid)}. Will use it`); + logSuccess(`Found active emulator! ${chalk().bold.white(found.udid)}. Will use it`); clearInterval(poll); resolve(found); } else if (simsOnly.length > 0) { - logSuccess(`Found active emulator! ${chalk().bold(simsOnly[0].udid)}. Will use it`); + logSuccess(`Found active emulator! ${chalk().bold.white(simsOnly[0].udid)}. Will use it`); clearInterval(poll); resolve(simsOnly[0]); } else { diff --git a/packages/sdk-android/src/gradleParser.ts b/packages/sdk-android/src/gradleParser.ts index b538b4cc68..3d3f3a04fc 100644 --- a/packages/sdk-android/src/gradleParser.ts +++ b/packages/sdk-android/src/gradleParser.ts @@ -287,7 +287,7 @@ def keystoreProps = new Properties() keystoreProps.load(new FileInputStream(keystorePropsFile))`; } else { logWarning( - `Your ${chalk().bold( + `Your ${chalk().bold.white( keystorePathFull )} does not exist. You won't be able to make production releases without it!` ); @@ -297,11 +297,11 @@ keystoreProps.load(new FileInputStream(keystorePropsFile))`; if (!keyAlias) missingKeys.push('keyAlias'); if (!storePassword) missingKeys.push('storePassword'); if (!keyPassword) missingKeys.push('keyPassword'); - logWarning(`You defined store file ${chalk().bold( + logWarning(`You defined store file ${chalk().bold.white( storeFile )}, but you are missing following keys: ${chalk().red(missingKeys.join(', '))} Check your private files at: -${chalk().bold(c.paths.workspace?.appConfig?.configsPrivate?.join('\n'))}`); +${chalk().bold.white(c.paths.workspace?.appConfig?.configsPrivate?.join('\n'))}`); } // BUILD_TYPES diff --git a/packages/sdk-android/src/installer.ts b/packages/sdk-android/src/installer.ts index c126af8576..2d2d874011 100644 --- a/packages/sdk-android/src/installer.ts +++ b/packages/sdk-android/src/installer.ts @@ -142,7 +142,7 @@ const _attemptAutoFix = async (c: RnvContext, sdkPlatform: string, sdkKey: SDKKe } if (result) { - logSuccess(`Found existing ${chalk().bold(sdkKey)} location at ${chalk().bold(result)}`); + logSuccess(`Found existing ${chalk().bold.white(sdkKey)} location at ${chalk().bold.white(result)}`); let confirmSdk = true; if (!c.program.opts().ci) { const { confirm } = await inquirerPrompt({ @@ -182,9 +182,9 @@ export const checkAndroidSdk = async () => { if (!_isSdkInstalled(c)) { logWarning( - `${c.platform} platform requires Android SDK to be installed. Your SDK path in ${chalk().bold( + `${c.platform} platform requires Android SDK to be installed. Your SDK path in ${chalk().bold.white( c.paths.workspace.config - )} does not exist: ${chalk().bold(_getCurrentSdkPath(c))}` + )} does not exist: ${chalk().bold.white(_getCurrentSdkPath(c))}` ); await _attemptAutoFix(c, 'android', 'ANDROID_SDK'); diff --git a/packages/sdk-android/src/runner.ts b/packages/sdk-android/src/runner.ts index cc521eea4f..76aedc056a 100644 --- a/packages/sdk-android/src/runner.ts +++ b/packages/sdk-android/src/runner.ts @@ -201,9 +201,9 @@ const _checkSigningCerts = async (c: Context) => { if (isRelease && !c.payload.pluginConfigAndroid?.store?.storeFile) { const msg = `You're attempting to ${ c.command - } app in release mode but you have't configured your ${chalk().bold( + } app in release mode but you have't configured your ${chalk().bold.white( c.paths.workspace.appConfig.configPrivate - )} for ${chalk().bold(c.platform)} platform yet.`; + )} for ${chalk().bold.white(c.platform)} platform yet.`; if (c.program.opts().ci === true) { return Promise.reject(msg); } @@ -254,9 +254,9 @@ const _checkSigningCerts = async (c: Context) => { type: 'input', name: 'storeFile', default: './release.keystore', - message: `Paste relative path to ${chalk().bold( + message: `Paste relative path to ${chalk().bold.white( c.paths.workspace.appConfig.dir - )} of your existing ${chalk().bold('release.keystore')} file`, + )} of your existing ${chalk().bold.white('release.keystore')} file`, }); storeFile = result?.storeFile; } @@ -308,7 +308,9 @@ const _checkSigningCerts = async (c: Context) => { } updateObjectSync(c.paths.workspace.appConfig.configPrivate, c.files.workspace.appConfig.configPrivate); - logSuccess(`Successfully updated private config file at ${chalk().bold(c.paths.workspace.appConfig.dir)}.`); + logSuccess( + `Successfully updated private config file at ${chalk().bold.white(c.paths.workspace.appConfig.dir)}.` + ); // await configureProject(c); await updateRenativeConfigs(); await parseAppBuildGradleSync(); @@ -402,7 +404,7 @@ export const configureProject = async () => { const fontDest = path.join(fontFolder, fontNormalised); copyFileSync(fontSource, fontDest); } else { - logWarning(`Font ${chalk().bold(fontSource)} doesn't exist! Skipping.`); + logWarning(`Font ${chalk().bold.white(fontSource)} doesn't exist! Skipping.`); } } } diff --git a/packages/sdk-android/src/taskOptions.ts b/packages/sdk-android/src/taskOptions.ts index 663628594f..c0b7607655 100644 --- a/packages/sdk-android/src/taskOptions.ts +++ b/packages/sdk-android/src/taskOptions.ts @@ -2,8 +2,8 @@ import { createTaskOptionsMap } from '@rnv/core'; export const TaskOptions = createTaskOptionsMap([ { - // key: 'skip-target-check', - key: 'skipTargetCheck', + key: 'skip-target-check', + altKey: 'skipTargetCheck', description: 'Skip Android target check, just display the raw adb devices to choose from', }, { @@ -14,8 +14,8 @@ export const TaskOptions = createTaskOptionsMap([ description: 'Filter value', }, { - // key: 'reset-adb', - key: 'resetAdb', + key: 'reset-adb', + altKey: 'resetAdb', description: 'Forces to reset android adb', }, ]); diff --git a/packages/sdk-apple/src/deviceManager.ts b/packages/sdk-apple/src/deviceManager.ts index 6ff780cc45..4fc17c8672 100644 --- a/packages/sdk-apple/src/deviceManager.ts +++ b/packages/sdk-apple/src/deviceManager.ts @@ -193,11 +193,11 @@ export const launchAppleSimulator = async (target: string | boolean) => { } if (selectedDevice) { - logInfo(`Launching: ${chalk().bold(selectedDevice.name)} (use -t to use different target)...`); + logInfo(`Launching: ${chalk().bold.white(selectedDevice.name)} (use -t to use different target)...`); await _launchSimulator(selectedDevice); return selectedDevice.name; } else if (target !== true && target !== undefined) { - logWarning(`Your specified simulator target ${chalk().bold(target)} doesn't exist`); + logWarning(`Your specified simulator target ${chalk().bold.white(target)} doesn't exist`); } const devices = devicesArr.map((v) => ({ @@ -264,7 +264,7 @@ export const listAppleDevices = async () => { const devicesArr = await getAppleDevices(); let devicesString = ''; devicesArr.forEach((v, i) => { - devicesString += ` [${i + 1}]> ${chalk().bold(v.name)} | ${v.icon} | v: ${chalk().green( + devicesString += ` [${i + 1}]> ${chalk().bold.white(v.name)} | ${v.icon} | v: ${chalk().green( v.version )} | udid: ${chalk().grey(v.udid)}${v.isDevice ? chalk().red(' (device)') : ''}\n`; }); diff --git a/packages/sdk-apple/src/plistParser.ts b/packages/sdk-apple/src/plistParser.ts index 9f6705903a..f0fa5a1afe 100644 --- a/packages/sdk-apple/src/plistParser.ts +++ b/packages/sdk-apple/src/plistParser.ts @@ -107,9 +107,9 @@ export const parseInfoPlist = () => if (!plistObj.CFBundleDisplayName) { throw new Error( - `CFBundleDisplayName is required!. set it by adding ${chalk().bold( + `CFBundleDisplayName is required!. set it by adding ${chalk().bold.white( '"common": { "title": "" }' - )} prop in ${chalk().bold(c.paths.appConfig.config)}` + )} prop in ${chalk().bold.white(c.paths.appConfig.config)}` ); } plistObj.CFBundleShortVersionString = getAppVersion(); diff --git a/packages/sdk-apple/src/provisionParser.ts b/packages/sdk-apple/src/provisionParser.ts index 272e14fe4b..e6e3e921db 100644 --- a/packages/sdk-apple/src/provisionParser.ts +++ b/packages/sdk-apple/src/provisionParser.ts @@ -19,7 +19,7 @@ export const parseProvisioningProfiles = async (c: Context) => { return result; } catch (e) { logWarning( - `You have no provisioning files available. Check your ${chalk().bold( + `You have no provisioning files available. Check your ${chalk().bold.white( path.join(c.paths.user.homeDir, 'Library/MobileDevice/Provisioning Profiles') )} folder` ); diff --git a/packages/sdk-apple/src/runner.ts b/packages/sdk-apple/src/runner.ts index 0ce238cf89..232f83684a 100644 --- a/packages/sdk-apple/src/runner.ts +++ b/packages/sdk-apple/src/runner.ts @@ -74,9 +74,9 @@ export const getIosDeviceToRunOn = async (c: Context) => { if (device === true) { if (devicesArr.length === 1) { logSuccess( - `Found one device connected! Device name: ${chalk().bold(devicesArr[0].name)} udid: ${chalk().bold( - devicesArr[0].udid - )}` + `Found one device connected! Device name: ${chalk().bold.white( + devicesArr[0].name + )} udid: ${chalk().bold.white(devicesArr[0].udid)}` ); if (devicesArr[0].udid) { p = `--udid ${devicesArr[0].udid}`; @@ -282,9 +282,11 @@ const _checkLockAndExec = async ( if (isDeviceNotRegistered) { logError(e); logWarning( - `${c.platform} DEVICE: ${chalk().bold(c.runtime.target)} with UDID: ${chalk().bold( + `${c.platform} DEVICE: ${chalk().bold.white(c.runtime.target)} with UDID: ${chalk().bold.white( c.runtime.targetUDID - )} is not included in your provisionong profile in TEAM: ${chalk().bold(getConfigProp('teamID'))}` + )} is not included in your provisionong profile in TEAM: ${chalk().bold.white( + getConfigProp('teamID') + )}` ); const { confirm } = await inquirerPrompt({ name: 'confirm', @@ -320,14 +322,14 @@ const _checkLockAndExec = async ( ${chalk().green('SUGGESTION:')} ${chalk().yellow('STEP 1:')} -Open xcode workspace at: ${chalk().bold(`${appPath}/${appFolderName}.xcworkspace`)} +Open xcode workspace at: ${chalk().bold.white(`${appPath}/${appFolderName}.xcworkspace`)} ${chalk().yellow('STEP 2:')} -${chalk().bold('Run app and observe any extra errors')} +${chalk().bold.white('Run app and observe any extra errors')} ${chalk().yellow('IF ALL HOPE IS LOST:')} Raise new issue and copy this SUMMARY box output at: -${chalk().bold('https://github.com/flexn-io/renative/issues')} +${chalk().bold.white('https://github.com/flexn-io/renative/issues')} and we will try to help! `); @@ -342,8 +344,8 @@ const _handleMissingTeam = async (c: Context, e: unknown) => { logError(e); logWarning(`You need specify the development team if you want to run app on ${ c.platform - } device. this can be set manually in ${chalk().bold(loc)} - You can find correct teamID in the URL of your apple developer account: ${chalk().bold( + } device. this can be set manually in ${chalk().bold.white(loc)} + You can find correct teamID in the URL of your apple developer account: ${chalk().bold.white( 'https://developer.apple.com/account/#/overview/YOUR-TEAM-ID' )} Type in your Apple Team ID to be used (will be saved to ${c.paths.appConfig?.config})`); @@ -369,18 +371,18 @@ const _handleProvisioningIssues = async (e: unknown, msg: string) => { const isProvAutomatic = provisioningStyle === 'Automatic'; const proAutoText = isProvAutomatic ? '' - : `${chalk().bold('[4]>')} Switch to automatic signing for appId: ${c.runtime.appId} , platform: ${ + : `${chalk().bold.white('[4]>')} Switch to automatic signing for appId: ${c.runtime.appId} , platform: ${ c.platform }, scheme: ${c.runtime.scheme}`; const fixCommand = `rnv crypto updateProfile -p ${c.platform} -s ${c.runtime.scheme}`; - const workspacePath = chalk().bold(`${getAppFolder()}/${appFolderName}.xcworkspace`); + const workspacePath = chalk().bold.white(`${getAppFolder()}/${appFolderName}.xcworkspace`); logError(e); logWarning(`${msg}. To fix try: -${chalk().bold('[1]>')} Configure your certificates, provisioning profiles correctly manually -${chalk().bold('[2]>')} Try to generate matching profiles with ${chalk().bold( +${chalk().bold.white('[1]>')} Configure your certificates, provisioning profiles correctly manually +${chalk().bold.white('[2]>')} Try to generate matching profiles with ${chalk().bold.white( fixCommand )} (you need correct priviledges in apple developer portal) -${chalk().bold( +${chalk().bold.white( '[3]>' )} Open generated project in Xcode: ${workspacePath} and debug from there (Sometimes this helps for the first-time builds) ${proAutoText}`); @@ -770,7 +772,7 @@ export const configureXcodeProject = async () => { c.payload.pluginConfigiOS.embeddedFonts.push(font); } } else { - logWarning(`Font ${chalk().bold(fontSource)} doesn't exist! Skipping.`); + logWarning(`Font ${chalk().bold.white(fontSource)} doesn't exist! Skipping.`); } } } @@ -780,7 +782,7 @@ export const configureXcodeProject = async () => { const tId = getConfigProp('teamID'); if (device && (!tId || tId === '')) { logError( - `You're missing teamID in your ${chalk().bold( + `You're missing teamID in your ${chalk().bold.white( c.paths.appConfig.config )} => .platforms.${platform}.teamID . you will not be able to build ${platform} app for device!` ); diff --git a/packages/sdk-apple/src/taskOptions.ts b/packages/sdk-apple/src/taskOptions.ts index 1652014ea1..b500e0eb7e 100644 --- a/packages/sdk-apple/src/taskOptions.ts +++ b/packages/sdk-apple/src/taskOptions.ts @@ -2,8 +2,8 @@ import { createTaskOptionsMap, createTaskOptionsPreset } from '@rnv/core'; export const TaskOptions = createTaskOptionsMap([ { - key: 'updatePods', - // key: 'update-pods', + key: 'update-pods', + altKey: 'updatePods', shortcut: 'u', description: 'Force update dependencies (iOS only)', }, @@ -14,50 +14,50 @@ export const TaskOptions = createTaskOptionsMap([ description: 'Name of the keychain', }, { - key: 'provisioningStyle', - // key: 'provisioning-style', + key: 'provisioning-style', + altKey: 'provisioningStyle', isValueType: true, isRequired: true, description: 'Set provisioningStyle (Automatic | Manual)', }, { - key: 'codeSignIdentity', - // key: 'code-sign-identity', + key: 'code-sign-identity', + altKey: 'codeSignIdentity', isValueType: true, isRequired: true, description: 'Set codeSignIdentity (ie iPhone Distribution)', }, { - key: 'provisionProfileSpecifier', - // key: 'provision-profile-specifier', + key: 'provision-profile-specifier', + altKey: 'provisionProfileSpecifier', isValueType: true, isRequired: true, description: 'Name of provisionProfile', }, { - key: 'xcodebuildArgs', - // key: 'xcodebuild-args', + key: 'xcodebuild-args', + altKey: 'xcodebuildArgs', isValueType: true, isRequired: true, description: 'pass down custom xcodebuild arguments', }, { - key: 'xcodebuildArchiveArgs', - // key: 'xcodebuild-archive-args', + key: 'xcodebuild-archive-args', + altKey: 'xcodebuildArchiveArgs', isValueType: true, isRequired: true, description: 'pass down custom xcodebuild arguments', }, { - key: 'xcodebuildExportArgs', - // key: 'xcodebuild-export-args', + key: 'xcodebuild-export-args', + altKey: 'xcodebuildExportArgs', isValueType: true, isRequired: true, description: 'pass down custom xcodebuild arguments', }, { - // key: 'skip-target-check', - key: 'skipTargetCheck', + key: 'skip-target-check', + altKey: 'skipTargetCheck', description: 'Skip ios target check, just display the raw sims to choose from', }, { diff --git a/packages/sdk-kaios/src/runner.ts b/packages/sdk-kaios/src/runner.ts index 99fee27f2f..83f0cef22a 100644 --- a/packages/sdk-kaios/src/runner.ts +++ b/packages/sdk-kaios/src/runner.ts @@ -100,7 +100,7 @@ export const runKaiOSProject = async (c: RnvContext) => { if (!isPortActive) { logInfo( - `Your ${chalk().bold(platform)} devServer at port ${chalk().bold( + `Your ${chalk().bold.white(platform)} devServer at port ${chalk().bold.white( c.runtime.port )} is not running. Starting it up for you...` ); diff --git a/packages/sdk-react-native/src/__tests__/androidRunner.test.ts b/packages/sdk-react-native/src/__tests__/androidRunner.test.ts index d5a87b4da5..54cbfacbf7 100644 --- a/packages/sdk-react-native/src/__tests__/androidRunner.test.ts +++ b/packages/sdk-react-native/src/__tests__/androidRunner.test.ts @@ -27,7 +27,7 @@ describe('Test packageReactNativeAndroid', () => { await expect(packageReactNativeAndroid()).resolves.toBe(true); //THEN expect(logInfo).toHaveBeenCalledWith( - `bundleAssets in scheme ${chalk().bold(ctx.runtime.scheme)} marked false. SKIPPING PACKAGING...` + `bundleAssets in scheme ${chalk().bold.white(ctx.runtime.scheme)} marked false. SKIPPING PACKAGING...` ); }); diff --git a/packages/sdk-react-native/src/androidRunner.ts b/packages/sdk-react-native/src/androidRunner.ts index 8abd5d3580..50733f0213 100644 --- a/packages/sdk-react-native/src/androidRunner.ts +++ b/packages/sdk-react-native/src/androidRunner.ts @@ -26,7 +26,7 @@ export const packageReactNativeAndroid = async () => { const bundleAssets = getConfigProp('bundleAssets') === true; if (!bundleAssets && platform !== 'androidwear') { - logInfo(`bundleAssets in scheme ${chalk().bold(c.runtime.scheme)} marked false. SKIPPING PACKAGING...`); + logInfo(`bundleAssets in scheme ${chalk().bold.white(c.runtime.scheme)} marked false. SKIPPING PACKAGING...`); return true; } @@ -100,8 +100,9 @@ export const runReactNativeAndroid = async (device: { udid?: string } | undefine const reactNativeCmnd = `node ${path.join(path.dirname(require.resolve('react-native')), 'cli.js')}`; // const reactNativeCmnd = 'npx react-native'; - let command = `${reactNativeCmnd} run-android --mode=${signingConfig} --no-packager --main-activity=${platform === 'androidwear' ? 'MainActivity' : 'SplashActivity' - }`; + let command = `${reactNativeCmnd} run-android --mode=${signingConfig} --no-packager --main-activity=${ + platform === 'androidwear' ? 'MainActivity' : 'SplashActivity' + }`; if (udid) { command += ` --deviceId=${udid}`; @@ -134,8 +135,9 @@ export const buildReactNativeAndroid = async () => { const reactNativeCmnd = `node ${path.join(path.dirname(require.resolve('react-native')), 'cli.js')}`; // const reactNativeCmnd = 'npx react-native'; - let command = `${reactNativeCmnd} build-android --mode=${signingConfig} --tasks ${outputAab ? 'bundle' : 'assemble' - }${signingConfig}`; + let command = `${reactNativeCmnd} build-android --mode=${signingConfig} --tasks ${ + outputAab ? 'bundle' : 'assemble' + }${signingConfig}`; if (extraGradleParams) { command += ` --extra-params ${extraGradleParams}`; diff --git a/packages/sdk-react-native/src/common.ts b/packages/sdk-react-native/src/common.ts index 23227c111c..b9d1c2186f 100644 --- a/packages/sdk-react-native/src/common.ts +++ b/packages/sdk-react-native/src/common.ts @@ -124,7 +124,7 @@ export const configureFontSources = async () => { const fontFolder = fontSource.split('/').slice(0, -1).join('/'); fontFolders.add(fontFolder); } else { - logWarning(`Font ${chalk().bold(fontSource)} doesn't exist! Skipping.`); + logWarning(`Font ${chalk().bold.white(fontSource)} doesn't exist! Skipping.`); } } } diff --git a/packages/sdk-react-native/src/metroRunner.ts b/packages/sdk-react-native/src/metroRunner.ts index 46cd60dd15..9f10746b0b 100644 --- a/packages/sdk-react-native/src/metroRunner.ts +++ b/packages/sdk-react-native/src/metroRunner.ts @@ -58,7 +58,7 @@ export const startReactNative = async (opts: { } if (c.program.opts().resetHard || c.program.opts().reset) { - logInfo(`You passed ${chalk().bold('-r')} argument. --reset-cache will be applied to react-native`); + logInfo(`You passed ${chalk().bold.white('-r')} argument. --reset-cache will be applied to react-native`); } // logSummary('BUNDLER STARTED'); diff --git a/packages/sdk-tizen/src/deviceManager.ts b/packages/sdk-tizen/src/deviceManager.ts index 0219dc239d..893c50a071 100644 --- a/packages/sdk-tizen/src/deviceManager.ts +++ b/packages/sdk-tizen/src/deviceManager.ts @@ -300,7 +300,9 @@ export const runTizenSimOrDevice = async () => { if (!appName) { throw new Error( - `runTizen: ${chalk().grey(platform)}.appName not defined in your ${chalk().bold(c.paths.appConfig.config)}` + `runTizen: ${chalk().grey(platform)}.appName not defined in your ${chalk().bold.white( + c.paths.appConfig.config + )}` ); } diff --git a/packages/sdk-tizen/src/installer.ts b/packages/sdk-tizen/src/installer.ts index ed9de59f75..3374b77079 100644 --- a/packages/sdk-tizen/src/installer.ts +++ b/packages/sdk-tizen/src/installer.ts @@ -71,7 +71,7 @@ const _attemptAutoFix = async (c: RnvContext, shouldThrow?: boolean) => { const result = getSdkLocations().find((v) => fsExistsSync(v)); if (result) { - logSuccess(`Found existing ${c.platform} SDK location at ${chalk().bold(result)}`); + logSuccess(`Found existing ${c.platform} SDK location at ${chalk().bold.white(result)}`); let confirmSdk = true; if (!c.program.opts().ci) { const { confirm } = await inquirerPrompt({ @@ -115,9 +115,9 @@ export const checkTizenSdk = async (shouldThrow?: boolean) => { logDefault('checkTizenSdk'); if (!_isSdkInstalled(c)) { logWarning( - `${c.platform} platform requires Tizen SDK to be installed. Your SDK path in ${chalk().bold( + `${c.platform} platform requires Tizen SDK to be installed. Your SDK path in ${chalk().bold.white( c.paths.workspace.config - )} does not exist: ${chalk().bold(_getCurrentSdkPath(c))}` + )} does not exist: ${chalk().bold.white(_getCurrentSdkPath(c))}` ); return _attemptAutoFix(c, shouldThrow); } diff --git a/packages/sdk-tizen/src/runner.ts b/packages/sdk-tizen/src/runner.ts index 29bcc769c7..965e287fd4 100644 --- a/packages/sdk-tizen/src/runner.ts +++ b/packages/sdk-tizen/src/runner.ts @@ -138,7 +138,7 @@ export const runTizen = async (c: RnvContext, target?: string) => { if (!isPortActive) { logInfo( - `Your ${chalk().bold(platform)} devServer at port ${chalk().bold( + `Your ${chalk().bold.white(platform)} devServer at port ${chalk().bold.white( c.runtime.port )} is not running. Starting it up for you...` ); diff --git a/packages/sdk-utils/src/fonts.ts b/packages/sdk-utils/src/fonts.ts index 8e7478d4af..bace3de0ba 100644 --- a/packages/sdk-utils/src/fonts.ts +++ b/packages/sdk-utils/src/fonts.ts @@ -43,7 +43,7 @@ export const configureFonts = async () => { file: require('${fontSource}'), },`; } else { - logWarning(`Font ${chalk().bold(fontSource)} doesn't exist! Skipping.`); + logWarning(`Font ${chalk().bold.white(fontSource)} doesn't exist! Skipping.`); } } } diff --git a/packages/sdk-utils/src/ipUtils.ts b/packages/sdk-utils/src/ipUtils.ts index c748471e4c..1bd1b88163 100644 --- a/packages/sdk-utils/src/ipUtils.ts +++ b/packages/sdk-utils/src/ipUtils.ts @@ -21,7 +21,7 @@ export const confirmActiveBundler = async () => { name: 'selectedOption', type: 'list', choices, - warningMessage: `Another ${c.platform} server at port ${chalk().bold(c.runtime.port)} already running`, + warningMessage: `Another ${c.platform} server at port ${chalk().bold.white(c.runtime.port)} already running`, }); if (choices[0] === selectedOption) { diff --git a/packages/sdk-utils/src/utils.ts b/packages/sdk-utils/src/utils.ts index a303a0e45a..4b251d9d50 100644 --- a/packages/sdk-utils/src/utils.ts +++ b/packages/sdk-utils/src/utils.ts @@ -13,7 +13,9 @@ export const addSystemInjects = (injects: OverridesOptions) => { export const sanitizeColor = (val: string | undefined, key: string) => { if (!val) { - logWarning(`You are missing ${chalk().bold(key)} in your renative config. will use default #FFFFFF instead`); + logWarning( + `You are missing ${chalk().bold.white(key)} in your renative config. will use default #FFFFFF instead` + ); return { rgb: [255, 255, 255, 1], rgbDecimal: [1, 1, 1, 1], diff --git a/packages/sdk-webos/src/deviceManager.ts b/packages/sdk-webos/src/deviceManager.ts index 134a73eb69..045c19e55d 100644 --- a/packages/sdk-webos/src/deviceManager.ts +++ b/packages/sdk-webos/src/deviceManager.ts @@ -214,7 +214,9 @@ export const listWebOSTargets = async () => { const devicesResponse = await execCLI(CLI_WEBOS_ARES_DEVICE_INFO, '-D'); const devices = await parseDevices(c, devicesResponse); - const deviceArray = devices.map((device, i) => ` [${i + 1}]> ${chalk().bold(device.name)} | ${device.device}`); + const deviceArray = devices.map( + (device, i) => ` [${i + 1}]> ${chalk().bold.white(device.name)} | ${device.device}` + ); const webosSdkPath = getRealPath(c.buildConfig?.sdks?.WEBOS_SDK); if (!webosSdkPath) { @@ -222,7 +224,7 @@ export const listWebOSTargets = async () => { } const availableSimulatorVersions = getDirectories(path.join(webosSdkPath, 'Simulator')); availableSimulatorVersions.map((a) => { - deviceArray.push(` [${deviceArray.length + 1}]> ${chalk().bold(a)} | simulator`); + deviceArray.push(` [${deviceArray.length + 1}]> ${chalk().bold.white(a)} | simulator`); }); logToSummary(`WebOS Targets:\n${deviceArray.join('\n')}`); diff --git a/packages/sdk-webos/src/installer.ts b/packages/sdk-webos/src/installer.ts index 44504dd839..5558664515 100644 --- a/packages/sdk-webos/src/installer.ts +++ b/packages/sdk-webos/src/installer.ts @@ -76,7 +76,7 @@ const _attemptAutoFix = async (c: RnvContext, shouldThrow?: boolean) => { const result = SDK_LOCATIONS.find((v) => fsExistsSync(v)); if (result) { - logSuccess(`Found existing ${c.platform} SDK location at ${chalk().bold(result)}`); + logSuccess(`Found existing ${c.platform} SDK location at ${chalk().bold.white(result)}`); let confirmSdk = true; if (!c.program.opts().ci) { const { confirm } = await inquirerPrompt({ @@ -123,9 +123,9 @@ export const checkWebosSdk = async (shouldThrow?: boolean) => { logDefault('checkWebosSdk'); if (!_isSdkInstalled(c)) { logWarning( - `${c.platform} platform requires WebOS SDK to be installed. Your SDK path in ${chalk().bold( + `${c.platform} platform requires WebOS SDK to be installed. Your SDK path in ${chalk().bold.white( c.paths.workspace.config - )} does not exist: ${chalk().bold(_getCurrentSdkPath(c))}` + )} does not exist: ${chalk().bold.white(_getCurrentSdkPath(c))}` ); return _attemptAutoFix(c, shouldThrow); } diff --git a/packages/sdk-webos/src/runner.ts b/packages/sdk-webos/src/runner.ts index 1bda0e87fb..a6742e170a 100644 --- a/packages/sdk-webos/src/runner.ts +++ b/packages/sdk-webos/src/runner.ts @@ -89,7 +89,7 @@ export const runWebOS = async (c: RnvContext) => { if (!isPortActive) { logInfo( - `Your ${chalk().bold(platform)} devServer at port ${chalk().bold( + `Your ${chalk().bold.white(platform)} devServer at port ${chalk().bold.white( c.runtime.port )} is not running. Starting it up for you...` ); diff --git a/packages/sdk-webpack/src/index.ts b/packages/sdk-webpack/src/index.ts index 2dfc4bd695..6fc3193833 100644 --- a/packages/sdk-webpack/src/index.ts +++ b/packages/sdk-webpack/src/index.ts @@ -105,7 +105,9 @@ Debugger running at: ${debugUrl}`); \n`; } catch (e) { logWarning( - `You are missing chii. You can install via ${chalk().bold('npm i -g chii')}) Trying to use weinre next` + `You are missing chii. You can install via ${chalk().bold.white.white( + 'npm i -g chii' + )}) Trying to use weinre next` ); } @@ -142,7 +144,7 @@ Debugger running at: ${debugUrl}`); c.platform }">`; } catch (e) { - logWarning(`You are missing weinre. Skipping debug. install via ${chalk().bold('npm i -g weinre')}`); + logWarning(`You are missing weinre. Skipping debug. install via ${chalk().bold.white('npm i -g weinre')}`); } return true; }; @@ -250,9 +252,9 @@ export const runWebpackServer = async (enableRemoteDebugger?: boolean) => { if (!isPortActive) { logInfo( - `Your ${chalk().bold(platform)} devServerHost ${chalk().bold(devServerHost)} at port ${chalk().bold( - port - )} is not running. Starting it up for you...` + `Your ${chalk().bold.white(platform)} devServerHost ${chalk().bold.white( + devServerHost + )} at port ${chalk().bold.white(port)} is not running. Starting it up for you...` ); await _runWebBrowser(devServerHost, port, false); if (!bundleAssets) {