Skip to content

Commit 3c8de60

Browse files
committed
chore: update repo
1 parent a5ccf5b commit 3c8de60

11 files changed

Lines changed: 1427 additions & 865 deletions

File tree

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/setup-node@v4
1111
with: { node-version: lts/*, cache: "pnpm" }
1212
- run: pnpm install
13-
- run: pnpm lint:fix
13+
- run: pnpm fmt
1414
- run: pnpm automd
1515
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
1616
with: { commit-message: "chore: apply automated updates" }

.oxfmtrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://unpkg.com/oxfmt/configuration_schema.json",
3+
"ignorePatterns": ["CHANGELOG.md"]
4+
}

.oxlintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "https://unpkg.com/oxlint/configuration_schema.json",
3+
"plugins": ["unicorn", "typescript", "oxc"],
4+
"rules": {}
5+
}

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

AGENTS.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# create-nitro-app
2+
3+
CLI tool that scaffolds new [Nitro](https://nitro.build) applications with a single command. Part of the [nitrojs](https://github.com/nitrojs) ecosystem.
4+
5+
Keep AGENTS.md updated with project structure and architecture.
6+
7+
## Project Structure
8+
9+
```
10+
src/cli.ts # Main CLI entry point (single-file CLI)
11+
nitro-app/ # Reference Nitro starter template
12+
build.config.mjs # obuild config (bundles CLI + injects pkg metadata)
13+
dist/ # Compiled output (single bundled .mjs executable)
14+
```
15+
16+
## Architecture
17+
18+
### CLI Flow (`src/cli.ts`)
19+
20+
1. Display ASCII banner
21+
2. Prompt for target directory (default: `nitro-app`)
22+
3. Handle existing directory (override/rename/abort)
23+
4. Select template from registry
24+
5. Download template via `giget` from `https://raw.githubusercontent.com/nitrojs/starter/templates`
25+
6. Detect/select package manager and install dependencies
26+
7. Optionally initialize git repo
27+
8. Display next steps
28+
29+
### CLI Arguments
30+
31+
| Arg | Description |
32+
| ------------------------------- | ---------------------------------- |
33+
| `dir` (positional) | Target directory |
34+
| `--template/-t` | Template name |
35+
| `--force` | Overwrite existing directory |
36+
| `--forceClean` | Remove existing dir before cloning |
37+
| `--offline` / `--preferOffline` | Cache behavior |
38+
| `--install` | Install deps (default: true) |
39+
| `--packageManager/-p` | Specify PM (npm, pnpm, yarn, bun) |
40+
| `--gitInit` | Initialize git repo |
41+
42+
### Templates
43+
44+
Hardcoded in `src/cli.ts`:
45+
46+
- **vite** - Full-stack with Vite
47+
- **cli** - Backend with Nitro CLI
48+
49+
### Build System
50+
51+
Uses **obuild** (rolldown-based bundler) to produce a single `dist/cli.mjs` executable (~793KB). Build-time injected globals:
52+
53+
- `globalThis.__pkg_version__`
54+
- `globalThis.__pkg_name__`
55+
- `globalThis.__pkg_description__`
56+
57+
## Key Dependencies
58+
59+
| Package | Purpose |
60+
| ------------ | ---------------------------------------------- |
61+
| **citty** | CLI framework (commands, args) |
62+
| **consola** | Logging and interactive prompts |
63+
| **giget** | Template downloading from GitHub registry |
64+
| **nypm** | Package manager detection and dep installation |
65+
| **tinyexec** | Shell command execution (git init) |
66+
67+
## Scripts
68+
69+
```bash
70+
pnpm build # Bundle CLI with obuild
71+
pnpm create-nitro-app # Test CLI locally (node ./src/cli.ts)
72+
pnpm lint # ESLint + Prettier check
73+
pnpm fmt # automd + ESLint fix + Prettier format
74+
pnpm test # lint + type check
75+
pnpm release # test + changelog + publish + push
76+
```
77+
78+
## Conventions
79+
80+
- ESM only (`"type": "module"`)
81+
- UnJS ESLint preset
82+
- Semantic commit messages with changelogen
83+
- TypeScript strict mode
84+
- 2-space indentation

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

eslint.config.mjs

Lines changed: 0 additions & 13 deletions
This file was deleted.

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22
"name": "create-nitro-app",
33
"version": "0.8.4",
44
"description": "Create a Nitro app with a single command",
5-
"repository": "nitrojs/create-nitro-app",
65
"license": "MIT",
7-
"sideEffects": false,
8-
"type": "module",
6+
"repository": "nitrojs/create-nitro-app",
97
"bin": "./dist/cli.mjs",
108
"files": [
119
"dist"
1210
],
11+
"type": "module",
12+
"sideEffects": false,
1313
"scripts": {
1414
"build": "obuild",
1515
"create-nitro-app": "node ./src/cli.ts",
16-
"lint": "eslint . && prettier -c .",
17-
"lint:fix": "automd && eslint . --fix && prettier -w .",
16+
"lint": "oxlint . && oxfmt --check .",
17+
"fmt": "automd && oxlint . --fix && oxfmt .",
1818
"prepack": "pnpm build",
1919
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
2020
"test": "pnpm lint && pnpm test:types",
2121
"test:types": "tsgo --noEmit --skipLibCheck"
2222
},
2323
"devDependencies": {
24-
"@types/node": "^25.0.9",
25-
"@typescript/native-preview": "7.0.0-dev.20260120.1",
26-
"automd": "^0.4.2",
24+
"@types/node": "^25.5.0",
25+
"@typescript/native-preview": "^7.0.0-dev.20260315.1",
26+
"automd": "^0.4.3",
2727
"changelogen": "^0.6.2",
28-
"citty": "^0.1.6",
28+
"citty": "^0.2.1",
2929
"consola": "^3.4.2",
30-
"eslint": "^9.39.2",
3130
"eslint-config-unjs": "^0.6.2",
32-
"giget": "^3.0.0",
33-
"nypm": "^0.6.3",
34-
"obuild": "^0.4.18",
35-
"prettier": "^3.8.0",
36-
"tinyexec": "^1.0.2",
31+
"giget": "^3.1.2",
32+
"nypm": "^0.6.5",
33+
"obuild": "^0.4.32",
34+
"oxfmt": "^0.40.0",
35+
"oxlint": "^1.55.0",
36+
"tinyexec": "^1.0.4",
3737
"typescript": "^5.9.3",
38-
"vitest": "^4.0.17"
38+
"vitest": "^4.1.0"
3939
},
40-
"packageManager": "pnpm@10.28.1"
40+
"packageManager": "pnpm@10.32.1"
4141
}

0 commit comments

Comments
 (0)