From 89fb2f5d7a37c9517f52d42cad72210d9d9217d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigui=20Kess=C3=A9=20Emmanuel?= Date: Sat, 4 Jan 2025 21:54:02 +0100 Subject: [PATCH 1/2] :pencil2: Improve the label of the current directory path --- libs/create-qwikdev-astro/src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/create-qwikdev-astro/src/app.ts b/libs/create-qwikdev-astro/src/app.ts index c69dd247..bda6eccd 100644 --- a/libs/create-qwikdev-astro/src/app.ts +++ b/libs/create-qwikdev-astro/src/app.ts @@ -186,7 +186,7 @@ export class Application extends Program { definition.destination === defaultDefinition.destination ? await this.scanString( `Where would you like to create your new project? ${this.gray( - `(Use '.' for current directory)` + `(Use './' for current directory)` )}`, definition.destination ) From 16aa5c12f178c86a8869a1b4af9c8e34fba3d226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigui=20Kess=C3=A9=20Emmanuel?= Date: Sat, 4 Jan 2025 23:17:27 +0100 Subject: [PATCH 2/2] :memo: Update CLI documentation --- libs/create-qwikdev-astro/README.md | 199 ++++++++++++++++------------ 1 file changed, 111 insertions(+), 88 deletions(-) diff --git a/libs/create-qwikdev-astro/README.md b/libs/create-qwikdev-astro/README.md index 55e00243..520be467 100644 --- a/libs/create-qwikdev-astro/README.md +++ b/libs/create-qwikdev-astro/README.md @@ -1,64 +1,80 @@ # Create @qwikdev/astro 🎉 -## Scaffolding for [QwikDev/astro](https://github.com/QwikDev/astro) projects +## **The Ultimate Starter for QwikDev/Astro Projects** -### 🛠️ CLI +Seamlessly scaffold content-driven web projects with the power of [QwikDev/Astro](https://github.com/QwikDev/astro). +Whether you're building blazing-fast blogs, portfolios, or scalable applications, +this CLI has you covered. - - **With `NPM`**: +--- - ```bash - npm create @qwikdev/astro@latest [destination] [adapter] [...options] - ``` +## 🚀 **Installation & Usage** - - **With `Yarn`**: +### 🧑‍💻 CLI - ```bash - yarn create @qwikdev/astro [destination] [adapter] [...options] - ``` +Run the following command using your preferred package manager: - - **With `PNPM`**: +- **With `NPM`**: - ```bash - pnpm create @qwikdev/astro [destination] [adapter] [...options] - ``` + ```bash + npm create @qwikdev/astro@latest [destination] [adapter] [...options] + ``` - - **With `Bun`**: +- **With `Yarn`**: - ```bash - bun create @qwikdev/astro [destination] [adapter] [...options] - ``` + ```bash + yarn create @qwikdev/astro [destination] [adapter] [...options] + ``` + +- **With `PNPM`**: - The `create @qwikdev/astro` command runs interactively without any arguments or options. + ```bash + pnpm create @qwikdev/astro [destination] [adapter] [...options] + ``` + +- **With `Bun`**: + + ```bash + bun create @qwikdev/astro [destination] [adapter] [...options] + ``` - However, it is possible to use the interactive mode as described below: +### 🛠️ Arguments & Options - **Types of arguments:** +#### Arguments + + Customize the command with the following arguments: | Name | Type | Default value | Description | | :-----------| :--------------------------| :----------------| :---------------------------------| | destination | String | ./qwik-astro-app | Directory of the project. | | adapter | "deno" or "node" or "none" | none | Server adapter. | - **Types of options:** - - | Name | Description | - | :--------------------------------------| :----------------------------------------| - | `--help` (`-h`) | Display available flags. | - | `--template` (`-t`) | Start from an Astro template. | - | `--add` (`-a`) / `--no-add` (`--no-a`) | Add QwikDev/astro to existing project. | - | `--force` (`-f`) / `--no-force` (`--no-f`) | Overwrite target directory if it exists. | - | `--copy` (`-c`) / `--no-copy` (`--no-c`) | Copy files without overwriting. | - | `--biome` / `--no-biome` | Prefer Biome to ESLint/Prettier. | - | `--install` (`-i`) / `--no-install` (`--no-i`) | Install dependencies. | - | `--git` / `--no-git` | Initialize Git repository. | - | `--ci` / `--no-ci` | Add CI workflow. | - | `--yes` (`-y`) | Skip all prompts by accepting defaults. | - | `--no` (`-n`) | Skip all prompts by declining defaults. | - | `--dry-run` | Walk through steps without executing. | +#### Options + + Enhance your project setup with these additional flags: + + | Name | Shortcut | Description | + | :--------------------------- | :---------------| :----------------------------------------------| + | `--help` | `-h` | Display all available options. | + | `--template` | `-t` | Use an Astro template. | + | `--add` / `--no-add` | `-a` / `--no-a` | Add QwikDev/astro to an existing project. | + | `--force` / `--no-force` | `-f` / `--no-f` | Overwrite target directory, if needed. | + | `--copy` / `--no-copy` | `-c` / `--no-c` | Copy files without overwriting. | + | `--biome` / `--no-biome` | | Use Biome instead of ESLint/Prettier. | + | `--install` / `--no-install` | `-i` / `--no-i` | Automatically install dependencies. | + | `--git` / `--no-git` | | Initialize a Git repository. | + | `--ci` / `--no-ci` | | Add CI workflow. | + | `--yes` | `-y` | Accept all default configurations. | + | `--no` | `-n` | Decline all default configurations. | + | `--dry-run` | | Simulate the setup process without executing. | ### 📦 API - - Use the arguments provided in the command line: +For developers looking to programmatically access the CLI functionality: + +1. Basic Usage + + Run the CLI programmatically without arguments: ```typescript import createQwikAstro from '@qwikdev/create-astro'; @@ -66,7 +82,9 @@ createQwikAstro(); ``` - - Specify the command line arguments to use: +2. With Custom Arguments + + Specify arguments directly: ```typescript import { run } from '@qwikdev/create-astro'; @@ -74,53 +92,58 @@ run(["./qwik-astro-app", "node"]); ``` - **Definition type:** - - ```typescript - export type Definition = { - destination: string; - adapter?: "deno" | "node" | "none"; - template?: string; - add?: boolean; - force?: boolean; - copy?: boolean; - biome?: boolean; - install?: boolean; - git?: boolean; - ci?: boolean; - yes?: boolean; - no?: boolean; - dryRun?: boolean; - }; - ``` +3. Definition Types + + Define the structure of the CLI options and arguments: + + ```typescript + export type Definition = { + destination: string; + adapter?: "deno" | "node" | "none"; + template?: string; + add?: boolean; + force?: boolean; + copy?: boolean; + biome?: boolean; + install?: boolean; + git?: boolean; + ci?: boolean; + yes?: boolean; + no?: boolean; + dryRun?: boolean; + }; + ``` + +4. Default Settings + + Here are the default configurations: + + ```typescript + export const defaultDefinition = { + destination: "./qwik-astro-app", + adapter: "none", + template: "", + add: undefined, + force: undefined, + copy: undefined, + biome: undefined, + install: undefined, + git: undefined, + ci: undefined, + yes: undefined, + no: undefined, + dryRun: undefined + } as const; + ``` + +## 🌐 Community + +- 🐦 Ping [@QwikDev](https://twitter.com/QwikDev) on Twitter +- 💬 Join our [Discord community](https://qwik.dev/chat) for discussions and support + +## 🔗 Related Links -**Default definition:** - -```typescript -export const defaultDefinition = { - destination: "./qwik-astro-app", - adapter: "none", - template: "", - add: undefined, - force: undefined, - copy: undefined, - biome: undefined, - install: undefined, - git: undefined, - ci: undefined, - yes: undefined, - no: undefined, - dryRun: undefined -} as const; -``` - -## 🌍 Community - -- Follow us on [@QwikDev](https://twitter.com/QwikDev) -- Ping us at [@QwikDev](https://twitter.com/QwikDev) -- Join our [Discord](https://qwik.dev/chat) community - -## 🔗 Related - -- [Qwik](https://qwik.dev/) -- [Astro](https://astro.build/) +- 📖 [Qwik](https://qwik.dev/) – Build instantly-interactive web apps. +- 📖 [Astro](https://astro.build/) – The web framework for content-rich websites. +- 🌟 [Awesome Astro (Community Examples)](https://github.com/one-aalam/awesome-astro?tab=readme-ov-file#%E2%84%B9%EF%B8%8F-repositoriesstarter-kitscomponents) +- 📚 [Full List of Templates](https://github.com/withastro/astro/tree/main/examples)