-
-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): replace wizard with
@million/install
(#1034)
* feat(cli): integrate `@million/install` * fix: update build config
- Loading branch information
Showing
13 changed files
with
7,423 additions
and
6,723 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,5 @@ | ||
#! /usr/bin/env node | ||
|
||
import { intro, outro } from '@clack/prompts'; | ||
import { bold, green, magenta } from 'kleur/colors'; | ||
import { installPackage } from './utils/package-manager.js'; | ||
import { abort } from './utils/utils.js'; | ||
import { handleConfigFile } from './utils/config.js'; | ||
import { isPackageInstalled } from './utils/package-json.js'; | ||
import { install } from '@million/install'; | ||
|
||
async function runMillionWizard(): Promise<void> { | ||
const isMillionAlreadyInstalled = await isPackageInstalled(); | ||
await installPackage({ | ||
packageName: 'million', | ||
alreadyInstalled: isMillionAlreadyInstalled, | ||
}); | ||
if (!isMillionAlreadyInstalled) { | ||
await handleConfigFile(); | ||
} | ||
} | ||
|
||
async function main(): Promise<void> { | ||
intro(showWelcomeScreen()); | ||
await runMillionWizard(); | ||
outro(`${bold(green('✓ '))} You're all set!`); | ||
} | ||
|
||
main().catch(() => { | ||
abort( | ||
'Failed to setup Million.js, refer to the docs for manual setup: https://million.dev/docs/install', | ||
); | ||
}); | ||
|
||
function showWelcomeScreen(): string { | ||
const text = magenta(`⚡ Million.js ${process.env.VERSION || ''}`); | ||
return text; | ||
} | ||
void install('Million', process.env.VERSION); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.