mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
[ci] format
This commit is contained in:
parent
651f45b401
commit
edc87abd47
4 changed files with 71 additions and 66 deletions
|
@ -21,7 +21,7 @@ export async function intro(
|
|||
),
|
||||
Promise.resolve(ctx.username).then((username) => `${username}!`),
|
||||
],
|
||||
welcome ?? 'Let\'s build something awesome!',
|
||||
welcome ?? "Let's build something awesome!",
|
||||
] as string[],
|
||||
{ clear: true, hat, tie }
|
||||
);
|
||||
|
|
|
@ -3,7 +3,9 @@ import type { Context } from './context.js';
|
|||
|
||||
import { nextSteps, say } from '../messages.js';
|
||||
|
||||
export async function next(ctx: Pick<Context, 'hat' | 'tie' | 'cwd' | 'packageManager' | 'skipHouston'>) {
|
||||
export async function next(
|
||||
ctx: Pick<Context, 'hat' | 'tie' | 'cwd' | 'packageManager' | 'skipHouston'>
|
||||
) {
|
||||
let projectDir = path.relative(process.cwd(), ctx.cwd);
|
||||
|
||||
const commandMap: { [key: string]: string } = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
interface SeasonalHouston {
|
||||
hats?: string[];
|
||||
ties?: string[];
|
||||
messages: string[]
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
export default function getSeasonalHouston({ fancy }: { fancy?: boolean }): SeasonalHouston {
|
||||
|
@ -19,11 +19,12 @@ export default function getSeasonalHouston({ fancy }: { fancy?: boolean }): Seas
|
|||
`${year} is your year! Let's build something awesome.`,
|
||||
`${year} is the year of Astro!`,
|
||||
`${year} is clearly off to a great start!`,
|
||||
`Thanks for starting ${year} with Astro!`
|
||||
]
|
||||
`Thanks for starting ${year} with Astro!`,
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
case 'spooky': return {
|
||||
case 'spooky':
|
||||
return {
|
||||
hats: rarity(0.5, ['🎃', '👻', '☠️', '💀', '🕷️', '🔮']),
|
||||
ties: rarity(0.25, ['🦴', '🍬', '🍫']),
|
||||
messages: [
|
||||
|
@ -37,9 +38,10 @@ export default function getSeasonalHouston({ fancy }: { fancy?: boolean }): Seas
|
|||
`We're conjuring up a spooktacular website!`,
|
||||
`Prepare for a web of spooky wonders to be woven.`,
|
||||
`Chills and thrills await you on your new project!`,
|
||||
]
|
||||
}
|
||||
case 'holiday': return {
|
||||
],
|
||||
};
|
||||
case 'holiday':
|
||||
return {
|
||||
hats: rarity(0.75, ['🎁', '🎄', '🌲']),
|
||||
ties: rarity(0.75, ['🧣']),
|
||||
messages: [
|
||||
|
@ -53,9 +55,10 @@ export default function getSeasonalHouston({ fancy }: { fancy?: boolean }): Seas
|
|||
`I'm dreaming of a brand new website!`,
|
||||
`No better holiday gift than a new site!`,
|
||||
`Your creativity is the gift that keeps on giving!`,
|
||||
]
|
||||
}
|
||||
default: return {
|
||||
],
|
||||
};
|
||||
default:
|
||||
return {
|
||||
hats: fancy ? ['🎩', '🎩', '🎩', '🎩', '🎓', '👑', '🧢', '🍦'] : undefined,
|
||||
ties: fancy ? rarity(0.33, ['🎀', '🧣']) : undefined,
|
||||
messages: [
|
||||
|
@ -77,8 +80,8 @@ export default function getSeasonalHouston({ fancy }: { fancy?: boolean }): Seas
|
|||
`Initiating launch sequence...`,
|
||||
`Initiating launch sequence... right... now!`,
|
||||
`Awaiting further instructions.`,
|
||||
]
|
||||
}
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,10 +95,10 @@ function getSeason(): Season | undefined {
|
|||
return 'new-year';
|
||||
}
|
||||
if (month === 10 && day > 7) {
|
||||
return 'spooky'
|
||||
return 'spooky';
|
||||
}
|
||||
if (month === 12 && day > 7 && day < 25) {
|
||||
return 'holiday'
|
||||
return 'holiday';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,6 +106,6 @@ function getSeason(): Season | undefined {
|
|||
function rarity(frequency: number, emoji: string[]) {
|
||||
if (frequency === 1) return emoji;
|
||||
if (frequency === 0) return [''];
|
||||
const empty = Array.from({ length: Math.round(emoji.length * frequency) }, () => '')
|
||||
const empty = Array.from({ length: Math.round(emoji.length * frequency) }, () => '');
|
||||
return [...emoji, ...empty];
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export function setStdout(writable: typeof process.stdout) {
|
|||
stdout = writable;
|
||||
}
|
||||
|
||||
export async function say(messages: string | string[], { clear = false, hat = '', tie = ''} = {}) {
|
||||
export async function say(messages: string | string[], { clear = false, hat = '', tie = '' } = {}) {
|
||||
return houston(messages, { clear, hat, tie, stdout });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue