phos 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +3 -0
- package/AGENTS.md +172 -0
- package/CHANGELOG.md +184 -0
- package/LICENSE +21 -0
- package/README.md +279 -0
- package/bun.lock +125 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +255 -0
- package/dist/cli.js.map +1 -0
- package/dist/generators/backends/elysia.d.ts +3 -0
- package/dist/generators/backends/elysia.d.ts.map +1 -0
- package/dist/generators/backends/elysia.js +135 -0
- package/dist/generators/backends/elysia.js.map +1 -0
- package/dist/generators/backends/fastapi.d.ts +3 -0
- package/dist/generators/backends/fastapi.d.ts.map +1 -0
- package/dist/generators/backends/fastapi.js +158 -0
- package/dist/generators/backends/fastapi.js.map +1 -0
- package/dist/generators/frontends/astro.d.ts +3 -0
- package/dist/generators/frontends/astro.d.ts.map +1 -0
- package/dist/generators/frontends/astro.js +303 -0
- package/dist/generators/frontends/astro.js.map +1 -0
- package/dist/generators/frontends/nextjs.d.ts +3 -0
- package/dist/generators/frontends/nextjs.d.ts.map +1 -0
- package/dist/generators/frontends/nextjs.js +274 -0
- package/dist/generators/frontends/nextjs.js.map +1 -0
- package/dist/generators/frontends/svelte.d.ts +3 -0
- package/dist/generators/frontends/svelte.d.ts.map +1 -0
- package/dist/generators/frontends/svelte.js +324 -0
- package/dist/generators/frontends/svelte.js.map +1 -0
- package/dist/generators/monorepo.d.ts +3 -0
- package/dist/generators/monorepo.d.ts.map +1 -0
- package/dist/generators/monorepo.js +320 -0
- package/dist/generators/monorepo.js.map +1 -0
- package/dist/generators/single.d.ts +3 -0
- package/dist/generators/single.d.ts.map +1 -0
- package/dist/generators/single.js +229 -0
- package/dist/generators/single.js.map +1 -0
- package/dist/utils/helpers.d.ts +38 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +109 -0
- package/dist/utils/helpers.js.map +1 -0
- package/package.json +46 -0
- package/src/cli.ts +500 -0
- package/src/generators/backends/elysia.ts +45 -0
- package/src/generators/backends/fastapi.ts +71 -0
- package/src/generators/frontends/astro.ts +37 -0
- package/src/generators/frontends/nextjs.ts +37 -0
- package/src/generators/frontends/svelte.ts +38 -0
- package/src/generators/monorepo.ts +529 -0
- package/src/generators/single.ts +465 -0
- package/src/templates/backend/elysia/README.md +15 -0
- package/src/templates/backend/elysia/package.json +26 -0
- package/src/templates/backend/elysia/src/api/user_api.ts +0 -0
- package/src/templates/backend/elysia/src/db.ts +17 -0
- package/src/templates/backend/elysia/src/index.ts +68 -0
- package/src/templates/backend/elysia/src/service/user_service.ts +0 -0
- package/src/templates/backend/elysia/src/sql/user_sql.ts +0 -0
- package/src/templates/backend/elysia/src/types/user_type.ts +0 -0
- package/src/templates/backend/elysia/tsconfig.json +103 -0
- package/src/templates/backend/fastapi/.pylintrc +2 -0
- package/src/templates/backend/fastapi/README.md +33 -0
- package/src/templates/backend/fastapi/pyproject.toml +9 -0
- package/src/templates/backend/fastapi/pyproject_prettier.toml +20 -0
- package/src/templates/backend/fastapi/requirements.txt +15 -0
- package/src/templates/backend/fastapi/setup.sh +23 -0
- package/src/templates/backend/fastapi/src/api/user_api.py +0 -0
- package/src/templates/backend/fastapi/src/db.py +31 -0
- package/src/templates/backend/fastapi/src/main.py +53 -0
- package/src/templates/backend/fastapi/src/service/user_service.py +0 -0
- package/src/templates/backend/fastapi/src/sql/user_sql.py +0 -0
- package/src/templates/backend/fastapi/src/types/user_type.py +0 -0
- package/src/templates/frontend/astro/README.md +46 -0
- package/src/templates/frontend/astro/astro.config.mjs +5 -0
- package/src/templates/frontend/astro/package.json +28 -0
- package/src/templates/frontend/astro/public/favicon.ico +0 -0
- package/src/templates/frontend/astro/public/favicon.svg +9 -0
- package/src/templates/frontend/astro/src/assets/astro.svg +1 -0
- package/src/templates/frontend/astro/src/assets/background.svg +1 -0
- package/src/templates/frontend/astro/src/components/Welcome.astro +5 -0
- package/src/templates/frontend/astro/src/layouts/Layout.astro +23 -0
- package/src/templates/frontend/astro/src/pages/index.astro +8 -0
- package/src/templates/frontend/astro/tsconfig.json +5 -0
- package/src/templates/frontend/nextjs/README.md +36 -0
- package/src/templates/frontend/nextjs/app/favicon.ico +0 -0
- package/src/templates/frontend/nextjs/app/globals.css +26 -0
- package/src/templates/frontend/nextjs/app/layout.tsx +34 -0
- package/src/templates/frontend/nextjs/app/page.tsx +16 -0
- package/src/templates/frontend/nextjs/eslint.config.mjs +18 -0
- package/src/templates/frontend/nextjs/next.config.ts +7 -0
- package/src/templates/frontend/nextjs/package.json +28 -0
- package/src/templates/frontend/nextjs/postcss.config.mjs +7 -0
- package/src/templates/frontend/nextjs/public/file.svg +1 -0
- package/src/templates/frontend/nextjs/public/globe.svg +1 -0
- package/src/templates/frontend/nextjs/public/next.svg +1 -0
- package/src/templates/frontend/nextjs/public/vercel.svg +1 -0
- package/src/templates/frontend/nextjs/public/window.svg +1 -0
- package/src/templates/frontend/nextjs/tsconfig.json +34 -0
- package/src/templates/frontend/svelte/.prettierignore +9 -0
- package/src/templates/frontend/svelte/.prettierrc +19 -0
- package/src/templates/frontend/svelte/README.md +42 -0
- package/src/templates/frontend/svelte/eslint.config.js +39 -0
- package/src/templates/frontend/svelte/package.json +39 -0
- package/src/templates/frontend/svelte/src/app.d.ts +13 -0
- package/src/templates/frontend/svelte/src/app.html +11 -0
- package/src/templates/frontend/svelte/src/lib/assets/favicon.svg +1 -0
- package/src/templates/frontend/svelte/src/lib/index.ts +1 -0
- package/src/templates/frontend/svelte/src/routes/+layout.svelte +9 -0
- package/src/templates/frontend/svelte/src/routes/+page.svelte +2 -0
- package/src/templates/frontend/svelte/src/routes/layout.css +2 -0
- package/src/templates/frontend/svelte/static/robots.txt +3 -0
- package/src/templates/frontend/svelte/svelte.config.js +13 -0
- package/src/templates/frontend/svelte/tsconfig.json +20 -0
- package/src/templates/frontend/svelte/vite.config.ts +5 -0
- package/src/utils/helpers.ts +198 -0
- package/tsconfig.json +24 -0
package/.eslintignore
ADDED
package/AGENTS.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# AGENTS Guidelines for This Repository
|
|
2
|
+
|
|
3
|
+
## Project Name: Phos CLI
|
|
4
|
+
|
|
5
|
+
Full-stack interactive project generator CLI that scaffolds modern web applications with configurable backends and frontends.
|
|
6
|
+
|
|
7
|
+
**Version:** 1.0.0 (Production Release)
|
|
8
|
+
|
|
9
|
+
### Core Features:
|
|
10
|
+
|
|
11
|
+
1. **Interactive CLI** - Beautiful prompts using @clack/prompts
|
|
12
|
+
2. **Multiple Backends** - Elysia (Bun), FastAPI (Python)
|
|
13
|
+
3. **Multiple Frontends** - Astro, Svelte, Next.js
|
|
14
|
+
4. **Monorepo Support** - Workspace configuration for scalable projects
|
|
15
|
+
5. **Configurable Tooling** - TypeScript, ESLint, Prettier options
|
|
16
|
+
6. **CSS Frameworks** - Tailwind, SCSS, CSS Modules
|
|
17
|
+
7. **UI Components** - shadcn/ui, Radix UI
|
|
18
|
+
8. **Testing Support** - Vitest, Playwright
|
|
19
|
+
|
|
20
|
+
### Technology Stack:
|
|
21
|
+
|
|
22
|
+
- **CLI**: Node.js + TypeScript
|
|
23
|
+
- **CLI Framework**: Commander.js
|
|
24
|
+
- **Interactive Prompts**: @clack/prompts
|
|
25
|
+
- **File Operations**: fs-extra
|
|
26
|
+
- **Template Engine**: Handlebars
|
|
27
|
+
- **Terminal Colors**: picocolors
|
|
28
|
+
- **Backend**: Elysia (Bun), FastAPI (Python)
|
|
29
|
+
- **Frontend**: Astro, SvelteKit, Next.js
|
|
30
|
+
- **Package Managers**: npm, yarn, pnpm, bun
|
|
31
|
+
|
|
32
|
+
## 1. Development Workflow
|
|
33
|
+
|
|
34
|
+
### CLI Tool (Phos)
|
|
35
|
+
|
|
36
|
+
- Use Commander.js for CLI argument parsing
|
|
37
|
+
- Use @clack/prompts for beautiful interactive UI
|
|
38
|
+
- Use fs-extra for file system operations
|
|
39
|
+
- Use Handlebars for template rendering
|
|
40
|
+
- Use picocolors for terminal colors
|
|
41
|
+
|
|
42
|
+
## 2. Architecture
|
|
43
|
+
|
|
44
|
+
### Core Components
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
src/
|
|
48
|
+
├── cli.ts # Main CLI entry point
|
|
49
|
+
├── generators/
|
|
50
|
+
│ ├── monorepo.ts # Monorepo scaffold generator
|
|
51
|
+
│ ├── single.ts # Single project generator
|
|
52
|
+
│ ├── backends/
|
|
53
|
+
│ │ ├── elysia.ts # Elysia (Bun) backend generator
|
|
54
|
+
│ │ └── fastapi.ts # FastAPI (Python) backend generator
|
|
55
|
+
│ └── frontends/
|
|
56
|
+
│ ├── astro.ts # Astro frontend generator
|
|
57
|
+
│ ├── svelte.ts # Svelte frontend generator
|
|
58
|
+
│ └── nextjs.ts # Next.js frontend generator
|
|
59
|
+
├── templates/ # Project templates
|
|
60
|
+
└── utils/
|
|
61
|
+
└── helpers.ts # Helper functions
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### File Naming Conventions
|
|
65
|
+
|
|
66
|
+
| Layer | Pattern | Example |
|
|
67
|
+
| ------------ | ---------------- | ----------------------- |
|
|
68
|
+
| CLI Commands | `*.ts` | `cli.ts`, `monorepo.ts` |
|
|
69
|
+
| Generators | `{framework}.ts` | `elysia.ts`, `astro.ts` |
|
|
70
|
+
| Utils | `*.ts` | `helpers.ts` |
|
|
71
|
+
|
|
72
|
+
**Rules:**
|
|
73
|
+
|
|
74
|
+
- Use **PascalCase** for generator files
|
|
75
|
+
- Use **camelCase** for utility functions
|
|
76
|
+
- Export generators as named exports
|
|
77
|
+
|
|
78
|
+
## 3. Keep Dependencies in Sync
|
|
79
|
+
|
|
80
|
+
When adding/updating packages:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bun install <package>
|
|
84
|
+
# OR
|
|
85
|
+
npm install <package>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 4. Coding Conventions
|
|
89
|
+
|
|
90
|
+
### TypeScript
|
|
91
|
+
|
|
92
|
+
- Use modern TypeScript with strict mode enabled
|
|
93
|
+
- Import using `@/` alias for internal modules
|
|
94
|
+
- Use ES modules with `.js` extensions
|
|
95
|
+
|
|
96
|
+
### Project Templates
|
|
97
|
+
|
|
98
|
+
- Use Handlebars for dynamic content
|
|
99
|
+
- Include TypeScript/ESLint/Prettier options as needed
|
|
100
|
+
- Generate complete project structures
|
|
101
|
+
|
|
102
|
+
## 5. Key Technologies
|
|
103
|
+
|
|
104
|
+
### CLI Framework
|
|
105
|
+
|
|
106
|
+
- **Commander.js** - Command-line interface framework
|
|
107
|
+
- **@clack/prompts** - Interactive prompts
|
|
108
|
+
- **fs-extra** - Enhanced file system operations
|
|
109
|
+
- **Handlebars** - Template engine
|
|
110
|
+
- **picocolors** - Terminal colors
|
|
111
|
+
|
|
112
|
+
### Supported Backends
|
|
113
|
+
|
|
114
|
+
- **Elysia** - Fast and elegant Bun web framework
|
|
115
|
+
- **FastAPI** - Modern Python web framework
|
|
116
|
+
|
|
117
|
+
### Supported Frontends
|
|
118
|
+
|
|
119
|
+
- **Astro** - Modern static site generator
|
|
120
|
+
- **SvelteKit** - Full-stack Svelte framework
|
|
121
|
+
- **Next.js** - React framework with server components
|
|
122
|
+
|
|
123
|
+
## 6. Configuration Options
|
|
124
|
+
|
|
125
|
+
### Backend Options
|
|
126
|
+
|
|
127
|
+
- **TypeScript** - Enable/disable TypeScript
|
|
128
|
+
- **ESLint** - Add ESLint configuration
|
|
129
|
+
- **Prettier** - Add Prettier configuration
|
|
130
|
+
|
|
131
|
+
### Frontend Options
|
|
132
|
+
|
|
133
|
+
- **TypeScript** - Enable/disable TypeScript
|
|
134
|
+
- **ESLint** - Add ESLint configuration
|
|
135
|
+
- **Prettier** - Add Prettier configuration
|
|
136
|
+
- **CSS Framework** - Tailwind, SCSS, CSS Modules
|
|
137
|
+
- **UI Components** - shadcn/ui, Radix UI
|
|
138
|
+
- **Testing** - Vitest, Playwright, or both
|
|
139
|
+
|
|
140
|
+
## 7. Available Commands
|
|
141
|
+
|
|
142
|
+
| Command | Purpose |
|
|
143
|
+
| ------------------------- | ------------------------------ |
|
|
144
|
+
| `bun run dev create` | Run CLI in development mode |
|
|
145
|
+
| `bun run build` | Build TypeScript to JavaScript |
|
|
146
|
+
| `bun run start` | Run built CLI |
|
|
147
|
+
| `node dist/cli.js create` | Run CLI directly |
|
|
148
|
+
| `bun link` | Link CLI globally |
|
|
149
|
+
| `phos create` | Run CLI (after linking) |
|
|
150
|
+
|
|
151
|
+
## 8. Versioning
|
|
152
|
+
|
|
153
|
+
Phos CLI follows semantic versioning:
|
|
154
|
+
|
|
155
|
+
- **x.y.z (Patch/Bugfix)**: `0.0.x`, `1.0.x`, `2.0.x`
|
|
156
|
+
- Bug fixes
|
|
157
|
+
- Documentation updates
|
|
158
|
+
- Small improvements
|
|
159
|
+
|
|
160
|
+
- **x.y.0 (Minor/Feature)**: `0.x.0`, `1.x.0`, `2.x.0`
|
|
161
|
+
- New features
|
|
162
|
+
- Breaking changes (when < 1.0.0)
|
|
163
|
+
- Significant updates
|
|
164
|
+
|
|
165
|
+
- **x.0.0 (Major/Milestone)**: `1.0.0`, `2.0.0`, `3.0.0`
|
|
166
|
+
- Major architectural changes
|
|
167
|
+
- Complete rewrites
|
|
168
|
+
- Production-ready releases
|
|
169
|
+
|
|
170
|
+
**Current Version: 1.0.0** - Production Release
|
|
171
|
+
|
|
172
|
+
See [CHANGELOG.md](CHANGELOG.md) for detailed version history.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Phos CLI will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2026-02-09
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Production Release**: Phos CLI is now production-ready with full feature support
|
|
12
|
+
- **Interactive CLI**: Beautiful command-line interface powered by @clack/prompts
|
|
13
|
+
- **Project Types**: Support for both Monorepo and Single repository structures
|
|
14
|
+
- **Backend Frameworks**:
|
|
15
|
+
- Elysia - Fast and elegant Bun web framework with TypeScript support
|
|
16
|
+
- FastAPI - Modern Python web framework with type hints
|
|
17
|
+
- **Frontend Frameworks**:
|
|
18
|
+
- Astro - Modern static site generator
|
|
19
|
+
- SvelteKit - Full-stack Svelte framework
|
|
20
|
+
- Next.js - React framework with server components and App Router
|
|
21
|
+
- **Monorepo Features**:
|
|
22
|
+
- Organized workspace structure with `{ProjectName}_Backend` and `{ProjectName}_Frontend` folders
|
|
23
|
+
- `Docs/` folder with `Feature` and `DatabaseSetup` subfolders
|
|
24
|
+
- Root-level documentation: `AGENTS.md`, `LICENSE`, `env.example`
|
|
25
|
+
- Independent project configurations without workspace dependencies
|
|
26
|
+
- **Single Project Mode**: Generate standalone backend or frontend projects
|
|
27
|
+
- **Package Manager Support**:
|
|
28
|
+
- Node.js: npm, yarn, pnpm, bun
|
|
29
|
+
- Python: venv (virtual environment), pip (system)
|
|
30
|
+
- **Configurable Tooling**:
|
|
31
|
+
- TypeScript support for backend (Elysia only) and frontend frameworks
|
|
32
|
+
- ESLint configuration with custom rules
|
|
33
|
+
- Prettier code formatting
|
|
34
|
+
- **CSS Framework Options**: Tailwind CSS, SCSS, CSS Modules, or no framework
|
|
35
|
+
- **UI Component Libraries**: shadcn/ui, Radix UI, or no components
|
|
36
|
+
- **Testing Frameworks**: Vitest, Playwright, or both for unit and E2E testing
|
|
37
|
+
- **Git Integration**: Optional Git repository initialization
|
|
38
|
+
- **Dependency Installation**: Optional automatic dependency installation
|
|
39
|
+
- **Template System**: Handlebars-based template engine with dynamic configuration
|
|
40
|
+
- **Binary File Support**: Proper handling of images, fonts, and other binary files
|
|
41
|
+
- **Helper Functions**:
|
|
42
|
+
- `eq` helper for equality checks in templates
|
|
43
|
+
- `or` helper for OR conditions in templates
|
|
44
|
+
- **Configuration Summary**: Interactive summary display before project generation
|
|
45
|
+
- **Project Validation**: Directory existence checks and project name validation
|
|
46
|
+
- **Complete Documentation**: Auto-generated README.md, AGENTS.md, and schema docs
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **Binary File Handling**: Fixed `copyTemplate` function to properly handle binary files
|
|
51
|
+
- **Template Processing**: Binary files (PNG, JPG, fonts, archives) are now copied directly without Handlebars processing
|
|
52
|
+
- **Error Handling**: Improved error messages and cancellation handling throughout the CLI
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- **Monorepo Structure**: Updated from `apps/backend` and `apps/frontend` to capitalized `{ProjectName}_Backend` and `{ProjectName}_Frontend`
|
|
57
|
+
- **Folder Naming**: Backend and frontend folder names now have capitalized first letters
|
|
58
|
+
- **Default Configuration**: TypeScript, ESLint, and Prettier now default to `true`
|
|
59
|
+
- **User Experience**: Users must manually deselect options they don't want instead of selecting them
|
|
60
|
+
|
|
61
|
+
### Dependencies
|
|
62
|
+
|
|
63
|
+
- @clack/prompts: ^1.0.0
|
|
64
|
+
- commander: ^14.0.2
|
|
65
|
+
- fs-extra: ^11.3.3
|
|
66
|
+
- handlebars: ^4.7.8
|
|
67
|
+
- picocolors: ^1.1.1
|
|
68
|
+
- typescript: ^5.7.3
|
|
69
|
+
- tsx: ^4.19.2 (dev)
|
|
70
|
+
- @types/fs-extra: ^11.0.4 (dev)
|
|
71
|
+
- @types/node: ^20.11.0 (dev)
|
|
72
|
+
|
|
73
|
+
### Project Structure
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
phos/
|
|
77
|
+
├── src/
|
|
78
|
+
│ ├── cli.ts # Main CLI entry point
|
|
79
|
+
│ ├── generators/
|
|
80
|
+
│ │ ├── monorepo.ts # Monorepo generator
|
|
81
|
+
│ │ ├── single.ts # Single project generator
|
|
82
|
+
│ │ ├── backends/
|
|
83
|
+
│ │ │ ├── elysia.ts # Elysia backend generator
|
|
84
|
+
│ │ │ └── fastapi.ts # FastAPI backend generator
|
|
85
|
+
│ │ └── frontends/
|
|
86
|
+
│ │ ├── astro.ts # Astro frontend generator
|
|
87
|
+
│ │ ├── svelte.ts # Svelte frontend generator
|
|
88
|
+
│ │ └── nextjs.ts # Next.js frontend generator
|
|
89
|
+
│ ├── templates/ # Project templates
|
|
90
|
+
│ │ ├── backend/
|
|
91
|
+
│ │ │ ├── elysia/ # Elysia template files
|
|
92
|
+
│ │ │ └── fastapi/ # FastAPI template files
|
|
93
|
+
│ │ └── frontend/
|
|
94
|
+
│ │ ├── astro/ # Astro template files
|
|
95
|
+
│ │ ├── nextjs/ # Next.js template files
|
|
96
|
+
│ │ └── svelte/ # Svelte template files
|
|
97
|
+
│ └── utils/
|
|
98
|
+
│ └── helpers.ts # Helper functions
|
|
99
|
+
├── package.json # Package configuration
|
|
100
|
+
├── tsconfig.json # TypeScript configuration
|
|
101
|
+
├── .gitignore # Git ignore rules
|
|
102
|
+
├── AGENTS.md # Project guidelines
|
|
103
|
+
├── CHANGELOG.md # Version history
|
|
104
|
+
└── README.md # Documentation
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## [0.3.0] - 2026-02-09
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
|
|
111
|
+
- **Monorepo Structure Update**:
|
|
112
|
+
- Changed from `apps/backend` and `apps/frontend` to `{ProjectName}_Backend` and `{ProjectName}_Frontend`
|
|
113
|
+
- Added `Docs` folder with `Feature` and `DatabaseSetup` subfolders
|
|
114
|
+
- Added root level files: `AGENTS.md`, `LICENSE`, `env.example`
|
|
115
|
+
- Removed root `package.json` and workspace config files
|
|
116
|
+
- Each project now manages its own configurations independently
|
|
117
|
+
- **Folder Naming**:
|
|
118
|
+
- Backend and frontend folder names now have capitalized first letter
|
|
119
|
+
- Example: `Colorful_Backend` and `Colorful_Frontend` instead of `colorful_Backend`
|
|
120
|
+
- **Default Configuration**:
|
|
121
|
+
- TypeScript, ESLint, and Prettier now default to `true`
|
|
122
|
+
- Users must manually deselect options they don't want
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
|
|
126
|
+
- **Binary File Handling**:
|
|
127
|
+
- Fixed `copyTemplate` function to properly handle binary files
|
|
128
|
+
- Binary files (PNG, JPG, fonts, archives, etc.) are now copied directly
|
|
129
|
+
- No longer attempts to process binary files as Handlebars templates
|
|
130
|
+
- Fixes "IHDR" error when copying image files
|
|
131
|
+
|
|
132
|
+
## [0.2.0] - 2025-02-09
|
|
133
|
+
|
|
134
|
+
### Changed
|
|
135
|
+
|
|
136
|
+
- **Template System Refactor**:
|
|
137
|
+
- All generators now use template files instead of dynamic generation
|
|
138
|
+
- Handlebars templating with conditional logic
|
|
139
|
+
- Dynamic configuration support (projectName, projectType, tooling options)
|
|
140
|
+
- Clean separation between generators and templates
|
|
141
|
+
- **Template Structure**:
|
|
142
|
+
- Backend templates: Elysia, FastAPI with full project structures
|
|
143
|
+
- Frontend templates: Astro, Svelte, Next.js with proper configs
|
|
144
|
+
- All templates use Handlebars variables for customization
|
|
145
|
+
- **Helper Functions**:
|
|
146
|
+
- `eq` helper for equality checks in templates
|
|
147
|
+
- `or` helper for OR conditions in templates
|
|
148
|
+
- `copyTemplate` function for template copying and rendering
|
|
149
|
+
- **ESLint Configuration**:
|
|
150
|
+
- Added `.eslintignore` to exclude template folder
|
|
151
|
+
- Prevents false positives from Handlebars syntax in templates
|
|
152
|
+
|
|
153
|
+
## [0.1.0] - 2025-02-09
|
|
154
|
+
|
|
155
|
+
### Added
|
|
156
|
+
|
|
157
|
+
- **Initial Release**: Complete project generator CLI
|
|
158
|
+
- Interactive prompts using @clack/prompts
|
|
159
|
+
- Multiple backend frameworks (Elysia, FastAPI)
|
|
160
|
+
- Multiple frontend frameworks (Astro, Svelte, Next.js)
|
|
161
|
+
- Monorepo and single project support
|
|
162
|
+
- Configurable tooling (TypeScript, ESLint, Prettier)
|
|
163
|
+
- CSS framework options (Tailwind, SCSS, CSS Modules)
|
|
164
|
+
- UI component library support (shadcn/ui, Radix UI)
|
|
165
|
+
- Testing framework options (Vitest, Playwright)
|
|
166
|
+
- Multiple package manager support (npm, yarn, pnpm, bun)
|
|
167
|
+
- **Project Structure**:
|
|
168
|
+
- Well-organized codebase with generators, templates, and utilities
|
|
169
|
+
- TypeScript path aliases configured (@/\*)
|
|
170
|
+
- Comprehensive documentation (AGENTS.md, CHANGELOG.md, README.md)
|
|
171
|
+
- **Configuration**:
|
|
172
|
+
- TypeScript strict mode enabled
|
|
173
|
+
- Module resolution set to bundler
|
|
174
|
+
- Path aliases for clean imports
|
|
175
|
+
- **Dependencies Updated**:
|
|
176
|
+
- @clack/prompts: ^0.7.0 → ^1.0.0
|
|
177
|
+
- commander: ^12.0.0 → ^14.0.3
|
|
178
|
+
- fs-extra: ^11.2.0 → ^11.3.3
|
|
179
|
+
- handlebars: ^4.7.8 (unchanged)
|
|
180
|
+
- picocolors: ^1.0.0 → ^1.1.1
|
|
181
|
+
- tsx: ^4.7.0 → ^4.19.2
|
|
182
|
+
- typescript: ^5.3.0 → ^5.7.3
|
|
183
|
+
- @types/fs-extra: ^11.0.4 (unchanged)
|
|
184
|
+
- @types/node: ^20.11.0 (kept for Node 20 compatibility)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DotJumpDot
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<h1>Phos ✨</h1>
|
|
4
|
+
|
|
5
|
+
Full-stack interactive project generator CLI
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/phos)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](http://makeapullrequest.com)
|
|
11
|
+
|
|
12
|
+
**Version 1.0.0 - Production Release** 🎉
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## About
|
|
19
|
+
|
|
20
|
+
Phos is a powerful CLI tool that scaffolds modern full-stack web applications with configurable backends and frontends. Get started in seconds with interactive prompts and pre-configured templates.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- ✨ Interactive CLI with beautiful prompts
|
|
25
|
+
- 🚀 Multiple backend frameworks (Elysia, FastAPI)
|
|
26
|
+
- 🎨 Multiple frontend frameworks (Astro, Svelte, Next.js)
|
|
27
|
+
- 📦 Monorepo support with workspace configuration
|
|
28
|
+
- 🛠️ Configurable tooling (TypeScript, ESLint, Prettier)
|
|
29
|
+
- 🎨 CSS framework options (Tailwind, SCSS, CSS Modules)
|
|
30
|
+
- 🧩 UI component library support (shadcn/ui, Radix UI)
|
|
31
|
+
- 🧪 Testing framework options (Vitest, Playwright)
|
|
32
|
+
- 🔤 Multiple package manager support (npm, yarn, pnpm, bun)
|
|
33
|
+
- 📝 Automatic README generation
|
|
34
|
+
- 🌳 Git initialization
|
|
35
|
+
- 🎯 Single project mode for standalone applications
|
|
36
|
+
- 📚 Comprehensive documentation auto-generation
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
bun create phos
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Follow the interactive prompts to configure your project, and Phos will generate a production-ready scaffold in seconds.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
### From NPM
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bun create phos
|
|
52
|
+
npm create phos
|
|
53
|
+
yarn create phos
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Local Development
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone <repository-url>
|
|
60
|
+
cd phos
|
|
61
|
+
bun install
|
|
62
|
+
bun link
|
|
63
|
+
phos create
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
phos create
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Phos will guide you through a series of questions to configure your project:
|
|
73
|
+
|
|
74
|
+
1. **Project Name** - Name of your new project
|
|
75
|
+
2. **Project Type** - Monorepo or Single repo
|
|
76
|
+
3. **Backend Framework** - Elysia or FastAPI (Monorepo mode)
|
|
77
|
+
4. **Backend Package Manager** - npm, yarn, pnpm, bun, venv, or pip
|
|
78
|
+
5. **Backend: Use TypeScript?** - Enable TypeScript for backend
|
|
79
|
+
6. **Backend: Add ESLint?** - Add ESLint configuration
|
|
80
|
+
7. **Backend: Add Prettier?** - Add Prettier configuration
|
|
81
|
+
8. **Frontend Framework** - Astro, Svelte, or Next.js
|
|
82
|
+
9. **Frontend Package Manager** - npm, yarn, pnpm, or bun
|
|
83
|
+
10. **Frontend: Use TypeScript?** - Enable TypeScript for frontend
|
|
84
|
+
11. **Frontend: Add ESLint?** - Add ESLint configuration
|
|
85
|
+
12. **Frontend: Add Prettier?** - Add Prettier configuration
|
|
86
|
+
13. **Select CSS Framework** - No, Tailwind CSS, SCSS, or CSS Modules
|
|
87
|
+
14. **Add UI Components?** - No, shadcn/ui, or Radix UI
|
|
88
|
+
15. **Add Testing?** - No, Vitest, Playwright, or both
|
|
89
|
+
16. **Initialize Git?** - Initialize a Git repository
|
|
90
|
+
17. **Install Dependencies?** - Auto-install dependencies after generation
|
|
91
|
+
|
|
92
|
+
## Project Types
|
|
93
|
+
|
|
94
|
+
### Monorepo Mode
|
|
95
|
+
|
|
96
|
+
Generates a full-stack monorepo with separate backend and frontend projects:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
my-project/
|
|
100
|
+
├── MyProject_Backend/ # Backend application
|
|
101
|
+
├── MyProject_Frontend/ # Frontend application
|
|
102
|
+
├── Docs/ # Documentation folder
|
|
103
|
+
│ ├── Feature/ # Feature documentation
|
|
104
|
+
│ └── DatabaseSetup/ # Database setup scripts
|
|
105
|
+
├── AGENTS.md # Agent guidelines
|
|
106
|
+
├── LICENSE # License file
|
|
107
|
+
├── env.example # Environment variables template
|
|
108
|
+
└── README.md # Project README
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Single Project Mode
|
|
112
|
+
|
|
113
|
+
Generates a standalone backend or frontend project:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
my-project/
|
|
117
|
+
├── src/ # Source code
|
|
118
|
+
├── public/ # Static assets (frontend)
|
|
119
|
+
├── package.json # Dependencies
|
|
120
|
+
├── tsconfig.json # TypeScript config
|
|
121
|
+
└── README.md # Project documentation
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Tech Stack
|
|
125
|
+
|
|
126
|
+
### Core
|
|
127
|
+
|
|
128
|
+
- **Runtime**: Node.js + TypeScript
|
|
129
|
+
- **CLI Framework**: Commander.js
|
|
130
|
+
- **Interactive Prompts**: @clack/prompts
|
|
131
|
+
- **File Operations**: fs-extra
|
|
132
|
+
- **Template Engine**: Handlebars
|
|
133
|
+
- **Colors**: picocolors
|
|
134
|
+
|
|
135
|
+
### Supported Frameworks
|
|
136
|
+
|
|
137
|
+
#### Backend
|
|
138
|
+
|
|
139
|
+
| Framework | Runtime | Description |
|
|
140
|
+
| ---------------------------------------- | ------- | ---------------------------------- |
|
|
141
|
+
| [Elysia](https://elysiajs.com/) | Bun | Fast and elegant Bun web framework |
|
|
142
|
+
| [FastAPI](https://fastapi.tiangolo.com/) | Python | Modern Python web framework |
|
|
143
|
+
|
|
144
|
+
#### Frontend
|
|
145
|
+
|
|
146
|
+
| Framework | Description |
|
|
147
|
+
| ------------------------------------ | -------------------------------------- |
|
|
148
|
+
| [Astro](https://astro.build/) | Modern static site generator |
|
|
149
|
+
| [SvelteKit](https://kit.svelte.dev/) | Full-stack Svelte framework |
|
|
150
|
+
| [Next.js](https://nextjs.org/) | React framework with server components |
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Install dependencies
|
|
156
|
+
bun install
|
|
157
|
+
|
|
158
|
+
# Run in development mode
|
|
159
|
+
bun run dev create
|
|
160
|
+
|
|
161
|
+
# Build the project
|
|
162
|
+
bun run build
|
|
163
|
+
|
|
164
|
+
# Run the built CLI
|
|
165
|
+
node dist/cli.js create
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Examples
|
|
169
|
+
|
|
170
|
+
### Create a Monorepo with Elysia and Next.js
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
phos create
|
|
174
|
+
# Project name: my-awesome-app
|
|
175
|
+
# Project type: Monorepo
|
|
176
|
+
# Backend Framework: Elysia
|
|
177
|
+
# Backend package manager: bun
|
|
178
|
+
# Backend: Use TypeScript? Yes
|
|
179
|
+
# Backend: Add ESLint? Yes
|
|
180
|
+
# Backend: Add Prettier? Yes
|
|
181
|
+
# Frontend Framework: NextJS
|
|
182
|
+
# Frontend package manager: bun
|
|
183
|
+
# Frontend: Use TypeScript? Yes
|
|
184
|
+
# Frontend: Add ESLint? Yes
|
|
185
|
+
# Frontend: Add Prettier? Yes
|
|
186
|
+
# CSS Framework: Tailwind CSS
|
|
187
|
+
# UI Components: shadcn/ui
|
|
188
|
+
# Testing: Vitest + Playwright
|
|
189
|
+
# Initialize Git? Yes
|
|
190
|
+
# Install dependencies? No
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Create a Single Astro Project
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
phos create
|
|
197
|
+
# Project name: my-astro-site
|
|
198
|
+
# Project type: Single repo
|
|
199
|
+
# Framework: Astro
|
|
200
|
+
# Package manager: bun
|
|
201
|
+
# Use TypeScript? Yes
|
|
202
|
+
# Add ESLint? Yes
|
|
203
|
+
# Add Prettier? Yes
|
|
204
|
+
# CSS Framework: Tailwind CSS
|
|
205
|
+
# UI Components: No
|
|
206
|
+
# Testing: Vitest
|
|
207
|
+
# Initialize Git? Yes
|
|
208
|
+
# Install dependencies? No
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Generated Projects Include
|
|
212
|
+
|
|
213
|
+
### Backend (Elysia/FastAPI)
|
|
214
|
+
|
|
215
|
+
- Pre-configured framework setup
|
|
216
|
+
- Example API endpoints
|
|
217
|
+
- Service layer architecture
|
|
218
|
+
- Database connection setup
|
|
219
|
+
- TypeScript/Python type definitions
|
|
220
|
+
- ESLint/Pylint configuration
|
|
221
|
+
- Prettier/Black configuration
|
|
222
|
+
|
|
223
|
+
### Frontend (Astro/Svelte/Next.js)
|
|
224
|
+
|
|
225
|
+
- Pre-configured framework setup
|
|
226
|
+
- Example components and pages
|
|
227
|
+
- Responsive layout
|
|
228
|
+
- CSS framework integration
|
|
229
|
+
- TypeScript configuration
|
|
230
|
+
- ESLint configuration
|
|
231
|
+
- Prettier configuration
|
|
232
|
+
- Testing setup (Vitest/Playwright)
|
|
233
|
+
|
|
234
|
+
### Documentation
|
|
235
|
+
|
|
236
|
+
- Comprehensive README.md
|
|
237
|
+
- AGENTS.md with project guidelines
|
|
238
|
+
- Database schema documentation
|
|
239
|
+
- Feature documentation templates
|
|
240
|
+
- Environment variable templates
|
|
241
|
+
|
|
242
|
+
## Contributing
|
|
243
|
+
|
|
244
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
245
|
+
|
|
246
|
+
1. Fork the repository
|
|
247
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
248
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
249
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
250
|
+
5. Open a Pull Request
|
|
251
|
+
|
|
252
|
+
## Versioning
|
|
253
|
+
|
|
254
|
+
Phos follows [semantic versioning](https://semver.org/).
|
|
255
|
+
|
|
256
|
+
- **1.0.0** - Production release with full feature support
|
|
257
|
+
- **1.0.x** - Patch releases (bug fixes, documentation)
|
|
258
|
+
- **1.x.0** - Minor releases (new features, non-breaking changes)
|
|
259
|
+
- **x.0.0** - Major releases (breaking changes)
|
|
260
|
+
|
|
261
|
+
See [CHANGELOG.md](CHANGELOG.md) for detailed version history.
|
|
262
|
+
|
|
263
|
+
## Acknowledgments
|
|
264
|
+
|
|
265
|
+
- [Clack](https://github.com/natemoo-re/clack) - Beautiful CLI prompts
|
|
266
|
+
- [Commander.js](https://github.com/tj/commander.js) - CLI framework
|
|
267
|
+
- [Picocolors](https://github.com/alexeyraspopov/picocolors) - Tiny color library
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
[MIT](LICENSE)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
<div align="center">
|
|
276
|
+
|
|
277
|
+
Made with ❤️ by the DotJumpDot
|
|
278
|
+
|
|
279
|
+
</div>
|