fossyl 0.1.6 → 0.9.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/CLAUDE.md +107 -0
- package/LICENSE +674 -0
- package/bin/fossyl.js +2 -0
- package/dist/index.d.mts +1 -203
- package/dist/index.d.ts +1 -203
- package/dist/index.js +1030 -75
- package/dist/index.mjs +1022 -66
- package/package.json +26 -24
- package/README.md +0 -101
- package/fossyl.svg +0 -2
- package/src/example.ts +0 -31
- package/src/index.ts +0 -22
- package/src/router/router.ts +0 -277
- package/src/router/tmp.sh +0 -15
- package/src/router/types/configuration.types.ts +0 -143
- package/src/router/types/params.types.ts +0 -13
- package/src/router/types/router-creation.types.ts +0 -36
- package/src/router/types/routes.types.ts +0 -124
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# fossyl CLI - AI Development Guide
|
|
2
|
+
|
|
3
|
+
**CLI for scaffolding fossyl projects**
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The `fossyl` CLI is an interactive project scaffolding tool that generates new fossyl API projects with your choice of adapters.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Use directly with npx (recommended)
|
|
13
|
+
npx fossyl --create my-api
|
|
14
|
+
|
|
15
|
+
# Or install globally
|
|
16
|
+
npm install -g fossyl
|
|
17
|
+
fossyl --create my-api
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Create a New Project
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx fossyl --create <project-name>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Interactive prompts will guide you through selecting:
|
|
29
|
+
|
|
30
|
+
1. **Server adapter**: Express (recommended) | Bring Your Own
|
|
31
|
+
2. **Validation library**: Zod (recommended) | Bring Your Own
|
|
32
|
+
3. **Database adapter**: Kysely (recommended) | Bring Your Own
|
|
33
|
+
|
|
34
|
+
### CLI Options
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx fossyl --create <name> # Create new project
|
|
38
|
+
npx fossyl --help # Show help
|
|
39
|
+
npx fossyl --version # Show version
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Examples
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Create a new project named "my-api"
|
|
46
|
+
npx fossyl --create my-api
|
|
47
|
+
|
|
48
|
+
# Create a new project in the current directory
|
|
49
|
+
npx fossyl --create .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Generated Project Structure
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
<project-name>/
|
|
56
|
+
├── src/
|
|
57
|
+
│ ├── features/
|
|
58
|
+
│ │ └── ping/
|
|
59
|
+
│ │ ├── routes/ping.route.ts # All 4 route types demonstrated
|
|
60
|
+
│ │ ├── services/ping.service.ts # Business logic
|
|
61
|
+
│ │ ├── validators/ # Request validators
|
|
62
|
+
│ │ └── repo/ping.repo.ts # Database access
|
|
63
|
+
│ ├── migrations/
|
|
64
|
+
│ │ ├── index.ts # Migration registry
|
|
65
|
+
│ │ └── 001_create_ping.ts # Example migration
|
|
66
|
+
│ ├── types/
|
|
67
|
+
│ │ └── db.ts # DB type definitions
|
|
68
|
+
│ ├── db.ts # Database setup
|
|
69
|
+
│ └── index.ts # Main entry point
|
|
70
|
+
├── package.json
|
|
71
|
+
├── tsconfig.json
|
|
72
|
+
├── .env.example
|
|
73
|
+
└── CLAUDE.md
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## BYO (Bring Your Own) Mode
|
|
77
|
+
|
|
78
|
+
When selecting BYO for any adapter, the CLI generates placeholder files with:
|
|
79
|
+
|
|
80
|
+
- TODO comments explaining what needs to be implemented
|
|
81
|
+
- Links to reference implementations in the fossyl monorepo
|
|
82
|
+
- Example code snippets for common patterns
|
|
83
|
+
|
|
84
|
+
## Available Adapters
|
|
85
|
+
|
|
86
|
+
| Adapter | Package | Description |
|
|
87
|
+
|---------|---------|-------------|
|
|
88
|
+
| Express | `@fossyl/express` | Express.js runtime adapter |
|
|
89
|
+
| Zod | `@fossyl/zod` | Zod validation adapter |
|
|
90
|
+
| Kysely | `@fossyl/kysely` | Kysely database adapter |
|
|
91
|
+
|
|
92
|
+
## Package Source
|
|
93
|
+
|
|
94
|
+
This package is part of the fossyl monorepo:
|
|
95
|
+
- Source: `packages/cli/`
|
|
96
|
+
- Repository: https://github.com/YoyoSaur/fossyl
|
|
97
|
+
|
|
98
|
+
## Development
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Build the CLI
|
|
102
|
+
pnpm --filter fossyl build
|
|
103
|
+
|
|
104
|
+
# Test locally
|
|
105
|
+
node packages/cli/bin/fossyl.js --help
|
|
106
|
+
node packages/cli/bin/fossyl.js --create /tmp/test-app
|
|
107
|
+
```
|