Skip to content

Commit

Permalink
Merge pull request #115 from siguici/main
Browse files Browse the repository at this point in the history
🚸 Improve user experience
  • Loading branch information
siguici authored Apr 29, 2024
2 parents e5951b1 + cbca1d3 commit 6e19e02
Show file tree
Hide file tree
Showing 46 changed files with 375 additions and 109 deletions.
5 changes: 5 additions & 0 deletions .changeset/poor-vans-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@qwikdev/create-astro": patch
---

🚸 Improve user experience
112 changes: 95 additions & 17 deletions libs/create-qwikdev-astro/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,108 @@
# Create @qwikdev/astro 🎉

Get started with [the @qwikdev/astro integration](https://github.com/QwikDev/astro):
## Scaffolding for [QwikDev/astro](https://github.com/QwikDev/astro) projects

- Using `npm`:
### 🛠️ CLI

```bash
npm create @qwikdev/astro@latest
```
- **With `NPM`**:

- Using `Yarn`:
```bash
npm create @qwikdev/astro@latest [project] [adapter] [...options]
```

```bash
yarn create @qwikdev/astro
```
- **With `Yarn`**:

- Using `PNPM`:
```bash
yarn create @qwikdev/astro [project] [adapter] [...options]
```

```bash
pnpm create @qwikdev/astro
```
- **With `PNPM`**:

- Using `Bun`:
```bash
pnpm create @qwikdev/astro [project] [adapter] [...options]
```

```bash
bun create @qwikdev/astro
```
- **With `Bun`**:

```bash
bun create @qwikdev/astro [project] [adapter] [...options]
```

The `create @qwikdev/astro` command runs interactively without any arguments or options.

However, it is possible to use the interactive mode as described below:

**Types of arguments:**

| Name | Type | Default value | Description |
| :-------| :----------------| :----------------| :---------------------------------|
| project | String | ./qwik-astro-app | Directory of the project. |
| adapter | "deno" or "node" | node | Server adapter. |

**Types of options:**

| Name | Description |
| :--------------------------------------| :----------------------------------------|
| `--help` (`-h`) | Display available flags. |
| `--it` | Execute actions interactively. |
| `--dry-run` | Walk through steps without executing. |
| `--force` / `--no-force` (`-f` / `--no-f`) | Overwrite target directory if it exists. |
| `--install` / `--no-install` (`-i` / `--no-i`) | Install dependencies. |
| `--biome` / `--no-biome` | Prefer Biome to ESLint/Prettier. |
| `--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. |

### 📦 API

- Use the arguments provided in the command line:

```typescript
import createQwikAstro from '@qwikdev/create-astro';
createQwikAstro();
```

- Specify the command line arguments to use:

```typescript
import { runCreate } from '@qwikdev/create-astro';
runCreate("./qwik-astro-app", "node", "--it");
```
- Pass the arguments to create a new project:
```typescript
import { createProject } from '@qwikdev/create-astro';
const config = {
project: "./qwik-astro-app",
starter: "node",
it: false,
};
createProject(config);
```
**Project configuration type:**
```typescript
export type ProjectConfig = {
project: string;
adapter?: "deno" | "node";
force?: boolean;
install?: boolean;
biome?: boolean;
git?: boolean;
ci?: boolean;
yes: boolean;
no: boolean;
it: boolean;
dryRun: boolean;
};
```
## 🌍 Community
Expand Down
4 changes: 4 additions & 0 deletions libs/create-qwikdev-astro/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"ignore": ["dist", "stubs"]
},
"linter": {
"include": ["src"],
"ignore": ["dist", "stubs"],
"rules": {
"style": {
"noParameterAssign": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
},
Expand Down
4 changes: 1 addition & 3 deletions libs/create-qwikdev-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
"./package.json": "./package.json"
},
"files": ["dist", "stubs"],
"bin": {
"create-qwikdev-astro": "./dist/index.js"
},
"bin": "./dist/cli.js",
"keywords": [
"astro-integration",
"astro-component",
Expand Down
3 changes: 3 additions & 0 deletions libs/create-qwikdev-astro/src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

import("./index.js").then((createQwikDevAstro) => createQwikDevAstro.default());
Loading

0 comments on commit 6e19e02

Please sign in to comment.