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

cli: add logo #305

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/cli-common/src/lib/text.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Config } from '@oclif/core'
import chalk from 'chalk'
import { EOL } from 'os'

export const code = (c: string) => chalk.bold(c)

Expand All @@ -12,3 +13,22 @@ export const highlight = (s: string) => chalk.greenBright(s)
export const success = (s: string) => chalk.greenBright(s)

export const recommendation = (s: string) => chalk.cyan(s)

const mag = chalk.rgb(255, 128, 197)

export const logo = [
'',
`${mag('@@@@')} @@@@`,
`${mag('@@@@@')}@@@@@@`,
`${mag('@@@@@')}@@@@@@@@ @@@@@@@@@@`,
`${mag('@@@@@')}@@@@@@@@@ @@@ @@@ @@ @@@ @@@@@% @@@@@ @@ @@@ @@@ @@@`,
`${mag('@@@@@')}@@@@@@@@@ @@@ @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@`,
`${mag('@@@@@@@@@')} @@@@@@@@@ @@ @@@@@@@@@ @@@@@@@@@ @@@ @@ @@ @@`,
`${mag('@@@@@@@@@')} @@@ @@ @@@ @@@ @@@@@@ @@@@`,
` ${mag('@@@@@@@@')} @@@ @@ @@@@@@@@ @@@@@@@@ @@@@ @@@@`,
` ${mag('@@@@@@')} @@@`,
` ${mag('@@@')} @@@@@`,
'',
].join(EOL)

export const { supportsColor } = chalk
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"plugins": [
"@oclif/plugin-help"
],
"helpClass": "./dist/help",
"hooks": {
"init": [
"./dist/hooks/init/sync-logging",
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export default class Init extends BaseCommand {
return undefined
}

if (text.supportsColor) {
this.log(text.logo)
}

const driver = await chooseDriver()
const driverStatic = machineDrivers[driver]

Expand Down
11 changes: 11 additions & 0 deletions packages/cli/src/help.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Help as HelpBase } from '@oclif/core'
import { text } from '@preevy/cli-common'

export default class Help extends HelpBase {
override async showRootHelp(): Promise<void> {
if (!this.opts.stripAnsi) {
this.log(text.logo)
}
return await super.showRootHelp()
}
}
Loading