Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle better canceling prompts #2138

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

szymonrybczak
Copy link
Collaborator

Summary:

In this PR I moved all prompts to use internal wrapper that we have in cli-tools that overwrites onCancel method with relevant error.

Before After
CleanShot 2023-10-27 at 16 45 59@2x CleanShot 2023-10-27 at 16 45 39@2x

Test Plan:

  1. Clone the repository and do all the required steps from the Contributing guide
  2. Run this command:
node /path/to/react-native-cli/packages/cli/build/bin.js init
  1. Press ctrl + c and you should see "Prompt cancelled." error message.

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

import type {Config as CLIConfig} from '@react-native-community/cli-types';
import chalk from 'chalk';
import execa from 'execa';
import {existsSync as fileExists, rmdir} from 'fs';
import os from 'os';
import path from 'path';
import prompts from 'prompts';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of prompts dependency from cli-clean? And other packages, if feasable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@thymikee
Copy link
Member

Unit tests failing

@szymonrybczak szymonrybczak force-pushed the feat/better-handle-aborting-in-prompt branch from db1ad2b to 34ed1c9 Compare October 30, 2023 13:25
@thymikee thymikee merged commit 17387d5 into main Oct 30, 2023
@thymikee thymikee deleted the feat/better-handle-aborting-in-prompt branch October 30, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants