diff --git a/packages/create-react-native-library/src/index.ts b/packages/create-react-native-library/src/index.ts index 929326859..37092969c 100644 --- a/packages/create-react-native-library/src/index.ts +++ b/packages/create-react-native-library/src/index.ts @@ -115,8 +115,7 @@ type ArgName = | 'type' | 'local' | 'example' - | 'react-native-version' - | 'with-recommended-options'; + | 'react-native-version'; type ProjectLanguages = 'kotlin-objc' | 'kotlin-swift' | 'cpp' | 'js'; @@ -141,7 +140,6 @@ type Answers = { type?: ProjectType; example?: boolean; reactNativeVersion?: string; - withRecommendedOptions?: boolean; }; const LANGUAGE_CHOICES: { @@ -150,7 +148,7 @@ const LANGUAGE_CHOICES: { types: ProjectType[]; }[] = [ { - title: `Kotlin & Objective-C`, + title: 'Kotlin & Objective-C', value: 'kotlin-objc', types: ['view-module-legacy', 'view-module-mixed', 'view-module-new'], }, @@ -221,16 +219,6 @@ const TYPE_CHOICES: { }, ]; -const RECOMMENDED_TEMPLATE: { - type: ProjectType; - languages: ProjectLanguages; - description: string; -} = { - type: 'view-module-mixed', - languages: 'kotlin-objc', - description: `Backward compatible Fabric view & Turbo module with Kotlin & Objective-C`, -}; - const args: Record = { 'slug': { description: 'Name of the npm package', @@ -277,10 +265,6 @@ const args: Record = { type: 'boolean', default: true, }, - 'with-recommended-options': { - description: `Whether to use the recommended template. ${RECOMMENDED_TEMPLATE.description}`, - type: 'boolean', - }, }; // FIXME: fix the type @@ -448,68 +432,24 @@ async function create(argv: yargs.Arguments) { }, validate: (input) => /^https?:\/\//.test(input) || 'Must be a valid URL', }, - 'with-recommended-options': { - type: 'select', - name: 'withRecommendedOptions', - message: 'Do you want to customize the library type and languages?', - choices: [ - { - title: 'Use recommended defaults', - value: true, - description: RECOMMENDED_TEMPLATE.description, - }, - { - title: 'Customize', - value: false, - }, - ], - }, 'type': { type: 'select', name: 'type', message: 'What type of library do you want to develop?', - choices: (_, values) => { - if (values.withRecommendedOptions) { - return TYPE_CHOICES.filter( - (choice) => choice.value === RECOMMENDED_TEMPLATE.type - ); - } - - return TYPE_CHOICES.map((choice) => - choice.value === RECOMMENDED_TEMPLATE.type - ? { - ...choice, - title: `${choice.title} ${kleur.yellow('(Recommended)')}`, - } - : choice - ); - }, + choices: TYPE_CHOICES, }, 'languages': { type: 'select', name: 'languages', message: 'Which languages do you want to use?', choices: (_, values) => { - if (values.withRecommendedOptions) { - return LANGUAGE_CHOICES.filter((choice) => { - return choice.value === RECOMMENDED_TEMPLATE.languages; - }); - } - return LANGUAGE_CHOICES.filter((choice) => { if (choice.types) { return choice.types.includes(values.type); } return true; - }).map((choice) => - choice.value === RECOMMENDED_TEMPLATE.languages - ? { - ...choice, - title: `${choice.title} ${kleur.yellow('(Recommended)')}`, - } - : choice - ); + }); }, }, };