-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56ad313
commit de9f5b6
Showing
3 changed files
with
30 additions
and
2 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,28 @@ | ||
import * as p from '@clack/prompts' | ||
import color from 'picocolors'; | ||
|
||
(async () => { | ||
console.clear(); | ||
|
||
p.intro(`${color.bgCyan(color.black(' clack-examples '))}`); | ||
|
||
// Choose example to run | ||
const example = await p.select({ | ||
message: 'Choose an example:', | ||
options: [ | ||
{ label: 'Basic', value: 'basic', hint: 'basic project setup' }, | ||
{ label: 'Changesets', value: 'changesets', hint: 'mimics the changesets cli' }, | ||
{ label: 'Spinner', value: 'spinner', hint: 'shows off the spinner functionality' }, | ||
{ label: 'Workflow', value: 'workflow' }, | ||
], | ||
}) | ||
|
||
if (p.isCancel(example)) return | ||
|
||
try { | ||
// Run example | ||
await import(`./${example}.ts`); | ||
} catch (error) { | ||
// Don't crash on error | ||
} | ||
})() |
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