This commit is contained in:
mdnapo 2024-07-26 16:57:28 +02:00
parent 6301bd438a
commit 128ae21088
5 changed files with 22 additions and 19 deletions

View File

@ -2,6 +2,3 @@
- Add a CLI UI library - Add a CLI UI library
- Clean up README files - Clean up README files
- Theme the site with a custom color scheme and icon/logos
- Elaborate on terminology and best practices, like meaningful service names (also emphasize common sense?)
- Fix bug in HelloWorldCommand.ExecuteAsync

View File

@ -133,14 +133,18 @@ public class DotenvCommand : Command, ISubCommandOf<RootCommand>
private async Task ExecuteAsync(string vars, bool overwrite) private async Task ExecuteAsync(string vars, bool overwrite)
{ {
var path = Path.Join(Environment.CurrentDirectory, ".env"); var path = Path.Join(Environment.CurrentDirectory, ".env");
var exists = File.Exists(path);
if (exists && !overwrite) if (File.Exists(path))
{ {
Console.WriteLine($"File {path} already exists, add the -o or --overwrite flag to overwrite it."); if (overwrite)
{
await _context.WriteFile(".env", content);
return; return;
} }
Console.WriteLine($"File {path} already exists, add the -o or --overwrite flag to overwrite it.");
}
var content = string.Join(Environment.NewLine, vars.Split(';')); var content = string.Join(Environment.NewLine, vars.Split(';'));
await _context.CreateFile(".env", content); await _context.CreateFile(".env", content);
} }

View File

@ -4,8 +4,8 @@ import type * as Preset from '@docusaurus/preset-classic';
const config: Config = { const config: Config = {
title: 'MycroForge', title: 'MycroForge',
tagline: 'Your FastAPI & SQLAlchemy assistant!', tagline: 'Your FastAPI & SQLAlchemy toolkit!',
favicon: 'img/favicon.ico', // favicon: 'img/favicon.ico',
// Set the production url of your site here // Set the production url of your site here
url: 'https://git.devdisciples.com', url: 'https://git.devdisciples.com',
@ -52,10 +52,10 @@ const config: Config = {
image: 'img/docusaurus-social-card.jpg', image: 'img/docusaurus-social-card.jpg',
navbar: { navbar: {
title: 'MycroForge', title: 'MycroForge',
logo: { // logo: {
alt: 'MycroForge Logo', // alt: 'MycroForge Logo',
src: 'img/logo.svg', // src: 'img/logo.svg',
}, // },
items: [ items: [
{ {
type: 'docSidebar', type: 'docSidebar',

View File

@ -4,14 +4,14 @@ import styles from './styles.module.css';
type FeatureItem = { type FeatureItem = {
title: string; title: string;
Svg: React.ComponentType<React.ComponentProps<'svg'>>; // Svg: React.ComponentType<React.ComponentProps<'svg'>>;
description: JSX.Element; description: JSX.Element;
}; };
const FeatureList: FeatureItem[] = [ const FeatureList: FeatureItem[] = [
{ {
title: 'Initialize a Skeleton Project Quickly', title: 'Initialize a Skeleton Project Quickly',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, // Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: ( description: (
<> <>
Start a new FastAPI and SQLAlchemy project with a single command. Start a new FastAPI and SQLAlchemy project with a single command.
@ -21,7 +21,7 @@ const FeatureList: FeatureItem[] = [
}, },
{ {
title: 'Generate Common Items', title: 'Generate Common Items',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, // Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: ( description: (
<> <>
Use MycroForge to generate boilerplate code for entities, services, and routers. Use MycroForge to generate boilerplate code for entities, services, and routers.
@ -31,7 +31,8 @@ const FeatureList: FeatureItem[] = [
}, },
{ {
title: 'Extend MycroForge', title: 'Extend MycroForge',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, // Svg: '',
// Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: ( description: (
<> <>
Create plugins to extend MycroForge with your own custom commands. Create plugins to extend MycroForge with your own custom commands.
@ -40,11 +41,12 @@ const FeatureList: FeatureItem[] = [
}, },
]; ];
function Feature({ title, Svg, description }: FeatureItem) { function Feature({ title, description }: FeatureItem) {
// function Feature({ title, Svg, description }: FeatureItem) {
return ( return (
<div className={clsx('col col--4', styles.feature)}> <div className={clsx('col col--4', styles.feature)}>
<div className="text--center"> <div className="text--center">
<Svg className={styles.featureSvg} role="img" /> {/* <Svg className={styles.featureSvg} role="img" /> */}
</div> </div>
<div className="text--center padding-horiz--md"> <div className="text--center padding-horiz--md">
<Heading as="h3">{title}</Heading> <Heading as="h3">{title}</Heading>

View File

@ -32,7 +32,7 @@ export default function Home(): JSX.Element {
const {siteConfig} = useDocusaurusContext(); const {siteConfig} = useDocusaurusContext();
return ( return (
<Layout <Layout
title={`Hello from ${siteConfig.title}`} title={`Home page`}
description="Description will go into a meta tag in <head />"> description="Description will go into a meta tag in <head />">
<HomepageHeader /> <HomepageHeader />
<main> <main>