From b9eb871ad1fe013dd621b449726a31aaf49227e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Gu=CC=88ner?= Date: Mon, 10 Jun 2024 16:22:15 +0300 Subject: [PATCH] refactor: version -> bobVersion, crnlVersion -> version --- packages/create-react-native-library/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/create-react-native-library/src/index.ts b/packages/create-react-native-library/src/index.ts index 65cbf9b01..87f6d0dcd 100644 --- a/packages/create-react-native-library/src/index.ts +++ b/packages/create-react-native-library/src/index.ts @@ -10,7 +10,7 @@ import githubUsername from 'github-username'; import prompts, { type PromptObject } from './utils/prompts'; import generateExampleApp from './utils/generateExampleApp'; import { spawn } from './utils/spawn'; -import { version as crnlVersion } from '../package.json'; +import { version } from '../package.json'; const FALLBACK_BOB_VERSION = '0.20.0'; @@ -554,10 +554,10 @@ async function create(_argv: yargs.Arguments) { } = answers; // Get latest version of Bob from NPM - let version: string; + let bobVersion: string; try { - version = await Promise.race([ + bobVersion = await Promise.race([ new Promise((resolve) => { setTimeout(() => resolve(FALLBACK_BOB_VERSION), 1000); }), @@ -565,7 +565,7 @@ async function create(_argv: yargs.Arguments) { ]); } catch (e) { // Fallback to a known version if we couldn't fetch - version = FALLBACK_BOB_VERSION; + bobVersion = FALLBACK_BOB_VERSION; } const moduleType = type.startsWith('view-') ? 'view' : 'module'; @@ -597,7 +597,7 @@ async function create(_argv: yargs.Arguments) { const options = { bob: { - version: version || FALLBACK_BOB_VERSION, + version: bobVersion || FALLBACK_BOB_VERSION, }, project: { slug, @@ -820,7 +820,7 @@ async function create(_argv: yargs.Arguments) { ) ) ); - libraryMetadata.version = crnlVersion; + libraryMetadata.version = version; const libraryPackageJson = await fs.readJson(path.join(folder, 'package.json')); libraryPackageJson['create-react-native-library'] = libraryMetadata;