feat(init): deprecate init and bump deps (#102)

Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
This commit is contained in:
Evo
2023-06-16 10:32:56 +05:30
committed by GitHub
parent 58fa3253f6
commit dce78c0945
8 changed files with 1942 additions and 136 deletions

View File

@@ -9,7 +9,7 @@ export function help() {
Welcome!
If you're new to ${cyanBright('sern')}, run ${magentaBright(
'sern init'
'npm create @sern/bot'
)} for an interactive setup to your new bot project!
${green(

View File

@@ -1,4 +1,4 @@
import { greenBright, redBright, underline } from 'colorette';
import { greenBright, redBright, underline, yellowBright } from 'colorette';
import { execa } from 'execa';
import { findUp } from 'find-up';
import ora from 'ora';
@@ -19,7 +19,16 @@ import { cloneRepo, installDeps } from '../utilities/install.js';
import { npm } from '../utilities/npm.js';
import type { PackageManagerChoice } from '../utilities/types.js';
/** @deprecated Use npm create instead */
export async function init(flags: Flags) {
console.log(
`${yellowBright(
'[WARN]:'
)} This command is deprecated, use ${greenBright(
'npm create @sern/bot'
)} instead`
);
let data: PromptData;
let git_init = true; // the default;
let pm = flags.sync ? undefined : flags.y ? 'npm' : await npm();

View File

@@ -6,18 +6,21 @@ import { init } from './commands/init.js';
import { Command } from 'commander';
import { plugins } from './commands/plugins.js';
import { yellowBright } from 'colorette';
export const program = new Command();
const version: string = '[VI]{{inject}}[/VI]';
program
.name('sern')
.description(help())
.version(`sern CLI v${version}`)
.version(`sern CLI v${version}`, '-v, --version')
.exitOverride(() => process.exit(0));
program
.command(init.name)
.description('Quickest way to scaffold a new project')
.description(
`Quickest way to scaffold a new project ${yellowBright('[DEPRECATED]')}`
)
.option('-y', 'Finishes setup as default')
.option('-s, --sync', 'Syncs the project and generates sern.config.json')
.action(init);