-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(setup): allow for local setup only without connecting to the too…
…ls (#51)
- Loading branch information
Showing
33 changed files
with
424 additions
and
136 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'stplr-core': patch | ||
'stplr': patch | ||
--- | ||
|
||
Add --no-deploy flag workflow |
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,13 @@ | ||
import inquirer from 'inquirer'; | ||
|
||
export const getProjectNamePrompt = async (): Promise<string> => | ||
( | ||
await inquirer.prompt([ | ||
{ | ||
type: 'input', | ||
name: 'name', | ||
message: 'What is your project named?', | ||
default: 'my-stapled-app', | ||
}, | ||
]) | ||
).name; |
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,4 @@ | ||
export * from './getProjectNamePrompt'; | ||
export * from './overwriteDirectoryPrompt'; | ||
export * from './shouldUsePayloadPrompt'; | ||
export * from './unfinishedProjectsChoicePrompt'; |
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,19 @@ | ||
import inquirer from 'inquirer'; | ||
|
||
/** | ||
* Prompts the user to confirm whether they want to overwrite an existing project directory. | ||
* | ||
* @param projectName - The name of the project that already exists. | ||
* @returns A promise that returns object with overwrite boolean value. | ||
* | ||
**/ | ||
|
||
export const overwriteDirectoryPrompt = async (projectName: string): Promise<{ overwrite: boolean }> => | ||
await inquirer.prompt([ | ||
{ | ||
type: 'confirm', | ||
name: 'overwrite', | ||
message: `The directory "${projectName}" already exists. Do you want to overwrite it?`, | ||
default: false, | ||
}, | ||
]); |
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,19 @@ | ||
import inquirer from 'inquirer'; | ||
|
||
/** | ||
* Prompts the user to confirm whether they want to overwrite an existing project directory. | ||
* | ||
* @param projectName - The name of the project that already exists. | ||
* @returns A promise that returns object with usePayload boolean value. | ||
* | ||
**/ | ||
|
||
export const shouldUsePayloadPrompt = async (): Promise<{ usePayload: boolean }> => | ||
await inquirer.prompt([ | ||
{ | ||
type: 'confirm', | ||
name: 'usePayload', | ||
message: 'Would you like to add Payload to your app?', | ||
default: true, | ||
}, | ||
]); |
38 changes: 38 additions & 0 deletions
38
packages/cli/command-prompts/unfinishedProjectsChoicePrompt.ts
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,38 @@ | ||
import inquirer from 'inquirer'; | ||
import { ProjectChoice, UnfinishedProject } from '../utils/findUnfinishedProjects'; | ||
|
||
export type UnfinishedProjectsChoiceAnswers = { | ||
resume: boolean; | ||
unfinishedSelectedProject: UnfinishedProject; | ||
}; | ||
|
||
/** | ||
* Prompts the user to select an unfinished project to resume. | ||
* | ||
* @param unfinishedProjects - An array of unfinished projects. | ||
* @param projectChoices - An array of project choices presented to the user. | ||
* @returns A promise that returns object with resume boolean value and selected project. | ||
* | ||
**/ | ||
|
||
export const unfinishedProjectsChoice = async ( | ||
unfinishedProjects: UnfinishedProject[], | ||
projectChoices: ProjectChoice[], | ||
): Promise<UnfinishedProjectsChoiceAnswers> => | ||
await inquirer.prompt([ | ||
{ | ||
type: 'confirm', | ||
name: 'resume', | ||
message: `We found the following unfinished project(s):\n${unfinishedProjects | ||
.map((p) => `- ${p.projectName}`) | ||
.join('\n')}\nWould you like to resume one of them?`, | ||
default: true, | ||
}, | ||
{ | ||
type: 'list', | ||
name: 'unfinishedSelectedProject', | ||
message: 'Select a project to resume:', | ||
choices: projectChoices, | ||
when: (answers) => answers.resume && unfinishedProjects.length > 1, | ||
}, | ||
]); |
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
Oops, something went wrong.