-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve #2004, ask for approval before exporting a component to anoth…
…er scope (fork), unless --force was used
- Loading branch information
1 parent
8640fb7
commit d5c23fb
Showing
7 changed files
with
75 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** @flow */ | ||
import chalk from 'chalk'; | ||
import BitId from '../../bit-id/bit-id'; | ||
|
||
/** | ||
* schema for forking components | ||
*/ | ||
export default function (bitIds: BitId[], remote: string) { | ||
return { | ||
properties: { | ||
shouldFork: { | ||
required: true, | ||
description: `bit is about to fork the following components and export them to ${chalk.bold(remote)}. | ||
\t${bitIds.map(id => chalk.bold(id.toStringWithoutVersion())).join('\n\t')} | ||
also, if they're staged, bit will not change their status to exported unless '--set-current-scope' flag is used. | ||
there are additional flags for the 'export' command to specifically handle forking components: | ||
1. '--include-dependencies' exports all dependencies to the destination alongside the component. | ||
2. '--set-current-scope' sets your workspace to use the destination scope as the main remote for the component. | ||
3. '--codemod' changes all dependencies to point to the new destination. | ||
would you like to proceed with forking the components? (yes/no)`, | ||
message: 'please type yes or no.', | ||
type: 'string', | ||
conform(value: string) { | ||
return ( | ||
value.toLowerCase() === 'y' || | ||
value.toLowerCase() === 'n' || | ||
value.toLowerCase() === 'yes' || | ||
value.toLowerCase() === 'no' | ||
); | ||
} | ||
} | ||
} | ||
}; | ||
} |