render-create 0.1.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/README.md +207 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +45 -0
- package/dist/commands/check.d.ts +8 -0
- package/dist/commands/check.js +96 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.js +1201 -0
- package/dist/commands/sync.d.ts +8 -0
- package/dist/commands/sync.js +126 -0
- package/dist/types.d.ts +246 -0
- package/dist/types.js +4 -0
- package/dist/utils.d.ts +53 -0
- package/dist/utils.js +142 -0
- package/package.json +65 -0
- package/templates/LINTING_SETUP.md +205 -0
- package/templates/README_TEMPLATE.md +68 -0
- package/templates/STYLE_GUIDE.md +241 -0
- package/templates/assets/favicon.png +0 -0
- package/templates/assets/favicon.svg +17 -0
- package/templates/biome.json +43 -0
- package/templates/cursor/rules/drizzle.mdc +165 -0
- package/templates/cursor/rules/fastify.mdc +132 -0
- package/templates/cursor/rules/general.mdc +112 -0
- package/templates/cursor/rules/nextjs.mdc +89 -0
- package/templates/cursor/rules/python.mdc +89 -0
- package/templates/cursor/rules/react.mdc +200 -0
- package/templates/cursor/rules/sqlalchemy.mdc +205 -0
- package/templates/cursor/rules/tailwind.mdc +139 -0
- package/templates/cursor/rules/typescript.mdc +112 -0
- package/templates/cursor/rules/vite.mdc +169 -0
- package/templates/cursor/rules/workflows.mdc +349 -0
- package/templates/docker-compose.example.yml +55 -0
- package/templates/drizzle/db-index.ts +15 -0
- package/templates/drizzle/drizzle.config.ts +10 -0
- package/templates/drizzle/schema.ts +12 -0
- package/templates/env.example +15 -0
- package/templates/fastapi/app/__init__.py +1 -0
- package/templates/fastapi/app/config.py +12 -0
- package/templates/fastapi/app/database.py +16 -0
- package/templates/fastapi/app/models.py +13 -0
- package/templates/fastapi/main.py +22 -0
- package/templates/fastify/index.ts +40 -0
- package/templates/github/CODEOWNERS +10 -0
- package/templates/github/ISSUE_TEMPLATE/bug_report.md +39 -0
- package/templates/github/ISSUE_TEMPLATE/feature_request.md +23 -0
- package/templates/github/PULL_REQUEST_TEMPLATE.md +25 -0
- package/templates/gitignore/node.gitignore +41 -0
- package/templates/gitignore/python.gitignore +49 -0
- package/templates/multi-api/README.md +60 -0
- package/templates/multi-api/gitignore +28 -0
- package/templates/multi-api/node-api/drizzle.config.ts +10 -0
- package/templates/multi-api/node-api/package-simple.json +13 -0
- package/templates/multi-api/node-api/package.json +16 -0
- package/templates/multi-api/node-api/src/db/index.ts +13 -0
- package/templates/multi-api/node-api/src/db/schema.ts +9 -0
- package/templates/multi-api/node-api/src/index-simple.ts +36 -0
- package/templates/multi-api/node-api/src/index.ts +50 -0
- package/templates/multi-api/node-api/tsconfig.json +20 -0
- package/templates/multi-api/python-api/app/__init__.py +1 -0
- package/templates/multi-api/python-api/app/config.py +12 -0
- package/templates/multi-api/python-api/app/database.py +16 -0
- package/templates/multi-api/python-api/app/models.py +13 -0
- package/templates/multi-api/python-api/main-simple.py +25 -0
- package/templates/multi-api/python-api/main.py +44 -0
- package/templates/multi-api/python-api/requirements-simple.txt +3 -0
- package/templates/multi-api/python-api/requirements.txt +8 -0
- package/templates/next/globals.css +126 -0
- package/templates/next/layout.tsx +34 -0
- package/templates/next/next.config.static.ts +10 -0
- package/templates/next/page-fullstack.tsx +120 -0
- package/templates/next/page.tsx +72 -0
- package/templates/presets.json +581 -0
- package/templates/ruff.toml +30 -0
- package/templates/tsconfig.base.json +17 -0
- package/templates/vite/index.css +127 -0
- package/templates/vite/vite.config.ts +7 -0
- package/templates/worker/py/cron.py +53 -0
- package/templates/worker/py/worker.py +95 -0
- package/templates/worker/py/workflow.py +73 -0
- package/templates/worker/ts/cron.ts +49 -0
- package/templates/worker/ts/worker.ts +84 -0
- package/templates/worker/ts/workflow.ts +67 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Linting and formatting setup
|
|
2
|
+
|
|
3
|
+
Standard configuration for consistent code style across projects. Uses fast, Rust-based tools for both TypeScript and Python.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Language | Tool | Purpose |
|
|
8
|
+
|----------|------|---------|
|
|
9
|
+
| TypeScript | [Biome](https://biomejs.dev/) | Linting + formatting |
|
|
10
|
+
| Python | [Ruff](https://docs.astral.sh/ruff/) | Linting + formatting |
|
|
11
|
+
|
|
12
|
+
## TypeScript setup (Biome)
|
|
13
|
+
|
|
14
|
+
### 1. Create `biome.json` at project root
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
|
|
19
|
+
"linter": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"rules": {
|
|
22
|
+
"recommended": true,
|
|
23
|
+
"style": {
|
|
24
|
+
"noNonNullAssertion": "off"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"formatter": {
|
|
29
|
+
"enabled": true,
|
|
30
|
+
"indentStyle": "space",
|
|
31
|
+
"indentWidth": 2,
|
|
32
|
+
"lineWidth": 100
|
|
33
|
+
},
|
|
34
|
+
"javascript": {
|
|
35
|
+
"formatter": {
|
|
36
|
+
"quoteStyle": "double",
|
|
37
|
+
"semicolons": "always",
|
|
38
|
+
"trailingCommas": "all"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": {
|
|
42
|
+
"includes": ["src/**/*.ts", "src/**/*.tsx"]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Adjust `files.includes` based on your project structure.
|
|
48
|
+
|
|
49
|
+
### 2. Add Biome to each TypeScript package
|
|
50
|
+
|
|
51
|
+
In each `package.json`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"scripts": {
|
|
56
|
+
"lint": "biome lint src/",
|
|
57
|
+
"format": "biome format --write src/",
|
|
58
|
+
"check": "biome check --write src/"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@biomejs/biome": "^2.0.0"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 3. Install and run
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm install
|
|
70
|
+
npm run check
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Python setup (Ruff)
|
|
74
|
+
|
|
75
|
+
### 1. Create `ruff.toml` at project root
|
|
76
|
+
|
|
77
|
+
```toml
|
|
78
|
+
# Ruff configuration for Python linting and formatting
|
|
79
|
+
# https://docs.astral.sh/ruff/
|
|
80
|
+
|
|
81
|
+
line-length = 100
|
|
82
|
+
target-version = "py312"
|
|
83
|
+
|
|
84
|
+
[lint]
|
|
85
|
+
select = [
|
|
86
|
+
"E", # pycodestyle errors
|
|
87
|
+
"W", # pycodestyle warnings
|
|
88
|
+
"F", # Pyflakes
|
|
89
|
+
"I", # isort
|
|
90
|
+
"B", # flake8-bugbear
|
|
91
|
+
"C4", # flake8-comprehensions
|
|
92
|
+
"UP", # pyupgrade
|
|
93
|
+
"SIM", # flake8-simplify
|
|
94
|
+
]
|
|
95
|
+
ignore = [
|
|
96
|
+
"E501", # line too long (handled by formatter)
|
|
97
|
+
"B008", # do not perform function calls in argument defaults
|
|
98
|
+
"SIM108", # ternary operator (can reduce readability)
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
[lint.isort]
|
|
102
|
+
known-first-party = ["your-package-name"]
|
|
103
|
+
|
|
104
|
+
[format]
|
|
105
|
+
quote-style = "double"
|
|
106
|
+
indent-style = "space"
|
|
107
|
+
line-ending = "auto"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 2. Add Ruff to requirements
|
|
111
|
+
|
|
112
|
+
In each `requirements.txt`:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
ruff>=0.8.0
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 3. Run Ruff
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Check for issues
|
|
122
|
+
ruff check .
|
|
123
|
+
|
|
124
|
+
# Auto-fix issues
|
|
125
|
+
ruff check --fix .
|
|
126
|
+
|
|
127
|
+
# Format code
|
|
128
|
+
ruff format .
|
|
129
|
+
|
|
130
|
+
# Or run both
|
|
131
|
+
ruff check --fix . && ruff format .
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## What the tools enforce
|
|
135
|
+
|
|
136
|
+
| Category | Enforced | Examples |
|
|
137
|
+
|----------|----------|----------|
|
|
138
|
+
| Formatting | Yes | Indentation, quotes, semicolons, line length |
|
|
139
|
+
| Import sorting | Yes | Alphabetical, grouped by type |
|
|
140
|
+
| Unused code | Yes | Unused variables, unreachable code |
|
|
141
|
+
| Bug prevention | Yes | Type coercion issues, null checks |
|
|
142
|
+
| Comments | No | See [STYLE_GUIDE.md](./STYLE_GUIDE.md) |
|
|
143
|
+
| Function style | No | See [STYLE_GUIDE.md](./STYLE_GUIDE.md) |
|
|
144
|
+
| Code organization | No | See [STYLE_GUIDE.md](./STYLE_GUIDE.md) |
|
|
145
|
+
|
|
146
|
+
## Formatting defaults
|
|
147
|
+
|
|
148
|
+
| Setting | Value |
|
|
149
|
+
|---------|-------|
|
|
150
|
+
| Indentation | 2 spaces (TS), 4 spaces (Python) |
|
|
151
|
+
| Line length | 100 characters |
|
|
152
|
+
| Quotes | Double quotes |
|
|
153
|
+
| Semicolons | Always (TypeScript) |
|
|
154
|
+
| Trailing commas | Yes |
|
|
155
|
+
|
|
156
|
+
For code style conventions (comments, functions, naming, etc.), see **[STYLE_GUIDE.md](./STYLE_GUIDE.md)**.
|
|
157
|
+
|
|
158
|
+
## IDE integration
|
|
159
|
+
|
|
160
|
+
### VS Code
|
|
161
|
+
|
|
162
|
+
Install extensions:
|
|
163
|
+
- **Biome**: `biomejs.biome`
|
|
164
|
+
- **Ruff**: `charliermarsh.ruff`
|
|
165
|
+
|
|
166
|
+
Both extensions provide format-on-save and inline error highlighting.
|
|
167
|
+
|
|
168
|
+
### Cursor
|
|
169
|
+
|
|
170
|
+
Biome and Ruff extensions work the same as VS Code.
|
|
171
|
+
|
|
172
|
+
## CI integration (optional)
|
|
173
|
+
|
|
174
|
+
Add to your CI pipeline:
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
# TypeScript
|
|
178
|
+
- name: Lint TypeScript
|
|
179
|
+
run: npx @biomejs/biome check src/
|
|
180
|
+
|
|
181
|
+
# Python
|
|
182
|
+
- name: Lint Python
|
|
183
|
+
run: |
|
|
184
|
+
pip install ruff
|
|
185
|
+
ruff check .
|
|
186
|
+
ruff format --check .
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Migrating existing projects
|
|
190
|
+
|
|
191
|
+
1. Install the tools
|
|
192
|
+
2. Run with auto-fix enabled
|
|
193
|
+
3. Review changes
|
|
194
|
+
4. Commit
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# TypeScript
|
|
198
|
+
npm install @biomejs/biome --save-dev
|
|
199
|
+
npx @biomejs/biome check --write .
|
|
200
|
+
|
|
201
|
+
# Python
|
|
202
|
+
pip install ruff
|
|
203
|
+
ruff check --fix .
|
|
204
|
+
ruff format .
|
|
205
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
{{PROJECT_DESCRIPTION}}
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Clone the repository
|
|
9
|
+
git clone https://github.com/render-examples/{{PROJECT_NAME}}.git
|
|
10
|
+
cd {{PROJECT_NAME}}
|
|
11
|
+
|
|
12
|
+
# Install dependencies
|
|
13
|
+
npm install # or: pip install -r requirements.txt
|
|
14
|
+
|
|
15
|
+
# Set up environment
|
|
16
|
+
cp .env.example .env
|
|
17
|
+
# Edit .env with your values
|
|
18
|
+
|
|
19
|
+
# Run the application
|
|
20
|
+
npm run dev # or: python app.py
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Environment Variables
|
|
24
|
+
|
|
25
|
+
| Variable | Description | Required |
|
|
26
|
+
|----------|-------------|----------|
|
|
27
|
+
| `DATABASE_URL` | PostgreSQL connection string | Yes |
|
|
28
|
+
| `API_KEY` | External API key | Yes |
|
|
29
|
+
|
|
30
|
+
See `.env.example` for all variables.
|
|
31
|
+
|
|
32
|
+
## Project Structure
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
{{PROJECT_NAME}}/
|
|
36
|
+
├── src/ # Source code
|
|
37
|
+
├── tests/ # Test files
|
|
38
|
+
├── docs/ # Documentation
|
|
39
|
+
└── README.md
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Development
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Run in development mode
|
|
46
|
+
npm run dev
|
|
47
|
+
|
|
48
|
+
# Run tests
|
|
49
|
+
npm test
|
|
50
|
+
|
|
51
|
+
# Lint code
|
|
52
|
+
npm run lint
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Deployment
|
|
56
|
+
|
|
57
|
+
This project is configured for deployment on [Render](https://render.com).
|
|
58
|
+
|
|
59
|
+
[](https://render.com/deploy)
|
|
60
|
+
|
|
61
|
+
## Links
|
|
62
|
+
|
|
63
|
+
- [Render Docs](https://docs.render.com)
|
|
64
|
+
- [GitHub Repository](https://github.com/render-examples/{{PROJECT_NAME}})
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Code Style Guide
|
|
2
|
+
|
|
3
|
+
Style conventions for projects. These patterns are **not enforced by tooling** and must be followed manually.
|
|
4
|
+
|
|
5
|
+
For automated linting/formatting setup, see [LINTING_SETUP.md](./LINTING_SETUP.md).
|
|
6
|
+
|
|
7
|
+
## Functions
|
|
8
|
+
|
|
9
|
+
### TypeScript: Use named functions for exports
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// Good
|
|
13
|
+
export function handleRequest(req: Request): Response {
|
|
14
|
+
// ...
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function fetchUserData(userId: string): Promise<User> {
|
|
18
|
+
// ...
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Avoid
|
|
22
|
+
export const handleRequest = (req: Request): Response => {
|
|
23
|
+
// ...
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Arrow functions are fine for:
|
|
28
|
+
- Callbacks: `items.map((item) => item.id)`
|
|
29
|
+
- Simple internal helpers: `const clean = (s: string) => s.trim()`
|
|
30
|
+
|
|
31
|
+
### Python: Use regular function definitions
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
# Good
|
|
35
|
+
def handle_request(request: Request) -> Response:
|
|
36
|
+
...
|
|
37
|
+
|
|
38
|
+
async def fetch_user_data(user_id: str) -> User:
|
|
39
|
+
...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Comments and documentation
|
|
43
|
+
|
|
44
|
+
### When to add comments
|
|
45
|
+
|
|
46
|
+
Add comments **liberally to help future readers**, but focus on explaining context and reasoning rather than restating code.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Good: Explains WHY
|
|
50
|
+
const timeout = 30000; // Extended timeout for slow upstream API
|
|
51
|
+
|
|
52
|
+
// Good: Provides context
|
|
53
|
+
// pMap limits concurrency to avoid overwhelming the API
|
|
54
|
+
const results = await pMap(items, processItem, { concurrency: 5 });
|
|
55
|
+
|
|
56
|
+
// Avoid: Restates the code
|
|
57
|
+
const timeout = 30000; // Set timeout to 30000
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### JSDoc / Docstrings
|
|
61
|
+
|
|
62
|
+
Add documentation **when behavior is non-obvious**. Self-explanatory functions don't need docs.
|
|
63
|
+
|
|
64
|
+
**TypeScript:**
|
|
65
|
+
```typescript
|
|
66
|
+
// Needs doc: Non-obvious behavior
|
|
67
|
+
/** Fetches title, trying og:title, twitter:title, then <title> tag. */
|
|
68
|
+
export function fetchBlogTitle(url: string): Promise<string> {
|
|
69
|
+
// ...
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// No doc needed: Self-explanatory
|
|
73
|
+
export function getHealthStatus(): HealthStatus {
|
|
74
|
+
return { status: "ok" };
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Python:**
|
|
79
|
+
```python
|
|
80
|
+
# Needs doc: Non-obvious behavior
|
|
81
|
+
def fetch_blog_title(url: str) -> str:
|
|
82
|
+
"""Fetch title, trying og:title, twitter:title, then <title> tag."""
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
# No doc needed: Self-explanatory
|
|
86
|
+
def get_health_status() -> dict:
|
|
87
|
+
return {"status": "ok"}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### File headers
|
|
91
|
+
|
|
92
|
+
Add a header comment **only to main entry files** (`index.ts`, `app.py`, `main.py`):
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
/**
|
|
96
|
+
* Project Name API
|
|
97
|
+
* Entry point: server setup, middleware, and routes.
|
|
98
|
+
*/
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
"""
|
|
103
|
+
Project Name API
|
|
104
|
+
Entry point: server setup, middleware, and routes.
|
|
105
|
+
"""
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Other files should have self-explanatory names (e.g., `storage.ts`, `handlers.py`).
|
|
109
|
+
|
|
110
|
+
## Error handling
|
|
111
|
+
|
|
112
|
+
Use **both patterns** depending on context:
|
|
113
|
+
|
|
114
|
+
### Early return for validation
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
export function processRequest(data: unknown): Result {
|
|
118
|
+
if (!data) {
|
|
119
|
+
return { error: "Data is required" };
|
|
120
|
+
}
|
|
121
|
+
if (!isValid(data)) {
|
|
122
|
+
return { error: "Invalid data format" };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Main logic here
|
|
126
|
+
return { success: true, result: transform(data) };
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Try-catch for external operations
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
export async function fetchData(url: string): Promise<Data> {
|
|
134
|
+
try {
|
|
135
|
+
const response = await fetch(url);
|
|
136
|
+
if (!response.ok) {
|
|
137
|
+
throw new Error(`HTTP ${response.status}`);
|
|
138
|
+
}
|
|
139
|
+
return await response.json();
|
|
140
|
+
} catch (error) {
|
|
141
|
+
logFullError("Fetch failed", error);
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Async code
|
|
148
|
+
|
|
149
|
+
### Always use async/await
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
// Good
|
|
153
|
+
async function fetchAndProcess(url: string): Promise<Result> {
|
|
154
|
+
const response = await fetch(url);
|
|
155
|
+
const data = await response.json();
|
|
156
|
+
return processData(data);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Avoid
|
|
160
|
+
function fetchAndProcess(url: string): Promise<Result> {
|
|
161
|
+
return fetch(url)
|
|
162
|
+
.then((response) => response.json())
|
|
163
|
+
.then((data) => processData(data));
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Logging
|
|
168
|
+
|
|
169
|
+
### Use prefixed log messages
|
|
170
|
+
|
|
171
|
+
Include the module/component name in brackets:
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
console.log("[API] Starting server on port 8080");
|
|
175
|
+
console.log("[storage] Creating bucket: thumbnails");
|
|
176
|
+
console.error("[handler] Failed to process request:", error);
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
print("[API] Starting server on port 8080")
|
|
181
|
+
print("[storage] Creating bucket: thumbnails")
|
|
182
|
+
print(f"[handler] Failed to process request: {error}")
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Naming
|
|
186
|
+
|
|
187
|
+
### Balanced verbosity
|
|
188
|
+
|
|
189
|
+
Names should be clear but not excessively long:
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
// Good: Balanced
|
|
193
|
+
const accountStatus = getAccountStatus();
|
|
194
|
+
const blogTitle = await fetchBlogTitle(url);
|
|
195
|
+
const taskResult = await runTask(input);
|
|
196
|
+
|
|
197
|
+
// Too verbose
|
|
198
|
+
const userAccountStatusFromDatabase = getUserAccountStatusFromDatabase();
|
|
199
|
+
|
|
200
|
+
// Too terse
|
|
201
|
+
const s = getStatus();
|
|
202
|
+
const t = fetchTitle(u);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Conventions by language
|
|
206
|
+
|
|
207
|
+
**TypeScript:**
|
|
208
|
+
- Variables/functions: `camelCase`
|
|
209
|
+
- Types/interfaces/classes: `PascalCase`
|
|
210
|
+
- Constants: `SCREAMING_SNAKE_CASE`
|
|
211
|
+
|
|
212
|
+
**Python:**
|
|
213
|
+
- Variables/functions: `snake_case`
|
|
214
|
+
- Classes: `PascalCase`
|
|
215
|
+
- Constants: `SCREAMING_SNAKE_CASE`
|
|
216
|
+
|
|
217
|
+
## Imports
|
|
218
|
+
|
|
219
|
+
Let **Biome (TypeScript)** and **Ruff (Python)** handle import organization automatically. Run:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# TypeScript
|
|
223
|
+
npm run check
|
|
224
|
+
|
|
225
|
+
# Python
|
|
226
|
+
ruff check --fix . && ruff format .
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Summary
|
|
230
|
+
|
|
231
|
+
| Aspect | Convention |
|
|
232
|
+
|--------|------------|
|
|
233
|
+
| Functions | Named exports (TS), regular defs (Python) |
|
|
234
|
+
| Comments | Liberal, explain WHY and context |
|
|
235
|
+
| Docs | Only when non-obvious |
|
|
236
|
+
| File headers | Only entry files |
|
|
237
|
+
| Error handling | Early return + try-catch |
|
|
238
|
+
| Async | Always async/await |
|
|
239
|
+
| Logging | Prefixed: `[module] message` |
|
|
240
|
+
| Naming | Balanced verbosity |
|
|
241
|
+
| Imports | Let tooling handle |
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 800 800">
|
|
3
|
+
<!-- Generator: Adobe Illustrator 30.0.0, SVG Export Plug-In . SVG Version: 2.1.1 Build 123) -->
|
|
4
|
+
<defs>
|
|
5
|
+
<style>
|
|
6
|
+
.st0 {
|
|
7
|
+
fill: #fff;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.st1 {
|
|
11
|
+
fill: #8a05ff;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
</defs>
|
|
15
|
+
<rect class="st1" width="800" height="800"/>
|
|
16
|
+
<path class="st0" d="M654.17,263.04c-.07-1.7-.22-3.36-.37-5.06-.04-.41-.04-.85-.11-1.26-.11-1.03-.26-2.03-.41-3.07-.15-1.07-.26-2.11-.41-3.14-.11-.74-.26-1.48-.41-2.18-.22-1.29-.44-2.62-.7-3.91-.22-1.03-.48-2.03-.7-3.07-.22-1-.44-1.96-.66-2.95-.26-1.03-.59-2.03-.89-3.07-.26-.96-.52-1.88-.81-2.84-.33-1.03-.7-2.07-1.07-3.1-.3-.89-.59-1.77-.89-2.66-.48-1.29-1-2.55-1.48-3.8-.26-.63-.48-1.22-.74-1.85-.59-1.37-1.18-2.7-1.81-4.03-.22-.48-.44-1-.66-1.48-.59-1.26-1.26-2.47-1.88-3.69-.3-.55-.55-1.11-.85-1.66-.74-1.37-1.55-2.73-2.33-4.06-.22-.37-.41-.74-.63-1.11-.85-1.4-1.74-2.77-2.66-4.14-.19-.3-.37-.59-.56-.89-1.11-1.63-2.25-3.25-3.44-4.84-1.11-1.48-2.25-2.96-3.44-4.4-.07-.11-.15-.22-.26-.33-22.84-27.67-57.31-45.25-95.93-45.28v-.07l-.11.07h.04c-10.72,0-21.14,1.37-31.08,3.92-5.95,1.52-11.75,3.51-17.33,5.84-1.85.78-3.7,1.62-5.51,2.47-36.69,17.65-63.3,52.82-69.17,94.63h-.07c-2.59,17.91-8.09,34.87-15.93,50.46h.26c-27.27,54.07-83.29,91.2-148.03,91.2-28.9,0-56.02-7.39-79.67-20.35-2.77-1.52-6.13.48-6.13,3.62v16.73h-.26v248.47h248.62v-124.25h.26v-62.13c0-34.31,27.83-62.13,62.15-62.13h62.15c10.64,0,20.95-1.37,30.82-3.92,5.95-1.55,11.75-3.51,17.33-5.84,1.85-.78,3.7-1.62,5.51-2.47,38.02-18.32,65.3-55.44,69.77-99.29.41-4.17.63-8.42.63-12.71,0-2.14-.04-4.28-.15-6.39Z"/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": false,
|
|
3
|
+
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
|
|
4
|
+
"linter": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"rules": {
|
|
7
|
+
"recommended": true,
|
|
8
|
+
"style": {
|
|
9
|
+
"noNonNullAssertion": "off"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"formatter": {
|
|
14
|
+
"enabled": true,
|
|
15
|
+
"indentStyle": "space",
|
|
16
|
+
"indentWidth": 2,
|
|
17
|
+
"lineWidth": 100
|
|
18
|
+
},
|
|
19
|
+
"javascript": {
|
|
20
|
+
"formatter": {
|
|
21
|
+
"quoteStyle": "double",
|
|
22
|
+
"semicolons": "always",
|
|
23
|
+
"trailingCommas": "all"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"css": {
|
|
27
|
+
"formatter": {
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"indentStyle": "space",
|
|
30
|
+
"indentWidth": 2
|
|
31
|
+
},
|
|
32
|
+
"linter": {
|
|
33
|
+
"enabled": true
|
|
34
|
+
},
|
|
35
|
+
"parser": {
|
|
36
|
+
"cssModules": true,
|
|
37
|
+
"tailwindDirectives": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": {
|
|
41
|
+
"includes": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.css", "app/**/*.css"]
|
|
42
|
+
}
|
|
43
|
+
}
|